Changeset 3470148
- Timestamp:
- 02/26/2026 10:25:28 AM (5 weeks ago)
- Location:
- ecomm-reels
- Files:
-
- 8 edited
- 1 copied
-
tags/4.1.8 (copied) (copied from ecomm-reels/trunk)
-
tags/4.1.8/CHANGELOG.md (modified) (1 diff)
-
tags/4.1.8/build/index.js (modified) (26 diffs)
-
tags/4.1.8/ecomm-reels.php (modified) (2 diffs)
-
tags/4.1.8/readme.txt (modified) (2 diffs)
-
trunk/CHANGELOG.md (modified) (1 diff)
-
trunk/build/index.js (modified) (26 diffs)
-
trunk/ecomm-reels.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ecomm-reels/tags/4.1.8/CHANGELOG.md
r3469230 r3470148 1 1 # Changelog 2 3 ## [4.1.8](https://github.com/dstudio-asia/reels-wp/compare/v4.1.7...v4.1.8) (2026-02-26) 4 5 6 ### Features 7 8 * add Rate Us link in admin header ([3f4e194](https://github.com/dstudio-asia/reels-wp/commit/3f4e194e947aeccdb705cc6c2266752e54a4fe02)) 9 * add Rate Us link in admin header ([2786b1f](https://github.com/dstudio-asia/reels-wp/commit/2786b1fd8b0237ea16371b97f9b63912c8e9cb21)) 2 10 3 11 ## [4.1.7](https://github.com/dstudio-asia/reels-wp/compare/v4.1.6...v4.1.7) (2026-02-25) -
ecomm-reels/tags/4.1.8/build/index.js
r3469230 r3470148 1 1 (function(_,wa,Ln,ja){"use strict";var ka=document.createElement("style");ka.textContent=`:root{--color-primary: #2563eb;--color-primary-foreground: #ffffff;--color-secondary: #e5e7eb;--color-secondary-foreground: #111827;--color-foreground: #111827;--color-muted: #f3f4f6;--color-muted-foreground: #6b7280;--color-accent: #f3f4f6;--color-border: #e5e7eb;--color-ring: #60a5fa}#ecommreels-admin-app,.ecommreels-short-code,.reelswp-group-short-code,.reelswp-reel-short-code{box-sizing:border-box;color:var(--color-foreground, #111);font-family:Inter,Segoe UI,system-ui,-apple-system,sans-serif}#ecommreels-admin-app *,#ecommreels-admin-app *:before,#ecommreels-admin-app *:after,.ecommreels-short-code *,.ecommreels-short-code *:before,.ecommreels-short-code *:after,.reelswp-group-short-code *,.reelswp-group-short-code *:before,.reelswp-group-short-code *:after,.reelswp-reel-short-code *,.reelswp-reel-short-code *:before,.reelswp-reel-short-code *:after{box-sizing:inherit}#ecommreels-admin-app input,#ecommreels-admin-app select,#ecommreels-admin-app textarea,.ecommreels-short-code input,.ecommreels-short-code select,.ecommreels-short-code textarea,.reelswp-group-short-code input,.reelswp-group-short-code select,.reelswp-group-short-code textarea,.reelswp-reel-short-code input,.reelswp-reel-short-code select,.reelswp-reel-short-code textarea{font:inherit;color:inherit}#ecommreels-admin-app button,.ecommreels-short-code button,.reelswp-group-short-code button,.reelswp-reel-short-code button{border:none}#ecommreels-admin-app input[type=checkbox],#ecommreels-admin-app input[type=radio],.ecommreels-short-code input[type=checkbox],.ecommreels-short-code input[type=radio],.reelswp-group-short-code input[type=checkbox],.reelswp-group-short-code input[type=radio],.reelswp-reel-short-code input[type=checkbox],.reelswp-reel-short-code input[type=radio]{margin:0}#ecommreels-admin-app input[type=number]::-webkit-inner-spin-button,#ecommreels-admin-app input[type=number]::-webkit-outer-spin-button,.ecommreels-short-code input[type=number]::-webkit-inner-spin-button,.ecommreels-short-code input[type=number]::-webkit-outer-spin-button,.reelswp-group-short-code input[type=number]::-webkit-inner-spin-button,.reelswp-group-short-code input[type=number]::-webkit-outer-spin-button,.reelswp-reel-short-code input[type=number]::-webkit-inner-spin-button,.reelswp-reel-short-code input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}#ecommreels-admin-app input[type=number],.ecommreels-short-code input[type=number],.reelswp-group-short-code input[type=number],.reelswp-reel-short-code input[type=number]{-moz-appearance:textfield}#ecommreels-admin-app input,.ecommreels-short-code input,.reelswp-group-short-code input,.reelswp-reel-short-code input{min-height:auto}#ecommreels-admin-app img,.ecommreels-short-code img,.reelswp-group-short-code img,.reelswp-reel-short-code img{max-width:100%;display:block}#ecommreels-admin-app h1,#ecommreels-admin-app h2,#ecommreels-admin-app h3,#ecommreels-admin-app h4,#ecommreels-admin-app h5,#ecommreels-admin-app h6,.ecommreels-short-code h1,.ecommreels-short-code h2,.ecommreels-short-code h3,.ecommreels-short-code h4,.ecommreels-short-code h5,.ecommreels-short-code h6,.reelswp-group-short-code h1,.reelswp-group-short-code h2,.reelswp-group-short-code h3,.reelswp-group-short-code h4,.reelswp-group-short-code h5,.reelswp-group-short-code h6,.reelswp-reel-short-code h1,.reelswp-reel-short-code h2,.reelswp-reel-short-code h3,.reelswp-reel-short-code h4,.reelswp-reel-short-code h5,.reelswp-reel-short-code h6{margin:0;font-weight:600}#ecommreels-admin-app p,.ecommreels-short-code p,.reelswp-group-short-code p,.reelswp-reel-short-code p{margin:0}#ecommreels-admin-app .ecr-admin-panel{position:relative;margin:24px;min-height:50vh;border-radius:6px;border:1px solid #d1d5db;background:#fff;padding:16px}#ecommreels-admin-app .ecr-admin-panel--reels{padding:16px}#ecommreels-admin-app .ecr-button{display:inline-flex;align-items:center;justify-content:center;gap:8px;border:1px solid transparent;border-radius:6px;font-size:14px;font-weight:600;line-height:1;padding:8px 16px;background:#111;color:#fff;cursor:pointer;transition:background-color .2s ease,border-color .2s ease,color .2s ease,box-shadow .2s ease,transform .2s ease}#ecommreels-admin-app .ecr-button:disabled{opacity:.6;cursor:not-allowed}#ecommreels-admin-app .ecr-button--primary{background:#2563eb;color:#fff}#ecommreels-admin-app .ecr-button--primary:hover{background:#1f29371a}#ecommreels-admin-app .ecr-button--secondary{background:#e5e7eb;color:#111827}#ecommreels-admin-app .ecr-button--secondary:hover{background:#e5e7eb1a}#ecommreels-admin-app .ecr-button--outline{background:transparent;border-color:#2563eb;color:#2563eb}#ecommreels-admin-app .ecr-button--outline:hover{background:#2563eb1a}#ecommreels-admin-app .ecr-button--outline-danger{background:transparent;border-color:#dc2626;color:#dc2626}#ecommreels-admin-app .ecr-button--outline-danger:hover{background:#dc26261a}#ecommreels-admin-app .ecr-button--ghost{background:transparent;color:#111827}#ecommreels-admin-app .ecr-button--ghost:hover{background:#f3f4f6}#ecommreels-admin-app .ecr-button--link{background:none;border-color:transparent;padding:0;color:#2563eb;text-decoration:none}#ecommreels-admin-app .ecr-button--link:hover{text-decoration:underline}#ecommreels-admin-app .ecr-button--danger{background:#dc2626;color:#fff}#ecommreels-admin-app .ecr-button--danger:hover{background:#b91c1c}#ecommreels-admin-app .ecr-button--sm{height:32px;padding:0 12px;font-size:13px}#ecommreels-admin-app .ecr-button--md{height:36px;padding:0 16px}#ecommreels-admin-app .ecr-button--lg{height:40px;padding:0 20px;font-size:15px}#ecommreels-admin-app .ecr-button--icon,#ecommreels-admin-app .ecr-button--icon-sm,#ecommreels-admin-app .ecr-button--icon-lg{padding:0;width:36px;height:36px}#ecommreels-admin-app .ecr-button--icon-sm{width:32px;height:32px}#ecommreels-admin-app .ecr-button--icon-lg{width:40px;height:40px}#ecommreels-admin-app .ecr-admin-reels-header{margin-bottom:16px;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px}#ecommreels-admin-app .ecr-admin-reels-header__left{display:flex;align-items:center;gap:32px}#ecommreels-admin-app .ecr-admin-reels-header__right{display:flex;flex-wrap:wrap;align-items:center;gap:16px}#ecommreels-admin-app .ecr-admin-reels-header__title{margin:0;padding:6px 0;font-size:20px;font-weight:700}#ecommreels-admin-app .ecr-admin-reels-header__actions{display:flex;align-items:center;gap:16px}#ecommreels-admin-app .ecr-admin-reels-header__action{padding:0;font-weight:600;background:none;border:none;box-shadow:none}#ecommreels-admin-app .ecr-admin-reels-header__action--primary{color:#2563eb}#ecommreels-admin-app .ecr-admin-reels-header__action--danger{color:#ef4444}#ecommreels-admin-app .ecr-admin-reels-header__search{position:relative;width:100%}@media(min-width:640px){#ecommreels-admin-app .ecr-admin-reels-header__search{width:280px}}#ecommreels-admin-app .ecr-admin-search-input{width:100%;padding:8px 16px;border-radius:6px;border:1px solid #e5e7eb;background:#fff;font-size:14px;line-height:1.4}#ecommreels-admin-app .ecr-admin-search-input:focus{outline:none;box-shadow:none;border-color:#cbd5f5}#ecommreels-admin-app .ecr-admin-reels-header__icon-wrapper{position:absolute;top:50%;right:8px;transform:translateY(-50%);width:fit-content;height:20px;display:flex;align-items:center}#ecommreels-admin-app .ecr-admin-reels-header__search-icon{color:#d1d5db;flex-shrink:0}#ecommreels-admin-app .ecr-admin-reels-header__clear-icon{color:#f50808;flex-shrink:0}#ecommreels-admin-app .ecr-admin-reels-header__create{border:1px solid #3b82f6;background:#fff;color:#3b82f6}#ecommreels-admin-app .ecr-admin-reels-header__create:hover{background:#ffffffe6}#ecommreels-admin-app .ecr-admin-reels-header__spinner{animation:ecr-reels-spin 1s linear infinite}@keyframes ecr-reels-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-admin-reels-empty{display:flex;align-items:center;justify-content:center;padding-top:50px}#ecommreels-admin-app .ecr-admin-reels-empty__text{margin:0;display:flex;width:320px;flex-direction:column;align-items:center;gap:8px;text-align:center;font-size:14px}#ecommreels-admin-app .ecr-admin-reels-loading{display:flex;align-items:center;justify-content:center;padding:16px 0}#ecommreels-admin-app .ecr-admin-reels-loading--fullscreen{position:absolute;inset:0}#ecommreels-admin-app .ecr-admin-reels-loading__icon{width:48px;height:48px;color:#3b82f6;animation:ecr-reels-loading-spin 1s linear infinite}@keyframes ecr-reels-loading-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-player__progress,.ecommreels-short-code .ecr-player__progress,.reelswp-group-short-code .ecr-player__progress,.reelswp-reel-short-code .ecr-player__progress{position:absolute;top:4px;left:50%;z-index:2;display:flex;width:90%;transform:translate(-50%);gap:4px;overflow:hidden;border-radius:999px}#ecommreels-admin-app .ecr-player__progress-track,.ecommreels-short-code .ecr-player__progress-track,.reelswp-group-short-code .ecr-player__progress-track,.reelswp-reel-short-code .ecr-player__progress-track{width:100%;height:3px;background:#ffffff80;border-radius:999px}#ecommreels-admin-app .ecr-player__progress-fill,.ecommreels-short-code .ecr-player__progress-fill,.reelswp-group-short-code .ecr-player__progress-fill,.reelswp-reel-short-code .ecr-player__progress-fill{height:3px;background:#fff;border-radius:999px;width:0}#ecommreels-admin-app .ecr-player__progress-fill--active,.ecommreels-short-code .ecr-player__progress-fill--active,.reelswp-group-short-code .ecr-player__progress-fill--active,.reelswp-reel-short-code .ecr-player__progress-fill--active{animation:ecr-progress var(--reels-wp-animation-time) linear forwards}#ecommreels-admin-app .ecr-player__progress-fill--complete,.ecommreels-short-code .ecr-player__progress-fill--complete,.reelswp-group-short-code .ecr-player__progress-fill--complete,.reelswp-reel-short-code .ecr-player__progress-fill--complete{width:100%}#ecommreels-admin-app .ecr-player__progress-fill--empty,.ecommreels-short-code .ecr-player__progress-fill--empty,.reelswp-group-short-code .ecr-player__progress-fill--empty,.reelswp-reel-short-code .ecr-player__progress-fill--empty{width:0}@keyframes ecr-progress{0%{width:0}to{width:100%}}#ecommreels-admin-app .ecr-player__nav,.ecommreels-short-code .ecr-player__nav,.reelswp-group-short-code .ecr-player__nav,.reelswp-reel-short-code .ecr-player__nav{position:absolute;top:50%;z-index:5;display:none;width:40px;height:40px;padding:0;transform:translateY(-50%);border:none;border-radius:999px;background:#ffffffd9;color:#374151;cursor:pointer;align-items:center;justify-content:center;transition:scale .3s ease}:is(#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):active{scale:.95}@media(min-width:1024px){#ecommreels-admin-app .ecr-player__nav,.ecommreels-short-code .ecr-player__nav,.reelswp-group-short-code .ecr-player__nav,.reelswp-reel-short-code .ecr-player__nav{display:grid}}#ecommreels-admin-app .ecr-player__nav--left,.ecommreels-short-code .ecr-player__nav--left,.reelswp-group-short-code .ecr-player__nav--left,.reelswp-reel-short-code .ecr-player__nav--left{left:0;transform:translate(-120%,-50%)}#ecommreels-admin-app .ecr-player__nav--right,.ecommreels-short-code .ecr-player__nav--right,.reelswp-group-short-code .ecr-player__nav--right,.reelswp-reel-short-code .ecr-player__nav--right{right:0;transform:translate(120%,-50%)}#ecommreels-admin-app .ecr-player__nav:hover,.ecommreels-short-code .ecr-player__nav:hover,.reelswp-group-short-code .ecr-player__nav:hover,.reelswp-reel-short-code .ecr-player__nav:hover{background:#fff}#ecommreels-admin-app .ecr-player__media-frame,.ecommreels-short-code .ecr-player__media-frame,.reelswp-group-short-code .ecr-player__media-frame,.reelswp-reel-short-code .ecr-player__media-frame{position:relative;display:flex;width:100%;height:100%;align-items:center;justify-content:center;overflow:hidden;border-radius:16px}@media screen and (max-width:767.98px){#ecommreels-admin-app .ecr-player__media-frame,.ecommreels-short-code .ecr-player__media-frame,.reelswp-group-short-code .ecr-player__media-frame,.reelswp-reel-short-code .ecr-player__media-frame{border-radius:0}}#ecommreels-admin-app .ecr-player__media,.ecommreels-short-code .ecr-player__media,.reelswp-group-short-code .ecr-player__media,.reelswp-reel-short-code .ecr-player__media{width:100%;height:auto}#ecommreels-admin-app .ecr-player__media--portrait,.ecommreels-short-code .ecr-player__media--portrait,.reelswp-group-short-code .ecr-player__media--portrait,.reelswp-reel-short-code .ecr-player__media--portrait{width:100%;height:100%;object-fit:cover}#ecommreels-admin-app .ecr-player__media--auto,.ecommreels-short-code .ecr-player__media--auto,.reelswp-group-short-code .ecr-player__media--auto,.reelswp-reel-short-code .ecr-player__media--auto{height:auto}#ecommreels-admin-app .ecr-player__slider,.ecommreels-short-code .ecr-player__slider,.reelswp-group-short-code .ecr-player__slider,.reelswp-reel-short-code .ecr-player__slider{position:absolute;top:0;display:flex;background:#000;transition:left .2s ease}#ecommreels-admin-app .ecr-player__slide,.ecommreels-short-code .ecr-player__slide,.reelswp-group-short-code .ecr-player__slide,.reelswp-reel-short-code .ecr-player__slide{position:relative;display:flex;align-items:center;justify-content:center;height:90vh;max-width:100vw;aspect-ratio:9 / 16}#ecommreels-admin-app .ecr-player__controls,.ecommreels-short-code .ecr-player__controls,.reelswp-group-short-code .ecr-player__controls,.reelswp-reel-short-code .ecr-player__controls{position:absolute;top:8px;right:40px;z-index:5;display:inline-flex;align-items:center;gap:10px;color:#fff;mix-blend-mode:difference}#ecommreels-admin-app .ecr-player__control-icon,.ecommreels-short-code .ecr-player__control-icon,.reelswp-group-short-code .ecr-player__control-icon,.reelswp-reel-short-code .ecr-player__control-icon{cursor:pointer}#ecommreels-admin-app .ecommreels-story-modal,.ecommreels-short-code .ecommreels-story-modal,.reelswp-group-short-code .ecommreels-story-modal,.reelswp-reel-short-code .ecommreels-story-modal{max-width:100%!important;z-index:2147483647;background-color:#000c;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}#ecommreels-admin-app #player *,.ecommreels-short-code #player *,.reelswp-group-short-code #player *,.reelswp-reel-short-code #player *{scrollbar-width:none;-ms-overflow-style:none}#ecommreels-admin-app #player *::-webkit-scrollbar,.ecommreels-short-code #player *::-webkit-scrollbar,.reelswp-group-short-code #player *::-webkit-scrollbar,.reelswp-reel-short-code #player *::-webkit-scrollbar{display:none}#ecommreels-admin-app .ecr-player,.ecommreels-short-code .ecr-player,.reelswp-group-short-code .ecr-player,.reelswp-reel-short-code .ecr-player{position:fixed!important;top:0!important;left:0!important;display:grid;place-items:center;width:100vw!important;height:100vh!important}#ecommreels-admin-app .ecr-player__stage,.ecommreels-short-code .ecr-player__stage,.reelswp-group-short-code .ecr-player__stage,.reelswp-reel-short-code .ecr-player__stage{position:relative;width:fit-content;height:fit-content}#ecommreels-admin-app .ecr-player__frame,.ecommreels-short-code .ecr-player__frame,.reelswp-group-short-code .ecr-player__frame,.reelswp-reel-short-code .ecr-player__frame{position:relative;aspect-ratio:9 / 16;height:90vh;max-width:100vw;overflow:hidden;border-radius:24px}@media screen and (max-width:767.98px){#ecommreels-admin-app .ecr-player__frame,.ecommreels-short-code .ecr-player__frame,.reelswp-group-short-code .ecr-player__frame,.reelswp-reel-short-code .ecr-player__frame{height:100vh;border-radius:0}}#ecommreels-admin-app .ecr-player__close,.ecommreels-short-code .ecr-player__close,.reelswp-group-short-code .ecr-player__close,.reelswp-reel-short-code .ecr-player__close{position:absolute;top:8px;right:8px;z-index:5;color:#fff;cursor:pointer;mix-blend-mode:difference;line-height:1}#ecommreels-admin-app .ecr-player__close-icon,.ecommreels-short-code .ecr-player__close-icon,.reelswp-group-short-code .ecr-player__close-icon,.reelswp-reel-short-code .ecr-player__close-icon{font-size:22px;font-weight:800}#ecommreels-admin-app .ecr-admin-reels-grid{display:grid;gap:16px;grid-template-columns:repeat(auto-fill,minmax(150px,1fr))}#ecommreels-admin-app .ecr-thumb__media,.ecommreels-short-code .ecr-thumb__media,.reelswp-group-short-code .ecr-thumb__media,.reelswp-reel-short-code .ecr-thumb__media{position:relative;width:100%;height:100%}#ecommreels-admin-app .ecr-thumb__video,.ecommreels-short-code .ecr-thumb__video,.reelswp-group-short-code .ecr-thumb__video,.reelswp-reel-short-code .ecr-thumb__video{pointer-events:none;width:100%;height:100%;object-fit:cover}#ecommreels-admin-app .ecr-thumb__placeholder,.ecommreels-short-code .ecr-thumb__placeholder,.reelswp-group-short-code .ecr-thumb__placeholder,.reelswp-reel-short-code .ecr-thumb__placeholder{display:flex;width:100%;height:100%;align-items:center;justify-content:center;background:#e5e7eb;color:#6b7280;font-size:13px}#ecommreels-admin-app .ecr-thumb__views,.ecommreels-short-code .ecr-thumb__views,.reelswp-group-short-code .ecr-thumb__views,.reelswp-reel-short-code .ecr-thumb__views{position:absolute;top:8px;z-index:4;display:inline-flex;align-items:center;gap:4px;background:#6b7280;color:#fff;padding:2.4px 5.6px;font-size:11px;border-radius:4px;word-break:normal}#ecommreels-admin-app .ecr-admin-reel-card{display:block}#ecommreels-admin-app .ecr-admin-reel-card__frame{position:relative;overflow:hidden;border-radius:6px;border:2px solid #e5e7eb;transition:border-color .2s ease,box-shadow .2s ease}#ecommreels-admin-app .ecr-admin-reel-card__frame--selected{border-color:#3b82f6;box-shadow:0 0 0 2px #2b7fff}#ecommreels-admin-app .ecr-admin-reel-card__actions{position:absolute;top:100%;z-index:5;display:flex;width:100%;height:50%;align-items:center;justify-content:center;gap:12px;background:#bfdbfee6;transition:top .2s ease}#ecommreels-admin-app .ecr-admin-reel-card__frame:hover .ecr-admin-reel-card__actions--hover{top:50%}#ecommreels-admin-app .ecr-admin-reel-card__action{background:#fff;color:#111827}#ecommreels-admin-app .ecr-admin-reel-card__action:hover{background:#fff}#ecommreels-admin-app .ecr-admin-reel-card__action--danger{color:#ef4444}#ecommreels-admin-app .ecr-admin-reel-card__icon{width:16px;height:16px}#ecommreels-admin-app .ecr-admin-reel-card__icon--primary{color:#2563eb}#ecommreels-admin-app .ecr-admin-reel-card__icon--danger{color:#ef4444}#ecommreels-admin-app .ecr-admin-reel-card__corner{position:absolute;display:flex;top:-2px;right:-2px;z-index:6;width:42px;height:42px;transition:transform .2s ease}#ecommreels-admin-app .ecr-admin-reel-card__corner--hidden{transform:translate(100%,-100%)}#ecommreels-admin-app .ecr-admin-reel-card__frame:hover .ecr-admin-reel-card__corner--hidden{transform:translate(0)}#ecommreels-admin-app .ecr-admin-reel-card__corner--selected{background:#3b82f6}#ecommreels-admin-app .ecr-admin-reel-card__corner--idle{background:#fff}#ecommreels-admin-app .ecr-admin-reel-card__select{margin-left:auto;width:24px;height:24px;border-radius:4px;background:transparent;padding:4px}#ecommreels-admin-app .ecr-admin-reel-card__select:hover{background:none}#ecommreels-admin-app .ecr-admin-reel-card__check{color:#6b7280}#ecommreels-admin-app .ecr-admin-reel-card__check--active{color:#fff}#ecommreels-admin-app .ecr-admin-reel-card__title{width:100%;margin:6px 0 0;text-align:center;font-size:13px;font-weight:500;text-transform:capitalize;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#ecommreels-admin-app .ecr-admin-back-button{background:none;border:none;padding:0;color:#6b7280;cursor:pointer;transition:color .15s ease}#ecommreels-admin-app .ecr-admin-back-button:hover{color:#2563eb}#ecommreels-admin-app .ecr-admin-breadcrumb{margin-top:12px;padding:0 24px;font-size:13px;color:#6b7280}#ecommreels-admin-app .ecr-admin-breadcrumb__list{display:flex;flex-wrap:wrap;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-breadcrumb__item{display:inline-flex;align-items:center}#ecommreels-admin-app .ecr-admin-breadcrumb__link{color:#2563eb;text-decoration:none;transition:color .15s ease}#ecommreels-admin-app .ecr-admin-breadcrumb__current{font-weight:600;color:#1f2937}#ecommreels-admin-app .ecr-admin-breadcrumb__separator{margin:0 4px;font-size:18px;color:#9ca3af}#ecommreels-admin-app .ecr-admin-modal{position:fixed;inset:0;z-index:2147483647;display:grid;place-items:center;background:#000c}#ecommreels-admin-app .ecr-admin-modal__panel{border-radius:8px;background:#fff;padding:24px;min-width:320px;max-width:500px}#ecommreels-admin-app .ecr-admin-modal__content{margin-bottom:16px}#ecommreels-admin-app .ecr-admin-modal__icon{margin-bottom:8px;display:flex;justify-content:center}#ecommreels-admin-app .ecr-admin-modal__message{margin:0;font-size:16px;font-weight:600;color:#111827;text-align:center}#ecommreels-admin-app .ecr-admin-modal__actions{display:flex;width:100%;align-items:center;justify-content:center;gap:8px}#ecommreels-admin-app .ecr-admin-modal__button{border-radius:6px;border:1px solid transparent;padding:6px 24px;font-size:14px;font-weight:600;cursor:pointer}#ecommreels-admin-app .ecr-admin-modal__button:disabled{opacity:.5;cursor:not-allowed}#ecommreels-admin-app .ecr-admin-modal__button--cancel{border-color:#3b82f6;background:#fff;color:#3b82f6}#ecommreels-admin-app .ecr-admin-modal__button--danger{display:inline-flex;align-items:center;gap:6px;border-color:#ef4444;background:#ef4444;color:#fff}#ecommreels-admin-app .ecr-admin-modal__spinner{animation:ecr-modal-spin 1s linear infinite}@keyframes ecr-modal-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-admin-link-button{display:inline-flex;align-items:center;justify-content:center;gap:8px;border-radius:6px;background:#3b82f6;padding:8px 16px;font-size:14px;font-weight:600;text-decoration:none;transition:background-color .15s ease;margin-inline-start:auto;white-space:nowrap}#ecommreels-admin-app .ecr-admin-link-button:hover{background:#1d4ed8}#ecommreels-admin-app .ecr-admin-loader{position:fixed;inset:0;z-index:5;display:grid;place-items:center;background:#fffc;color:#3b82f6}#ecommreels-admin-app .ecr-admin-loader__icon{animation:ecr-admin-spin 1s linear infinite}@keyframes ecr-admin-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-admin-navbar{display:flex;align-items:center;justify-content:space-between;background:#fff;padding:16px 24px;gap:16px;flex-wrap:wrap}#ecommreels-admin-app .ecr-admin-navbar__section{display:flex;align-items:center;gap:16px}@media(max-width:1024px){#ecommreels-admin-app .ecr-admin-navbar{justify-content:center}}#ecommreels-admin-app .ecr-admin-page-name{margin:0;display:inline-flex;align-items:center;gap:4px;font-size:20px;font-weight:600;-webkit-user-select:none;user-select:none;white-space:nowrap}#ecommreels-admin-app .ecr-admin-widget-name{display:inline-flex;align-items:center;justify-content:center;gap:4px;width:320px;border-radius:6px;background:#e5e7eb;padding:8px;font-size:14px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-create{margin:16px 24px 0;display:flex;gap:24px}@media(max-width:1024px){#ecommreels-admin-app .ecr-admin-create{flex-direction:column}}#ecommreels-admin-app .ecr-admin-create__panel{position:relative;overflow-x:hidden;border-radius:16px;background:#fff;padding:16px 20px 20px}#ecommreels-admin-app .ecr-admin-create__panel--main{flex:1;min-width:0}#ecommreels-admin-app .ecr-admin-create__panel--side{width:300px;flex-shrink:0}@media(max-width:1024px){#ecommreels-admin-app .ecr-admin-create__panel--side{width:100%}}#ecommreels-admin-app .ecr-admin-create__title{margin:0 0 8px;font-size:16px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-create__separator{margin:12px 0}#ecommreels-admin-app .ecr-admin-save-button{background:#3b82f6;color:#fff;text-transform:capitalize}#ecommreels-admin-app .ecr-admin-save-button:hover{background:#2563eb}#ecommreels-admin-app .ecr-admin-save-button:disabled{background:#6b7280}#ecommreels-admin-app .ecr-admin-save-button__icon{font-size:16px}#ecommreels-admin-app .ecr-admin-save-button__icon--spin{animation:ecr-save-spin 1s linear infinite}@keyframes ecr-save-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-admin-title-input{width:320px;border-radius:6px;border:1px solid transparent;background:#e5e7eb;padding:8px;text-align:center;font-size:14px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-popover{border-radius:10px;border:1px solid var(--color-border, #e5e7eb);background:#fff;color:var(--color-foreground, #111827);padding-block:16px;width:288px;box-shadow:0 10px 30px #00000026;z-index:999}#ecommreels-admin-app .ecr-popover[data-state=open]{animation:ecr-popover-in .15s ease-out}@keyframes ecr-popover-in{0%{opacity:0;transform:translateY(4px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}.ecr-separator{background:var(--color-border, #e5e7eb);flex-shrink:0}.ecr-separator[data-orientation=horizontal]{height:1px;width:100%}.ecr-separator[data-orientation=vertical]{width:1px;height:100%}.ecr-admin-upgrade__title{margin:0;display:inline-flex;align-items:center;gap:6px;font-weight:600;padding-inline:16px}.ecr-admin-upgrade__name{text-transform:capitalize}.ecr-admin-upgrade__tag{display:inline-block;padding:0 4px;border-radius:2px;background:#2563eb;color:#fff;font-size:10px;letter-spacing:.32px}.ecr-admin-upgrade__text{margin:0;font-size:13px;color:#374151;line-height:1.4;padding-inline:16px}.ecr-admin-upgrade__actions{display:flex;justify-content:flex-end;padding-inline:16px}.ecr-admin-upgrade__button{background:#3b82f6;color:#fff}.ecr-admin-upgrade__button:hover{background:#2563eb}.ecr-admin-upgrade__link{font-size:13px;text-decoration:none}.ecr-admin-separator{margin:12px 0}#ecommreels-admin-app .ecr-admin-upload{display:grid;width:260px;aspect-ratio:9 / 16;place-items:center;border-radius:12px;border:2px dashed #d1d5db;background:#eff6ff;position:relative}#ecommreels-admin-app .ecr-admin-upload--active{border-color:#3b82f6;background:#eff6ff}#ecommreels-admin-app .ecr-admin-upload--idle{border-color:#d1d5db}#ecommreels-admin-app .ecr-admin-upload__label{display:flex;flex-direction:column;justify-content:center;align-items:center;cursor:pointer;text-align:center;height:100%;background-color:transparent}#ecommreels-admin-app .ecr-admin-upload__text-icon_wrapper{display:grid;place-items:center;text-align:center}#ecommreels-admin-app .ecr-admin-upload__icon{width:40%;transition:transform .2s ease}#ecommreels-admin-app .ecr-admin-upload__label:hover .ecr-admin-upload__icon{transform:scale(1.02)}#ecommreels-admin-app .ecr-admin-upload__text{margin:8px 0 0;color:#6b7280;font-size:13px}#ecommreels-admin-app .ecr-admin-upload__text-stack{display:flex;flex-direction:column;gap:8px}#ecommreels-admin-app .ecr-admin-upload__text-item{font-size:13px}#ecommreels-admin-app .ecr-admin-upload__text-strong{font-weight:600}#ecommreels-admin-app .ecr-admin-video-upload-options{position:absolute;inset:2px;border-radius:10px;background-color:#fff;box-shadow:0 0 4px 8px #f5f5f5;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:12px}#ecommreels-admin-app .ecr-admin-upload-source-panel{position:absolute;inset:6px;z-index:3;border-radius:10px;border:1px solid #dbeafe;background:#fff;box-shadow:0 12px 24px #0f172a26;padding:12px;display:flex;flex-direction:column}#ecommreels-admin-app .ecr-admin-upload-source-panel__close{align-self:flex-end;width:28px;height:28px;border:1px solid #e5e7eb;border-radius:6px;background:#fff;color:#6b7280;cursor:pointer;display:inline-flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-admin-upload-source-panel__close:hover{color:#111827}#ecommreels-admin-app .ecr-admin-upload-source-popover__title{margin:0;font-size:14px;font-weight:700;color:#111827}#ecommreels-admin-app .ecr-admin-upload-source-popover__description{margin:4px 0 0;font-size:12px;color:#6b7280}#ecommreels-admin-app .ecr-admin-upload-source-popover__options{margin-top:12px;display:flex;flex-direction:column;gap:8px}#ecommreels-admin-app .ecr-admin-upload-source-option{width:100%;padding:12px;border:1px solid #dbeafe;border-radius:8px;background:#eff6ff;color:#1d4ed8;text-align:left;font-weight:600;font-size:13px;transition:all .2s ease}#ecommreels-admin-app .ecr-admin-upload-source-option:hover{border-color:#3b82f6;background:#3b82f6;color:#fff}#ecommreels-admin-app .ecr-admin-upload-vimeo-video-btn{padding:12px;border-radius:6px;background:#eff6ff;width:100%;text-align:center;transition:all .2s ease;cursor:pointer;display:flex;align-items:center;gap:8px;opacity:.8}#ecommreels-admin-app .ecr-admin-upload-native-video-btn{padding:12px;border-radius:6px;background:#eff6ff;width:100%;text-align:center;transition:all .2s ease;cursor:pointer;display:flex;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-upload-native-video-btn:hover{background-color:#3b82f6;color:#fff}#ecommreels-admin-app .ecr-dialog__overlay{position:fixed;inset:0;background:#0f172abf;z-index:5}#ecommreels-admin-app .ecr-dialog__overlay[data-state=open]{animation:ecr-dialog-overlay-in .15s ease-out}#ecommreels-admin-app .ecr-dialog__content{position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);width:min(500px,92vw);max-height:85vh;overflow:auto;border-radius:12px;border:1px solid var(--color-border, #e5e7eb);background:#fff;color:var(--color-foreground, #111827);padding:20px;box-shadow:0 25px 60px #0f172a40;z-index:6}#ecommreels-admin-app .ecr-dialog__content[data-state=open]{animation:ecr-dialog-content-in .2s ease-out}#ecommreels-admin-app .ecr-dialog__close{position:absolute;right:12px;top:12px;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:8px;border:1px solid var(--color-border, #e5e7eb);background:#fff;color:var(--color-muted-foreground, #6b7280);cursor:pointer}#ecommreels-admin-app .ecr-dialog__close:hover{color:var(--color-foreground, #111827)}#ecommreels-admin-app .ecr-dialog__close-icon{width:16px;height:16px}#ecommreels-admin-app .ecr-dialog__header{display:flex;flex-direction:column;gap:6px;padding-right:36px;margin-bottom:16px}#ecommreels-admin-app .ecr-dialog__title{font-size:16px;font-weight:600;text-transform:none}#ecommreels-admin-app .ecr-dialog__description{font-size:13px;color:var(--color-muted-foreground, #6b7280)}@keyframes ecr-dialog-overlay-in{0%{opacity:0}to{opacity:1}}@keyframes ecr-dialog-content-in{0%{opacity:0;transform:translate(-50%,-48%) scale(.98)}to{opacity:1;transform:translate(-50%,-50%) scale(1)}}#ecommreels-admin-app .ecr-admin-link-tabs{width:100%;max-height:550px}#ecommreels-admin-app .ecr-admin-link-tabs__list{width:100%;display:grid;grid-template-columns:1fr;gap:8px;border-radius:10px;padding:3px}#ecommreels-admin-app .ecr-admin-link-tabs__trigger,#ecommreels-admin-app .ecr-admin-link-tabs__lock{display:flex;cursor:pointer;align-items:center;justify-content:center;gap:4px;border:1px solid #3b82f6;border-radius:8px;padding:8px;font-size:13px;font-weight:600;background:#fff;color:#6b7280;text-transform:none}#ecommreels-admin-app .ecr-admin-link-tabs__lock{border-color:#969eab}#ecommreels-admin-app .ecr-admin-link-tabs__trigger{color:#3b82f6}#ecommreels-admin-app .ecr-admin-link-tabs__popover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-link-tabs__content{display:flex;flex-direction:column;gap:20px}#ecommreels-admin-app .ecr-admin-link-dialog{max-width:560px}#ecommreels-admin-app .ecr-admin-product-link__search-input{width:100%;border-radius:4px;border:1px solid #e5e7eb;padding:8px 12px;font-size:13px}#ecommreels-admin-app .ecr-admin-product-link__list{height:100%;max-height:300px;width:100%;overflow-y:auto}#ecommreels-admin-app .ecr-admin-product-link__list-inner{display:flex;flex-direction:column;gap:8px;width:100%}#ecommreels-admin-app .ecr-admin-product-link__empty{padding:24px 0;text-align:center;font-size:14px;color:#6b7280}#ecommreels-admin-app .ecr-admin-product-link__item{width:100%}#ecommreels-admin-app .ecr-admin-product-link__button{height:auto;width:100%;justify-content:flex-start;border:1px solid #e5e7eb;background:#f7f7f7;color:#111827;padding:8px;font-weight:400;text-align:left;font-size:13px;display:flex;align-items:center;gap:8px;border-radius:6px}#ecommreels-admin-app .ecr-admin-product-link__button--selected{border-color:#2563eb;background:#eff6ff}#ecommreels-admin-app .ecr-admin-product-link__button--unselected:hover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-product-link__thumb{pointer-events:none;width:40px;height:40px;flex:0 0 auto}#ecommreels-admin-app .ecr-admin-product-link__error{margin:0 0 8px;text-align:left;font-size:14px;color:#ef4444}#ecommreels-admin-app .ecr-admin-product-link__actions{display:flex;justify-content:end}#ecommreels-admin-app .ecr-admin-product-link__actions .ecr-button{text-transform:capitalize;padding:12px 32px}#ecommreels-admin-app .ecr-admin-product-link__loader{display:flex;justify-content:center;padding:24px 0}#ecommreels-admin-app .ecr-admin-product-link__spinner{width:24px;height:24px;border-radius:999px;border-bottom:2px solid #3b82f6;animation:ecr-admin-product-link-spin 1s linear infinite}@keyframes ecr-admin-product-link-spin{to{transform:rotate(360deg)}}.scrollbarThin{--sb-track: transparent;--sb-thumb: rgba(0, 0, 0, .35);--sb-thumb-hover: rgba(0, 0, 0, .5);--sb-thumb-radius: 6px;--sb-size: 8px;scrollbar-width:thin;scrollbar-color:var(--sb-thumb) var(--sb-track);-ms-overflow-style:auto}.scrollbarThin::-webkit-scrollbar{width:var(--sb-size);height:var(--sb-size)}.scrollbarThin::-webkit-scrollbar-track{background:var(--sb-track)}.scrollbarThin::-webkit-scrollbar-thumb{background-color:var(--sb-thumb);border-radius:var(--sb-thumb-radius);border:2px solid transparent;background-clip:padding-box}.scrollbarThin::-webkit-scrollbar-thumb:hover{background-color:var(--sb-thumb-hover)}.scrollbarThin::-webkit-scrollbar-thumb:active{background-color:var(--sb-thumb-hover)}.scrollbarThin::-webkit-scrollbar-corner{background:var(--sb-track)}.scrollbarThin:focus-within::-webkit-scrollbar-thumb{box-shadow:0 0 0 1px #0000000f inset}#ecommreels-admin-app .ecr-admin-link__label{display:block;text-align:left;font-size:14px;font-weight:600;text-transform:capitalize;margin-bottom:4px}#ecommreels-admin-app .ecr-admin-link__input{width:100%;border-radius:6px;border:1px solid #6b7280;padding:6px 8px}#ecommreels-admin-app .ecr-admin-link__input--normal{border-color:#6b7280}#ecommreels-admin-app .ecr-admin-link__input--error{border-color:#ef4444}#ecommreels-admin-app .ecr-admin-link__input:focus{outline:none;border-color:#3b82f6;box-shadow:0 0 0 2px #3b82f626}#ecommreels-admin-app .ecr-admin-link__error{margin:4px 0 0;text-align:left;font-size:12px;color:#ef4444}#ecommreels-admin-app .ecr-admin-link__toggle{display:flex;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-link__checkbox{width:16px;height:16px}#ecommreels-admin-app .ecr-admin-link__toggle-label{cursor:pointer;font-size:14px;font-weight:600}#ecommreels-admin-app .ecr-admin-link__actions{margin-top:12px;display:flex;gap:8px}#ecommreels-admin-app .ecr-admin-link__actions .ecr-button{text-transform:capitalize;width:100%}#ecommreels-admin-app .ecr-admin-links{display:flex;flex-direction:column;gap:8px}#ecommreels-admin-app .ecr-admin-links__title{margin:0;font-size:16px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-links__wrapper{display:flex;flex-direction:column;gap:4px;max-height:380px;overflow-y:auto}#ecommreels-admin-app .ecr-admin-links__item{display:flex;align-items:center;justify-content:space-between;gap:8px;border-radius:6px;background:#eff6ff;padding:2px 8px 2px 16px}#ecommreels-admin-app .ecr-admin-links__remove{color:#ef4444}#ecommreels-admin-app .ecr-admin-links__add-more_btn{margin-top:8px;display:flex;width:100%;cursor:pointer;align-items:center;justify-content:center;gap:4px;border-radius:6px;background:#3b82f6;padding:8px;font-size:13px;color:#fff;text-transform:capitalize}#ecommreels-admin-app .ecr-admin-links__upgrade{margin-top:12px;display:flex;width:100%;cursor:pointer;align-items:center;justify-content:center;gap:4px;border-radius:6px;background:#3b82f6b3;padding:6px;font-size:13px;color:#fff;text-transform:capitalize}#ecommreels-admin-app .ecr-admin-links__popover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-reelvideo{width:100%;border-radius:12px;display:block}#ecommreels-admin-app .ecr-admin-reelvideo--portrait{width:100%;height:100%;object-fit:cover}#ecommreels-admin-app .ecr-admin-reelvideo--landscape{width:100%}#ecommreels-admin-app .ecr-admin-customization__panel{position:relative;display:flex;width:260px;aspect-ratio:9 / 16;cursor:grab;align-items:center;justify-content:center;overflow:hidden;border-radius:12px;background:#000;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-admin-customization__panel:active{cursor:grabbing}#ecommreels-admin-app .ecr-admin-customization__remove{position:absolute;top:8px;left:8px;z-index:3;cursor:pointer;color:#fff;mix-blend-mode:difference}#ecommreels-admin-app .ecr-admin-customization__controls{position:absolute;top:8px;right:8px;z-index:5;display:flex;gap:8px;font-size:18px;color:#fff;mix-blend-mode:difference}#ecommreels-admin-app .ecr-admin-customization__control{cursor:pointer}#ecommreels-admin-app .ecr-admin-customization{display:flex;width:fit-content;flex-wrap:wrap;gap:16px}#ecommreels-admin-app .ecr-admin-customization__add{position:relative;display:flex;width:260px;aspect-ratio:9 / 16;flex-direction:column;align-items:center;justify-content:center;gap:8px;border-radius:12px;border:2px dashed #d1d5db;background:#e5e7eb;padding:20px;cursor:pointer}#ecommreels-admin-app .ecr-admin-customization__icon{width:40%;transition:transform .2s ease}#ecommreels-admin-app .ecr-admin-customization__add:hover .ecr-admin-customization__icon{transform:scale(1.02)}#ecommreels-admin-app .ecr-admin-customization__label{font-size:13px;color:#4b5563}#ecommreels-admin-app .ecr-admin-customization__lock{position:absolute;top:8px;right:8px;color:#6b7280}#ecommreels-admin-app .ecr-admin-customization__popover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-thumbnail{display:flex;flex-direction:column}#ecommreels-admin-app .ecr-admin-thumbnail__title{margin:0 0 8px;font-size:16px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-thumbnail__preview{position:relative;margin:0 auto;width:100%;aspect-ratio:9 / 16;overflow:hidden;border-radius:12px}#ecommreels-admin-app .ecr-admin-thumbnail__image{width:100%;height:100%;object-fit:cover}#ecommreels-admin-app .ecr-admin-thumbnail__remove{position:absolute;top:8px;right:8px;z-index:3;cursor:pointer;color:#fff;mix-blend-mode:difference}#ecommreels-admin-app .ecr-admin-thumbnail__uploader{width:100%}@media(max-width:767px){#ecommreels-admin-app .ecr-admin-thumbnail__uploader{width:260px}}#ecommreels-admin-app .ecr-admin-card{margin:24px auto 0;max-width:1024px;border:1px solid #6b7280;border-radius:6px;background:#fff;padding:24px;box-shadow:0 0 8px #aaa}#ecommreels-admin-app .ecr-admin-card--settings{width:fit-content}#ecommreels-admin-app .ecr-admin-card__header{display:flex;align-items:center;justify-content:space-between;gap:16px}#ecommreels-admin-app .ecr-admin-card__title{margin:0;font-size:20px;font-weight:700}#ecommreels-admin-app .ecr-admin-groups{display:flex;flex-direction:column;gap:16px}#ecommreels-admin-app .ecr-admin-groups__header{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px}#ecommreels-admin-app .ecr-admin-groups__title{margin:0;font-size:20px;font-weight:700;color:#111827}#ecommreels-admin-app .ecr-admin-groups__create-button{border:1px solid #2563eb;background:#fff;color:#2563eb}#ecommreels-admin-app .ecr-admin-groups__create-button:hover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-groups__load-more{display:flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-admin-groups__load-more__icon{width:48px;height:48px;color:#3b82f6;animation:ecr-load-more-spin 1s linear infinite}@keyframes ecr-load-more-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-admin-groups_action_wrapper{display:flex;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-groups-header__search{position:relative;width:100%}@media(min-width:640px){#ecommreels-admin-app .ecr-admin-groups-header__search{width:280px}}#ecommreels-admin-app .ecr-admin-groups-search-input{width:100%;padding:8px 16px;border-radius:6px;border:1px solid #e5e7eb;background:#fff;font-size:14px;line-height:1.4}#ecommreels-admin-app .ecr-admin-groups-search-input:focus{outline:none;box-shadow:none;border-color:#cbd5f5}#ecommreels-admin-app .ecr-admin-groups-header__icon-wrapper{position:absolute;top:50%;right:8px;transform:translateY(-50%);width:fit-content;height:20px;display:flex;align-items:center}#ecommreels-admin-app .ecr-admin-groups-header__search-icon{color:#d1d5db;flex-shrink:0}#ecommreels-admin-app .ecr-admin-groups-header__clear-icon{color:#f50808;flex-shrink:0}#ecommreels-admin-app .ecr-admin-docs-link{color:#2563eb;display:flex;align-items:center;text-decoration:none;gap:4px;transition:color .15s ease}#ecommreels-admin-app .ecr-admin-docs-link:focus{box-shadow:none}#ecommreels-admin-app .ecr-admin-error{margin-top:16px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;border-radius:6px;border:1px solid #fecaca;background:#fef2f2;padding:24px;color:#dc2626}#ecommreels-admin-app .ecr-admin-error__icon{width:28px;height:28px}#ecommreels-admin-app .ecr-admin-error__text{margin:0;text-align:center;font-weight:600}.ecr-table__container{width:100%;overflow-x:auto}.ecr-table{width:100%;border-collapse:collapse;font-size:13px}.ecr-table__header tr{border-bottom:1px solid var(--color-border, #e5e7eb)}.ecr-table__row{border-bottom:1px solid var(--color-border, #e5e7eb);transition:background-color .2s ease}.ecr-table__row:hover,.ecr-table__row[data-state=selected]{background:var(--color-muted, #f3f4f6)}.ecr-table__head,.ecr-table__cell{padding:8px;text-align:left;vertical-align:middle;white-space:nowrap}.ecr-table__head{font-weight:600;color:var(--color-foreground, #111827)}.ecr-table__footer{border-top:1px solid var(--color-border, #e5e7eb);font-weight:600;background:var(--color-muted, #f3f4f6)}.ecr-table__caption{margin-top:16px;font-size:12px;color:var(--color-muted-foreground, #6b7280)}#ecommreels-admin-app .ecr-admin-groups__head{background:#1f2937;color:#fff;border:1px solid #374151;padding:8px;font-size:13px;font-weight:600}#ecommreels-admin-app .ecr-admin-groups__row{background:#fff}#ecommreels-admin-app .ecr-admin-groups__row--alt{background:#f3f4f6}#ecommreels-admin-app .ecr-admin-groups__cell--center{text-align:center}#ecommreels-admin-app .ecr-admin-groups__cell--strong{font-weight:600}#ecommreels-admin-app .ecr-admin-groups__name{display:flex;align-items:center;gap:8px;font-weight:600;color:#1f2937}#ecommreels-admin-app .ecr-admin-groups__shortcode{display:flex;align-items:center;gap:16px}#ecommreels-admin-app .ecr-admin-groups__shortcode-text{font-family:Courier New,monospace;font-size:13px;color:#111827}#ecommreels-admin-app .ecr-admin-groups__copy{position:relative;isolation:isolate}#ecommreels-admin-app .ecr-admin-groups__copy-button{border:none;border-radius:4px;background:#1f2937;color:#fff;padding:4px 6px;cursor:pointer;transition:transform .15s ease}#ecommreels-admin-app .ecr-admin-groups__copy-button:active{transform:scale(.95)}#ecommreels-admin-app .ecr-admin-groups__copy-icon{display:block;width:12px;height:12px}#ecommreels-admin-app .ecr-admin-groups__copy-tooltip{position:absolute;top:-8px;right:8px;transform:translate(33%,-100%) scale(0);transform-origin:bottom right;border-radius:4px;background:#6b7280;padding:4px 8px;font-size:12px;font-weight:600;letter-spacing:.32px;color:#fff;transition:transform .2s ease}#ecommreels-admin-app .ecr-admin-groups__copy-tooltip:after{content:"";position:absolute;bottom:-4px;left:50%;width:12px;height:12px;transform:translate(-50%) rotate(45deg);background:#6b7280;z-index:-1}#ecommreels-admin-app .ecr-admin-groups__copy-tooltip--visible{transform:translate(33%,-100%) scale(1)}#ecommreels-admin-app .ecr-admin-groups__actions{display:flex;align-items:center;justify-content:center;gap:6px}#ecommreels-admin-app .ecr-admin-groups__action-button{color:inherit}#ecommreels-admin-app .ecr-admin-groups__icon{width:18px;height:18px}#ecommreels-admin-app .ecr-admin-groups__icon--neutral{color:#475569}#ecommreels-admin-app .ecr-admin-groups__icon--danger{color:#f43f5e}#ecommreels-admin-app .ecr-admin-groups__caption{margin-top:16px}#ecommreels-admin-app .ecr-admin-groups__empty{display:flex;align-items:center;justify-content:center;gap:8px;font-size:15px;font-weight:600;color:#374151}#ecommreels-admin-app .ecr-admin-groups__empty-icon{width:20px;height:20px;color:#f59e0b}#ecommreels-admin-app .ecr-admin-groups__skeleton-table{width:100%;border-collapse:collapse}#ecommreels-admin-app .ecr-admin-groups__skeleton-head{background:#1f2937}#ecommreels-admin-app .ecr-admin-groups__skeleton-row{background:#fff}#ecommreels-admin-app .ecr-admin-groups__skeleton-row--alt{background:#f9fafb}#ecommreels-admin-app .ecr-admin-groups__skeleton-cell{border:1px solid #e5e7eb;padding:8px}#ecommreels-admin-app .ecr-admin-groups__skeleton-cell--center{text-align:center}#ecommreels-admin-app .ecr-admin-groups__skeleton-block,#ecommreels-admin-app .ecr-admin-groups__skeleton-line{border-radius:4px;background:#d1d5db;animation:ecr-groups-pulse 1.6s ease-in-out infinite}#ecommreels-admin-app .ecr-admin-groups__skeleton-block{height:24px}#ecommreels-admin-app .ecr-admin-groups__skeleton-line{height:16px;margin:4px 0}#ecommreels-admin-app .ecr-admin-groups__skeleton-block--tiny,#ecommreels-admin-app .ecr-admin-groups__skeleton-line--tiny{width:32px;margin-inline:auto}#ecommreels-admin-app .ecr-admin-groups__skeleton-block--small,#ecommreels-admin-app .ecr-admin-groups__skeleton-line--small{width:96px;margin-inline:auto}#ecommreels-admin-app .ecr-admin-groups__skeleton-block--medium,#ecommreels-admin-app .ecr-admin-groups__skeleton-line--medium{width:160px}#ecommreels-admin-app .ecr-admin-groups__skeleton-block--large,#ecommreels-admin-app .ecr-admin-groups__skeleton-line--large{width:220px}@keyframes ecr-groups-pulse{0%,to{opacity:1}50%{opacity:.5}}#ecommreels-admin-app .ecr-admin-form{margin-top:24px;display:flex;flex-direction:column;gap:16px}#ecommreels-admin-app .ecr-admin-form__row{display:grid;grid-template-columns:1fr;align-items:center;gap:24px}@media(min-width:640px){#ecommreels-admin-app .ecr-admin-form__row{grid-template-columns:repeat(2,minmax(0,1fr))}}#ecommreels-admin-app .ecr-admin-form__label{font-size:14px;font-weight:600}#ecommreels-admin-app .ecr-admin-form__input{width:128px;border-radius:6px;border:1px solid #d1d5db;padding:8px;font-size:14px}#ecommreels-admin-app .ecr-admin-stats{display:flex;flex-direction:column;gap:16px}#ecommreels-admin-app .ecr-admin-stats__header{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px}#ecommreels-admin-app .ecr-admin-stats__title{margin:0;font-size:20px;font-weight:700;color:#111827}#ecommreels-admin-app .ecr-admin-stats__summary{font-size:15px;font-weight:700;color:#111827}#ecommreels-admin-app .ecr-admin-stats__summary-skeleton{width:64px;height:24px;border-radius:6px;background:#d1d5db;animation:ecr-stats-pulse 1.6s ease-in-out infinite}#ecommreels-admin-app .ecr-admin-stats__body{margin-top:16px}@keyframes ecr-stats-pulse{0%,to{opacity:1}50%{opacity:.5}}#ecommreels-admin-app .ecr-admin-stats__table{margin-top:8px}#ecommreels-admin-app .ecr-admin-stats__head{background:#1f2937;color:#fff;border:1px solid #374151;padding:8px;font-size:13px;font-weight:600}#ecommreels-admin-app .ecr-admin-stats__row{background:#fff}#ecommreels-admin-app .ecr-admin-stats__row--alt{background:#f3f4f6}#ecommreels-admin-app .ecr-admin-stats__cell{border:1px solid #e5e7eb;padding:8px;font-size:13px;color:#111827}#ecommreels-admin-app .ecr-admin-stats__cell--center{text-align:center}#ecommreels-admin-app .ecr-admin-stats__cell--link{word-break:break-word}#ecommreels-admin-app .ecr-admin-stats__link{color:#2563eb;text-decoration:underline}#ecommreels-admin-app .ecr-admin-stats__caption{margin-top:16px}#ecommreels-admin-app .ecr-admin-stats__empty{display:flex;align-items:center;justify-content:center;gap:8px;font-size:14px;font-weight:600;color:#374151}#ecommreels-admin-app .ecr-admin-stats__empty-icon{width:20px;height:20px;color:#f59e0b}#ecommreels-admin-app .ecr-admin-group-edit{margin-top:24px;padding:0 24px;display:flex;flex-direction:column;gap:16px;position:relative}@media(min-width:1200px){#ecommreels-admin-app .ecr-admin-group-edit{flex-direction:row}}#ecommreels-admin-app .ecr-admin-group-title__wrapper{position:relative}#ecommreels-admin-app .ecr-admin-group-title-customization__trigger{position:absolute;top:50%;translate:0 -50%;right:0;background-color:transparent;color:gray;padding:0 8px}#ecommreels-admin-app .ecr-admin-group-title-customization-dialog{max-width:350px}#ecommreels-admin-app .ecr-admin-nav-btn-reverse{flex-direction:row-reverse}@media(min-width:640px){#ecommreels-admin-app .ecr-admin-nav-btn-reverse{flex-direction:row}}#ecommreels-admin-app .ecr-admin-side-toggle{background:none;border:none;padding:0;color:#6b7280;cursor:pointer}#ecommreels-admin-app .ecr-admin-side-toggle--active{color:#2563eb}.ecr-input{width:100%;min-width:0;border:1px solid transparent;border-radius:6px;background:#f3f4f6;color:inherit;padding:6.4px 12px;font-size:14px;line-height:1.4;transition:border-color .2s ease,box-shadow .2s ease,background-color .2s ease}.ecr-input:focus{outline:none;border-color:var(--color-ring, #60a5fa);box-shadow:0 0 0 3px color-mix(in srgb,#60a5fa 35%,transparent);background:#fff}.ecr-input::placeholder{color:var(--color-muted-foreground, #9ca3af)}.ecr-input:disabled{opacity:.6;cursor:not-allowed}#ecommreels-admin-app .ecr-admin-range{display:flex;flex-direction:column;align-items:flex-start;gap:4px}#ecommreels-admin-app .ecr-admin-range__label{font-size:13px;font-weight:600;white-space:nowrap;color:#374151;display:flex;align-items:center;gap:4px}#ecommreels-admin-app .ecr-admin-range__row{display:flex;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-range__slider{width:112px;cursor:pointer;accent-color:#2563eb}#ecommreels-admin-app .ecr-admin-range__value{display:inline-flex;align-items:center;gap:6px}#ecommreels-admin-app .ecr-admin-range__value .ecr-input{width:80px;padding:6px 8px}#ecommreels-admin-app .ecr-admin-range__unit{font-size:12px;color:#6b7280}#ecommreels-admin-app .ecr-admin-group-title_alignment{display:flex;align-items:center;flex-wrap:wrap;gap:8px;justify-content:space-between}#ecommreels-admin-app .ecr-admin-group-title_alignment-label{margin:0;font-size:13px;font-weight:600;white-space:nowrap;color:#374151}#ecommreels-admin-app .ecr-admin-group-title_alignment-options{display:flex;align-items:center;gap:0;background-color:#dfdfdf;border-radius:8px;overflow:hidden}#ecommreels-admin-app .ecr-admin-group-title_alignment-options button{border-radius:0;color:#3d3d3d}#ecommreels-admin-app .ecr-admin-group-title_alignment-options button:not(:last-child){border-right:1px solid gray}#ecommreels-admin-app .ecr-admin-group-title-customization__content{display:flex;flex-direction:column;gap:16px;margin-top:40px}#ecommreels-admin-app .ecr-admin-color-selector-popover{width:auto;padding:0;z-index:9}#ecommreels-admin-app .ecr-admin-shortcode{display:flex;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-shortcode__badge{border-radius:4px;background:#e5e7eb;padding:4px 8px;font-family:Courier New,monospace;font-size:14px;color:#111827;font-weight:900}#ecommreels-admin-app .ecr-admin-shortcode__copy{position:relative;isolation:isolate}#ecommreels-admin-app .ecr-admin-shortcode__button{cursor:pointer;border:none;border-radius:4px;background:#1f2937;padding:4px 6px;color:#fff}#ecommreels-admin-app .ecr-admin-shortcode__button:active{transform:scale(.95)}#ecommreels-admin-app .ecr-admin-shortcode__tooltip{position:absolute;top:50%;right:150%;transform:translateY(-50%) scale(0);transform-origin:center;border-radius:4px;background:#6b7280;padding:4px 8px;font-size:12px;font-weight:600;letter-spacing:.32px;color:#fff;transition:transform .2s ease}#ecommreels-admin-app .ecr-admin-shortcode__tooltip:after{content:"";position:absolute;top:50%;right:-4px;width:12px;height:12px;transform:translateY(-50%) rotate(45deg);background:#6b7280;z-index:-1}#ecommreels-admin-app .ecr-admin-shortcode__tooltip--visible{transform:translateY(-50%) scale(1)}#ecommreels-admin-app .ecr-admin-shortcode__tooltip--hidden{transform:translateY(-50%) scale(0)}#ecommreels-admin-app .ecr-admin-reelitem{display:inline-flex;flex-direction:column;width:var(--thumbnail-size, 150px)}@media screen and (max-width:640px){#ecommreels-admin-app .ecr-admin-reelitem{width:var(--thumbnail-size-mobile, 150px)}}@media screen and (max-width:991px)and (min-width:640px){#ecommreels-admin-app .ecr-admin-reelitem{width:var(--thumbnail-size-tab, 150px)}}#ecommreels-admin-app .ecr-admin-reelitem__frame{position:relative;display:flex;align-items:center;justify-content:center;overflow:hidden;transition:aspect-ratio .2s ease}#ecommreels-admin-app .ecr-admin-reelitem__actions{position:absolute;top:100%;left:0;z-index:1;display:flex;height:50%;width:100%;cursor:pointer;align-items:center;justify-content:center;gap:12px;background:#bfdbfee6;transition:top .2s ease}#ecommreels-admin-app .ecr-admin-reelitem__frame:hover .ecr-admin-reelitem__actions{top:50%}#ecommreels-admin-app .ecr-admin-reelitem__button{background:#fff;color:#111827;padding:4px;border-radius:6px}#ecommreels-admin-app .ecr-admin-reelitem__button:hover{background:#fff}#ecommreels-admin-app .ecr-admin-reelitem__button--danger{color:#ef4444}#ecommreels-admin-app .ecr-admin-reelitem__icon{width:16px;height:16px}#ecommreels-admin-app .ecr-admin-reelitem__spinner{animation:ecr-reelitem-spin 1s linear infinite}#ecommreels-admin-app .ecr-admin-reelitem__link{display:inline-flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-admin-reelitem__link--disabled{pointer-events:none}#ecommreels-admin-app .ecr-admin-reelitem__link--active{pointer-events:auto}#ecommreels-admin-app .zoom-in,#ecommreels-admin-app .zoom-out{transition:transform .2s ease}#ecommreels-admin-app .zoom-in:hover{transform:scale(1.05)}#ecommreels-admin-app .zoom-out:hover{transform:scale(.95)}#ecommreels-admin-app .ecr-admin-reel__title{width:100%;margin:6px 0 0;text-align:center;font-size:13px;font-weight:500;text-transform:capitalize;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@keyframes ecr-reelitem-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-product-card-one,.ecommreels-short-code .ecr-product-card-one,.reelswp-group-short-code .ecr-product-card-one,.reelswp-reel-short-code .ecr-product-card-one{display:flex;flex-direction:column;align-items:stretch;gap:16px;background-color:#0003;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);border-radius:8px;padding:8px;overflow:hidden;border:1px solid rgba(255,255,255,.2);flex-shrink:0;border-bottom-left-radius:max(calc(var(--thumbnail-border-radius, 0px) - 4px),8px);border-bottom-right-radius:max(calc(var(--thumbnail-border-radius, 0px) - 4px),8px);transition:all .3s ease-in-out;min-height:var(--thumbnail-border-radius);padding-inline:max(var(--thumbnail-border-radius, 8px) / 5,8px)}#ecommreels-admin-app .ecr-product-card-one-content-wrapper,.ecommreels-short-code .ecr-product-card-one-content-wrapper,.reelswp-group-short-code .ecr-product-card-one-content-wrapper,.reelswp-reel-short-code .ecr-product-card-one-content-wrapper{display:flex;align-items:center;gap:8px;flex-shrink:0}#ecommreels-admin-app .ecr-product-card-one__thumb,.ecommreels-short-code .ecr-product-card-one__thumb,.reelswp-group-short-code .ecr-product-card-one__thumb,.reelswp-reel-short-code .ecr-product-card-one__thumb{pointer-events:none;width:40px;height:40px;flex-shrink:0;border-radius:4px}#ecommreels-admin-app .ecr-product-card-one__content,.ecommreels-short-code .ecr-product-card-one__content,.reelswp-group-short-code .ecr-product-card-one__content,.reelswp-reel-short-code .ecr-product-card-one__content{flex-grow:1;display:flex;flex-direction:column;align-items:flex-start;gap:4px;overflow:hidden}#ecommreels-admin-app .ecr-product-card-one p.ecr-product-card-one__title,.ecommreels-short-code .ecr-product-card-one p.ecr-product-card-one__title,.reelswp-group-short-code .ecr-product-card-one p.ecr-product-card-one__title,.reelswp-reel-short-code .ecr-product-card-one p.ecr-product-card-one__title,#ecommreels-admin-app .ecr-product-card-one a.ecr-product-card-one__title,.ecommreels-short-code .ecr-product-card-one a.ecr-product-card-one__title,.reelswp-group-short-code .ecr-product-card-one a.ecr-product-card-one__title,.reelswp-reel-short-code .ecr-product-card-one a.ecr-product-card-one__title{max-width:100%;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;font-weight:500;line-height:1.2;color:#fff;text-decoration:none}:is(#ecommreels-admin-app .ecr-product-card-one p.ecr-product-card-one__title,.ecommreels-short-code .ecr-product-card-one p.ecr-product-card-one__title,.reelswp-group-short-code .ecr-product-card-one p.ecr-product-card-one__title,.reelswp-reel-short-code .ecr-product-card-one p.ecr-product-card-one__title,#ecommreels-admin-app .ecr-product-card-one a.ecr-product-card-one__title,.ecommreels-short-code .ecr-product-card-one a.ecr-product-card-one__title,.reelswp-group-short-code .ecr-product-card-one a.ecr-product-card-one__title,.reelswp-reel-short-code .ecr-product-card-one a.ecr-product-card-one__title):hover{text-decoration:underline}#ecommreels-admin-app .ecr-product-card-one__meta,.ecommreels-short-code .ecr-product-card-one__meta,.reelswp-group-short-code .ecr-product-card-one__meta,.reelswp-reel-short-code .ecr-product-card-one__meta{display:flex;flex-wrap:wrap;column-gap:8px;row-gap:4px}#ecommreels-admin-app .ecr-product-card-one__rating,.ecommreels-short-code .ecr-product-card-one__rating,.reelswp-group-short-code .ecr-product-card-one__rating,.reelswp-reel-short-code .ecr-product-card-one__rating{margin-left:4px;display:flex;align-items:center;gap:4px;font-size:12px;color:#fff}#ecommreels-admin-app .ecr-product-card-one__star,.ecommreels-short-code .ecr-product-card-one__star,.reelswp-group-short-code .ecr-product-card-one__star,.reelswp-reel-short-code .ecr-product-card-one__star{width:12px;height:12px;color:#fff}#ecommreels-admin-app .ecr-product-card-one__price,.ecommreels-short-code .ecr-product-card-one__price,.reelswp-group-short-code .ecr-product-card-one__price,.reelswp-reel-short-code .ecr-product-card-one__price{display:flex;align-items:center;gap:.25ch;color:#fff}#ecommreels-admin-app .ecr-product-card-one__price *,.ecommreels-short-code .ecr-product-card-one__price *,.reelswp-group-short-code .ecr-product-card-one__price *,.reelswp-reel-short-code .ecr-product-card-one__price *{line-height:1;background-color:transparent;color:#fff;font-size:12px}#ecommreels-admin-app .ecr-product-card-one__price span.woocommerce-Price-amount,.ecommreels-short-code .ecr-product-card-one__price span.woocommerce-Price-amount,.reelswp-group-short-code .ecr-product-card-one__price span.woocommerce-Price-amount,.reelswp-reel-short-code .ecr-product-card-one__price span.woocommerce-Price-amount{line-height:normal}#ecommreels-admin-app .ecr-product-card-one__price ins,.ecommreels-short-code .ecr-product-card-one__price ins,.reelswp-group-short-code .ecr-product-card-one__price ins,.reelswp-reel-short-code .ecr-product-card-one__price ins{text-decoration:none}#ecommreels-admin-app .ecr-thumb__link-wrapper,.ecommreels-short-code .ecr-thumb__link-wrapper,.reelswp-group-short-code .ecr-thumb__link-wrapper,.reelswp-reel-short-code .ecr-thumb__link-wrapper{display:flex;flex-direction:column;gap:4px;flex-shrink:0}#ecommreels-admin-app .ecr-thumb__link-wrapper a.ecr-thumb__link,.ecommreels-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link,.reelswp-group-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link,.reelswp-reel-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link{display:grid;place-items:center;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;border-radius:8px;background-color:transparent;position:relative;min-height:max(var(--thumbnail-border-radius, 48px),48px);text-align:center;font-size:16px;font-weight:600;color:#fff;text-decoration:none;border:1px solid #fff;border-bottom-left-radius:max(var(--thumbnail-border-radius, 8px),8px);border-bottom-right-radius:max(var(--thumbnail-border-radius, 8px),8px);transition:all .3s ease-in-out;isolation:isolate}:is(#ecommreels-admin-app .ecr-thumb__link-wrapper a.ecr-thumb__link,.ecommreels-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link,.reelswp-group-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link,.reelswp-reel-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link):hover{text-decoration:underline}:is(#ecommreels-admin-app .ecr-thumb__link-wrapper a.ecr-thumb__link,.ecommreels-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link,.reelswp-group-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link,.reelswp-reel-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link):before{content:"";position:absolute;inset:0;background-color:#0003;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);border-radius:8px;border-bottom-left-radius:max(var(--thumbnail-border-radius, 8px),8px);border-bottom-right-radius:max(var(--thumbnail-border-radius, 8px),8px);overflow:hidden;z-index:-1;transition:all .3s ease-in-out}#ecommreels-admin-app .ecr-admin-reelitem-links,.ecommreels-short-code .ecr-admin-reelitem-links,.reelswp-group-short-code .ecr-admin-reelitem-links,.reelswp-reel-short-code .ecr-admin-reelitem-links{display:flex;align-items:center;gap:8px;overflow:hidden;margin-top:8px;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-admin-reelitem-links[data-dragging=true] *,.ecommreels-short-code .ecr-admin-reelitem-links[data-dragging=true] *,.reelswp-group-short-code .ecr-admin-reelitem-links[data-dragging=true] *,.reelswp-reel-short-code .ecr-admin-reelitem-links[data-dragging=true] *{pointer-events:none}#ecommreels-admin-app .ecr-reel_title,.ecommreels-short-code .ecr-reel_title,.reelswp-group-short-code .ecr-reel_title,.reelswp-reel-short-code .ecr-reel_title{position:absolute;left:50%;transform:translate(-50%);bottom:8px;text-transform:capitalize;background-color:#0003;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);padding:4px 8px;color:#fff;width:95%;border-radius:8px;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-bottom:0}#ecommreels-admin-app .ecr-admin-editor-carousel{position:relative;max-width:100%}#ecommreels-admin-app .ecr-admin-editor-carousel__viewport{cursor:grab;overflow:hidden;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-admin-editor-carousel__viewport:active{cursor:grabbing}#ecommreels-admin-app .ecr-admin-editor-carousel__track{display:flex;width:max-content;flex-wrap:nowrap;padding:16px 0;gap:var(--thumbnail-gap, 16px)}@media screen and (max-width:640px){#ecommreels-admin-app .ecr-admin-editor-carousel__track{gap:var(--thumbnail-gap-mobile, 16px)}}@media screen and (max-width:991px)and (min-width:640px){#ecommreels-admin-app .ecr-admin-editor-carousel__track{gap:var(--thumbnail-gap-tab, 16px)}}#ecommreels-admin-app .ecr-admin-editor-carousel__track--padded{padding:16px}#ecommreels-admin-app .ecr-admin-editor-carousel__empty{display:flex;width:100%;justify-content:center}#ecommreels-admin-app .ecr-admin-editor-carousel__empty-text{margin:0;display:flex;width:320px;flex-direction:column;align-items:center;gap:8px;text-align:center;font-size:15px;color:#374151}#ecommreels-admin-app .ecr-admin-editor-carousel__empty-icon{width:40px;height:40px;color:#f59e0b}#ecommreels-admin-app .ecr-admin-editor-carousel__nav{position:absolute;top:50%;z-index:2;transform:translateY(-50%);border:none;background:#fff;padding:6px 8px;color:#374151;cursor:pointer;width:32px;height:40px;transition:background-color .2s ease;display:flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-admin-editor-carousel__nav:hover{background:#dbeafe}#ecommreels-admin-app .ecr-admin-editor-carousel__nav--left{left:0;border-radius:0 999px 999px 0}#ecommreels-admin-app .ecr-admin-editor-carousel__nav--right{right:0;border-radius:999px 0 0 999px}#ecommreels-admin-app .ecr-admin-editor-grid{display:flex;flex-wrap:wrap;row-gap:16px;column-gap:var(--thumbnail-gap, 16px)}@media screen and (max-width:640px){#ecommreels-admin-app .ecr-admin-editor-grid{column-gap:var(--thumbnail-gap-mobile, 16px)}}@media screen and (max-width:991px)and (min-width:640px){#ecommreels-admin-app .ecr-admin-editor-grid{column-gap:var(--thumbnail-gap-tab, 16px)}}#ecommreels-admin-app .ecr-admin-editor-grid--padded{padding:16px}#ecommreels-admin-app .ecr-admin-editor-grid__empty{display:flex;width:100%;justify-content:center;padding-top:160px}#ecommreels-admin-app .ecr-admin-editor-grid__empty-text{margin:0;display:flex;width:320px;flex-direction:column;align-items:center;gap:8px;text-align:center;font-size:15px;color:#374151}#ecommreels-admin-app .ecr-admin-editor-grid__empty-icon{width:40px;height:40px;color:#f59e0b}#ecommreels-admin-app .ecr-admin-existing{width:100%;flex:1;overflow:hidden;border-radius:8px;border:1px solid #e5e7eb;background:#fff}#ecommreels-admin-app .ecr-admin-existing__header{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px;border-bottom:1px solid #e5e7eb;padding:16px 16px 8px}#ecommreels-admin-app .ecr-admin-existing__title-wrapper{display:flex;flex-direction:column}#ecommreels-admin-app .ecr-admin-existing__title{margin:0;font-size:16px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-existing__body{max-height:800px;overflow-y:auto;padding:8px 16px 16px}#ecommreels-admin-app .ecr-preview-player{background-color:#000000b3;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);display:grid;place-items:center;padding:24px;width:100%;min-height:320px;border-radius:4px;container-type:inline-size}#ecommreels-admin-app .ecr-preview-player__stage{position:relative;width:fit-content;height:fit-content}#ecommreels-admin-app .ecr-preview-player .ecr-player__frame{position:relative;aspect-ratio:9 / 16;height:min(70vh,560px);max-width:90vw;overflow:hidden;border-radius:24px}#ecommreels-admin-app .ecr-preview-player__media{width:100%;height:100%}#ecommreels-admin-app .ecr-preview-player__media-item{width:100%;object-fit:cover;display:block}#ecommreels-admin-app .ecr-preview-player__nav--disabled{opacity:.4;cursor:not-allowed}#ecommreels-admin-app .ecr-player__close{position:absolute;top:8px;right:8px;z-index:5;color:#fff;cursor:pointer;mix-blend-mode:difference;line-height:1;background:transparent;border:none}#ecommreels-admin-app .ecr-player__close-icon{font-size:22px;font-weight:800}#ecommreels-admin-app .ecr-player__controls{position:absolute;top:8px;right:40px;z-index:5;display:inline-flex;align-items:center;gap:10px;color:#fff;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-preview-message{font-size:12px;color:#e9e8e8;width:100%;max-width:300px;margin-left:auto;padding-top:12px}@container (width > 992px){#ecommreels-admin-app .ecr-preview-message{position:absolute;right:0;bottom:6px}}#ecommreels-admin-app .ecr-admin-reellist{display:flex;flex-direction:column;min-height:100%;width:100%;flex-shrink:0;overflow-y:auto;border-radius:8px;border:1px solid #e5e7eb;background:#fff;box-shadow:0 1px 2px #0000000d}@media(min-width:1200px){#ecommreels-admin-app .ecr-admin-reellist{width:280px}}#ecommreels-admin-app .ecr-admin-reellist__header{border-bottom:1px solid #e5e7eb;padding:16px 16px 8px;display:flex;flex-direction:column}#ecommreels-admin-app .ecr-admin-reellist__title{margin:0;font-size:16px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-reellist__body{margin-top:8px;display:flex;flex-direction:column;gap:12px;padding:0 16px 16px}#ecommreels-admin-app .ecr-admin-reellist__add-button{width:100%;flex-shrink:0;margin-inline-start:0;border:1px solid #2563eb;background:#fff}#ecommreels-admin-app .ecr-admin-reellist__add-button:hover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-reellist__search-input{width:100%;border-radius:4px;border:1px solid #e5e7eb;padding:8px 12px;font-size:13px}#ecommreels-admin-app .ecr-admin-reellist__search-input:focus{outline:none;border-color:#93c5fd;box-shadow:0 0 0 2px #3b82f626}#ecommreels-admin-app .ecr-admin-reellist__grid{margin-top:16px;max-height:60vh;width:100%;overflow-y:auto}#ecommreels-admin-app .ecr-admin-reellist__items{width:100%;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}@media(min-width:767px)and (max-width:1199px){#ecommreels-admin-app .ecr-admin-reellist__items{grid-template-columns:repeat(4,minmax(0,1fr))}}@media(min-width:1200px){#ecommreels-admin-app .ecr-admin-reellist__items{grid-template-columns:repeat(2,minmax(0,1fr))}}#ecommreels-admin-app .ecr-admin-reellist__empty{grid-column:1 / -1;padding:24px 0;text-align:center;font-size:13px;color:#6b7280}#ecommreels-admin-app .ecr-admin-reellist__item{width:100%}#ecommreels-admin-app .ecr-admin-reellist__card{position:relative;width:100%;overflow:hidden;border-radius:6px;border:2px solid #e5e7eb;transition:border-color .2s ease;padding:0}#ecommreels-admin-app .ecr-admin-reellist__card:hover{border-color:#3b82f6}#ecommreels-admin-app .ecr-admin-reellist__media{aspect-ratio:9 / 16;width:100%}#ecommreels-admin-app .ecr-admin-reellist__thumb{pointer-events:none;display:block;width:100%;height:100%;object-fit:cover}#ecommreels-admin-app .ecr-admin-reellist__label{position:absolute;bottom:0;left:0;width:100%;padding:4px;background:linear-gradient(0deg,#fff 20%,#fff0);font-size:13px;font-weight:600;color:#111827;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#ecommreels-admin-app .ecr-admin-reellist__overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:#ffffffbf}#ecommreels-admin-app .ecr-admin-reellist__overlay-icon{width:24px;height:24px;color:#3b82f6;animation:ecr-reellist-spin 1s linear infinite}#ecommreels-admin-app .ecr-admin-reellist__loader{grid-column:1 / -1;display:flex;justify-content:center;padding:24px 0}#ecommreels-admin-app .ecr-admin-reellist__spinner{width:24px;height:24px;border-radius:999px;border:2px solid #cbd5e1;border-top-color:#3b82f6;animation:ecr-reellist-spin 1s linear infinite}@keyframes ecr-reellist-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-tabs{display:flex;flex-direction:column;gap:8px}#ecommreels-admin-app .ecr-tabs__list{display:inline-flex;align-items:center;background:var(--color-muted, #f3f4f6);border-radius:10px;padding:3px;width:fit-content}#ecommreels-admin-app .ecr-tabs__trigger{border:1px solid transparent;border-radius:8px;padding:8px;font-size:13px;font-weight:600;color:var(--color-muted-foreground, #6b7280);background:transparent;transition:background-color .2s ease,color .2s ease,border-color .2s ease}#ecommreels-admin-app .ecr-tabs__trigger[data-state=active]{background:#fff;color:var(--color-foreground, #111827);border-color:var(--color-border, #e5e7eb);box-shadow:0 1px 2px #0000000f}#ecommreels-admin-app .ecr-tabs__content{outline:none}#ecommreels-admin-app .ecr-admin-sidepanel{position:relative;display:flex;flex-direction:column;min-height:100%;max-height:100%;flex-shrink:0;overflow:hidden;border-radius:8px;transition:width .2s ease}#ecommreels-admin-app .ecr-admin-sidepanel--expanded{width:100%;max-height:100%;position:absolute;right:16px;top:0}#ecommreels-admin-app .ecr-admin-mobile-overlay{position:fixed;top:0;left:0;width:100vw;height:100vh;background:#0f172abf;z-index:5}#ecommreels-admin-app .ecr-admin-sidepanel-content{width:280px;background:#fff;margin-left:auto;border:2px solid #e5e7eb;height:100vh;position:fixed;top:0;right:0}@media(max-width:1024px)and (min-width:640px){#ecommreels-admin-app .ecr-admin-sidepanel-content{padding-top:32px}}@media(max-width:1200px){#ecommreels-admin-app .ecr-admin-sidepanel-content{z-index:999}}@media(min-width:1200px){#ecommreels-admin-app .ecr-admin-sidepanel--expanded{position:static}#ecommreels-admin-app .ecr-admin-mobile-overlay{display:none}#ecommreels-admin-app .ecr-admin-sidepanel-content{position:static;width:280px;background:#fff;margin-left:0;border:2px solid #e5e7eb;height:100%;border-radius:8px}#ecommreels-admin-app .ecr-admin-sidepanel--expanded{width:fit-content}}#ecommreels-admin-app .ecr-admin-sidepanel--collapsed{width:0;border:0;pointer-events:none}#ecommreels-admin-app .ecr-admin-sidepanel__header{position:relative;display:flex;flex-direction:column;border-bottom:1px solid #e5e7eb;padding:16px 16px 8px}#ecommreels-admin-app .ecr-admin-sidepanel__title{margin:0;font-size:15px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-sidepanel__body{height:100%;overflow-x:hidden;padding:8px 16px 16px}#ecommreels-admin-app .ecr-admin-sidepanel__tabs,#ecommreels-admin-app .ecr-admin-sidepanel__tabs-list{width:100%}#ecommreels-admin-app .ecr-admin-sidepanel__tabs-list{display:grid;grid-template-columns:1fr 1fr}#ecommreels-admin-app .ecr-admin-sidepanel__lock-trigger{display:flex;cursor:pointer;align-items:center;justify-content:center;gap:4px;font-size:13px;color:#6b7280;text-transform:capitalize;padding:8px}#ecommreels-admin-app .ecr-admin-sidepanel__popover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-switch{display:inline-flex;align-items:center;gap:8px;cursor:pointer;font-size:14px;font-weight:500;color:#6b7280}#ecommreels-admin-app .ecr-admin-switch__label{display:inline-flex;align-items:center;gap:4px}#ecommreels-admin-app .ecr-admin-switch__icon{color:#6b7280}#ecommreels-admin-app .ecr-admin-popover{background:#eff6ff}#ecommreels-admin-app .ecr-select__trigger{display:inline-flex;align-items:center;justify-content:space-between;gap:8px;border:1px solid var(--color-border, #d1d5db);border-radius:6px;padding:7.2px 12px;font-size:13px;background:#fff;color:var(--color-foreground, #111827);min-width:fit-content}#ecommreels-admin-app .ecr-select__trigger[data-size=sm]{height:32px}#ecommreels-admin-app .ecr-select__trigger[data-size=default]{height:36px}#ecommreels-admin-app .ecr-select__trigger:focus-visible{outline:none;border-color:var(--color-ring, #60a5fa);box-shadow:0 0 0 3px color-mix(in srgb,#60a5fa 35%,transparent)}#ecommreels-admin-app .ecr-select__icon{width:16px;height:16px;opacity:.6}#ecommreels-admin-app .ecr-select__content{background:#fff;color:var(--color-foreground, #111827);border:1px solid var(--color-border, #d1d5db);border-radius:8px;box-shadow:0 10px 30px #00000026;overflow:hidden;min-width:140px;z-index:999}#ecommreels-admin-app .ecr-select__content[data-side=bottom]{animation:ecr-fade-down .15s ease-out}#ecommreels-admin-app .ecr-select__content[data-side=top]{animation:ecr-fade-up .15s ease-out}#ecommreels-admin-app .ecr-select__viewport{padding:5.6px}#ecommreels-admin-app .ecr-select__item{display:flex;align-items:center;gap:8px;border-radius:6px;padding:8px;font-size:13px;cursor:pointer;text-transform:capitalize}#ecommreels-admin-app .ecr-select__item[data-highlighted]{background:var(--color-accent, #f3f4f6)}#ecommreels-admin-app .ecr-select__item[data-disabled]{opacity:.5;cursor:not-allowed}#ecommreels-admin-app .ecr-select__label{padding:5.6px 8px;font-size:12px;color:var(--color-muted-foreground, #6b7280)}#ecommreels-admin-app .ecr-select__separator{height:1px;margin:4px 0;background:var(--color-border, #e5e7eb)}#ecommreels-admin-app .ecr-select__check{position:absolute;right:8px;width:14px;height:14px;display:inline-flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-select__check-icon{width:14px;height:14px}#ecommreels-admin-app .ecr-select__scroll-button{display:flex;align-items:center;justify-content:center;padding:4px 0;cursor:default}@keyframes ecr-fade-down{0%{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:translateY(0)}}@keyframes ecr-fade-up{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}#ecommreels-admin-app .ecr-admin-thumb-controls{display:flex;flex-direction:column;gap:16px}#ecommreels-admin-app .ecr-admin-thumb-controls__section{border:1px solid var(--color-border, #e5e7eb);border-radius:10px;padding:12px;background:#fff;display:flex;flex-direction:column}#ecommreels-admin-app .ecr-admin-thumb-controls__section-trigger{align-items:center;background:transparent;border:none;color:var(--color-foreground, #111827);cursor:pointer;display:flex;font-size:13px;font-weight:600;justify-content:space-between;padding:0;text-align:left}#ecommreels-admin-app .ecr-admin-thumb-controls__section-content{display:flex;flex-direction:column;gap:16px}#ecommreels-admin-app .ecr-admin-thumb-controls__section-content[data-state=open]{margin-top:12px;padding-top:12px;border-top:1px solid #e5e7eb}#ecommreels-admin-app .ecr-collapsible__trigger{align-items:center;display:inline-flex;gap:8px;justify-content:space-between;width:100%}#ecommreels-admin-app .ecr-collapsible__trigger-label{align-items:center;display:inline-flex;gap:4px}#ecommreels-admin-app .ecr-collapsible__trigger-icon{height:16px;width:16px;transition:transform .2s ease}#ecommreels-admin-app .ecr-collapsible__trigger[data-state=open] .ecr-collapsible__trigger-icon{transform:rotate(180deg)}#ecommreels-admin-app .ecr-admin-control{display:flex;flex-direction:column;align-items:flex-start;gap:4px}#ecommreels-admin-app .ecr-admin-control--row,#ecommreels-admin-app .ecr-admin-control--inline{flex-direction:row;align-items:center;flex-wrap:wrap;gap:8px}#ecommreels-admin-app .ecr-admin-control__label{margin:0;font-size:13px;font-weight:600;white-space:nowrap;color:#374151}#ecommreels-admin-app .ecr-admin-control__row{display:flex;align-items:center;gap:12px}#ecommreels-admin-app .ecr-admin-control__row--color{position:relative}#ecommreels-admin-app .ecr-admin-control__choice{display:flex;align-items:center;gap:4px}#ecommreels-admin-app .ecr-admin-control__choice-label{cursor:pointer;display:flex;align-items:center;gap:4px}#ecommreels-admin-app .ecr-admin-control__trigger,#ecommreels-admin-app .ecr-admin-control__option{text-transform:capitalize}.ecr-admin-control__lock-trigger{display:flex;width:100%;align-items:center;justify-content:space-between;gap:8px;padding:6px 8px;font-size:13px;color:#6b7280;cursor:pointer;border:none}.ecr-admin-control__lock-trigger:hover{background:#f3f4f6}.ecr-admin-control__popover{background:#eff6ff}.ecr-admin-control__swatch{width:24px;height:24px;cursor:pointer;border-radius:4px;border:2px solid #6b7280}#ecommreels-admin-app .ecr-admin-control__picker{position:absolute;top:100%;left:0;z-index:9;box-shadow:0 8px 16px #0000001f;outline:none}#ecommreels-admin-app .ecr-admin-control__hex{width:80px;border-radius:4px;border:1px solid #6b7280;padding:6px 8px}#ecommreels-admin-app,.ecommreels-short-code,.reelswp-group-short-code,.reelswp-reel-short-code{--reels-wp-animation-time: 3s;--reels-wp-marquee-time: 20s}#ecommreels-admin-app .ecr-player__loader,.ecommreels-short-code .ecr-player__loader,.reelswp-group-short-code .ecr-player__loader,.reelswp-reel-short-code .ecr-player__loader{height:90vh;max-width:100vw;aspect-ratio:9 / 16;border-radius:16px;border:1px solid #e5e7eb;display:flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-loader,.ecommreels-short-code .ecr-loader,.reelswp-group-short-code .ecr-loader,.reelswp-reel-short-code .ecr-loader{width:100%;height:100%;display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:10px}#ecommreels-admin-app .ecr-loader__ball,.ecommreels-short-code .ecr-loader__ball,.reelswp-group-short-code .ecr-loader__ball,.reelswp-reel-short-code .ecr-loader__ball{width:20px;height:20px;border-radius:50%;background:#919191;animation:ecr-bounce 1s alternate infinite}#ecommreels-admin-app .ecr-loader__ball:nth-child(2),.ecommreels-short-code .ecr-loader__ball:nth-child(2),.reelswp-group-short-code .ecr-loader__ball:nth-child(2),.reelswp-reel-short-code .ecr-loader__ball:nth-child(2){animation-delay:.25s}#ecommreels-admin-app .ecr-loader__ball:nth-child(3),.ecommreels-short-code .ecr-loader__ball:nth-child(3),.reelswp-group-short-code .ecr-loader__ball:nth-child(3),.reelswp-reel-short-code .ecr-loader__ball:nth-child(3){animation-delay:.5s}@keyframes ecr-bounce{0%{transform:scale(2)}to{transform:scale(1)}}#ecommreels-admin-app .ecr-thumb,.ecommreels-short-code .ecr-thumb,.reelswp-group-short-code .ecr-thumb,.reelswp-reel-short-code .ecr-thumb{display:block;width:var(--thumbnail-size, 150px)}@media screen and (max-width:640px){#ecommreels-admin-app .ecr-thumb,.ecommreels-short-code .ecr-thumb,.reelswp-group-short-code .ecr-thumb,.reelswp-reel-short-code .ecr-thumb{width:var(--thumbnail-size-mobile, 150px)}}@media screen and (max-width:991px)and (min-width:640px){#ecommreels-admin-app .ecr-thumb,.ecommreels-short-code .ecr-thumb,.reelswp-group-short-code .ecr-thumb,.reelswp-reel-short-code .ecr-thumb{width:var(--thumbnail-size-tab, 150px)}}#ecommreels-admin-app .ecr-thumb__frame,.ecommreels-short-code .ecr-thumb__frame,.reelswp-group-short-code .ecr-thumb__frame,.reelswp-reel-short-code .ecr-thumb__frame{overflow:hidden;width:100%;position:relative}#ecommreels-admin-app .zoom-in,.ecommreels-short-code .zoom-in,.reelswp-group-short-code .zoom-in,.reelswp-reel-short-code .zoom-in,#ecommreels-admin-app .zoom-out,.ecommreels-short-code .zoom-out,.reelswp-group-short-code .zoom-out,.reelswp-reel-short-code .zoom-out{transition:transform .2s ease-in-out}#ecommreels-admin-app .zoom-in:hover,.ecommreels-short-code .zoom-in:hover,.reelswp-group-short-code .zoom-in:hover,.reelswp-reel-short-code .zoom-in:hover{transform:scale(1.05)}#ecommreels-admin-app .zoom-out:hover,.ecommreels-short-code .zoom-out:hover,.reelswp-group-short-code .zoom-out:hover,.reelswp-reel-short-code .zoom-out:hover{transform:scale(.95)}#ecommreels-admin-app .ecr-reel__title,.ecommreels-short-code .ecr-reel__title,.reelswp-group-short-code .ecr-reel__title,.reelswp-reel-short-code .ecr-reel__title{width:100%;margin:6px 0 0;text-align:center;font-size:13px;font-weight:500;text-transform:capitalize;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#ecommreels-admin-app .ecr-front-carousel,.ecommreels-short-code .ecr-front-carousel,.reelswp-group-short-code .ecr-front-carousel,.reelswp-reel-short-code .ecr-front-carousel{position:relative;max-width:100%}#ecommreels-admin-app .ecr-front-carousel__viewport,.ecommreels-short-code .ecr-front-carousel__viewport,.reelswp-group-short-code .ecr-front-carousel__viewport,.reelswp-reel-short-code .ecr-front-carousel__viewport{cursor:grab;overflow:hidden;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-front-carousel__track,.ecommreels-short-code .ecr-front-carousel__track,.reelswp-group-short-code .ecr-front-carousel__track,.reelswp-reel-short-code .ecr-front-carousel__track{display:flex;flex-wrap:nowrap;width:max-content;gap:var(--thumbnail-gap, 16px)}@media screen and (max-width:640px){#ecommreels-admin-app .ecr-front-carousel__track,.ecommreels-short-code .ecr-front-carousel__track,.reelswp-group-short-code .ecr-front-carousel__track,.reelswp-reel-short-code .ecr-front-carousel__track{gap:var(--thumbnail-gap-mobile, 16px)}}@media screen and (max-width:991px)and (min-width:640px){#ecommreels-admin-app .ecr-front-carousel__track,.ecommreels-short-code .ecr-front-carousel__track,.reelswp-group-short-code .ecr-front-carousel__track,.reelswp-reel-short-code .ecr-front-carousel__track{gap:var(--thumbnail-gap-tab, 16px)}}#ecommreels-admin-app .ecr-front-carousel__track--zoom,.ecommreels-short-code .ecr-front-carousel__track--zoom,.reelswp-group-short-code .ecr-front-carousel__track--zoom,.reelswp-reel-short-code .ecr-front-carousel__track--zoom{padding:16px}#ecommreels-admin-app .ecr-front-carousel__nav,.ecommreels-short-code .ecr-front-carousel__nav,.reelswp-group-short-code .ecr-front-carousel__nav,.reelswp-reel-short-code .ecr-front-carousel__nav{position:absolute;top:50%;z-index:1;transform:translateY(-50%);border:none;background:#fff;color:#1f2937;cursor:pointer;width:32px;height:40px;padding:0;display:flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-front-carousel__nav--left,.ecommreels-short-code .ecr-front-carousel__nav--left,.reelswp-group-short-code .ecr-front-carousel__nav--left,.reelswp-reel-short-code .ecr-front-carousel__nav--left{left:0;border-top-right-radius:999px;border-bottom-right-radius:999px}#ecommreels-admin-app .ecr-front-carousel__nav--right,.ecommreels-short-code .ecr-front-carousel__nav--right,.reelswp-group-short-code .ecr-front-carousel__nav--right,.reelswp-reel-short-code .ecr-front-carousel__nav--right{right:0;border-top-left-radius:999px;border-bottom-left-radius:999px}#ecommreels-admin-app .ecr-front-carousel__nav:hover,.ecommreels-short-code .ecr-front-carousel__nav:hover,.reelswp-group-short-code .ecr-front-carousel__nav:hover,.reelswp-reel-short-code .ecr-front-carousel__nav:hover{background:#dbeafe}#ecommreels-admin-app .ecr-front-grid,.ecommreels-short-code .ecr-front-grid,.reelswp-group-short-code .ecr-front-grid,.reelswp-reel-short-code .ecr-front-grid{cursor:default;overflow:hidden;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-front-grid__list,.ecommreels-short-code .ecr-front-grid__list,.reelswp-group-short-code .ecr-front-grid__list,.reelswp-reel-short-code .ecr-front-grid__list{display:grid;grid-template-columns:repeat(auto-fill,minmax(var(--thumbnail-size-grid, 150px),1fr));row-gap:16px;column-gap:var(--thumbnail-gap, 16px)}@media screen and (max-width:640px){#ecommreels-admin-app .ecr-front-grid__list,.ecommreels-short-code .ecr-front-grid__list,.reelswp-group-short-code .ecr-front-grid__list,.reelswp-reel-short-code .ecr-front-grid__list{column-gap:var(--thumbnail-gap-mobile, 16px);grid-template-columns:repeat(auto-fill,minmax(var(--thumbnail-size-grid-mobile, 150px),1fr))}}@media screen and (max-width:991px)and (min-width:640px){#ecommreels-admin-app .ecr-front-grid__list,.ecommreels-short-code .ecr-front-grid__list,.reelswp-group-short-code .ecr-front-grid__list,.reelswp-reel-short-code .ecr-front-grid__list{column-gap:var(--thumbnail-gap-tab, 16px);grid-template-columns:repeat(auto-fill,minmax(var(--thumbnail-size-grid-tab, 150px),1fr))}} 2 /*$vite$:1*/`,document.head.appendChild(ka);function Sa(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=Sa(_),xr=Sa(ja);function Nd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var In={exports:{}},Yt={};/**2 /*$vite$:1*/`,document.head.appendChild(ka);function Sa(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=Sa(_),xr=Sa(ja);function Td(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var In={exports:{}},Yt={};/** 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 Ca;function Ed(){if(Ca)return Yt;Ca=1;var e=_,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,i={key:!0,ref:!0,__self:!0,__source:!0};function s(l,c,d){var u,p={},m=null,g=null;d!==void 0&&(m=""+d),c.key!==void 0&&(m=""+c.key),c.ref!==void 0&&(g=c.ref);for(u in c)n.call(c,u)&&!i.hasOwnProperty(u)&&(p[u]=c[u]);if(l&&l.defaultProps)for(u in c=l.defaultProps,c)p[u]===void 0&&(p[u]=c[u]);return{$$typeof:t,type:l,key:m,ref:g,props:p,_owner:o.current}}return Yt.Fragment=r,Yt.jsx=s,Yt.jsxs=s,Yt}var Na;function Td(){return Na||(Na=1,In.exports=Ed()),In.exports}var a=Td();/**10 */var Ca;function Ad(){if(Ca)return Yt;Ca=1;var e=_,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,i={key:!0,ref:!0,__self:!0,__source:!0};function s(l,c,d){var u,p={},m=null,g=null;d!==void 0&&(m=""+d),c.key!==void 0&&(m=""+c.key),c.ref!==void 0&&(g=c.ref);for(u in c)n.call(c,u)&&!i.hasOwnProperty(u)&&(p[u]=c[u]);if(l&&l.defaultProps)for(u in c=l.defaultProps,c)p[u]===void 0&&(p[u]=c[u]);return{$$typeof:t,type:l,key:m,ref:g,props:p,_owner:o.current}}return Yt.Fragment=r,Yt.jsx=s,Yt.jsxs=s,Yt}var Na;function Pd(){return Na||(Na=1,In.exports=Ad()),In.exports}var a=Pd();/** 11 11 * @remix-run/router v1.23.2 12 12 * … … 17 17 * 18 18 * @license MIT 19 */function Xt(){return Xt=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},Xt.apply(this,arguments)}var nt;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(nt||(nt={}));const Ea="popstate";function Ad(e){e===void 0&&(e={});function t(o,i){let{pathname:s="/",search:l="",hash:c=""}=Jt(o.location.hash.substr(1));return!s.startsWith("/")&&!s.startsWith(".")&&(s="/"+s),Mn("",{pathname:s,search:l,hash:c},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function r(o,i){let s=o.document.querySelector("base"),l="";if(s&&s.getAttribute("href")){let c=o.location.href,d=c.indexOf("#");l=d===-1?c:c.slice(0,d)}return l+"#"+(typeof i=="string"?i:br(i))}function n(o,i){Ta(o.pathname.charAt(0)==="/","relative pathnames are not supported in hash history.push("+JSON.stringify(i)+")")}return Od(t,r,n,e)}function ye(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Ta(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 Aa(e,t){return{usr:e.state,key:e.key,idx:t}}function Mn(e,t,r,n){return r===void 0&&(r=null),Xt({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Jt(t):t,{state:r,key:t&&t.key||n||Pd()})}function br(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 Jt(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 Od(e,t,r,n){n===void 0&&(n={});let{window:o=document.defaultView,v5Compat:i=!1}=n,s=o.history,l=nt.Pop,c=null,d=u();d==null&&(d=0,s.replaceState(Xt({},s.state,{idx:d}),""));function u(){return(s.state||{idx:null}).idx}function p(){l=nt.Pop;let h=u(),v=h==null?null:h-d;d=h,c&&c({action:l,location:f.location,delta:v})}function m(h,v){l=nt.Push;let y=Mn(f.location,h,v);r&&r(y,h),d=u()+1;let w=Aa(y,d),j=f.createHref(y);try{s.pushState(w,"",j)}catch(C){if(C instanceof DOMException&&C.name==="DataCloneError")throw C;o.location.assign(j)}i&&c&&c({action:l,location:f.location,delta:1})}function g(h,v){l=nt.Replace;let y=Mn(f.location,h,v);r&&r(y,h),d=u();let w=Aa(y,d),j=f.createHref(y);s.replaceState(w,"",j),i&&c&&c({action:l,location:f.location,delta:0})}function b(h){let v=o.location.origin!=="null"?o.location.origin:o.location.href,y=typeof h=="string"?h:br(h);return y=y.replace(/ $/,"%20"),ye(v,"No window.location.(origin|href) available to create URL for href: "+y),new URL(y,v)}let f={get action(){return l},get location(){return e(o,s)},listen(h){if(c)throw new Error("A history only accepts one active listener");return o.addEventListener(Ea,p),c=h,()=>{o.removeEventListener(Ea,p),c=null}},createHref(h){return t(o,h)},createURL:b,encodeLocation(h){let v=b(h);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:m,replace:g,go(h){return s.go(h)}};return f}var Pa;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Pa||(Pa={}));function Oa(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 Rd=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ld=e=>Rd.test(e);function Id(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:o=""}=typeof e=="string"?Jt(e):e,i;if(r)if(Ld(r))i=r;else{if(r.includes("//")){let s=r;r=r.replace(/\/\/+/g,"/"),Ta(!1,"Pathnames cannot have embedded double slashes - normalizing "+(s+" -> "+r))}r.startsWith("/")?i=Ra(r.substring(1),"/"):i=Ra(r,t)}else i=t;return{pathname:i,search:zd(n),hash:Dd(o)}}function Ra(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 zn(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 Md(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function La(e,t){let r=Md(e);return t?r.map((n,o)=>o===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function Ia(e,t,r,n){n===void 0&&(n=!1);let o;typeof e=="string"?o=Jt(e):(o=Xt({},e),ye(!o.pathname||!o.pathname.includes("?"),zn("?","pathname","search",o)),ye(!o.pathname||!o.pathname.includes("#"),zn("#","pathname","hash",o)),ye(!o.search||!o.search.includes("#"),zn("#","search","hash",o)));let i=e===""||o.pathname==="",s=i?"/":o.pathname,l;if(s==null)l=r;else{let p=t.length-1;if(!n&&s.startsWith("..")){let m=s.split("/");for(;m[0]==="..";)m.shift(),p-=1;o.pathname=m.join("/")}l=p>=0?t[p]:"/"}let c=Id(o,l),d=s&&s!=="/"&&s.endsWith("/"),u=(i||s===".")&&r.endsWith("/");return!c.pathname.endsWith("/")&&(d||u)&&(c.pathname+="/"),c}const Ma=e=>e.join("/").replace(/\/\/+/g,"/"),zd=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Dd=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,za=["post","put","patch","delete"];new Set(za);const $d=["get",...za];new Set($d);/**19 */function Xt(){return Xt=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},Xt.apply(this,arguments)}var nt;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(nt||(nt={}));const Ea="popstate";function Od(e){e===void 0&&(e={});function t(o,i){let{pathname:s="/",search:l="",hash:c=""}=Jt(o.location.hash.substr(1));return!s.startsWith("/")&&!s.startsWith(".")&&(s="/"+s),Mn("",{pathname:s,search:l,hash:c},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function r(o,i){let s=o.document.querySelector("base"),l="";if(s&&s.getAttribute("href")){let c=o.location.href,d=c.indexOf("#");l=d===-1?c:c.slice(0,d)}return l+"#"+(typeof i=="string"?i:br(i))}function n(o,i){Ta(o.pathname.charAt(0)==="/","relative pathnames are not supported in hash history.push("+JSON.stringify(i)+")")}return Ld(t,r,n,e)}function ye(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Ta(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Rd(){return Math.random().toString(36).substr(2,8)}function Aa(e,t){return{usr:e.state,key:e.key,idx:t}}function Mn(e,t,r,n){return r===void 0&&(r=null),Xt({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Jt(t):t,{state:r,key:t&&t.key||n||Rd()})}function br(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 Jt(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 Ld(e,t,r,n){n===void 0&&(n={});let{window:o=document.defaultView,v5Compat:i=!1}=n,s=o.history,l=nt.Pop,c=null,d=u();d==null&&(d=0,s.replaceState(Xt({},s.state,{idx:d}),""));function u(){return(s.state||{idx:null}).idx}function p(){l=nt.Pop;let h=u(),v=h==null?null:h-d;d=h,c&&c({action:l,location:f.location,delta:v})}function m(h,v){l=nt.Push;let y=Mn(f.location,h,v);r&&r(y,h),d=u()+1;let w=Aa(y,d),j=f.createHref(y);try{s.pushState(w,"",j)}catch(C){if(C instanceof DOMException&&C.name==="DataCloneError")throw C;o.location.assign(j)}i&&c&&c({action:l,location:f.location,delta:1})}function g(h,v){l=nt.Replace;let y=Mn(f.location,h,v);r&&r(y,h),d=u();let w=Aa(y,d),j=f.createHref(y);s.replaceState(w,"",j),i&&c&&c({action:l,location:f.location,delta:0})}function b(h){let v=o.location.origin!=="null"?o.location.origin:o.location.href,y=typeof h=="string"?h:br(h);return y=y.replace(/ $/,"%20"),ye(v,"No window.location.(origin|href) available to create URL for href: "+y),new URL(y,v)}let f={get action(){return l},get location(){return e(o,s)},listen(h){if(c)throw new Error("A history only accepts one active listener");return o.addEventListener(Ea,p),c=h,()=>{o.removeEventListener(Ea,p),c=null}},createHref(h){return t(o,h)},createURL:b,encodeLocation(h){let v=b(h);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:m,replace:g,go(h){return s.go(h)}};return f}var Pa;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Pa||(Pa={}));function Oa(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 Id=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Md=e=>Id.test(e);function zd(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:o=""}=typeof e=="string"?Jt(e):e,i;if(r)if(Md(r))i=r;else{if(r.includes("//")){let s=r;r=r.replace(/\/\/+/g,"/"),Ta(!1,"Pathnames cannot have embedded double slashes - normalizing "+(s+" -> "+r))}r.startsWith("/")?i=Ra(r.substring(1),"/"):i=Ra(r,t)}else i=t;return{pathname:i,search:$d(n),hash:Fd(o)}}function Ra(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 zn(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 Dd(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function La(e,t){let r=Dd(e);return t?r.map((n,o)=>o===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function Ia(e,t,r,n){n===void 0&&(n=!1);let o;typeof e=="string"?o=Jt(e):(o=Xt({},e),ye(!o.pathname||!o.pathname.includes("?"),zn("?","pathname","search",o)),ye(!o.pathname||!o.pathname.includes("#"),zn("#","pathname","hash",o)),ye(!o.search||!o.search.includes("#"),zn("#","search","hash",o)));let i=e===""||o.pathname==="",s=i?"/":o.pathname,l;if(s==null)l=r;else{let p=t.length-1;if(!n&&s.startsWith("..")){let m=s.split("/");for(;m[0]==="..";)m.shift(),p-=1;o.pathname=m.join("/")}l=p>=0?t[p]:"/"}let c=zd(o,l),d=s&&s!=="/"&&s.endsWith("/"),u=(i||s===".")&&r.endsWith("/");return!c.pathname.endsWith("/")&&(d||u)&&(c.pathname+="/"),c}const Ma=e=>e.join("/").replace(/\/\/+/g,"/"),$d=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Fd=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,za=["post","put","patch","delete"];new Set(za);const Bd=["get",...za];new Set(Bd);/** 20 20 * React Router v6.30.3 21 21 * … … 26 26 * 27 27 * @license MIT 28 */function _r(){return _r=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},_r.apply(this,arguments)}const Da=x.createContext(null),_t=x.createContext(null),Dn=x.createContext(null),vr=x.createContext({outlet:null,matches:[],isDataRoute:!1});function Fd(e,t){let{relative:r}=t===void 0?{}:t;yr()||ye(!1);let{basename:n,navigator:o}=x.useContext(_t),{hash:i,pathname:s,search:l}=Fa(e,{relative:r}),c=s;return n!=="/"&&(c=s==="/"?n:Ma([n,s])),o.createHref({pathname:c,search:l,hash:i})}function yr(){return x.useContext(Dn)!=null}function wr(){return yr()||ye(!1),x.useContext(Dn).location}function $a(e){x.useContext(_t).static||x.useLayoutEffect(e)}function Ne(){let{isDataRoute:e}=x.useContext(vr);return e?Wd():Bd()}function Bd(){yr()||ye(!1);let e=x.useContext(Da),{basename:t,future:r,navigator:n}=x.useContext(_t),{matches:o}=x.useContext(vr),{pathname:i}=wr(),s=JSON.stringify(La(o,r.v7_relativeSplatPath)),l=x.useRef(!1);return $a(()=>{l.current=!0}),x.useCallback(function(d,u){if(u===void 0&&(u={}),!l.current)return;if(typeof d=="number"){n.go(d);return}let p=Ia(d,JSON.parse(s),i,u.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:Ma([t,p.pathname])),(u.replace?n.replace:n.push)(p,u.state,u)},[t,n,s,i,e])}function Fa(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=x.useContext(_t),{matches:o}=x.useContext(vr),{pathname:i}=wr(),s=JSON.stringify(La(o,n.v7_relativeSplatPath));return x.useMemo(()=>Ia(e,JSON.parse(s),i,r==="path"),[e,s,i,r])}var Ba=(function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e})(Ba||{}),Ua=(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})(Ua||{});function Ud(e){let t=x.useContext(Da);return t||ye(!1),t}function Hd(e){let t=x.useContext(vr);return t||ye(!1),t}function Vd(e){let t=Hd(),r=t.matches[t.matches.length-1];return r.route.id||ye(!1),r.route.id}function Wd(){let{router:e}=Ud(Ba.UseNavigateStable),t=Vd(Ua.UseNavigateStable),r=x.useRef(!1);return $a(()=>{r.current=!0}),x.useCallback(function(o,i){i===void 0&&(i={}),r.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,_r({fromRouteId:t},i)))},[e,t])}function qd(e,t){e?.v7_startTransition,e?.v7_relativeSplatPath}function Gd(e){let{basename:t="/",children:r=null,location:n,navigationType:o=nt.Pop,navigator:i,static:s=!1,future:l}=e;yr()&&ye(!1);let c=t.replace(/^\/*/,"/"),d=x.useMemo(()=>({basename:c,navigator:i,static:s,future:_r({v7_relativeSplatPath:!1},l)}),[c,l,i,s]);typeof n=="string"&&(n=Jt(n));let{pathname:u="/",search:p="",hash:m="",state:g=null,key:b="default"}=n,f=x.useMemo(()=>{let h=Oa(u,c);return h==null?null:{location:{pathname:h,search:p,hash:m,state:g,key:b},navigationType:o}},[c,u,p,m,g,b,o]);return f==null?null:x.createElement(_t.Provider,{value:d},x.createElement(Dn.Provider,{children:r,value:f}))}new Promise(()=>{});/**28 */function _r(){return _r=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},_r.apply(this,arguments)}const Da=x.createContext(null),_t=x.createContext(null),Dn=x.createContext(null),vr=x.createContext({outlet:null,matches:[],isDataRoute:!1});function Ud(e,t){let{relative:r}=t===void 0?{}:t;yr()||ye(!1);let{basename:n,navigator:o}=x.useContext(_t),{hash:i,pathname:s,search:l}=Fa(e,{relative:r}),c=s;return n!=="/"&&(c=s==="/"?n:Ma([n,s])),o.createHref({pathname:c,search:l,hash:i})}function yr(){return x.useContext(Dn)!=null}function wr(){return yr()||ye(!1),x.useContext(Dn).location}function $a(e){x.useContext(_t).static||x.useLayoutEffect(e)}function Ne(){let{isDataRoute:e}=x.useContext(vr);return e?Gd():Hd()}function Hd(){yr()||ye(!1);let e=x.useContext(Da),{basename:t,future:r,navigator:n}=x.useContext(_t),{matches:o}=x.useContext(vr),{pathname:i}=wr(),s=JSON.stringify(La(o,r.v7_relativeSplatPath)),l=x.useRef(!1);return $a(()=>{l.current=!0}),x.useCallback(function(d,u){if(u===void 0&&(u={}),!l.current)return;if(typeof d=="number"){n.go(d);return}let p=Ia(d,JSON.parse(s),i,u.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:Ma([t,p.pathname])),(u.replace?n.replace:n.push)(p,u.state,u)},[t,n,s,i,e])}function Fa(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=x.useContext(_t),{matches:o}=x.useContext(vr),{pathname:i}=wr(),s=JSON.stringify(La(o,n.v7_relativeSplatPath));return x.useMemo(()=>Ia(e,JSON.parse(s),i,r==="path"),[e,s,i,r])}var Ba=(function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e})(Ba||{}),Ua=(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})(Ua||{});function Vd(e){let t=x.useContext(Da);return t||ye(!1),t}function Wd(e){let t=x.useContext(vr);return t||ye(!1),t}function qd(e){let t=Wd(),r=t.matches[t.matches.length-1];return r.route.id||ye(!1),r.route.id}function Gd(){let{router:e}=Vd(Ba.UseNavigateStable),t=qd(Ua.UseNavigateStable),r=x.useRef(!1);return $a(()=>{r.current=!0}),x.useCallback(function(o,i){i===void 0&&(i={}),r.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,_r({fromRouteId:t},i)))},[e,t])}function Kd(e,t){e?.v7_startTransition,e?.v7_relativeSplatPath}function Yd(e){let{basename:t="/",children:r=null,location:n,navigationType:o=nt.Pop,navigator:i,static:s=!1,future:l}=e;yr()&&ye(!1);let c=t.replace(/^\/*/,"/"),d=x.useMemo(()=>({basename:c,navigator:i,static:s,future:_r({v7_relativeSplatPath:!1},l)}),[c,l,i,s]);typeof n=="string"&&(n=Jt(n));let{pathname:u="/",search:p="",hash:m="",state:g=null,key:b="default"}=n,f=x.useMemo(()=>{let h=Oa(u,c);return h==null?null:{location:{pathname:h,search:p,hash:m,state:g,key:b},navigationType:o}},[c,u,p,m,g,b,o]);return f==null?null:x.createElement(_t.Provider,{value:d},x.createElement(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 Kd(e,t){if(e==null)return{};var r={},n=Object.keys(e),o,i;for(i=0;i<n.length;i++)o=n[i],!(t.indexOf(o)>=0)&&(r[o]=e[o]);return r}function Yd(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Xd(e,t){return e.button===0&&(!t||t==="_self")&&!Yd(e)}function Fn(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 Jd(e,t){let r=Fn(e);return t&&t.forEach((n,o)=>{r.has(o)||t.getAll(o).forEach(i=>{r.append(o,i)})}),r}const Zd=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Qd="6";try{window.__reactRouterVersion=Qd}catch{}const Ha=x["startTransition"];function eu(e){let{basename:t,children:r,future:n,window:o}=e,i=x.useRef();i.current==null&&(i.current=Ad({window:o,v5Compat:!0}));let s=i.current,[l,c]=x.useState({action:s.action,location:s.location}),{v7_startTransition:d}=n||{},u=x.useCallback(p=>{d&&Ha?Ha(()=>c(p)):c(p)},[c,d]);return x.useLayoutEffect(()=>s.listen(u),[s,u]),x.useEffect(()=>qd(n),[n]),x.createElement(Gd,{basename:t,children:r,location:l.location,navigationType:l.action,navigator:s,future:n})}const tu=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",ru=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,vt=x.forwardRef(function(t,r){let{onClick:n,relative:o,reloadDocument:i,replace:s,state:l,target:c,to:d,preventScrollReset:u,viewTransition:p}=t,m=Kd(t,Zd),{basename:g}=x.useContext(_t),b,f=!1;if(typeof d=="string"&&ru.test(d)&&(b=d,tu))try{let w=new URL(window.location.href),j=d.startsWith("//")?new URL(w.protocol+d):new URL(d),C=Oa(j.pathname,g);j.origin===w.origin&&C!=null?d=C+j.search+j.hash:f=!0}catch{}let h=Fd(d,{relative:o}),v=nu(d,{replace:s,state:l,target:c,preventScrollReset:u,relative:o,viewTransition:p});function y(w){n&&n(w),w.defaultPrevented||v(w)}return x.createElement("a",$n({},m,{href:b||h,onClick:f||i?n:y,ref:r,target:c}))});var Va;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Va||(Va={}));var Wa;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Wa||(Wa={}));function nu(e,t){let{target:r,replace:n,state:o,preventScrollReset:i,relative:s,viewTransition:l}=t===void 0?{}:t,c=Ne(),d=wr(),u=Fa(e,{relative:s});return x.useCallback(p=>{if(Xd(p,r)){p.preventDefault();let m=n!==void 0?n:br(d)===br(u);c(e,{replace:m,state:o,preventScrollReset:i,relative:s,viewTransition:l})}},[d,c,u,n,o,r,e,i,s,l])}function Zt(e){let t=x.useRef(Fn(e)),r=x.useRef(!1),n=wr(),o=x.useMemo(()=>Jd(n.search,r.current?null:t.current),[n.search]),i=Ne(),s=x.useCallback((l,c)=>{const d=Fn(typeof l=="function"?l(o):l);r.current=!0,i("?"+d,c)},[i,o]);return[o,s]}let ou={data:""},au=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||ou},iu=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,su=/\/\*[^]*?\*\/| +/g,qa=/\n+/g,Ue=(e,t)=>{let r="",n="",o="";for(let i in e){let s=e[i];i[0]=="@"?i[1]=="i"?r=i+" "+s+";":n+=i[1]=="f"?Ue(s,i):i+"{"+Ue(s,i[1]=="k"?"":t)+"}":typeof s=="object"?n+=Ue(s,t?t.replace(/([^,])+/g,l=>i.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,c=>/&/.test(c)?c.replace(/&/g,l):l?l+" "+c:c)):i):s!=null&&(i=/^--/.test(i)?i:i.replace(/[A-Z]/g,"-$&").toLowerCase(),o+=Ue.p?Ue.p(i,s):i+":"+s+";")}return r+(t&&o?t+"{"+o+"}":o)+n},ze={},Ga=e=>{if(typeof e=="object"){let t="";for(let r in e)t+=r+Ga(e[r]);return t}return e},lu=(e,t,r,n,o)=>{let i=Ga(e),s=ze[i]||(ze[i]=(c=>{let d=0,u=11;for(;d<c.length;)u=101*u+c.charCodeAt(d++)>>>0;return"go"+u})(i));if(!ze[s]){let c=i!==e?e:(d=>{let u,p,m=[{}];for(;u=iu.exec(d.replace(su,""));)u[4]?m.shift():u[3]?(p=u[3].replace(qa," ").trim(),m.unshift(m[0][p]=m[0][p]||{})):m[0][u[1]]=u[2].replace(qa," ").trim();return m[0]})(e);ze[s]=Ue(o?{["@keyframes "+s]:c}:c,r?"":"."+s)}let l=r&&ze.g?ze.g:null;return r&&(ze.g=ze[s]),((c,d,u,p)=>{p?d.data=d.data.replace(p,c):d.data.indexOf(c)===-1&&(d.data=u?c+d.data:d.data+c)})(ze[s],t,n,l),s},cu=(e,t,r)=>e.reduce((n,o,i)=>{let s=t[i];if(s&&s.call){let l=s(r),c=l&&l.props&&l.props.className||/^go/.test(l)&&l;s=c?"."+c:l&&typeof l=="object"?l.props?"":Ue(l,""):l===!1?"":l}return n+o+(s??"")},"");function jr(e){let t=this||{},r=e.call?e(t.p):e;return lu(r.unshift?r.raw?cu(r,[].slice.call(arguments,1),t.p):r.reduce((n,o)=>Object.assign(n,o&&o.call?o(t.p):o),{}):r,au(t.target),t.g,t.o,t.k)}let Ka,Bn,Un;jr.bind({g:1});let De=jr.bind({k:1});function du(e,t,r,n){Ue.p=t,Ka=e,Bn=r,Un=n}function He(e,t){let r=this||{};return function(){let n=arguments;function o(i,s){let l=Object.assign({},i),c=l.className||o.className;r.p=Object.assign({theme:Bn&&Bn()},l),r.o=/ *go\d+/.test(c),l.className=jr.apply(r,n)+(c?" "+c:"");let d=e;return e[0]&&(d=l.as||e,delete l.as),Un&&d[0]&&Un(l),Ka(d,l)}return o}}var uu=e=>typeof e=="function",kr=(e,t)=>uu(e)?e(t):e,pu=(()=>{let e=0;return()=>(++e).toString()})(),Ya=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),mu=20,Hn="default",Xa=(e,t)=>{let{toastLimit:r}=e.settings;switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,r)};case 1:return{...e,toasts:e.toasts.map(s=>s.id===t.toast.id?{...s,...t.toast}:s)};case 2:let{toast:n}=t;return Xa(e,{type:e.toasts.find(s=>s.id===n.id)?1:0,toast:n});case 3:let{toastId:o}=t;return{...e,toasts:e.toasts.map(s=>s.id===o||o===void 0?{...s,dismissed:!0,visible:!1}:s)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(s=>s.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let i=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(s=>({...s,pauseDuration:s.pauseDuration+i}))}}},Sr=[],Ja={toasts:[],pausedAt:void 0,settings:{toastLimit:mu}},Ee={},Za=(e,t=Hn)=>{Ee[t]=Xa(Ee[t]||Ja,e),Sr.forEach(([r,n])=>{r===t&&n(Ee[t])})},Qa=e=>Object.keys(Ee).forEach(t=>Za(e,t)),fu=e=>Object.keys(Ee).find(t=>Ee[t].toasts.some(r=>r.id===e)),Cr=(e=Hn)=>t=>{Za(t,e)},hu={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},gu=(e={},t=Hn)=>{let[r,n]=_.useState(Ee[t]||Ja),o=_.useRef(Ee[t]);_.useEffect(()=>(o.current!==Ee[t]&&n(Ee[t]),Sr.push([t,n]),()=>{let s=Sr.findIndex(([l])=>l===t);s>-1&&Sr.splice(s,1)}),[t]);let i=r.toasts.map(s=>{var l,c,d;return{...e,...e[s.type],...s,removeDelay:s.removeDelay||((l=e[s.type])==null?void 0:l.removeDelay)||e?.removeDelay,duration:s.duration||((c=e[s.type])==null?void 0:c.duration)||e?.duration||hu[s.type],style:{...e.style,...(d=e[s.type])==null?void 0:d.style,...s.style}}});return{...r,toasts:i}},xu=(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||pu()}),Qt=e=>(t,r)=>{let n=xu(t,e,r);return Cr(n.toasterId||fu(n.id))({type:2,toast:n}),n.id},ie=(e,t)=>Qt("blank")(e,t);ie.error=Qt("error"),ie.success=Qt("success"),ie.loading=Qt("loading"),ie.custom=Qt("custom"),ie.dismiss=(e,t)=>{let r={type:3,toastId:e};t?Cr(t)(r):Qa(r)},ie.dismissAll=e=>ie.dismiss(void 0,e),ie.remove=(e,t)=>{let r={type:4,toastId:e};t?Cr(t)(r):Qa(r)},ie.removeAll=e=>ie.remove(void 0,e),ie.promise=(e,t,r)=>{let n=ie.loading(t.loading,{...r,...r?.loading});return typeof e=="function"&&(e=e()),e.then(o=>{let i=t.success?kr(t.success,o):void 0;return i?ie.success(i,{id:n,...r,...r?.success}):ie.dismiss(n),o}).catch(o=>{let i=t.error?kr(t.error,o):void 0;i?ie.error(i,{id:n,...r,...r?.error}):ie.dismiss(n)}),e};var bu=1e3,_u=(e,t="default")=>{let{toasts:r,pausedAt:n}=gu(e,t),o=_.useRef(new Map).current,i=_.useCallback((p,m=bu)=>{if(o.has(p))return;let g=setTimeout(()=>{o.delete(p),s({type:4,toastId:p})},m);o.set(p,g)},[]);_.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&&ie.dismiss(g.id);return}return setTimeout(()=>ie.dismiss(g.id,t),b)});return()=>{m.forEach(g=>g&&clearTimeout(g))}},[r,n,t]);let s=_.useCallback(Cr(t),[t]),l=_.useCallback(()=>{s({type:5,time:Date.now()})},[s]),c=_.useCallback((p,m)=>{s({type:1,toast:{id:p,height:m}})},[s]),d=_.useCallback(()=>{n&&s({type:6,time:Date.now()})},[n,s]),u=_.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),y=h.filter((w,j)=>j<v&&w.visible).length;return h.filter(w=>w.visible).slice(...g?[y+1]:[0,y]).reduce((w,j)=>w+(j.height||0)+b,0)},[r]);return _.useEffect(()=>{r.forEach(p=>{if(p.dismissed)i(p.id,p.removeDelay);else{let m=o.get(p.id);m&&(clearTimeout(m),o.delete(p.id))}})},[r,i]),{toasts:r,handlers:{updateHeight:c,startPause:l,endPause:d,calculateOffset:u}}},vu=De`37 */function $n(){return $n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},$n.apply(this,arguments)}function Xd(e,t){if(e==null)return{};var r={},n=Object.keys(e),o,i;for(i=0;i<n.length;i++)o=n[i],!(t.indexOf(o)>=0)&&(r[o]=e[o]);return r}function Jd(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Zd(e,t){return e.button===0&&(!t||t==="_self")&&!Jd(e)}function Fn(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 Qd(e,t){let r=Fn(e);return t&&t.forEach((n,o)=>{r.has(o)||t.getAll(o).forEach(i=>{r.append(o,i)})}),r}const eu=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],tu="6";try{window.__reactRouterVersion=tu}catch{}const Ha=x["startTransition"];function ru(e){let{basename:t,children:r,future:n,window:o}=e,i=x.useRef();i.current==null&&(i.current=Od({window:o,v5Compat:!0}));let s=i.current,[l,c]=x.useState({action:s.action,location:s.location}),{v7_startTransition:d}=n||{},u=x.useCallback(p=>{d&&Ha?Ha(()=>c(p)):c(p)},[c,d]);return x.useLayoutEffect(()=>s.listen(u),[s,u]),x.useEffect(()=>Kd(n),[n]),x.createElement(Yd,{basename:t,children:r,location:l.location,navigationType:l.action,navigator:s,future:n})}const nu=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",ou=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,vt=x.forwardRef(function(t,r){let{onClick:n,relative:o,reloadDocument:i,replace:s,state:l,target:c,to:d,preventScrollReset:u,viewTransition:p}=t,m=Xd(t,eu),{basename:g}=x.useContext(_t),b,f=!1;if(typeof d=="string"&&ou.test(d)&&(b=d,nu))try{let w=new URL(window.location.href),j=d.startsWith("//")?new URL(w.protocol+d):new URL(d),C=Oa(j.pathname,g);j.origin===w.origin&&C!=null?d=C+j.search+j.hash:f=!0}catch{}let h=Ud(d,{relative:o}),v=au(d,{replace:s,state:l,target:c,preventScrollReset:u,relative:o,viewTransition:p});function y(w){n&&n(w),w.defaultPrevented||v(w)}return x.createElement("a",$n({},m,{href:b||h,onClick:f||i?n:y,ref:r,target:c}))});var Va;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Va||(Va={}));var Wa;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Wa||(Wa={}));function au(e,t){let{target:r,replace:n,state:o,preventScrollReset:i,relative:s,viewTransition:l}=t===void 0?{}:t,c=Ne(),d=wr(),u=Fa(e,{relative:s});return x.useCallback(p=>{if(Zd(p,r)){p.preventDefault();let m=n!==void 0?n:br(d)===br(u);c(e,{replace:m,state:o,preventScrollReset:i,relative:s,viewTransition:l})}},[d,c,u,n,o,r,e,i,s,l])}function Zt(e){let t=x.useRef(Fn(e)),r=x.useRef(!1),n=wr(),o=x.useMemo(()=>Qd(n.search,r.current?null:t.current),[n.search]),i=Ne(),s=x.useCallback((l,c)=>{const d=Fn(typeof l=="function"?l(o):l);r.current=!0,i("?"+d,c)},[i,o]);return[o,s]}let iu={data:""},su=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||iu},lu=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,cu=/\/\*[^]*?\*\/| +/g,qa=/\n+/g,Ue=(e,t)=>{let r="",n="",o="";for(let i in e){let s=e[i];i[0]=="@"?i[1]=="i"?r=i+" "+s+";":n+=i[1]=="f"?Ue(s,i):i+"{"+Ue(s,i[1]=="k"?"":t)+"}":typeof s=="object"?n+=Ue(s,t?t.replace(/([^,])+/g,l=>i.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,c=>/&/.test(c)?c.replace(/&/g,l):l?l+" "+c:c)):i):s!=null&&(i=/^--/.test(i)?i:i.replace(/[A-Z]/g,"-$&").toLowerCase(),o+=Ue.p?Ue.p(i,s):i+":"+s+";")}return r+(t&&o?t+"{"+o+"}":o)+n},ze={},Ga=e=>{if(typeof e=="object"){let t="";for(let r in e)t+=r+Ga(e[r]);return t}return e},du=(e,t,r,n,o)=>{let i=Ga(e),s=ze[i]||(ze[i]=(c=>{let d=0,u=11;for(;d<c.length;)u=101*u+c.charCodeAt(d++)>>>0;return"go"+u})(i));if(!ze[s]){let c=i!==e?e:(d=>{let u,p,m=[{}];for(;u=lu.exec(d.replace(cu,""));)u[4]?m.shift():u[3]?(p=u[3].replace(qa," ").trim(),m.unshift(m[0][p]=m[0][p]||{})):m[0][u[1]]=u[2].replace(qa," ").trim();return m[0]})(e);ze[s]=Ue(o?{["@keyframes "+s]:c}:c,r?"":"."+s)}let l=r&&ze.g?ze.g:null;return r&&(ze.g=ze[s]),((c,d,u,p)=>{p?d.data=d.data.replace(p,c):d.data.indexOf(c)===-1&&(d.data=u?c+d.data:d.data+c)})(ze[s],t,n,l),s},uu=(e,t,r)=>e.reduce((n,o,i)=>{let s=t[i];if(s&&s.call){let l=s(r),c=l&&l.props&&l.props.className||/^go/.test(l)&&l;s=c?"."+c:l&&typeof l=="object"?l.props?"":Ue(l,""):l===!1?"":l}return n+o+(s??"")},"");function jr(e){let t=this||{},r=e.call?e(t.p):e;return du(r.unshift?r.raw?uu(r,[].slice.call(arguments,1),t.p):r.reduce((n,o)=>Object.assign(n,o&&o.call?o(t.p):o),{}):r,su(t.target),t.g,t.o,t.k)}let Ka,Bn,Un;jr.bind({g:1});let De=jr.bind({k:1});function pu(e,t,r,n){Ue.p=t,Ka=e,Bn=r,Un=n}function He(e,t){let r=this||{};return function(){let n=arguments;function o(i,s){let l=Object.assign({},i),c=l.className||o.className;r.p=Object.assign({theme:Bn&&Bn()},l),r.o=/ *go\d+/.test(c),l.className=jr.apply(r,n)+(c?" "+c:"");let d=e;return e[0]&&(d=l.as||e,delete l.as),Un&&d[0]&&Un(l),Ka(d,l)}return o}}var mu=e=>typeof e=="function",kr=(e,t)=>mu(e)?e(t):e,fu=(()=>{let e=0;return()=>(++e).toString()})(),Ya=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),hu=20,Hn="default",Xa=(e,t)=>{let{toastLimit:r}=e.settings;switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,r)};case 1:return{...e,toasts:e.toasts.map(s=>s.id===t.toast.id?{...s,...t.toast}:s)};case 2:let{toast:n}=t;return Xa(e,{type:e.toasts.find(s=>s.id===n.id)?1:0,toast:n});case 3:let{toastId:o}=t;return{...e,toasts:e.toasts.map(s=>s.id===o||o===void 0?{...s,dismissed:!0,visible:!1}:s)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(s=>s.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let i=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(s=>({...s,pauseDuration:s.pauseDuration+i}))}}},Sr=[],Ja={toasts:[],pausedAt:void 0,settings:{toastLimit:hu}},Ee={},Za=(e,t=Hn)=>{Ee[t]=Xa(Ee[t]||Ja,e),Sr.forEach(([r,n])=>{r===t&&n(Ee[t])})},Qa=e=>Object.keys(Ee).forEach(t=>Za(e,t)),gu=e=>Object.keys(Ee).find(t=>Ee[t].toasts.some(r=>r.id===e)),Cr=(e=Hn)=>t=>{Za(t,e)},xu={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},bu=(e={},t=Hn)=>{let[r,n]=_.useState(Ee[t]||Ja),o=_.useRef(Ee[t]);_.useEffect(()=>(o.current!==Ee[t]&&n(Ee[t]),Sr.push([t,n]),()=>{let s=Sr.findIndex(([l])=>l===t);s>-1&&Sr.splice(s,1)}),[t]);let i=r.toasts.map(s=>{var l,c,d;return{...e,...e[s.type],...s,removeDelay:s.removeDelay||((l=e[s.type])==null?void 0:l.removeDelay)||e?.removeDelay,duration:s.duration||((c=e[s.type])==null?void 0:c.duration)||e?.duration||xu[s.type],style:{...e.style,...(d=e[s.type])==null?void 0:d.style,...s.style}}});return{...r,toasts:i}},_u=(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||fu()}),Qt=e=>(t,r)=>{let n=_u(t,e,r);return Cr(n.toasterId||gu(n.id))({type:2,toast:n}),n.id},ie=(e,t)=>Qt("blank")(e,t);ie.error=Qt("error"),ie.success=Qt("success"),ie.loading=Qt("loading"),ie.custom=Qt("custom"),ie.dismiss=(e,t)=>{let r={type:3,toastId:e};t?Cr(t)(r):Qa(r)},ie.dismissAll=e=>ie.dismiss(void 0,e),ie.remove=(e,t)=>{let r={type:4,toastId:e};t?Cr(t)(r):Qa(r)},ie.removeAll=e=>ie.remove(void 0,e),ie.promise=(e,t,r)=>{let n=ie.loading(t.loading,{...r,...r?.loading});return typeof e=="function"&&(e=e()),e.then(o=>{let i=t.success?kr(t.success,o):void 0;return i?ie.success(i,{id:n,...r,...r?.success}):ie.dismiss(n),o}).catch(o=>{let i=t.error?kr(t.error,o):void 0;i?ie.error(i,{id:n,...r,...r?.error}):ie.dismiss(n)}),e};var vu=1e3,yu=(e,t="default")=>{let{toasts:r,pausedAt:n}=bu(e,t),o=_.useRef(new Map).current,i=_.useCallback((p,m=vu)=>{if(o.has(p))return;let g=setTimeout(()=>{o.delete(p),s({type:4,toastId:p})},m);o.set(p,g)},[]);_.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&&ie.dismiss(g.id);return}return setTimeout(()=>ie.dismiss(g.id,t),b)});return()=>{m.forEach(g=>g&&clearTimeout(g))}},[r,n,t]);let s=_.useCallback(Cr(t),[t]),l=_.useCallback(()=>{s({type:5,time:Date.now()})},[s]),c=_.useCallback((p,m)=>{s({type:1,toast:{id:p,height:m}})},[s]),d=_.useCallback(()=>{n&&s({type:6,time:Date.now()})},[n,s]),u=_.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),y=h.filter((w,j)=>j<v&&w.visible).length;return h.filter(w=>w.visible).slice(...g?[y+1]:[0,y]).reduce((w,j)=>w+(j.height||0)+b,0)},[r]);return _.useEffect(()=>{r.forEach(p=>{if(p.dismissed)i(p.id,p.removeDelay);else{let m=o.get(p.id);m&&(clearTimeout(m),o.delete(p.id))}})},[r,i]),{toasts:r,handlers:{updateHeight:c,startPause:l,endPause:d,calculateOffset:u}}},wu=De` 38 38 from { 39 39 transform: scale(0) rotate(45deg); … … 43 43 transform: scale(1) rotate(45deg); 44 44 opacity: 1; 45 }`, yu=De`45 }`,ju=De` 46 46 from { 47 47 transform: scale(0); … … 51 51 transform: scale(1); 52 52 opacity: 1; 53 }`, wu=De`53 }`,ku=De` 54 54 from { 55 55 transform: scale(0) rotate(90deg); … … 59 59 transform: scale(1) rotate(90deg); 60 60 opacity: 1; 61 }`, ju=He("div")`61 }`,Su=He("div")` 62 62 width: 20px; 63 63 opacity: 0; … … 68 68 transform: rotate(45deg); 69 69 70 animation: ${ vu} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)70 animation: ${wu} 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: ${ yu} 0.15s ease-out forwards;77 animation: ${ju} 0.15s ease-out forwards; 78 78 animation-delay: 150ms; 79 79 position: absolute; … … 88 88 89 89 &:before { 90 animation: ${ wu} 0.15s ease-out forwards;90 animation: ${ku} 0.15s ease-out forwards; 91 91 animation-delay: 180ms; 92 92 transform: rotate(90deg); 93 93 } 94 `, ku=De`94 `,Cu=De` 95 95 from { 96 96 transform: rotate(0deg); … … 99 99 transform: rotate(360deg); 100 100 } 101 `, Su=He("div")`101 `,Nu=He("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: ${ ku} 1s linear infinite;110 `, Cu=De`109 animation: ${Cu} 1s linear infinite; 110 `,Eu=De` 111 111 from { 112 112 transform: scale(0) rotate(45deg); … … 116 116 transform: scale(1) rotate(45deg); 117 117 opacity: 1; 118 }`, Nu=De`118 }`,Tu=De` 119 119 0% { 120 120 height: 0; … … 130 130 opacity: 1; 131 131 height: 10px; 132 }`, Eu=He("div")`132 }`,Au=He("div")` 133 133 width: 20px; 134 134 opacity: 0; … … 139 139 transform: rotate(45deg); 140 140 141 animation: ${ Cu} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)141 animation: ${Eu} 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: ${ Nu} 0.2s ease-out forwards;147 animation: ${Tu} 0.2s ease-out forwards; 148 148 opacity: 0; 149 149 animation-delay: 200ms; … … 157 157 width: 6px; 158 158 } 159 `, Tu=He("div")`159 `,Pu=He("div")` 160 160 position: absolute; 161 `, Au=He("div")`161 `,Ou=He("div")` 162 162 position: relative; 163 163 display: flex; … … 166 166 min-width: 20px; 167 167 min-height: 20px; 168 `, Pu=De`168 `,Ru=De` 169 169 from { 170 170 transform: scale(0.6); … … 174 174 transform: scale(1); 175 175 opacity: 1; 176 }`, Ou=He("div")`176 }`,Lu=He("div")` 177 177 position: relative; 178 178 transform: scale(0.6); 179 179 opacity: 0.4; 180 180 min-width: 20px; 181 animation: ${ Pu} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)181 animation: ${Ru} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275) 182 182 forwards; 183 `, Ru=({toast:e})=>{let{icon:t,type:r,iconTheme:n}=e;return t!==void 0?typeof t=="string"?x.createElement(Ou,null,t):t:r==="blank"?null:x.createElement(Au,null,x.createElement(Su,{...n}),r!=="loading"&&x.createElement(Tu,null,r==="error"?x.createElement(ju,{...n}):x.createElement(Eu,{...n})))},Lu=e=>`183 `,Iu=({toast:e})=>{let{icon:t,type:r,iconTheme:n}=e;return t!==void 0?typeof t=="string"?x.createElement(Lu,null,t):t:r==="blank"?null:x.createElement(Ou,null,x.createElement(Nu,{...n}),r!=="loading"&&x.createElement(Pu,null,r==="error"?x.createElement(Su,{...n}):x.createElement(Au,{...n})))},Mu=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 `, Iu=e=>`186 `,zu=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 `, Mu="0%{opacity:0;} 100%{opacity:1;}",zu="0%{opacity:1;} 100%{opacity:0;}",Du=He("div")`189 `,Du="0%{opacity:0;} 100%{opacity:1;}",$u="0%{opacity:1;} 100%{opacity:0;}",Fu=He("div")` 190 190 display: flex; 191 191 align-items: center; … … 199 199 padding: 8px 10px; 200 200 border-radius: 8px; 201 `, $u=He("div")`201 `,Bu=He("div")` 202 202 display: flex; 203 203 justify-content: center; … … 206 206 flex: 1 1 auto; 207 207 white-space: pre-line; 208 `, Fu=(e,t)=>{let r=e.includes("top")?1:-1,[n,o]=Ya()?[Mu,zu]:[Lu(r),Iu(r)];return{animation:t?`${De(n)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${De(o)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},Bu=x.memo(({toast:e,position:t,style:r,children:n})=>{let o=e.height?Fu(e.position||t||"top-center",e.visible):{opacity:0},i=x.createElement(Ru,{toast:e}),s=x.createElement($u,{...e.ariaProps},kr(e.message,e));return x.createElement(Du,{className:e.className,style:{...o,...r,...e.style}},typeof n=="function"?n({icon:i,message:s}):x.createElement(x.Fragment,null,i,s))});du(x.createElement);var Uu=({id:e,className:t,style:r,onHeightUpdate:n,children:o})=>{let i=x.useCallback(s=>{if(s){let l=()=>{let c=s.getBoundingClientRect().height;n(e,c)};l(),new MutationObserver(l).observe(s,{subtree:!0,childList:!0,characterData:!0})}},[e,n]);return x.createElement("div",{ref:i,className:t,style:r},o)},Hu=(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:Ya()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(r?1:-1)}px)`,...n,...o}},Vu=jr`208 `,Uu=(e,t)=>{let r=e.includes("top")?1:-1,[n,o]=Ya()?[Du,$u]:[Mu(r),zu(r)];return{animation:t?`${De(n)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${De(o)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},Hu=x.memo(({toast:e,position:t,style:r,children:n})=>{let o=e.height?Uu(e.position||t||"top-center",e.visible):{opacity:0},i=x.createElement(Iu,{toast:e}),s=x.createElement(Bu,{...e.ariaProps},kr(e.message,e));return x.createElement(Fu,{className:e.className,style:{...o,...r,...e.style}},typeof n=="function"?n({icon:i,message:s}):x.createElement(x.Fragment,null,i,s))});pu(x.createElement);var Vu=({id:e,className:t,style:r,onHeightUpdate:n,children:o})=>{let i=x.useCallback(s=>{if(s){let l=()=>{let c=s.getBoundingClientRect().height;n(e,c)};l(),new MutationObserver(l).observe(s,{subtree:!0,childList:!0,characterData:!0})}},[e,n]);return x.createElement("div",{ref:i,className:t,style:r},o)},Wu=(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:Ya()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(r?1:-1)}px)`,...n,...o}},qu=jr` 209 209 z-index: 9999; 210 210 > * { 211 211 pointer-events: auto; 212 212 } 213 `,Nr=16, Wu=({reverseOrder:e,position:t="top-center",toastOptions:r,gutter:n,children:o,toasterId:i,containerStyle:s,containerClassName:l})=>{let{toasts:c,handlers:d}=_u(r,i);return x.createElement("div",{"data-rht-toaster":i||"",style:{position:"fixed",zIndex:9999,top:Nr,left:Nr,right:Nr,bottom:Nr,pointerEvents:"none",...s},className:l,onMouseEnter:d.startPause,onMouseLeave:d.endPause},c.map(u=>{let p=u.position||t,m=d.calculateOffset(u,{reverseOrder:e,gutter:n,defaultPosition:t}),g=Hu(p,m);return x.createElement(Uu,{id:u.id,key:u.id,onHeightUpdate:d.updateHeight,className:u.visible?Vu:"",style:g},u.type==="custom"?kr(u.message,u):o?o(u):x.createElement(Bu,{toast:u,position:p}))}))},G=ie;const ei={carousel:"carousel",grid:"grid"},qu=["marquee","stacked"],ot={topBottomSpacing:0,gap:16,gapOnTab:16,gapOnMobile:16,shape:"rectangle",size:200,sizeOnTab:150,sizeOnMobile:150,hoverEffect:"none",border:{border_width:2,border_color:"#9ca3af",border_radius:6},shadow:{shadow_size:16},template:ei.carousel,appearance:"overlay",widgetTitle:{alignment:"hidden",fontSize:24,color:"#000000"},playerAppearance:"overlay"},X={settings:"settings",stat:"statistics",cr:"create-reel",mg:"manage-group",ag:"all-groups",ar:"all-reels"},Gu=[{label:"None",value:"none"},{label:"zoom in",value:"zoom-in"},{label:"zoom out",value:"zoom-out"}],ti=[{label:"Horizontal",value:"horizontal"}],Ku=[{label:"Vertical",value:"vertical"}],Yu=[{label:"Overlay",value:"overlay"},{label:"Only Title",value:"title"},{label:"None",value:"none"}],Xu=[{label:"Modern",value:"modern"},{label:"Classic",value:"classic"}],Ju=[{label:"Overlay",value:"overlay"},{label:"Only Tile",value:"title"},{label:"None",value:"none"}];var ri={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},ni=_.createContext&&_.createContext(ri),Zu=["attr","size","title"];function Qu(e,t){if(e==null)return{};var r=ep(e,t),n,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function ep(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 oi(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 Tr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?oi(Object(r),!0).forEach(function(n){tp(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):oi(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function tp(e,t,r){return t=rp(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function rp(e){var t=np(e,"string");return typeof t=="symbol"?t:t+""}function np(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 ai(e){return e&&e.map((t,r)=>_.createElement(t.tag,Tr({key:r},t.attr),ai(t.child)))}function V(e){return t=>_.createElement(op,Er({attr:Tr({},e.attr)},t),ai(e.child))}function op(e){var t=r=>{var{attr:n,size:o,title:i}=e,s=Qu(e,Zu),l=o||r.size||"1em",c;return r.className&&(c=r.className),e.className&&(c=(c?c+" ":"")+e.className),_.createElement("svg",Er({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,n,s,{className:c,style:Tr(Tr({color:e.color||r.color},r.style),e.style),height:l,width:l,xmlns:"http://www.w3.org/2000/svg"}),i&&_.createElement("title",null,i),e.children)};return ni!==void 0?_.createElement(ni.Consumer,null,r=>t(r)):t(ri)}function ap(e){return V({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M164.44,105.34l-48-32A8,8,0,0,0,104,80v64a8,8,0,0,0,12.44,6.66l48-32a8,8,0,0,0,0-13.32ZM120,129.05V95l25.58,17ZM216,40H40A16,16,0,0,0,24,56V168a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,128H40V56H216V168Zm16,40a8,8,0,0,1-8,8H32a8,8,0,0,1,0-16H224A8,8,0,0,1,232,208Z"},child:[]}]})(e)}function at(e){return V({attr:{version:"1.2",baseProfile:"tiny",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M17 10h-1v-2c0-2.205-1.794-4-4-4s-4 1.795-4 4v2h-1c-1.103 0-2 .896-2 2v7c0 1.104.897 2 2 2h10c1.103 0 2-.896 2-2v-7c0-1.104-.897-2-2-2zm-5 8.299c-.719 0-1.3-.58-1.3-1.299s.581-1.301 1.3-1.301 1.3.582 1.3 1.301-.581 1.299-1.3 1.299zm2-7.299h-4v-3c0-1.104.897-2 2-2s2 .896 2 2v3z"},child:[]}]})(e)}function yt(e){return V({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 Vn(e){return V({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 Wn(e){return V({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 ip(e){return V({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 sp(e){return V({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 lp(e){return V({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"},child:[]},{tag:"path",attr:{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"},child:[]}]})(e)}function it(e){return V({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 cp(e){return V({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 ii(e){return V({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 dp(e){return V({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 up(e){return V({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"},child:[]},{tag:"polyline",attr:{points:"17 8 12 3 7 8"},child:[]},{tag:"line",attr:{x1:"12",x2:"12",y1:"3",y2:"15"},child:[]}]})(e)}function qn(e){return V({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 Gn(e){return V({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 pp(e){return V({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 mp(e){return V({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 fp(e){return V({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 hp(e){return V({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 si(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Kn(...e){return t=>{let r=!1;const n=e.map(o=>{const i=si(o,t);return!r&&typeof i=="function"&&(r=!0),i});if(r)return()=>{for(let o=0;o<n.length;o++){const i=n[o];typeof i=="function"?i():si(e[o],null)}}}}function J(...e){return x.useCallback(Kn(...e),e)}function st(e){const t=xp(e),r=x.forwardRef((n,o)=>{const{children:i,...s}=n,l=x.Children.toArray(i),c=l.find(_p);if(c){const d=c.props.children,u=l.map(p=>p===c?x.Children.count(d)>1?x.Children.only(null):x.isValidElement(d)?d.props.children:null:p);return a.jsx(t,{...s,ref:o,children:x.isValidElement(d)?x.cloneElement(d,void 0,u):null})}return a.jsx(t,{...s,ref:o,children:i})});return r.displayName=`${e}.Slot`,r}var gp=st("Slot");function xp(e){const t=x.forwardRef((r,n)=>{const{children:o,...i}=r;if(x.isValidElement(o)){const s=yp(o),l=vp(i,o.props);return o.type!==x.Fragment&&(l.ref=n?Kn(n,s):s),x.cloneElement(o,l)}return x.Children.count(o)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var bp=Symbol("radix.slottable");function _p(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===bp}function vp(e,t){const r={...t};for(const n in t){const o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...l)=>{const c=i(...l);return o(...l),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}function yp(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 li(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=li(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function jp(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=li(e))&&(n&&(n+=" "),n+=t);return n}function $(...e){return jp(e)}const kp="ecr-button",Sp={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"},Cp={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 ne({className:e,variant:t="default",size:r="default",asChild:n=!1,...o}){const i=n?gp:"button";return a.jsx(i,{"data-slot":"button","data-variant":t,"data-size":r,className:$(kp,Sp[t],Cp[r],e),...o})}function Np({selectedReelIds:e,handleSelectAll:t,clearSelection:r,searchTerm:n,setSearchTerm:o,isCreating:i,handleCreateGroup:s,handleBulkDelete:l}){return a.jsxs("div",{className:"ecr-admin-reels-header",children:[a.jsxs("div",{className:"ecr-admin-reels-header__left",children:[a.jsx("h2",{className:"ecr-admin-reels-header__title",children:"Reels"}),e.length?a.jsxs("div",{className:"ecr-admin-reels-header__actions",children:[a.jsx(ne,{onClick:t,variant:"link",className:"ecr-admin-reels-header__action ecr-admin-reels-header__action--primary",children:"Select all"}),a.jsx(ne,{onClick:r,variant:"link",className:"ecr-admin-reels-header__action ecr-admin-reels-header__action--danger",children:"Clear"}),a.jsxs(ne,{variant:"outline-danger",size:"sm",onClick:l,children:[a.jsx(Gn,{size:22,className:"ecr-admin-reel-card__icon ecr-admin-reel-card__icon--danger"}),"Delete Selected"]})]}):null]}),a.jsxs("div",{className:"ecr-admin-reels-header__right",children:[a.jsxs("div",{className:"ecr-admin-reels-header__search",children:[a.jsx("input",{type:"text",placeholder:"Search reels...",value:n,onChange:c=>o(c.target.value),className:"ecr-admin-search-input"}),a.jsxs("div",{className:"ecr-admin-reels-header__icon-wrapper",children:[n&&a.jsx(ne,{onClick:()=>o(""),variant:"link",size:"icon-sm",children:a.jsx(qn,{size:16,className:"ecr-admin-reels-header__clear-icon"})}),a.jsx(ii,{size:16,className:"ecr-admin-reels-header__search-icon"})]})," "]}),e.length?a.jsxs(ne,{disabled:i,onClick:s,className:"ecr-admin-reels-header__create",children:[i?a.jsx(it,{className:"ecr-admin-reels-header__spinner"}):a.jsx(yt,{})," ","Create Widget"]}):null]})]})}function Ep(e){return V({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 Tp(e){return V({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M262.29 192.31a64 64 0 1 0 57.4 57.4 64.13 64.13 0 0 0-57.4-57.4zM416.39 256a154.34 154.34 0 0 1-1.53 20.79l45.21 35.46a10.81 10.81 0 0 1 2.45 13.75l-42.77 74a10.81 10.81 0 0 1-13.14 4.59l-44.9-18.08a16.11 16.11 0 0 0-15.17 1.75A164.48 164.48 0 0 1 325 400.8a15.94 15.94 0 0 0-8.82 12.14l-6.73 47.89a11.08 11.08 0 0 1-10.68 9.17h-85.54a11.11 11.11 0 0 1-10.69-8.87l-6.72-47.82a16.07 16.07 0 0 0-9-12.22 155.3 155.3 0 0 1-21.46-12.57 16 16 0 0 0-15.11-1.71l-44.89 18.07a10.81 10.81 0 0 1-13.14-4.58l-42.77-74a10.8 10.8 0 0 1 2.45-13.75l38.21-30a16.05 16.05 0 0 0 6-14.08c-.36-4.17-.58-8.33-.58-12.5s.21-8.27.58-12.35a16 16 0 0 0-6.07-13.94l-38.19-30A10.81 10.81 0 0 1 49.48 186l42.77-74a10.81 10.81 0 0 1 13.14-4.59l44.9 18.08a16.11 16.11 0 0 0 15.17-1.75A164.48 164.48 0 0 1 187 111.2a15.94 15.94 0 0 0 8.82-12.14l6.73-47.89A11.08 11.08 0 0 1 213.23 42h85.54a11.11 11.11 0 0 1 10.69 8.87l6.72 47.82a16.07 16.07 0 0 0 9 12.22 155.3 155.3 0 0 1 21.46 12.57 16 16 0 0 0 15.11 1.71l44.89-18.07a10.81 10.81 0 0 1 13.14 4.58l42.77 74a10.8 10.8 0 0 1-2.45 13.75l-38.21 30a16.05 16.05 0 0 0-6.05 14.08c.33 4.14.55 8.3.55 12.47z"},child:[]}]})(e)}function lt(e){return V({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 Ap(){return a.jsx("div",{className:"ecr-admin-reels-empty",children:a.jsxs("p",{className:"ecr-admin-reels-empty__text",children:[a.jsx(lt,{color:"#FFA500",size:40}),a.jsx("span",{children:"You did not have any reel yet."})]})})}function Pp({isFullScreen:e}){return a.jsx("div",{className:$("ecr-admin-reels-loading",e&&"ecr-admin-reels-loading--fullscreen"),children:a.jsx(it,{className:"ecr-admin-reels-loading__icon"})})}const ci=({playingStory:e,duration:t,currentFileIndex:r,isPaused:n})=>a.jsx("div",{className:"ecr-player__progress",children:e?.files?.map((o,i)=>a.jsx("div",{className:"ecr-player__progress-track",children:a.jsx("div",{style:{"--reels-wp-animation-time":`${t}s`,animationPlayState:n?"paused":"running"},className:$("ecr-player__progress-fill",i===r?.index?"ecr-player__progress-fill--active":i<r?.index?"ecr-player__progress-fill--complete":"ecr-player__progress-fill--empty")})},i))}),wt=({className:e,children:t,...r})=>a.jsx("button",{className:$("ecr-player__nav",e),...r,children:t});/**214 * @license lucide-react v0.552.0 - ISC 215 * 216 * This source code is licensed under the ISC license. 217 * See the LICENSE file in the root directory of this source tree. 218 */const Op=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Rp=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,n)=>n?n.toUpperCase():r.toLowerCase()),di=e=>{const t=Rp(e);return t.charAt(0).toUpperCase()+t.slice(1)},ui=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim(),Lp=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**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 */var Ip={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"};/**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 */const Mp=_.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:o="",children:i,iconNode:s,...l},c)=>_.createElement("svg",{ref:c,...Ip,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:ui("lucide",o),...!i&&!Lp(l)&&{"aria-hidden":"true"},...l},[...s.map(([d,u])=>_.createElement(d,u)),...Array.isArray(i)?i:[i]]));/**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 Q=(e,t)=>{const r=_.forwardRef(({className:n,...o},i)=>_.createElement( Mp,{ref:i,iconNode:t,className:ui(`lucide-${Op(di(e))}`,`lucide-${e}`,n),...o}));return r.displayName=di(e),r};/**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 zp=Q("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**213 `,Nr=16,Gu=({reverseOrder:e,position:t="top-center",toastOptions:r,gutter:n,children:o,toasterId:i,containerStyle:s,containerClassName:l})=>{let{toasts:c,handlers:d}=yu(r,i);return x.createElement("div",{"data-rht-toaster":i||"",style:{position:"fixed",zIndex:9999,top:Nr,left:Nr,right:Nr,bottom:Nr,pointerEvents:"none",...s},className:l,onMouseEnter:d.startPause,onMouseLeave:d.endPause},c.map(u=>{let p=u.position||t,m=d.calculateOffset(u,{reverseOrder:e,gutter:n,defaultPosition:t}),g=Wu(p,m);return x.createElement(Vu,{id:u.id,key:u.id,onHeightUpdate:d.updateHeight,className:u.visible?qu:"",style:g},u.type==="custom"?kr(u.message,u):o?o(u):x.createElement(Hu,{toast:u,position:p}))}))},G=ie;const ei={carousel:"carousel",grid:"grid"},Ku=["marquee","stacked"],ot={topBottomSpacing:0,gap:16,gapOnTab:16,gapOnMobile:16,shape:"rectangle",size:200,sizeOnTab:150,sizeOnMobile:150,hoverEffect:"none",border:{border_width:2,border_color:"#9ca3af",border_radius:6},shadow:{shadow_size:16},template:ei.carousel,appearance:"overlay",widgetTitle:{alignment:"hidden",fontSize:24,color:"#000000"},playerAppearance:"overlay"},X={settings:"settings",stat:"statistics",cr:"create-reel",mg:"manage-group",ag:"all-groups",ar:"all-reels"},Yu=[{label:"None",value:"none"},{label:"zoom in",value:"zoom-in"},{label:"zoom out",value:"zoom-out"}],ti=[{label:"Horizontal",value:"horizontal"}],Xu=[{label:"Vertical",value:"vertical"}],Ju=[{label:"Overlay",value:"overlay"},{label:"Only Title",value:"title"},{label:"None",value:"none"}],Zu=[{label:"Modern",value:"modern"},{label:"Classic",value:"classic"}],Qu=[{label:"Overlay",value:"overlay"},{label:"Only Tile",value:"title"},{label:"None",value:"none"}];var ri={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},ni=_.createContext&&_.createContext(ri),ep=["attr","size","title"];function tp(e,t){if(e==null)return{};var r=rp(e,t),n,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function rp(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 oi(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 Tr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?oi(Object(r),!0).forEach(function(n){np(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):oi(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function np(e,t,r){return t=op(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function op(e){var t=ap(e,"string");return typeof t=="symbol"?t:t+""}function ap(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 ai(e){return e&&e.map((t,r)=>_.createElement(t.tag,Tr({key:r},t.attr),ai(t.child)))}function V(e){return t=>_.createElement(ip,Er({attr:Tr({},e.attr)},t),ai(e.child))}function ip(e){var t=r=>{var{attr:n,size:o,title:i}=e,s=tp(e,ep),l=o||r.size||"1em",c;return r.className&&(c=r.className),e.className&&(c=(c?c+" ":"")+e.className),_.createElement("svg",Er({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,n,s,{className:c,style:Tr(Tr({color:e.color||r.color},r.style),e.style),height:l,width:l,xmlns:"http://www.w3.org/2000/svg"}),i&&_.createElement("title",null,i),e.children)};return ni!==void 0?_.createElement(ni.Consumer,null,r=>t(r)):t(ri)}function sp(e){return V({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M164.44,105.34l-48-32A8,8,0,0,0,104,80v64a8,8,0,0,0,12.44,6.66l48-32a8,8,0,0,0,0-13.32ZM120,129.05V95l25.58,17ZM216,40H40A16,16,0,0,0,24,56V168a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,128H40V56H216V168Zm16,40a8,8,0,0,1-8,8H32a8,8,0,0,1,0-16H224A8,8,0,0,1,232,208Z"},child:[]}]})(e)}function at(e){return V({attr:{version:"1.2",baseProfile:"tiny",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M17 10h-1v-2c0-2.205-1.794-4-4-4s-4 1.795-4 4v2h-1c-1.103 0-2 .896-2 2v7c0 1.104.897 2 2 2h10c1.103 0 2-.896 2-2v-7c0-1.104-.897-2-2-2zm-5 8.299c-.719 0-1.3-.58-1.3-1.299s.581-1.301 1.3-1.301 1.3.582 1.3 1.301-.581 1.299-1.3 1.299zm2-7.299h-4v-3c0-1.104.897-2 2-2s2 .896 2 2v3z"},child:[]}]})(e)}function yt(e){return V({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 Vn(e){return V({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 Wn(e){return V({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 lp(e){return V({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 cp(e){return V({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 dp(e){return V({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"},child:[]},{tag:"path",attr:{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"},child:[]}]})(e)}function it(e){return V({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 up(e){return V({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 ii(e){return V({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 pp(e){return V({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 mp(e){return V({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"},child:[]},{tag:"polyline",attr:{points:"17 8 12 3 7 8"},child:[]},{tag:"line",attr:{x1:"12",x2:"12",y1:"3",y2:"15"},child:[]}]})(e)}function qn(e){return V({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 Gn(e){return V({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 fp(e){return V({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 V({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 gp(e){return V({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 xp(e){return V({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 si(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Kn(...e){return t=>{let r=!1;const n=e.map(o=>{const i=si(o,t);return!r&&typeof i=="function"&&(r=!0),i});if(r)return()=>{for(let o=0;o<n.length;o++){const i=n[o];typeof i=="function"?i():si(e[o],null)}}}}function J(...e){return x.useCallback(Kn(...e),e)}function st(e){const t=_p(e),r=x.forwardRef((n,o)=>{const{children:i,...s}=n,l=x.Children.toArray(i),c=l.find(yp);if(c){const d=c.props.children,u=l.map(p=>p===c?x.Children.count(d)>1?x.Children.only(null):x.isValidElement(d)?d.props.children:null:p);return a.jsx(t,{...s,ref:o,children:x.isValidElement(d)?x.cloneElement(d,void 0,u):null})}return a.jsx(t,{...s,ref:o,children:i})});return r.displayName=`${e}.Slot`,r}var bp=st("Slot");function _p(e){const t=x.forwardRef((r,n)=>{const{children:o,...i}=r;if(x.isValidElement(o)){const s=kp(o),l=jp(i,o.props);return o.type!==x.Fragment&&(l.ref=n?Kn(n,s):s),x.cloneElement(o,l)}return x.Children.count(o)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var vp=Symbol("radix.slottable");function yp(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===vp}function jp(e,t){const r={...t};for(const n in t){const o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...l)=>{const c=i(...l);return o(...l),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}function kp(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 li(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=li(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Sp(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=li(e))&&(n&&(n+=" "),n+=t);return n}function $(...e){return Sp(e)}const Cp="ecr-button",Np={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"},Ep={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 ne({className:e,variant:t="default",size:r="default",asChild:n=!1,...o}){const i=n?bp:"button";return a.jsx(i,{"data-slot":"button","data-variant":t,"data-size":r,className:$(Cp,Np[t],Ep[r],e),...o})}function Tp({selectedReelIds:e,handleSelectAll:t,clearSelection:r,searchTerm:n,setSearchTerm:o,isCreating:i,handleCreateGroup:s,handleBulkDelete:l}){return a.jsxs("div",{className:"ecr-admin-reels-header",children:[a.jsxs("div",{className:"ecr-admin-reels-header__left",children:[a.jsx("h2",{className:"ecr-admin-reels-header__title",children:"Reels"}),e.length?a.jsxs("div",{className:"ecr-admin-reels-header__actions",children:[a.jsx(ne,{onClick:t,variant:"link",className:"ecr-admin-reels-header__action ecr-admin-reels-header__action--primary",children:"Select all"}),a.jsx(ne,{onClick:r,variant:"link",className:"ecr-admin-reels-header__action ecr-admin-reels-header__action--danger",children:"Clear"}),a.jsxs(ne,{variant:"outline-danger",size:"sm",onClick:l,children:[a.jsx(Gn,{size:22,className:"ecr-admin-reel-card__icon ecr-admin-reel-card__icon--danger"}),"Delete Selected"]})]}):null]}),a.jsxs("div",{className:"ecr-admin-reels-header__right",children:[a.jsxs("div",{className:"ecr-admin-reels-header__search",children:[a.jsx("input",{type:"text",placeholder:"Search reels...",value:n,onChange:c=>o(c.target.value),className:"ecr-admin-search-input"}),a.jsxs("div",{className:"ecr-admin-reels-header__icon-wrapper",children:[n&&a.jsx(ne,{onClick:()=>o(""),variant:"link",size:"icon-sm",children:a.jsx(qn,{size:16,className:"ecr-admin-reels-header__clear-icon"})}),a.jsx(ii,{size:16,className:"ecr-admin-reels-header__search-icon"})]})," "]}),e.length?a.jsxs(ne,{disabled:i,onClick:s,className:"ecr-admin-reels-header__create",children:[i?a.jsx(it,{className:"ecr-admin-reels-header__spinner"}):a.jsx(yt,{})," ","Create Widget"]}):null]})]})}function Ap(e){return V({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 Pp(e){return V({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M262.29 192.31a64 64 0 1 0 57.4 57.4 64.13 64.13 0 0 0-57.4-57.4zM416.39 256a154.34 154.34 0 0 1-1.53 20.79l45.21 35.46a10.81 10.81 0 0 1 2.45 13.75l-42.77 74a10.81 10.81 0 0 1-13.14 4.59l-44.9-18.08a16.11 16.11 0 0 0-15.17 1.75A164.48 164.48 0 0 1 325 400.8a15.94 15.94 0 0 0-8.82 12.14l-6.73 47.89a11.08 11.08 0 0 1-10.68 9.17h-85.54a11.11 11.11 0 0 1-10.69-8.87l-6.72-47.82a16.07 16.07 0 0 0-9-12.22 155.3 155.3 0 0 1-21.46-12.57 16 16 0 0 0-15.11-1.71l-44.89 18.07a10.81 10.81 0 0 1-13.14-4.58l-42.77-74a10.8 10.8 0 0 1 2.45-13.75l38.21-30a16.05 16.05 0 0 0 6-14.08c-.36-4.17-.58-8.33-.58-12.5s.21-8.27.58-12.35a16 16 0 0 0-6.07-13.94l-38.19-30A10.81 10.81 0 0 1 49.48 186l42.77-74a10.81 10.81 0 0 1 13.14-4.59l44.9 18.08a16.11 16.11 0 0 0 15.17-1.75A164.48 164.48 0 0 1 187 111.2a15.94 15.94 0 0 0 8.82-12.14l6.73-47.89A11.08 11.08 0 0 1 213.23 42h85.54a11.11 11.11 0 0 1 10.69 8.87l6.72 47.82a16.07 16.07 0 0 0 9 12.22 155.3 155.3 0 0 1 21.46 12.57 16 16 0 0 0 15.11 1.71l44.89-18.07a10.81 10.81 0 0 1 13.14 4.58l42.77 74a10.8 10.8 0 0 1-2.45 13.75l-38.21 30a16.05 16.05 0 0 0-6.05 14.08c.33 4.14.55 8.3.55 12.47z"},child:[]}]})(e)}function lt(e){return V({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 Op(){return a.jsx("div",{className:"ecr-admin-reels-empty",children:a.jsxs("p",{className:"ecr-admin-reels-empty__text",children:[a.jsx(lt,{color:"#FFA500",size:40}),a.jsx("span",{children:"You did not have any reel yet."})]})})}function Rp({isFullScreen:e}){return a.jsx("div",{className:$("ecr-admin-reels-loading",e&&"ecr-admin-reels-loading--fullscreen"),children:a.jsx(it,{className:"ecr-admin-reels-loading__icon"})})}const ci=({playingStory:e,duration:t,currentFileIndex:r,isPaused:n})=>a.jsx("div",{className:"ecr-player__progress",children:e?.files?.map((o,i)=>a.jsx("div",{className:"ecr-player__progress-track",children:a.jsx("div",{style:{"--reels-wp-animation-time":`${t}s`,animationPlayState:n?"paused":"running"},className:$("ecr-player__progress-fill",i===r?.index?"ecr-player__progress-fill--active":i<r?.index?"ecr-player__progress-fill--complete":"ecr-player__progress-fill--empty")})},i))}),wt=({className:e,children:t,...r})=>a.jsx("button",{className:$("ecr-player__nav",e),...r,children:t});/** 214 * @license lucide-react v0.552.0 - ISC 215 * 216 * This source code is licensed under the ISC license. 217 * See the LICENSE file in the root directory of this source tree. 218 */const Lp=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Ip=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,n)=>n?n.toUpperCase():r.toLowerCase()),di=e=>{const t=Ip(e);return t.charAt(0).toUpperCase()+t.slice(1)},ui=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim(),Mp=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/** 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 */var zp={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"};/** 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 */const Dp=_.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:o="",children:i,iconNode:s,...l},c)=>_.createElement("svg",{ref:c,...zp,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:ui("lucide",o),...!i&&!Mp(l)&&{"aria-hidden":"true"},...l},[...s.map(([d,u])=>_.createElement(d,u)),...Array.isArray(i)?i:[i]]));/** 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 Q=(e,t)=>{const r=_.forwardRef(({className:n,...o},i)=>_.createElement(Dp,{ref:i,iconNode:t,className:ui(`lucide-${Lp(di(e))}`,`lucide-${e}`,n),...o}));return r.displayName=di(e),r};/** 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 $p=Q("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** 239 239 * @license lucide-react v0.552.0 - ISC 240 240 * … … 256 256 * This source code is licensed under the ISC license. 257 257 * See the LICENSE file in the root directory of this source tree. 258 */const Dp=Q("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**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 $p=Q("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"}]]);/**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 Fp=Q("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"}]]);/**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 Bp=Q("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"}]]);/**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 Up=Q("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"}]]);/**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 Hp=Q("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**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 Vp=Q("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"}]]);/**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 Wp=Q("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"}]]);/**258 */const Fp=Q("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** 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 Bp=Q("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"}]]);/** 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 Up=Q("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"}]]);/** 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 Hp=Q("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"}]]);/** 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 Vp=Q("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"}]]);/** 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 Wp=Q("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** 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 qp=Q("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"}]]);/** 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 Gp=Q("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"}]]);/** 294 294 * @license lucide-react v0.552.0 - ISC 295 295 * … … 306 306 * This source code is licensed under the ISC license. 307 307 * See the LICENSE file in the root directory of this source tree. 308 */const qp=Q("smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);/**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 Gp=Q("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"}]]);/**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 Kp=Q("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**319 * @license lucide-react v0.552.0 - ISC 320 * 321 * This source code is licensed under the ISC license. 322 * See the LICENSE file in the root directory of this source tree. 323 */const Yp=Q("tablet",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["line",{x1:"12",x2:"12.01",y1:"18",y2:"18",key:"1dp563"}]]);/**324 * @license lucide-react v0.552.0 - ISC 325 * 326 * This source code is licensed under the ISC license. 327 * See the LICENSE file in the root directory of this source tree. 328 */const Xp=Q("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"}]]);/**329 * @license lucide-react v0.552.0 - ISC 330 * 331 * This source code is licensed under the ISC license. 332 * See the LICENSE file in the root directory of this source tree. 333 */const Jp=Q("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"}]]);/**334 * @license lucide-react v0.552.0 - ISC 335 * 336 * This source code is licensed under the ISC license. 337 * See the LICENSE file in the root directory of this source tree. 338 */const Zp=Q("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**308 */const Kp=Q("smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);/** 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 Yp=Q("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"}]]);/** 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 Xp=Q("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/** 319 * @license lucide-react v0.552.0 - ISC 320 * 321 * This source code is licensed under the ISC license. 322 * See the LICENSE file in the root directory of this source tree. 323 */const Jp=Q("tablet",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["line",{x1:"12",x2:"12.01",y1:"18",y2:"18",key:"1dp563"}]]);/** 324 * @license lucide-react v0.552.0 - ISC 325 * 326 * This source code is licensed under the ISC license. 327 * See the LICENSE file in the root directory of this source tree. 328 */const Zp=Q("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"}]]);/** 329 * @license lucide-react v0.552.0 - ISC 330 * 331 * This source code is licensed under the ISC license. 332 * See the LICENSE file in the root directory of this source tree. 333 */const Qp=Q("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"}]]);/** 334 * @license lucide-react v0.552.0 - ISC 335 * 336 * This source code is licensed under the ISC license. 337 * See the LICENSE file in the root directory of this source tree. 338 */const em=Q("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** 339 339 * @license lucide-react v0.552.0 - ISC 340 340 * … … 351 351 * This source code is licensed under the ISC license. 352 352 * See the LICENSE file in the root directory of this source tree. 353 */const er=Q("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]), Qp="Left",em="Right",tm="Up",rm="Down",jt={delta:10,preventScrollOnSwipe:!1,rotationAngle:0,trackMouse:!1,trackTouch:!0,swipeDuration:1/0,touchEventOptions:{passive:!0}},eo={first:!0,initial:[0,0],start:0,swiping:!1,xy:[0,0]},fi="mousemove",hi="mouseup",nm="touchend",om="touchmove",am="touchstart";function im(e,t,r,n){return e>t?r>0?em:Qp:n>0?rm:tm}function gi(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 sm(e,t){const r=u=>{const p="touches"in u;p&&u.touches.length>1||e((m,g)=>{g.trackMouse&&!p&&(document.addEventListener(fi,n),document.addEventListener(hi,s));const{clientX:b,clientY:f}=p?u.touches[0]:u,h=gi([b,f],g.rotationAngle);return g.onTouchStartOrOnMouseDown&&g.onTouchStartOrOnMouseDown({event:u}),Object.assign(Object.assign(Object.assign({},m),eo),{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]=gi([b,f],m.rotationAngle),y=h-p.xy[0],w=v-p.xy[1],j=Math.abs(y),C=Math.abs(w),N=(u.timeStamp||0)-p.start,S=Math.sqrt(j*j+C*C)/(N||1),E=[y/(N||1),w/(N||1)],T=im(j,C,y,w),A=typeof m.delta=="number"?m.delta:m.delta[T.toLowerCase()]||jt.delta;if(j<A&&C<A&&!p.swiping)return p;const R={absX:j,absY:C,deltaX:y,deltaY:w,dir:T,event:u,first:p.first,initial:p.initial,velocity:S,vxvy:E};R.first&&m.onSwipeStart&&m.onSwipeStart(R),m.onSwiping&&m.onSwiping(R);let L=!1;return(m.onSwiping||m.onSwiped||m[`onSwiped${T}`])&&(L=!0),L&&m.preventScrollOnSwipe&&m.trackTouch&&u.cancelable&&u.preventDefault(),Object.assign(Object.assign({},p),{first:!1,eventData:R,swiping:!0})})},o=u=>{e((p,m)=>{let g;if(p.swiping&&p.eventData){if(u.timeStamp-p.start<m.swipeDuration){g=Object.assign(Object.assign({},p.eventData),{event:u}),m.onSwiped&&m.onSwiped(g);const b=m[`onSwiped${g.dir}`];b&&b(g)}}else m.onTap&&m.onTap({event:u});return m.onTouchEndOrOnMouseUp&&m.onTouchEndOrOnMouseUp({event:u}),Object.assign(Object.assign(Object.assign({},p),eo),{eventData:g})})},i=()=>{document.removeEventListener(fi,n),document.removeEventListener(hi,s)},s=u=>{i(),o(u)},l=(u,p)=>{let m=()=>{};if(u&&u.addEventListener){const g=Object.assign(Object.assign({},jt.touchEventOptions),p.touchEventOptions),b=[[am,r,g],[om,n,Object.assign(Object.assign({},g),p.preventScrollOnSwipe?{passive:!1}:{})],[nm,o,g]];b.forEach(([f,h,v])=>u.addEventListener(f,h,v)),m=()=>b.forEach(([f,h])=>u.removeEventListener(f,h))}return m},d={ref:u=>{u!==null&&e((p,m)=>{if(p.el===u)return p;const g={};return p.el&&p.el!==u&&p.cleanUpTouch&&(p.cleanUpTouch(),g.cleanUpTouch=void 0),m.trackTouch&&u&&(g.cleanUpTouch=l(u,m)),Object.assign(Object.assign(Object.assign({},p),{el:u}),g)})}};return t.trackMouse&&(d.onMouseDown=r),[d,l]}function lm(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 cm(e){const{trackMouse:t}=e,r=x.useRef(Object.assign({},eo)),n=x.useRef(Object.assign({},jt)),o=x.useRef(Object.assign({},n.current));o.current=Object.assign({},n.current),n.current=Object.assign(Object.assign({},jt),e);let i;for(i in jt)n.current[i]===void 0&&(n.current[i]=jt[i]);const[s,l]=x.useMemo(()=>sm(c=>r.current=c(r.current,n.current),{trackMouse:t}),[t]);return r.current=lm(r.current,n.current,o.current,l),s}const Ar=e=>{const[t,r]=_.useState(()=>typeof window>"u"?!1:window.matchMedia(e).matches);return _.useEffect(()=>{if(typeof window>"u")return;const n=window.matchMedia(e),o=i=>{r(i.matches)};return n.addEventListener("change",o),()=>n.removeEventListener("change",o)},[e]),t},dm=({videoRefs:e,file:t,isMuted:r,isPaused:n,i:o,togglePlayPause:i,handleNextFile:s,setDuration:l})=>{const[c,d]=_.useState(!1);return a.jsx("div",{className:"ecr-player__media-frame",children:a.jsx("video",{preload:"metadata",playsInline:!0,"webkit-playsinline":"true",muted:r,autoPlay:!n,controls:!1,loop:!1,"aria-label":"Reel video",disablePictureInPicture:!0,controlsList:"nodownload noplaybackrate noremoteplayback",ref:u=>{u&&(e.current[o]=u,u.setAttribute("webkit-playsinline","true"),u.setAttribute("x-webkit-airplay","allow"),u.setAttribute("airplay","allow"))},className:c?"ecr-player__media ecr-player__media--portrait":"ecr-player__media",src:t?.url,onClick:()=>i(o),onEnded:s,onError:s,onLoadedMetadata:u=>{const p=u.currentTarget,m=p.videoWidth,g=p.videoHeight;d(g>m),l(p.duration)}})})},xi=({currentFileIndex:e,files:t,setDuration:r,setIsPlaying:n,setPreviewReel:o,isPaused:i,setIsPaused:s,isMuted:l,setIsMuted:c,handlePrevFile:d,handleNextFile:u})=>{const p=Ar("(min-width: 1024px)"),[m,g]=_.useState(l??!1),b=typeof l=="boolean"&&typeof c=="function",f=b?l:m,h=b?c:g,v=_.useRef([]);_.useEffect(()=>{v.current=[]},[t]);const y=N=>{const S=v.current[N];S&&(i?S.play().catch(()=>{}):S.pause(),s(E=>!E))},w=N=>{const S=v.current[N];S&&(S.muted=!l,h(E=>!E))},j=typeof window<"u"&&window.matchMedia("(max-width: 767px)").matches,C=cm({trackMouse:!0,onSwipedRight:d,onSwipedLeft:u,onSwipedUp:()=>{j&&u()},onSwipedDown:()=>{if(j){d();return}n&&n(null),o&&o(null)}});return a.jsx("div",{style:{left:`${-100*e?.index}%`},className:"ecr-player__slider",...C,children:Array.isArray(t)&&t.map((N,S)=>a.jsx("div",{className:"ecr-player__slide",children:N?.mime_type?.startsWith("image")?null:a.jsxs("div",{className:"ecr-player__media-frame",children:[a.jsx(dm,{videoRefs:v,file:N,isMuted:f,i:S,togglePlayPause:y,handleNextFile:u,setDuration:r,isPaused:i},N.file_uuid),a.jsxs("div",{className:"ecr-player__controls",children:[i?a.jsx(Jn,{size:p?20:24,className:"ecr-player__control-icon",onClick:()=>y(S)}):a.jsx(Xn,{size:p?20:24,className:"ecr-player__control-icon",onClick:()=>y(S)}),l?a.jsx(Qn,{size:p?20:24,className:"ecr-player__control-icon",onClick:()=>w(S)}):a.jsx(Zn,{size:p?20:24,className:"ecr-player__control-icon",onClick:()=>w(S)})]})]})},S))})},um=({previewReel:e,setPreviewReel:t})=>{const[r,n]=_.useState({index:0,story_uuid:e?.story_uuid}),[o,i]=_.useState(!1),[s,l]=_.useState(3);_.useEffect(()=>(document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}),[]);const c=()=>{const m=e?.files??[];r?.index>0?n(g=>({index:g.index-1,story_uuid:m[g.index-1].story_uuid})):t(null)},d=()=>{const m=e?.files??[];r?.index+1<m.length?n(g=>({index:g.index+1,story_uuid:m[g.index+1].story_uuid})):t(null)},u=e.files.length,p=m=>{m.target===m.currentTarget&&t(null)};return a.jsx("div",{onClick:p,style:{zIndex:999999999999999,backgroundColor:"rgba(0,0,0,0.8)",backdropFilter:"blur(8px)"},className:"ecommreels-story-modal ecr-player",children:e&&a.jsxs("div",{className:"ecr-player__stage",children:[u>1?a.jsxs(a.Fragment,{children:[r.index>0?a.jsx(wt,{onClick:c,className:"ecr-player__nav--left",children:a.jsx(Vn,{size:24})}):null,r.index<u-1?a.jsx(wt,{onClick:d,className:"ecr-player__nav--right",children:a.jsx(Wn,{size:24})}):null]}):null,a.jsxs("div",{id:"player",className:"ecr-player__frame",children:[e&&a.jsx(ci,{playingStory:e,duration:s,currentFileIndex:r,isPaused:o},`${e.story_uuid}-${r.index}`),a.jsx("div",{onClick:()=>t(null),className:"ecr-player__close",children:a.jsx(qn,{className:"ecr-player__close-icon"})}),e?.files.length>0&&a.jsx(xi,{currentFileIndex:r,files:e?.files,setDuration:l,setPreviewReel:t,isPaused:o,setIsPaused:i,handlePrevFile:c,handleNextFile:d,storyId:e.id,storyTitle:e?.title})]})]})})};function pm(e){return V({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 19h16v2H4zm0-4h11v2H4zm0-4h16v2H4zm0-8h16v2H4zm0 4h11v2H4z"},child:[]}]})(e)}function mm(e){return V({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 19h16v2H4zm3-4h10v2H7zm-3-4h16v2H4zm0-8h16v2H4zm3 4h10v2H7z"},child:[]}]})(e)}function fm(e){return V({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 19h16v2H4zm5-4h11v2H9zm-5-4h16v2H4zm0-8h16v2H4zm5 4h11v2H9z"},child:[]}]})(e)}function Pr(e){return V({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 hm(e){return V({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 bi(e){return V({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 gm(e){return V({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 xm(e){return V({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 bm(e){return V({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 _m(e){return V({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 vm=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`},ym=({story:e,styles:t,storyViews:r,setStoryViews:n})=>{_.useEffect(()=>{n&&n(s=>({...s,[e.id]:e.view_count}))},[e]);const o=e?.files[0]?.mime_type.startsWith("video"),i=e.thumbnail||void 0;return a.jsxs("div",{className:"ecr-thumb__media",children:[o?a.jsx("video",{className:"ecr-thumb__video",src:e?.files[0]?.url,muted:!0,playsInline:!0,"webkit-playsinline":"true",preload:"metadata",poster:i}):a.jsx("div",{className:"ecr-thumb__placeholder",children:"No Video"}),(r?.[e.id]??e.view_count)>0&&a.jsxs("div",{style:{left:t?.shape==="circle"?"50%":"100%",transform:`translateX(${t?.shape==="circle"?"-50%":`calc(-120% - ${t.border.border_radius/2}px)`})`,transition:"all 0.3s ease-in-out"},className:"ecr-thumb__views",children:[a.jsx("span",{children:vm(r?.[e.id]??e.view_count)}),a.jsx(sp,{size:14})]})]})},to=_.memo(ym);function wm({reel:e,styles:t,isSelected:r,onSelect:n,onDelete:o,onPreview:i,isAnyReelSelected:s}){return a.jsxs("div",{className:`ecr-admin-reel-card ${t?.hoverEffect??""}`,children:[a.jsxs("div",{style:{aspectRatio:t?.shape==="rectangle"?"9/16":"1/1"},className:$("ecr-admin-reel-card__frame",r?"ecr-admin-reel-card__frame--selected":""),children:[a.jsx(to,{story:e,styles:t}),a.jsxs("div",{className:$("ecr-admin-reel-card__actions",s?"":"ecr-admin-reel-card__actions--hover"),children:[e.files[0]?.mime_type.startsWith("image")?null:a.jsx(ne,{onClick:()=>i(e),className:"ecr-admin-reel-card__action ecr-admin-reel-card__action--primary",size:"icon-sm",title:"Preview Reel",children:a.jsx(hp,{size:18,className:"ecr-admin-reel-card__icon ecr-admin-reel-card__icon--primary"})}),a.jsx(ne,{title:"Edit Reel",size:"icon-sm",asChild:!0,className:"ecr-admin-reel-card__action",children:a.jsx(vt,{to:`?view=${X.cr}&from=${X.ar}&sid=${e.id}`,children:a.jsx(Pr,{className:"ecr-admin-reel-card__icon"})})}),a.jsx(ne,{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(Gn,{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:$("ecr-admin-reel-card__corner",s?"":"ecr-admin-reel-card__corner--hidden",r?"ecr-admin-reel-card__corner--selected":"ecr-admin-reel-card__corner--idle"),children:a.jsx(ne,{onClick:()=>n(e.id),size:"icon-sm",className:"ecr-admin-reel-card__select",children:r?a.jsx(gm,{size:18,className:"ecr-admin-reel-card__check ecr-admin-reel-card__check--active"}):a.jsx(xm,{size:18,className:"ecr-admin-reel-card__check"})})})]}),e.title&&a.jsx("p",{className:"ecr-admin-reel-card__title",children:e.title})]})}function jm({reels:e,styles:t,selectedReelIds:r,onSelectReel:n,onDeleteReel:o,onPreviewReel:i,lastStoryElementRef:s}){return a.jsx("div",{className:"ecr-admin-reels-grid",children:e?.map((l,c)=>a.jsx("div",{ref:e.length===c+1?s:null,children:a.jsx(wm,{reel:l,styles:t,isSelected:r.includes(l.id),onSelect:n,onDelete:o,onPreview:i,isAnyReelSelected:r.length>0})},l.id))})}const tr=({cb:e})=>{const t=Ne(),r=()=>{e?e():t(-1)};return a.jsx("button",{title:"Back",onClick:r,className:"ecr-admin-back-button",children:a.jsx(Ep,{size:24})})};function km(e){return V({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(vt,{to:r.href,className:"ecr-admin-breadcrumb__link",onClick:i=>{if(!t)return;const s=r.href;s&&(i.preventDefault(),t(s))},children:r.label}):a.jsx("span",{className:"ecr-admin-breadcrumb__current",children:r.label}),n<e.length-1&&a.jsx(km,{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=_.useRef(null);return _.useEffect(()=>{o.current&&o.current.focus()},[]),a.jsx("div",{className:"ecr-admin-modal",children:a.jsxs("div",{ref:o,tabIndex:-1,className:"ecr-admin-modal__panel",onBlur:i=>{i.currentTarget.contains(i.relatedTarget)||e(null)},children:[a.jsxs("div",{className:"ecr-admin-modal__content",children:[a.jsx("div",{className:"ecr-admin-modal__icon",children:a.jsx(dp,{size:40,color:"#ffa500"})}),a.jsx("p",{className:"ecr-admin-modal__message",children:n})]}),a.jsxs("div",{className:"ecr-admin-modal__actions",children:[a.jsx("button",{disabled:r,onClick:()=>e(null),className:"ecr-admin-modal__button ecr-admin-modal__button--cancel",children:"No"}),a.jsxs("button",{disabled:r,onClick:t,className:"ecr-admin-modal__button ecr-admin-modal__button--danger",children:[r&&a.jsx(it,{className:"ecr-admin-modal__spinner"}),"Yes"]})]})]})})},Rr=({to:e,Icon:t,textColor:r="#fff",text:n,className:o,onNavigate:i})=>a.jsxs(vt,{style:{color:r},to:e,className:$("ecr-admin-link-button",o),onClick:s=>{i&&(s.preventDefault(),i(e))},children:[t&&a.jsx(t,{}),n]}),Lr=({className:e})=>a.jsx("div",{className:$("ecr-admin-loader",e),children:a.jsx(it,{className:"ecr-admin-loader__icon",size:64})}),kt=({left:e=[],center:t=[],right:r=[],leftClass:n="",centerClass:o="",rightClass:i=""})=>a.jsxs("div",{className:"ecr-admin-navbar",children:[a.jsx("div",{className:`ecr-admin-navbar__section ${n}`.trim(),children:e.map((s,l)=>a.jsx(_.Fragment,{children:s},l))}),a.jsx("div",{className:`ecr-admin-navbar__section ${o}`.trim(),children:t.map((s,l)=>a.jsx(_.Fragment,{children:s},l))}),a.jsx("div",{className:`ecr-admin-navbar__section ${i}`.trim(),children:r.map((s,l)=>a.jsx(_.Fragment,{children:s},l))})]}),St=({name:e,Icon:t})=>a.jsxs("h1",{className:"ecr-admin-page-name",children:[a.jsx(t,{}),e]});function Sm(e){return V({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(Sm,{}),"ReelsWP"]});function _i(e,t){return function(){return e.apply(t,arguments)}}const{toString:Cm}=Object.prototype,{getPrototypeOf:ro}=Object,{iterator:Mr,toStringTag:vi}=Symbol,zr=(e=>t=>{const r=Cm.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),we=e=>(e=e.toLowerCase(),t=>zr(t)===e),Dr=e=>t=>typeof t===e,{isArray:Ct}=Array,Nt=Dr("undefined");function nr(e){return e!==null&&!Nt(e)&&e.constructor!==null&&!Nt(e.constructor)&&me(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const yi=we("ArrayBuffer");function Nm(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&yi(e.buffer),t}const Em=Dr("string"),me=Dr("function"),wi=Dr("number"),or=e=>e!==null&&typeof e=="object",Tm=e=>e===!0||e===!1,$r=e=>{if(zr(e)!=="object")return!1;const t=ro(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(vi in e)&&!(Mr in e)},Am=e=>{if(!or(e)||nr(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Pm=we("Date"),Om=we("File"),Rm=we("Blob"),Lm=we("FileList"),Im=e=>or(e)&&me(e.pipe),Mm=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||me(e.append)&&((t=zr(e))==="formdata"||t==="object"&&me(e.toString)&&e.toString()==="[object FormData]"))},zm=we("URLSearchParams"),[Dm,$m,Fm,Bm]=["ReadableStream","Request","Response","Headers"].map(we),Um=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]),Ct(e))for(n=0,o=e.length;n<o;n++)t.call(null,e[n],n,e);else{if(nr(e))return;const i=r?Object.getOwnPropertyNames(e):Object.keys(e),s=i.length;let l;for(n=0;n<s;n++)l=i[n],t.call(null,e[l],l,e)}}function ji(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 ct=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,ki=e=>!Nt(e)&&e!==ct;function no(){const{caseless:e,skipUndefined:t}=ki(this)&&this||{},r={},n=(o,i)=>{const s=e&&ji(r,i)||i;$r(r[s])&&$r(o)?r[s]=no(r[s],o):$r(o)?r[s]=no({},o):Ct(o)?r[s]=o.slice():(!t||!Nt(o))&&(r[s]=o)};for(let o=0,i=arguments.length;o<i;o++)arguments[o]&&ar(arguments[o],n);return r}const Hm=(e,t,r,{allOwnKeys:n}={})=>(ar(t,(o,i)=>{r&&me(o)?e[i]=_i(o,r):e[i]=o},{allOwnKeys:n}),e),Vm=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Wm=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},qm=(e,t,r,n)=>{let o,i,s;const l={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)s=o[i],(!n||n(s,e,t))&&!l[s]&&(t[s]=e[s],l[s]=!0);e=r!==!1&&ro(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},Gm=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},Km=e=>{if(!e)return null;if(Ct(e))return e;let t=e.length;if(!wi(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"&&ro(Uint8Array)),Xm=(e,t)=>{const n=(e&&e[Mr]).call(e);let o;for(;(o=n.next())&&!o.done;){const i=o.value;t.call(e,i[0],i[1])}},Jm=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},Zm=we("HTMLFormElement"),Qm=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,o){return n.toUpperCase()+o}),Si=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),ef=we("RegExp"),Ci=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};ar(r,(o,i)=>{let s;(s=t(o,i,e))!==!1&&(n[i]=s||o)}),Object.defineProperties(e,n)},tf=e=>{Ci(e,(t,r)=>{if(me(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(me(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},rf=(e,t)=>{const r={},n=o=>{o.forEach(i=>{r[i]=!0})};return Ct(e)?n(e):n(String(e).split(t)),r},nf=()=>{},of=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function af(e){return!!(e&&me(e.append)&&e[vi]==="FormData"&&e[Mr])}const sf=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 i=Ct(n)?[]:{};return ar(n,(s,l)=>{const c=r(s,o+1);!Nt(c)&&(i[l]=c)}),t[o]=void 0,i}}return n};return r(e,0)},lf=we("AsyncFunction"),cf=e=>e&&(or(e)||me(e))&&me(e.then)&&me(e.catch),Ni=((e,t)=>e?setImmediate:t?((r,n)=>(ct.addEventListener("message",({source:o,data:i})=>{o===ct&&i===r&&n.length&&n.shift()()},!1),o=>{n.push(o),ct.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",me(ct.postMessage)),df=typeof queueMicrotask<"u"?queueMicrotask.bind(ct):typeof process<"u"&&process.nextTick||Ni,k={isArray:Ct,isArrayBuffer:yi,isBuffer:nr,isFormData:Mm,isArrayBufferView:Nm,isString:Em,isNumber:wi,isBoolean:Tm,isObject:or,isPlainObject:$r,isEmptyObject:Am,isReadableStream:Dm,isRequest:$m,isResponse:Fm,isHeaders:Bm,isUndefined:Nt,isDate:Pm,isFile:Om,isBlob:Rm,isRegExp:ef,isFunction:me,isStream:Im,isURLSearchParams:zm,isTypedArray:Ym,isFileList:Lm,forEach:ar,merge:no,extend:Hm,trim:Um,stripBOM:Vm,inherits:Wm,toFlatObject:qm,kindOf:zr,kindOfTest:we,endsWith:Gm,toArray:Km,forEachEntry:Xm,matchAll:Jm,isHTMLForm:Zm,hasOwnProperty:Si,hasOwnProp:Si,reduceDescriptors:Ci,freezeMethods:tf,toObjectSet:rf,toCamelCase:Qm,noop:nf,toFiniteNumber:of,findKey:ji,global:ct,isContextDefined:ki,isSpecCompliantForm:af,toJSONObject:sf,isAsyncFn:lf,isThenable:cf,setImmediate:Ni,asap:df,isIterable:e=>e!=null&&me(e[Mr])};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)}k.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:k.toJSONObject(this.config),code:this.code,status:this.status}}});const Ei=U.prototype,Ti={};["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=>{Ti[e]={value:e}}),Object.defineProperties(U,Ti),Object.defineProperty(Ei,"isAxiosError",{value:!0}),U.from=(e,t,r,n,o,i)=>{const s=Object.create(Ei);k.toFlatObject(e,s,function(u){return u!==Error.prototype},d=>d!=="isAxiosError");const l=e&&e.message?e.message:"Error",c=t==null&&e?e.code:t;return U.call(s,l,c,r,n,o),e&&s.cause==null&&Object.defineProperty(s,"cause",{value:e,configurable:!0}),s.name=e&&e.name||"Error",i&&Object.assign(s,i),s};const uf=null;function oo(e){return k.isPlainObject(e)||k.isArray(e)}function Ai(e){return k.endsWith(e,"[]")?e.slice(0,-2):e}function Pi(e,t,r){return e?e.concat(t).map(function(o,i){return o=Ai(o),!r&&i?"["+o+"]":o}).join(r?".":""):t}function pf(e){return k.isArray(e)&&!e.some(oo)}const mf=k.toFlatObject(k,{},null,function(t){return/^is[A-Z]/.test(t)});function Fr(e,t,r){if(!k.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=k.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(f,h){return!k.isUndefined(h[f])});const n=r.metaTokens,o=r.visitor||u,i=r.dots,s=r.indexes,c=(r.Blob||typeof Blob<"u"&&Blob)&&k.isSpecCompliantForm(t);if(!k.isFunction(o))throw new TypeError("visitor must be a function");function d(b){if(b===null)return"";if(k.isDate(b))return b.toISOString();if(k.isBoolean(b))return b.toString();if(!c&&k.isBlob(b))throw new U("Blob is not supported. Use a Buffer instead.");return k.isArrayBuffer(b)||k.isTypedArray(b)?c&&typeof Blob=="function"?new Blob([b]):Buffer.from(b):b}function u(b,f,h){let v=b;if(b&&!h&&typeof b=="object"){if(k.endsWith(f,"{}"))f=n?f:f.slice(0,-2),b=JSON.stringify(b);else if(k.isArray(b)&&pf(b)||(k.isFileList(b)||k.endsWith(f,"[]"))&&(v=k.toArray(b)))return f=Ai(f),v.forEach(function(w,j){!(k.isUndefined(w)||w===null)&&t.append(s===!0?Pi([f],j,i):s===null?f:f+"[]",d(w))}),!1}return oo(b)?!0:(t.append(Pi(h,f,i),d(b)),!1)}const p=[],m=Object.assign(mf,{defaultVisitor:u,convertValue:d,isVisitable:oo});function g(b,f){if(!k.isUndefined(b)){if(p.indexOf(b)!==-1)throw Error("Circular reference detected in "+f.join("."));p.push(b),k.forEach(b,function(v,y){(!(k.isUndefined(v)||v===null)&&o.call(t,v,k.isString(y)?y.trim():y,f,m))===!0&&g(v,f?f.concat(y):[y])}),p.pop()}}if(!k.isObject(e))throw new TypeError("data must be an object");return g(e),t}function Oi(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function ao(e,t){this._pairs=[],e&&Fr(e,this,t)}const Ri=ao.prototype;Ri.append=function(t,r){this._pairs.push([t,r])},Ri.toString=function(t){const r=t?function(n){return t.call(this,n,Oi)}:Oi;return this._pairs.map(function(o){return r(o[0])+"="+r(o[1])},"").join("&")};function ff(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Li(e,t,r){if(!t)return e;const n=r&&r.encode||ff;k.isFunction(r)&&(r={serialize:r});const o=r&&r.serialize;let i;if(o?i=o(t,r):i=k.isURLSearchParams(t)?t.toString():new ao(t,r).toString(n),i){const s=e.indexOf("#");s!==-1&&(e=e.slice(0,s)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class Ii{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){k.forEach(this.handlers,function(n){n!==null&&t(n)})}}const Mi={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},hf={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:ao,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},io=typeof window<"u"&&typeof document<"u",so=typeof navigator=="object"&&navigator||void 0,gf=io&&(!so||["ReactNative","NativeScript","NS"].indexOf(so.product)<0),xf=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",bf=io&&window.location.href||"http://localhost",ue={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:io,hasStandardBrowserEnv:gf,hasStandardBrowserWebWorkerEnv:xf,navigator:so,origin:bf},Symbol.toStringTag,{value:"Module"})),...hf};function _f(e,t){return Fr(e,new ue.classes.URLSearchParams,{visitor:function(r,n,o,i){return ue.isNode&&k.isBuffer(r)?(this.append(n,r.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}function vf(e){return k.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function yf(e){const t={},r=Object.keys(e);let n;const o=r.length;let i;for(n=0;n<o;n++)i=r[n],t[i]=e[i];return t}function zi(e){function t(r,n,o,i){let s=r[i++];if(s==="__proto__")return!0;const l=Number.isFinite(+s),c=i>=r.length;return s=!s&&k.isArray(o)?o.length:s,c?(k.hasOwnProp(o,s)?o[s]=[o[s],n]:o[s]=n,!l):((!o[s]||!k.isObject(o[s]))&&(o[s]=[]),t(r,n,o[s],i)&&k.isArray(o[s])&&(o[s]=yf(o[s])),!l)}if(k.isFormData(e)&&k.isFunction(e.entries)){const r={};return k.forEachEntry(e,(n,o)=>{t(vf(n),o,r,0)}),r}return null}function wf(e,t,r){if(k.isString(e))try{return(t||JSON.parse)(e),k.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const ir={transitional:Mi,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",o=n.indexOf("application/json")>-1,i=k.isObject(t);if(i&&k.isHTMLForm(t)&&(t=new FormData(t)),k.isFormData(t))return o?JSON.stringify(zi(t)):t;if(k.isArrayBuffer(t)||k.isBuffer(t)||k.isStream(t)||k.isFile(t)||k.isBlob(t)||k.isReadableStream(t))return t;if(k.isArrayBufferView(t))return t.buffer;if(k.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return _f(t,this.formSerializer).toString();if((l=k.isFileList(t))||n.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return Fr(l?{"files[]":t}:t,c&&new c,this.formSerializer)}}return i||o?(r.setContentType("application/json",!1),wf(t)):t}],transformResponse:[function(t){const r=this.transitional||ir.transitional,n=r&&r.forcedJSONParsing,o=this.responseType==="json";if(k.isResponse(t)||k.isReadableStream(t))return t;if(t&&k.isString(t)&&(n&&!this.responseType||o)){const s=!(r&&r.silentJSONParsing)&&o;try{return JSON.parse(t,this.parseReviver)}catch(l){if(s)throw l.name==="SyntaxError"?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:ue.classes.FormData,Blob:ue.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};k.forEach(["delete","get","head","post","put","patch"],e=>{ir.headers[e]={}});const jf=k.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"]),kf=e=>{const t={};let r,n,o;return e&&e.split(`354 `).forEach(function(s){o=s.indexOf(":"),r=s.substring(0,o).trim().toLowerCase(),n=s.substring(o+1).trim(),!(!r||t[r]&& jf[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t},Di=Symbol("internals");function sr(e){return e&&String(e).trim().toLowerCase()}function Br(e){return e===!1||e==null?e:k.isArray(e)?e.map(Br):String(e)}function Sf(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 Cf=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function lo(e,t,r,n,o){if(k.isFunction(n))return n.call(this,t,r);if(o&&(t=r),!!k.isString(t)){if(k.isString(n))return t.indexOf(n)!==-1;if(k.isRegExp(n))return n.test(t)}}function Nf(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function Ef(e,t){const r=k.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(o,i,s){return this[n].call(this,t,o,i,s)},configurable:!0})})}let fe=class{constructor(t){t&&this.set(t)}set(t,r,n){const o=this;function i(l,c,d){const u=sr(c);if(!u)throw new Error("header name must be a non-empty string");const p=k.findKey(o,u);(!p||o[p]===void 0||d===!0||d===void 0&&o[p]!==!1)&&(o[p||c]=Br(l))}const s=(l,c)=>k.forEach(l,(d,u)=>i(d,u,c));if(k.isPlainObject(t)||t instanceof this.constructor)s(t,r);else if(k.isString(t)&&(t=t.trim())&&!Cf(t))s(kf(t),r);else if(k.isObject(t)&&k.isIterable(t)){let l={},c,d;for(const u of t){if(!k.isArray(u))throw TypeError("Object iterator must return a key-value pair");l[d=u[0]]=(c=l[d])?k.isArray(c)?[...c,u[1]]:[c,u[1]]:u[1]}s(l,r)}else t!=null&&i(r,t,n);return this}get(t,r){if(t=sr(t),t){const n=k.findKey(this,t);if(n){const o=this[n];if(!r)return o;if(r===!0)return Sf(o);if(k.isFunction(r))return r.call(this,o,n);if(k.isRegExp(r))return r.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=sr(t),t){const n=k.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||lo(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let o=!1;function i(s){if(s=sr(s),s){const l=k.findKey(n,s);l&&(!r||lo(n,n[l],l,r))&&(delete n[l],o=!0)}}return k.isArray(t)?t.forEach(i):i(t),o}clear(t){const r=Object.keys(this);let n=r.length,o=!1;for(;n--;){const i=r[n];(!t||lo(this,this[i],i,t,!0))&&(delete this[i],o=!0)}return o}normalize(t){const r=this,n={};return k.forEach(this,(o,i)=>{const s=k.findKey(n,i);if(s){r[s]=Br(o),delete r[i];return}const l=t?Nf(i):String(i).trim();l!==i&&delete r[i],r[l]=Br(o),n[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return k.forEach(this,(n,o)=>{n!=null&&n!==!1&&(r[o]=t&&k.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(`355 `)}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[Di]=this[Di]={accessors:{}}).accessors,o=this.prototype;function i(s){const l=sr(s);n[l]||( Ef(o,s),n[l]=!0)}return k.isArray(t)?t.forEach(i):i(t),this}};fe.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),k.reduceDescriptors(fe.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}}),k.freezeMethods(fe);function co(e,t){const r=this||ir,n=t||r,o=fe.from(n.headers);let i=n.data;return k.forEach(e,function(l){i=l.call(r,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function $i(e){return!!(e&&e.__CANCEL__)}function Et(e,t,r){U.call(this,e??"canceled",U.ERR_CANCELED,t,r),this.name="CanceledError"}k.inherits(Et,U,{__CANCEL__:!0});function Fi(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 Tf(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Af(e,t){e=e||10;const r=new Array(e),n=new Array(e);let o=0,i=0,s;return t=t!==void 0?t:1e3,function(c){const d=Date.now(),u=n[i];s||(s=d),r[o]=c,n[o]=d;let p=i,m=0;for(;p!==o;)m+=r[p++],p=p%e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),d-s<t)return;const g=u&&d-u;return g?Math.round(m*1e3/g):void 0}}function Pf(e,t){let r=0,n=1e3/t,o,i;const s=(d,u=Date.now())=>{r=u,o=null,i&&(clearTimeout(i),i=null),e(...d)};return[(...d)=>{const u=Date.now(),p=u-r;p>=n?s(d,u):(o=d,i||(i=setTimeout(()=>{i=null,s(o)},n-p)))},()=>o&&s(o)]}const Ur=(e,t,r=3)=>{let n=0;const o=Af(50,250);return Pf(i=>{const s=i.loaded,l=i.lengthComputable?i.total:void 0,c=s-n,d=o(c),u=s<=l;n=s;const p={loaded:s,total:l,progress:l?s/l:void 0,bytes:c,rate:d||void 0,estimated:d&&l&&u?(l-s)/d:void 0,event:i,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(p)},r)},Bi=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},Ui=e=>(...t)=>k.asap(()=>e(...t)),Of=ue.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,ue.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(ue.origin),ue.navigator&&/(msie|trident)/i.test(ue.navigator.userAgent)):()=>!0,Rf=ue.hasStandardBrowserEnv?{write(e,t,r,n,o,i,s){if(typeof document>"u")return;const l=[`${e}=${encodeURIComponent(t)}`];k.isNumber(r)&&l.push(`expires=${new Date(r).toUTCString()}`),k.isString(n)&&l.push(`path=${n}`),k.isString(o)&&l.push(`domain=${o}`),i===!0&&l.push("secure"),k.isString(s)&&l.push(`SameSite=${s}`),document.cookie=l.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Lf(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function If(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Hi(e,t,r){let n=!Lf(t);return e&&(n||r==!1)?If(e,t):t}const Vi=e=>e instanceof fe?{...e}:e;function dt(e,t){t=t||{};const r={};function n(d,u,p,m){return k.isPlainObject(d)&&k.isPlainObject(u)?k.merge.call({caseless:m},d,u):k.isPlainObject(u)?k.merge({},u):k.isArray(u)?u.slice():u}function o(d,u,p,m){if(k.isUndefined(u)){if(!k.isUndefined(d))return n(void 0,d,p,m)}else return n(d,u,p,m)}function i(d,u){if(!k.isUndefined(u))return n(void 0,u)}function s(d,u){if(k.isUndefined(u)){if(!k.isUndefined(d))return n(void 0,d)}else return n(void 0,u)}function l(d,u,p){if(p in t)return n(d,u);if(p in e)return n(void 0,d)}const c={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:l,headers:(d,u,p)=>o(Vi(d),Vi(u),p,!0)};return k.forEach(Object.keys({...e,...t}),function(u){const p=c[u]||o,m=p(e[u],t[u],u);k.isUndefined(m)&&p!==l||(r[u]=m)}),r}const Wi=e=>{const t=dt({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:o,xsrfCookieName:i,headers:s,auth:l}=t;if(t.headers=s=fe.from(s),t.url=Li(Hi(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),l&&s.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),k.isFormData(r)){if(ue.hasStandardBrowserEnv||ue.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(k.isFunction(r.getHeaders)){const c=r.getHeaders(),d=["content-type","content-length"];Object.entries(c).forEach(([u,p])=>{d.includes(u.toLowerCase())&&s.set(u,p)})}}if(ue.hasStandardBrowserEnv&&(n&&k.isFunction(n)&&(n=n(t)),n||n!==!1&&Of(t.url))){const c=o&&i&&Rf.read(i);c&&s.set(o,c)}return t},Mf=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(r,n){const o=Wi(e);let i=o.data;const s=fe.from(o.headers).normalize();let{responseType:l,onUploadProgress:c,onDownloadProgress:d}=o,u,p,m,g,b;function f(){g&&g(),b&&b(),o.cancelToken&&o.cancelToken.unsubscribe(u),o.signal&&o.signal.removeEventListener("abort",u)}let h=new XMLHttpRequest;h.open(o.method.toUpperCase(),o.url,!0),h.timeout=o.timeout;function v(){if(!h)return;const w=fe.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),C={data:!l||l==="text"||l==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:w,config:e,request:h};Fi(function(S){r(S),f()},function(S){n(S),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||Mi;o.timeoutErrorMessage&&(j=o.timeoutErrorMessage),n(new U(j,C.clarifyTimeoutError?U.ETIMEDOUT:U.ECONNABORTED,e,h)),h=null},i===void 0&&s.setContentType(null),"setRequestHeader"in h&&k.forEach(s.toJSON(),function(j,C){h.setRequestHeader(C,j)}),k.isUndefined(o.withCredentials)||(h.withCredentials=!!o.withCredentials),l&&l!=="json"&&(h.responseType=o.responseType),d&&([m,b]=Ur(d,!0),h.addEventListener("progress",m)),c&&h.upload&&([p,g]=Ur(c),h.upload.addEventListener("progress",p),h.upload.addEventListener("loadend",g)),(o.cancelToken||o.signal)&&(u=w=>{h&&(n(!w||w.type?new Et(null,e,h):w),h.abort(),h=null)},o.cancelToken&&o.cancelToken.subscribe(u),o.signal&&(o.signal.aborted?u():o.signal.addEventListener("abort",u)));const y=Tf(o.url);if(y&&ue.protocols.indexOf(y)===-1){n(new U("Unsupported protocol "+y+":",U.ERR_BAD_REQUEST,e));return}h.send(i||null)})},zf=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let n=new AbortController,o;const i=function(d){if(!o){o=!0,l();const u=d instanceof Error?d:this.reason;n.abort(u instanceof U?u:new Et(u instanceof Error?u.message:u))}};let s=t&&setTimeout(()=>{s=null,i(new U(`timeout ${t} of ms exceeded`,U.ETIMEDOUT))},t);const l=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(d=>{d.unsubscribe?d.unsubscribe(i):d.removeEventListener("abort",i)}),e=null)};e.forEach(d=>d.addEventListener("abort",i));const{signal:c}=n;return c.unsubscribe=()=>k.asap(l),c}},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},$f=async function*(e,t){for await(const r of Ff(e))yield*Df(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()}},qi=(e,t,r,n)=>{const o=$f(e,t);let i=0,s,l=c=>{s||(s=!0,n&&n(c))};return new ReadableStream({async pull(c){try{const{done:d,value:u}=await o.next();if(d){l(),c.close();return}let p=u.byteLength;if(r){let m=i+=p;r(m)}c.enqueue(new Uint8Array(u))}catch(d){throw l(d),d}},cancel(c){return l(c),o.return()}},{highWaterMark:2})},Gi=64*1024,{isFunction:Hr}=k,Bf=(({Request:e,Response:t})=>({Request:e,Response:t}))(k.global),{ReadableStream:Ki,TextEncoder:Yi}=k.global,Xi=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Uf=e=>{e=k.merge.call({skipUndefined:!0},Bf,e);const{fetch:t,Request:r,Response:n}=e,o=t?Hr(t):typeof fetch=="function",i=Hr(r),s=Hr(n);if(!o)return!1;const l=o&&Hr(Ki),c=o&&(typeof Yi=="function"?(b=>f=>b.encode(f))(new Yi):async b=>new Uint8Array(await new r(b).arrayBuffer())),d=i&&l&&Xi(()=>{let b=!1;const f=new r(ue.origin,{body:new Ki,method:"POST",get duplex(){return b=!0,"half"}}).headers.has("Content-Type");return b&&!f}),u=s&&l&&Xi(()=>k.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(k.isBlob(b))return b.size;if(k.isSpecCompliantForm(b))return(await new r(ue.origin,{method:"POST",body:b}).arrayBuffer()).byteLength;if(k.isArrayBufferView(b)||k.isArrayBuffer(b))return b.byteLength;if(k.isURLSearchParams(b)&&(b=b+""),k.isString(b))return(await c(b)).byteLength},g=async(b,f)=>{const h=k.toFiniteNumber(b.getContentLength());return h??m(f)};return async b=>{let{url:f,method:h,data:v,signal:y,cancelToken:w,timeout:j,onDownloadProgress:C,onUploadProgress:N,responseType:S,headers:E,withCredentials:T="same-origin",fetchOptions:A}=Wi(b),R=t||fetch;S=S?(S+"").toLowerCase():"text";let L=zf([y,w&&w.toAbortSignal()],j),B=null;const M=L&&L.unsubscribe&&(()=>{L.unsubscribe()});let O;try{if(N&&d&&h!=="get"&&h!=="head"&&(O=await g(E,v))!==0){let oe=new r(f,{method:"POST",body:v,duplex:"half"}),ge;if(k.isFormData(v)&&(ge=oe.headers.get("content-type"))&&E.setContentType(ge),oe.body){const[_e,pe]=Bi(O,Ur(Ui(N)));v=qi(oe.body,Gi,_e,pe)}}k.isString(T)||(T=T?"include":"omit");const P=i&&"credentials"in r.prototype,z={...A,signal:L,method:h.toUpperCase(),headers:E.normalize().toJSON(),body:v,duplex:"half",credentials:P?T:void 0};B=i&&new r(f,z);let I=await(i?R(B,A):R(f,z));const q=u&&(S==="stream"||S==="response");if(u&&(C||q&&M)){const oe={};["status","statusText","headers"].forEach(K=>{oe[K]=I[K]});const ge=k.toFiniteNumber(I.headers.get("content-length")),[_e,pe]=C&&Bi(ge,Ur(Ui(C),!0))||[];I=new n(qi(I.body,Gi,_e,()=>{pe&&pe(),M&&M()}),oe)}S=S||"text";let te=await p[k.findKey(p,S)||"text"](I,b);return!q&&M&&M(),await new Promise((oe,ge)=>{Fi(oe,ge,{data:te,headers:fe.from(I.headers),status:I.status,statusText:I.statusText,config:b,request:B})})}catch(P){throw M&&M(),P&&P.name==="TypeError"&&/Load failed|fetch/i.test(P.message)?Object.assign(new U("Network Error",U.ERR_NETWORK,b,B),{cause:P.cause||P}):U.from(P,P&&P.code,b,B)}}},Hf=new Map,Ji=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:o}=t,i=[n,o,r];let s=i.length,l=s,c,d,u=Hf;for(;l--;)c=i[l],d=u.get(c),d===void 0&&u.set(c,d=l?new Map:Uf(t)),u=d;return d};Ji();const uo={http:uf,xhr:Mf,fetch:{get:Ji}};k.forEach(uo,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Zi=e=>`- ${e}`,Vf=e=>k.isFunction(e)||e===null||e===!1;function Wf(e,t){e=k.isArray(e)?e:[e];const{length:r}=e;let n,o;const i={};for(let s=0;s<r;s++){n=e[s];let l;if(o=n,!Vf(n)&&(o=uo[(l=String(n)).toLowerCase()],o===void 0))throw new U(`Unknown adapter '${l}'`);if(o&&(k.isFunction(o)||(o=o.get(t))))break;i[l||"#"+s]=o}if(!o){const s=Object.entries(i).map(([c,d])=>`adapter ${c} `+(d===!1?"is not supported by the environment":"is not available in the build"));let l=r?s.length>1?`since :353 */const er=Q("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),tm="Left",rm="Right",nm="Up",om="Down",jt={delta:10,preventScrollOnSwipe:!1,rotationAngle:0,trackMouse:!1,trackTouch:!0,swipeDuration:1/0,touchEventOptions:{passive:!0}},eo={first:!0,initial:[0,0],start:0,swiping:!1,xy:[0,0]},fi="mousemove",hi="mouseup",am="touchend",im="touchmove",sm="touchstart";function lm(e,t,r,n){return e>t?r>0?rm:tm:n>0?om:nm}function gi(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 cm(e,t){const r=u=>{const p="touches"in u;p&&u.touches.length>1||e((m,g)=>{g.trackMouse&&!p&&(document.addEventListener(fi,n),document.addEventListener(hi,s));const{clientX:b,clientY:f}=p?u.touches[0]:u,h=gi([b,f],g.rotationAngle);return g.onTouchStartOrOnMouseDown&&g.onTouchStartOrOnMouseDown({event:u}),Object.assign(Object.assign(Object.assign({},m),eo),{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]=gi([b,f],m.rotationAngle),y=h-p.xy[0],w=v-p.xy[1],j=Math.abs(y),C=Math.abs(w),N=(u.timeStamp||0)-p.start,S=Math.sqrt(j*j+C*C)/(N||1),E=[y/(N||1),w/(N||1)],T=lm(j,C,y,w),A=typeof m.delta=="number"?m.delta:m.delta[T.toLowerCase()]||jt.delta;if(j<A&&C<A&&!p.swiping)return p;const R={absX:j,absY:C,deltaX:y,deltaY:w,dir:T,event:u,first:p.first,initial:p.initial,velocity:S,vxvy:E};R.first&&m.onSwipeStart&&m.onSwipeStart(R),m.onSwiping&&m.onSwiping(R);let L=!1;return(m.onSwiping||m.onSwiped||m[`onSwiped${T}`])&&(L=!0),L&&m.preventScrollOnSwipe&&m.trackTouch&&u.cancelable&&u.preventDefault(),Object.assign(Object.assign({},p),{first:!1,eventData:R,swiping:!0})})},o=u=>{e((p,m)=>{let g;if(p.swiping&&p.eventData){if(u.timeStamp-p.start<m.swipeDuration){g=Object.assign(Object.assign({},p.eventData),{event:u}),m.onSwiped&&m.onSwiped(g);const b=m[`onSwiped${g.dir}`];b&&b(g)}}else m.onTap&&m.onTap({event:u});return m.onTouchEndOrOnMouseUp&&m.onTouchEndOrOnMouseUp({event:u}),Object.assign(Object.assign(Object.assign({},p),eo),{eventData:g})})},i=()=>{document.removeEventListener(fi,n),document.removeEventListener(hi,s)},s=u=>{i(),o(u)},l=(u,p)=>{let m=()=>{};if(u&&u.addEventListener){const g=Object.assign(Object.assign({},jt.touchEventOptions),p.touchEventOptions),b=[[sm,r,g],[im,n,Object.assign(Object.assign({},g),p.preventScrollOnSwipe?{passive:!1}:{})],[am,o,g]];b.forEach(([f,h,v])=>u.addEventListener(f,h,v)),m=()=>b.forEach(([f,h])=>u.removeEventListener(f,h))}return m},d={ref:u=>{u!==null&&e((p,m)=>{if(p.el===u)return p;const g={};return p.el&&p.el!==u&&p.cleanUpTouch&&(p.cleanUpTouch(),g.cleanUpTouch=void 0),m.trackTouch&&u&&(g.cleanUpTouch=l(u,m)),Object.assign(Object.assign(Object.assign({},p),{el:u}),g)})}};return t.trackMouse&&(d.onMouseDown=r),[d,l]}function dm(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 um(e){const{trackMouse:t}=e,r=x.useRef(Object.assign({},eo)),n=x.useRef(Object.assign({},jt)),o=x.useRef(Object.assign({},n.current));o.current=Object.assign({},n.current),n.current=Object.assign(Object.assign({},jt),e);let i;for(i in jt)n.current[i]===void 0&&(n.current[i]=jt[i]);const[s,l]=x.useMemo(()=>cm(c=>r.current=c(r.current,n.current),{trackMouse:t}),[t]);return r.current=dm(r.current,n.current,o.current,l),s}const Ar=e=>{const[t,r]=_.useState(()=>typeof window>"u"?!1:window.matchMedia(e).matches);return _.useEffect(()=>{if(typeof window>"u")return;const n=window.matchMedia(e),o=i=>{r(i.matches)};return n.addEventListener("change",o),()=>n.removeEventListener("change",o)},[e]),t},pm=({videoRefs:e,file:t,isMuted:r,isPaused:n,i:o,togglePlayPause:i,handleNextFile:s,setDuration:l})=>{const[c,d]=_.useState(!1);return a.jsx("div",{className:"ecr-player__media-frame",children:a.jsx("video",{preload:"metadata",playsInline:!0,"webkit-playsinline":"true",muted:r,autoPlay:!n,controls:!1,loop:!1,"aria-label":"Reel video",disablePictureInPicture:!0,controlsList:"nodownload noplaybackrate noremoteplayback",ref:u=>{u&&(e.current[o]=u,u.setAttribute("webkit-playsinline","true"),u.setAttribute("x-webkit-airplay","allow"),u.setAttribute("airplay","allow"))},className:c?"ecr-player__media ecr-player__media--portrait":"ecr-player__media",src:t?.url,onClick:()=>i(o),onEnded:s,onError:s,onLoadedMetadata:u=>{const p=u.currentTarget,m=p.videoWidth,g=p.videoHeight;d(g>m),l(p.duration)}})})},xi=({currentFileIndex:e,files:t,setDuration:r,setIsPlaying:n,setPreviewReel:o,isPaused:i,setIsPaused:s,isMuted:l,setIsMuted:c,handlePrevFile:d,handleNextFile:u})=>{const p=Ar("(min-width: 1024px)"),[m,g]=_.useState(l??!1),b=typeof l=="boolean"&&typeof c=="function",f=b?l:m,h=b?c:g,v=_.useRef([]);_.useEffect(()=>{v.current=[]},[t]);const y=N=>{const S=v.current[N];S&&(i?S.play().catch(()=>{}):S.pause(),s(E=>!E))},w=N=>{const S=v.current[N];S&&(S.muted=!l,h(E=>!E))},j=typeof window<"u"&&window.matchMedia("(max-width: 767px)").matches,C=um({trackMouse:!0,onSwipedRight:d,onSwipedLeft:u,onSwipedUp:()=>{j&&u()},onSwipedDown:()=>{if(j){d();return}n&&n(null),o&&o(null)}});return a.jsx("div",{style:{left:`${-100*e?.index}%`},className:"ecr-player__slider",...C,children:Array.isArray(t)&&t.map((N,S)=>a.jsx("div",{className:"ecr-player__slide",children:N?.mime_type?.startsWith("image")?null:a.jsxs("div",{className:"ecr-player__media-frame",children:[a.jsx(pm,{videoRefs:v,file:N,isMuted:f,i:S,togglePlayPause:y,handleNextFile:u,setDuration:r,isPaused:i},N.file_uuid),a.jsxs("div",{className:"ecr-player__controls",children:[i?a.jsx(Jn,{size:p?20:24,className:"ecr-player__control-icon",onClick:()=>y(S)}):a.jsx(Xn,{size:p?20:24,className:"ecr-player__control-icon",onClick:()=>y(S)}),l?a.jsx(Qn,{size:p?20:24,className:"ecr-player__control-icon",onClick:()=>w(S)}):a.jsx(Zn,{size:p?20:24,className:"ecr-player__control-icon",onClick:()=>w(S)})]})]})},S))})},mm=({previewReel:e,setPreviewReel:t})=>{const[r,n]=_.useState({index:0,story_uuid:e?.story_uuid}),[o,i]=_.useState(!1),[s,l]=_.useState(3);_.useEffect(()=>(document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}),[]);const c=()=>{const m=e?.files??[];r?.index>0?n(g=>({index:g.index-1,story_uuid:m[g.index-1].story_uuid})):t(null)},d=()=>{const m=e?.files??[];r?.index+1<m.length?n(g=>({index:g.index+1,story_uuid:m[g.index+1].story_uuid})):t(null)},u=e.files.length,p=m=>{m.target===m.currentTarget&&t(null)};return a.jsx("div",{onClick:p,style:{zIndex:999999999999999,backgroundColor:"rgba(0,0,0,0.8)",backdropFilter:"blur(8px)"},className:"ecommreels-story-modal ecr-player",children:e&&a.jsxs("div",{className:"ecr-player__stage",children:[u>1?a.jsxs(a.Fragment,{children:[r.index>0?a.jsx(wt,{onClick:c,className:"ecr-player__nav--left",children:a.jsx(Vn,{size:24})}):null,r.index<u-1?a.jsx(wt,{onClick:d,className:"ecr-player__nav--right",children:a.jsx(Wn,{size:24})}):null]}):null,a.jsxs("div",{id:"player",className:"ecr-player__frame",children:[e&&a.jsx(ci,{playingStory:e,duration:s,currentFileIndex:r,isPaused:o},`${e.story_uuid}-${r.index}`),a.jsx("div",{onClick:()=>t(null),className:"ecr-player__close",children:a.jsx(qn,{className:"ecr-player__close-icon"})}),e?.files.length>0&&a.jsx(xi,{currentFileIndex:r,files:e?.files,setDuration:l,setPreviewReel:t,isPaused:o,setIsPaused:i,handlePrevFile:c,handleNextFile:d,storyId:e.id,storyTitle:e?.title})]})]})})};function fm(e){return V({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 19h16v2H4zm0-4h11v2H4zm0-4h16v2H4zm0-8h16v2H4zm0 4h11v2H4z"},child:[]}]})(e)}function hm(e){return V({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 19h16v2H4zm3-4h10v2H7zm-3-4h16v2H4zm0-8h16v2H4zm3 4h10v2H7z"},child:[]}]})(e)}function gm(e){return V({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 19h16v2H4zm5-4h11v2H9zm-5-4h16v2H4zm0-8h16v2H4zm5 4h11v2H9z"},child:[]}]})(e)}function Pr(e){return V({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 xm(e){return V({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 bi(e){return V({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 bm(e){return V({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 _m(e){return V({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 vm(e){return V({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 ym(e){return V({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 wm=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`},jm=({story:e,styles:t,storyViews:r,setStoryViews:n})=>{_.useEffect(()=>{n&&n(s=>({...s,[e.id]:e.view_count}))},[e]);const o=e?.files[0]?.mime_type.startsWith("video"),i=e.thumbnail||void 0;return a.jsxs("div",{className:"ecr-thumb__media",children:[o?a.jsx("video",{className:"ecr-thumb__video",src:e?.files[0]?.url,muted:!0,playsInline:!0,"webkit-playsinline":"true",preload:"metadata",poster:i}):a.jsx("div",{className:"ecr-thumb__placeholder",children:"No Video"}),(r?.[e.id]??e.view_count)>0&&a.jsxs("div",{style:{left:t?.shape==="circle"?"50%":"100%",transform:`translateX(${t?.shape==="circle"?"-50%":`calc(-120% - ${t.border.border_radius/2}px)`})`,transition:"all 0.3s ease-in-out"},className:"ecr-thumb__views",children:[a.jsx("span",{children:wm(r?.[e.id]??e.view_count)}),a.jsx(cp,{size:14})]})]})},to=_.memo(jm);function km({reel:e,styles:t,isSelected:r,onSelect:n,onDelete:o,onPreview:i,isAnyReelSelected:s}){return a.jsxs("div",{className:`ecr-admin-reel-card ${t?.hoverEffect??""}`,children:[a.jsxs("div",{style:{aspectRatio:t?.shape==="rectangle"?"9/16":"1/1"},className:$("ecr-admin-reel-card__frame",r?"ecr-admin-reel-card__frame--selected":""),children:[a.jsx(to,{story:e,styles:t}),a.jsxs("div",{className:$("ecr-admin-reel-card__actions",s?"":"ecr-admin-reel-card__actions--hover"),children:[e.files[0]?.mime_type.startsWith("image")?null:a.jsx(ne,{onClick:()=>i(e),className:"ecr-admin-reel-card__action ecr-admin-reel-card__action--primary",size:"icon-sm",title:"Preview Reel",children:a.jsx(xp,{size:18,className:"ecr-admin-reel-card__icon ecr-admin-reel-card__icon--primary"})}),a.jsx(ne,{title:"Edit Reel",size:"icon-sm",asChild:!0,className:"ecr-admin-reel-card__action",children:a.jsx(vt,{to:`?view=${X.cr}&from=${X.ar}&sid=${e.id}`,children:a.jsx(Pr,{className:"ecr-admin-reel-card__icon"})})}),a.jsx(ne,{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(Gn,{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:$("ecr-admin-reel-card__corner",s?"":"ecr-admin-reel-card__corner--hidden",r?"ecr-admin-reel-card__corner--selected":"ecr-admin-reel-card__corner--idle"),children:a.jsx(ne,{onClick:()=>n(e.id),size:"icon-sm",className:"ecr-admin-reel-card__select",children:r?a.jsx(bm,{size:18,className:"ecr-admin-reel-card__check ecr-admin-reel-card__check--active"}):a.jsx(_m,{size:18,className:"ecr-admin-reel-card__check"})})})]}),e.title&&a.jsx("p",{className:"ecr-admin-reel-card__title",children:e.title})]})}function Sm({reels:e,styles:t,selectedReelIds:r,onSelectReel:n,onDeleteReel:o,onPreviewReel:i,lastStoryElementRef:s}){return a.jsx("div",{className:"ecr-admin-reels-grid",children:e?.map((l,c)=>a.jsx("div",{ref:e.length===c+1?s:null,children:a.jsx(km,{reel:l,styles:t,isSelected:r.includes(l.id),onSelect:n,onDelete:o,onPreview:i,isAnyReelSelected:r.length>0})},l.id))})}const tr=({cb:e})=>{const t=Ne(),r=()=>{e?e():t(-1)};return a.jsx("button",{title:"Back",onClick:r,className:"ecr-admin-back-button",children:a.jsx(Ap,{size:24})})};function Cm(e){return V({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(vt,{to:r.href,className:"ecr-admin-breadcrumb__link",onClick:i=>{if(!t)return;const s=r.href;s&&(i.preventDefault(),t(s))},children:r.label}):a.jsx("span",{className:"ecr-admin-breadcrumb__current",children:r.label}),n<e.length-1&&a.jsx(Cm,{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=_.useRef(null);return _.useEffect(()=>{o.current&&o.current.focus()},[]),a.jsx("div",{className:"ecr-admin-modal",children:a.jsxs("div",{ref:o,tabIndex:-1,className:"ecr-admin-modal__panel",onBlur:i=>{i.currentTarget.contains(i.relatedTarget)||e(null)},children:[a.jsxs("div",{className:"ecr-admin-modal__content",children:[a.jsx("div",{className:"ecr-admin-modal__icon",children:a.jsx(pp,{size:40,color:"#ffa500"})}),a.jsx("p",{className:"ecr-admin-modal__message",children:n})]}),a.jsxs("div",{className:"ecr-admin-modal__actions",children:[a.jsx("button",{disabled:r,onClick:()=>e(null),className:"ecr-admin-modal__button ecr-admin-modal__button--cancel",children:"No"}),a.jsxs("button",{disabled:r,onClick:t,className:"ecr-admin-modal__button ecr-admin-modal__button--danger",children:[r&&a.jsx(it,{className:"ecr-admin-modal__spinner"}),"Yes"]})]})]})})},Rr=({to:e,Icon:t,textColor:r="#fff",text:n,className:o,onNavigate:i})=>a.jsxs(vt,{style:{color:r},to:e,className:$("ecr-admin-link-button",o),onClick:s=>{i&&(s.preventDefault(),i(e))},children:[t&&a.jsx(t,{}),n]}),Lr=({className:e})=>a.jsx("div",{className:$("ecr-admin-loader",e),children:a.jsx(it,{className:"ecr-admin-loader__icon",size:64})}),kt=({left:e=[],center:t=[],right:r=[],leftClass:n="",centerClass:o="",rightClass:i=""})=>a.jsxs("div",{className:"ecr-admin-navbar",children:[a.jsx("div",{className:`ecr-admin-navbar__section ${n}`.trim(),children:e.map((s,l)=>a.jsx(_.Fragment,{children:s},l))}),a.jsx("div",{className:`ecr-admin-navbar__section ${o}`.trim(),children:t.map((s,l)=>a.jsx(_.Fragment,{children:s},l))}),a.jsx("div",{className:`ecr-admin-navbar__section ${i}`.trim(),children:r.map((s,l)=>a.jsx(_.Fragment,{children:s},l))})]}),St=({name:e,Icon:t})=>a.jsxs("h1",{className:"ecr-admin-page-name",children:[a.jsx(t,{}),e]});function Nm(e){return V({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(Nm,{}),"ReelsWP"]});function _i(e,t){return function(){return e.apply(t,arguments)}}const{toString:Em}=Object.prototype,{getPrototypeOf:ro}=Object,{iterator:Mr,toStringTag:vi}=Symbol,zr=(e=>t=>{const r=Em.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),we=e=>(e=e.toLowerCase(),t=>zr(t)===e),Dr=e=>t=>typeof t===e,{isArray:Ct}=Array,Nt=Dr("undefined");function nr(e){return e!==null&&!Nt(e)&&e.constructor!==null&&!Nt(e.constructor)&&me(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const yi=we("ArrayBuffer");function Tm(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&yi(e.buffer),t}const Am=Dr("string"),me=Dr("function"),wi=Dr("number"),or=e=>e!==null&&typeof e=="object",Pm=e=>e===!0||e===!1,$r=e=>{if(zr(e)!=="object")return!1;const t=ro(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(vi in e)&&!(Mr 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}},Rm=we("Date"),Lm=we("File"),Im=we("Blob"),Mm=we("FileList"),zm=e=>or(e)&&me(e.pipe),Dm=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||me(e.append)&&((t=zr(e))==="formdata"||t==="object"&&me(e.toString)&&e.toString()==="[object FormData]"))},$m=we("URLSearchParams"),[Fm,Bm,Um,Hm]=["ReadableStream","Request","Response","Headers"].map(we),Vm=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]),Ct(e))for(n=0,o=e.length;n<o;n++)t.call(null,e[n],n,e);else{if(nr(e))return;const i=r?Object.getOwnPropertyNames(e):Object.keys(e),s=i.length;let l;for(n=0;n<s;n++)l=i[n],t.call(null,e[l],l,e)}}function ji(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 ct=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,ki=e=>!Nt(e)&&e!==ct;function no(){const{caseless:e,skipUndefined:t}=ki(this)&&this||{},r={},n=(o,i)=>{const s=e&&ji(r,i)||i;$r(r[s])&&$r(o)?r[s]=no(r[s],o):$r(o)?r[s]=no({},o):Ct(o)?r[s]=o.slice():(!t||!Nt(o))&&(r[s]=o)};for(let o=0,i=arguments.length;o<i;o++)arguments[o]&&ar(arguments[o],n);return r}const Wm=(e,t,r,{allOwnKeys:n}={})=>(ar(t,(o,i)=>{r&&me(o)?e[i]=_i(o,r):e[i]=o},{allOwnKeys:n}),e),qm=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Gm=(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)},Km=(e,t,r,n)=>{let o,i,s;const l={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)s=o[i],(!n||n(s,e,t))&&!l[s]&&(t[s]=e[s],l[s]=!0);e=r!==!1&&ro(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},Xm=e=>{if(!e)return null;if(Ct(e))return e;let t=e.length;if(!wi(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"&&ro(Uint8Array)),Zm=(e,t)=>{const n=(e&&e[Mr]).call(e);let o;for(;(o=n.next())&&!o.done;){const i=o.value;t.call(e,i[0],i[1])}},Qm=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},ef=we("HTMLFormElement"),tf=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,o){return n.toUpperCase()+o}),Si=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),rf=we("RegExp"),Ci=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};ar(r,(o,i)=>{let s;(s=t(o,i,e))!==!1&&(n[i]=s||o)}),Object.defineProperties(e,n)},nf=e=>{Ci(e,(t,r)=>{if(me(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(me(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},of=(e,t)=>{const r={},n=o=>{o.forEach(i=>{r[i]=!0})};return Ct(e)?n(e):n(String(e).split(t)),r},af=()=>{},sf=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function lf(e){return!!(e&&me(e.append)&&e[vi]==="FormData"&&e[Mr])}const cf=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 i=Ct(n)?[]:{};return ar(n,(s,l)=>{const c=r(s,o+1);!Nt(c)&&(i[l]=c)}),t[o]=void 0,i}}return n};return r(e,0)},df=we("AsyncFunction"),uf=e=>e&&(or(e)||me(e))&&me(e.then)&&me(e.catch),Ni=((e,t)=>e?setImmediate:t?((r,n)=>(ct.addEventListener("message",({source:o,data:i})=>{o===ct&&i===r&&n.length&&n.shift()()},!1),o=>{n.push(o),ct.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",me(ct.postMessage)),pf=typeof queueMicrotask<"u"?queueMicrotask.bind(ct):typeof process<"u"&&process.nextTick||Ni,k={isArray:Ct,isArrayBuffer:yi,isBuffer:nr,isFormData:Dm,isArrayBufferView:Tm,isString:Am,isNumber:wi,isBoolean:Pm,isObject:or,isPlainObject:$r,isEmptyObject:Om,isReadableStream:Fm,isRequest:Bm,isResponse:Um,isHeaders:Hm,isUndefined:Nt,isDate:Rm,isFile:Lm,isBlob:Im,isRegExp:rf,isFunction:me,isStream:zm,isURLSearchParams:$m,isTypedArray:Jm,isFileList:Mm,forEach:ar,merge:no,extend:Wm,trim:Vm,stripBOM:qm,inherits:Gm,toFlatObject:Km,kindOf:zr,kindOfTest:we,endsWith:Ym,toArray:Xm,forEachEntry:Zm,matchAll:Qm,isHTMLForm:ef,hasOwnProperty:Si,hasOwnProp:Si,reduceDescriptors:Ci,freezeMethods:nf,toObjectSet:of,toCamelCase:tf,noop:af,toFiniteNumber:sf,findKey:ji,global:ct,isContextDefined:ki,isSpecCompliantForm:lf,toJSONObject:cf,isAsyncFn:df,isThenable:uf,setImmediate:Ni,asap:pf,isIterable:e=>e!=null&&me(e[Mr])};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)}k.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:k.toJSONObject(this.config),code:this.code,status:this.status}}});const Ei=U.prototype,Ti={};["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=>{Ti[e]={value:e}}),Object.defineProperties(U,Ti),Object.defineProperty(Ei,"isAxiosError",{value:!0}),U.from=(e,t,r,n,o,i)=>{const s=Object.create(Ei);k.toFlatObject(e,s,function(u){return u!==Error.prototype},d=>d!=="isAxiosError");const l=e&&e.message?e.message:"Error",c=t==null&&e?e.code:t;return U.call(s,l,c,r,n,o),e&&s.cause==null&&Object.defineProperty(s,"cause",{value:e,configurable:!0}),s.name=e&&e.name||"Error",i&&Object.assign(s,i),s};const mf=null;function oo(e){return k.isPlainObject(e)||k.isArray(e)}function Ai(e){return k.endsWith(e,"[]")?e.slice(0,-2):e}function Pi(e,t,r){return e?e.concat(t).map(function(o,i){return o=Ai(o),!r&&i?"["+o+"]":o}).join(r?".":""):t}function ff(e){return k.isArray(e)&&!e.some(oo)}const hf=k.toFlatObject(k,{},null,function(t){return/^is[A-Z]/.test(t)});function Fr(e,t,r){if(!k.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=k.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(f,h){return!k.isUndefined(h[f])});const n=r.metaTokens,o=r.visitor||u,i=r.dots,s=r.indexes,c=(r.Blob||typeof Blob<"u"&&Blob)&&k.isSpecCompliantForm(t);if(!k.isFunction(o))throw new TypeError("visitor must be a function");function d(b){if(b===null)return"";if(k.isDate(b))return b.toISOString();if(k.isBoolean(b))return b.toString();if(!c&&k.isBlob(b))throw new U("Blob is not supported. Use a Buffer instead.");return k.isArrayBuffer(b)||k.isTypedArray(b)?c&&typeof Blob=="function"?new Blob([b]):Buffer.from(b):b}function u(b,f,h){let v=b;if(b&&!h&&typeof b=="object"){if(k.endsWith(f,"{}"))f=n?f:f.slice(0,-2),b=JSON.stringify(b);else if(k.isArray(b)&&ff(b)||(k.isFileList(b)||k.endsWith(f,"[]"))&&(v=k.toArray(b)))return f=Ai(f),v.forEach(function(w,j){!(k.isUndefined(w)||w===null)&&t.append(s===!0?Pi([f],j,i):s===null?f:f+"[]",d(w))}),!1}return oo(b)?!0:(t.append(Pi(h,f,i),d(b)),!1)}const p=[],m=Object.assign(hf,{defaultVisitor:u,convertValue:d,isVisitable:oo});function g(b,f){if(!k.isUndefined(b)){if(p.indexOf(b)!==-1)throw Error("Circular reference detected in "+f.join("."));p.push(b),k.forEach(b,function(v,y){(!(k.isUndefined(v)||v===null)&&o.call(t,v,k.isString(y)?y.trim():y,f,m))===!0&&g(v,f?f.concat(y):[y])}),p.pop()}}if(!k.isObject(e))throw new TypeError("data must be an object");return g(e),t}function Oi(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function ao(e,t){this._pairs=[],e&&Fr(e,this,t)}const Ri=ao.prototype;Ri.append=function(t,r){this._pairs.push([t,r])},Ri.toString=function(t){const r=t?function(n){return t.call(this,n,Oi)}:Oi;return this._pairs.map(function(o){return r(o[0])+"="+r(o[1])},"").join("&")};function gf(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Li(e,t,r){if(!t)return e;const n=r&&r.encode||gf;k.isFunction(r)&&(r={serialize:r});const o=r&&r.serialize;let i;if(o?i=o(t,r):i=k.isURLSearchParams(t)?t.toString():new ao(t,r).toString(n),i){const s=e.indexOf("#");s!==-1&&(e=e.slice(0,s)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class Ii{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){k.forEach(this.handlers,function(n){n!==null&&t(n)})}}const Mi={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},xf={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:ao,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},io=typeof window<"u"&&typeof document<"u",so=typeof navigator=="object"&&navigator||void 0,bf=io&&(!so||["ReactNative","NativeScript","NS"].indexOf(so.product)<0),_f=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",vf=io&&window.location.href||"http://localhost",ue={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:io,hasStandardBrowserEnv:bf,hasStandardBrowserWebWorkerEnv:_f,navigator:so,origin:vf},Symbol.toStringTag,{value:"Module"})),...xf};function yf(e,t){return Fr(e,new ue.classes.URLSearchParams,{visitor:function(r,n,o,i){return ue.isNode&&k.isBuffer(r)?(this.append(n,r.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}function wf(e){return k.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function jf(e){const t={},r=Object.keys(e);let n;const o=r.length;let i;for(n=0;n<o;n++)i=r[n],t[i]=e[i];return t}function zi(e){function t(r,n,o,i){let s=r[i++];if(s==="__proto__")return!0;const l=Number.isFinite(+s),c=i>=r.length;return s=!s&&k.isArray(o)?o.length:s,c?(k.hasOwnProp(o,s)?o[s]=[o[s],n]:o[s]=n,!l):((!o[s]||!k.isObject(o[s]))&&(o[s]=[]),t(r,n,o[s],i)&&k.isArray(o[s])&&(o[s]=jf(o[s])),!l)}if(k.isFormData(e)&&k.isFunction(e.entries)){const r={};return k.forEachEntry(e,(n,o)=>{t(wf(n),o,r,0)}),r}return null}function kf(e,t,r){if(k.isString(e))try{return(t||JSON.parse)(e),k.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const ir={transitional:Mi,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",o=n.indexOf("application/json")>-1,i=k.isObject(t);if(i&&k.isHTMLForm(t)&&(t=new FormData(t)),k.isFormData(t))return o?JSON.stringify(zi(t)):t;if(k.isArrayBuffer(t)||k.isBuffer(t)||k.isStream(t)||k.isFile(t)||k.isBlob(t)||k.isReadableStream(t))return t;if(k.isArrayBufferView(t))return t.buffer;if(k.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return yf(t,this.formSerializer).toString();if((l=k.isFileList(t))||n.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return Fr(l?{"files[]":t}:t,c&&new c,this.formSerializer)}}return i||o?(r.setContentType("application/json",!1),kf(t)):t}],transformResponse:[function(t){const r=this.transitional||ir.transitional,n=r&&r.forcedJSONParsing,o=this.responseType==="json";if(k.isResponse(t)||k.isReadableStream(t))return t;if(t&&k.isString(t)&&(n&&!this.responseType||o)){const s=!(r&&r.silentJSONParsing)&&o;try{return JSON.parse(t,this.parseReviver)}catch(l){if(s)throw l.name==="SyntaxError"?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:ue.classes.FormData,Blob:ue.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};k.forEach(["delete","get","head","post","put","patch"],e=>{ir.headers[e]={}});const Sf=k.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"]),Cf=e=>{const t={};let r,n,o;return e&&e.split(` 354 `).forEach(function(s){o=s.indexOf(":"),r=s.substring(0,o).trim().toLowerCase(),n=s.substring(o+1).trim(),!(!r||t[r]&&Sf[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t},Di=Symbol("internals");function sr(e){return e&&String(e).trim().toLowerCase()}function Br(e){return e===!1||e==null?e:k.isArray(e)?e.map(Br):String(e)}function Nf(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 Ef=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function lo(e,t,r,n,o){if(k.isFunction(n))return n.call(this,t,r);if(o&&(t=r),!!k.isString(t)){if(k.isString(n))return t.indexOf(n)!==-1;if(k.isRegExp(n))return n.test(t)}}function Tf(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function Af(e,t){const r=k.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(o,i,s){return this[n].call(this,t,o,i,s)},configurable:!0})})}let fe=class{constructor(t){t&&this.set(t)}set(t,r,n){const o=this;function i(l,c,d){const u=sr(c);if(!u)throw new Error("header name must be a non-empty string");const p=k.findKey(o,u);(!p||o[p]===void 0||d===!0||d===void 0&&o[p]!==!1)&&(o[p||c]=Br(l))}const s=(l,c)=>k.forEach(l,(d,u)=>i(d,u,c));if(k.isPlainObject(t)||t instanceof this.constructor)s(t,r);else if(k.isString(t)&&(t=t.trim())&&!Ef(t))s(Cf(t),r);else if(k.isObject(t)&&k.isIterable(t)){let l={},c,d;for(const u of t){if(!k.isArray(u))throw TypeError("Object iterator must return a key-value pair");l[d=u[0]]=(c=l[d])?k.isArray(c)?[...c,u[1]]:[c,u[1]]:u[1]}s(l,r)}else t!=null&&i(r,t,n);return this}get(t,r){if(t=sr(t),t){const n=k.findKey(this,t);if(n){const o=this[n];if(!r)return o;if(r===!0)return Nf(o);if(k.isFunction(r))return r.call(this,o,n);if(k.isRegExp(r))return r.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=sr(t),t){const n=k.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||lo(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let o=!1;function i(s){if(s=sr(s),s){const l=k.findKey(n,s);l&&(!r||lo(n,n[l],l,r))&&(delete n[l],o=!0)}}return k.isArray(t)?t.forEach(i):i(t),o}clear(t){const r=Object.keys(this);let n=r.length,o=!1;for(;n--;){const i=r[n];(!t||lo(this,this[i],i,t,!0))&&(delete this[i],o=!0)}return o}normalize(t){const r=this,n={};return k.forEach(this,(o,i)=>{const s=k.findKey(n,i);if(s){r[s]=Br(o),delete r[i];return}const l=t?Tf(i):String(i).trim();l!==i&&delete r[i],r[l]=Br(o),n[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return k.forEach(this,(n,o)=>{n!=null&&n!==!1&&(r[o]=t&&k.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(` 355 `)}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[Di]=this[Di]={accessors:{}}).accessors,o=this.prototype;function i(s){const l=sr(s);n[l]||(Af(o,s),n[l]=!0)}return k.isArray(t)?t.forEach(i):i(t),this}};fe.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),k.reduceDescriptors(fe.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}}),k.freezeMethods(fe);function co(e,t){const r=this||ir,n=t||r,o=fe.from(n.headers);let i=n.data;return k.forEach(e,function(l){i=l.call(r,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function $i(e){return!!(e&&e.__CANCEL__)}function Et(e,t,r){U.call(this,e??"canceled",U.ERR_CANCELED,t,r),this.name="CanceledError"}k.inherits(Et,U,{__CANCEL__:!0});function Fi(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 Pf(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Of(e,t){e=e||10;const r=new Array(e),n=new Array(e);let o=0,i=0,s;return t=t!==void 0?t:1e3,function(c){const d=Date.now(),u=n[i];s||(s=d),r[o]=c,n[o]=d;let p=i,m=0;for(;p!==o;)m+=r[p++],p=p%e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),d-s<t)return;const g=u&&d-u;return g?Math.round(m*1e3/g):void 0}}function Rf(e,t){let r=0,n=1e3/t,o,i;const s=(d,u=Date.now())=>{r=u,o=null,i&&(clearTimeout(i),i=null),e(...d)};return[(...d)=>{const u=Date.now(),p=u-r;p>=n?s(d,u):(o=d,i||(i=setTimeout(()=>{i=null,s(o)},n-p)))},()=>o&&s(o)]}const Ur=(e,t,r=3)=>{let n=0;const o=Of(50,250);return Rf(i=>{const s=i.loaded,l=i.lengthComputable?i.total:void 0,c=s-n,d=o(c),u=s<=l;n=s;const p={loaded:s,total:l,progress:l?s/l:void 0,bytes:c,rate:d||void 0,estimated:d&&l&&u?(l-s)/d:void 0,event:i,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(p)},r)},Bi=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},Ui=e=>(...t)=>k.asap(()=>e(...t)),Lf=ue.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,ue.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(ue.origin),ue.navigator&&/(msie|trident)/i.test(ue.navigator.userAgent)):()=>!0,If=ue.hasStandardBrowserEnv?{write(e,t,r,n,o,i,s){if(typeof document>"u")return;const l=[`${e}=${encodeURIComponent(t)}`];k.isNumber(r)&&l.push(`expires=${new Date(r).toUTCString()}`),k.isString(n)&&l.push(`path=${n}`),k.isString(o)&&l.push(`domain=${o}`),i===!0&&l.push("secure"),k.isString(s)&&l.push(`SameSite=${s}`),document.cookie=l.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Mf(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function zf(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Hi(e,t,r){let n=!Mf(t);return e&&(n||r==!1)?zf(e,t):t}const Vi=e=>e instanceof fe?{...e}:e;function dt(e,t){t=t||{};const r={};function n(d,u,p,m){return k.isPlainObject(d)&&k.isPlainObject(u)?k.merge.call({caseless:m},d,u):k.isPlainObject(u)?k.merge({},u):k.isArray(u)?u.slice():u}function o(d,u,p,m){if(k.isUndefined(u)){if(!k.isUndefined(d))return n(void 0,d,p,m)}else return n(d,u,p,m)}function i(d,u){if(!k.isUndefined(u))return n(void 0,u)}function s(d,u){if(k.isUndefined(u)){if(!k.isUndefined(d))return n(void 0,d)}else return n(void 0,u)}function l(d,u,p){if(p in t)return n(d,u);if(p in e)return n(void 0,d)}const c={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:l,headers:(d,u,p)=>o(Vi(d),Vi(u),p,!0)};return k.forEach(Object.keys({...e,...t}),function(u){const p=c[u]||o,m=p(e[u],t[u],u);k.isUndefined(m)&&p!==l||(r[u]=m)}),r}const Wi=e=>{const t=dt({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:o,xsrfCookieName:i,headers:s,auth:l}=t;if(t.headers=s=fe.from(s),t.url=Li(Hi(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),l&&s.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),k.isFormData(r)){if(ue.hasStandardBrowserEnv||ue.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(k.isFunction(r.getHeaders)){const c=r.getHeaders(),d=["content-type","content-length"];Object.entries(c).forEach(([u,p])=>{d.includes(u.toLowerCase())&&s.set(u,p)})}}if(ue.hasStandardBrowserEnv&&(n&&k.isFunction(n)&&(n=n(t)),n||n!==!1&&Lf(t.url))){const c=o&&i&&If.read(i);c&&s.set(o,c)}return t},Df=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(r,n){const o=Wi(e);let i=o.data;const s=fe.from(o.headers).normalize();let{responseType:l,onUploadProgress:c,onDownloadProgress:d}=o,u,p,m,g,b;function f(){g&&g(),b&&b(),o.cancelToken&&o.cancelToken.unsubscribe(u),o.signal&&o.signal.removeEventListener("abort",u)}let h=new XMLHttpRequest;h.open(o.method.toUpperCase(),o.url,!0),h.timeout=o.timeout;function v(){if(!h)return;const w=fe.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),C={data:!l||l==="text"||l==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:w,config:e,request:h};Fi(function(S){r(S),f()},function(S){n(S),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||Mi;o.timeoutErrorMessage&&(j=o.timeoutErrorMessage),n(new U(j,C.clarifyTimeoutError?U.ETIMEDOUT:U.ECONNABORTED,e,h)),h=null},i===void 0&&s.setContentType(null),"setRequestHeader"in h&&k.forEach(s.toJSON(),function(j,C){h.setRequestHeader(C,j)}),k.isUndefined(o.withCredentials)||(h.withCredentials=!!o.withCredentials),l&&l!=="json"&&(h.responseType=o.responseType),d&&([m,b]=Ur(d,!0),h.addEventListener("progress",m)),c&&h.upload&&([p,g]=Ur(c),h.upload.addEventListener("progress",p),h.upload.addEventListener("loadend",g)),(o.cancelToken||o.signal)&&(u=w=>{h&&(n(!w||w.type?new Et(null,e,h):w),h.abort(),h=null)},o.cancelToken&&o.cancelToken.subscribe(u),o.signal&&(o.signal.aborted?u():o.signal.addEventListener("abort",u)));const y=Pf(o.url);if(y&&ue.protocols.indexOf(y)===-1){n(new U("Unsupported protocol "+y+":",U.ERR_BAD_REQUEST,e));return}h.send(i||null)})},$f=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let n=new AbortController,o;const i=function(d){if(!o){o=!0,l();const u=d instanceof Error?d:this.reason;n.abort(u instanceof U?u:new Et(u instanceof Error?u.message:u))}};let s=t&&setTimeout(()=>{s=null,i(new U(`timeout ${t} of ms exceeded`,U.ETIMEDOUT))},t);const l=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(d=>{d.unsubscribe?d.unsubscribe(i):d.removeEventListener("abort",i)}),e=null)};e.forEach(d=>d.addEventListener("abort",i));const{signal:c}=n;return c.unsubscribe=()=>k.asap(l),c}},Ff=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},Bf=async function*(e,t){for await(const r of Uf(e))yield*Ff(r,t)},Uf=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()}},qi=(e,t,r,n)=>{const o=Bf(e,t);let i=0,s,l=c=>{s||(s=!0,n&&n(c))};return new ReadableStream({async pull(c){try{const{done:d,value:u}=await o.next();if(d){l(),c.close();return}let p=u.byteLength;if(r){let m=i+=p;r(m)}c.enqueue(new Uint8Array(u))}catch(d){throw l(d),d}},cancel(c){return l(c),o.return()}},{highWaterMark:2})},Gi=64*1024,{isFunction:Hr}=k,Hf=(({Request:e,Response:t})=>({Request:e,Response:t}))(k.global),{ReadableStream:Ki,TextEncoder:Yi}=k.global,Xi=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Vf=e=>{e=k.merge.call({skipUndefined:!0},Hf,e);const{fetch:t,Request:r,Response:n}=e,o=t?Hr(t):typeof fetch=="function",i=Hr(r),s=Hr(n);if(!o)return!1;const l=o&&Hr(Ki),c=o&&(typeof Yi=="function"?(b=>f=>b.encode(f))(new Yi):async b=>new Uint8Array(await new r(b).arrayBuffer())),d=i&&l&&Xi(()=>{let b=!1;const f=new r(ue.origin,{body:new Ki,method:"POST",get duplex(){return b=!0,"half"}}).headers.has("Content-Type");return b&&!f}),u=s&&l&&Xi(()=>k.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(k.isBlob(b))return b.size;if(k.isSpecCompliantForm(b))return(await new r(ue.origin,{method:"POST",body:b}).arrayBuffer()).byteLength;if(k.isArrayBufferView(b)||k.isArrayBuffer(b))return b.byteLength;if(k.isURLSearchParams(b)&&(b=b+""),k.isString(b))return(await c(b)).byteLength},g=async(b,f)=>{const h=k.toFiniteNumber(b.getContentLength());return h??m(f)};return async b=>{let{url:f,method:h,data:v,signal:y,cancelToken:w,timeout:j,onDownloadProgress:C,onUploadProgress:N,responseType:S,headers:E,withCredentials:T="same-origin",fetchOptions:A}=Wi(b),R=t||fetch;S=S?(S+"").toLowerCase():"text";let L=$f([y,w&&w.toAbortSignal()],j),B=null;const M=L&&L.unsubscribe&&(()=>{L.unsubscribe()});let O;try{if(N&&d&&h!=="get"&&h!=="head"&&(O=await g(E,v))!==0){let oe=new r(f,{method:"POST",body:v,duplex:"half"}),ge;if(k.isFormData(v)&&(ge=oe.headers.get("content-type"))&&E.setContentType(ge),oe.body){const[_e,pe]=Bi(O,Ur(Ui(N)));v=qi(oe.body,Gi,_e,pe)}}k.isString(T)||(T=T?"include":"omit");const P=i&&"credentials"in r.prototype,z={...A,signal:L,method:h.toUpperCase(),headers:E.normalize().toJSON(),body:v,duplex:"half",credentials:P?T:void 0};B=i&&new r(f,z);let I=await(i?R(B,A):R(f,z));const q=u&&(S==="stream"||S==="response");if(u&&(C||q&&M)){const oe={};["status","statusText","headers"].forEach(K=>{oe[K]=I[K]});const ge=k.toFiniteNumber(I.headers.get("content-length")),[_e,pe]=C&&Bi(ge,Ur(Ui(C),!0))||[];I=new n(qi(I.body,Gi,_e,()=>{pe&&pe(),M&&M()}),oe)}S=S||"text";let te=await p[k.findKey(p,S)||"text"](I,b);return!q&&M&&M(),await new Promise((oe,ge)=>{Fi(oe,ge,{data:te,headers:fe.from(I.headers),status:I.status,statusText:I.statusText,config:b,request:B})})}catch(P){throw M&&M(),P&&P.name==="TypeError"&&/Load failed|fetch/i.test(P.message)?Object.assign(new U("Network Error",U.ERR_NETWORK,b,B),{cause:P.cause||P}):U.from(P,P&&P.code,b,B)}}},Wf=new Map,Ji=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:o}=t,i=[n,o,r];let s=i.length,l=s,c,d,u=Wf;for(;l--;)c=i[l],d=u.get(c),d===void 0&&u.set(c,d=l?new Map:Vf(t)),u=d;return d};Ji();const uo={http:mf,xhr:Df,fetch:{get:Ji}};k.forEach(uo,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Zi=e=>`- ${e}`,qf=e=>k.isFunction(e)||e===null||e===!1;function Gf(e,t){e=k.isArray(e)?e:[e];const{length:r}=e;let n,o;const i={};for(let s=0;s<r;s++){n=e[s];let l;if(o=n,!qf(n)&&(o=uo[(l=String(n)).toLowerCase()],o===void 0))throw new U(`Unknown adapter '${l}'`);if(o&&(k.isFunction(o)||(o=o.get(t))))break;i[l||"#"+s]=o}if(!o){const s=Object.entries(i).map(([c,d])=>`adapter ${c} `+(d===!1?"is not supported by the environment":"is not available in the build"));let l=r?s.length>1?`since : 356 356 `+s.map(Zi).join(` 357 `):" "+Zi(s[0]):"as no adapter specified";throw new U("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return o}const Qi={getAdapter: Wf,adapters:uo};function po(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Et(null,e)}function es(e){return po(e),e.headers=fe.from(e.headers),e.data=co.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Qi.getAdapter(e.adapter||ir.adapter,e)(e).then(function(n){return po(e),n.data=co.call(e,e.transformResponse,n),n.headers=fe.from(n.headers),n},function(n){return $i(n)||(po(e),n&&n.response&&(n.response.data=co.call(e,e.transformResponse,n.response),n.response.headers=fe.from(n.response.headers))),Promise.reject(n)})}const ts="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 rs={};Vr.transitional=function(t,r,n){function o(i,s){return"[Axios v"+ts+"] Transitional option '"+i+"'"+s+(n?". "+n:"")}return(i,s,l)=>{if(t===!1)throw new U(o(s," has been removed"+(r?" in "+r:"")),U.ERR_DEPRECATED);return r&&!rs[s]&&(rs[s]=!0,console.warn(o(s," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(i,s,l):!0}},Vr.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function qf(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 i=n[o],s=t[i];if(s){const l=e[i],c=l===void 0||s(l,i,e);if(c!==!0)throw new U("option "+i+" must be "+c,U.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new U("Unknown option "+i,U.ERR_BAD_OPTION)}}const Wr={assertOptions:qf,validators:Vr},Te=Wr.validators;let ut=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Ii,response:new Ii}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const i=o.stack?o.stack.replace(/^.+\n/,""):"";try{n.stack?i&&!String(n.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(n.stack+=`358 `+i):n.stack=i}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=dt(this.defaults,r);const{transitional:n,paramsSerializer:o,headers:i}=r;n!==void 0&&Wr.assertOptions(n,{silentJSONParsing:Te.transitional(Te.boolean),forcedJSONParsing:Te.transitional(Te.boolean),clarifyTimeoutError:Te.transitional(Te.boolean)},!1),o!=null&&(k.isFunction(o)?r.paramsSerializer={serialize:o}:Wr.assertOptions(o,{encode:Te.function,serialize:Te.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),Wr.assertOptions(r,{baseUrl:Te.spelling("baseURL"),withXsrfToken:Te.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let s=i&&k.merge(i.common,i[r.method]);i&&k.forEach(["delete","get","head","post","put","patch","common"],b=>{delete i[b]}),r.headers=fe.concat(s,i);const l=[];let c=!0;this.interceptors.request.forEach(function(f){typeof f.runWhen=="function"&&f.runWhen(r)===!1||(c=c&&f.synchronous,l.unshift(f.fulfilled,f.rejected))});const d=[];this.interceptors.response.forEach(function(f){d.push(f.fulfilled,f.rejected)});let u,p=0,m;if(!c){const b=[es.bind(this),void 0];for(b.unshift(...l),b.push(...d),m=b.length,u=Promise.resolve(r);p<m;)u=u.then(b[p++],b[p++]);return u}m=l.length;let g=r;for(;p<m;){const b=l[p++],f=l[p++];try{g=b(g)}catch(h){f.call(this,h);break}}try{u=es.call(this,g)}catch(b){return Promise.reject(b)}for(p=0,m=d.length;p<m;)u=u.then(d[p++],d[p++]);return u}getUri(t){t=dt(this.defaults,t);const r=Hi(t.baseURL,t.url,t.allowAbsoluteUrls);return Li(r,t.params,t.paramsSerializer)}};k.forEach(["delete","get","head","options"],function(t){ut.prototype[t]=function(r,n){return this.request(dt(n||{},{method:t,url:r,data:(n||{}).data}))}}),k.forEach(["post","put","patch"],function(t){function r(n){return function(i,s,l){return this.request(dt(l||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:s}))}}ut.prototype[t]=r(),ut.prototype[t+"Form"]=r(!0)});let Gf=class Cd{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(i){r=i});const n=this;this.promise.then(o=>{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](o);n._listeners=null}),this.promise.then=o=>{let i;const s=new Promise(l=>{n.subscribe(l),i=l}).then(o);return s.cancel=function(){n.unsubscribe(i)},s},t(function(i,s,l){n.reason||(n.reason=new Et(i,s,l),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new Cd(function(o){t=o}),cancel:t}}};function Kf(e){return function(r){return e.apply(null,r)}}function Yf(e){return k.isObject(e)&&e.isAxiosError===!0}const mo={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(mo).forEach(([e,t])=>{mo[t]=e});function ns(e){const t=new ut(e),r=_i(ut.prototype.request,t);return k.extend(r,ut.prototype,t,{allOwnKeys:!0}),k.extend(r,t,null,{allOwnKeys:!0}),r.create=function(o){return ns(dt(e,o))},r}const re=ns(ir);re.Axios=ut,re.CanceledError=Et,re.CancelToken=Gf,re.isCancel=$i,re.VERSION=ts,re.toFormData=Fr,re.AxiosError=U,re.Cancel=re.CanceledError,re.all=function(t){return Promise.all(t)},re.spread=Kf,re.isAxiosError=Yf,re.mergeConfig=dt,re.AxiosHeaders=fe,re.formToJSON=e=>zi(k.isHTMLForm(e)?new FormData(e):e),re.getAdapter=Qi.getAdapter,re.HttpStatusCode=mo,re.default=re;const{Axios:_1,AxiosError:v1,CanceledError:y1,isCancel:w1,CancelToken:j1,VERSION:k1,all:S1,Cancel:C1,isAxiosError:N1,spread:E1,toFormData:T1,AxiosHeaders:A1,HttpStatusCode:P1,formToJSON:O1,getAdapter:R1,mergeConfig:L1}=re,os=ecommreelsInfo,he=re.create({baseURL:`${os.apiBase}`,headers:{"X-WP-Nonce":os.nonce,"Content-Type":"application/json"}}),Xf=()=>{const[e,t]=_.useState(!1),[r,n]=_.useState(!1),o=_.useCallback(async s=>{try{t(!0);const l={styles:ot,story_ids:s},c=await he.post("stories/manage-group-stories",l);return G.success("Group created successfully!"),c.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)}},[]),i=_.useCallback(async(s,l,c)=>{try{return n(!0),await he.delete(`story/${s}`),l(d=>d.filter(u=>u.id!==s)),c?.silent||G.success("Reel deleted successfully!"),{ok:!0}}catch(d){const u=d instanceof Error?d.message:"Something went wrong. Try again later!";return c?.silent||G.error(u),{ok:!1,message:u}}finally{n(!1)}},[]);return{styles:ot,isCreating:e,isDeleting:r,createGroup:o,deleteReel:i}};function fo(e,t){const[r,n]=_.useState(e);return _.useEffect(()=>{const o=setTimeout(()=>{n(e)},t);return()=>{clearTimeout(o)}},[e,t]),r}const as=e=>{const[t,r]=_.useState([]),[n,o]=_.useState(1),[i,s]=_.useState(!0),[l,c]=_.useState(!1),[d,u]=_.useState(!1),[p,m]=_.useState(""),g=fo(p,500),b=_.useRef(!0),f=_.useCallback(async w=>{w===1&&b.current?u(!0):c(!0);try{const j={page:w,per_page:20};e&&(j.group_id=e),g&&(j.search=g);const C=await he.get("stories",{params:j}),N=C.data,S=parseInt(C.headers["x-wp-totalpages"]);r(E=>w===1?N:[...E,...N]),o(w+1),s(w<S)}catch(j){j instanceof Error?G.error(j.message):G.error("Something went wrong. Try again later!")}finally{b.current&&(b.current=!1),c(!1),u(!1)}},[e,g]),h=_.useCallback(()=>{o(1),r([]),f(1)},[f]);_.useEffect(()=>{h()},[g,h]);const v=_.useRef(null),y=_.useCallback(w=>{l||(v.current&&v.current.disconnect(),v.current=new IntersectionObserver(j=>{j[0].isIntersecting&&i&&f(n)}),w&&v.current.observe(w))},[l,i,n,f]);return _.useEffect(()=>()=>{v.current&&v.current.disconnect()},[]),{allReels:t,setAllReels:r,searchTerm:p,setSearchTerm:m,isSearching:l,isLoading:d,lastStoryElementRef:y,refreshReels:h}};function Jf(){const e=Ne(),{allReels:t,setAllReels:r,isSearching:n,lastStoryElementRef:o,searchTerm:i,setSearchTerm:s,isLoading:l}=as(null),{styles:c,isCreating:d,isDeleting:u,createGroup:p,deleteReel:m}=Xf(),[g,b]=_.useState(null),[f,h]=_.useState(null),[v,y]=_.useState(null),[w,j]=_.useState([]),C=async()=>{const A=await p(w);A&&e(`?view=${X.mg}&gid=${A}`)},N=()=>{j(t.map(A=>A.id))},S=A=>{j(R=>R.includes(A)?R.filter(L=>L!==A):[...R,A])},E=()=>{w.length&&h(w)},T=_.useCallback(async()=>{if(g){await m(g,r),b(null);return}if(f?.length){const A=await Promise.all(f.map(M=>m(M,r,{silent:!0}))),R=f.filter((M,O)=>A[O]?.ok),L=R.length,B=f.length-L;L&&(r(M=>M.filter(O=>!R.includes(O.id))),j(M=>M.filter(O=>!R.includes(O)))),L&&G.success(`${L} reels deleted successfully!`),B&&G.error(`${B} reels failed to delete.`),h(null)}},[m,g,f,r]);return l&&!t.length?a.jsx(Lr,{}):a.jsxs(a.Fragment,{children:[(g||f)&&a.jsx(Or,{onReject:()=>{b(null),h(null)},onAccept:T,isLoading:u,message:f?.length?`Are you sure you want to remove ${f.length} reels?`:"Are you sure you want to remove this reel?"}),a.jsx(kt,{left:[a.jsx(St,{name:"All Reels",Icon:ap},"page"),a.jsx(tr,{cb:()=>e(`?view=${X.ag}`)},"back")],center:[a.jsx(Ir,{},"reel-wp")],right:[a.jsx(Rr,{to:`?view=${X.cr}&from=${X.ar}`,text:"Add Reel",Icon:yt},"add-reel-all-reel")]}),a.jsx(rr,{breads:[{label:"Dashboard",href:`?view=${X.ag}`},{label:"All Reels"}]}),a.jsxs("div",{className:"ecr-admin-panel ecr-admin-panel--reels",children:[a.jsx(Np,{selectedReelIds:w,handleSelectAll:N,clearSelection:()=>j([]),searchTerm:i,setSearchTerm:s,isCreating:d,handleCreateGroup:C,handleBulkDelete:E}),t.length?a.jsx(jm,{reels:t,styles:c,selectedReelIds:w,onSelectReel:S,onDeleteReel:b,onPreviewReel:y,lastStoryElementRef:o}):!n&&!l?a.jsx(Ap,{}):null,n&&a.jsx(Pp,{isFullScreen:!t.length})]}),!!v&&a.jsx(um,{previewReel:v,setPreviewReel:y})]})}const Zf=()=>{const[e,t]=_.useState(!1),r=_.useCallback(async({storyId:n,storyTitle:o,uploadedFiles:i,links:s,thumbnail:l})=>{try{t(!0);const c={story_title:o,files:i,thumbnail:l,links:s};n&&(c.story_id=n);const d=await he.post("files",c);return G.success(`Story ${n?"updated":"created"} successfully!`),d.data.story_id}catch(c){return c instanceof Error?G.error(c.message):G.error("Something went wrong. Try again later!"),null}finally{t(!1)}},[]);return{isSaving:e,saveStory:r}},ho=({isSaving:e,onSave:t,text:r="Save",className:n,...o})=>a.jsxs(ne,{onClick:t,className:$("ecr-admin-save-button",n),...o,children:[e?a.jsx(it,{className:"ecr-admin-save-button__icon ecr-admin-save-button__icon--spin"}):a.jsx(cp,{className:"ecr-admin-save-button__icon"})," ",r]}),is=({setIsEdited:e,title:t,setTitle:r,placeholder:n,style:o})=>a.jsx("div",{children:a.jsx("input",{style:o,className:"ecr-admin-title-input",type:"text",value:t,placeholder:n,onChange:i=>{e&&e(!0),r(i.target.value)}})}),Qf=({uploadedFiles:e,links:t,storyTitle:r,setStoryTitle:n,thumbnail:o})=>{const i=Ne(),[s]=Zt(),l=s.get("sid"),c=s.get("from")||X.ag,d=s.get("gid"),{isSaving:u,saveStory:p}=Zf(),m=async()=>{u||!await p({storyId:l,storyTitle:r,uploadedFiles:e,links:t,thumbnail:o})||i(`?view=${c}${d?`&gid=${d}`:""}`,{replace:!0})};return a.jsxs(a.Fragment,{children:[a.jsx(kt,{left:[a.jsx(St,{name:l?"Update Reel":"Add Reel",Icon:yt},"page"),a.jsx(tr,{},"back")],center:[a.jsx(is,{placeholder:"Enter reel title",title:r,setTitle:n},"title")],right:[a.jsx(ho,{onSave:m,isSaving:u,disabled:!e.length},"save")]}),a.jsx(rr,{breads:[{label:"Dashboard",href:"?view=my-reels"},{label:l?"Update Reel":"Add Reel"}]})]})};function H(e,t,{checkForDefaultPrevented:r=!0}={}){return function(o){if(e?.(o),r===!1||!o.defaultPrevented)return t?.(o)}}function eh(e,t){const r=x.createContext(t),n=i=>{const{children:s,...l}=i,c=x.useMemo(()=>l,Object.values(l));return a.jsx(r.Provider,{value:c,children:s})};n.displayName=e+"Provider";function o(i){const s=x.useContext(r);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[n,o]}function Ve(e,t=[]){let r=[];function n(i,s){const l=x.createContext(s),c=r.length;r=[...r,s];const d=p=>{const{scope:m,children:g,...b}=p,f=m?.[e]?.[c]||l,h=x.useMemo(()=>b,Object.values(b));return a.jsx(f.Provider,{value:h,children:g})};d.displayName=i+"Provider";function u(p,m){const g=m?.[e]?.[c]||l,b=x.useContext(g);if(b)return b;if(s!==void 0)return s;throw new Error(`\`${p}\` must be used within \`${i}\``)}return[d,u]}const o=()=>{const i=r.map(s=>x.createContext(s));return function(l){const c=l?.[e]||i;return x.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return o.scopeName=e,[n,th(o,...t)]}function th(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=n.reduce((l,{useScope:c,scopeName:d})=>{const p=c(i)[`__scope${d}`];return{...l,...p}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return r.scopeName=t.scopeName,r}var rh=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],W=rh.reduce((e,t)=>{const r=st(`Primitive.${t}`),n=x.forwardRef((o,i)=>{const{asChild:s,...l}=o,c=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function nh(e,t){e&&xr.flushSync(()=>e.dispatchEvent(t))}function We(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...r)=>t.current?.(...r),[])}function oh(e,t=globalThis?.document){const r=We(e);x.useEffect(()=>{const n=o=>{o.key==="Escape"&&r(o)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var ah="DismissableLayer",go="dismissableLayer.update",ih="dismissableLayer.pointerDownOutside",sh="dismissableLayer.focusOutside",ss,ls=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),qr=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:l,...c}=e,d=x.useContext(ls),[u,p]=x.useState(null),m=u?.ownerDocument??globalThis?.document,[,g]=x.useState({}),b=J(t,S=>p(S)),f=Array.from(d.layers),[h]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),v=f.indexOf(h),y=u?f.indexOf(u):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,j=y>=v,C=dh(S=>{const E=S.target,T=[...d.branches].some(A=>A.contains(E));!j||T||(o?.(S),s?.(S),S.defaultPrevented||l?.())},m),N=uh(S=>{const E=S.target;[...d.branches].some(A=>A.contains(E))||(i?.(S),s?.(S),S.defaultPrevented||l?.())},m);return oh(S=>{y===d.layers.size-1&&(n?.(S),!S.defaultPrevented&&l&&(S.preventDefault(),l()))},m),x.useEffect(()=>{if(u)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(ss=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(u)),d.layers.add(u),cs(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=ss)}},[u,m,r,d]),x.useEffect(()=>()=>{u&&(d.layers.delete(u),d.layersWithOutsidePointerEventsDisabled.delete(u),cs())},[u,d]),x.useEffect(()=>{const S=()=>g({});return document.addEventListener(go,S),()=>document.removeEventListener(go,S)},[]),a.jsx(W.div,{...c,ref:b,style:{pointerEvents:w?j?"auto":"none":void 0,...e.style},onFocusCapture:H(e.onFocusCapture,N.onFocusCapture),onBlurCapture:H(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:H(e.onPointerDownCapture,C.onPointerDownCapture)})});qr.displayName=ah;var lh="DismissableLayerBranch",ch=x.forwardRef((e,t)=>{const r=x.useContext(ls),n=x.useRef(null),o=J(t,n);return x.useEffect(()=>{const i=n.current;if(i)return r.branches.add(i),()=>{r.branches.delete(i)}},[r.branches]),a.jsx(W.div,{...e,ref:o})});ch.displayName=lh;function dh(e,t=globalThis?.document){const r=We(e),n=x.useRef(!1),o=x.useRef(()=>{});return x.useEffect(()=>{const i=l=>{if(l.target&&!n.current){let c=function(){ds(ih,r,d,{discrete:!0})};const d={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);n.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function uh(e,t=globalThis?.document){const r=We(e),n=x.useRef(!1);return x.useEffect(()=>{const o=i=>{i.target&&!n.current&&ds(sh,r,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function cs(){const e=new CustomEvent(go);document.dispatchEvent(e)}function ds(e,t,r,{discrete:n}){const o=r.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?nh(o,i):o.dispatchEvent(i)}var xo=0;function bo(){x.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??us()),document.body.insertAdjacentElement("beforeend",e[1]??us()),xo++,()=>{xo===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),xo--}},[])}function us(){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 _o="focusScope.autoFocusOnMount",vo="focusScope.autoFocusOnUnmount",ps={bubbles:!1,cancelable:!0},ph="FocusScope",Gr=x.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[l,c]=x.useState(null),d=We(o),u=We(i),p=x.useRef(null),m=J(t,f=>c(f)),g=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(n){let f=function(w){if(g.paused||!l)return;const j=w.target;l.contains(j)?p.current=j:qe(p.current,{select:!0})},h=function(w){if(g.paused||!l)return;const j=w.relatedTarget;j!==null&&(l.contains(j)||qe(p.current,{select:!0}))},v=function(w){if(document.activeElement===document.body)for(const C of w)C.removedNodes.length>0&&qe(l)};document.addEventListener("focusin",f),document.addEventListener("focusout",h);const y=new MutationObserver(v);return l&&y.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",f),document.removeEventListener("focusout",h),y.disconnect()}}},[n,l,g.paused]),x.useEffect(()=>{if(l){hs.add(g);const f=document.activeElement;if(!l.contains(f)){const v=new CustomEvent(_o,ps);l.addEventListener(_o,d),l.dispatchEvent(v),v.defaultPrevented||(mh(bh(ms(l)),{select:!0}),document.activeElement===f&&qe(l))}return()=>{l.removeEventListener(_o,d),setTimeout(()=>{const v=new CustomEvent(vo,ps);l.addEventListener(vo,u),l.dispatchEvent(v),v.defaultPrevented||qe(f??document.body,{select:!0}),l.removeEventListener(vo,u),hs.remove(g)},0)}}},[l,d,u,g]);const b=x.useCallback(f=>{if(!r&&!n||g.paused)return;const h=f.key==="Tab"&&!f.altKey&&!f.ctrlKey&&!f.metaKey,v=document.activeElement;if(h&&v){const y=f.currentTarget,[w,j]=fh(y);w&&j?!f.shiftKey&&v===j?(f.preventDefault(),r&&qe(w,{select:!0})):f.shiftKey&&v===w&&(f.preventDefault(),r&&qe(j,{select:!0})):v===y&&f.preventDefault()}},[r,n,g.paused]);return a.jsx(W.div,{tabIndex:-1,...s,ref:m,onKeyDown:b})});Gr.displayName=ph;function mh(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(qe(n,{select:t}),document.activeElement!==r)return}function fh(e){const t=ms(e),r=fs(t,e),n=fs(t.reverse(),e);return[r,n]}function ms(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 fs(e,t){for(const r of e)if(!hh(r,{upTo:t}))return r}function hh(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 gh(e){return e instanceof HTMLInputElement&&"select"in e}function qe(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&gh(e)&&t&&e.select()}}var hs=xh();function xh(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=gs(e,t),e.unshift(t)},remove(t){e=gs(e,t),e[0]?.resume()}}}function gs(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function bh(e){return e.filter(t=>t.tagName!=="A")}var le=globalThis?.document?x.useLayoutEffect:()=>{},_h=x[" useId ".trim().toString()]||(()=>{}),vh=0;function Ae(e){const[t,r]=x.useState(_h());return le(()=>{r(n=>n??String(vh++))},[e]),e||(t?`radix-${t}`:"")}const yh=["top","right","bottom","left"],Ge=Math.min,xe=Math.max,Kr=Math.round,Yr=Math.floor,Pe=e=>({x:e,y:e}),wh={left:"right",right:"left",bottom:"top",top:"bottom"},jh={start:"end",end:"start"};function yo(e,t,r){return xe(e,Ge(t,r))}function $e(e,t){return typeof e=="function"?e(t):e}function Fe(e){return e.split("-")[0]}function Tt(e){return e.split("-")[1]}function wo(e){return e==="x"?"y":"x"}function jo(e){return e==="y"?"height":"width"}const kh=new Set(["top","bottom"]);function Oe(e){return kh.has(Fe(e))?"y":"x"}function ko(e){return wo(Oe(e))}function Sh(e,t,r){r===void 0&&(r=!1);const n=Tt(e),o=ko(e),i=jo(o);let s=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Xr(s)),[s,Xr(s)]}function Ch(e){const t=Xr(e);return[So(e),t,So(t)]}function So(e){return e.replace(/start|end/g,t=>jh[t])}const xs=["left","right"],bs=["right","left"],Nh=["top","bottom"],Eh=["bottom","top"];function Th(e,t,r){switch(e){case"top":case"bottom":return r?t?bs:xs:t?xs:bs;case"left":case"right":return t?Nh:Eh;default:return[]}}function Ah(e,t,r,n){const o=Tt(e);let i=Th(Fe(e),r==="start",n);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(So)))),i}function Xr(e){return e.replace(/left|right|bottom|top/g,t=>wh[t])}function Ph(e){return{top:0,right:0,bottom:0,left:0,...e}}function _s(e){return typeof e!="number"?Ph(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 vs(e,t,r){let{reference:n,floating:o}=e;const i=Oe(t),s=ko(t),l=jo(s),c=Fe(t),d=i==="y",u=n.x+n.width/2-o.width/2,p=n.y+n.height/2-o.height/2,m=n[l]/2-o[l]/2;let g;switch(c){case"top":g={x:u,y:n.y-o.height};break;case"bottom":g={x:u,y:n.y+n.height};break;case"right":g={x:n.x+n.width,y:p};break;case"left":g={x:n.x-o.width,y:p};break;default:g={x:n.x,y:n.y}}switch(Tt(t)){case"start":g[s]-=m*(r&&d?-1:1);break;case"end":g[s]+=m*(r&&d?-1:1);break}return g}const Oh=async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:i=[],platform:s}=r,l=i.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(t));let d=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:p}=vs(d,n,c),m=n,g={},b=0;for(let f=0;f<l.length;f++){const{name:h,fn:v}=l[f],{x:y,y:w,data:j,reset:C}=await v({x:u,y:p,initialPlacement:n,placement:m,strategy:o,middlewareData:g,rects:d,platform:s,elements:{reference:e,floating:t}});u=y??u,p=w??p,g={...g,[h]:{...g[h],...j}},C&&b<=50&&(b++,typeof C=="object"&&(C.placement&&(m=C.placement),C.rects&&(d=C.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):C.rects),{x:u,y:p}=vs(d,m,c)),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:i,rects:s,elements:l,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:p="floating",altBoundary:m=!1,padding:g=0}=$e(t,e),b=_s(g),h=l[m?p==="floating"?"reference":"floating":p],v=Jr(await i.getClippingRect({element:(r=await(i.isElement==null?void 0:i.isElement(h)))==null||r?h:h.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:d,rootBoundary:u,strategy:c})),y=p==="floating"?{x:n,y:o,width:s.floating.width,height:s.floating.height}:s.reference,w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),j=await(i.isElement==null?void 0:i.isElement(w))?await(i.getScale==null?void 0:i.getScale(w))||{x:1,y:1}:{x:1,y:1},C=Jr(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:w,strategy:c}):y);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 Rh=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:i,platform:s,elements:l,middlewareData:c}=t,{element:d,padding:u=0}=$e(e,t)||{};if(d==null)return{};const p=_s(u),m={x:r,y:n},g=ko(o),b=jo(g),f=await s.getDimensions(d),h=g==="y",v=h?"top":"left",y=h?"bottom":"right",w=h?"clientHeight":"clientWidth",j=i.reference[b]+i.reference[g]-m[g]-i.floating[b],C=m[g]-i.reference[g],N=await(s.getOffsetParent==null?void 0:s.getOffsetParent(d));let S=N?N[w]:0;(!S||!await(s.isElement==null?void 0:s.isElement(N)))&&(S=l.floating[w]||i.floating[b]);const E=j/2-C/2,T=S/2-f[b]/2-1,A=Ge(p[v],T),R=Ge(p[y],T),L=A,B=S-f[b]-R,M=S/2-f[b]/2+E,O=yo(L,M,B),P=!c.arrow&&Tt(o)!=null&&M!==O&&i.reference[b]/2-(M<L?A:R)-f[b]/2<0,z=P?M<L?M-L:M-B:0;return{[g]:m[g]+z,data:{[g]:O,centerOffset:M-O-z,...P&&{alignmentOffset:z}},reset:P}}}),Lh=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:i,rects:s,initialPlacement:l,platform:c,elements:d}=t,{mainAxis:u=!0,crossAxis:p=!0,fallbackPlacements:m,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:f=!0,...h}=$e(e,t);if((r=i.arrow)!=null&&r.alignmentOffset)return{};const v=Fe(o),y=Oe(l),w=Fe(l)===l,j=await(c.isRTL==null?void 0:c.isRTL(d.floating)),C=m||(w||!f?[Xr(l)]:Ch(l)),N=b!=="none";!m&&N&&C.push(...Ah(l,f,b,j));const S=[l,...C],E=await lr(t,h),T=[];let A=((n=i.flip)==null?void 0:n.overflows)||[];if(u&&T.push(E[v]),p){const M=Sh(o,s,j);T.push(E[M[0]],E[M[1]])}if(A=[...A,{placement:o,overflows:T}],!T.every(M=>M<=0)){var R,L;const M=(((R=i.flip)==null?void 0:R.index)||0)+1,O=S[M];if(O&&(!(p==="alignment"?y!==Oe(O):!1)||A.every(I=>Oe(I.placement)===y?I.overflows[0]>0:!0)))return{data:{index:M,overflows:A},reset:{placement:O}};let P=(L=A.filter(z=>z.overflows[0]<=0).sort((z,I)=>z.overflows[1]-I.overflows[1])[0])==null?void 0:L.placement;if(!P)switch(g){case"bestFit":{var B;const z=(B=A.filter(I=>{if(N){const q=Oe(I.placement);return q===y||q==="y"}return!0}).map(I=>[I.placement,I.overflows.filter(q=>q>0).reduce((q,te)=>q+te,0)]).sort((I,q)=>I[1]-q[1])[0])==null?void 0:B[0];z&&(P=z);break}case"initialPlacement":P=l;break}if(o!==P)return{reset:{placement:P}}}return{}}}};function ys(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ws(e){return yh.some(t=>e[t]>=0)}const Ih=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...o}=$e(e,t);switch(n){case"referenceHidden":{const i=await lr(t,{...o,elementContext:"reference"}),s=ys(i,r.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:ws(s)}}}case"escaped":{const i=await lr(t,{...o,altBoundary:!0}),s=ys(i,r.floating);return{data:{escapedOffsets:s,escaped:ws(s)}}}default:return{}}}}},js=new Set(["left","top"]);async function Mh(e,t){const{placement:r,platform:n,elements:o}=e,i=await(n.isRTL==null?void 0:n.isRTL(o.floating)),s=Fe(r),l=Tt(r),c=Oe(r)==="y",d=js.has(s)?-1:1,u=i&&c?-1:1,p=$e(t,e);let{mainAxis:m,crossAxis:g,alignmentAxis:b}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return l&&typeof b=="number"&&(g=l==="end"?b*-1:b),c?{x:g*u,y:m*d}:{x:m*d,y:g*u}}const zh=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:i,placement:s,middlewareData:l}=t,c=await Mh(t,e);return s===((r=l.offset)==null?void 0:r.placement)&&(n=l.arrow)!=null&&n.alignmentOffset?{}:{x:o+c.x,y:i+c.y,data:{...c,placement:s}}}}},Dh=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:l={fn:h=>{let{x:v,y}=h;return{x:v,y}}},...c}=$e(e,t),d={x:r,y:n},u=await lr(t,c),p=Oe(Fe(o)),m=wo(p);let g=d[m],b=d[p];if(i){const h=m==="y"?"top":"left",v=m==="y"?"bottom":"right",y=g+u[h],w=g-u[v];g=yo(y,g,w)}if(s){const h=p==="y"?"top":"left",v=p==="y"?"bottom":"right",y=b+u[h],w=b-u[v];b=yo(y,b,w)}const f=l.fn({...t,[m]:g,[p]:b});return{...f,data:{x:f.x-r,y:f.y-n,enabled:{[m]:i,[p]:s}}}}}},$h=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:i,middlewareData:s}=t,{offset:l=0,mainAxis:c=!0,crossAxis:d=!0}=$e(e,t),u={x:r,y:n},p=Oe(o),m=wo(p);let g=u[m],b=u[p];const f=$e(l,t),h=typeof f=="number"?{mainAxis:f,crossAxis:0}:{mainAxis:0,crossAxis:0,...f};if(c){const w=m==="y"?"height":"width",j=i.reference[m]-i.floating[w]+h.mainAxis,C=i.reference[m]+i.reference[w]-h.mainAxis;g<j?g=j:g>C&&(g=C)}if(d){var v,y;const w=m==="y"?"width":"height",j=js.has(Fe(o)),C=i.reference[p]-i.floating[w]+(j&&((v=s.offset)==null?void 0:v[p])||0)+(j?0:h.crossAxis),N=i.reference[p]+i.reference[w]+(j?0:((y=s.offset)==null?void 0:y[p])||0)-(j?h.crossAxis:0);b<C?b=C:b>N&&(b=N)}return{[m]:g,[p]:b}}}},Fh=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:o,rects:i,platform:s,elements:l}=t,{apply:c=()=>{},...d}=$e(e,t),u=await lr(t,d),p=Fe(o),m=Tt(o),g=Oe(o)==="y",{width:b,height:f}=i.floating;let h,v;p==="top"||p==="bottom"?(h=p,v=m===(await(s.isRTL==null?void 0:s.isRTL(l.floating))?"start":"end")?"left":"right"):(v=p,h=m==="end"?"top":"bottom");const y=f-u.top-u.bottom,w=b-u.left-u.right,j=Ge(f-u[h],y),C=Ge(b-u[v],w),N=!t.middlewareData.shift;let S=j,E=C;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(E=w),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(S=y),N&&!m){const A=xe(u.left,0),R=xe(u.right,0),L=xe(u.top,0),B=xe(u.bottom,0);g?E=b-2*(A!==0||R!==0?A+R:xe(u.left,u.right)):S=f-2*(L!==0||B!==0?L+B:xe(u.top,u.bottom))}await c({...t,availableWidth:E,availableHeight:S});const T=await s.getDimensions(l.floating);return b!==T.width||f!==T.height?{reset:{rects:!0}}:{}}}};function Zr(){return typeof window<"u"}function At(e){return ks(e)?(e.nodeName||"").toLowerCase():"#document"}function be(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Re(e){var t;return(t=(ks(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ks(e){return Zr()?e instanceof Node||e instanceof be(e).Node:!1}function je(e){return Zr()?e instanceof Element||e instanceof be(e).Element:!1}function Le(e){return Zr()?e instanceof HTMLElement||e instanceof be(e).HTMLElement:!1}function Ss(e){return!Zr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof be(e).ShadowRoot}const Bh=new Set(["inline","contents"]);function cr(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=ke(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!Bh.has(o)}const Uh=new Set(["table","td","th"]);function Hh(e){return Uh.has(At(e))}const Vh=[":popover-open",":modal"];function Qr(e){return Vh.some(t=>{try{return e.matches(t)}catch{return!1}})}const Wh=["transform","translate","scale","rotate","perspective"],qh=["transform","translate","scale","rotate","perspective","filter"],Gh=["paint","layout","strict","content"];function Co(e){const t=No(),r=je(e)?ke(e):e;return Wh.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)||qh.some(n=>(r.willChange||"").includes(n))||Gh.some(n=>(r.contain||"").includes(n))}function Kh(e){let t=Ke(e);for(;Le(t)&&!Pt(t);){if(Co(t))return t;if(Qr(t))return null;t=Ke(t)}return null}function No(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Yh=new Set(["html","body","#document"]);function Pt(e){return Yh.has(At(e))}function ke(e){return be(e).getComputedStyle(e)}function en(e){return je(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ke(e){if(At(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ss(e)&&e.host||Re(e);return Ss(t)?t.host:t}function Cs(e){const t=Ke(e);return Pt(t)?e.ownerDocument?e.ownerDocument.body:e.body:Le(t)&&cr(t)?t:Cs(t)}function dr(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=Cs(e),i=o===((n=e.ownerDocument)==null?void 0:n.body),s=be(o);if(i){const l=Eo(s);return t.concat(s,s.visualViewport||[],cr(o)?o:[],l&&r?dr(l):[])}return t.concat(o,dr(o,[],r))}function Eo(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ns(e){const t=ke(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=Le(e),i=o?e.offsetWidth:r,s=o?e.offsetHeight:n,l=Kr(r)!==i||Kr(n)!==s;return l&&(r=i,n=s),{width:r,height:n,$:l}}function To(e){return je(e)?e:e.contextElement}function Ot(e){const t=To(e);if(!Le(t))return Pe(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:i}=Ns(t);let s=(i?Kr(r.width):r.width)/n,l=(i?Kr(r.height):r.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const Xh=Pe(0);function Es(e){const t=be(e);return!No()||!t.visualViewport?Xh:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Jh(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==be(e)?!1:t}function pt(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),i=To(e);let s=Pe(1);t&&(n?je(n)&&(s=Ot(n)):s=Ot(e));const l=Jh(i,r,n)?Es(i):Pe(0);let c=(o.left+l.x)/s.x,d=(o.top+l.y)/s.y,u=o.width/s.x,p=o.height/s.y;if(i){const m=be(i),g=n&&je(n)?be(n):n;let b=m,f=Eo(b);for(;f&&n&&g!==b;){const h=Ot(f),v=f.getBoundingClientRect(),y=ke(f),w=v.left+(f.clientLeft+parseFloat(y.paddingLeft))*h.x,j=v.top+(f.clientTop+parseFloat(y.paddingTop))*h.y;c*=h.x,d*=h.y,u*=h.x,p*=h.y,c+=w,d+=j,b=be(f),f=Eo(b)}}return Jr({width:u,height:p,x:c,y:d})}function tn(e,t){const r=en(e).scrollLeft;return t?t.left+r:pt(Re(e)).left+r}function Ts(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 Zh(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const i=o==="fixed",s=Re(n),l=t?Qr(t.floating):!1;if(n===s||l&&i)return r;let c={scrollLeft:0,scrollTop:0},d=Pe(1);const u=Pe(0),p=Le(n);if((p||!p&&!i)&&((At(n)!=="body"||cr(s))&&(c=en(n)),Le(n))){const g=pt(n);d=Ot(n),u.x=g.x+n.clientLeft,u.y=g.y+n.clientTop}const m=s&&!p&&!i?Ts(s,c):Pe(0);return{width:r.width*d.x,height:r.height*d.y,x:r.x*d.x-c.scrollLeft*d.x+u.x+m.x,y:r.y*d.y-c.scrollTop*d.y+u.y+m.y}}function Qh(e){return Array.from(e.getClientRects())}function eg(e){const t=Re(e),r=en(e),n=e.ownerDocument.body,o=xe(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=xe(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let s=-r.scrollLeft+tn(e);const l=-r.scrollTop;return ke(n).direction==="rtl"&&(s+=xe(t.clientWidth,n.clientWidth)-o),{width:o,height:i,x:s,y:l}}const As=25;function tg(e,t){const r=be(e),n=Re(e),o=r.visualViewport;let i=n.clientWidth,s=n.clientHeight,l=0,c=0;if(o){i=o.width,s=o.height;const u=No();(!u||u&&t==="fixed")&&(l=o.offsetLeft,c=o.offsetTop)}const d=tn(n);if(d<=0){const u=n.ownerDocument,p=u.body,m=getComputedStyle(p),g=u.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,b=Math.abs(n.clientWidth-p.clientWidth-g);b<=As&&(i-=b)}else d<=As&&(i+=d);return{width:i,height:s,x:l,y:c}}const rg=new Set(["absolute","fixed"]);function ng(e,t){const r=pt(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,i=Le(e)?Ot(e):Pe(1),s=e.clientWidth*i.x,l=e.clientHeight*i.y,c=o*i.x,d=n*i.y;return{width:s,height:l,x:c,y:d}}function Ps(e,t,r){let n;if(t==="viewport")n=tg(e,r);else if(t==="document")n=eg(Re(e));else if(je(t))n=ng(t,r);else{const o=Es(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Jr(n)}function Os(e,t){const r=Ke(e);return r===t||!je(r)||Pt(r)?!1:ke(r).position==="fixed"||Os(r,t)}function og(e,t){const r=t.get(e);if(r)return r;let n=dr(e,[],!1).filter(l=>je(l)&&At(l)!=="body"),o=null;const i=ke(e).position==="fixed";let s=i?Ke(e):e;for(;je(s)&&!Pt(s);){const l=ke(s),c=Co(s);!c&&l.position==="fixed"&&(o=null),(i?!c&&!o:!c&&l.position==="static"&&!!o&&rg.has(o.position)||cr(s)&&!c&&Os(e,s))?n=n.filter(u=>u!==s):o=l,s=Ke(s)}return t.set(e,n),n}function ag(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const s=[...r==="clippingAncestors"?Qr(t)?[]:og(t,this._c):[].concat(r),n],l=s[0],c=s.reduce((d,u)=>{const p=Ps(t,u,o);return d.top=xe(p.top,d.top),d.right=Ge(p.right,d.right),d.bottom=Ge(p.bottom,d.bottom),d.left=xe(p.left,d.left),d},Ps(t,l,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function ig(e){const{width:t,height:r}=Ns(e);return{width:t,height:r}}function sg(e,t,r){const n=Le(t),o=Re(t),i=r==="fixed",s=pt(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const c=Pe(0);function d(){c.x=tn(o)}if(n||!n&&!i)if((At(t)!=="body"||cr(o))&&(l=en(t)),n){const g=pt(t,!0,i,t);c.x=g.x+t.clientLeft,c.y=g.y+t.clientTop}else o&&d();i&&!n&&o&&d();const u=o&&!n&&!i?Ts(o,l):Pe(0),p=s.left+l.scrollLeft-c.x-u.x,m=s.top+l.scrollTop-c.y-u.y;return{x:p,y:m,width:s.width,height:s.height}}function Ao(e){return ke(e).position==="static"}function Rs(e,t){if(!Le(e)||ke(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Re(e)===r&&(r=r.ownerDocument.body),r}function Ls(e,t){const r=be(e);if(Qr(e))return r;if(!Le(e)){let o=Ke(e);for(;o&&!Pt(o);){if(je(o)&&!Ao(o))return o;o=Ke(o)}return r}let n=Rs(e,t);for(;n&&Hh(n)&&Ao(n);)n=Rs(n,t);return n&&Pt(n)&&Ao(n)&&!Co(n)?r:n||Kh(e)||r}const lg=async function(e){const t=this.getOffsetParent||Ls,r=this.getDimensions,n=await r(e.floating);return{reference:sg(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function cg(e){return ke(e).direction==="rtl"}const dg={convertOffsetParentRelativeRectToViewportRelativeRect:Zh,getDocumentElement:Re,getClippingRect:ag,getOffsetParent:Ls,getElementRects:lg,getClientRects:Qh,getDimensions:ig,getScale:Ot,isElement:je,isRTL:cg};function Is(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ug(e,t){let r=null,n;const o=Re(e);function i(){var l;clearTimeout(n),(l=r)==null||l.disconnect(),r=null}function s(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),i();const d=e.getBoundingClientRect(),{left:u,top:p,width:m,height:g}=d;if(l||t(),!m||!g)return;const b=Yr(p),f=Yr(o.clientWidth-(u+m)),h=Yr(o.clientHeight-(p+g)),v=Yr(u),w={rootMargin:-b+"px "+-f+"px "+-h+"px "+-v+"px",threshold:xe(0,Ge(1,c))||1};let j=!0;function C(N){const S=N[0].intersectionRatio;if(S!==c){if(!j)return s();S?s(!1,S):n=setTimeout(()=>{s(!1,1e-7)},1e3)}S===1&&!Is(d,e.getBoundingClientRect())&&s(),j=!1}try{r=new IntersectionObserver(C,{...w,root:o.ownerDocument})}catch{r=new IntersectionObserver(C,w)}r.observe(e)}return s(!0),i}function pg(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,d=To(e),u=o||i?[...d?dr(d):[],...dr(t)]:[];u.forEach(v=>{o&&v.addEventListener("scroll",r,{passive:!0}),i&&v.addEventListener("resize",r)});const p=d&&l?ug(d,r):null;let m=-1,g=null;s&&(g=new ResizeObserver(v=>{let[y]=v;y&&y.target===d&&g&&(g.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var w;(w=g)==null||w.observe(t)})),r()}),d&&!c&&g.observe(d),g.observe(t));let b,f=c?pt(e):null;c&&h();function h(){const v=pt(e);f&&!Is(f,v)&&r(),f=v,b=requestAnimationFrame(h)}return r(),()=>{var v;u.forEach(y=>{o&&y.removeEventListener("scroll",r),i&&y.removeEventListener("resize",r)}),p?.(),(v=g)==null||v.disconnect(),g=null,c&&cancelAnimationFrame(b)}}const mg=zh,fg=Dh,hg=Lh,gg=Fh,xg=Ih,Ms=Rh,bg=$h,_g=(e,t,r)=>{const n=new Map,o={platform:dg,...r},i={...o.platform,_c:n};return Oh(e,t,{...o,platform:i})};var vg=typeof document<"u",yg=function(){},rn=vg?_.useLayoutEffect:yg;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 i=o[n];if(!(i==="_owner"&&e.$$typeof)&&!nn(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function zs(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ds(e,t){const r=zs(e);return Math.round(t*r)/r}function Po(e){const t=x.useRef(e);return rn(()=>{t.current=e}),t}function wg(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:i,floating:s}={},transform:l=!0,whileElementsMounted:c,open:d}=e,[u,p]=x.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[m,g]=x.useState(n);nn(m,n)||g(n);const[b,f]=x.useState(null),[h,v]=x.useState(null),y=x.useCallback(I=>{I!==N.current&&(N.current=I,f(I))},[]),w=x.useCallback(I=>{I!==S.current&&(S.current=I,v(I))},[]),j=i||b,C=s||h,N=x.useRef(null),S=x.useRef(null),E=x.useRef(u),T=c!=null,A=Po(c),R=Po(o),L=Po(d),B=x.useCallback(()=>{if(!N.current||!S.current)return;const I={placement:t,strategy:r,middleware:m};R.current&&(I.platform=R.current),_g(N.current,S.current,I).then(q=>{const te={...q,isPositioned:L.current!==!1};M.current&&!nn(E.current,te)&&(E.current=te,xr.flushSync(()=>{p(te)}))})},[m,t,r,R,L]);rn(()=>{d===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,p(I=>({...I,isPositioned:!1})))},[d]);const M=x.useRef(!1);rn(()=>(M.current=!0,()=>{M.current=!1}),[]),rn(()=>{if(j&&(N.current=j),C&&(S.current=C),j&&C){if(A.current)return A.current(j,C,B);B()}},[j,C,B,A,T]);const O=x.useMemo(()=>({reference:N,floating:S,setReference:y,setFloating:w}),[y,w]),P=x.useMemo(()=>({reference:j,floating:C}),[j,C]),z=x.useMemo(()=>{const I={position:r,left:0,top:0};if(!P.floating)return I;const q=Ds(P.floating,u.x),te=Ds(P.floating,u.y);return l?{...I,transform:"translate("+q+"px, "+te+"px)",...zs(P.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:q,top:te}},[r,l,P.floating,u.x,u.y]);return x.useMemo(()=>({...u,update:B,refs:O,elements:P,floatingStyles:z}),[u,B,O,P,z])}const jg=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?Ms({element:n.current,padding:o}).fn(r):{}:n?Ms({element:n,padding:o}).fn(r):{}}}},kg=(e,t)=>({...mg(e),options:[e,t]}),Sg=(e,t)=>({...fg(e),options:[e,t]}),Cg=(e,t)=>({...bg(e),options:[e,t]}),Ng=(e,t)=>({...hg(e),options:[e,t]}),Eg=(e,t)=>({...gg(e),options:[e,t]}),Tg=(e,t)=>({...xg(e),options:[e,t]}),Ag=(e,t)=>({...jg(e),options:[e,t]});var Pg="Arrow",$s=x.forwardRef((e,t)=>{const{children:r,width:n=10,height:o=5,...i}=e;return a.jsx(W.svg,{...i,ref:t,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:a.jsx("polygon",{points:"0,0 30,0 15,10"})})});$s.displayName=Pg;var Og=$s;function Rg(e){const[t,r]=x.useState(void 0);return le(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,l;if("borderBoxSize"in i){const c=i.borderBoxSize,d=Array.isArray(c)?c[0]:c;s=d.inlineSize,l=d.blockSize}else s=e.offsetWidth,l=e.offsetHeight;r({width:s,height:l})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var Oo="Popper",[Fs,on]=Ve(Oo),[Lg,Bs]=Fs(Oo),Us=e=>{const{__scopePopper:t,children:r}=e,[n,o]=x.useState(null);return a.jsx(Lg,{scope:t,anchor:n,onAnchorChange:o,children:r})};Us.displayName=Oo;var Hs="PopperAnchor",Vs=x.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...o}=e,i=Bs(Hs,r),s=x.useRef(null),l=J(t,s),c=x.useRef(null);return x.useEffect(()=>{const d=c.current;c.current=n?.current||s.current,d!==c.current&&i.onAnchorChange(c.current)}),n?null:a.jsx(W.div,{...o,ref:l})});Vs.displayName=Hs;var Ro="PopperContent",[Ig,Mg]=Fs(Ro),Ws=x.forwardRef((e,t)=>{const{__scopePopper:r,side:n="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:u=0,sticky:p="partial",hideWhenDetached:m=!1,updatePositionStrategy:g="optimized",onPlaced:b,...f}=e,h=Bs(Ro,r),[v,y]=x.useState(null),w=J(t,F=>y(F)),[j,C]=x.useState(null),N=Rg(j),S=N?.width??0,E=N?.height??0,T=n+(i!=="center"?"-"+i:""),A=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},R=Array.isArray(d)?d:[d],L=R.length>0,B={padding:A,boundary:R.filter(Dg),altBoundary:L},{refs:M,floatingStyles:O,placement:P,isPositioned:z,middlewareData:I}=wg({strategy:"fixed",placement:T,whileElementsMounted:(...F)=>pg(...F,{animationFrame:g==="always"}),elements:{reference:h.anchor},middleware:[kg({mainAxis:o+E,alignmentAxis:s}),c&&Sg({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?Cg():void 0,...B}),c&&Ng({...B}),Eg({...B,apply:({elements:F,rects:Y,availableWidth:se,availableHeight:Z})=>{const{width:ee,height:ae}=Y.reference,ve=F.floating.style;ve.setProperty("--radix-popper-available-width",`${se}px`),ve.setProperty("--radix-popper-available-height",`${Z}px`),ve.setProperty("--radix-popper-anchor-width",`${ee}px`),ve.setProperty("--radix-popper-anchor-height",`${ae}px`)}}),j&&Ag({element:j,padding:l}),$g({arrowWidth:S,arrowHeight:E}),m&&Tg({strategy:"referenceHidden",...B})]}),[q,te]=Ks(P),oe=We(b);le(()=>{z&&oe?.()},[z,oe]);const ge=I.arrow?.x,_e=I.arrow?.y,pe=I.arrow?.centerOffset!==0,[K,de]=x.useState();return le(()=>{v&&de(window.getComputedStyle(v).zIndex)},[v]),a.jsx("div",{ref:M.setFloating,"data-radix-popper-content-wrapper":"",style:{...O,transform:z?O.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:K,"--radix-popper-transform-origin":[I.transformOrigin?.x,I.transformOrigin?.y].join(" "),...I.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:a.jsx(Ig,{scope:r,placedSide:q,onArrowChange:C,arrowX:ge,arrowY:_e,shouldHideArrow:pe,children:a.jsx(W.div,{"data-side":q,"data-align":te,...f,ref:w,style:{...f.style,animation:z?void 0:"none"}})})})});Ws.displayName=Ro;var qs="PopperArrow",zg={top:"bottom",right:"left",bottom:"top",left:"right"},Gs=x.forwardRef(function(t,r){const{__scopePopper:n,...o}=t,i=Mg(qs,n),s=zg[i.placedSide];return a.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:a.jsx(Og,{...o,ref:r,style:{...o.style,display:"block"}})})});Gs.displayName=qs;function Dg(e){return e!==null}var $g=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:n,middlewareData:o}=t,s=o.arrow?.centerOffset!==0,l=s?0:e.arrowWidth,c=s?0:e.arrowHeight,[d,u]=Ks(r),p={start:"0%",center:"50%",end:"100%"}[u],m=(o.arrow?.x??0)+l/2,g=(o.arrow?.y??0)+c/2;let b="",f="";return d==="bottom"?(b=s?p:`${m}px`,f=`${-c}px`):d==="top"?(b=s?p:`${m}px`,f=`${n.floating.height+c}px`):d==="right"?(b=`${-c}px`,f=s?p:`${g}px`):d==="left"&&(b=`${n.floating.width+c}px`,f=s?p:`${g}px`),{data:{x:b,y:f}}}});function Ks(e){const[t,r="center"]=e.split("-");return[t,r]}var Ys=Us,Lo=Vs,Xs=Ws,Js=Gs,Fg="Portal",an=x.forwardRef((e,t)=>{const{container:r,...n}=e,[o,i]=x.useState(!1);le(()=>i(!0),[]);const s=r||o&&globalThis?.document?.body;return s?ja.createPortal(a.jsx(W.div,{...n,ref:t}),s):null});an.displayName=Fg;function Bg(e,t){return x.useReducer((r,n)=>t[r][n]??r,e)}var Ye=e=>{const{present:t,children:r}=e,n=Ug(t),o=typeof r=="function"?r({present:n.isPresent}):x.Children.only(r),i=J(n.ref,Hg(o));return typeof r=="function"||n.isPresent?x.cloneElement(o,{ref:i}):null};Ye.displayName="Presence";function Ug(e){const[t,r]=x.useState(),n=x.useRef(null),o=x.useRef(e),i=x.useRef("none"),s=e?"mounted":"unmounted",[l,c]=Bg(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const d=sn(n.current);i.current=l==="mounted"?d:"none"},[l]),le(()=>{const d=n.current,u=o.current;if(u!==e){const m=i.current,g=sn(d);e?c("MOUNT"):g==="none"||d?.display==="none"?c("UNMOUNT"):c(u&&m!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),le(()=>{if(t){let d;const u=t.ownerDocument.defaultView??window,p=g=>{const f=sn(n.current).includes(CSS.escape(g.animationName));if(g.target===t&&f&&(c("ANIMATION_END"),!o.current)){const h=t.style.animationFillMode;t.style.animationFillMode="forwards",d=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=h)})}},m=g=>{g.target===t&&(i.current=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 c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:x.useCallback(d=>{n.current=d?getComputedStyle(d):null,r(d)},[])}}function sn(e){return e?.animationName||"none"}function Hg(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 Vg=x[" useInsertionEffect ".trim().toString()]||le;function mt({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[o,i,s]=Wg({defaultProp:t,onChange:r}),l=e!==void 0,c=l?e:o;{const u=x.useRef(e!==void 0);x.useEffect(()=>{const p=u.current;p!==l&&console.warn(`${n} is changing from ${p?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=l},[l,n])}const d=x.useCallback(u=>{if(l){const p=qg(u)?u(e):u;p!==e&&s.current?.(p)}else i(u)},[l,e,i,s]);return[c,d]}function Wg({defaultProp:e,onChange:t}){const[r,n]=x.useState(e),o=x.useRef(r),i=x.useRef(t);return Vg(()=>{i.current=t},[t]),x.useEffect(()=>{o.current!==r&&(i.current?.(r),o.current=r)},[r,o]),[r,n,i]}function qg(e){return typeof e=="function"}var Gg=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Rt=new WeakMap,ln=new WeakMap,cn={},Io=0,Zs=function(e){return e&&(e.host||Zs(e.parentNode))},Kg=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=Zs(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})},Yg=function(e,t,r,n){var o=Kg(t,Array.isArray(e)?e:[e]);cn[r]||(cn[r]=new WeakMap);var i=cn[r],s=[],l=new Set,c=new Set(o),d=function(p){!p||l.has(p)||(l.add(p),d(p.parentNode))};o.forEach(d);var u=function(p){!p||c.has(p)||Array.prototype.forEach.call(p.children,function(m){if(l.has(m))u(m);else try{var g=m.getAttribute(n),b=g!==null&&g!=="false",f=(Rt.get(m)||0)+1,h=(i.get(m)||0)+1;Rt.set(m,f),i.set(m,h),s.push(m),f===1&&b&&ln.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(),Io++,function(){s.forEach(function(p){var m=Rt.get(p)-1,g=i.get(p)-1;Rt.set(p,m),i.set(p,g),m||(ln.has(p)||p.removeAttribute(n),ln.delete(p)),g||p.removeAttribute(r)}),Io--,Io||(Rt=new WeakMap,Rt=new WeakMap,ln=new WeakMap,cn={})}},Mo=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=Gg(e);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live], script"))),Yg(n,o,r,"aria-hidden")):function(){return null}},Ie=function(){return Ie=Object.assign||function(t){for(var r,n=1,o=arguments.length;n<o;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},Ie.apply(this,arguments)};function Qs(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 Xg(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,i;n<o;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var dn="right-scroll-bar-position",un="width-before-scroll-bar",Jg="with-scroll-bars-hidden",Zg="--removed-body-scroll-bar-size";function zo(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Qg(e,t){var r=_.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 ex=typeof window<"u"?x.useLayoutEffect:x.useEffect,el=new WeakMap;function tx(e,t){var r=Qg(null,function(n){return e.forEach(function(o){return zo(o,n)})});return ex(function(){var n=el.get(r);if(n){var o=new Set(n),i=new Set(e),s=r.current;o.forEach(function(l){i.has(l)||zo(l,null)}),i.forEach(function(l){o.has(l)||zo(l,s)})}el.set(r,e)},[e]),r}function rx(e){return e}function nx(e,t){t===void 0&&(t=rx);var r=[],n=!1,o={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(i){var s=t(i,n);return r.push(s),function(){r=r.filter(function(l){return l!==s})}},assignSyncMedium:function(i){for(n=!0;r.length;){var s=r;r=[],s.forEach(i)}r={push:function(l){return i(l)},filter:function(){return r}}},assignMedium:function(i){n=!0;var s=[];if(r.length){var l=r;r=[],l.forEach(i),s=r}var c=function(){var u=s;s=[],u.forEach(i)},d=function(){return Promise.resolve().then(c)};d(),r={push:function(u){s.push(u),d()},filter:function(u){return s=s.filter(u),r}}}};return o}function ox(e){e===void 0&&(e={});var t=nx(null);return t.options=Ie({async:!0,ssr:!1},e),t}var tl=function(e){var t=e.sideCar,r=Qs(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return x.createElement(n,Ie({},r))};tl.isSideCarExport=!0;function ax(e,t){return e.useMedium(t),tl}var rl=ox(),Do=function(){},pn=x.forwardRef(function(e,t){var r=x.useRef(null),n=x.useState({onScrollCapture:Do,onWheelCapture:Do,onTouchMoveCapture:Do}),o=n[0],i=n[1],s=e.forwardProps,l=e.children,c=e.className,d=e.removeScrollBar,u=e.enabled,p=e.shards,m=e.sideCar,g=e.noRelative,b=e.noIsolation,f=e.inert,h=e.allowPinchZoom,v=e.as,y=v===void 0?"div":v,w=e.gapMode,j=Qs(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=m,N=tx([r,t]),S=Ie(Ie({},j),o);return x.createElement(x.Fragment,null,u&&x.createElement(C,{sideCar:rl,removeScrollBar:d,shards:p,noRelative:g,noIsolation:b,inert:f,setCallbacks:i,allowPinchZoom:!!h,lockRef:r,gapMode:w}),s?x.cloneElement(x.Children.only(l),Ie(Ie({},S),{ref:N})):x.createElement(y,Ie({},S,{className:c,ref:N}),l))});pn.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},pn.classNames={fullWidth:un,zeroRight:dn};var ix=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function sx(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=ix();return t&&e.setAttribute("nonce",t),e}function lx(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function cx(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var dx=function(){var e=0,t=null;return{add:function(r){e==0&&(t=sx())&&(lx(t,r),cx(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},ux=function(){var e=dx();return function(t,r){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},nl=function(){var e=ux(),t=function(r){var n=r.styles,o=r.dynamic;return e(n,o),null};return t},px={left:0,top:0,right:0,gap:0},$o=function(e){return parseInt(e||"",10)||0},mx=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[$o(r),$o(n),$o(o)]},fx=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return px;var t=mx(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])}},hx=nl(),Lt="data-scroll-locked",gx=function(e,t,r,n){var o=e.left,i=e.top,s=e.right,l=e.gap;return r===void 0&&(r="margin"),`359 .`.concat( Jg,` {357 `):" "+Zi(s[0]):"as no adapter specified";throw new U("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return o}const Qi={getAdapter:Gf,adapters:uo};function po(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Et(null,e)}function es(e){return po(e),e.headers=fe.from(e.headers),e.data=co.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Qi.getAdapter(e.adapter||ir.adapter,e)(e).then(function(n){return po(e),n.data=co.call(e,e.transformResponse,n),n.headers=fe.from(n.headers),n},function(n){return $i(n)||(po(e),n&&n.response&&(n.response.data=co.call(e,e.transformResponse,n.response),n.response.headers=fe.from(n.response.headers))),Promise.reject(n)})}const ts="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 rs={};Vr.transitional=function(t,r,n){function o(i,s){return"[Axios v"+ts+"] Transitional option '"+i+"'"+s+(n?". "+n:"")}return(i,s,l)=>{if(t===!1)throw new U(o(s," has been removed"+(r?" in "+r:"")),U.ERR_DEPRECATED);return r&&!rs[s]&&(rs[s]=!0,console.warn(o(s," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(i,s,l):!0}},Vr.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function Kf(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 i=n[o],s=t[i];if(s){const l=e[i],c=l===void 0||s(l,i,e);if(c!==!0)throw new U("option "+i+" must be "+c,U.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new U("Unknown option "+i,U.ERR_BAD_OPTION)}}const Wr={assertOptions:Kf,validators:Vr},Te=Wr.validators;let ut=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Ii,response:new Ii}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const i=o.stack?o.stack.replace(/^.+\n/,""):"";try{n.stack?i&&!String(n.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(n.stack+=` 358 `+i):n.stack=i}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=dt(this.defaults,r);const{transitional:n,paramsSerializer:o,headers:i}=r;n!==void 0&&Wr.assertOptions(n,{silentJSONParsing:Te.transitional(Te.boolean),forcedJSONParsing:Te.transitional(Te.boolean),clarifyTimeoutError:Te.transitional(Te.boolean)},!1),o!=null&&(k.isFunction(o)?r.paramsSerializer={serialize:o}:Wr.assertOptions(o,{encode:Te.function,serialize:Te.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),Wr.assertOptions(r,{baseUrl:Te.spelling("baseURL"),withXsrfToken:Te.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let s=i&&k.merge(i.common,i[r.method]);i&&k.forEach(["delete","get","head","post","put","patch","common"],b=>{delete i[b]}),r.headers=fe.concat(s,i);const l=[];let c=!0;this.interceptors.request.forEach(function(f){typeof f.runWhen=="function"&&f.runWhen(r)===!1||(c=c&&f.synchronous,l.unshift(f.fulfilled,f.rejected))});const d=[];this.interceptors.response.forEach(function(f){d.push(f.fulfilled,f.rejected)});let u,p=0,m;if(!c){const b=[es.bind(this),void 0];for(b.unshift(...l),b.push(...d),m=b.length,u=Promise.resolve(r);p<m;)u=u.then(b[p++],b[p++]);return u}m=l.length;let g=r;for(;p<m;){const b=l[p++],f=l[p++];try{g=b(g)}catch(h){f.call(this,h);break}}try{u=es.call(this,g)}catch(b){return Promise.reject(b)}for(p=0,m=d.length;p<m;)u=u.then(d[p++],d[p++]);return u}getUri(t){t=dt(this.defaults,t);const r=Hi(t.baseURL,t.url,t.allowAbsoluteUrls);return Li(r,t.params,t.paramsSerializer)}};k.forEach(["delete","get","head","options"],function(t){ut.prototype[t]=function(r,n){return this.request(dt(n||{},{method:t,url:r,data:(n||{}).data}))}}),k.forEach(["post","put","patch"],function(t){function r(n){return function(i,s,l){return this.request(dt(l||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:s}))}}ut.prototype[t]=r(),ut.prototype[t+"Form"]=r(!0)});let Yf=class Ed{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(i){r=i});const n=this;this.promise.then(o=>{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](o);n._listeners=null}),this.promise.then=o=>{let i;const s=new Promise(l=>{n.subscribe(l),i=l}).then(o);return s.cancel=function(){n.unsubscribe(i)},s},t(function(i,s,l){n.reason||(n.reason=new Et(i,s,l),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new Ed(function(o){t=o}),cancel:t}}};function Xf(e){return function(r){return e.apply(null,r)}}function Jf(e){return k.isObject(e)&&e.isAxiosError===!0}const mo={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(mo).forEach(([e,t])=>{mo[t]=e});function ns(e){const t=new ut(e),r=_i(ut.prototype.request,t);return k.extend(r,ut.prototype,t,{allOwnKeys:!0}),k.extend(r,t,null,{allOwnKeys:!0}),r.create=function(o){return ns(dt(e,o))},r}const re=ns(ir);re.Axios=ut,re.CanceledError=Et,re.CancelToken=Yf,re.isCancel=$i,re.VERSION=ts,re.toFormData=Fr,re.AxiosError=U,re.Cancel=re.CanceledError,re.all=function(t){return Promise.all(t)},re.spread=Xf,re.isAxiosError=Jf,re.mergeConfig=dt,re.AxiosHeaders=fe,re.formToJSON=e=>zi(k.isHTMLForm(e)?new FormData(e):e),re.getAdapter=Qi.getAdapter,re.HttpStatusCode=mo,re.default=re;const{Axios:_1,AxiosError:v1,CanceledError:y1,isCancel:w1,CancelToken:j1,VERSION:k1,all:S1,Cancel:C1,isAxiosError:N1,spread:E1,toFormData:T1,AxiosHeaders:A1,HttpStatusCode:P1,formToJSON:O1,getAdapter:R1,mergeConfig:L1}=re,os=ecommreelsInfo,he=re.create({baseURL:`${os.apiBase}`,headers:{"X-WP-Nonce":os.nonce,"Content-Type":"application/json"}}),Zf=()=>{const[e,t]=_.useState(!1),[r,n]=_.useState(!1),o=_.useCallback(async s=>{try{t(!0);const l={styles:ot,story_ids:s},c=await he.post("stories/manage-group-stories",l);return G.success("Group created successfully!"),c.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)}},[]),i=_.useCallback(async(s,l,c)=>{try{return n(!0),await he.delete(`story/${s}`),l(d=>d.filter(u=>u.id!==s)),c?.silent||G.success("Reel deleted successfully!"),{ok:!0}}catch(d){const u=d instanceof Error?d.message:"Something went wrong. Try again later!";return c?.silent||G.error(u),{ok:!1,message:u}}finally{n(!1)}},[]);return{styles:ot,isCreating:e,isDeleting:r,createGroup:o,deleteReel:i}};function fo(e,t){const[r,n]=_.useState(e);return _.useEffect(()=>{const o=setTimeout(()=>{n(e)},t);return()=>{clearTimeout(o)}},[e,t]),r}const as=e=>{const[t,r]=_.useState([]),[n,o]=_.useState(1),[i,s]=_.useState(!0),[l,c]=_.useState(!1),[d,u]=_.useState(!1),[p,m]=_.useState(""),g=fo(p,500),b=_.useRef(!0),f=_.useCallback(async w=>{w===1&&b.current?u(!0):c(!0);try{const j={page:w,per_page:20};e&&(j.group_id=e),g&&(j.search=g);const C=await he.get("stories",{params:j}),N=C.data,S=parseInt(C.headers["x-wp-totalpages"]);r(E=>w===1?N:[...E,...N]),o(w+1),s(w<S)}catch(j){j instanceof Error?G.error(j.message):G.error("Something went wrong. Try again later!")}finally{b.current&&(b.current=!1),c(!1),u(!1)}},[e,g]),h=_.useCallback(()=>{o(1),r([]),f(1)},[f]);_.useEffect(()=>{h()},[g,h]);const v=_.useRef(null),y=_.useCallback(w=>{l||(v.current&&v.current.disconnect(),v.current=new IntersectionObserver(j=>{j[0].isIntersecting&&i&&f(n)}),w&&v.current.observe(w))},[l,i,n,f]);return _.useEffect(()=>()=>{v.current&&v.current.disconnect()},[]),{allReels:t,setAllReels:r,searchTerm:p,setSearchTerm:m,isSearching:l,isLoading:d,lastStoryElementRef:y,refreshReels:h}};function Qf(){const e=Ne(),{allReels:t,setAllReels:r,isSearching:n,lastStoryElementRef:o,searchTerm:i,setSearchTerm:s,isLoading:l}=as(null),{styles:c,isCreating:d,isDeleting:u,createGroup:p,deleteReel:m}=Zf(),[g,b]=_.useState(null),[f,h]=_.useState(null),[v,y]=_.useState(null),[w,j]=_.useState([]),C=async()=>{const A=await p(w);A&&e(`?view=${X.mg}&gid=${A}`)},N=()=>{j(t.map(A=>A.id))},S=A=>{j(R=>R.includes(A)?R.filter(L=>L!==A):[...R,A])},E=()=>{w.length&&h(w)},T=_.useCallback(async()=>{if(g){await m(g,r),b(null);return}if(f?.length){const A=await Promise.all(f.map(M=>m(M,r,{silent:!0}))),R=f.filter((M,O)=>A[O]?.ok),L=R.length,B=f.length-L;L&&(r(M=>M.filter(O=>!R.includes(O.id))),j(M=>M.filter(O=>!R.includes(O)))),L&&G.success(`${L} reels deleted successfully!`),B&&G.error(`${B} reels failed to delete.`),h(null)}},[m,g,f,r]);return l&&!t.length?a.jsx(Lr,{}):a.jsxs(a.Fragment,{children:[(g||f)&&a.jsx(Or,{onReject:()=>{b(null),h(null)},onAccept:T,isLoading:u,message:f?.length?`Are you sure you want to remove ${f.length} reels?`:"Are you sure you want to remove this reel?"}),a.jsx(kt,{left:[a.jsx(St,{name:"All Reels",Icon:sp},"page"),a.jsx(tr,{cb:()=>e(`?view=${X.ag}`)},"back")],center:[a.jsx(Ir,{},"reel-wp")],right:[a.jsx(Rr,{to:`?view=${X.cr}&from=${X.ar}`,text:"Add Reel",Icon:yt},"add-reel-all-reel")]}),a.jsx(rr,{breads:[{label:"Dashboard",href:`?view=${X.ag}`},{label:"All Reels"}]}),a.jsxs("div",{className:"ecr-admin-panel ecr-admin-panel--reels",children:[a.jsx(Tp,{selectedReelIds:w,handleSelectAll:N,clearSelection:()=>j([]),searchTerm:i,setSearchTerm:s,isCreating:d,handleCreateGroup:C,handleBulkDelete:E}),t.length?a.jsx(Sm,{reels:t,styles:c,selectedReelIds:w,onSelectReel:S,onDeleteReel:b,onPreviewReel:y,lastStoryElementRef:o}):!n&&!l?a.jsx(Op,{}):null,n&&a.jsx(Rp,{isFullScreen:!t.length})]}),!!v&&a.jsx(mm,{previewReel:v,setPreviewReel:y})]})}const eh=()=>{const[e,t]=_.useState(!1),r=_.useCallback(async({storyId:n,storyTitle:o,uploadedFiles:i,links:s,thumbnail:l})=>{try{t(!0);const c={story_title:o,files:i,thumbnail:l,links:s};n&&(c.story_id=n);const d=await he.post("files",c);return G.success(`Story ${n?"updated":"created"} successfully!`),d.data.story_id}catch(c){return c instanceof Error?G.error(c.message):G.error("Something went wrong. Try again later!"),null}finally{t(!1)}},[]);return{isSaving:e,saveStory:r}},ho=({isSaving:e,onSave:t,text:r="Save",className:n,...o})=>a.jsxs(ne,{onClick:t,className:$("ecr-admin-save-button",n),...o,children:[e?a.jsx(it,{className:"ecr-admin-save-button__icon ecr-admin-save-button__icon--spin"}):a.jsx(up,{className:"ecr-admin-save-button__icon"})," ",r]}),is=({setIsEdited:e,title:t,setTitle:r,placeholder:n,style:o})=>a.jsx("div",{children:a.jsx("input",{style:o,className:"ecr-admin-title-input",type:"text",value:t,placeholder:n,onChange:i=>{e&&e(!0),r(i.target.value)}})}),th=({uploadedFiles:e,links:t,storyTitle:r,setStoryTitle:n,thumbnail:o})=>{const i=Ne(),[s]=Zt(),l=s.get("sid"),c=s.get("from")||X.ag,d=s.get("gid"),{isSaving:u,saveStory:p}=eh(),m=async()=>{u||!await p({storyId:l,storyTitle:r,uploadedFiles:e,links:t,thumbnail:o})||i(`?view=${c}${d?`&gid=${d}`:""}`,{replace:!0})};return a.jsxs(a.Fragment,{children:[a.jsx(kt,{left:[a.jsx(St,{name:l?"Update Reel":"Add Reel",Icon:yt},"page"),a.jsx(tr,{},"back")],center:[a.jsx(is,{placeholder:"Enter reel title",title:r,setTitle:n},"title")],right:[a.jsx(ho,{onSave:m,isSaving:u,disabled:!e.length},"save")]}),a.jsx(rr,{breads:[{label:"Dashboard",href:"?view=my-reels"},{label:l?"Update Reel":"Add Reel"}]})]})};function H(e,t,{checkForDefaultPrevented:r=!0}={}){return function(o){if(e?.(o),r===!1||!o.defaultPrevented)return t?.(o)}}function rh(e,t){const r=x.createContext(t),n=i=>{const{children:s,...l}=i,c=x.useMemo(()=>l,Object.values(l));return a.jsx(r.Provider,{value:c,children:s})};n.displayName=e+"Provider";function o(i){const s=x.useContext(r);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[n,o]}function Ve(e,t=[]){let r=[];function n(i,s){const l=x.createContext(s),c=r.length;r=[...r,s];const d=p=>{const{scope:m,children:g,...b}=p,f=m?.[e]?.[c]||l,h=x.useMemo(()=>b,Object.values(b));return a.jsx(f.Provider,{value:h,children:g})};d.displayName=i+"Provider";function u(p,m){const g=m?.[e]?.[c]||l,b=x.useContext(g);if(b)return b;if(s!==void 0)return s;throw new Error(`\`${p}\` must be used within \`${i}\``)}return[d,u]}const o=()=>{const i=r.map(s=>x.createContext(s));return function(l){const c=l?.[e]||i;return x.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return o.scopeName=e,[n,nh(o,...t)]}function nh(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=n.reduce((l,{useScope:c,scopeName:d})=>{const p=c(i)[`__scope${d}`];return{...l,...p}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return r.scopeName=t.scopeName,r}var oh=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],W=oh.reduce((e,t)=>{const r=st(`Primitive.${t}`),n=x.forwardRef((o,i)=>{const{asChild:s,...l}=o,c=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function ah(e,t){e&&xr.flushSync(()=>e.dispatchEvent(t))}function We(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...r)=>t.current?.(...r),[])}function ih(e,t=globalThis?.document){const r=We(e);x.useEffect(()=>{const n=o=>{o.key==="Escape"&&r(o)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var sh="DismissableLayer",go="dismissableLayer.update",lh="dismissableLayer.pointerDownOutside",ch="dismissableLayer.focusOutside",ss,ls=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),qr=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:l,...c}=e,d=x.useContext(ls),[u,p]=x.useState(null),m=u?.ownerDocument??globalThis?.document,[,g]=x.useState({}),b=J(t,S=>p(S)),f=Array.from(d.layers),[h]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),v=f.indexOf(h),y=u?f.indexOf(u):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,j=y>=v,C=ph(S=>{const E=S.target,T=[...d.branches].some(A=>A.contains(E));!j||T||(o?.(S),s?.(S),S.defaultPrevented||l?.())},m),N=mh(S=>{const E=S.target;[...d.branches].some(A=>A.contains(E))||(i?.(S),s?.(S),S.defaultPrevented||l?.())},m);return ih(S=>{y===d.layers.size-1&&(n?.(S),!S.defaultPrevented&&l&&(S.preventDefault(),l()))},m),x.useEffect(()=>{if(u)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(ss=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(u)),d.layers.add(u),cs(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=ss)}},[u,m,r,d]),x.useEffect(()=>()=>{u&&(d.layers.delete(u),d.layersWithOutsidePointerEventsDisabled.delete(u),cs())},[u,d]),x.useEffect(()=>{const S=()=>g({});return document.addEventListener(go,S),()=>document.removeEventListener(go,S)},[]),a.jsx(W.div,{...c,ref:b,style:{pointerEvents:w?j?"auto":"none":void 0,...e.style},onFocusCapture:H(e.onFocusCapture,N.onFocusCapture),onBlurCapture:H(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:H(e.onPointerDownCapture,C.onPointerDownCapture)})});qr.displayName=sh;var dh="DismissableLayerBranch",uh=x.forwardRef((e,t)=>{const r=x.useContext(ls),n=x.useRef(null),o=J(t,n);return x.useEffect(()=>{const i=n.current;if(i)return r.branches.add(i),()=>{r.branches.delete(i)}},[r.branches]),a.jsx(W.div,{...e,ref:o})});uh.displayName=dh;function ph(e,t=globalThis?.document){const r=We(e),n=x.useRef(!1),o=x.useRef(()=>{});return x.useEffect(()=>{const i=l=>{if(l.target&&!n.current){let c=function(){ds(lh,r,d,{discrete:!0})};const d={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);n.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function mh(e,t=globalThis?.document){const r=We(e),n=x.useRef(!1);return x.useEffect(()=>{const o=i=>{i.target&&!n.current&&ds(ch,r,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function cs(){const e=new CustomEvent(go);document.dispatchEvent(e)}function ds(e,t,r,{discrete:n}){const o=r.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?ah(o,i):o.dispatchEvent(i)}var xo=0;function bo(){x.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??us()),document.body.insertAdjacentElement("beforeend",e[1]??us()),xo++,()=>{xo===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),xo--}},[])}function us(){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 _o="focusScope.autoFocusOnMount",vo="focusScope.autoFocusOnUnmount",ps={bubbles:!1,cancelable:!0},fh="FocusScope",Gr=x.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[l,c]=x.useState(null),d=We(o),u=We(i),p=x.useRef(null),m=J(t,f=>c(f)),g=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(n){let f=function(w){if(g.paused||!l)return;const j=w.target;l.contains(j)?p.current=j:qe(p.current,{select:!0})},h=function(w){if(g.paused||!l)return;const j=w.relatedTarget;j!==null&&(l.contains(j)||qe(p.current,{select:!0}))},v=function(w){if(document.activeElement===document.body)for(const C of w)C.removedNodes.length>0&&qe(l)};document.addEventListener("focusin",f),document.addEventListener("focusout",h);const y=new MutationObserver(v);return l&&y.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",f),document.removeEventListener("focusout",h),y.disconnect()}}},[n,l,g.paused]),x.useEffect(()=>{if(l){hs.add(g);const f=document.activeElement;if(!l.contains(f)){const v=new CustomEvent(_o,ps);l.addEventListener(_o,d),l.dispatchEvent(v),v.defaultPrevented||(hh(vh(ms(l)),{select:!0}),document.activeElement===f&&qe(l))}return()=>{l.removeEventListener(_o,d),setTimeout(()=>{const v=new CustomEvent(vo,ps);l.addEventListener(vo,u),l.dispatchEvent(v),v.defaultPrevented||qe(f??document.body,{select:!0}),l.removeEventListener(vo,u),hs.remove(g)},0)}}},[l,d,u,g]);const b=x.useCallback(f=>{if(!r&&!n||g.paused)return;const h=f.key==="Tab"&&!f.altKey&&!f.ctrlKey&&!f.metaKey,v=document.activeElement;if(h&&v){const y=f.currentTarget,[w,j]=gh(y);w&&j?!f.shiftKey&&v===j?(f.preventDefault(),r&&qe(w,{select:!0})):f.shiftKey&&v===w&&(f.preventDefault(),r&&qe(j,{select:!0})):v===y&&f.preventDefault()}},[r,n,g.paused]);return a.jsx(W.div,{tabIndex:-1,...s,ref:m,onKeyDown:b})});Gr.displayName=fh;function hh(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(qe(n,{select:t}),document.activeElement!==r)return}function gh(e){const t=ms(e),r=fs(t,e),n=fs(t.reverse(),e);return[r,n]}function ms(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 fs(e,t){for(const r of e)if(!xh(r,{upTo:t}))return r}function xh(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 bh(e){return e instanceof HTMLInputElement&&"select"in e}function qe(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&bh(e)&&t&&e.select()}}var hs=_h();function _h(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=gs(e,t),e.unshift(t)},remove(t){e=gs(e,t),e[0]?.resume()}}}function gs(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function vh(e){return e.filter(t=>t.tagName!=="A")}var le=globalThis?.document?x.useLayoutEffect:()=>{},yh=x[" useId ".trim().toString()]||(()=>{}),wh=0;function Ae(e){const[t,r]=x.useState(yh());return le(()=>{r(n=>n??String(wh++))},[e]),e||(t?`radix-${t}`:"")}const jh=["top","right","bottom","left"],Ge=Math.min,xe=Math.max,Kr=Math.round,Yr=Math.floor,Pe=e=>({x:e,y:e}),kh={left:"right",right:"left",bottom:"top",top:"bottom"},Sh={start:"end",end:"start"};function yo(e,t,r){return xe(e,Ge(t,r))}function $e(e,t){return typeof e=="function"?e(t):e}function Fe(e){return e.split("-")[0]}function Tt(e){return e.split("-")[1]}function wo(e){return e==="x"?"y":"x"}function jo(e){return e==="y"?"height":"width"}const Ch=new Set(["top","bottom"]);function Oe(e){return Ch.has(Fe(e))?"y":"x"}function ko(e){return wo(Oe(e))}function Nh(e,t,r){r===void 0&&(r=!1);const n=Tt(e),o=ko(e),i=jo(o);let s=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Xr(s)),[s,Xr(s)]}function Eh(e){const t=Xr(e);return[So(e),t,So(t)]}function So(e){return e.replace(/start|end/g,t=>Sh[t])}const xs=["left","right"],bs=["right","left"],Th=["top","bottom"],Ah=["bottom","top"];function Ph(e,t,r){switch(e){case"top":case"bottom":return r?t?bs:xs:t?xs:bs;case"left":case"right":return t?Th:Ah;default:return[]}}function Oh(e,t,r,n){const o=Tt(e);let i=Ph(Fe(e),r==="start",n);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(So)))),i}function Xr(e){return e.replace(/left|right|bottom|top/g,t=>kh[t])}function Rh(e){return{top:0,right:0,bottom:0,left:0,...e}}function _s(e){return typeof e!="number"?Rh(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 vs(e,t,r){let{reference:n,floating:o}=e;const i=Oe(t),s=ko(t),l=jo(s),c=Fe(t),d=i==="y",u=n.x+n.width/2-o.width/2,p=n.y+n.height/2-o.height/2,m=n[l]/2-o[l]/2;let g;switch(c){case"top":g={x:u,y:n.y-o.height};break;case"bottom":g={x:u,y:n.y+n.height};break;case"right":g={x:n.x+n.width,y:p};break;case"left":g={x:n.x-o.width,y:p};break;default:g={x:n.x,y:n.y}}switch(Tt(t)){case"start":g[s]-=m*(r&&d?-1:1);break;case"end":g[s]+=m*(r&&d?-1:1);break}return g}const Lh=async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:i=[],platform:s}=r,l=i.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(t));let d=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:p}=vs(d,n,c),m=n,g={},b=0;for(let f=0;f<l.length;f++){const{name:h,fn:v}=l[f],{x:y,y:w,data:j,reset:C}=await v({x:u,y:p,initialPlacement:n,placement:m,strategy:o,middlewareData:g,rects:d,platform:s,elements:{reference:e,floating:t}});u=y??u,p=w??p,g={...g,[h]:{...g[h],...j}},C&&b<=50&&(b++,typeof C=="object"&&(C.placement&&(m=C.placement),C.rects&&(d=C.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):C.rects),{x:u,y:p}=vs(d,m,c)),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:i,rects:s,elements:l,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:p="floating",altBoundary:m=!1,padding:g=0}=$e(t,e),b=_s(g),h=l[m?p==="floating"?"reference":"floating":p],v=Jr(await i.getClippingRect({element:(r=await(i.isElement==null?void 0:i.isElement(h)))==null||r?h:h.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:d,rootBoundary:u,strategy:c})),y=p==="floating"?{x:n,y:o,width:s.floating.width,height:s.floating.height}:s.reference,w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),j=await(i.isElement==null?void 0:i.isElement(w))?await(i.getScale==null?void 0:i.getScale(w))||{x:1,y:1}:{x:1,y:1},C=Jr(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:w,strategy:c}):y);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 Ih=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:i,platform:s,elements:l,middlewareData:c}=t,{element:d,padding:u=0}=$e(e,t)||{};if(d==null)return{};const p=_s(u),m={x:r,y:n},g=ko(o),b=jo(g),f=await s.getDimensions(d),h=g==="y",v=h?"top":"left",y=h?"bottom":"right",w=h?"clientHeight":"clientWidth",j=i.reference[b]+i.reference[g]-m[g]-i.floating[b],C=m[g]-i.reference[g],N=await(s.getOffsetParent==null?void 0:s.getOffsetParent(d));let S=N?N[w]:0;(!S||!await(s.isElement==null?void 0:s.isElement(N)))&&(S=l.floating[w]||i.floating[b]);const E=j/2-C/2,T=S/2-f[b]/2-1,A=Ge(p[v],T),R=Ge(p[y],T),L=A,B=S-f[b]-R,M=S/2-f[b]/2+E,O=yo(L,M,B),P=!c.arrow&&Tt(o)!=null&&M!==O&&i.reference[b]/2-(M<L?A:R)-f[b]/2<0,z=P?M<L?M-L:M-B:0;return{[g]:m[g]+z,data:{[g]:O,centerOffset:M-O-z,...P&&{alignmentOffset:z}},reset:P}}}),Mh=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:i,rects:s,initialPlacement:l,platform:c,elements:d}=t,{mainAxis:u=!0,crossAxis:p=!0,fallbackPlacements:m,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:f=!0,...h}=$e(e,t);if((r=i.arrow)!=null&&r.alignmentOffset)return{};const v=Fe(o),y=Oe(l),w=Fe(l)===l,j=await(c.isRTL==null?void 0:c.isRTL(d.floating)),C=m||(w||!f?[Xr(l)]:Eh(l)),N=b!=="none";!m&&N&&C.push(...Oh(l,f,b,j));const S=[l,...C],E=await lr(t,h),T=[];let A=((n=i.flip)==null?void 0:n.overflows)||[];if(u&&T.push(E[v]),p){const M=Nh(o,s,j);T.push(E[M[0]],E[M[1]])}if(A=[...A,{placement:o,overflows:T}],!T.every(M=>M<=0)){var R,L;const M=(((R=i.flip)==null?void 0:R.index)||0)+1,O=S[M];if(O&&(!(p==="alignment"?y!==Oe(O):!1)||A.every(I=>Oe(I.placement)===y?I.overflows[0]>0:!0)))return{data:{index:M,overflows:A},reset:{placement:O}};let P=(L=A.filter(z=>z.overflows[0]<=0).sort((z,I)=>z.overflows[1]-I.overflows[1])[0])==null?void 0:L.placement;if(!P)switch(g){case"bestFit":{var B;const z=(B=A.filter(I=>{if(N){const q=Oe(I.placement);return q===y||q==="y"}return!0}).map(I=>[I.placement,I.overflows.filter(q=>q>0).reduce((q,te)=>q+te,0)]).sort((I,q)=>I[1]-q[1])[0])==null?void 0:B[0];z&&(P=z);break}case"initialPlacement":P=l;break}if(o!==P)return{reset:{placement:P}}}return{}}}};function ys(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ws(e){return jh.some(t=>e[t]>=0)}const zh=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...o}=$e(e,t);switch(n){case"referenceHidden":{const i=await lr(t,{...o,elementContext:"reference"}),s=ys(i,r.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:ws(s)}}}case"escaped":{const i=await lr(t,{...o,altBoundary:!0}),s=ys(i,r.floating);return{data:{escapedOffsets:s,escaped:ws(s)}}}default:return{}}}}},js=new Set(["left","top"]);async function Dh(e,t){const{placement:r,platform:n,elements:o}=e,i=await(n.isRTL==null?void 0:n.isRTL(o.floating)),s=Fe(r),l=Tt(r),c=Oe(r)==="y",d=js.has(s)?-1:1,u=i&&c?-1:1,p=$e(t,e);let{mainAxis:m,crossAxis:g,alignmentAxis:b}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return l&&typeof b=="number"&&(g=l==="end"?b*-1:b),c?{x:g*u,y:m*d}:{x:m*d,y:g*u}}const $h=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:i,placement:s,middlewareData:l}=t,c=await Dh(t,e);return s===((r=l.offset)==null?void 0:r.placement)&&(n=l.arrow)!=null&&n.alignmentOffset?{}:{x:o+c.x,y:i+c.y,data:{...c,placement:s}}}}},Fh=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:l={fn:h=>{let{x:v,y}=h;return{x:v,y}}},...c}=$e(e,t),d={x:r,y:n},u=await lr(t,c),p=Oe(Fe(o)),m=wo(p);let g=d[m],b=d[p];if(i){const h=m==="y"?"top":"left",v=m==="y"?"bottom":"right",y=g+u[h],w=g-u[v];g=yo(y,g,w)}if(s){const h=p==="y"?"top":"left",v=p==="y"?"bottom":"right",y=b+u[h],w=b-u[v];b=yo(y,b,w)}const f=l.fn({...t,[m]:g,[p]:b});return{...f,data:{x:f.x-r,y:f.y-n,enabled:{[m]:i,[p]:s}}}}}},Bh=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:i,middlewareData:s}=t,{offset:l=0,mainAxis:c=!0,crossAxis:d=!0}=$e(e,t),u={x:r,y:n},p=Oe(o),m=wo(p);let g=u[m],b=u[p];const f=$e(l,t),h=typeof f=="number"?{mainAxis:f,crossAxis:0}:{mainAxis:0,crossAxis:0,...f};if(c){const w=m==="y"?"height":"width",j=i.reference[m]-i.floating[w]+h.mainAxis,C=i.reference[m]+i.reference[w]-h.mainAxis;g<j?g=j:g>C&&(g=C)}if(d){var v,y;const w=m==="y"?"width":"height",j=js.has(Fe(o)),C=i.reference[p]-i.floating[w]+(j&&((v=s.offset)==null?void 0:v[p])||0)+(j?0:h.crossAxis),N=i.reference[p]+i.reference[w]+(j?0:((y=s.offset)==null?void 0:y[p])||0)-(j?h.crossAxis:0);b<C?b=C:b>N&&(b=N)}return{[m]:g,[p]:b}}}},Uh=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:o,rects:i,platform:s,elements:l}=t,{apply:c=()=>{},...d}=$e(e,t),u=await lr(t,d),p=Fe(o),m=Tt(o),g=Oe(o)==="y",{width:b,height:f}=i.floating;let h,v;p==="top"||p==="bottom"?(h=p,v=m===(await(s.isRTL==null?void 0:s.isRTL(l.floating))?"start":"end")?"left":"right"):(v=p,h=m==="end"?"top":"bottom");const y=f-u.top-u.bottom,w=b-u.left-u.right,j=Ge(f-u[h],y),C=Ge(b-u[v],w),N=!t.middlewareData.shift;let S=j,E=C;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(E=w),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(S=y),N&&!m){const A=xe(u.left,0),R=xe(u.right,0),L=xe(u.top,0),B=xe(u.bottom,0);g?E=b-2*(A!==0||R!==0?A+R:xe(u.left,u.right)):S=f-2*(L!==0||B!==0?L+B:xe(u.top,u.bottom))}await c({...t,availableWidth:E,availableHeight:S});const T=await s.getDimensions(l.floating);return b!==T.width||f!==T.height?{reset:{rects:!0}}:{}}}};function Zr(){return typeof window<"u"}function At(e){return ks(e)?(e.nodeName||"").toLowerCase():"#document"}function be(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Re(e){var t;return(t=(ks(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ks(e){return Zr()?e instanceof Node||e instanceof be(e).Node:!1}function je(e){return Zr()?e instanceof Element||e instanceof be(e).Element:!1}function Le(e){return Zr()?e instanceof HTMLElement||e instanceof be(e).HTMLElement:!1}function Ss(e){return!Zr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof be(e).ShadowRoot}const Hh=new Set(["inline","contents"]);function cr(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=ke(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!Hh.has(o)}const Vh=new Set(["table","td","th"]);function Wh(e){return Vh.has(At(e))}const qh=[":popover-open",":modal"];function Qr(e){return qh.some(t=>{try{return e.matches(t)}catch{return!1}})}const Gh=["transform","translate","scale","rotate","perspective"],Kh=["transform","translate","scale","rotate","perspective","filter"],Yh=["paint","layout","strict","content"];function Co(e){const t=No(),r=je(e)?ke(e):e;return Gh.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)||Kh.some(n=>(r.willChange||"").includes(n))||Yh.some(n=>(r.contain||"").includes(n))}function Xh(e){let t=Ke(e);for(;Le(t)&&!Pt(t);){if(Co(t))return t;if(Qr(t))return null;t=Ke(t)}return null}function No(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Jh=new Set(["html","body","#document"]);function Pt(e){return Jh.has(At(e))}function ke(e){return be(e).getComputedStyle(e)}function en(e){return je(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ke(e){if(At(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ss(e)&&e.host||Re(e);return Ss(t)?t.host:t}function Cs(e){const t=Ke(e);return Pt(t)?e.ownerDocument?e.ownerDocument.body:e.body:Le(t)&&cr(t)?t:Cs(t)}function dr(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=Cs(e),i=o===((n=e.ownerDocument)==null?void 0:n.body),s=be(o);if(i){const l=Eo(s);return t.concat(s,s.visualViewport||[],cr(o)?o:[],l&&r?dr(l):[])}return t.concat(o,dr(o,[],r))}function Eo(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ns(e){const t=ke(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=Le(e),i=o?e.offsetWidth:r,s=o?e.offsetHeight:n,l=Kr(r)!==i||Kr(n)!==s;return l&&(r=i,n=s),{width:r,height:n,$:l}}function To(e){return je(e)?e:e.contextElement}function Ot(e){const t=To(e);if(!Le(t))return Pe(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:i}=Ns(t);let s=(i?Kr(r.width):r.width)/n,l=(i?Kr(r.height):r.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const Zh=Pe(0);function Es(e){const t=be(e);return!No()||!t.visualViewport?Zh:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Qh(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==be(e)?!1:t}function pt(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),i=To(e);let s=Pe(1);t&&(n?je(n)&&(s=Ot(n)):s=Ot(e));const l=Qh(i,r,n)?Es(i):Pe(0);let c=(o.left+l.x)/s.x,d=(o.top+l.y)/s.y,u=o.width/s.x,p=o.height/s.y;if(i){const m=be(i),g=n&&je(n)?be(n):n;let b=m,f=Eo(b);for(;f&&n&&g!==b;){const h=Ot(f),v=f.getBoundingClientRect(),y=ke(f),w=v.left+(f.clientLeft+parseFloat(y.paddingLeft))*h.x,j=v.top+(f.clientTop+parseFloat(y.paddingTop))*h.y;c*=h.x,d*=h.y,u*=h.x,p*=h.y,c+=w,d+=j,b=be(f),f=Eo(b)}}return Jr({width:u,height:p,x:c,y:d})}function tn(e,t){const r=en(e).scrollLeft;return t?t.left+r:pt(Re(e)).left+r}function Ts(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 eg(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const i=o==="fixed",s=Re(n),l=t?Qr(t.floating):!1;if(n===s||l&&i)return r;let c={scrollLeft:0,scrollTop:0},d=Pe(1);const u=Pe(0),p=Le(n);if((p||!p&&!i)&&((At(n)!=="body"||cr(s))&&(c=en(n)),Le(n))){const g=pt(n);d=Ot(n),u.x=g.x+n.clientLeft,u.y=g.y+n.clientTop}const m=s&&!p&&!i?Ts(s,c):Pe(0);return{width:r.width*d.x,height:r.height*d.y,x:r.x*d.x-c.scrollLeft*d.x+u.x+m.x,y:r.y*d.y-c.scrollTop*d.y+u.y+m.y}}function tg(e){return Array.from(e.getClientRects())}function rg(e){const t=Re(e),r=en(e),n=e.ownerDocument.body,o=xe(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=xe(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let s=-r.scrollLeft+tn(e);const l=-r.scrollTop;return ke(n).direction==="rtl"&&(s+=xe(t.clientWidth,n.clientWidth)-o),{width:o,height:i,x:s,y:l}}const As=25;function ng(e,t){const r=be(e),n=Re(e),o=r.visualViewport;let i=n.clientWidth,s=n.clientHeight,l=0,c=0;if(o){i=o.width,s=o.height;const u=No();(!u||u&&t==="fixed")&&(l=o.offsetLeft,c=o.offsetTop)}const d=tn(n);if(d<=0){const u=n.ownerDocument,p=u.body,m=getComputedStyle(p),g=u.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,b=Math.abs(n.clientWidth-p.clientWidth-g);b<=As&&(i-=b)}else d<=As&&(i+=d);return{width:i,height:s,x:l,y:c}}const og=new Set(["absolute","fixed"]);function ag(e,t){const r=pt(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,i=Le(e)?Ot(e):Pe(1),s=e.clientWidth*i.x,l=e.clientHeight*i.y,c=o*i.x,d=n*i.y;return{width:s,height:l,x:c,y:d}}function Ps(e,t,r){let n;if(t==="viewport")n=ng(e,r);else if(t==="document")n=rg(Re(e));else if(je(t))n=ag(t,r);else{const o=Es(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Jr(n)}function Os(e,t){const r=Ke(e);return r===t||!je(r)||Pt(r)?!1:ke(r).position==="fixed"||Os(r,t)}function ig(e,t){const r=t.get(e);if(r)return r;let n=dr(e,[],!1).filter(l=>je(l)&&At(l)!=="body"),o=null;const i=ke(e).position==="fixed";let s=i?Ke(e):e;for(;je(s)&&!Pt(s);){const l=ke(s),c=Co(s);!c&&l.position==="fixed"&&(o=null),(i?!c&&!o:!c&&l.position==="static"&&!!o&&og.has(o.position)||cr(s)&&!c&&Os(e,s))?n=n.filter(u=>u!==s):o=l,s=Ke(s)}return t.set(e,n),n}function sg(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const s=[...r==="clippingAncestors"?Qr(t)?[]:ig(t,this._c):[].concat(r),n],l=s[0],c=s.reduce((d,u)=>{const p=Ps(t,u,o);return d.top=xe(p.top,d.top),d.right=Ge(p.right,d.right),d.bottom=Ge(p.bottom,d.bottom),d.left=xe(p.left,d.left),d},Ps(t,l,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function lg(e){const{width:t,height:r}=Ns(e);return{width:t,height:r}}function cg(e,t,r){const n=Le(t),o=Re(t),i=r==="fixed",s=pt(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const c=Pe(0);function d(){c.x=tn(o)}if(n||!n&&!i)if((At(t)!=="body"||cr(o))&&(l=en(t)),n){const g=pt(t,!0,i,t);c.x=g.x+t.clientLeft,c.y=g.y+t.clientTop}else o&&d();i&&!n&&o&&d();const u=o&&!n&&!i?Ts(o,l):Pe(0),p=s.left+l.scrollLeft-c.x-u.x,m=s.top+l.scrollTop-c.y-u.y;return{x:p,y:m,width:s.width,height:s.height}}function Ao(e){return ke(e).position==="static"}function Rs(e,t){if(!Le(e)||ke(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Re(e)===r&&(r=r.ownerDocument.body),r}function Ls(e,t){const r=be(e);if(Qr(e))return r;if(!Le(e)){let o=Ke(e);for(;o&&!Pt(o);){if(je(o)&&!Ao(o))return o;o=Ke(o)}return r}let n=Rs(e,t);for(;n&&Wh(n)&&Ao(n);)n=Rs(n,t);return n&&Pt(n)&&Ao(n)&&!Co(n)?r:n||Xh(e)||r}const dg=async function(e){const t=this.getOffsetParent||Ls,r=this.getDimensions,n=await r(e.floating);return{reference:cg(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function ug(e){return ke(e).direction==="rtl"}const pg={convertOffsetParentRelativeRectToViewportRelativeRect:eg,getDocumentElement:Re,getClippingRect:sg,getOffsetParent:Ls,getElementRects:dg,getClientRects:tg,getDimensions:lg,getScale:Ot,isElement:je,isRTL:ug};function Is(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function mg(e,t){let r=null,n;const o=Re(e);function i(){var l;clearTimeout(n),(l=r)==null||l.disconnect(),r=null}function s(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),i();const d=e.getBoundingClientRect(),{left:u,top:p,width:m,height:g}=d;if(l||t(),!m||!g)return;const b=Yr(p),f=Yr(o.clientWidth-(u+m)),h=Yr(o.clientHeight-(p+g)),v=Yr(u),w={rootMargin:-b+"px "+-f+"px "+-h+"px "+-v+"px",threshold:xe(0,Ge(1,c))||1};let j=!0;function C(N){const S=N[0].intersectionRatio;if(S!==c){if(!j)return s();S?s(!1,S):n=setTimeout(()=>{s(!1,1e-7)},1e3)}S===1&&!Is(d,e.getBoundingClientRect())&&s(),j=!1}try{r=new IntersectionObserver(C,{...w,root:o.ownerDocument})}catch{r=new IntersectionObserver(C,w)}r.observe(e)}return s(!0),i}function fg(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,d=To(e),u=o||i?[...d?dr(d):[],...dr(t)]:[];u.forEach(v=>{o&&v.addEventListener("scroll",r,{passive:!0}),i&&v.addEventListener("resize",r)});const p=d&&l?mg(d,r):null;let m=-1,g=null;s&&(g=new ResizeObserver(v=>{let[y]=v;y&&y.target===d&&g&&(g.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var w;(w=g)==null||w.observe(t)})),r()}),d&&!c&&g.observe(d),g.observe(t));let b,f=c?pt(e):null;c&&h();function h(){const v=pt(e);f&&!Is(f,v)&&r(),f=v,b=requestAnimationFrame(h)}return r(),()=>{var v;u.forEach(y=>{o&&y.removeEventListener("scroll",r),i&&y.removeEventListener("resize",r)}),p?.(),(v=g)==null||v.disconnect(),g=null,c&&cancelAnimationFrame(b)}}const hg=$h,gg=Fh,xg=Mh,bg=Uh,_g=zh,Ms=Ih,vg=Bh,yg=(e,t,r)=>{const n=new Map,o={platform:pg,...r},i={...o.platform,_c:n};return Lh(e,t,{...o,platform:i})};var wg=typeof document<"u",jg=function(){},rn=wg?_.useLayoutEffect:jg;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 i=o[n];if(!(i==="_owner"&&e.$$typeof)&&!nn(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function zs(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ds(e,t){const r=zs(e);return Math.round(t*r)/r}function Po(e){const t=x.useRef(e);return rn(()=>{t.current=e}),t}function kg(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:i,floating:s}={},transform:l=!0,whileElementsMounted:c,open:d}=e,[u,p]=x.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[m,g]=x.useState(n);nn(m,n)||g(n);const[b,f]=x.useState(null),[h,v]=x.useState(null),y=x.useCallback(I=>{I!==N.current&&(N.current=I,f(I))},[]),w=x.useCallback(I=>{I!==S.current&&(S.current=I,v(I))},[]),j=i||b,C=s||h,N=x.useRef(null),S=x.useRef(null),E=x.useRef(u),T=c!=null,A=Po(c),R=Po(o),L=Po(d),B=x.useCallback(()=>{if(!N.current||!S.current)return;const I={placement:t,strategy:r,middleware:m};R.current&&(I.platform=R.current),yg(N.current,S.current,I).then(q=>{const te={...q,isPositioned:L.current!==!1};M.current&&!nn(E.current,te)&&(E.current=te,xr.flushSync(()=>{p(te)}))})},[m,t,r,R,L]);rn(()=>{d===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,p(I=>({...I,isPositioned:!1})))},[d]);const M=x.useRef(!1);rn(()=>(M.current=!0,()=>{M.current=!1}),[]),rn(()=>{if(j&&(N.current=j),C&&(S.current=C),j&&C){if(A.current)return A.current(j,C,B);B()}},[j,C,B,A,T]);const O=x.useMemo(()=>({reference:N,floating:S,setReference:y,setFloating:w}),[y,w]),P=x.useMemo(()=>({reference:j,floating:C}),[j,C]),z=x.useMemo(()=>{const I={position:r,left:0,top:0};if(!P.floating)return I;const q=Ds(P.floating,u.x),te=Ds(P.floating,u.y);return l?{...I,transform:"translate("+q+"px, "+te+"px)",...zs(P.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:q,top:te}},[r,l,P.floating,u.x,u.y]);return x.useMemo(()=>({...u,update:B,refs:O,elements:P,floatingStyles:z}),[u,B,O,P,z])}const Sg=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?Ms({element:n.current,padding:o}).fn(r):{}:n?Ms({element:n,padding:o}).fn(r):{}}}},Cg=(e,t)=>({...hg(e),options:[e,t]}),Ng=(e,t)=>({...gg(e),options:[e,t]}),Eg=(e,t)=>({...vg(e),options:[e,t]}),Tg=(e,t)=>({...xg(e),options:[e,t]}),Ag=(e,t)=>({...bg(e),options:[e,t]}),Pg=(e,t)=>({..._g(e),options:[e,t]}),Og=(e,t)=>({...Sg(e),options:[e,t]});var Rg="Arrow",$s=x.forwardRef((e,t)=>{const{children:r,width:n=10,height:o=5,...i}=e;return a.jsx(W.svg,{...i,ref:t,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:a.jsx("polygon",{points:"0,0 30,0 15,10"})})});$s.displayName=Rg;var Lg=$s;function Ig(e){const[t,r]=x.useState(void 0);return le(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,l;if("borderBoxSize"in i){const c=i.borderBoxSize,d=Array.isArray(c)?c[0]:c;s=d.inlineSize,l=d.blockSize}else s=e.offsetWidth,l=e.offsetHeight;r({width:s,height:l})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var Oo="Popper",[Fs,on]=Ve(Oo),[Mg,Bs]=Fs(Oo),Us=e=>{const{__scopePopper:t,children:r}=e,[n,o]=x.useState(null);return a.jsx(Mg,{scope:t,anchor:n,onAnchorChange:o,children:r})};Us.displayName=Oo;var Hs="PopperAnchor",Vs=x.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...o}=e,i=Bs(Hs,r),s=x.useRef(null),l=J(t,s),c=x.useRef(null);return x.useEffect(()=>{const d=c.current;c.current=n?.current||s.current,d!==c.current&&i.onAnchorChange(c.current)}),n?null:a.jsx(W.div,{...o,ref:l})});Vs.displayName=Hs;var Ro="PopperContent",[zg,Dg]=Fs(Ro),Ws=x.forwardRef((e,t)=>{const{__scopePopper:r,side:n="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:u=0,sticky:p="partial",hideWhenDetached:m=!1,updatePositionStrategy:g="optimized",onPlaced:b,...f}=e,h=Bs(Ro,r),[v,y]=x.useState(null),w=J(t,F=>y(F)),[j,C]=x.useState(null),N=Ig(j),S=N?.width??0,E=N?.height??0,T=n+(i!=="center"?"-"+i:""),A=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},R=Array.isArray(d)?d:[d],L=R.length>0,B={padding:A,boundary:R.filter(Fg),altBoundary:L},{refs:M,floatingStyles:O,placement:P,isPositioned:z,middlewareData:I}=kg({strategy:"fixed",placement:T,whileElementsMounted:(...F)=>fg(...F,{animationFrame:g==="always"}),elements:{reference:h.anchor},middleware:[Cg({mainAxis:o+E,alignmentAxis:s}),c&&Ng({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?Eg():void 0,...B}),c&&Tg({...B}),Ag({...B,apply:({elements:F,rects:Y,availableWidth:se,availableHeight:Z})=>{const{width:ee,height:ae}=Y.reference,ve=F.floating.style;ve.setProperty("--radix-popper-available-width",`${se}px`),ve.setProperty("--radix-popper-available-height",`${Z}px`),ve.setProperty("--radix-popper-anchor-width",`${ee}px`),ve.setProperty("--radix-popper-anchor-height",`${ae}px`)}}),j&&Og({element:j,padding:l}),Bg({arrowWidth:S,arrowHeight:E}),m&&Pg({strategy:"referenceHidden",...B})]}),[q,te]=Ks(P),oe=We(b);le(()=>{z&&oe?.()},[z,oe]);const ge=I.arrow?.x,_e=I.arrow?.y,pe=I.arrow?.centerOffset!==0,[K,de]=x.useState();return le(()=>{v&&de(window.getComputedStyle(v).zIndex)},[v]),a.jsx("div",{ref:M.setFloating,"data-radix-popper-content-wrapper":"",style:{...O,transform:z?O.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:K,"--radix-popper-transform-origin":[I.transformOrigin?.x,I.transformOrigin?.y].join(" "),...I.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:a.jsx(zg,{scope:r,placedSide:q,onArrowChange:C,arrowX:ge,arrowY:_e,shouldHideArrow:pe,children:a.jsx(W.div,{"data-side":q,"data-align":te,...f,ref:w,style:{...f.style,animation:z?void 0:"none"}})})})});Ws.displayName=Ro;var qs="PopperArrow",$g={top:"bottom",right:"left",bottom:"top",left:"right"},Gs=x.forwardRef(function(t,r){const{__scopePopper:n,...o}=t,i=Dg(qs,n),s=$g[i.placedSide];return a.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:a.jsx(Lg,{...o,ref:r,style:{...o.style,display:"block"}})})});Gs.displayName=qs;function Fg(e){return e!==null}var Bg=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:n,middlewareData:o}=t,s=o.arrow?.centerOffset!==0,l=s?0:e.arrowWidth,c=s?0:e.arrowHeight,[d,u]=Ks(r),p={start:"0%",center:"50%",end:"100%"}[u],m=(o.arrow?.x??0)+l/2,g=(o.arrow?.y??0)+c/2;let b="",f="";return d==="bottom"?(b=s?p:`${m}px`,f=`${-c}px`):d==="top"?(b=s?p:`${m}px`,f=`${n.floating.height+c}px`):d==="right"?(b=`${-c}px`,f=s?p:`${g}px`):d==="left"&&(b=`${n.floating.width+c}px`,f=s?p:`${g}px`),{data:{x:b,y:f}}}});function Ks(e){const[t,r="center"]=e.split("-");return[t,r]}var Ys=Us,Lo=Vs,Xs=Ws,Js=Gs,Ug="Portal",an=x.forwardRef((e,t)=>{const{container:r,...n}=e,[o,i]=x.useState(!1);le(()=>i(!0),[]);const s=r||o&&globalThis?.document?.body;return s?ja.createPortal(a.jsx(W.div,{...n,ref:t}),s):null});an.displayName=Ug;function Hg(e,t){return x.useReducer((r,n)=>t[r][n]??r,e)}var Ye=e=>{const{present:t,children:r}=e,n=Vg(t),o=typeof r=="function"?r({present:n.isPresent}):x.Children.only(r),i=J(n.ref,Wg(o));return typeof r=="function"||n.isPresent?x.cloneElement(o,{ref:i}):null};Ye.displayName="Presence";function Vg(e){const[t,r]=x.useState(),n=x.useRef(null),o=x.useRef(e),i=x.useRef("none"),s=e?"mounted":"unmounted",[l,c]=Hg(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const d=sn(n.current);i.current=l==="mounted"?d:"none"},[l]),le(()=>{const d=n.current,u=o.current;if(u!==e){const m=i.current,g=sn(d);e?c("MOUNT"):g==="none"||d?.display==="none"?c("UNMOUNT"):c(u&&m!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),le(()=>{if(t){let d;const u=t.ownerDocument.defaultView??window,p=g=>{const f=sn(n.current).includes(CSS.escape(g.animationName));if(g.target===t&&f&&(c("ANIMATION_END"),!o.current)){const h=t.style.animationFillMode;t.style.animationFillMode="forwards",d=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=h)})}},m=g=>{g.target===t&&(i.current=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 c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:x.useCallback(d=>{n.current=d?getComputedStyle(d):null,r(d)},[])}}function sn(e){return e?.animationName||"none"}function Wg(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 qg=x[" useInsertionEffect ".trim().toString()]||le;function mt({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[o,i,s]=Gg({defaultProp:t,onChange:r}),l=e!==void 0,c=l?e:o;{const u=x.useRef(e!==void 0);x.useEffect(()=>{const p=u.current;p!==l&&console.warn(`${n} is changing from ${p?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=l},[l,n])}const d=x.useCallback(u=>{if(l){const p=Kg(u)?u(e):u;p!==e&&s.current?.(p)}else i(u)},[l,e,i,s]);return[c,d]}function Gg({defaultProp:e,onChange:t}){const[r,n]=x.useState(e),o=x.useRef(r),i=x.useRef(t);return qg(()=>{i.current=t},[t]),x.useEffect(()=>{o.current!==r&&(i.current?.(r),o.current=r)},[r,o]),[r,n,i]}function Kg(e){return typeof e=="function"}var Yg=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Rt=new WeakMap,ln=new WeakMap,cn={},Io=0,Zs=function(e){return e&&(e.host||Zs(e.parentNode))},Xg=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=Zs(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})},Jg=function(e,t,r,n){var o=Xg(t,Array.isArray(e)?e:[e]);cn[r]||(cn[r]=new WeakMap);var i=cn[r],s=[],l=new Set,c=new Set(o),d=function(p){!p||l.has(p)||(l.add(p),d(p.parentNode))};o.forEach(d);var u=function(p){!p||c.has(p)||Array.prototype.forEach.call(p.children,function(m){if(l.has(m))u(m);else try{var g=m.getAttribute(n),b=g!==null&&g!=="false",f=(Rt.get(m)||0)+1,h=(i.get(m)||0)+1;Rt.set(m,f),i.set(m,h),s.push(m),f===1&&b&&ln.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(),Io++,function(){s.forEach(function(p){var m=Rt.get(p)-1,g=i.get(p)-1;Rt.set(p,m),i.set(p,g),m||(ln.has(p)||p.removeAttribute(n),ln.delete(p)),g||p.removeAttribute(r)}),Io--,Io||(Rt=new WeakMap,Rt=new WeakMap,ln=new WeakMap,cn={})}},Mo=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=Yg(e);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live], script"))),Jg(n,o,r,"aria-hidden")):function(){return null}},Ie=function(){return Ie=Object.assign||function(t){for(var r,n=1,o=arguments.length;n<o;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},Ie.apply(this,arguments)};function Qs(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 Zg(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,i;n<o;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var dn="right-scroll-bar-position",un="width-before-scroll-bar",Qg="with-scroll-bars-hidden",ex="--removed-body-scroll-bar-size";function zo(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function tx(e,t){var r=_.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 rx=typeof window<"u"?x.useLayoutEffect:x.useEffect,el=new WeakMap;function nx(e,t){var r=tx(null,function(n){return e.forEach(function(o){return zo(o,n)})});return rx(function(){var n=el.get(r);if(n){var o=new Set(n),i=new Set(e),s=r.current;o.forEach(function(l){i.has(l)||zo(l,null)}),i.forEach(function(l){o.has(l)||zo(l,s)})}el.set(r,e)},[e]),r}function ox(e){return e}function ax(e,t){t===void 0&&(t=ox);var r=[],n=!1,o={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(i){var s=t(i,n);return r.push(s),function(){r=r.filter(function(l){return l!==s})}},assignSyncMedium:function(i){for(n=!0;r.length;){var s=r;r=[],s.forEach(i)}r={push:function(l){return i(l)},filter:function(){return r}}},assignMedium:function(i){n=!0;var s=[];if(r.length){var l=r;r=[],l.forEach(i),s=r}var c=function(){var u=s;s=[],u.forEach(i)},d=function(){return Promise.resolve().then(c)};d(),r={push:function(u){s.push(u),d()},filter:function(u){return s=s.filter(u),r}}}};return o}function ix(e){e===void 0&&(e={});var t=ax(null);return t.options=Ie({async:!0,ssr:!1},e),t}var tl=function(e){var t=e.sideCar,r=Qs(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return x.createElement(n,Ie({},r))};tl.isSideCarExport=!0;function sx(e,t){return e.useMedium(t),tl}var rl=ix(),Do=function(){},pn=x.forwardRef(function(e,t){var r=x.useRef(null),n=x.useState({onScrollCapture:Do,onWheelCapture:Do,onTouchMoveCapture:Do}),o=n[0],i=n[1],s=e.forwardProps,l=e.children,c=e.className,d=e.removeScrollBar,u=e.enabled,p=e.shards,m=e.sideCar,g=e.noRelative,b=e.noIsolation,f=e.inert,h=e.allowPinchZoom,v=e.as,y=v===void 0?"div":v,w=e.gapMode,j=Qs(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=m,N=nx([r,t]),S=Ie(Ie({},j),o);return x.createElement(x.Fragment,null,u&&x.createElement(C,{sideCar:rl,removeScrollBar:d,shards:p,noRelative:g,noIsolation:b,inert:f,setCallbacks:i,allowPinchZoom:!!h,lockRef:r,gapMode:w}),s?x.cloneElement(x.Children.only(l),Ie(Ie({},S),{ref:N})):x.createElement(y,Ie({},S,{className:c,ref:N}),l))});pn.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},pn.classNames={fullWidth:un,zeroRight:dn};var lx=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function cx(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=lx();return t&&e.setAttribute("nonce",t),e}function dx(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function ux(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var px=function(){var e=0,t=null;return{add:function(r){e==0&&(t=cx())&&(dx(t,r),ux(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},mx=function(){var e=px();return function(t,r){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},nl=function(){var e=mx(),t=function(r){var n=r.styles,o=r.dynamic;return e(n,o),null};return t},fx={left:0,top:0,right:0,gap:0},$o=function(e){return parseInt(e||"",10)||0},hx=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[$o(r),$o(n),$o(o)]},gx=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return fx;var t=hx(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])}},xx=nl(),Lt="data-scroll-locked",bx=function(e,t,r,n){var o=e.left,i=e.top,s=e.right,l=e.gap;return r===void 0&&(r="margin"),` 359 .`.concat(Qg,` { 360 360 overflow: hidden `).concat(n,`; 361 361 padding-right: `).concat(l,"px ").concat(n,`; … … 391 391 392 392 body[`).concat(Lt,`] { 393 `).concat( Zg,": ").concat(l,`px;394 } 395 `)},ol=function(){var e=parseInt(document.body.getAttribute(Lt)||"0",10);return isFinite(e)?e:0}, xx=function(){x.useEffect(function(){return document.body.setAttribute(Lt,(ol()+1).toString()),function(){var e=ol()-1;e<=0?document.body.removeAttribute(Lt):document.body.setAttribute(Lt,e.toString())}},[])},bx=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,o=n===void 0?"margin":n;xx();var i=x.useMemo(function(){return fx(o)},[o]);return x.createElement(hx,{styles:gx(i,!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 It=Fo?{passive:!1}:!1,_x=function(e){return e.tagName==="TEXTAREA"},al=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!_x(e)&&r[t]==="visible")},vx=function(e){return al(e,"overflowY")},yx=function(e){return al(e,"overflowX")},il=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var o=sl(e,n);if(o){var i=ll(e,n),s=i[1],l=i[2];if(s>l)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},wx=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},jx=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},sl=function(e,t){return e==="v"?vx(t):yx(t)},ll=function(e,t){return e==="v"?wx(t):jx(t)},kx=function(e,t){return e==="h"&&t==="rtl"?-1:1},Sx=function(e,t,r,n,o){var i=kx(e,window.getComputedStyle(t).direction),s=i*n,l=r.target,c=t.contains(l),d=!1,u=s>0,p=0,m=0;do{if(!l)break;var g=ll(e,l),b=g[0],f=g[1],h=g[2],v=f-h-i*b;(b||v)&&sl(e,l)&&(p+=v,m+=b);var y=l.parentNode;l=y&&y.nodeType===Node.DOCUMENT_FRAGMENT_NODE?y.host:y}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(u&&Math.abs(p)<1||!u&&Math.abs(m)<1)&&(d=!0),d},fn=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},cl=function(e){return[e.deltaX,e.deltaY]},dl=function(e){return e&&"current"in e?e.current:e},Cx=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Nx=function(e){return`393 `).concat(ex,": ").concat(l,`px; 394 } 395 `)},ol=function(){var e=parseInt(document.body.getAttribute(Lt)||"0",10);return isFinite(e)?e:0},_x=function(){x.useEffect(function(){return document.body.setAttribute(Lt,(ol()+1).toString()),function(){var e=ol()-1;e<=0?document.body.removeAttribute(Lt):document.body.setAttribute(Lt,e.toString())}},[])},vx=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,o=n===void 0?"margin":n;_x();var i=x.useMemo(function(){return gx(o)},[o]);return x.createElement(xx,{styles:bx(i,!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 It=Fo?{passive:!1}:!1,yx=function(e){return e.tagName==="TEXTAREA"},al=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!yx(e)&&r[t]==="visible")},wx=function(e){return al(e,"overflowY")},jx=function(e){return al(e,"overflowX")},il=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var o=sl(e,n);if(o){var i=ll(e,n),s=i[1],l=i[2];if(s>l)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},kx=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},Sx=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},sl=function(e,t){return e==="v"?wx(t):jx(t)},ll=function(e,t){return e==="v"?kx(t):Sx(t)},Cx=function(e,t){return e==="h"&&t==="rtl"?-1:1},Nx=function(e,t,r,n,o){var i=Cx(e,window.getComputedStyle(t).direction),s=i*n,l=r.target,c=t.contains(l),d=!1,u=s>0,p=0,m=0;do{if(!l)break;var g=ll(e,l),b=g[0],f=g[1],h=g[2],v=f-h-i*b;(b||v)&&sl(e,l)&&(p+=v,m+=b);var y=l.parentNode;l=y&&y.nodeType===Node.DOCUMENT_FRAGMENT_NODE?y.host:y}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(u&&Math.abs(p)<1||!u&&Math.abs(m)<1)&&(d=!0),d},fn=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},cl=function(e){return[e.deltaX,e.deltaY]},dl=function(e){return e&&"current"in e?e.current:e},Ex=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Tx=function(e){return` 396 396 .block-interactivity-`.concat(e,` {pointer-events: none;} 397 397 .allow-interactivity-`).concat(e,` {pointer-events: all;} 398 `)}, Ex=0,Mt=[];function Tx(e){var t=x.useRef([]),r=x.useRef([0,0]),n=x.useRef(),o=x.useState(Ex++)[0],i=x.useState(nl)[0],s=x.useRef(e);x.useEffect(function(){s.current=e},[e]),x.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var f=Xg([e.lockRef.current],(e.shards||[]).map(dl),!0).filter(Boolean);return f.forEach(function(h){return h.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),f.forEach(function(h){return h.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=x.useCallback(function(f,h){if("touches"in f&&f.touches.length===2||f.type==="wheel"&&f.ctrlKey)return!s.current.allowPinchZoom;var v=fn(f),y=r.current,w="deltaX"in f?f.deltaX:y[0]-v[0],j="deltaY"in f?f.deltaY:y[1]-v[1],C,N=f.target,S=Math.abs(w)>Math.abs(j)?"h":"v";if("touches"in f&&S==="h"&&N.type==="range")return!1;var E=il(S,N);if(!E)return!0;if(E?C=S:(C=S==="v"?"h":"v",E=il(S,N)),!E)return!1;if(!n.current&&"changedTouches"in f&&(w||j)&&(n.current=C),!C)return!0;var T=n.current||C;return Sx(T,h,f,T==="h"?w:j)},[]),c=x.useCallback(function(f){var h=f;if(!(!Mt.length||Mt[Mt.length-1]!==i)){var v="deltaY"in h?cl(h):fn(h),y=t.current.filter(function(C){return C.name===h.type&&(C.target===h.target||h.target===C.shadowParent)&&Cx(C.delta,v)})[0];if(y&&y.should){h.cancelable&&h.preventDefault();return}if(!y){var w=(s.current.shards||[]).map(dl).filter(Boolean).filter(function(C){return C.contains(h.target)}),j=w.length>0?l(h,w[0]):!s.current.noIsolation;j&&h.cancelable&&h.preventDefault()}}},[]),d=x.useCallback(function(f,h,v,y){var w={name:f,delta:h,target:v,should:y,shadowParent:Ax(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=fn(f),n.current=void 0},[]),p=x.useCallback(function(f){d(f.type,cl(f),f.target,l(f,e.lockRef.current))},[]),m=x.useCallback(function(f){d(f.type,fn(f),f.target,l(f,e.lockRef.current))},[]);x.useEffect(function(){return Mt.push(i),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",c,It),document.addEventListener("touchmove",c,It),document.addEventListener("touchstart",u,It),function(){Mt=Mt.filter(function(f){return f!==i}),document.removeEventListener("wheel",c,It),document.removeEventListener("touchmove",c,It),document.removeEventListener("touchstart",u,It)}},[]);var g=e.removeScrollBar,b=e.inert;return x.createElement(x.Fragment,null,b?x.createElement(i,{styles:Nx(o)}):null,g?x.createElement(bx,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Ax(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Px=ax(rl,Tx);var hn=x.forwardRef(function(e,t){return x.createElement(pn,Ie({},e,{ref:t,sideCar:Px}))});hn.classNames=pn.classNames;var gn="Popover",[ul]=Ve(gn,[on]),ur=on(),[Ox,Xe]=ul(gn),pl=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:o,onOpenChange:i,modal:s=!1}=e,l=ur(t),c=x.useRef(null),[d,u]=x.useState(!1),[p,m]=mt({prop:n,defaultProp:o??!1,onChange:i,caller:gn});return a.jsx(Ys,{...l,children:a.jsx(Ox,{scope:t,contentId:Ae(),triggerRef:c,open:p,onOpenChange:m,onOpenToggle:x.useCallback(()=>m(g=>!g),[m]),hasCustomAnchor:d,onCustomAnchorAdd:x.useCallback(()=>u(!0),[]),onCustomAnchorRemove:x.useCallback(()=>u(!1),[]),modal:s,children:r})})};pl.displayName=gn;var ml="PopoverAnchor",Rx=x.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Xe(ml,r),i=ur(r),{onCustomAnchorAdd:s,onCustomAnchorRemove:l}=o;return x.useEffect(()=>(s(),()=>l()),[s,l]),a.jsx(Lo,{...i,...n,ref:t})});Rx.displayName=ml;var fl="PopoverTrigger",hl=x.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Xe(fl,r),i=ur(r),s=J(t,o.triggerRef),l=a.jsx(W.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":vl(o.open),...n,ref:s,onClick:H(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?l:a.jsx(Lo,{asChild:!0,...i,children:l})});hl.displayName=fl;var Bo="PopoverPortal",[Lx,Ix]=ul(Bo,{forceMount:void 0}),gl=e=>{const{__scopePopover:t,forceMount:r,children:n,container:o}=e,i=Xe(Bo,t);return a.jsx(Lx,{scope:t,forceMount:r,children:a.jsx(Ye,{present:r||i.open,children:a.jsx(an,{asChild:!0,container:o,children:n})})})};gl.displayName=Bo;var zt="PopoverContent",xl=x.forwardRef((e,t)=>{const r=Ix(zt,e.__scopePopover),{forceMount:n=r.forceMount,...o}=e,i=Xe(zt,e.__scopePopover);return a.jsx(Ye,{present:n||i.open,children:i.modal?a.jsx(zx,{...o,ref:t}):a.jsx(Dx,{...o,ref:t})})});xl.displayName=zt;var Mx=st("PopoverContent.RemoveScroll"),zx=x.forwardRef((e,t)=>{const r=Xe(zt,e.__scopePopover),n=x.useRef(null),o=J(t,n),i=x.useRef(!1);return x.useEffect(()=>{const s=n.current;if(s)return Mo(s)},[]),a.jsx(hn,{as:Mx,allowPinchZoom:!0,children:a.jsx(bl,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:H(e.onCloseAutoFocus,s=>{s.preventDefault(),i.current||r.triggerRef.current?.focus()}),onPointerDownOutside:H(e.onPointerDownOutside,s=>{const l=s.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,d=l.button===2||c;i.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:H(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),Dx=x.forwardRef((e,t)=>{const r=Xe(zt,e.__scopePopover),n=x.useRef(!1),o=x.useRef(!1);return a.jsx(bl,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(n.current||r.triggerRef.current?.focus(),i.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;r.triggerRef.current?.contains(s)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),bl=x.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:u,...p}=e,m=Xe(zt,r),g=ur(r);return bo(),a.jsx(Gr,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:i,children:a.jsx(qr,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:u,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onDismiss:()=>m.onOpenChange(!1),children:a.jsx(Xs,{"data-state":vl(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)"}})})})}),_l="PopoverClose",$x=x.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Xe(_l,r);return a.jsx(W.button,{type:"button",...n,ref:t,onClick:H(e.onClick,()=>o.onOpenChange(!1))})});$x.displayName=_l;var Fx="PopoverArrow",Bx=x.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=ur(r);return a.jsx(Js,{...o,...n,ref:t})});Bx.displayName=Fx;function vl(e){return e?"open":"closed"}var Ux=pl,Hx=hl,Vx=gl,Wx=xl;function Je({...e}){return a.jsx(Ux,{"data-slot":"popover",...e})}function Ze({...e}){return a.jsx(Hx,{"data-slot":"popover-trigger",...e})}function Qe({className:e,align:t="center",sideOffset:r=4,...n}){const o=typeof document<"u"?document.getElementById("ecommreels-admin-app")??document.body:void 0;return a.jsx(Vx,{container:o,children:a.jsx(Wx,{"data-slot":"popover-content",align:t,sideOffset:r,className:$("ecr-popover",e),...n})})}const Uo="data:image/svg+xml,%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Transformed%20by:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20fill='%23919191'%20width='800px'%20height='800px'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%20stroke='%23919191'%3e%3cg%20id='SVGRepo_bgCarrier'%20stroke-width='0'/%3e%3cg%20id='SVGRepo_tracerCarrier'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cg%20id='SVGRepo_iconCarrier'%3e%3cg%20data-name='Layer%202'%3e%3cg%20data-name='file-add'%3e%3crect%20width='24'%20height='24'%20opacity='0'/%3e%3cpath%20d='M19.74%207.33l-4.44-5a1%201%200%200%200-.74-.33h-8A2.53%202.53%200%200%200%204%204.5v15A2.53%202.53%200%200%200%206.56%2022h10.88A2.53%202.53%200%200%200%2020%2019.5V8a1%201%200%200%200-.26-.67zM14%2015h-1v1a1%201%200%200%201-2%200v-1h-1a1%201%200%200%201%200-2h1v-1a1%201%200%200%201%202%200v1h1a1%201%200%200%201%200%202zm.71-7a.79.79%200%200%201-.71-.85V4l3.74%204z'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e";var qx=Symbol.for("react.lazy"),xn=x[" use ".trim().toString()];function Gx(e){return typeof e=="object"&&e!==null&&"then"in e}function yl(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===qx&&"_payload"in e&&Gx(e._payload)}function Kx(e){const t=Yx(e),r=x.forwardRef((n,o)=>{let{children:i,...s}=n;yl(i)&&typeof xn=="function"&&(i=xn(i._payload));const l=x.Children.toArray(i),c=l.find(Jx);if(c){const d=c.props.children,u=l.map(p=>p===c?x.Children.count(d)>1?x.Children.only(null):x.isValidElement(d)?d.props.children:null:p);return a.jsx(t,{...s,ref:o,children:x.isValidElement(d)?x.cloneElement(d,void 0,u):null})}return a.jsx(t,{...s,ref:o,children:i})});return r.displayName=`${e}.Slot`,r}function Yx(e){const t=x.forwardRef((r,n)=>{let{children:o,...i}=r;if(yl(o)&&typeof xn=="function"&&(o=xn(o._payload)),x.isValidElement(o)){const s=Qx(o),l=Zx(i,o.props);return o.type!==x.Fragment&&(l.ref=n?Kn(n,s):s),x.cloneElement(o,l)}return x.Children.count(o)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Xx=Symbol("radix.slottable");function Jx(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Xx}function Zx(e,t){const r={...t};for(const n in t){const o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...l)=>{const c=i(...l);return o(...l),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}function Qx(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 e0=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],t0=e0.reduce((e,t)=>{const r=Kx(`Primitive.${t}`),n=x.forwardRef((o,i)=>{const{asChild:s,...l}=o,c=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),r0="Separator",wl="horizontal",n0=["horizontal","vertical"],jl=x.forwardRef((e,t)=>{const{decorative:r,orientation:n=wl,...o}=e,i=o0(n)?n:wl,l=r?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return a.jsx(t0.div,{"data-orientation":i,...l,...o,ref:t})});jl.displayName=r0;function o0(e){return n0.includes(e)}var a0=jl;function bn({className:e,orientation:t="horizontal",decorative:r=!0,...n}){return a.jsx(a0,{"data-slot":"separator",decorative:r,orientation:t,className:$("ecr-separator",e),...n})}const ft=({name:e,text:t})=>{const r=ecommreelsInfo.isProActive,n=ecommreelsInfo.isLicenseActive,o=ecommreelsInfo.license_page;return a.jsxs("div",{className:"ecr-admin-upgrade__modal",children:[a.jsxs("h4",{className:"ecr-admin-upgrade__title",children:[a.jsx("span",{className:"ecr-admin-upgrade__name",children:e}),a.jsx("span",{className:"ecr-admin-upgrade__tag",children:"PRO"})]}),a.jsx(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(ne,{asChild:!0,className:"ecr-admin-upgrade__button",size:"sm",children:a.jsx("a",{href:r&&!n?o:"https://reelswp.com/pricing/",style:{color:"#fff"},target:"_blank",rel:"noreferrer",className:"ecr-admin-upgrade__link",children:r&&!n?"Active":"Upgrade to Pro"})})})]})},ce=[];for(let e=0;e<256;++e)ce.push((e+256).toString(16).slice(1));function i0(e,t=0){return(ce[e[t+0]]+ce[e[t+1]]+ce[e[t+2]]+ce[e[t+3]]+"-"+ce[e[t+4]]+ce[e[t+5]]+"-"+ce[e[t+6]]+ce[e[t+7]]+"-"+ce[e[t+8]]+ce[e[t+9]]+"-"+ce[e[t+10]]+ce[e[t+11]]+ce[e[t+12]]+ce[e[t+13]]+ce[e[t+14]]+ce[e[t+15]]).toLowerCase()}let Ho;const s0=new Uint8Array(16);function l0(){if(!Ho){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Ho=crypto.getRandomValues.bind(crypto)}return Ho(s0)}const kl={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function c0(e,t,r){e=e||{};const n=e.random??e.rng?.()??l0();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,i0(n)}function _n(e,t,r){return kl.randomUUID&&!e?kl.randomUUID():c0(e)}const d0=new Set(["video/mp4"]),u0=[".mp4",".m4v"],p0=e=>(e.mime||"").toLowerCase().trim(),m0=e=>(e.url||"").toLowerCase().trim(),f0=e=>e.split("?")[0].split("#")[0],h0=e=>{const t=f0(e);return u0.some(r=>t.endsWith(r))},g0=()=>{if(typeof document>"u")return!0;const t=document.createElement("video").canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"');return t==="probably"||t==="maybe"},x0=e=>{const t=p0(e),r=m0(e),n=t&&d0.has(t),o=r&&h0(r);return!n&&!o?!1:g0()},b0=e=>{const t=[],r=[];for(const n of e)x0(n)?t.push(n):r.push(n);return{compatible:t,incompatible:r}},_0=({setUploadedFiles:e,setShowOptions:t})=>{const r=()=>{if(!window.wp?.media){G.error("Media library is not available.");return}const n=window.wp.media({title:"Select image or video files",button:{text:"Use this file"},multiple:!1,library:{type:["video"]}});n.on("select",()=>{const o=n.state().get("selection").toJSON();if(!e)return;const{incompatible:i}=b0(o);i.length>0&&G(a.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:8},children:[a.jsx(Zp,{style:{flexShrink:0},color:"oklch(66.6% 0.179 58.318)"}),i.length," video(s) may not play reliably on iOS/macOS Safari. Recommended format: MP4 (H.264/AAC)."]}));const s=o.map(l=>({url:l.url,mime_type:l.mime,file_uuid:_n(),source:"native"}));e(l=>[...l,...s]),t(!1)}),n.open()};return a.jsxs("button",{className:"ecr-admin-upload-native-video-btn",type:"button",onClick:r,children:[a.jsx(up,{})," Choose from Media"]})},v0=({setUploadedFiles:e})=>{const[t,r]=_.useState(!1);return a.jsxs("div",{className:"ecr-admin-upload",children:[a.jsx("button",{type:"button",className:"ecr-admin-upload__label",onClick:()=>r(!0),children:a.jsxs("span",{className:"ecr-admin-upload__text-icon_wrapper",children:[a.jsx("img",{className:"ecr-admin-upload__icon",src:Uo,alt:"Upload"}),a.jsx("span",{className:"ecr-admin-upload__text",children:a.jsxs("span",{className:"ecr-admin-upload__text-stack",children:[a.jsx("span",{className:"ecr-admin-upload__text-item",children:"Upload videos"}),a.jsx("span",{className:"ecr-admin-upload__text-item",children:"Click here to upload videos"})]})})]})}),t?a.jsxs("div",{className:"ecr-admin-upload-source-panel",children:[a.jsx("button",{type:"button",className:"ecr-admin-upload-source-panel__close",onClick:()=>r(!1),"aria-label":"Close upload source picker",children:a.jsx(er,{size:16})}),a.jsx("p",{className:"ecr-admin-upload-source-popover__title",children:"Add Videos"}),a.jsx("p",{className:"ecr-admin-upload-source-popover__description",children:"Upload from media library or paste Vimeo links."}),a.jsxs("div",{className:"ecr-admin-upload-source-popover__options",children:[a.jsx(_0,{setUploadedFiles:e,setShowOptions:r}),a.jsxs(Je,{children:[a.jsx(Ze,{asChild:!0,children:a.jsxs("button",{className:"ecr-admin-upload-vimeo-video-btn",type:"button",children:[a.jsx(lp,{})," Add Vimeo Videos ",a.jsx(at,{size:20})]})}),a.jsx(Qe,{className:"ecr-admin-links__popover",children:a.jsx(ft,{name:"Vimeo Videos",text:a.jsx(a.Fragment,{children:"To embed Vimeo videos directly into your reels, giving your content a professional, seamless, and engaging playback experience for your audience."})})})]})]})]}):null]})};var vn="Dialog",[Sl]=Ve(vn),[y0,Se]=Sl(vn),Cl=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:o,onOpenChange:i,modal:s=!0}=e,l=x.useRef(null),c=x.useRef(null),[d,u]=mt({prop:n,defaultProp:o??!1,onChange:i,caller:vn});return a.jsx(y0,{scope:t,triggerRef:l,contentRef:c,contentId:Ae(),titleId:Ae(),descriptionId:Ae(),open:d,onOpenChange:u,onOpenToggle:x.useCallback(()=>u(p=>!p),[u]),modal:s,children:r})};Cl.displayName=vn;var Nl="DialogTrigger",El=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=Se(Nl,r),i=J(t,o.triggerRef);return a.jsx(W.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":qo(o.open),...n,ref:i,onClick:H(e.onClick,o.onOpenToggle)})});El.displayName=Nl;var Vo="DialogPortal",[w0,Tl]=Sl(Vo,{forceMount:void 0}),Al=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:o}=e,i=Se(Vo,t);return a.jsx(w0,{scope:t,forceMount:r,children:x.Children.map(n,s=>a.jsx(Ye,{present:r||i.open,children:a.jsx(an,{asChild:!0,container:o,children:s})}))})};Al.displayName=Vo;var yn="DialogOverlay",Pl=x.forwardRef((e,t)=>{const r=Tl(yn,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,i=Se(yn,e.__scopeDialog);return i.modal?a.jsx(Ye,{present:n||i.open,children:a.jsx(k0,{...o,ref:t})}):null});Pl.displayName=yn;var j0=st("DialogOverlay.RemoveScroll"),k0=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=Se(yn,r);return a.jsx(hn,{as:j0,allowPinchZoom:!0,shards:[o.contentRef],children:a.jsx(W.div,{"data-state":qo(o.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),ht="DialogContent",Ol=x.forwardRef((e,t)=>{const r=Tl(ht,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,i=Se(ht,e.__scopeDialog);return a.jsx(Ye,{present:n||i.open,children:i.modal?a.jsx(S0,{...o,ref:t}):a.jsx(C0,{...o,ref:t})})});Ol.displayName=ht;var S0=x.forwardRef((e,t)=>{const r=Se(ht,e.__scopeDialog),n=x.useRef(null),o=J(t,r.contentRef,n);return x.useEffect(()=>{const i=n.current;if(i)return Mo(i)},[]),a.jsx(Rl,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:H(e.onCloseAutoFocus,i=>{i.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:H(e.onPointerDownOutside,i=>{const s=i.detail.originalEvent,l=s.button===0&&s.ctrlKey===!0;(s.button===2||l)&&i.preventDefault()}),onFocusOutside:H(e.onFocusOutside,i=>i.preventDefault())})}),C0=x.forwardRef((e,t)=>{const r=Se(ht,e.__scopeDialog),n=x.useRef(!1),o=x.useRef(!1);return a.jsx(Rl,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(n.current||r.triggerRef.current?.focus(),i.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;r.triggerRef.current?.contains(s)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),Rl=x.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:i,...s}=e,l=Se(ht,r),c=x.useRef(null),d=J(t,c);return bo(),a.jsxs(a.Fragment,{children:[a.jsx(Gr,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:i,children:a.jsx(qr,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":qo(l.open),...s,ref:d,onDismiss:()=>l.onOpenChange(!1)})}),a.jsxs(a.Fragment,{children:[a.jsx(E0,{titleId:l.titleId}),a.jsx(A0,{contentRef:c,descriptionId:l.descriptionId})]})]})}),Wo="DialogTitle",Ll=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=Se(Wo,r);return a.jsx(W.h2,{id:o.titleId,...n,ref:t})});Ll.displayName=Wo;var Il="DialogDescription",N0=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=Se(Il,r);return a.jsx(W.p,{id:o.descriptionId,...n,ref:t})});N0.displayName=Il;var Ml="DialogClose",zl=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=Se(Ml,r);return a.jsx(W.button,{type:"button",...n,ref:t,onClick:H(e.onClick,()=>o.onOpenChange(!1))})});zl.displayName=Ml;function qo(e){return e?"open":"closed"}var Dl="DialogTitleWarning",[M1,$l]=eh(Dl,{contentName:ht,titleName:Wo,docsSlug:"dialog"}),E0=({titleId:e})=>{const t=$l(Dl),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.398 `)},Ax=0,Mt=[];function Px(e){var t=x.useRef([]),r=x.useRef([0,0]),n=x.useRef(),o=x.useState(Ax++)[0],i=x.useState(nl)[0],s=x.useRef(e);x.useEffect(function(){s.current=e},[e]),x.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var f=Zg([e.lockRef.current],(e.shards||[]).map(dl),!0).filter(Boolean);return f.forEach(function(h){return h.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),f.forEach(function(h){return h.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=x.useCallback(function(f,h){if("touches"in f&&f.touches.length===2||f.type==="wheel"&&f.ctrlKey)return!s.current.allowPinchZoom;var v=fn(f),y=r.current,w="deltaX"in f?f.deltaX:y[0]-v[0],j="deltaY"in f?f.deltaY:y[1]-v[1],C,N=f.target,S=Math.abs(w)>Math.abs(j)?"h":"v";if("touches"in f&&S==="h"&&N.type==="range")return!1;var E=il(S,N);if(!E)return!0;if(E?C=S:(C=S==="v"?"h":"v",E=il(S,N)),!E)return!1;if(!n.current&&"changedTouches"in f&&(w||j)&&(n.current=C),!C)return!0;var T=n.current||C;return Nx(T,h,f,T==="h"?w:j)},[]),c=x.useCallback(function(f){var h=f;if(!(!Mt.length||Mt[Mt.length-1]!==i)){var v="deltaY"in h?cl(h):fn(h),y=t.current.filter(function(C){return C.name===h.type&&(C.target===h.target||h.target===C.shadowParent)&&Ex(C.delta,v)})[0];if(y&&y.should){h.cancelable&&h.preventDefault();return}if(!y){var w=(s.current.shards||[]).map(dl).filter(Boolean).filter(function(C){return C.contains(h.target)}),j=w.length>0?l(h,w[0]):!s.current.noIsolation;j&&h.cancelable&&h.preventDefault()}}},[]),d=x.useCallback(function(f,h,v,y){var w={name:f,delta:h,target:v,should:y,shadowParent:Ox(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=fn(f),n.current=void 0},[]),p=x.useCallback(function(f){d(f.type,cl(f),f.target,l(f,e.lockRef.current))},[]),m=x.useCallback(function(f){d(f.type,fn(f),f.target,l(f,e.lockRef.current))},[]);x.useEffect(function(){return Mt.push(i),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",c,It),document.addEventListener("touchmove",c,It),document.addEventListener("touchstart",u,It),function(){Mt=Mt.filter(function(f){return f!==i}),document.removeEventListener("wheel",c,It),document.removeEventListener("touchmove",c,It),document.removeEventListener("touchstart",u,It)}},[]);var g=e.removeScrollBar,b=e.inert;return x.createElement(x.Fragment,null,b?x.createElement(i,{styles:Tx(o)}):null,g?x.createElement(vx,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Ox(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Rx=sx(rl,Px);var hn=x.forwardRef(function(e,t){return x.createElement(pn,Ie({},e,{ref:t,sideCar:Rx}))});hn.classNames=pn.classNames;var gn="Popover",[ul]=Ve(gn,[on]),ur=on(),[Lx,Xe]=ul(gn),pl=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:o,onOpenChange:i,modal:s=!1}=e,l=ur(t),c=x.useRef(null),[d,u]=x.useState(!1),[p,m]=mt({prop:n,defaultProp:o??!1,onChange:i,caller:gn});return a.jsx(Ys,{...l,children:a.jsx(Lx,{scope:t,contentId:Ae(),triggerRef:c,open:p,onOpenChange:m,onOpenToggle:x.useCallback(()=>m(g=>!g),[m]),hasCustomAnchor:d,onCustomAnchorAdd:x.useCallback(()=>u(!0),[]),onCustomAnchorRemove:x.useCallback(()=>u(!1),[]),modal:s,children:r})})};pl.displayName=gn;var ml="PopoverAnchor",Ix=x.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Xe(ml,r),i=ur(r),{onCustomAnchorAdd:s,onCustomAnchorRemove:l}=o;return x.useEffect(()=>(s(),()=>l()),[s,l]),a.jsx(Lo,{...i,...n,ref:t})});Ix.displayName=ml;var fl="PopoverTrigger",hl=x.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Xe(fl,r),i=ur(r),s=J(t,o.triggerRef),l=a.jsx(W.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":vl(o.open),...n,ref:s,onClick:H(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?l:a.jsx(Lo,{asChild:!0,...i,children:l})});hl.displayName=fl;var Bo="PopoverPortal",[Mx,zx]=ul(Bo,{forceMount:void 0}),gl=e=>{const{__scopePopover:t,forceMount:r,children:n,container:o}=e,i=Xe(Bo,t);return a.jsx(Mx,{scope:t,forceMount:r,children:a.jsx(Ye,{present:r||i.open,children:a.jsx(an,{asChild:!0,container:o,children:n})})})};gl.displayName=Bo;var zt="PopoverContent",xl=x.forwardRef((e,t)=>{const r=zx(zt,e.__scopePopover),{forceMount:n=r.forceMount,...o}=e,i=Xe(zt,e.__scopePopover);return a.jsx(Ye,{present:n||i.open,children:i.modal?a.jsx($x,{...o,ref:t}):a.jsx(Fx,{...o,ref:t})})});xl.displayName=zt;var Dx=st("PopoverContent.RemoveScroll"),$x=x.forwardRef((e,t)=>{const r=Xe(zt,e.__scopePopover),n=x.useRef(null),o=J(t,n),i=x.useRef(!1);return x.useEffect(()=>{const s=n.current;if(s)return Mo(s)},[]),a.jsx(hn,{as:Dx,allowPinchZoom:!0,children:a.jsx(bl,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:H(e.onCloseAutoFocus,s=>{s.preventDefault(),i.current||r.triggerRef.current?.focus()}),onPointerDownOutside:H(e.onPointerDownOutside,s=>{const l=s.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,d=l.button===2||c;i.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:H(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),Fx=x.forwardRef((e,t)=>{const r=Xe(zt,e.__scopePopover),n=x.useRef(!1),o=x.useRef(!1);return a.jsx(bl,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(n.current||r.triggerRef.current?.focus(),i.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;r.triggerRef.current?.contains(s)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),bl=x.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:u,...p}=e,m=Xe(zt,r),g=ur(r);return bo(),a.jsx(Gr,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:i,children:a.jsx(qr,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:u,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onDismiss:()=>m.onOpenChange(!1),children:a.jsx(Xs,{"data-state":vl(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)"}})})})}),_l="PopoverClose",Bx=x.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Xe(_l,r);return a.jsx(W.button,{type:"button",...n,ref:t,onClick:H(e.onClick,()=>o.onOpenChange(!1))})});Bx.displayName=_l;var Ux="PopoverArrow",Hx=x.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=ur(r);return a.jsx(Js,{...o,...n,ref:t})});Hx.displayName=Ux;function vl(e){return e?"open":"closed"}var Vx=pl,Wx=hl,qx=gl,Gx=xl;function Je({...e}){return a.jsx(Vx,{"data-slot":"popover",...e})}function Ze({...e}){return a.jsx(Wx,{"data-slot":"popover-trigger",...e})}function Qe({className:e,align:t="center",sideOffset:r=4,...n}){const o=typeof document<"u"?document.getElementById("ecommreels-admin-app")??document.body:void 0;return a.jsx(qx,{container:o,children:a.jsx(Gx,{"data-slot":"popover-content",align:t,sideOffset:r,className:$("ecr-popover",e),...n})})}const Uo="data:image/svg+xml,%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Transformed%20by:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20fill='%23919191'%20width='800px'%20height='800px'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%20stroke='%23919191'%3e%3cg%20id='SVGRepo_bgCarrier'%20stroke-width='0'/%3e%3cg%20id='SVGRepo_tracerCarrier'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cg%20id='SVGRepo_iconCarrier'%3e%3cg%20data-name='Layer%202'%3e%3cg%20data-name='file-add'%3e%3crect%20width='24'%20height='24'%20opacity='0'/%3e%3cpath%20d='M19.74%207.33l-4.44-5a1%201%200%200%200-.74-.33h-8A2.53%202.53%200%200%200%204%204.5v15A2.53%202.53%200%200%200%206.56%2022h10.88A2.53%202.53%200%200%200%2020%2019.5V8a1%201%200%200%200-.26-.67zM14%2015h-1v1a1%201%200%200%201-2%200v-1h-1a1%201%200%200%201%200-2h1v-1a1%201%200%200%201%202%200v1h1a1%201%200%200%201%200%202zm.71-7a.79.79%200%200%201-.71-.85V4l3.74%204z'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e";var Kx=Symbol.for("react.lazy"),xn=x[" use ".trim().toString()];function Yx(e){return typeof e=="object"&&e!==null&&"then"in e}function yl(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Kx&&"_payload"in e&&Yx(e._payload)}function Xx(e){const t=Jx(e),r=x.forwardRef((n,o)=>{let{children:i,...s}=n;yl(i)&&typeof xn=="function"&&(i=xn(i._payload));const l=x.Children.toArray(i),c=l.find(Qx);if(c){const d=c.props.children,u=l.map(p=>p===c?x.Children.count(d)>1?x.Children.only(null):x.isValidElement(d)?d.props.children:null:p);return a.jsx(t,{...s,ref:o,children:x.isValidElement(d)?x.cloneElement(d,void 0,u):null})}return a.jsx(t,{...s,ref:o,children:i})});return r.displayName=`${e}.Slot`,r}function Jx(e){const t=x.forwardRef((r,n)=>{let{children:o,...i}=r;if(yl(o)&&typeof xn=="function"&&(o=xn(o._payload)),x.isValidElement(o)){const s=t0(o),l=e0(i,o.props);return o.type!==x.Fragment&&(l.ref=n?Kn(n,s):s),x.cloneElement(o,l)}return x.Children.count(o)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Zx=Symbol("radix.slottable");function Qx(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Zx}function e0(e,t){const r={...t};for(const n in t){const o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...l)=>{const c=i(...l);return o(...l),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}function t0(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 r0=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],n0=r0.reduce((e,t)=>{const r=Xx(`Primitive.${t}`),n=x.forwardRef((o,i)=>{const{asChild:s,...l}=o,c=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),o0="Separator",wl="horizontal",a0=["horizontal","vertical"],jl=x.forwardRef((e,t)=>{const{decorative:r,orientation:n=wl,...o}=e,i=i0(n)?n:wl,l=r?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return a.jsx(n0.div,{"data-orientation":i,...l,...o,ref:t})});jl.displayName=o0;function i0(e){return a0.includes(e)}var s0=jl;function bn({className:e,orientation:t="horizontal",decorative:r=!0,...n}){return a.jsx(s0,{"data-slot":"separator",decorative:r,orientation:t,className:$("ecr-separator",e),...n})}const ft=({name:e,text:t})=>{const r=ecommreelsInfo.isProActive,n=ecommreelsInfo.isLicenseActive,o=ecommreelsInfo.license_page;return a.jsxs("div",{className:"ecr-admin-upgrade__modal",children:[a.jsxs("h4",{className:"ecr-admin-upgrade__title",children:[a.jsx("span",{className:"ecr-admin-upgrade__name",children:e}),a.jsx("span",{className:"ecr-admin-upgrade__tag",children:"PRO"})]}),a.jsx(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(ne,{asChild:!0,className:"ecr-admin-upgrade__button",size:"sm",children:a.jsx("a",{href:r&&!n?o:"https://reelswp.com/pricing/",style:{color:"#fff"},target:"_blank",rel:"noreferrer",className:"ecr-admin-upgrade__link",children:r&&!n?"Active":"Upgrade to Pro"})})})]})},ce=[];for(let e=0;e<256;++e)ce.push((e+256).toString(16).slice(1));function l0(e,t=0){return(ce[e[t+0]]+ce[e[t+1]]+ce[e[t+2]]+ce[e[t+3]]+"-"+ce[e[t+4]]+ce[e[t+5]]+"-"+ce[e[t+6]]+ce[e[t+7]]+"-"+ce[e[t+8]]+ce[e[t+9]]+"-"+ce[e[t+10]]+ce[e[t+11]]+ce[e[t+12]]+ce[e[t+13]]+ce[e[t+14]]+ce[e[t+15]]).toLowerCase()}let Ho;const c0=new Uint8Array(16);function d0(){if(!Ho){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Ho=crypto.getRandomValues.bind(crypto)}return Ho(c0)}const kl={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function u0(e,t,r){e=e||{};const n=e.random??e.rng?.()??d0();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,l0(n)}function _n(e,t,r){return kl.randomUUID&&!e?kl.randomUUID():u0(e)}const p0=new Set(["video/mp4"]),m0=[".mp4",".m4v"],f0=e=>(e.mime||"").toLowerCase().trim(),h0=e=>(e.url||"").toLowerCase().trim(),g0=e=>e.split("?")[0].split("#")[0],x0=e=>{const t=g0(e);return m0.some(r=>t.endsWith(r))},b0=()=>{if(typeof document>"u")return!0;const t=document.createElement("video").canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"');return t==="probably"||t==="maybe"},_0=e=>{const t=f0(e),r=h0(e),n=t&&p0.has(t),o=r&&x0(r);return!n&&!o?!1:b0()},v0=e=>{const t=[],r=[];for(const n of e)_0(n)?t.push(n):r.push(n);return{compatible:t,incompatible:r}},y0=({setUploadedFiles:e,setShowOptions:t})=>{const r=()=>{if(!window.wp?.media){G.error("Media library is not available.");return}const n=window.wp.media({title:"Select image or video files",button:{text:"Use this file"},multiple:!1,library:{type:["video"]}});n.on("select",()=>{const o=n.state().get("selection").toJSON();if(!e)return;const{incompatible:i}=v0(o);i.length>0&&G(a.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:8},children:[a.jsx(em,{style:{flexShrink:0},color:"oklch(66.6% 0.179 58.318)"}),i.length," video(s) may not play reliably on iOS/macOS Safari. Recommended format: MP4 (H.264/AAC)."]}));const s=o.map(l=>({url:l.url,mime_type:l.mime,file_uuid:_n(),source:"native"}));e(l=>[...l,...s]),t(!1)}),n.open()};return a.jsxs("button",{className:"ecr-admin-upload-native-video-btn",type:"button",onClick:r,children:[a.jsx(mp,{})," Choose from Media"]})},w0=({setUploadedFiles:e})=>{const[t,r]=_.useState(!1);return a.jsxs("div",{className:"ecr-admin-upload",children:[a.jsx("button",{type:"button",className:"ecr-admin-upload__label",onClick:()=>r(!0),children:a.jsxs("span",{className:"ecr-admin-upload__text-icon_wrapper",children:[a.jsx("img",{className:"ecr-admin-upload__icon",src:Uo,alt:"Upload"}),a.jsx("span",{className:"ecr-admin-upload__text",children:a.jsxs("span",{className:"ecr-admin-upload__text-stack",children:[a.jsx("span",{className:"ecr-admin-upload__text-item",children:"Upload videos"}),a.jsx("span",{className:"ecr-admin-upload__text-item",children:"Click here to upload videos"})]})})]})}),t?a.jsxs("div",{className:"ecr-admin-upload-source-panel",children:[a.jsx("button",{type:"button",className:"ecr-admin-upload-source-panel__close",onClick:()=>r(!1),"aria-label":"Close upload source picker",children:a.jsx(er,{size:16})}),a.jsx("p",{className:"ecr-admin-upload-source-popover__title",children:"Add Videos"}),a.jsx("p",{className:"ecr-admin-upload-source-popover__description",children:"Upload from media library or paste Vimeo links."}),a.jsxs("div",{className:"ecr-admin-upload-source-popover__options",children:[a.jsx(y0,{setUploadedFiles:e,setShowOptions:r}),a.jsxs(Je,{children:[a.jsx(Ze,{asChild:!0,children:a.jsxs("button",{className:"ecr-admin-upload-vimeo-video-btn",type:"button",children:[a.jsx(dp,{})," Add Vimeo Videos ",a.jsx(at,{size:20})]})}),a.jsx(Qe,{className:"ecr-admin-links__popover",children:a.jsx(ft,{name:"Vimeo Videos",text:a.jsx(a.Fragment,{children:"To embed Vimeo videos directly into your reels, giving your content a professional, seamless, and engaging playback experience for your audience."})})})]})]})]}):null]})};var vn="Dialog",[Sl]=Ve(vn),[j0,Se]=Sl(vn),Cl=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:o,onOpenChange:i,modal:s=!0}=e,l=x.useRef(null),c=x.useRef(null),[d,u]=mt({prop:n,defaultProp:o??!1,onChange:i,caller:vn});return a.jsx(j0,{scope:t,triggerRef:l,contentRef:c,contentId:Ae(),titleId:Ae(),descriptionId:Ae(),open:d,onOpenChange:u,onOpenToggle:x.useCallback(()=>u(p=>!p),[u]),modal:s,children:r})};Cl.displayName=vn;var Nl="DialogTrigger",El=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=Se(Nl,r),i=J(t,o.triggerRef);return a.jsx(W.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":qo(o.open),...n,ref:i,onClick:H(e.onClick,o.onOpenToggle)})});El.displayName=Nl;var Vo="DialogPortal",[k0,Tl]=Sl(Vo,{forceMount:void 0}),Al=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:o}=e,i=Se(Vo,t);return a.jsx(k0,{scope:t,forceMount:r,children:x.Children.map(n,s=>a.jsx(Ye,{present:r||i.open,children:a.jsx(an,{asChild:!0,container:o,children:s})}))})};Al.displayName=Vo;var yn="DialogOverlay",Pl=x.forwardRef((e,t)=>{const r=Tl(yn,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,i=Se(yn,e.__scopeDialog);return i.modal?a.jsx(Ye,{present:n||i.open,children:a.jsx(C0,{...o,ref:t})}):null});Pl.displayName=yn;var S0=st("DialogOverlay.RemoveScroll"),C0=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=Se(yn,r);return a.jsx(hn,{as:S0,allowPinchZoom:!0,shards:[o.contentRef],children:a.jsx(W.div,{"data-state":qo(o.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),ht="DialogContent",Ol=x.forwardRef((e,t)=>{const r=Tl(ht,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,i=Se(ht,e.__scopeDialog);return a.jsx(Ye,{present:n||i.open,children:i.modal?a.jsx(N0,{...o,ref:t}):a.jsx(E0,{...o,ref:t})})});Ol.displayName=ht;var N0=x.forwardRef((e,t)=>{const r=Se(ht,e.__scopeDialog),n=x.useRef(null),o=J(t,r.contentRef,n);return x.useEffect(()=>{const i=n.current;if(i)return Mo(i)},[]),a.jsx(Rl,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:H(e.onCloseAutoFocus,i=>{i.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:H(e.onPointerDownOutside,i=>{const s=i.detail.originalEvent,l=s.button===0&&s.ctrlKey===!0;(s.button===2||l)&&i.preventDefault()}),onFocusOutside:H(e.onFocusOutside,i=>i.preventDefault())})}),E0=x.forwardRef((e,t)=>{const r=Se(ht,e.__scopeDialog),n=x.useRef(!1),o=x.useRef(!1);return a.jsx(Rl,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(n.current||r.triggerRef.current?.focus(),i.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;r.triggerRef.current?.contains(s)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),Rl=x.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:i,...s}=e,l=Se(ht,r),c=x.useRef(null),d=J(t,c);return bo(),a.jsxs(a.Fragment,{children:[a.jsx(Gr,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:i,children:a.jsx(qr,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":qo(l.open),...s,ref:d,onDismiss:()=>l.onOpenChange(!1)})}),a.jsxs(a.Fragment,{children:[a.jsx(A0,{titleId:l.titleId}),a.jsx(O0,{contentRef:c,descriptionId:l.descriptionId})]})]})}),Wo="DialogTitle",Ll=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=Se(Wo,r);return a.jsx(W.h2,{id:o.titleId,...n,ref:t})});Ll.displayName=Wo;var Il="DialogDescription",T0=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=Se(Il,r);return a.jsx(W.p,{id:o.descriptionId,...n,ref:t})});T0.displayName=Il;var Ml="DialogClose",zl=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=Se(Ml,r);return a.jsx(W.button,{type:"button",...n,ref:t,onClick:H(e.onClick,()=>o.onOpenChange(!1))})});zl.displayName=Ml;function qo(e){return e?"open":"closed"}var Dl="DialogTitleWarning",[M1,$l]=rh(Dl,{contentName:ht,titleName:Wo,docsSlug:"dialog"}),A0=({titleId:e})=>{const t=$l(Dl),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. 399 399 400 400 If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. 401 401 402 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}, T0="DialogDescriptionWarning",A0=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${$l(T0).contentName}}.`;return x.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},P0=Cl,O0=El,R0=Al,L0=Pl,I0=Ol,M0=Ll,Fl=zl;function Go({...e}){return a.jsx(P0,{"data-slot":"dialog",...e})}function Ko({...e}){return a.jsx(O0,{"data-slot":"dialog-trigger",...e})}function z0({...e}){const t=typeof document<"u"?document.getElementById("ecommreels-admin-app")??document.body:void 0;return a.jsx(R0,{"data-slot":"dialog-portal",container:t,...e})}function D0({className:e,...t}){return a.jsx(L0,{"data-slot":"dialog-overlay",className:$("ecr-dialog__overlay",e),...t})}function Yo({className:e,children:t,...r}){return a.jsxs(z0,{children:[a.jsx(D0,{}),a.jsxs(I0,{"data-slot":"dialog-content",className:$("ecr-dialog__content",e),...r,children:[t,a.jsx(Fl,{className:"ecr-dialog__close","aria-label":"Close dialog",children:a.jsx(er,{className:"ecr-dialog__close-icon"})})]})]})}function Xo({className:e,...t}){return a.jsx("div",{className:$("ecr-dialog__header",e),...t})}function Jo({className:e,...t}){return a.jsx(M0,{"data-slot":"dialog-title",className:$("ecr-dialog__title",e),...t})}function $0({...e}){return a.jsx(Fl,{"data-slot":"dialog-close",...e})}const F0=(e={})=>{const{enabled:t=!0}=e,r=typeof ecommreelsInfo<"u"?ecommreelsInfo?.url:"",n=typeof ecommreelsInfo<"u"?ecommreelsInfo?.nonce:"",[o,i]=_.useState([]),[s,l]=_.useState(1),[c,d]=_.useState(!0),[u,p]=_.useState(!1),[m,g]=_.useState(!1),[b,f]=_.useState(""),h=fo(b,500),v=_.useRef(!0),y=_.useRef(0),w=_.useRef(null),[j,C]=_.useState(null),N=_.useCallback(async T=>{if(!r||!n){C("Missing API configuration."),g(!1),p(!1);return}const A=++y.current;w.current&&w.current.abort();const R=new AbortController;w.current=R,T===1&&v.current?g(!0):p(!0);try{const L={page:T,per_page:50};h&&(L.search=h);const B=await re.get(`${r}wc/v3/products`,{headers:{"X-WP-Nonce":n},withCredentials:!0,params:L,signal:R.signal}),M=B.data,O=parseInt(B.headers["x-wp-totalpages"]||"1",10);A===y.current&&(i(P=>T===1?M:[...P,...M]),l(T+1),d(T<O))}catch(L){if(R.signal.aborted)return;L instanceof Error?C(L.message):C("An unknown error occurred")}finally{v.current&&(v.current=!1),A===y.current&&!R.signal.aborted&&(p(!1),g(!1))}},[h,n,r]);_.useEffect(()=>{t&&(l(1),i([]),C(null),v.current=!0,N(1))},[h,N,t]);const S=_.useRef(null),E=_.useCallback(T=>{u||(S.current&&S.current.disconnect(),S.current=new IntersectionObserver(A=>{A[0].isIntersecting&&c&&N(s)}),T&&S.current.observe(T))},[u,c,s,N]);return _.useEffect(()=>()=>{S.current&&S.current.disconnect(),w.current&&w.current.abort()},[]),{products:o,setProducts:i,searchTerm:b,setSearchTerm:f,isSearching:u,isLoading:m,error:j,lastProductElementRef:E}},wn="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",Bl=({name:e,handleClick:t})=>a.jsx("button",{onClick:t,className:$("ecr-button ecr-button--sm",e==="add"?"ecr-button--primary":"ecr-button--danger"),children:e}),B0=({handleLinks:e,taggedProducts:t,products:r,isSearching:n,isLoading:o,lastProductElementRef:i,searchTerm:s,setSearchTerm:l,error:c})=>{const[d,u]=_.useState(t.map(f=>f.product_id)),[p,m]=_.useState(!1),g=f=>{m(!1),u(h=>h.includes(f.id)?h.filter(v=>v!==f.id):[f.id])},b=f=>{if(f.preventDefault(),d.length===0){m(!0);return}const h=new Set(d),v=[];for(const y of r)h.has(y.id)&&v.push({btn_type:"product",btn_uuid:_n(),buttonText:y.name,buttonUrl:y.permalink,rating:y.average_rating,price:y.price_html,thumbnail:y.images?.[0]?.thumbnail||y.images?.[0]?.src||wn,product_id:y.id});e(v),u([])};return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"ecr-admin-product-link__search",children:a.jsx("input",{type:"text",placeholder:"Search products...",value:s,onChange:f=>l(f.target.value),className:"ecr-admin-product-link__search-input"})}),a.jsx("div",{className:"scrollbarThin ecr-admin-product-link__list",children:o&&r.length===0?a.jsx(Ul,{}):a.jsxs("div",{className:"ecr-admin-product-link__list-inner",children:[r.length===0?a.jsx("p",{className:"ecr-admin-product-link__empty",children:c||"No products are available to add."}):r.map((f,h)=>{const v=d.includes(f.id);return a.jsx("div",{ref:r.length===h+1?i:null,className:"ecr-admin-product-link__item",style:d.length>0&&!v?{opacity:.5,pointerEvents:"none"}:{},children:a.jsxs(ne,{type:"button",onClick:()=>g(f),className:$("ecr-admin-product-link__button",v?"ecr-admin-product-link__button--selected":"ecr-admin-product-link__button--unselected"),children:[v?a.jsx(Gp,{size:20,color:"#2563eb"}):a.jsx(Kp,{size:20,color:"#8c95a9"}),a.jsx("img",{className:"ecr-admin-product-link__thumb",src:f.images?.[0]?.thumbnail||f.images?.[0]?.src||wn,alt:"Product thumbnail"}),a.jsx("span",{children:f.name||`Product #${f.id}`})]})},f.id)}),n&&r.length>0&&a.jsx(Ul,{})]})}),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(Bl,{name:"add",handleClick:b})})]})]})},Ul=()=>a.jsx("div",{className:"ecr-admin-product-link__loader",children:a.jsx("div",{className:"ecr-admin-product-link__spinner"})}),U0=/^(https?|ftp):\/\/[^\s/$.?#].[^\s]*$/i,H0=({handleLinks:e})=>{const[t,r]=_.useState(""),[n,o]=_.useState(""),[i,s]=_.useState(""),[l,c]=_.useState(!0),[d,u]=_.useState(""),[p,m]=_.useState([]),g=()=>{const b=[];t||b.push("text"),n&&U0.test(n)||b.push("url"),i||b.push("campaign"),m(b),!(b.length>0)&&e({btn_type:"custom",btn_uuid:_n(),buttonText:t,buttonUrl:n,openInNewTab:l,campaignName:i,customClass:d,clickCount:0})};return a.jsxs(a.Fragment,{children:[a.jsxs("div",{children:[a.jsx(jn,{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(jn,{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(jn,{error:p.includes("campaign"),type:"text",name:"campaignName",label:"Campaign Name",placeholder:"e.g Summer sale",value:i,setValue:s}),p.includes("campaign")&&a.jsx("p",{className:"ecr-admin-link__error",children:"Campaign name is required!"})]}),a.jsxs("div",{className:"ecr-admin-link__toggle",children:[a.jsx("input",{checked:l,onChange:b=>c(b.target.checked),className:"ecr-admin-link__checkbox",type:"checkbox",name:"",id:"newTab"}),a.jsx("label",{className:"ecr-admin-link__toggle-label",htmlFor:"newTab",children:"Open in new tab"})]}),a.jsx("div",{children:a.jsx(jn,{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(Bl,{name:"add",handleClick:g})})]})};function jn({error:e,type:t,name:r,label:n,placeholder:o,value:i,setValue:s}){return a.jsxs(a.Fragment,{children:[a.jsx("label",{className:"ecr-admin-link__label",htmlFor:r,children:n}),a.jsx("input",{id:r,name:r,type:t,placeholder:o,value:i,onChange:l=>s(l.target.value),className:$("ecr-admin-link__input",e?"ecr-admin-link__input--error":"ecr-admin-link__input--normal")})]})}const V0=({setLinks:e,linkCount:t,linkType:r,links:n})=>{const[o,i]=_.useState(null),[s,l]=_.useState(!1),c=F0({enabled:s}),d=t===0||r==="Link",u=t===0||r==="Product",p=n.filter(g=>g.btn_type==="product"),m=()=>l(!0);return a.jsxs(a.Fragment,{children:[t?a.jsx(bn,{}):null,a.jsx("div",{className:"ecr-admin-link-tabs",children:a.jsxs("div",{className:"ecr-admin-link-tabs__list",children:[d&&a.jsxs(Go,{open:o==="custom",onOpenChange:g=>i(g?"custom":null),children:[a.jsxs(Ko,{className:"ecr-admin-link-tabs__trigger",children:[a.jsx(Up,{size:20})," Add Custom Link"]}),a.jsxs(Yo,{className:"ecr-admin-link-dialog",children:[a.jsx(Xo,{children:a.jsx(Jo,{children:"Add Custom Link"})}),a.jsx("div",{className:"ecr-admin-link-tabs__content",children:a.jsx(H0,{handleLinks:g=>{e(b=>[...b,g]),i(null)}})})]})]}),u&&a.jsxs(Go,{open:o==="product",onOpenChange:g=>i(g?"product":null),children:[a.jsxs(Ko,{className:"ecr-admin-link-tabs__trigger",onMouseEnter:m,children:[a.jsx(Xp,{size:20})," Tag Products"]}),a.jsxs(Yo,{className:"ecr-admin-link-dialog",children:[a.jsx(Xo,{children:a.jsx(Jo,{children:"Select Products"})}),a.jsx("div",{className:"ecr-admin-link-tabs__content",children:a.jsx(B0,{handleLinks:g=>{e(g),i(null)},taggedProducts:p,products:c.products,isSearching:c.isSearching,isLoading:c.isLoading,lastProductElementRef:c.lastProductElementRef,searchTerm:c.searchTerm,setSearchTerm:c.setSearchTerm,error:c.error})})]})]})]})})]})},W0=({links:e,onLinksChange:t})=>{const r=o=>{t(i=>i.filter(s=>s.btn_uuid!==o))},n=e[0]?.btn_type==="product"?"Product":"Link";return a.jsxs("div",{className:"ecr-admin-links",children:[a.jsx("p",{className:"ecr-admin-links__title",children:`${n}${e.length>1?"s":""}`}),e.length>0?a.jsxs(a.Fragment,{children:[e.map(o=>a.jsxs("div",{className:`ecr-admin-links__item ${o.btn_type==="custom"?o.customClass??"":""}`,children:[a.jsx("span",{children:o.buttonText}),a.jsx(ne,{onClick:()=>r(o.btn_uuid),size:"icon-sm",variant:"link",className:"ecr-admin-links__remove",children:a.jsx(Jp,{size:16})})]},o.btn_uuid)),a.jsxs(Je,{children:[a.jsxs(Ze,{className:"ecr-admin-links__upgrade",children:["+ Add Another ",a.jsx(at,{size:20})]}),a.jsx(Qe,{className:"ecr-admin-links__popover",children:a.jsx(ft,{name:"Multiple Links",text:a.jsx(a.Fragment,{children:"Unlock the ability to add multiple custom links, seamlessly redirecting users to your pages from the videos!"})})})]})]}):a.jsx(V0,{setLinks:t,linkCount:e.length,linkType:n,links:e})]})},q0=({togglePlayPause:e,isMuted:t,file:r,videoRef:n,onEnded:o})=>{const[i,s]=_.useState(!1);return a.jsx("video",{ref:n,className:$("ecr-admin-reelvideo",i?"ecr-admin-reelvideo--portrait":"ecr-admin-reelvideo--landscape"),src:r?.url,muted:t,playsInline:!0,preload:"metadata",onClick:e,autoPlay:!0,draggable:!1,onEnded:o,onError:o,"webkit-playsinline":"true",onLoadedMetadata:l=>{const c=l.currentTarget,d=c.videoWidth,u=c.videoHeight;s(()=>u>d)}})},G0=({index:e,setIsAttemptingDelete:t,file:r,file_uuid:n,dragStart:o,dragEnter:i,dragEnd:s})=>{const[l,c]=_.useState(!0),[d,u]=_.useState(!1),p=_.useRef(null),m=()=>{p.current&&(d?p.current.play():p.current.pause(),u(b=>!b))},g=()=>{p.current&&(p.current.muted=!l,c(b=>!b))};return a.jsxs("div",{draggable:!0,onDragStart:()=>o(e),onDragEnter:()=>i(e),onDragEnd:s,className:$("ecr-admin-customization__panel"),children:[a.jsx(er,{className:"ecr-admin-customization__remove",size:20,onClick:()=>t(n)}),a.jsx(q0,{togglePlayPause:m,isMuted:l,file:r,videoRef:p,onEnded:()=>u(!0)}),a.jsxs("div",{className:"ecr-admin-customization__controls",children:[d?a.jsx(Jn,{size:18,className:"ecr-admin-customization__control",onClick:m}):a.jsx(Xn,{size:18,className:"ecr-admin-customization__control",onClick:m}),l?a.jsx(Qn,{size:18,className:"ecr-admin-customization__control",onClick:g}):a.jsx(Zn,{size:18,className:"ecr-admin-customization__control",onClick:g})]})]})},K0=({uploadedFiles:e,setIsAttemptingDelete:t,setUploadedFiles:r})=>{const n=_.useRef(null),o=_.useRef(null),i=c=>{n.current=c},s=c=>{o.current=c},l=()=>{if(n.current===null||o.current===null)return;const c=[...e],d=c[n.current];c.splice(n.current,1),c.splice(o.current,0,d),n.current=null,o.current=null,r(c)};return a.jsxs("div",{className:"ecr-admin-customization",children:[e.map((c,d)=>a.jsx(G0,{setIsAttemptingDelete:t,file:c,file_uuid:c.file_uuid,index:d,dragStart:i,dragEnter:s,dragEnd:l},d)),a.jsxs(Je,{children:[a.jsxs(Ze,{className:"ecr-admin-customization__add",children:[a.jsx("img",{className:"ecr-admin-customization__icon",src:Uo,alt:"Upload"}),a.jsx("span",{className:"ecr-admin-customization__label",children:"Upload another video"}),a.jsx(at,{size:20,className:"ecr-admin-customization__lock"})]}),a.jsx(Qe,{side:"right",className:"ecr-admin-customization__popover",children:a.jsx(ft,{name:"Multiple Videos",text:a.jsxs(a.Fragment,{children:["Unlock the power of ",a.jsx("strong",{children:"Multiple Video"})," uploads, boosting engagement and variety in every Reels!"]})})})]})]})};function Y0(e){return V({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 X0=({setUploadedFiles:e,setThumbnail:t,usedFor:r="video",mode:n="files",multiple:o=!1,className:i})=>{const[s,l]=_.useState(!1),c=()=>{const d=window.wp.media({title:"Select image or video files",button:{text:"Use this file"},multiple:o,library:{type:[r]}});d.on("select",()=>{const u=d.state().get("selection").toJSON();if(n==="thumbnail"){const m=u[0];m&&t&&t(m.url);return}if(!e)return;const p=u.map(m=>({url:m.url,mime_type:m.mime,file_uuid:_n()}));e(m=>[...m,...p])}),d.open()};return a.jsx("div",{className:$("ecr-admin-upload",s?"ecr-admin-upload--active":"ecr-admin-upload--idle",i),onDragOver:d=>{d.preventDefault(),l(!0)},onDragLeave:()=>l(!1),onDrop:d=>{d.preventDefault(),l(!1),c()},children:a.jsxs("label",{className:"ecr-admin-upload__label",htmlFor:"file",onClick:c,children:[a.jsx("img",{className:"ecr-admin-upload__icon",src:Uo,alt:"Upload"}),a.jsx("span",{className:"ecr-admin-upload__text",children:s?a.jsx("span",{className:"ecr-admin-upload__text-strong",children:"Drop files here..."}):a.jsxs("span",{className:"ecr-admin-upload__text-stack",children:[a.jsxs("span",{className:"ecr-admin-upload__text-item",children:["Upload ",r]}),n==="files"?a.jsx("span",{className:"ecr-admin-upload__text-item",children:"Click or Drag and drop files here"}):null]})})]})})},J0=({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(Y0,{className:"ecr-admin-thumbnail__remove",size:20,onClick:()=>t(null)})]}):a.jsx(X0,{mode:"thumbnail",usedFor:"image",setThumbnail:t,className:"ecr-admin-thumbnail__uploader"})]}),Z0=()=>{const e=Ne(),[t]=Zt(),r=_.useMemo(()=>t.get("sid"),[t]),n=_.useRef(null),[o,i]=_.useState({files:[],title:"",links:[],thumbnail:null}),[s,l]=_.useState(!1),[c,d]=_.useState(null),u=_.useCallback(h=>{i(v=>({...v,title:typeof h=="function"?h(v.title):h}))},[]),p=_.useCallback(h=>{i(v=>({...v,files:typeof h=="function"?h(v.files):h}))},[]),m=_.useCallback(h=>{i(v=>({...v,links:typeof h=="function"?h(v.links):h}))},[]),g=_.useCallback(h=>{i(v=>({...v,thumbnail:typeof h=="function"?h(v.thumbnail):h}))},[]),b=()=>{c&&(p(h=>h.filter(v=>v.file_uuid!==c)),d(null))},f=_.useCallback(async h=>{try{l(!0);const v=await he.get(`story/${h}`);i({title:v.data.title,files:v.data.files,links:v.data.links,thumbnail:v.data.thumbnail})}catch(v){v instanceof Error?G.error(v.message):G.error("Something went wrong. Try again later!"),n.current=setTimeout(()=>e(-1),1e3)}finally{l(!1)}},[e]);return _.useEffect(()=>{r&&f(r)},[r,f]),_.useEffect(()=>()=>{n.current&&clearTimeout(n.current)},[]),s?a.jsx(Lr,{}):a.jsxs(a.Fragment,{children:[a.jsx(Qf,{uploadedFiles:o.files,links:o.links,thumbnail:o.thumbnail,storyTitle:o.title,setStoryTitle:u}),a.jsxs("div",{className:"ecr-admin-create",children:[a.jsxs("div",{className:"ecr-admin-create__panel ecr-admin-create__panel--main",children:[a.jsx("p",{className:"ecr-admin-create__title",children:"Select video"}),c&&a.jsx(Or,{onReject:()=>d(null),onAccept:b,isLoading:!1,message:"Are you sure, You want to remove this file?"}),o.files.length>0?a.jsx(K0,{uploadedFiles:o.files,setUploadedFiles:p,setIsAttemptingDelete:d}):a.jsx(v0,{setUploadedFiles:p})]}),a.jsxs("div",{className:"ecr-admin-create__panel ecr-admin-create__panel--side",children:[a.jsx(J0,{thumbnail:o.thumbnail,onThumbnailChange:g}),a.jsx(bn,{className:"ecr-admin-create__separator"}),a.jsx(W0,{links:o.links,onLinksChange:m})]})]})]})},Hl=({message:e="Something went wrong. Please try again."})=>a.jsxs("div",{className:"ecr-admin-error",children:[a.jsx(mp,{className:"ecr-admin-error__icon"}),a.jsx("p",{className:"ecr-admin-error__text",children:e})]});var Zo,Vl;function Q0(){return Vl||(Vl=1,Zo=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()}}),Zo}var Qo,Wl;function eb(){if(Wl)return Qo;Wl=1;var e=Q0(),t={"text/plain":"Text","text/html":"Url",default:"Text"},r="Copy to clipboard: #{key}, Enter";function n(i){var s=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return i.replace(/#{\s*key\s*}/g,s)}function o(i,s){var l,c,d,u,p,m,g=!1;s||(s={}),l=s.debug||!1;try{d=e(),u=document.createRange(),p=document.getSelection(),m=document.createElement("span"),m.textContent=i,m.ariaHidden="true",m.style.all="unset",m.style.position="fixed",m.style.top=0,m.style.clip="rect(0, 0, 0, 0)",m.style.whiteSpace="pre",m.style.webkitUserSelect="text",m.style.MozUserSelect="text",m.style.msUserSelect="text",m.style.userSelect="text",m.addEventListener("copy",function(f){if(f.stopPropagation(),s.format)if(f.preventDefault(),typeof f.clipboardData>"u"){l&&console.warn("unable to use e.clipboardData"),l&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var h=t[s.format]||t.default;window.clipboardData.setData(h,i)}else f.clipboardData.clearData(),f.clipboardData.setData(s.format,i);s.onCopy&&(f.preventDefault(),s.onCopy(f.clipboardData))}),document.body.appendChild(m),u.selectNodeContents(m),p.addRange(u);var b=document.execCommand("copy");if(!b)throw new Error("copy command was unsuccessful");g=!0}catch(f){l&&console.error("unable to copy using execCommand: ",f),l&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(s.format||"text",i),s.onCopy&&s.onCopy(window.clipboardData),g=!0}catch(h){l&&console.error("unable to copy using clipboardData: ",h),l&&console.error("falling back to prompt"),c=n("message"in s?s.message:r),window.prompt(c,i)}}finally{p&&(typeof p.removeRange=="function"?p.removeRange(u):p.removeAllRanges()),m&&document.body.removeChild(m),d()}return g}return Qo=o,Qo}var tb=eb();const ql=Nd(tb);function Gl({className:e,...t}){return a.jsx("div",{"data-slot":"table-container",className:"ecr-table__container",children:a.jsx("table",{"data-slot":"table",className:$("ecr-table",e),...t})})}function Kl({className:e,...t}){return a.jsx("thead",{"data-slot":"table-header",className:$("ecr-table__header",e),...t})}function Yl({className:e,...t}){return a.jsx("tbody",{"data-slot":"table-body",className:$("ecr-table__body",e),...t})}function kn({className:e,...t}){return a.jsx("tr",{"data-slot":"table-row",className:$("ecr-table__row",e),...t})}function Xl({className:e,...t}){return a.jsx("th",{"data-slot":"table-head",className:$("ecr-table__head",e),...t})}function Me({className:e,...t}){return a.jsx("td",{"data-slot":"table-cell",className:$("ecr-table__cell",e),...t})}function Jl({className:e,...t}){return a.jsx("caption",{"data-slot":"table-caption",className:$("ecr-table__caption",e),...t})}const rb=[{label:"No.",width:80,align:"center"},{label:"Group Name",width:250,align:"start"},{label:"Short Code",align:"start"},{label:"Action",width:150,align:"center"}],nb=({tableData:e,setIsAttemptingDelete:t})=>{const[r,n]=_.useState(null),o=_.useRef(null),i=(s,l)=>{ql(s),n(l),o.current=setTimeout(()=>{n(null)},700)};return _.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]),a.jsxs(Gl,{className:"ecr-admin-groups__table",children:[!e.length&&a.jsx(Jl,{className:"ecr-admin-groups__caption",children:a.jsxs("div",{className:"ecr-admin-groups__empty",children:[a.jsx(lt,{className:"ecr-admin-groups__empty-icon"}),"You did not create any reel group yet!"]})}),e.length?a.jsxs(a.Fragment,{children:[a.jsx(Kl,{children:a.jsx(kn,{children:rb.map((s,l)=>a.jsx(Xl,{className:"ecr-admin-groups__head",style:{width:s?.width||"auto",textAlign:s?.align},children:s.label},l))})}),a.jsx(Yl,{children:e.map((s,l)=>a.jsxs(kn,{className:$("ecr-admin-groups__row",l%2===0&&"ecr-admin-groups__row--alt"),children:[a.jsx(Me,{className:"ecr-admin-groups__cell ecr-admin-groups__cell--center ecr-admin-groups__cell--strong",children:l+1}),a.jsx(Me,{children:a.jsx("div",{className:"ecr-admin-groups__name",children:s.group_name})}),a.jsx(Me,{children:a.jsxs("div",{className:"ecr-admin-groups__shortcode",children:[a.jsx("span",{className:"ecr-admin-groups__shortcode-text",children:`[reelswp-group id='${s.id}']`}),a.jsxs("div",{className:"ecr-admin-groups__copy",children:[a.jsx("button",{onClick:()=>i(`[reelswp-group id='${s.id}']`,l),className:"ecr-admin-groups__copy-button",title:"Copy",children:a.jsx(ip,{className:"ecr-admin-groups__copy-icon"})}),a.jsx("span",{className:$("ecr-admin-groups__copy-tooltip",r===l&&"ecr-admin-groups__copy-tooltip--visible"),children:"Copied!"})]})]})}),a.jsx(Me,{children:a.jsxs("div",{className:"ecr-admin-groups__actions",children:[a.jsx(ne,{title:"Statistics",variant:"link",size:"icon-sm",asChild:!0,className:"ecr-admin-groups__action-button",children:a.jsx(vt,{to:`?view=${X.stat}&group=${s.id}&name=${s.group_name}`,children:a.jsx(bi,{className:"ecr-admin-groups__icon ecr-admin-groups__icon--neutral"})})}),a.jsx(ne,{title:"Update Stories",variant:"link",size:"icon-sm",asChild:!0,className:"ecr-admin-groups__action-button",children:a.jsx(vt,{to:`?view=${X.mg}&gid=${s.id}`,children:a.jsx(Pr,{className:"ecr-admin-groups__icon ecr-admin-groups__icon--neutral"})})}),a.jsx(ne,{title:"Delete Group",onClick:()=>t(s.id),variant:"link",size:"icon-sm",className:"ecr-admin-groups__action-button",children:a.jsx(pp,{className:"ecr-admin-groups__icon ecr-admin-groups__icon--danger"})})]})})]},s.id??l))})]}):null]})},Zl=()=>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))})]}),ob=()=>{const[e,t]=_.useState([]),[r,n]=_.useState(""),[o,i]=_.useState(!1),[s,l]=_.useState(!1),[c,d]=_.useState(!1),[u,p]=_.useState(""),[m,g]=_.useState(1),[b]=_.useState(20),[f,h]=_.useState(0),[v,y]=_.useState(1),w=fo(u,500),j=_.useCallback(async E=>{const T=new AbortController,A=E===1;try{A?i(!0):l(!0),n("");const R=await he.get("groups",{params:{page:E,per_page:b,...w&&{q:w}},signal:T.signal}),L=Number(R.headers?.["x-wp-total"]??0),B=Number(R.headers?.["x-wp-totalpages"]??1),M=Math.max(1,B||1);t(O=>{if(A)return R.data;const P=new Set(O.map(I=>I.id)),z=R.data.filter(I=>!P.has(I.id));return[...O,...z]}),h(L),y(M),E>M&&g(M)}catch(R){if(T.signal.aborted)return;R instanceof Error?n(R.message):n("Something went wrong. Try again later!")}finally{T.signal.aborted||(A?i(!1):l(!1))}},[b,w]),C=_.useCallback(()=>{g(E=>o||s||E>=v?E:E+1)},[o,s,v]),N=_.useCallback(async()=>{if(m!==1){g(1);return}await j(1)},[m,j]),S=_.useCallback(async E=>{try{d(!0),await he.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 _.useEffect(()=>{j(m)},[m,j,w]),{groups:e,groupError:r,isLoading:o,isLoadingMore:s,isDeleting:c,searchTerm:u,setSearchTerm:p,perPage:b,total:f,totalPages:v,hasMore:m<=v,loadMore:C,refreshGroups:N,deleteGroup:S}},ab={docs:"https://reelswp.com/docs/"},ib=()=>{const[e,t]=_.useState(null),{groups:r,groupError:n,isLoading:o,isLoadingMore:i,isDeleting:s,deleteGroup:l,hasMore:c,loadMore:d,searchTerm:u,setSearchTerm:p}=ob(),m=_.useRef(null),g=async()=>{e&&(await l(e),t(null))};return _.useEffect(()=>{if(!m.current||!c)return;const b=new IntersectionObserver(f=>{const[h]=f;h.isIntersecting&&d()},{root:null,rootMargin:"200px",threshold:0});return b.observe(m.current),()=>b.disconnect()},[c,d]),a.jsxs(a.Fragment,{children:[a.jsx(kt,{left:[a.jsx(St,{name:"All Widgets",Icon:fp},"page")],center:[a.jsx(Ir,{},"reel-wp")],right:[a.jsxs("a",{href:ab.docs,className:"ecr-admin-docs-link",target:"_blank",children:[a.jsx(Fp,{size:14}),a.jsx("span",{children:"Documentation"})]},"view-documentation"),a.jsx(Rr,{to:`?view=${X.cr}`,text:"Add Reel",Icon:yt},"add-reel-reel-group")]}),a.jsxs("div",{className:"ecr-admin-card ecr-admin-groups",children:[e&&a.jsx(Or,{onAccept:g,onReject:()=>t(null),isLoading:s}),a.jsxs("div",{className:"ecr-admin-groups__header",children:[a.jsx("h2",{className:"ecr-admin-groups__title",children:"Reel Widgets"}),a.jsxs("div",{className:"ecr-admin-groups_action_wrapper",children:[a.jsxs("div",{className:"ecr-admin-groups-header__search",children:[a.jsx("input",{type:"text",placeholder:"Search widgets...",value:u,onChange:b=>p(b.target.value),className:"ecr-admin-groups-search-input"}),a.jsxs("div",{className:"ecr-admin-groups-header__icon-wrapper",children:[u&&a.jsx(ne,{onClick:()=>p(""),variant:"link",size:"icon-sm",children:a.jsx(qn,{size:16,className:"ecr-admin-groups-header__clear-icon"})}),a.jsx(ii,{size:16,className:"ecr-admin-groups-header__search-icon"})]})]}),a.jsx(Rr,{to:`?view=${X.mg}`,text:"Create Widget",Icon:yt,className:"ecr-admin-groups__create-button",textColor:"#2563eb"})]})]}),o?a.jsx(Zl,{}):n?a.jsx(Hl,{}):a.jsxs(a.Fragment,{children:[a.jsx(nb,{tableData:r,setIsAttemptingDelete:t}),c&&a.jsx("div",{ref:m,className:"ecr-admin-groups__load-more","aria-live":"polite",children:i?a.jsx(Hp,{className:"ecr-admin-groups__load-more__icon"}):null})]})]})]})},sb=()=>{const[e,t]=_.useState(!1),[r,n]=_.useState({rateLimit:2,timeLimit:1}),[o,i]=_.useState(!1),[s,l]=_.useState(!1),[c,d]=_.useState(!1),u=_.useCallback((m,g)=>{t(!0),n(b=>({...b,[m]:g}))},[]),p=_.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),d(!1),await he.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!"),d(!0)}finally{l(!1)}},[r.rateLimit,r.timeLimit]);return _.useEffect(()=>{const m=new AbortController;return(async()=>{try{i(!0),d(!1);const b=await he.get("settings",{signal:m.signal});n({rateLimit:b.data.rate_limit,timeLimit:b.data.time_limit}),t(!1)}catch(b){if(m.signal.aborted)return;b instanceof Error?G.error(b.message):G.error("Something went wrong. Try again later!"),d(!0)}finally{m.signal.aborted||i(!1)}})(),()=>m.abort()},[]),{limit:r,isEdited:e,isLoading:o,isSaving:s,isError:c,handleOnChange:u,handleSave:p}},lb=()=>{const{limit:e,isEdited:t,isLoading:r,isSaving:n,isError:o,handleOnChange:i,handleSave:s}=sb();return a.jsxs(a.Fragment,{children:[r&&a.jsx(Lr,{}),a.jsx(kt,{left:[a.jsx(St,{name:"Settings",Icon:Tp},"Settings"),a.jsx(tr,{},"back-settings")],center:[a.jsx(Ir,{},"Settings-widget-name")],right:[a.jsx(ho,{onSave:s,isSaving:n,disabled:!t},"save")]}),a.jsx(rr,{breads:[{label:"Dashboard",href:`?view=${X.ag}`},{label:"Settings"}]}),a.jsxs("div",{className:"ecr-admin-card ecr-admin-card--settings",children:[a.jsx("div",{className:"ecr-admin-card__header",children:a.jsx("h2",{className:"ecr-admin-card__title",children:"ReelsWP Settings"})}),o&&a.jsx("div",{className:"ecr-admin-form__row",children:a.jsx("span",{children:"Unable to load settings. Please try again."})}),a.jsxs("form",{action:"",className:"ecr-admin-form",children:[a.jsxs("div",{className:"ecr-admin-form__row",children:[a.jsx("label",{htmlFor:"ecommreels_rate_limit",className:"ecr-admin-form__label",children:"Rate Limit:"}),a.jsx("input",{type:"number",id:"ecommreels_rate_limit",name:"ecommreels_rate_limit",value:e.rateLimit,onChange:l=>i("rateLimit",l.target.value),className:"ecr-admin-form__input",min:"1"})]}),a.jsxs("div",{className:"ecr-admin-form__row",children:[a.jsx("label",{htmlFor:"ecommreels_time_limit",className:"ecr-admin-form__label",children:"Time Limit (minutes):"}),a.jsx("input",{type:"number",id:"ecommreels_time_limit",name:"ecommreels_time_limit",value:e.timeLimit,onChange:l=>i("timeLimit",l.target.value),className:"ecr-admin-form__input",min:"1"})]})]})]})]})},cb=[{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"}],db=({tableData:e})=>a.jsxs(Gl,{className:"ecr-admin-stats__table",children:[!e.length&&a.jsx(Jl,{className:"ecr-admin-stats__caption",children:a.jsxs("div",{className:"ecr-admin-stats__empty",children:[a.jsx(lt,{className:"ecr-admin-stats__empty-icon"}),"You did not create any reel group yet!"]})}),a.jsx(Kl,{children:a.jsx(kn,{children:cb.map((t,r)=>a.jsx(Xl,{className:"ecr-admin-stats__head",style:{...t.width&&{width:`${t.width}px`},textAlign:t.align},children:t.label},r))})}),!!e.length&&a.jsx(Yl,{children:e.map((t,r)=>a.jsxs(kn,{className:$("ecr-admin-stats__row",r%2===0&&"ecr-admin-stats__row--alt"),children:[a.jsx(Me,{className:"ecr-admin-stats__cell ecr-admin-stats__cell--center",children:r+1}),a.jsx(Me,{className:"ecr-admin-stats__cell",children:t.storyTitle}),a.jsx(Me,{className:"ecr-admin-stats__cell",children:t.campaignName}),a.jsx(Me,{className:"ecr-admin-stats__cell",children:t.buttonText}),a.jsx(Me,{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(Me,{className:"ecr-admin-stats__cell ecr-admin-stats__cell--center",children:t.clickCount})]},t.id))})]}),ub=()=>{const[e]=Zt(),t=e.get("group"),r=e.get("name"),[n,o]=_.useState([]),[i,s]=_.useState([]),[l,c]=_.useState(!1),[d,u]=_.useState(!1);_.useEffect(()=>{t&&(async()=>{try{c(!0);const g=await he.get(`/group/${t}/stats`);o(g.data.stories),s(g.data.buttons)}catch(g){g instanceof Error?G.error(g.message):G.error("Something went wrong. Try again later!"),u(!0)}finally{c(!1)}})()},[t]);const p=n.length>0?n.reduce((m,g)=>m+=g.view_count??0,0):0;return a.jsxs(a.Fragment,{children:[a.jsx(kt,{left:[a.jsx(St,{name:"Statistics",Icon:bi},"Statistics"),a.jsx(tr,{},"Statistics-back")],center:[a.jsx(Ir,{},"Statistics-widget-name")]}),a.jsx(rr,{breads:[{label:"Dashboard",href:`?view=${X.ag}`},{label:"Statistics"}]}),a.jsxs("div",{className:"ecr-admin-card ecr-admin-stats",children:[a.jsxs("div",{className:"ecr-admin-stats__header",children:[a.jsxs("h2",{className:"ecr-admin-stats__title",children:["Group: ",r]}),l?a.jsx("div",{className:"ecr-admin-stats__summary-skeleton"}):a.jsxs("div",{className:"ecr-admin-stats__summary",children:[a.jsx("span",{children:"Total View:"})," ",a.jsx("span",{children:p})]})]}),a.jsx("div",{className:"ecr-admin-stats__body",children:l?a.jsx(Zl,{}):d?a.jsx(Hl,{}):i.length===0?a.jsxs("div",{className:"ecr-admin-stats__empty",children:[a.jsx(lt,{className:"ecr-admin-stats__empty-icon"}),a.jsx("span",{children:"No Stats available for this group"})]}):a.jsx(db,{tableData:i})})]})]})};function pb(e){return V({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 mb(e){return V({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 fb=({isExpanded:e,setIsExpanded:t})=>a.jsx("button",{onClick:()=>t(r=>!r),className:$("ecr-admin-side-toggle",e?"ecr-admin-side-toggle--active":""),title:"Side Panel",children:a.jsx(pb,{size:24})}),hb=({...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"})]})}),ea=_.forwardRef(({className:e,type:t,...r},n)=>a.jsx(W.input,{ref:n,type:t,"data-slot":"input",className:$("ecr-input",e),...r}));ea.displayName="Input";const ta=({label:e,min:t,max:r,value:n,onChange:o,name:i,id:s,wrapperStyles:l,hideSlider:c})=>{const[d,u]=_.useState(n),p=_.useRef(null);_.useEffect(()=>{u(n)},[n]);const m=b=>{const f=Math.min(r,Math.max(t,Number(b)));o(f)},g=b=>{const f=Number(b);u(f),p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{m(f>r?r:f<t?t:f)},1e3)};return a.jsxs("div",{style:l,className:"ecr-admin-range",children:[a.jsxs("label",{htmlFor:s,className:"ecr-admin-range__label",children:[e,":"]}),a.jsxs("div",{className:"ecr-admin-range__row",children:[!c&&a.jsx("input",{type:"range",id:s,name:i,min:t,max:r,value:n,onChange:b=>{const f=Number(b.target.value);u(f),m(f)},className:"ecr-admin-range__slider"}),a.jsxs("div",{className:"ecr-admin-range__value",children:[a.jsx(ea,{type:"number",min:t,max:r,value:d,onChange:b=>g(b.target.value)}),a.jsx("span",{className:"ecr-admin-range__unit",children:"px"})]})]})]})};function D(){return D=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},D.apply(null,arguments)}function Be(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var Dt=255,et=100,pr=e=>{var{r:t,g:r,b:n,a:o}=e,i=Math.max(t,r,n),s=i-Math.min(t,r,n),l=s?i===t?(r-n)/s:i===r?2+(n-t)/s:4+(t-r)/s:0;return{h:60*(l<0?l+6:l),s:i?s/i*et:0,v:i/Dt*et,a:o}},Ql=e=>{var{h:t,s:r,l:n,a:o}=ec(e);return"hsla("+t+", "+r+"%, "+n+"%, "+o+")"},ec=e=>{var{h:t,s:r,v:n,a:o}=e,i=(200-r)*n/et;return{h:t,s:i>0&&i<200?r*n/et/(i<=et?i:200-i)*et:0,l:i/2,a:o}},tc=e=>{var{r:t,g:r,b:n}=e,o=t<<16|r<<8|n;return"#"+(i=>new Array(7-i.length).join("0")+i)(o.toString(16))},gb=e=>{var{r:t,g:r,b:n,a:o}=e,i=typeof o=="number"&&(o*255|256).toString(16).slice(1);return""+tc({r:t,g:r,b:n})+(i||"")},mr=e=>pr(xb(e)),xb=e=>{var t=e.replace("#","");/^#?/.test(e)&&t.length===3&&(e="#"+t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2));var r=new RegExp("[A-Za-z0-9]{2}","g"),[n,o,i=0,s]=e.match(r).map(l=>parseInt(l,16));return{r:n,g:o,b:i,a:(s??255)/Dt}},Sn=e=>{var{h:t,s:r,v:n,a:o}=e,i=t/60,s=r/et,l=n/et,c=Math.floor(i)%6,d=i-Math.floor(i),u=Dt*l*(1-s),p=Dt*l*(1-s*d),m=Dt*l*(1-s*(1-d));l*=Dt;var g={};switch(c){case 0:g.r=l,g.g=m,g.b=u;break;case 1:g.r=p,g.g=l,g.b=u;break;case 2:g.r=u,g.g=l,g.b=m;break;case 3:g.r=u,g.g=p,g.b=l;break;case 4:g.r=m,g.g=u,g.b=l;break;case 5:g.r=l,g.g=u,g.b=p;break}return g.r=Math.round(g.r),g.g=Math.round(g.g),g.b=Math.round(g.b),D({},g,{a:o})},bb=e=>{var{r:t,g:r,b:n,a:o}=Sn(e);return"rgba("+t+", "+r+", "+n+", "+o+")"},_b=e=>{var{r:t,g:r,b:n}=e;return{r:t,g:r,b:n}},vb=e=>{var{h:t,s:r,l:n}=e;return{h:t,s:r,l:n}},ra=e=>tc(Sn(e)),yb=e=>{var{h:t,s:r,v:n}=e;return{h:t,s:r,v:n}},wb=e=>{var{r:t,g:r,b:n}=e,o=function(u){return u<=.04045?u/12.92:Math.pow((u+.055)/1.055,2.4)},i=o(t/255),s=o(r/255),l=o(n/255),c={};return c.x=i*.4124+s*.3576+l*.1805,c.y=i*.2126+s*.7152+l*.0722,c.bri=i*.0193+s*.1192+l*.9505,c},$t=e=>{var t,r,n,o,i,s,l,c,d;return typeof e=="string"&&na(e)?(s=mr(e),c=e):typeof e!="string"&&(s=e),s&&(n=yb(s),i=ec(s),o=Sn(s),d=gb(o),c=ra(s),r=vb(i),t=_b(o),l=wb(t)),{rgb:t,hsl:r,hsv:n,rgba:o,hsla:i,hsva:s,hex:c,hexa:d,xy:l}},na=e=>/^#?([A-Fa-f0-9]{3,4}){1,2}$/.test(e);function rc(e){var t=_.useRef(e);return _.useEffect(()=>{t.current=e}),_.useCallback((r,n)=>t.current&&t.current(r,n),[])}var fr=e=>"touches"in e,nc=e=>{!fr(e)&&e.preventDefault&&e.preventDefault()},oc=function(t,r,n){return r===void 0&&(r=0),n===void 0&&(n=1),t>n?n:t<r?r:t},ac=(e,t)=>{var r=e.getBoundingClientRect(),n=fr(t)?t.touches[0]:t;return{left:oc((n.pageX-(r.left+window.pageXOffset))/r.width),top:oc((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)}},jb=["prefixCls","className","onMove","onDown"],oa=_.forwardRef((e,t)=>{var{prefixCls:r="w-color-interactive",className:n,onMove:o,onDown:i}=e,s=Be(e,jb),l=_.useRef(null),c=_.useRef(!1),[d,u]=_.useState(!1),p=rc(o),m=rc(i),g=y=>c.current&&!fr(y)?!1:(c.current=fr(y),!0),b=_.useCallback(y=>{if(nc(y),!!l.current){var w=fr(y)?y.touches.length>0:y.buttons>0;if(!w){u(!1);return}p?.(ac(l.current,y),y)}},[p]),f=_.useCallback(()=>u(!1),[]),h=_.useCallback(y=>{y?(window.addEventListener(c.current?"touchmove":"mousemove",b),window.addEventListener(c.current?"touchend":"mouseup",f)):(window.removeEventListener("mousemove",b),window.removeEventListener("mouseup",f),window.removeEventListener("touchmove",b),window.removeEventListener("touchend",f))},[b,f]);_.useEffect(()=>(h(d),()=>{h(!1)}),[d,b,f,h]);var v=_.useCallback(y=>{var w=document.activeElement;w?.blur(),nc(y.nativeEvent),g(y.nativeEvent)&&l.current&&(m?.(ac(l.current,y.nativeEvent),y.nativeEvent),u(!0))},[m]);return a.jsx("div",D({},s,{className:[r,n||""].filter(Boolean).join(" "),style:D({},s.style,{touchAction:"none"}),ref:l,tabIndex:0,onMouseDown:v,onTouchStart:v}))});oa.displayName="Interactive";var kb=e=>{var{className:t,color:r,left:n,top:o,prefixCls:i}=e,s={position:"absolute",top:o,left:n},l={"--saturation-pointer-box-shadow":"rgb(255 255 255) 0px 0px 0px 1.5px, rgb(0 0 0 / 30%) 0px 0px 1px 1px inset, rgb(0 0 0 / 40%) 0px 0px 1px 2px",width:6,height:6,transform:"translate(-3px, -3px)",boxShadow:"var(--saturation-pointer-box-shadow)",borderRadius:"50%",backgroundColor:r};return _.useMemo(()=>a.jsx("div",{className:i+"-pointer "+(t||""),style:s,children:a.jsx("div",{className:i+"-fill",style:l})}),[o,n,r,t,i])},Sb=["prefixCls","radius","pointer","className","hue","style","hsva","onChange"],ic=_.forwardRef((e,t)=>{var r,{prefixCls:n="w-color-saturation",radius:o=0,pointer:i,className:s,hue:l=0,style:c,hsva:d,onChange:u}=e,p=Be(e,Sb),m=D({width:200,height:200,borderRadius:o},c,{position:"relative"}),g=(v,y)=>{u&&d&&u({h:d.h,s:v.left*100,v:(1-v.top)*100,a:d.a})},b=_.useCallback(v=>{if(!(!d||!u)){var y=1,w=d.s,j=d.v,C=!1;switch(v.key){case"ArrowLeft":w=Math.max(0,d.s-y),C=!0,v.preventDefault();break;case"ArrowRight":w=Math.min(100,d.s+y),C=!0,v.preventDefault();break;case"ArrowUp":j=Math.min(100,d.v+y),C=!0,v.preventDefault();break;case"ArrowDown":j=Math.max(0,d.v-y),C=!0,v.preventDefault();break;default:return}C&&u({h:d.h,s:w,v:j,a:d.a})}},[d,u]),f=_.useMemo(()=>{if(!d)return null;var v={top:100-d.v+"%",left:d.s+"%",color:Ql(d)};return i&&typeof i=="function"?i(D({prefixCls:n},v)):a.jsx(kb,D({prefixCls:n},v))},[d,i,n]),h=_.useCallback(v=>{v.target.focus()},[]);return a.jsx(oa,D({className:[n,s||""].filter(Boolean).join(" ")},p,{style:D({position:"absolute",inset:0,cursor:"crosshair",backgroundImage:"linear-gradient(0deg, #000, transparent), linear-gradient(90deg, #fff, hsl("+((r=d?.h)!=null?r:l)+", 100%, 50%))"},m,{outline:"none"}),ref:t,onMove:g,onDown:g,onKeyDown:b,onClick:h,children:f}))});ic.displayName="Saturation";var Cb=["className","prefixCls","left","top","style","fillProps"],Nb=e=>{var{className:t,prefixCls:r,left:n,top:o,style:i,fillProps:s}=e,l=Be(e,Cb),c=D({},i,{position:"absolute",left:n,top:o}),d=D({width:18,height:18,boxShadow:"var(--alpha-pointer-box-shadow)",borderRadius:"50%",backgroundColor:"var(--alpha-pointer-background-color)"},s?.style,{transform:n?"translate(-9px, -1px)":"translate(-1px, -9px)"});return a.jsx("div",D({className:r+"-pointer "+(t||""),style:c},l,{children:a.jsx("div",D({className:r+"-fill"},s,{style:d}))}))},Eb=["prefixCls","className","hsva","background","bgProps","innerProps","pointerProps","radius","width","height","direction","style","onChange","pointer"],Tb="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg==",Cn=_.forwardRef((e,t)=>{var{prefixCls:r="w-color-alpha",className:n,hsva:o,background:i,bgProps:s={},innerProps:l={},pointerProps:c={},radius:d=0,width:u,height:p=16,direction:m="horizontal",style:g,onChange:b,pointer:f}=e,h=Be(e,Eb),v=T=>{b&&b(D({},o,{a:m==="horizontal"?T.left:T.top}),T)},y=Ql(Object.assign({},o,{a:1})),w="linear-gradient(to "+(m==="horizontal"?"right":"bottom")+", rgba(244, 67, 54, 0) 0%, "+y+" 100%)",j={};m==="horizontal"?j.left=o.a*100+"%":j.top=o.a*100+"%";var C=D({"--alpha-background-color":"#fff","--alpha-pointer-background-color":"rgb(248, 248, 248)","--alpha-pointer-box-shadow":"rgb(0 0 0 / 37%) 0px 1px 4px 0px",borderRadius:d,background:"url("+Tb+") left center",backgroundColor:"var(--alpha-background-color)"},{width:u,height:p},g,{position:"relative"}),N=_.useCallback(T=>{var A=.01,R=o.a,L=R;switch(T.key){case"ArrowLeft":m==="horizontal"&&(L=Math.max(0,R-A),T.preventDefault());break;case"ArrowRight":m==="horizontal"&&(L=Math.min(1,R+A),T.preventDefault());break;case"ArrowUp":m==="vertical"&&(L=Math.max(0,R-A),T.preventDefault());break;case"ArrowDown":m==="vertical"&&(L=Math.min(1,R+A),T.preventDefault());break;default:return}if(L!==R){var B={left:m==="horizontal"?L:o.a,top:m==="vertical"?L:o.a,width:0,height:0,x:0,y:0};b&&b(D({},o,{a:L}),B)}},[o,m,b]),S=_.useCallback(T=>{T.target.focus()},[]),E=f&&typeof f=="function"?f(D({prefixCls:r},c,j)):a.jsx(Nb,D({},c,{prefixCls:r},j));return a.jsxs("div",D({},h,{className:[r,r+"-"+m,n||""].filter(Boolean).join(" "),style:C,ref:t,children:[a.jsx("div",D({},s,{style:D({inset:0,position:"absolute",background:i||w,borderRadius:d},s.style)})),a.jsx(oa,D({},l,{style:D({},l.style,{inset:0,zIndex:1,position:"absolute",outline:"none"}),onMove:v,onDown:v,onClick:S,onKeyDown:N,children:E}))]}))});Cn.displayName="Alpha";var Ab=["prefixCls","placement","label","value","className","style","labelStyle","inputStyle","onChange","onBlur","renderInput"],Pb=e=>/^#?([A-Fa-f0-9]{3,4}){1,2}$/.test(e),Ob=e=>Number(String(e).replace(/%/g,"")),Ft=_.forwardRef((e,t)=>{var{prefixCls:r="w-color-editable-input",placement:n="bottom",label:o,value:i,className:s,style:l,labelStyle:c,inputStyle:d,onChange:u,onBlur:p,renderInput:m}=e,g=Be(e,Ab),[b,f]=_.useState(i),h=_.useRef(!1);_.useEffect(()=>{e.value!==b&&(h.current||f(e.value))},[e.value]);function v(S,E){var T=(E||S.target.value).trim().replace(/^#/,"");Pb(T)&&u&&u(S,T);var A=Ob(T);isNaN(A)||u&&u(S,A),f(T)}function y(S){h.current=!1,f(e.value),p&&p(S)}var w={};n==="bottom"&&(w.flexDirection="column"),n==="top"&&(w.flexDirection="column-reverse"),n==="left"&&(w.flexDirection="row-reverse");var j=D({"--editable-input-label-color":"rgb(153, 153, 153)","--editable-input-box-shadow":"rgb(204 204 204) 0px 0px 0px 1px inset","--editable-input-color":"#666",position:"relative",alignItems:"center",display:"flex",fontSize:11},w,l),C=D({width:"100%",paddingTop:2,paddingBottom:2,paddingLeft:3,paddingRight:3,fontSize:11,background:"transparent",boxSizing:"border-box",border:"none",color:"var(--editable-input-color)",boxShadow:"var(--editable-input-box-shadow)"},d),N=D({value:b,onChange:v,onBlur:y,autoComplete:"off",onFocus:()=>h.current=!0},g,{style:C,onFocusCapture:S=>{var E=S.target;E.setSelectionRange(E.value.length,E.value.length)}});return a.jsxs("div",{className:[r,s||""].filter(Boolean).join(" "),style:j,children:[m?m(N,t):a.jsx("input",D({ref:t},N)),o&&a.jsx("span",{style:D({color:"var(--editable-input-label-color)",textTransform:"capitalize"},c),children:o})]})});Ft.displayName="EditableInput";var Rb=["prefixCls","hsva","placement","rProps","gProps","bProps","aProps","className","style","onChange"],sc=_.forwardRef((e,t)=>{var{prefixCls:r="w-color-editable-input-rgba",hsva:n,placement:o="bottom",rProps:i={},gProps:s={},bProps:l={},aProps:c={},className:d,style:u,onChange:p}=e,m=Be(e,Rb),g=n?Sn(n):{};function b(y){var w=Number(y.target.value);w&&w>255&&(y.target.value="255"),w&&w<0&&(y.target.value="0")}var f=y=>{var w=Number(y.target.value);w&&w>100&&(y.target.value="100"),w&&w<0&&(y.target.value="0")},h=(y,w,j)=>{typeof y=="number"&&(w==="a"&&(y<0&&(y=0),y>100&&(y=100),p&&p($t(pr(D({},g,{a:y/100}))))),y>255&&(y=255,j.target.value="255"),y<0&&(y=0,j.target.value="0"),w==="r"&&p&&p($t(pr(D({},g,{r:y})))),w==="g"&&p&&p($t(pr(D({},g,{g:y})))),w==="b"&&p&&p($t(pr(D({},g,{b:y})))))},v=g.a?Math.round(g.a*100)/100:0;return a.jsxs("div",D({ref:t,className:[r,d||""].filter(Boolean).join(" ")},m,{style:D({fontSize:11,display:"flex"},u),children:[a.jsx(Ft,D({label:"R",value:g.r||0,onBlur:b,placement:o,onChange:(y,w)=>h(w,"r",y)},i,{style:D({},i.style)})),a.jsx(Ft,D({label:"G",value:g.g||0,onBlur:b,placement:o,onChange:(y,w)=>h(w,"g",y)},s,{style:D({marginLeft:5},i.style)})),a.jsx(Ft,D({label:"B",value:g.b||0,onBlur:b,placement:o,onChange:(y,w)=>h(w,"b",y)},l,{style:D({marginLeft:5},l.style)})),c&&a.jsx(Ft,D({label:"A",value:parseInt(String(v*100),10),onBlur:f,placement:o,onChange:(y,w)=>h(w,"a",y)},c,{style:D({marginLeft:5},c.style)}))]}))});sc.displayName="EditableInputRGBA";var Lb=["prefixCls","className","hue","onChange","direction"],lc=_.forwardRef((e,t)=>{var{prefixCls:r="w-color-hue",className:n,hue:o=0,onChange:i,direction:s="horizontal"}=e,l=Be(e,Lb);return a.jsx(Cn,D({ref:t,className:r+" "+(n||"")},l,{direction:s,background:"linear-gradient(to "+(s==="horizontal"?"right":"bottom")+", rgb(255, 0, 0) 0%, rgb(255, 255, 0) 17%, rgb(0, 255, 0) 33%, rgb(0, 255, 255) 50%, rgb(0, 0, 255) 67%, rgb(255, 0, 255) 83%, rgb(255, 0, 0) 100%)",hsva:{h:o,s:100,v:100,a:o/360},onChange:(c,d)=>{i&&i({h:s==="horizontal"?360*d.left:360*d.top})}}))});lc.displayName="Hue";var Ib=["prefixCls","className","color","colors","style","rectProps","onChange","addonAfter","addonBefore","rectRender"],cc=_.forwardRef((e,t)=>{var{prefixCls:r="w-color-swatch",className:n,color:o,colors:i=[],style:s,rectProps:l={},onChange:c,addonAfter:d,addonBefore:u,rectRender:p}=e,m=Be(e,Ib),g=D({"--swatch-background-color":"rgb(144, 19, 254)",background:"var(--swatch-background-color)",height:15,width:15,marginRight:5,marginBottom:5,cursor:"pointer",position:"relative",outline:"none",borderRadius:2},l.style),b=(f,h)=>{c&&c(mr(f),$t(mr(f)),h)};return a.jsxs("div",D({ref:t},m,{className:[r,n||""].filter(Boolean).join(" "),style:D({display:"flex",flexWrap:"wrap",position:"relative"},s),children:[u&&_.isValidElement(u)&&u,i&&Array.isArray(i)&&i.map((f,h)=>{var v="",y="";typeof f=="string"&&(v=f,y=f),typeof f=="object"&&f.color&&(v=f.title||f.color,y=f.color);var w=o&&o.toLocaleLowerCase()===y.toLocaleLowerCase(),j=p&&p({title:v,color:y,checked:!!w,style:D({},g,{background:y}),onClick:N=>b(y,N)});if(j)return a.jsx(_.Fragment,{children:j},h);var C=l.children&&_.isValidElement(l.children)?_.cloneElement(l.children,{color:y,checked:w}):null;return a.jsx("div",D({tabIndex:0,title:v,onClick:N=>b(y,N)},l,{children:C,style:D({},g,{background:y})}),h)}),d&&_.isValidElement(d)&&d]}))});cc.displayName="Swatch";var Mb=["prefixCls","className","onChange","width","presetColors","color","editableDisable","disableAlpha","style"],zb=["#D0021B","#F5A623","#f8e61b","#8B572A","#7ED321","#417505","#BD10E0","#9013FE","#4A90E2","#50E3C2","#B8E986","#000000","#4A4A4A","#9B9B9B","#FFFFFF"],dc=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"}}),uc=_.forwardRef((e,t)=>{var{prefixCls:r="w-color-sketch",className:n,onChange:o,width:i=218,presetColors:s=zb,color:l,editableDisable:c=!0,disableAlpha:d=!1,style:u}=e,p=Be(e,Mb),[m,g]=_.useState({h:209,s:36,v:90,a:1});_.useEffect(()=>{typeof l=="string"&&na(l)&&g(mr(l)),typeof l=="object"&&g(l)},[l]);var b=N=>{g(N),o&&o($t(N))},f=(N,S)=>{typeof N=="string"&&na(N)&&/(3|6)/.test(String(N.length))&&b(mr(N))},h=N=>b(D({},m,{a:N.a})),v=N=>b(D({},m,N,{a:m.a})),y=D({"--sketch-background":"rgb(255, 255, 255)","--sketch-box-shadow":"rgb(0 0 0 / 15%) 0px 0px 0px 1px, rgb(0 0 0 / 15%) 0px 8px 16px","--sketch-swatch-box-shadow":"rgb(0 0 0 / 15%) 0px 0px 0px 1px inset","--sketch-alpha-box-shadow":"rgb(0 0 0 / 15%) 0px 0px 0px 1px inset, rgb(0 0 0 / 25%) 0px 0px 4px inset","--sketch-swatch-border-top":"1px solid rgb(238, 238, 238)",background:"var(--sketch-background)",borderRadius:4,boxShadow:"var(--sketch-box-shadow)",width:i},u),w={borderRadius:2,background:bb(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",D({},p,{className:r+" "+(n||""),ref:t,style:y,children:[a.jsxs("div",{style:{padding:"10px 10px 8px"},children:[a.jsx(ic,{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(lc,{width:"auto",height:10,hue:m.h,pointer:dc,innerProps:{style:{marginLeft:1,marginRight:5}},onChange:N=>b(D({},m,N))}),!d&&a.jsx(Cn,{width:"auto",height:10,hsva:m,pointer:dc,style:{marginTop:4},innerProps:{style:{marginLeft:1,marginRight:5}},onChange:h})]}),!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(_.Fragment,{})})]})]}),c&&a.jsxs("div",{style:{display:"flex",margin:"0 10px 3px 10px"},children:[a.jsx(Ft,{label:"Hex",value:ra(m).replace(/^#/,"").toLocaleUpperCase(),onChange:(N,S)=>f(S),style:{minWidth:58}}),a.jsx(sc,{hsva:m,style:{marginLeft:6},aProps:d?!1:{},onChange:N=>b(N.hsva)})]}),s&&s.length>0&&a.jsx(cc,{style:j,colors:s,color:ra(m),onChange:N=>b(N),rectProps:{style:C}})]}))});uc.displayName="Sketch";const pc=({selectedColor:e,handleColor:t,text:r,wrapperStyles:n})=>a.jsxs("div",{style:n,className:"ecr-admin-control",children:[a.jsxs("p",{className:"ecr-admin-control__label",children:[r,":"]}),a.jsxs("div",{className:"ecr-admin-control__row ecr-admin-control__row--color",children:[a.jsxs(Je,{children:[a.jsx(Ze,{style:{padding:0,backgroundColor:"transparent"},children:a.jsx("div",{style:{backgroundColor:e},className:"ecr-admin-control__swatch"})}),a.jsx(Qe,{className:"ecr-admin-popover ecr-admin-color-selector-popover",children:a.jsx(uc,{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)})]})]}),Db=[{value:"left",title:"Align Left",Icon:pm},{value:"center",title:"Align Center",Icon:mm},{value:"right",title:"Align Right",Icon:fm},{value:"hidden",title:"Hidden",Icon:hm}],$b=({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:Db.map(({value:r,title:n,Icon:o})=>a.jsx(ne,{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))})]}),Fb=({styles:e,setStyles:t,setIsEdited:r})=>{const n=o=>{t(i=>{const s=o(i);return r(!0),s})};return a.jsxs("div",{className:"ecr-admin-group-title-customization__content",children:[a.jsx($b,{alignment:e.widgetTitle?.alignment??"hidden",handleWidgetTitleAlignment:o=>n(i=>({...i,widgetTitle:{...i.widgetTitle,alignment:o}}))}),a.jsx(pc,{selectedColor:e.widgetTitle?.color??"#000000",handleColor:o=>n(i=>({...i,widgetTitle:{...i.widgetTitle,color:o}})),text:"Title Color",wrapperStyles:{flexDirection:"row",justifyContent:"space-between",alignItems:"center"}}),a.jsx(ta,{label:"Font size",min:10,max:200,value:e?.widgetTitle?.fontSize??24,onChange:o=>n(i=>({...i,widgetTitle:{...i.widgetTitle,fontSize:o}})),name:"font_size",id:"font-size",hideSlider:!0,wrapperStyles:{flexDirection:"row",justifyContent:"space-between",alignItems:"center"}})]})},Bb=(e=700)=>{const[t,r]=_.useState(!1),n=_.useRef(null),o=_.useCallback(i=>{ql(i),r(!0),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{r(!1)},e)},[e]);return _.useEffect(()=>()=>{n.current&&clearTimeout(n.current)},[]),[t,o]},Ub=({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($p,{color:"#ffffff",size:12})}),a.jsx("span",{className:$("ecr-admin-shortcode__tooltip",t?"ecr-admin-shortcode__tooltip--visible":"ecr-admin-shortcode__tooltip--hidden"),children:"Copied!"})]})]})},mc=_.createContext({requestLeave:e=>e()}),Hb=({value:e,children:t})=>a.jsx(mc.Provider,{value:e,children:t}),fc=()=>_.useContext(mc);function Vb(e){return V({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(qb,{link:e,usedFor:t})}),qb=({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||wn,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||wn,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(Vb,{className:"ecr-product-card-one__star"}),Number(e.rating).toString()]}):null,a.jsx("div",{className:"ecr-product-card-one__price",dangerouslySetInnerHTML:{__html:e.price}})]})]})]})}),Gb=({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})})},Nn=({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(Gb,{link:e,usedFor:t},e.btn_uuid)}),Bt=({title:e,styles:t})=>a.jsx("p",{className:"ecr-reel_title",style:t,children:e}),hc=({reel:e,styles:t,gid:r,togglingId:n,onRemove:o})=>{const i=Ne(),{requestLeave:s}=fc(),l=n===e.story_uuid,c=`?view=${X.cr}&from=${X.mg}&sid=${e.id}${r?`&gid=${r}`:""}`,d=t.appearance??"overlay",u={border:`${t?.border?.border_width}px solid ${t?.border?.border_color}`,borderRadius:t?.shape==="rectangle"?`${t?.border?.border_radius}px`:"50%",aspectRatio:t?.shape==="rectangle"?"9/16":"1/1"},p=t.border.border_radius,m=p>50?p+16:p>20?p:0,g=e.links&&e.links.length>0?e.links[0]:null,b=d==="none",f=d==="title",h=t.shape==="rectangle",v=!b&&!f&&g;return a.jsxs("div",{className:$("ecr-admin-reelitem",t?.hoverEffect),children:[a.jsxs("div",{style:u,className:"ecr-admin-reelitem__frame",children:[a.jsx(to,{story:e,styles:t}),!b&&!f&&h?v?a.jsx(Nn,{link:g,usedFor:"admin",usedIn:"thumb",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"4px",width:"calc(100% - 8px)",borderRadius:"6px"}}):a.jsx(Bt,{title:e.title,styles:{width:`calc(95% - ${m}px)`}}):null,a.jsxs("div",{className:"ecr-admin-reelitem__actions",children:[a.jsx(ne,{title:"Edit Story",size:"icon-sm",asChild:!0,className:"ecr-admin-reelitem__button",disabled:l,children:a.jsx(vt,{to:c,className:$("ecr-admin-reelitem__link",l?"ecr-admin-reelitem__link--disabled":"ecr-admin-reelitem__link--active"),onClick:y=>{y.preventDefault(),s(()=>i(c))},children:a.jsx(Pr,{className:"ecr-admin-reelitem__icon"})})}),a.jsx(ne,{onClick:()=>o(e,"remove"),className:"ecr-admin-reelitem__button ecr-admin-reelitem__button--danger",size:"icon-sm",title:"Remove Story",disabled:l,children:l?a.jsx(it,{className:"ecr-admin-reelitem__spinner",size:18}):a.jsx(Gn,{size:18})})]})]}),f?a.jsx("p",{className:"ecr-admin-reel__title",children:e.title}):null]})},gc=(e,t)=>{const r=_.useRef(null),n=_.useRef(null),o=_.useRef(null),[i,s]=_.useState(!1),[l,c]=_.useState(!1),[d,u]=_.useState(!1),[p,m]=_.useState(300),g=()=>{const f=r.current;if(!f)return;const h=f.scrollLeft,v=f.scrollWidth,y=f.clientWidth;c(h>0),u(h+y<v-1)};_.useEffect(()=>{const f=r.current,h=n.current;f&&h&&(s(h.scrollWidth>f.clientWidth),m(f.clientWidth-100),g())},[e,t]);const b=f=>{const h=r.current;h&&(h.scrollBy({left:f,behavior:"smooth"}),o.current&&clearTimeout(o.current),o.current=setTimeout(g,300))};return _.useEffect(()=>{const f=r.current;if(!f)return;let h=!1,v,y;const w=A=>{h=!0,v=A.pageX-f.offsetLeft,y=f.scrollLeft,f.style.cursor="grabbing"},j=()=>{h=!1,f.style.cursor="default"},C=()=>{h=!1,f.style.cursor="default"},N=A=>{if(!h)return;A.preventDefault();const L=(A.pageX-f.offsetLeft-v)*1.5;f.scrollLeft=y-L,g()},S=A=>{h=!0,v=A.touches[0].pageX-f.offsetLeft,y=f.scrollLeft},E=()=>{h=!1},T=A=>{if(!h)return;const L=(A.touches[0].pageX-f.offsetLeft-v)*1.5;f.scrollLeft=y-L,g()};return f.addEventListener("mousedown",w),f.addEventListener("mouseleave",j),f.addEventListener("mouseup",C),f.addEventListener("mousemove",N),f.addEventListener("touchstart",S,{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",S),f.removeEventListener("touchend",E),f.removeEventListener("touchmove",T)}},[t]),_.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]),{thumbsContainerRef:r,thumbsWrapperRef:n,isOverflowing:i,canScrollLeft:l,canScrollRight:d,scrollBy:b,scrollStep:p}},xc=({reels:e,styles:t,gid:r,togglingId:n,handleRemoveReel:o})=>{const{thumbsContainerRef:i,thumbsWrapperRef:s,isOverflowing:l,canScrollLeft:c,canScrollRight:d,scrollBy:u,scrollStep:p}=gc([e],!0);return a.jsxs("div",{className:"ecr-admin-editor-carousel",children:[a.jsx("div",{ref:i,className:"ecr-admin-editor-carousel__viewport",children:a.jsx("div",{ref:s,style:{...!e.length&&{margin:"auto"}},className:$("ecr-admin-editor-carousel__track",t.hoverEffect==="zoom-in"&&"ecr-admin-editor-carousel__track--padded"),children:e.length>0?e.map(m=>a.jsx(hc,{reel:m,styles:t,gid:r,togglingId:n,onRemove:o},m.id)):a.jsx("div",{className:"ecr-admin-editor-carousel__empty",children:a.jsxs("p",{className:"ecr-admin-editor-carousel__empty-text",children:[a.jsx(lt,{className:"ecr-admin-editor-carousel__empty-icon"}),a.jsx("span",{children:"No reels have been added to this widget yet. Select some from the list on the left to get started."})]})})})}),l&&c&&a.jsx("button",{onClick:()=>u(-p),className:"ecr-admin-editor-carousel__nav ecr-admin-editor-carousel__nav--left",children:a.jsx(Vn,{size:20})}),l&&d&&a.jsx("button",{onClick:()=>u(p),className:"ecr-admin-editor-carousel__nav ecr-admin-editor-carousel__nav--right",children:a.jsx(Wn,{size:20})})]})},Kb=({reels:e,styles:t,gid:r,togglingId:n,handleRemoveReel:o})=>a.jsx("div",{className:$("ecr-admin-editor-grid",t?.hoverEffect==="zoom-in"&&"ecr-admin-editor-grid--padded"),children:e.length>0?e.map(i=>a.jsx(hc,{reel:i,styles:t,gid:r,togglingId:n,onRemove:o},i.id)):a.jsx("div",{className:"ecr-admin-editor-grid__empty",children:a.jsxs("p",{className:"ecr-admin-editor-grid__empty-text",children:[a.jsx(lt,{className:"ecr-admin-editor-grid__empty-icon"}),a.jsx("span",{children:"No reels have been added to this widget yet. Select some from the list on the left to get started."})]})})}),Yb=({reel:e,styles:t})=>{const r=Ar("(min-width: 1024px)"),n=e?.files?.[0],o=!!n?.mime_type?.startsWith("image"),[i,s]=_.useState(!1),[l,c]=_.useState(!0),[d,u]=_.useState(!1),p=_.useRef(null);_.useEffect(()=>{p.current&&(p.current.muted=l)},[l]),_.useEffect(()=>{p.current&&(i?p.current.pause():p.current.play().catch(()=>{}))},[i]);const m=()=>{p.current&&s(h=>!h)},g=()=>{p.current&&c(h=>!h)},b=t?.playerAppearance??"overlay",f=e.links&&e.links.length>0?e.links[0]:null;return a.jsxs("div",{className:"ecr-preview-player",children:[a.jsxs("div",{className:"ecr-preview-player__stage",children:[a.jsx(wt,{className:"ecr-player__nav--left ecr-preview-player__nav--disabled",type:"button",disabled:!0,"aria-disabled":"true",children:a.jsx(pi,{size:24})}),a.jsx(wt,{className:"ecr-player__nav--right ecr-preview-player__nav--disabled",type:"button",disabled:!0,"aria-disabled":"true",children:a.jsx(mi,{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,{size:r?20:24,className:"ecr-player__close-icon"})}),n?a.jsx("div",{className:"ecr-player__media-frame",children:o?a.jsx("img",{src:n.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:p,className:"ecr-preview-player__media-item",src:n.url,poster:e?.thumbnail,autoPlay:!0,muted:l,loop:!0,playsInline:!0,onClick:m,onLoadedMetadata:h=>{const v=h.currentTarget,y=v.videoWidth,w=v.videoHeight;u(()=>w>y)}}),a.jsxs("div",{className:"ecr-player__controls",children:[i?a.jsx(Jn,{size:r?20:24,className:"ecr-player__control-icon",onClick:m}):a.jsx(Xn,{size:r?20:24,className:"ecr-player__control-icon",onClick:m}),l?a.jsx(Qn,{size:r?20:24,className:"ecr-player__control-icon",onClick:g}):a.jsx(Zn,{size:r?20:24,className:"ecr-player__control-icon",onClick:g})]})]})}):a.jsx("div",{className:"ecr-preview-player__empty",children:"No preview available"})]}),b==="overlay"?f?a.jsx(Nn,{link:f,usedFor:"admin",usedIn:"thumb",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"8px",width:"95%",borderRadius:"6px"}}):a.jsx(Bt,{title:e.title}):null,b==="title"?a.jsx(Bt,{title:e.title}):null]}),a.jsxs("p",{className:"ecr-preview-message",children:["This is simply a ",a.jsx("strong",{children:"visual"})," representation intended to show how the preview will appear to end users."]})]})},Xb={carousel:xc,grid:Kb},Jb=({gid:e,reels:t,styles:r,handleRemoveReel:n,togglingId:o,currentTab:i})=>{const s=r.template??"carousel",l=Xb[s]||xc;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(Ub,{gid:e})]}),a.jsx("div",{className:"scrollbarThin ecr-admin-existing__body",children:i==="thumbnail"?a.jsx("div",{style:{"--thumbnail-size":`${r?.size}px`,"--thumbnail-size-tab":`${r?.sizeOnTab??r?.size}px`,"--thumbnail-size-mobile":`${r?.sizeOnMobile??r?.size}px`,"--thumbnail-gap":`${r?.gap}px`,"--thumbnail-gap-tab":`${r?.gapOnTab??r?.gap}px`,"--thumbnail-gap-mobile":`${r?.gapOnMobile??r?.gap}px`,"--thumbnail-border-radius":`${r?.border?.border_radius}px`},children:a.jsx(l,{reels:t,styles:r,gid:e,togglingId:o,handleRemoveReel:n})}):t.length>0?a.jsx(Yb,{reel:t[0],styles:r}):a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,alignItems:"center"},children:[a.jsx(lt,{style:{width:"40px",height:"40px",color:"#f59e0b"}}),"No reels available for preview."]})})]})},bc=()=>a.jsx("div",{className:"ecr-admin-reellist__loader",children:a.jsx("div",{className:"ecr-admin-reellist__spinner"})}),Zb=({gid:e,allReels:t,handleSelectReel:r,searchTerm:n,setSearchTerm:o,isSearching:i,togglingId:s,lastStoryElementRef:l})=>{const c=Ne(),{requestLeave:d}=fc(),u=`?view=${X.cr}&from=${X.mg}${e?`&gid=${e}`:""}`,p=t.filter(m=>!m?.files[0]?.mime_type.startsWith("image"));return a.jsxs("div",{className:"ecr-admin-reellist",children:[a.jsxs("div",{className:"ecr-admin-reellist__header",children:[a.jsx("p",{className:"ecr-admin-reellist__title",children:"All reels"}),a.jsx("small",{className:"ecr-admin-reellist__subtitle",children:"Choose reels to attach in this widget"})]}),a.jsxs("div",{className:"ecr-admin-reellist__body",children:[a.jsx(Rr,{to:u,text:"Add Reel",Icon:yt,className:"ecr-admin-reellist__add-button",textColor:"#2563eb",onNavigate:m=>d(()=>c(m))}),a.jsx("div",{className:"ecr-admin-reellist__search",children:a.jsx("input",{type:"text",placeholder:"Search reels...",value:n,onChange:m=>o(m.target.value),className:"ecr-admin-reellist__search-input"})}),a.jsx("div",{className:"scrollbarThin ecr-admin-reellist__grid",children:i&&t.length===0?a.jsx(bc,{}):a.jsxs("div",{className:"ecr-admin-reellist__items",children:[p.length===0?a.jsx("p",{className:"ecr-admin-reellist__empty",children:"No reels are available to add."}):p.map((m,g)=>a.jsx("div",{ref:p.length===g+1?l:null,className:"ecr-admin-reellist__item",children:a.jsxs("button",{title:"Click to add this reel",onClick:()=>r(m,"add"),disabled:s==m.story_uuid,className:"ecr-admin-reellist__card",children:[a.jsx("div",{className:"ecr-admin-reellist__media",children:a.jsx("video",{className:"ecr-admin-reellist__thumb",src:m?.files[0]?.url,poster:m?.thumbnail})}),a.jsx("span",{className:"ecr-admin-reellist__label",children:m.title||`Reel #${m.id}`}),s==m.story_uuid?a.jsx("div",{className:"ecr-admin-reellist__overlay",children:a.jsx(it,{className:"ecr-admin-reellist__overlay-icon"})}):null]})},m.id)),i&&t.length>0&&a.jsx(bc,{})]})})]})]})};function _c(e){const t=e+"CollectionProvider",[r,n]=Ve(t),[o,i]=r(t,{collectionRef:{current:null},itemMap:new Map}),s=f=>{const{scope:h,children:v}=f,y=_.useRef(null),w=_.useRef(new Map).current;return a.jsx(o,{scope:h,itemMap:w,collectionRef:y,children:v})};s.displayName=t;const l=e+"CollectionSlot",c=st(l),d=_.forwardRef((f,h)=>{const{scope:v,children:y}=f,w=i(l,v),j=J(h,w.collectionRef);return a.jsx(c,{ref:j,children:y})});d.displayName=l;const u=e+"CollectionItemSlot",p="data-radix-collection-item",m=st(u),g=_.forwardRef((f,h)=>{const{scope:v,children:y,...w}=f,j=_.useRef(null),C=J(h,j),N=i(u,v);return _.useEffect(()=>(N.itemMap.set(j,{ref:j,...w}),()=>void N.itemMap.delete(j))),a.jsx(m,{[p]:"",ref:C,children:y})});g.displayName=u;function b(f){const h=i(e+"CollectionConsumer",f);return _.useCallback(()=>{const y=h.collectionRef.current;if(!y)return[];const w=Array.from(y.querySelectorAll(`[${p}]`));return Array.from(h.itemMap.values()).sort((N,S)=>w.indexOf(N.ref.current)-w.indexOf(S.ref.current))},[h.collectionRef,h.itemMap])}return[{Provider:s,Slot:d,ItemSlot:g},b,n]}var Qb=x.createContext(void 0);function aa(e){const t=x.useContext(Qb);return e||t||"ltr"}var ia="rovingFocusGroup.onEntryFocus",e_={bubbles:!1,cancelable:!0},hr="RovingFocusGroup",[sa,vc,t_]=_c(hr),[r_,yc]=Ve(hr,[t_]),[n_,o_]=r_(hr),wc=x.forwardRef((e,t)=>a.jsx(sa.Provider,{scope:e.__scopeRovingFocusGroup,children:a.jsx(sa.Slot,{scope:e.__scopeRovingFocusGroup,children:a.jsx(a_,{...e,ref:t})})}));wc.displayName=hr;var a_=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:u=!1,...p}=e,m=x.useRef(null),g=J(t,m),b=aa(i),[f,h]=mt({prop:s,defaultProp:l??null,onChange:c,caller:hr}),[v,y]=x.useState(!1),w=We(d),j=vc(r),C=x.useRef(!1),[N,S]=x.useState(0);return x.useEffect(()=>{const E=m.current;if(E)return E.addEventListener(ia,w),()=>E.removeEventListener(ia,w)},[w]),a.jsx(n_,{scope:r,orientation:n,dir:b,loop:o,currentTabStopId:f,onItemFocus:x.useCallback(E=>h(E),[h]),onItemShiftTab:x.useCallback(()=>y(!0),[]),onFocusableItemAdd:x.useCallback(()=>S(E=>E+1),[]),onFocusableItemRemove:x.useCallback(()=>S(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:H(e.onMouseDown,()=>{C.current=!0}),onFocus:H(e.onFocus,E=>{const T=!C.current;if(E.target===E.currentTarget&&T&&!v){const A=new CustomEvent(ia,e_);if(E.currentTarget.dispatchEvent(A),!A.defaultPrevented){const R=j().filter(P=>P.focusable),L=R.find(P=>P.active),B=R.find(P=>P.id===f),O=[L,B,...R].filter(Boolean).map(P=>P.ref.current);Sc(O,u)}}C.current=!1}),onBlur:H(e.onBlur,()=>y(!1))})})}),jc="RovingFocusGroupItem",kc=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:o=!1,tabStopId:i,children:s,...l}=e,c=Ae(),d=i||c,u=o_(jc,r),p=u.currentTabStopId===d,m=vc(r),{onFocusableItemAdd:g,onFocusableItemRemove:b,currentTabStopId:f}=u;return x.useEffect(()=>{if(n)return g(),()=>b()},[n,g,b]),a.jsx(sa.ItemSlot,{scope:r,id:d,focusable:n,active:o,children:a.jsx(W.span,{tabIndex:p?0:-1,"data-orientation":u.orientation,...l,ref:t,onMouseDown:H(e.onMouseDown,h=>{n?u.onItemFocus(d):h.preventDefault()}),onFocus:H(e.onFocus,()=>u.onItemFocus(d)),onKeyDown:H(e.onKeyDown,h=>{if(h.key==="Tab"&&h.shiftKey){u.onItemShiftTab();return}if(h.target!==h.currentTarget)return;const v=l_(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?c_(w,j+1):w.slice(j+1)}setTimeout(()=>Sc(w))}}),children:typeof s=="function"?s({isCurrentTabStop:p,hasTabStop:f!=null}):s})})});kc.displayName=jc;var i_={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function s_(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function l_(e,t,r){const n=s_(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return i_[n]}function Sc(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function c_(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var d_=wc,u_=kc,En="Tabs",[p_]=Ve(En,[yc]),Cc=yc(),[m_,la]=p_(En),Nc=x.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,onValueChange:o,defaultValue:i,orientation:s="horizontal",dir:l,activationMode:c="automatic",...d}=e,u=aa(l),[p,m]=mt({prop:n,onChange:o,defaultProp:i??"",caller:En});return a.jsx(m_,{scope:r,baseId:Ae(),value:p,onValueChange:m,orientation:s,dir:u,activationMode:c,children:a.jsx(W.div,{dir:u,"data-orientation":s,...d,ref:t})})});Nc.displayName=En;var Ec="TabsList",Tc=x.forwardRef((e,t)=>{const{__scopeTabs:r,loop:n=!0,...o}=e,i=la(Ec,r),s=Cc(r);return a.jsx(d_,{asChild:!0,...s,orientation:i.orientation,dir:i.dir,loop:n,children:a.jsx(W.div,{role:"tablist","aria-orientation":i.orientation,...o,ref:t})})});Tc.displayName=Ec;var Ac="TabsTrigger",Pc=x.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,disabled:o=!1,...i}=e,s=la(Ac,r),l=Cc(r),c=Lc(s.baseId,n),d=Ic(s.baseId,n),u=n===s.value;return a.jsx(u_,{asChild:!0,...l,focusable:!o,active:u,children:a.jsx(W.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":d,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:c,...i,ref:t,onMouseDown:H(e.onMouseDown,p=>{!o&&p.button===0&&p.ctrlKey===!1?s.onValueChange(n):p.preventDefault()}),onKeyDown:H(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&s.onValueChange(n)}),onFocus:H(e.onFocus,()=>{const p=s.activationMode!=="manual";!u&&!o&&p&&s.onValueChange(n)})})})});Pc.displayName=Ac;var Oc="TabsContent",Rc=x.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,forceMount:o,children:i,...s}=e,l=la(Oc,r),c=Lc(l.baseId,n),d=Ic(l.baseId,n),u=n===l.value,p=x.useRef(u);return x.useEffect(()=>{const m=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(m)},[]),a.jsx(Ye,{present:o||u,children:({present:m})=>a.jsx(W.div,{"data-state":u?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!m,id:d,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:m&&i})})});Rc.displayName=Oc;function Lc(e,t){return`${e}-trigger-${t}`}function Ic(e,t){return`${e}-content-${t}`}var f_=Nc,h_=Tc,g_=Pc,x_=Rc;function b_({className:e,...t}){return a.jsx(f_,{"data-slot":"tabs",className:$("ecr-tabs",e),...t})}function __({className:e,...t}){return a.jsx(h_,{"data-slot":"tabs-list",className:$("ecr-tabs__list",e),...t})}function Mc({className:e,...t}){return a.jsx(g_,{"data-slot":"tabs-trigger",className:$("ecr-tabs__trigger",e),...t})}function zc({className:e,...t}){return a.jsx(x_,{"data-slot":"tabs-content",className:$("ecr-tabs__content",e),...t})}const Ut=({label:e,text:t})=>a.jsxs(Je,{children:[a.jsx(Ze,{style:{textAlign:"left",padding:0,backgroundColor:"transparent"},children:a.jsxs("label",{className:"ecr-admin-switch",children:[a.jsxs("span",{className:"ecr-admin-switch__label",children:[e,": ",a.jsx(at,{size:20})]}),a.jsx(mb,{className:"ecr-admin-switch__icon",size:24})]})}),a.jsx(Qe,{className:"ecr-admin-popover",children:a.jsx(ft,{name:e,text:t})})]});function Dc(e,[t,r]){return Math.min(r,Math.max(t,e))}function v_(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 $c=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"}),y_="VisuallyHidden",w_=x.forwardRef((e,t)=>a.jsx(W.span,{...e,ref:t,style:{...$c,...e.style}}));w_.displayName=y_;var j_=[" ","Enter","ArrowUp","ArrowDown"],k_=[" ","Enter"],gt="Select",[Tn,An,S_]=_c(gt),[Ht]=Ve(gt,[S_,on]),Pn=on(),[C_,tt]=Ht(gt),[N_,E_]=Ht(gt),Fc=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:o,onOpenChange:i,value:s,defaultValue:l,onValueChange:c,dir:d,name:u,autoComplete:p,disabled:m,required:g,form:b}=e,f=Pn(t),[h,v]=x.useState(null),[y,w]=x.useState(null),[j,C]=x.useState(!1),N=aa(d),[S,E]=mt({prop:n,defaultProp:o??!1,onChange:i,caller:gt}),[T,A]=mt({prop:s,defaultProp:l,onChange:c,caller:gt}),R=x.useRef(null),L=h?b||!!h.closest("form"):!0,[B,M]=x.useState(new Set),O=Array.from(B).map(P=>P.props.value).join(";");return a.jsx(Ys,{...f,children:a.jsxs(C_,{required:g,scope:t,trigger:h,onTriggerChange:v,valueNode:y,onValueNodeChange:w,valueNodeHasChildren:j,onValueNodeHasChildrenChange:C,contentId:Ae(),value:T,onValueChange:A,open:S,onOpenChange:E,dir:N,triggerPointerDownPosRef:R,disabled:m,children:[a.jsx(Tn.Provider,{scope:t,children:a.jsx(N_,{scope:e.__scopeSelect,onNativeOptionAdd:x.useCallback(P=>{M(z=>new Set(z).add(P))},[]),onNativeOptionRemove:x.useCallback(P=>{M(z=>{const I=new Set(z);return I.delete(P),I})},[]),children:r})}),L?a.jsxs(ld,{"aria-hidden":!0,required:g,tabIndex:-1,name:u,autoComplete:p,value:T,onChange:P=>A(P.target.value),disabled:m,form:b,children:[T===void 0?a.jsx("option",{value:""}):null,Array.from(B)]},O):null]})})};Fc.displayName=gt;var Bc="SelectTrigger",Uc=x.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...o}=e,i=Pn(r),s=tt(Bc,r),l=s.disabled||n,c=J(t,s.onTriggerChange),d=An(r),u=x.useRef("touch"),[p,m,g]=dd(f=>{const h=d().filter(w=>!w.disabled),v=h.find(w=>w.value===s.value),y=ud(h,f,v);y!==void 0&&s.onValueChange(y.value)}),b=f=>{l||(s.onOpenChange(!0),g()),f&&(s.triggerPointerDownPosRef.current={x:Math.round(f.pageX),y:Math.round(f.pageY)})};return a.jsx(Lo,{asChild:!0,...i,children:a.jsx(W.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":cd(s.value)?"":void 0,...o,ref:c,onClick:H(o.onClick,f=>{f.currentTarget.focus(),u.current!=="mouse"&&b(f)}),onPointerDown:H(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:H(o.onKeyDown,f=>{const h=p.current!=="";!(f.ctrlKey||f.altKey||f.metaKey)&&f.key.length===1&&m(f.key),!(h&&f.key===" ")&&j_.includes(f.key)&&(b(),f.preventDefault())})})})});Uc.displayName=Bc;var Hc="SelectValue",Vc=x.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,children:i,placeholder:s="",...l}=e,c=tt(Hc,r),{onValueNodeHasChildrenChange:d}=c,u=i!==void 0,p=J(t,c.onValueNodeChange);return le(()=>{d(u)},[d,u]),a.jsx(W.span,{...l,ref:p,style:{pointerEvents:"none"},children:cd(c.value)?a.jsx(a.Fragment,{children:s}):i})});Vc.displayName=Hc;var T_="SelectIcon",Wc=x.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...o}=e;return a.jsx(W.span,{"aria-hidden":!0,...o,ref:t,children:n||"▼"})});Wc.displayName=T_;var A_="SelectPortal",qc=e=>a.jsx(an,{asChild:!0,...e});qc.displayName=A_;var xt="SelectContent",Gc=x.forwardRef((e,t)=>{const r=tt(xt,e.__scopeSelect),[n,o]=x.useState();if(le(()=>{o(new DocumentFragment)},[]),!r.open){const i=n;return i?xr.createPortal(a.jsx(Kc,{scope:e.__scopeSelect,children:a.jsx(Tn.Slot,{scope:e.__scopeSelect,children:a.jsx("div",{children:e.children})})}),i):null}return a.jsx(Yc,{...e,ref:t})});Gc.displayName=xt;var Ce=10,[Kc,rt]=Ht(xt),P_="SelectContentImpl",O_=st("SelectContent.RemoveScroll"),Yc=x.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:s,side:l,sideOffset:c,align:d,alignOffset:u,arrowPadding:p,collisionBoundary:m,collisionPadding:g,sticky:b,hideWhenDetached:f,avoidCollisions:h,...v}=e,y=tt(xt,r),[w,j]=x.useState(null),[C,N]=x.useState(null),S=J(t,F=>j(F)),[E,T]=x.useState(null),[A,R]=x.useState(null),L=An(r),[B,M]=x.useState(!1),O=x.useRef(!1);x.useEffect(()=>{if(w)return Mo(w)},[w]),bo();const P=x.useCallback(F=>{const[Y,...se]=L().map(ae=>ae.ref.current),[Z]=se.slice(-1),ee=document.activeElement;for(const ae of F)if(ae===ee||(ae?.scrollIntoView({block:"nearest"}),ae===Y&&C&&(C.scrollTop=0),ae===Z&&C&&(C.scrollTop=C.scrollHeight),ae?.focus(),document.activeElement!==ee))return},[L,C]),z=x.useCallback(()=>P([E,w]),[P,E,w]);x.useEffect(()=>{B&&z()},[B,z]);const{onOpenChange:I,triggerPointerDownPosRef:q}=y;x.useEffect(()=>{if(w){let F={x:0,y:0};const Y=Z=>{F={x:Math.abs(Math.round(Z.pageX)-(q.current?.x??0)),y:Math.abs(Math.round(Z.pageY)-(q.current?.y??0))}},se=Z=>{F.x<=10&&F.y<=10?Z.preventDefault():w.contains(Z.target)||I(!1),document.removeEventListener("pointermove",Y),q.current=null};return q.current!==null&&(document.addEventListener("pointermove",Y),document.addEventListener("pointerup",se,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Y),document.removeEventListener("pointerup",se,{capture:!0})}}},[w,I,q]),x.useEffect(()=>{const F=()=>I(!1);return window.addEventListener("blur",F),window.addEventListener("resize",F),()=>{window.removeEventListener("blur",F),window.removeEventListener("resize",F)}},[I]);const[te,oe]=dd(F=>{const Y=L().filter(ee=>!ee.disabled),se=Y.find(ee=>ee.ref.current===document.activeElement),Z=ud(Y,F,se);Z&&setTimeout(()=>Z.ref.current.focus())}),ge=x.useCallback((F,Y,se)=>{const Z=!O.current&&!se;(y.value!==void 0&&y.value===Y||Z)&&(T(F),Z&&(O.current=!0))},[y.value]),_e=x.useCallback(()=>w?.focus(),[w]),pe=x.useCallback((F,Y,se)=>{const Z=!O.current&&!se;(y.value!==void 0&&y.value===Y||Z)&&R(F)},[y.value]),K=n==="popper"?ca:Xc,de=K===ca?{side:l,sideOffset:c,align:d,alignOffset:u,arrowPadding:p,collisionBoundary:m,collisionPadding:g,sticky:b,hideWhenDetached:f,avoidCollisions:h}:{};return a.jsx(Kc,{scope:r,content:w,viewport:C,onViewportChange:N,itemRefCallback:ge,selectedItem:E,onItemLeave:_e,itemTextRefCallback:pe,focusSelectedItem:z,selectedItemText:A,position:n,isPositioned:B,searchRef:te,children:a.jsx(hn,{as:O_,allowPinchZoom:!0,children:a.jsx(Gr,{asChild:!0,trapped:y.open,onMountAutoFocus:F=>{F.preventDefault()},onUnmountAutoFocus:H(o,F=>{y.trigger?.focus({preventScroll:!0}),F.preventDefault()}),children:a.jsx(qr,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:F=>F.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:a.jsx(K,{role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed",dir:y.dir,onContextMenu:F=>F.preventDefault(),...v,...de,onPlaced:()=>M(!0),ref:S,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:H(v.onKeyDown,F=>{const Y=F.ctrlKey||F.altKey||F.metaKey;if(F.key==="Tab"&&F.preventDefault(),!Y&&F.key.length===1&&oe(F.key),["ArrowUp","ArrowDown","Home","End"].includes(F.key)){let Z=L().filter(ee=>!ee.disabled).map(ee=>ee.ref.current);if(["ArrowUp","End"].includes(F.key)&&(Z=Z.slice().reverse()),["ArrowUp","ArrowDown"].includes(F.key)){const ee=F.target,ae=Z.indexOf(ee);Z=Z.slice(ae+1)}setTimeout(()=>P(Z)),F.preventDefault()}})})})})})})});Yc.displayName=P_;var R_="SelectItemAlignedPosition",Xc=x.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...o}=e,i=tt(xt,r),s=rt(xt,r),[l,c]=x.useState(null),[d,u]=x.useState(null),p=J(t,S=>u(S)),m=An(r),g=x.useRef(!1),b=x.useRef(!0),{viewport:f,selectedItem:h,selectedItemText:v,focusSelectedItem:y}=s,w=x.useCallback(()=>{if(i.trigger&&i.valueNode&&l&&d&&f&&h&&v){const S=i.trigger.getBoundingClientRect(),E=d.getBoundingClientRect(),T=i.valueNode.getBoundingClientRect(),A=v.getBoundingClientRect();if(i.dir!=="rtl"){const ee=A.left-E.left,ae=T.left-ee,ve=S.left-ae,bt=S.width+ve,_a=Math.max(bt,E.width),va=window.innerWidth-Ce,ya=Dc(ae,[Ce,Math.max(Ce,va-_a)]);l.style.minWidth=bt+"px",l.style.left=ya+"px"}else{const ee=E.right-A.right,ae=window.innerWidth-T.right-ee,ve=window.innerWidth-S.right-ae,bt=S.width+ve,_a=Math.max(bt,E.width),va=window.innerWidth-Ce,ya=Dc(ae,[Ce,Math.max(Ce,va-_a)]);l.style.minWidth=bt+"px",l.style.right=ya+"px"}const R=m(),L=window.innerHeight-Ce*2,B=f.scrollHeight,M=window.getComputedStyle(d),O=parseInt(M.borderTopWidth,10),P=parseInt(M.paddingTop,10),z=parseInt(M.borderBottomWidth,10),I=parseInt(M.paddingBottom,10),q=O+P+B+I+z,te=Math.min(h.offsetHeight*5,q),oe=window.getComputedStyle(f),ge=parseInt(oe.paddingTop,10),_e=parseInt(oe.paddingBottom,10),pe=S.top+S.height/2-Ce,K=L-pe,de=h.offsetHeight/2,F=h.offsetTop+de,Y=O+P+F,se=q-Y;if(Y<=pe){const ee=R.length>0&&h===R[R.length-1].ref.current;l.style.bottom="0px";const ae=d.clientHeight-f.offsetTop-f.offsetHeight,ve=Math.max(K,de+(ee?_e:0)+ae+z),bt=Y+ve;l.style.height=bt+"px"}else{const ee=R.length>0&&h===R[0].ref.current;l.style.top="0px";const ve=Math.max(pe,O+f.offsetTop+(ee?ge:0)+de)+se;l.style.height=ve+"px",f.scrollTop=Y-pe+f.offsetTop}l.style.margin=`${Ce}px 0`,l.style.minHeight=te+"px",l.style.maxHeight=L+"px",n?.(),requestAnimationFrame(()=>g.current=!0)}},[m,i.trigger,i.valueNode,l,d,f,h,v,i.dir,n]);le(()=>w(),[w]);const[j,C]=x.useState();le(()=>{d&&C(window.getComputedStyle(d).zIndex)},[d]);const N=x.useCallback(S=>{S&&b.current===!0&&(w(),y?.(),b.current=!1)},[w,y]);return a.jsx(I_,{scope:r,contentWrapper:l,shouldExpandOnScrollRef:g,onScrollButtonChange:N,children:a.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:j},children:a.jsx(W.div,{...o,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});Xc.displayName=R_;var L_="SelectPopperPosition",ca=x.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:o=Ce,...i}=e,s=Pn(r);return a.jsx(Xs,{...s,...i,ref:t,align:n,collisionPadding:o,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});ca.displayName=L_;var[I_,da]=Ht(xt,{}),ua="SelectViewport",Jc=x.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...o}=e,i=rt(ua,r),s=da(ua,r),l=J(t,i.onViewportChange),c=x.useRef(0);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),a.jsx(Tn.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:H(o.onScroll,d=>{const u=d.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:m}=s;if(m?.current&&p){const g=Math.abs(c.current-u.scrollTop);if(g>0){const b=window.innerHeight-Ce*2,f=parseFloat(p.style.minHeight),h=parseFloat(p.style.height),v=Math.max(f,h);if(v<b){const y=v+g,w=Math.min(b,y),j=y-w;p.style.height=w+"px",p.style.bottom==="0px"&&(u.scrollTop=j>0?j:0,p.style.justifyContent="flex-end")}}}c.current=u.scrollTop})})})]})});Jc.displayName=ua;var Zc="SelectGroup",[M_,z_]=Ht(Zc),D_=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=Ae();return a.jsx(M_,{scope:r,id:o,children:a.jsx(W.div,{role:"group","aria-labelledby":o,...n,ref:t})})});D_.displayName=Zc;var Qc="SelectLabel",$_=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=z_(Qc,r);return a.jsx(W.div,{id:o.id,...n,ref:t})});$_.displayName=Qc;var On="SelectItem",[F_,ed]=Ht(On),td=x.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:o=!1,textValue:i,...s}=e,l=tt(On,r),c=rt(On,r),d=l.value===n,[u,p]=x.useState(i??""),[m,g]=x.useState(!1),b=J(t,y=>c.itemRefCallback?.(y,n,o)),f=Ae(),h=x.useRef("touch"),v=()=>{o||(l.onValueChange(n),l.onOpenChange(!1))};if(n==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return a.jsx(F_,{scope:r,value:n,disabled:o,textId:f,isSelected:d,onItemTextChange:x.useCallback(y=>{p(w=>w||(y?.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,...s,ref:b,onFocus:H(s.onFocus,()=>g(!0)),onBlur:H(s.onBlur,()=>g(!1)),onClick:H(s.onClick,()=>{h.current!=="mouse"&&v()}),onPointerUp:H(s.onPointerUp,()=>{h.current==="mouse"&&v()}),onPointerDown:H(s.onPointerDown,y=>{h.current=y.pointerType}),onPointerMove:H(s.onPointerMove,y=>{h.current=y.pointerType,o?c.onItemLeave?.():h.current==="mouse"&&y.currentTarget.focus({preventScroll:!0})}),onPointerLeave:H(s.onPointerLeave,y=>{y.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:H(s.onKeyDown,y=>{c.searchRef?.current!==""&&y.key===" "||(k_.includes(y.key)&&v(),y.key===" "&&y.preventDefault())})})})})});td.displayName=On;var gr="SelectItemText",rd=x.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,...i}=e,s=tt(gr,r),l=rt(gr,r),c=ed(gr,r),d=E_(gr,r),[u,p]=x.useState(null),m=J(t,v=>p(v),c.onItemTextChange,v=>l.itemTextRefCallback?.(v,c.value,c.disabled)),g=u?.textContent,b=x.useMemo(()=>a.jsx("option",{value:c.value,disabled:c.disabled,children:g},c.value),[c.disabled,c.value,g]),{onNativeOptionAdd:f,onNativeOptionRemove:h}=d;return le(()=>(f(b),()=>h(b)),[f,h,b]),a.jsxs(a.Fragment,{children:[a.jsx(W.span,{id:c.textId,...i,ref:m}),c.isSelected&&s.valueNode&&!s.valueNodeHasChildren?xr.createPortal(i.children,s.valueNode):null]})});rd.displayName=gr;var nd="SelectItemIndicator",od=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return ed(nd,r).isSelected?a.jsx(W.span,{"aria-hidden":!0,...n,ref:t}):null});od.displayName=nd;var pa="SelectScrollUpButton",ad=x.forwardRef((e,t)=>{const r=rt(pa,e.__scopeSelect),n=da(pa,e.__scopeSelect),[o,i]=x.useState(!1),s=J(t,n.onScrollButtonChange);return le(()=>{if(r.viewport&&r.isPositioned){let l=function(){const d=c.scrollTop>0;i(d)};const c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),o?a.jsx(sd,{...e,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});ad.displayName=pa;var ma="SelectScrollDownButton",id=x.forwardRef((e,t)=>{const r=rt(ma,e.__scopeSelect),n=da(ma,e.__scopeSelect),[o,i]=x.useState(!1),s=J(t,n.onScrollButtonChange);return le(()=>{if(r.viewport&&r.isPositioned){let l=function(){const d=c.scrollHeight-c.clientHeight,u=Math.ceil(c.scrollTop)<d;i(u)};const c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),o?a.jsx(sd,{...e,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});id.displayName=ma;var sd=x.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...o}=e,i=rt("SelectScrollButton",r),s=x.useRef(null),l=An(r),c=x.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return x.useEffect(()=>()=>c(),[c]),le(()=>{l().find(u=>u.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),a.jsx(W.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:H(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(n,50))}),onPointerMove:H(o.onPointerMove,()=>{i.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(n,50))}),onPointerLeave:H(o.onPointerLeave,()=>{c()})})}),B_="SelectSeparator",U_=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return a.jsx(W.div,{"aria-hidden":!0,...n,ref:t})});U_.displayName=B_;var fa="SelectArrow",H_=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=Pn(r),i=tt(fa,r),s=rt(fa,r);return i.open&&s.position==="popper"?a.jsx(Js,{...o,...n,ref:t}):null});H_.displayName=fa;var V_="SelectBubbleInput",ld=x.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const o=x.useRef(null),i=J(n,o),s=v_(t);return x.useEffect(()=>{const l=o.current;if(!l)return;const c=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(c,"value").set;if(s!==t&&u){const p=new Event("change",{bubbles:!0});u.call(l,t),l.dispatchEvent(p)}},[s,t]),a.jsx(W.select,{...r,style:{...$c,...r.style},ref:i,defaultValue:t})});ld.displayName=V_;function cd(e){return e===""||e===void 0}function dd(e){const t=We(e),r=x.useRef(""),n=x.useRef(0),o=x.useCallback(s=>{const l=r.current+s;t(l),(function c(d){r.current=d,window.clearTimeout(n.current),d!==""&&(n.current=window.setTimeout(()=>c(""),1e3))})(l)},[t]),i=x.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return x.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,o,i]}function ud(e,t,r){const o=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,i=r?e.indexOf(r):-1;let s=W_(e,Math.max(i,0));o.length===1&&(s=s.filter(d=>d!==r));const c=s.find(d=>d.textValue.toLowerCase().startsWith(o.toLowerCase()));return c!==r?c:void 0}function W_(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var q_=Fc,G_=Uc,K_=Vc,Y_=Wc,X_=qc,J_=Gc,Z_=Jc,Q_=td,ev=rd,tv=od,rv=ad,nv=id;function Vt({...e}){return a.jsx(q_,{"data-slot":"select",...e})}function Wt({...e}){return a.jsx(K_,{"data-slot":"select-value",...e})}function qt({className:e,size:t="default",children:r,...n}){return a.jsxs(G_,{"data-slot":"select-trigger","data-size":t,className:$("ecr-select__trigger",e),...n,children:[r,a.jsx(Y_,{asChild:!0,children:a.jsx(Yn,{className:"ecr-select__icon"})})]})}function Gt({className:e,children:t,position:r="popper",align:n="center",...o}){const i=typeof document<"u"?document.getElementById("ecommreels-admin-app")??document.body:void 0;return a.jsx(X_,{container:i,children:a.jsxs(J_,{"data-slot":"select-content",className:$("ecr-select__content",e),position:r,align:n,...o,children:[a.jsx(ov,{}),a.jsx(Z_,{className:$("ecr-select__viewport"),children:t}),a.jsx(av,{})]})})}function Kt({className:e,children:t,...r}){return a.jsxs(Q_,{"data-slot":"select-item",className:$("ecr-select__item",e),...r,children:[a.jsx("span",{className:"ecr-select__check",children:a.jsx(tv,{children:a.jsx(zp,{className:"ecr-select__check-icon"})})}),a.jsx(ev,{children:t})]})}function ov({className:e,...t}){return a.jsx(rv,{"data-slot":"select-scroll-up-button",className:$("ecr-select__scroll-button",e),...t,children:a.jsx(Dp,{className:"ecr-select__icon"})})}function av({className:e,...t}){return a.jsx(nv,{"data-slot":"select-scroll-down-button",className:$("ecr-select__scroll-button",e),...t,children:a.jsx(Yn,{className:"ecr-select__icon"})})}const iv=({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(Vt,{value:e,onValueChange:t,children:[a.jsx(qt,{className:"ecr-admin-control__trigger",children:a.jsx(Wt,{placeholder:"Layout"})}),a.jsx(Gt,{children:Ju.map(r=>a.jsx(Kt,{value:r.value,className:"ecr-admin-control__option",children:r.label},r.value))})]})]}),sv={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 lv(){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(Vt,{defaultValue:ti[0].value,children:[a.jsx(qt,{className:"ecr-admin-control__trigger",children:a.jsx(Wt,{placeholder:"Layout"})}),a.jsxs(Gt,{children:[ti.map(e=>a.jsx(Kt,{value:e.value,className:"ecr-admin-control__option",children:e.label},e.value)),Ku.map(e=>a.jsx("div",{children:a.jsxs(Je,{modal:!0,children:[a.jsxs(Ze,{className:"ecr-admin-control__lock-trigger",children:[a.jsx("span",{className:"ecr-admin-control__option",children:e.label}),a.jsx(at,{size:18})]}),a.jsx(Qe,{className:"ecr-admin-control__popover",children:a.jsx(ft,{name:e.label,text:sv[e.value]})})]})},e.value))]})]})]})}const cv=({styles:e,updateStyles:t})=>a.jsxs("div",{className:"ecr-admin-thumb-controls",children:[a.jsx(Ut,{label:"Disable Preview",text:a.jsx(a.Fragment,{children:"Turn off previews for a cleaner look and a more focused browsing experience!"})}),a.jsx(lv,{}),a.jsx(iv,{appearance:e?.playerAppearance??"overlay",handleLinkLayout:r=>t(n=>({...n,playerAppearance:r}))})]});var Rn="Collapsible",[dv]=Ve(Rn),[uv,ha]=dv(Rn),pd=x.forwardRef((e,t)=>{const{__scopeCollapsible:r,open:n,defaultOpen:o,disabled:i,onOpenChange:s,...l}=e,[c,d]=mt({prop:n,defaultProp:o??!1,onChange:s,caller:Rn});return a.jsx(uv,{scope:r,disabled:i,contentId:Ae(),open:c,onOpenToggle:x.useCallback(()=>d(u=>!u),[d]),children:a.jsx(W.div,{"data-state":xa(c),"data-disabled":i?"":void 0,...l,ref:t})})});pd.displayName=Rn;var md="CollapsibleTrigger",fd=x.forwardRef((e,t)=>{const{__scopeCollapsible:r,...n}=e,o=ha(md,r);return a.jsx(W.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":xa(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...n,ref:t,onClick:H(e.onClick,o.onOpenToggle)})});fd.displayName=md;var ga="CollapsibleContent",hd=x.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=ha(ga,e.__scopeCollapsible);return a.jsx(Ye,{present:r||o.open,children:({present:i})=>a.jsx(pv,{...n,ref:t,present:i})})});hd.displayName=ga;var pv=x.forwardRef((e,t)=>{const{__scopeCollapsible:r,present:n,children:o,...i}=e,s=ha(ga,r),[l,c]=x.useState(n),d=x.useRef(null),u=J(t,d),p=x.useRef(0),m=p.current,g=x.useRef(0),b=g.current,f=s.open||l,h=x.useRef(f),v=x.useRef(void 0);return x.useEffect(()=>{const y=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(y)},[]),le(()=>{const y=d.current;if(y){v.current=v.current||{transitionDuration:y.style.transitionDuration,animationName:y.style.animationName},y.style.transitionDuration="0s",y.style.animationName="none";const w=y.getBoundingClientRect();p.current=w.height,g.current=w.width,h.current||(y.style.transitionDuration=v.current.transitionDuration,y.style.animationName=v.current.animationName),c(n)}},[s.open,n]),a.jsx(W.div,{"data-state":xa(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!f,...i,ref:u,style:{"--radix-collapsible-content-height":m?`${m}px`:void 0,"--radix-collapsible-content-width":b?`${b}px`:void 0,...e.style},children:f&&o})});function xa(e){return e?"open":"closed"}var mv=pd,fv=fd,hv=hd;function gd({className:e,...t}){return a.jsx(mv,{"data-slot":"collapsible",className:$("ecr-collapsible",e),...t})}function xd({className:e,children:t,...r}){return a.jsxs(fv,{"data-slot":"collapsible-trigger",className:$("ecr-collapsible__trigger",e),...r,children:[a.jsx("span",{className:"ecr-collapsible__trigger-label",children:t}),a.jsx(Yn,{className:"ecr-collapsible__trigger-icon"})]})}function bd({className:e,...t}){return a.jsx(hv,{"data-slot":"collapsible-content",className:$("ecr-collapsible__content",e),...t})}const gv={modern:a.jsx(a.Fragment,{children:"Give your reel’s product card a sleek, modern appearance that feels fresh, clean, and visually engaging."}),classic:a.jsx(a.Fragment,{children:"Give your reel’s product card a timeless, classic appearance that feels familiar, simple, and easy to recognize."})},xv=({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(Vt,{value:e,onValueChange:t,children:[a.jsx(qt,{className:"ecr-admin-control__trigger",children:a.jsx(Wt,{placeholder:"Layout"})}),a.jsxs(Gt,{children:[Yu.map(r=>a.jsx(Kt,{value:r.value,className:"ecr-admin-control__option",children:r.label},r.value)),Xu.map(r=>a.jsx("div",{children:a.jsxs(Je,{modal:!0,children:[a.jsxs(Ze,{className:"ecr-admin-control__lock-trigger",children:[a.jsx("span",{className:"ecr-admin-control__option",children:r.label}),a.jsx(at,{size:18})]}),a.jsx(Qe,{className:"ecr-admin-control__popover",children:a.jsx(ft,{name:r.label,text:gv[r.value]})})]})},r.value))]})]})]}),bv=[{Icon:Vp,label:"Desktop",value:"desktop"},{Icon:Yp,label:"Tab",value:"tab"},{Icon:qp,label:"Mobile",value:"mobile"}],_d=({label:e,min:t,max:r,value:n,onChange:o,name:i,id:s,wrapperStyles:l,hideSlider:c,device:d,setDevice:u})=>{const[p,m]=_.useState(n),g=_.useRef(null);_.useEffect(()=>{m(n)},[n]);const b=h=>{const v=Math.min(r,Math.max(t,Number(h)));o(v)},f=h=>{const v=Number(h);m(v),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{b(v>r?r:v<t?t:v)},1e3)};return a.jsxs("div",{style:l,className:"ecr-admin-range",children:[a.jsxs("label",{htmlFor:s,className:"ecr-admin-range__label",children:[e,":",a.jsxs(Vt,{value:d,onValueChange:h=>u(h),children:[a.jsx(qt,{style:{padding:"4px 4px 0px",height:"24px",gap:"4px"},children:a.jsx(Wt,{})}),a.jsx(Gt,{style:{minWidth:"60px"},children:bv.map(h=>a.jsx(Kt,{value:h.value,title:h.label,children:a.jsx(h.Icon,{size:16})},h.value))})]})]}),a.jsxs("div",{className:"ecr-admin-range__row",children:[!c&&a.jsx("input",{type:"range",id:s,name:i,min:t,max:r,value:n,onChange:h=>{const v=Number(h.target.value);m(v),b(v)},className:"ecr-admin-range__slider"}),a.jsxs("div",{className:"ecr-admin-range__value",children:[a.jsx(ea,{type:"number",min:t,max:r,value:p,onChange:h=>f(h.target.value)}),a.jsx("span",{className:"ecr-admin-range__unit",children:"px"})]})]})]})},_v=({styles:e,updateStyles:t})=>{const[r,n]=_.useState("desktop"),i={mobile:e?.gapOnMobile,tab:e?.gapOnTab,desktop:e?.gap}[r]??e?.gap,s=l=>{switch(r){case"mobile":t(c=>({...c,gapOnMobile:l}));break;case"tab":t(c=>({...c,gapOnTab:l}));break;default:t(c=>({...c,gap:l}));break}};return a.jsx(_d,{label:"Gap",min:0,max:80,value:i,onChange:s,name:"column_gap",id:"column-gap",device:r,setDevice:n})},vv=({styles:e,updateStyles:t})=>{const[r,n]=_.useState("desktop"),i={mobile:e?.sizeOnMobile,tab:e?.sizeOnTab,desktop:e?.size}[r]??e?.size,s=l=>{switch(r){case"mobile":t(c=>({...c,sizeOnMobile:l}));break;case"tab":t(c=>({...c,sizeOnTab:l}));break;default:t(c=>({...c,size:l}));break}};return a.jsx(_d,{label:"Size",min:150,max:400,value:i,onChange:s,name:"size",id:"size",device:r,setDevice:n})},yv=[{value:"rectangle",label:"Rectangle"},{value:"circle",label:"Circle"}],wv=({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:yv.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(bm,{color:"#2563eb",size:16}):a.jsx(_m,{color:"#8c95a9",size:16}),n.label]})]},n.value))})]})},jv=Object.values(ei),kv={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!"})},Sv=({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(Vt,{value:e,onValueChange:t,children:[a.jsx(qt,{className:"ecr-admin-control__trigger",children:a.jsx(Wt,{placeholder:"Layout"})}),a.jsxs(Gt,{children:[jv.map(r=>a.jsx(Kt,{value:r,className:"ecr-admin-control__option",children:r},r)),qu.map(r=>a.jsx("div",{children:a.jsxs(Je,{modal:!0,children:[a.jsxs(Ze,{className:"ecr-admin-control__lock-trigger",children:[a.jsx("span",{className:"ecr-admin-control__option",children:r}),a.jsx(at,{size:18})]}),a.jsx(Qe,{className:"ecr-admin-control__popover",children:a.jsx(ft,{name:r,text:kv[r]})})]})},r))]})]})]}),Cv=({isLayoutOpen:e,handleSectionOpen:t,styles:r,updateStyles:n})=>a.jsxs(gd,{open:e,className:"ecr-admin-thumb-controls__section",children:[a.jsxs(xd,{className:"ecr-admin-thumb-controls__section-trigger",type:"button",onClick:()=>t("layout"),children:[a.jsx(Bp,{size:16})," ",a.jsx("span",{children:"Layout"})]}),a.jsxs(bd,{className:"ecr-admin-thumb-controls__section-content",children:[a.jsx(wv,{selectedShape:r?.shape,handleShape:o=>n(i=>({...i,shape:o}))}),a.jsx(Sv,{selectedLayout:r?.template??"carousel",handleLayout:o=>n(i=>({...i,template:o}))}),a.jsx(xv,{linkLayout:r?.appearance??"overlay",handleLinkLayout:o=>n(i=>({...i,appearance:o}))}),a.jsx(vv,{styles:r,updateStyles:n}),a.jsx(_v,{styles:r,updateStyles:n}),a.jsx(Ut,{label:"Show Ratings",text:a.jsx(a.Fragment,{children:"Hide Ratings to remove distractions and provide a cleaner, more focused visual experience!"})}),a.jsx(Ut,{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(Ut,{label:"Autoplay",text:a.jsx(a.Fragment,{children:"Enable autoplay for videos on your product and pages, capturing users' attention instantly!"})}),a.jsx(Ut,{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(Ut,{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!"})})]})]}),Nv=({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(Vt,{value:e,onValueChange:t,children:[a.jsx(qt,{className:"ecr-admin-control__trigger",children:a.jsx(Wt,{placeholder:"Layout"})}),a.jsx(Gt,{children:Gu.map(r=>a.jsx(Kt,{value:r.value,className:"ecr-admin-control__option",children:r.label},r.value))})]})]}),Ev=({isStyleOpen:e,handleSectionOpen:t,styles:r,updateStyles:n})=>a.jsxs(gd,{open:e,className:"ecr-admin-thumb-controls__section",children:[a.jsxs(xd,{className:"ecr-admin-thumb-controls__section-trigger",type:"button",onClick:()=>t("style"),children:[a.jsx(Wp,{size:16}),a.jsx("span",{children:"Styles"})]}),a.jsxs(bd,{className:"ecr-admin-thumb-controls__section-content",children:[a.jsx(ta,{label:"Border Width",min:0,max:12,value:r?.border?.border_width??0,onChange:o=>n(i=>({...i,border:{...i.border,border_width:o}})),name:"border_width",id:"border-width"}),a.jsx(pc,{selectedColor:r?.border?.border_color,handleColor:o=>n(i=>({...i,border:{...i.border,border_color:o}})),text:"Border Color"}),r?.shape==="rectangle"&&a.jsx(ta,{label:"Border Radius",min:0,max:99,value:r?.border?.border_radius??0,onChange:o=>n(i=>({...i,border:{...i.border,border_radius:o}})),name:"border_radius",id:"border-radius"}),a.jsx(Nv,{hoverEffect:r?.hoverEffect||"none",handleHoverEffect:o=>n(i=>({...i,hoverEffect:o}))})]})]}),Tv=({styles:e,updateStyles:t})=>{const[r,n]=_.useState("layout"),o=r==="layout",i=r==="style",s=l=>{n(r!==l?l:null)};return a.jsxs("div",{className:"ecr-admin-thumb-controls",children:[a.jsx(Cv,{handleSectionOpen:s,isLayoutOpen:o,styles:e,updateStyles:t}),a.jsx(Ev,{isStyleOpen:i,handleSectionOpen:s,styles:e,updateStyles:t})]})},Av=({styles:e,setStyles:t,isExpanded:r,setIsExpanded:n,setIsEdited:o,tabs:i,currentTab:s,setCurrentTab:l})=>{const c=u=>{t(p=>{const m=u(p);return o(!0),m})},d=u=>{(u===i.thumbnail||u===i.preview)&&l(u)};return a.jsxs("div",{className:$("ecr-admin-sidepanel",r?"ecr-admin-sidepanel--expanded":"ecr-admin-sidepanel--collapsed"),children:[r&&a.jsx("div",{className:"ecr-admin-mobile-overlay",onClick:()=>n(!1)}),a.jsxs("div",{className:"ecr-admin-sidepanel-content",children:[a.jsxs("div",{className:"ecr-admin-sidepanel__header",children:[a.jsx("p",{className:"ecr-admin-sidepanel__title",children:"Customization"}),a.jsx("small",{className:"ecr-admin-sidepanel__subtitle",children:"Customize your widget however you like"})]}),a.jsx("div",{className:"ecr-admin-sidepanel__body",children:a.jsxs(b_,{value:s,onValueChange:d,className:"ecr-admin-sidepanel__tabs",children:[a.jsxs(__,{className:"ecr-admin-sidepanel__tabs-list",children:[a.jsx(Mc,{value:i.thumbnail,children:"Thumbnail"}),a.jsx(Mc,{value:i.preview,children:"Preview"})]}),a.jsx(zc,{value:i.thumbnail,children:a.jsx(Tv,{styles:e,updateStyles:c})}),a.jsx(zc,{value:i.preview,children:a.jsx(cv,{styles:e,updateStyles:c})})]})})]})]})},Pv=e=>{const t=Ne(),[r,n]=_.useState(""),[o,i]=_.useState([]),[s,l]=_.useState(ot),[c,d]=_.useState(!0),[u,p]=_.useState(!1),[m,g]=_.useState(!1);_.useEffect(()=>{(async()=>{if(!e){d(!1);return}d(!0);try{const y=(await he.get(`stories/${e}`)).data;n(y.group_name),i(y.stories),l(y.styles??ot)}catch(v){v instanceof Error?G.error(v.message):G.error("Something went wrong. Try again later!")}finally{d(!1)}})()},[e]);const b=async h=>{const v=o.map(j=>j.id),y={group_name:r,styles:s,story_ids:v};e&&(y.group_id=e);const w=await he.post("stories/manage-group-stories",y);if(!e){const j=w.data.group_id;t(`?view=${X.mg}&gid=${j}`,{replace:!0})}return{...w.data,isNewGroup:!e}};return{groupTitle:r,setGroupTitle:n,thisGroupReels:o,setThisGroupReels:i,styles:s,setStyles:l,isLoading:c,isSaving:u,isEdited:m,setIsEdited:g,handleSave:async()=>{try{p(!0);const h=await b();return g(!1),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)}}}},Ov=e=>{const[t,r]=_.useState(!1),n=_.useRef(null),o=_.useRef(null),i=_.useRef(!1),s=_.useRef(typeof window<"u"?window.location.hash:"");return _.useEffect(()=>{e||(n.current=null,o.current=null,r(!1))},[e]),_.useEffect(()=>{if(!e)return;const p=m=>{m.preventDefault(),m.returnValue=""};return window.addEventListener("beforeunload",p),()=>window.removeEventListener("beforeunload",p)},[e]),_.useEffect(()=>{const p=()=>{const m=window.location.hash;if(!e){s.current=m;return}if(i.current){i.current=!1,s.current=m;return}m!==s.current&&(o.current=m,window.location.hash=s.current,r(!0))};return window.addEventListener("hashchange",p),()=>window.removeEventListener("hashchange",p)},[e]),{showLeaveModal:t,requestLeave:p=>{if(!e){p();return}n.current=p,r(!0)},confirmLeave:()=>{if(r(!1),n.current){const p=n.current;n.current=null,i.current=!0,p();return}if(o.current){const p=o.current;o.current=null,i.current=!0,window.location.hash=p}},cancelLeave:()=>{n.current=null,o.current=null,r(!1)},allowNextNavigation:p=>{i.current=!0,p()}}},vd={thumbnail:"thumbnail",preview:"preview"},Rv=()=>{const e=Ne(),[t]=Zt(),r=t.get("gid"),n=Ar("(min-width: 1024px)"),{groupTitle:o,setGroupTitle:i,thisGroupReels:s,setThisGroupReels:l,styles:c,setStyles:d,isLoading:u,isSaving:p,isEdited:m,setIsEdited:g,handleSave:b}=Pv(r),{allReels:f,searchTerm:h,setSearchTerm:v,isSearching:y,lastStoryElementRef:w,refreshReels:j}=as(r),[C,N]=_.useState(""),[S,E]=_.useState(n),[T,A]=_.useState(vd.thumbnail),[R,L]=_.useState([]),B=_.useMemo(()=>new Set(s.map(K=>K.story_uuid)),[s]),M=_.useMemo(()=>h.trim().toLowerCase(),[h]),O=_.useMemo(()=>M?R.filter(K=>K.title.toLowerCase().includes(M)):R,[R,M]),P=_.useMemo(()=>{const K=new Map;for(const de of O)K.set(de.story_uuid,de);for(const de of f)K.has(de.story_uuid)||K.set(de.story_uuid,de);return Array.from(K.values())},[O,f]),z=_.useMemo(()=>P.filter(K=>!B.has(K.story_uuid)),[P,B]);_.useEffect(()=>{E(n)},[n]),_.useEffect(()=>{L([])},[r]);const{showLeaveModal:I,requestLeave:q,confirmLeave:te,cancelLeave:oe,allowNextNavigation:ge}=Ov(m),_e=async(K,de)=>{try{N(K.story_uuid);const F=de==="add"?[K,...s]:s.filter(Y=>Y.story_uuid!==K.story_uuid);l(F),L(de==="add"?Y=>Y.filter(se=>se.story_uuid!==K.story_uuid):Y=>Y.some(se=>se.story_uuid===K.story_uuid)?Y:[K,...Y]),g(!0)}catch(F){F instanceof Error?G.error(F.message):G.error("Something went wrong. Please try again later!")}finally{N("")}},pe=async()=>{const K=await b();K&&(L([]),j()),K?.isNewGroup&&ge(()=>{e(`?view=${X.mg}&gid=${K.group_id}`,{replace:!0})})};return u?a.jsx(Lr,{}):a.jsxs(Hb,{value:{requestLeave:q},children:[a.jsx(kt,{left:[a.jsx(St,{name:"Manage Widget",Icon:Pr},"page"),a.jsx(tr,{cb:()=>q(()=>e(`?view=${X.ag}`))},"back")],center:[a.jsxs("div",{className:"ecr-admin-group-title__wrapper",children:[a.jsx(is,{placeholder:"Enter group title",title:o,setTitle:i,setIsEdited:g,style:{paddingInline:"32px"}}),o&&a.jsxs(Go,{children:[a.jsx(Ko,{className:"ecr-admin-group-title-customization__trigger",children:a.jsx(hb,{})}),a.jsxs(Yo,{className:"ecr-admin-group-title-customization-dialog",children:[a.jsx(Xo,{children:a.jsx(Jo,{children:"Customize title appearance"})}),a.jsx(Fb,{styles:c,setStyles:d,setIsEdited:g}),a.jsx("div",{style:{display:"flex",justifyContent:"end",marginTop:40},children:a.jsx($0,{asChild:!0,children:a.jsx(ne,{style:{paddingInline:40},variant:"outline",children:"Ok"})})})]})]})]},"title")],right:[a.jsx(fb,{isExpanded:S,setIsExpanded:E},"toggle"),a.jsx(ho,{onSave:pe,isSaving:p,disabled:!m},"save")],rightClass:"ecr-admin-nav-btn-reverse"}),a.jsx(rr,{breads:[{label:"Dashboard",href:`?view=${X.ag}`},{label:"Manage Widget"}],onNavigate:K=>q(()=>e(K))}),a.jsxs("div",{className:"ecr-admin-group-edit",children:[a.jsx(Zb,{allReels:z,gid:r,handleSelectReel:_e,searchTerm:h,setSearchTerm:v,isSearching:y,togglingId:C,lastStoryElementRef:w}),a.jsx(Jb,{gid:r,reels:s,styles:c,handleRemoveReel:_e,togglingId:C,currentTab:T}),S&&a.jsx(Av,{isExpanded:S,setIsExpanded:E,setIsEdited:g,styles:c,setStyles:d,tabs:vd,setCurrentTab:A,currentTab:T})]}),I&&a.jsx(Or,{onReject:oe,onAccept:te,isLoading:!1,message:"You have unsaved changes. Leave this page without saving?"})]})};function Lv(){const[e]=Zt(),t=e.get("view")||X.ag;let r;switch(t){case X.settings:r=a.jsx(lb,{});break;case X.ar:r=a.jsx(Jf,{});break;case X.stat:r=a.jsx(ub,{});break;case X.cr:r=a.jsx(Z0,{});break;case X.mg:r=a.jsx(Rv,{});break;default:r=a.jsx(ib,{})}return a.jsxs("div",{children:[r,a.jsx(Wu,{position:"top-right",toastOptions:{style:{padding:"16px",marginTop:"24px",fontSize:"16px"}}})]})}const yd=async(e,t,r,n={})=>{try{if(await he.post(`group/${e}/story/${t}/view`),n.isActive&&!n.isActive())return;r(o=>({...o,[t]:Number(o[t]||0)+1}))}catch{}},wd=e=>!!e?.files?.[0]?.mime_type?.startsWith("video"),Iv=()=>{const e=_.useContext(ba);if(!e)throw new Error("useVideoPlayer must be used inside PublicStoryContext");const{styles:t,stories:r,groupId:n,isPlaying:o,setIsPlaying:i,setStoryViews:s}=e,[l,c]=_.useState(r.length-1),[d,u]=_.useState(null),[p,m]=_.useState(!0),[g,b]=_.useState(0),[f,h]=_.useState(!1),[v,y]=_.useState(!1),[w,j]=_.useState({index:0,story_uuid:r[0]?.story_uuid??""}),C=d?.links&&d.links.length>0?d.links[0]:null,N=t?.playerAppearance??"overlay",S=_.useRef({bodyOverflow:"",bodyPosition:"",bodyTop:"",bodyWidth:"",bodyScrollBehavior:"",htmlOverflow:"",htmlScrollBehavior:"",scrollY:0}),E=_.useCallback((O,P=1)=>{if(r.length===0)return null;let z=O;for(let I=0;I<r.length;I+=1){const q=r[z];if(wd(q))return{story:q,index:z};z=(z+P+r.length)%r.length}return null},[r]),T=_.useCallback(()=>{c(r.length-1);const O=r.findIndex(I=>String(I.story_uuid)===o),P=O>=0?r[O]:null,z=wd(P)?{story:P,index:O}:E(Math.max(O,0),1);if(!z?.story){u(null),m(!1);return}u(z.story),O!==z.index&&z.story.story_uuid!==o&&i(z.story.story_uuid),j({index:0,story_uuid:z.story.story_uuid}),m(!1)},[E,o,i,r]);_.useEffect(()=>{T()},[T]),_.useEffect(()=>{const{body:O,documentElement:P}=document;return S.current={bodyOverflow:O.style.overflow,bodyPosition:O.style.position,bodyTop:O.style.top,bodyWidth:O.style.width,bodyScrollBehavior:O.style.scrollBehavior,htmlOverflow:P.style.overflow,htmlScrollBehavior:P.style.scrollBehavior,scrollY:window.scrollY},P.style.overflow="hidden",O.style.overflow="hidden",O.style.position="fixed",O.style.top=`-${S.current.scrollY}px`,O.style.width="100%",()=>{const z=S.current;P.style.overflow=z.htmlOverflow,O.style.overflow=z.bodyOverflow,O.style.position=z.bodyPosition,O.style.top=z.bodyTop,O.style.width=z.bodyWidth,P.style.scrollBehavior="auto",O.style.scrollBehavior="auto",window.scrollTo({top:z.scrollY,left:0,behavior:"auto"}),P.style.scrollBehavior=z.htmlScrollBehavior,O.style.scrollBehavior=z.bodyScrollBehavior}},[]);const A=_.useCallback(()=>{i(null)},[i]),R=_.useCallback((O=1)=>{m(!0);const P=r.findIndex(oe=>String(oe.story_uuid)===String(o)),z=O>0?1:-1,I=O>0?l>P?P+1:0:P>0?P-1:l,q=E(I,z);if(!q?.story){m(!1);return}const te=q.story;if(te.story_uuid===o){m(!1),A();return}j({index:0,story_uuid:te.story_uuid}),n&&yd(n,te.id,s),i(te.story_uuid),m(!1)},[A,E,n,o,l,i,s,r]),L=_.useCallback(()=>{const O=d?.files??[];if(w.index>0){j(P=>({index:P.index-1,story_uuid:O[P.index-1].story_uuid??""}));return}R(-1)},[w.index,R,d?.files]),B=_.useCallback(()=>{const O=d?.files??[];if(w.index+1<O.length){j(P=>({index:P.index+1,story_uuid:O[P.index+1].story_uuid??""}));return}R(1)},[w.index,R,d?.files]),M=_.useCallback(O=>{O.target===O.currentTarget&&A()},[A]);return{closePlayer:A,currentFileIndex:w,duration:g,handleBackdropClick:M,handleNextFile:B,handlePrevFile:L,isLoadingNext:p,isMuted:v,isPaused:f,playingStory:d,setDuration:b,setIsPaused:h,setIsMuted:y,setIsPlaying:i,firstLink:C,playerAppearance:N}},Mv=()=>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"})]})})}),zv=()=>{const e=Ar("(min-width: 1024px)"),{closePlayer:t,currentFileIndex:r,duration:n,handleBackdropClick:o,handleNextFile:i,handlePrevFile:s,isLoadingNext:l,isMuted:c,isPaused:d,playerAppearance:u,playingStory:p,firstLink:m,setDuration:g,setIsMuted:b,setIsPaused:f,setIsPlaying:h}=Iv();return a.jsx("div",{onClick:o,className:"ecommreels-story-modal ecr-player",children:p&&a.jsxs("div",{className:"ecr-player__stage",children:[a.jsx(wt,{onClick:s,className:"ecr-player__nav--left",children:a.jsx(pi,{size:24})}),a.jsx(wt,{onClick:i,className:"ecr-player__nav--right",children:a.jsx(mi,{size:24})}),a.jsxs("div",{id:"player",className:"ecr-player__frame",children:[p&&a.jsx(ci,{playingStory:p,duration:n,currentFileIndex:r,isPaused:d},`${p.story_uuid}-${r.index}`),a.jsx("div",{onClick:t,className:"ecr-player__close",children:a.jsx(er,{size:e?20:24,className:"ecr-player__close-icon"})}),l?a.jsx(Mv,{}):p?.files.length>0&&a.jsx(xi,{currentFileIndex:r,files:p?.files,setDuration:g,setIsPlaying:h,isPaused:d,setIsPaused:f,isMuted:c,setIsMuted:b,handlePrevFile:s,handleNextFile:i,storyId:p.id,storyTitle:p?.title}),u==="overlay"?m?a.jsx(Nn,{link:m,usedFor:"user",usedIn:"player",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"8px",width:"95%",borderRadius:"6px"}}):a.jsx(Bt,{title:p.title}):null,u==="title"?a.jsx(Bt,{title:p.title}):null]})]})})},jd=({story:e,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o})=>{const i=t.appearance??"overlay",s=e.links&&e.links.length>0?e.links[0]:null,l=i==="none",c=i==="title",d=t.shape==="rectangle",u=!l&&!c&&s,p=t.border.border_radius,m=p>50?p+16:p>20?p:0;return a.jsxs("div",{className:`ecr-thumb ${t.hoverEffect??""}`,children:[a.jsxs("div",{onClick:()=>r({sid:e.id,story_uuid:e.story_uuid}),className:"ecr-thumb__frame",style:{border:`${t?.border?.border_width}px solid ${t?.border?.border_color}`,borderRadius:t.shape==="rectangle"?`${t?.border?.border_radius}px`:"50%",aspectRatio:t.shape==="rectangle"?"9/16":"1/1"},children:[a.jsx(to,{story:e,styles:t,storyViews:n,setStoryViews:o}),!l&&!c&&d?u?a.jsx(Nn,{link:s,usedFor:"user",usedIn:"thumb",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"4px",width:"calc(100% - 8px)",borderRadius:"6px"}}):a.jsx(Bt,{title:e.title,styles:{width:`calc(95% - ${m}px)`}}):null]}),c?a.jsx("p",{className:"ecr-reel__title",children:e.title}):null]})},Dv=({stories:e,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o})=>{const{thumbsContainerRef:i,thumbsWrapperRef:s,isOverflowing:l,canScrollLeft:c,canScrollRight:d,scrollBy:u,scrollStep:p}=gc([e],!0);return a.jsxs("div",{className:"ecr-front-carousel",children:[a.jsx("div",{ref:i,className:"ecr-front-carousel__viewport",children:a.jsx("div",{ref:s,className:t.hoverEffect==="zoom-in"?"ecr-front-carousel__track ecr-front-carousel__track--zoom":"ecr-front-carousel__track",children:e?.map(m=>m?.files[0]?.mime_type.startsWith("video")?a.jsx(jd,{story:m,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o},m.story_uuid):null)})}),l&&c&&a.jsx("button",{onClick:()=>u(-p),className:"ecr-front-carousel__nav ecr-front-carousel__nav--left",children:a.jsx(Vn,{size:20,style:{width:"20px",height:"20px"}})}),l&&d&&a.jsx("button",{onClick:()=>u(p),className:"ecr-front-carousel__nav ecr-front-carousel__nav--right",children:a.jsx(Wn,{size:20,style:{width:"20px",height:"20px"}})})]})},kd=({stories:e,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o})=>a.jsx("div",{className:"ecr-front-grid",children:a.jsx("div",{style:{padding:t.hoverEffect==="zoom-in"?16:0},className:"ecr-front-grid__list",children:e?.map(i=>i?.files[0]?.mime_type.startsWith("video")?a.jsx(jd,{story:i,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o},i.story_uuid):null)})}),$v={carousel:Dv,grid:kd},Fv=()=>{const e=_.useContext(ba),{groupTitle:t,styles:r,stories:n,groupId:o,setIsPlaying:i,storyViews:s,setStoryViews:l}=e,c=_.useRef(!0);_.useEffect(()=>(c.current=!0,()=>{c.current=!1}),[]);const d=r.template??"carousel",u=$v[d]||kd,p=({sid:m,story_uuid:g})=>{i(g),o&&yd(o,m,l,{isActive:()=>c.current})};return a.jsxs("div",{style:{"--thumbnail-size":r.template==="grid"?"auto":`${r?.size}px`,"--thumbnail-size-grid":`${r?.size}px`,"--thumbnail-size-tab":r.template==="grid"?"auto":`${r?.sizeOnTab??r?.size}px`,"--thumbnail-size-grid-tab":`${r?.sizeOnTab??r?.size}px`,"--thumbnail-size-mobile":r.template==="grid"?"auto":`${r?.sizeOnMobile??r?.size}px`,"--thumbnail-size-grid-mobile":`${r?.sizeOnMobile??r?.size}px`,"--thumbnail-gap":`${r?.gap}px`,"--thumbnail-gap-tab":`${r?.gapOnTab??r?.gap}px`,"--thumbnail-gap-mobile":`${r?.gapOnMobile??r?.gap}px`,"--thumbnail-border-radius":`${r?.border?.border_radius}px`},children:[r?.widgetTitle&&r?.widgetTitle?.alignment!=="hidden"&&t?a.jsx("h2",{style:{textAlign:r.widgetTitle?.alignment,fontSize:r.widgetTitle?.fontSize,color:r.widgetTitle?.color,marginBottom:24},children:t}):null,a.jsx(u,{stories:n,styles:r,handlePlaying:p,storyViews:s,setStoryViews:l})]})},Bv=e=>{const[t,r]=_.useState(""),[n,o]=_.useState([]),[i,s]=_.useState(ot),[l,c]=_.useState(!1),[d,u]=_.useState(null),p=_.useCallback(async()=>{const m=e?.trim();if(!m){o([]),s(ot),c(!1),u(null);return}const g=new AbortController;c(!0),u(null);try{const b=await he.get(`stories/${m}`,{signal:g.signal});if(g.signal.aborted)return;r(b.data.group_name),o(b.data.stories),s(b.data.styles||ot)}catch(b){if(g.signal.aborted)return;u(b)}finally{c(!1)}return()=>{g.abort()}},[e]);return _.useEffect(()=>{p()},[e]),{groupTitle:t,stories:n,styles:i,isLoading:l,error:d}},ba=_.createContext(void 0),Sd=({groupId:e})=>{const[t,r]=_.useState(null),[n,o]=_.useState({}),{groupTitle:i,stories:s,styles:l}=Bv(e);return a.jsxs(ba.Provider,{value:{groupTitle:i,groupId:e,stories:s,styles:l,isPlaying:t,setIsPlaying:r,storyViews:n,setStoryViews:o},children:[t&&a.jsx(zv,{}),a.jsx(Fv,{})]})};wa(()=>{const e=document.getElementById("ecommreels-admin-app");e&&Ln.createRoot(e).render(a.jsx(eu,{children:a.jsx(Lv,{})}))}),wa(()=>{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(Sd,{groupId:o}))}),t.forEach(r=>{const n=r,o=n.dataset.id;if(!o)return;Ln.createRoot(n).render(a.jsx(Sd,{groupId:o}))})})})(React,wp.domReady,wp.element,ReactDOM);402 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",O0=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${$l(P0).contentName}}.`;return x.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},R0=Cl,L0=El,I0=Al,M0=Pl,z0=Ol,D0=Ll,Fl=zl;function Go({...e}){return a.jsx(R0,{"data-slot":"dialog",...e})}function Ko({...e}){return a.jsx(L0,{"data-slot":"dialog-trigger",...e})}function $0({...e}){const t=typeof document<"u"?document.getElementById("ecommreels-admin-app")??document.body:void 0;return a.jsx(I0,{"data-slot":"dialog-portal",container:t,...e})}function F0({className:e,...t}){return a.jsx(M0,{"data-slot":"dialog-overlay",className:$("ecr-dialog__overlay",e),...t})}function Yo({className:e,children:t,...r}){return a.jsxs($0,{children:[a.jsx(F0,{}),a.jsxs(z0,{"data-slot":"dialog-content",className:$("ecr-dialog__content",e),...r,children:[t,a.jsx(Fl,{className:"ecr-dialog__close","aria-label":"Close dialog",children:a.jsx(er,{className:"ecr-dialog__close-icon"})})]})]})}function Xo({className:e,...t}){return a.jsx("div",{className:$("ecr-dialog__header",e),...t})}function Jo({className:e,...t}){return a.jsx(D0,{"data-slot":"dialog-title",className:$("ecr-dialog__title",e),...t})}function B0({...e}){return a.jsx(Fl,{"data-slot":"dialog-close",...e})}const U0=(e={})=>{const{enabled:t=!0}=e,r=typeof ecommreelsInfo<"u"?ecommreelsInfo?.url:"",n=typeof ecommreelsInfo<"u"?ecommreelsInfo?.nonce:"",[o,i]=_.useState([]),[s,l]=_.useState(1),[c,d]=_.useState(!0),[u,p]=_.useState(!1),[m,g]=_.useState(!1),[b,f]=_.useState(""),h=fo(b,500),v=_.useRef(!0),y=_.useRef(0),w=_.useRef(null),[j,C]=_.useState(null),N=_.useCallback(async T=>{if(!r||!n){C("Missing API configuration."),g(!1),p(!1);return}const A=++y.current;w.current&&w.current.abort();const R=new AbortController;w.current=R,T===1&&v.current?g(!0):p(!0);try{const L={page:T,per_page:50};h&&(L.search=h);const B=await re.get(`${r}wc/v3/products`,{headers:{"X-WP-Nonce":n},withCredentials:!0,params:L,signal:R.signal}),M=B.data,O=parseInt(B.headers["x-wp-totalpages"]||"1",10);A===y.current&&(i(P=>T===1?M:[...P,...M]),l(T+1),d(T<O))}catch(L){if(R.signal.aborted)return;L instanceof Error?C(L.message):C("An unknown error occurred")}finally{v.current&&(v.current=!1),A===y.current&&!R.signal.aborted&&(p(!1),g(!1))}},[h,n,r]);_.useEffect(()=>{t&&(l(1),i([]),C(null),v.current=!0,N(1))},[h,N,t]);const S=_.useRef(null),E=_.useCallback(T=>{u||(S.current&&S.current.disconnect(),S.current=new IntersectionObserver(A=>{A[0].isIntersecting&&c&&N(s)}),T&&S.current.observe(T))},[u,c,s,N]);return _.useEffect(()=>()=>{S.current&&S.current.disconnect(),w.current&&w.current.abort()},[]),{products:o,setProducts:i,searchTerm:b,setSearchTerm:f,isSearching:u,isLoading:m,error:j,lastProductElementRef:E}},wn="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",Bl=({name:e,handleClick:t})=>a.jsx("button",{onClick:t,className:$("ecr-button ecr-button--sm",e==="add"?"ecr-button--primary":"ecr-button--danger"),children:e}),H0=({handleLinks:e,taggedProducts:t,products:r,isSearching:n,isLoading:o,lastProductElementRef:i,searchTerm:s,setSearchTerm:l,error:c})=>{const[d,u]=_.useState(t.map(f=>f.product_id)),[p,m]=_.useState(!1),g=f=>{m(!1),u(h=>h.includes(f.id)?h.filter(v=>v!==f.id):[f.id])},b=f=>{if(f.preventDefault(),d.length===0){m(!0);return}const h=new Set(d),v=[];for(const y of r)h.has(y.id)&&v.push({btn_type:"product",btn_uuid:_n(),buttonText:y.name,buttonUrl:y.permalink,rating:y.average_rating,price:y.price_html,thumbnail:y.images?.[0]?.thumbnail||y.images?.[0]?.src||wn,product_id:y.id});e(v),u([])};return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"ecr-admin-product-link__search",children:a.jsx("input",{type:"text",placeholder:"Search products...",value:s,onChange:f=>l(f.target.value),className:"ecr-admin-product-link__search-input"})}),a.jsx("div",{className:"scrollbarThin ecr-admin-product-link__list",children:o&&r.length===0?a.jsx(Ul,{}):a.jsxs("div",{className:"ecr-admin-product-link__list-inner",children:[r.length===0?a.jsx("p",{className:"ecr-admin-product-link__empty",children:c||"No products are available to add."}):r.map((f,h)=>{const v=d.includes(f.id);return a.jsx("div",{ref:r.length===h+1?i:null,className:"ecr-admin-product-link__item",style:d.length>0&&!v?{opacity:.5,pointerEvents:"none"}:{},children:a.jsxs(ne,{type:"button",onClick:()=>g(f),className:$("ecr-admin-product-link__button",v?"ecr-admin-product-link__button--selected":"ecr-admin-product-link__button--unselected"),children:[v?a.jsx(Yp,{size:20,color:"#2563eb"}):a.jsx(Xp,{size:20,color:"#8c95a9"}),a.jsx("img",{className:"ecr-admin-product-link__thumb",src:f.images?.[0]?.thumbnail||f.images?.[0]?.src||wn,alt:"Product thumbnail"}),a.jsx("span",{children:f.name||`Product #${f.id}`})]})},f.id)}),n&&r.length>0&&a.jsx(Ul,{})]})}),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(Bl,{name:"add",handleClick:b})})]})]})},Ul=()=>a.jsx("div",{className:"ecr-admin-product-link__loader",children:a.jsx("div",{className:"ecr-admin-product-link__spinner"})}),V0=/^(https?|ftp):\/\/[^\s/$.?#].[^\s]*$/i,W0=({handleLinks:e})=>{const[t,r]=_.useState(""),[n,o]=_.useState(""),[i,s]=_.useState(""),[l,c]=_.useState(!0),[d,u]=_.useState(""),[p,m]=_.useState([]),g=()=>{const b=[];t||b.push("text"),n&&V0.test(n)||b.push("url"),i||b.push("campaign"),m(b),!(b.length>0)&&e({btn_type:"custom",btn_uuid:_n(),buttonText:t,buttonUrl:n,openInNewTab:l,campaignName:i,customClass:d,clickCount:0})};return a.jsxs(a.Fragment,{children:[a.jsxs("div",{children:[a.jsx(jn,{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(jn,{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(jn,{error:p.includes("campaign"),type:"text",name:"campaignName",label:"Campaign Name",placeholder:"e.g Summer sale",value:i,setValue:s}),p.includes("campaign")&&a.jsx("p",{className:"ecr-admin-link__error",children:"Campaign name is required!"})]}),a.jsxs("div",{className:"ecr-admin-link__toggle",children:[a.jsx("input",{checked:l,onChange:b=>c(b.target.checked),className:"ecr-admin-link__checkbox",type:"checkbox",name:"",id:"newTab"}),a.jsx("label",{className:"ecr-admin-link__toggle-label",htmlFor:"newTab",children:"Open in new tab"})]}),a.jsx("div",{children:a.jsx(jn,{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(Bl,{name:"add",handleClick:g})})]})};function jn({error:e,type:t,name:r,label:n,placeholder:o,value:i,setValue:s}){return a.jsxs(a.Fragment,{children:[a.jsx("label",{className:"ecr-admin-link__label",htmlFor:r,children:n}),a.jsx("input",{id:r,name:r,type:t,placeholder:o,value:i,onChange:l=>s(l.target.value),className:$("ecr-admin-link__input",e?"ecr-admin-link__input--error":"ecr-admin-link__input--normal")})]})}const q0=({setLinks:e,linkCount:t,linkType:r,links:n})=>{const[o,i]=_.useState(null),[s,l]=_.useState(!1),c=U0({enabled:s}),d=t===0||r==="Link",u=t===0||r==="Product",p=n.filter(g=>g.btn_type==="product"),m=()=>l(!0);return a.jsxs(a.Fragment,{children:[t?a.jsx(bn,{}):null,a.jsx("div",{className:"ecr-admin-link-tabs",children:a.jsxs("div",{className:"ecr-admin-link-tabs__list",children:[d&&a.jsxs(Go,{open:o==="custom",onOpenChange:g=>i(g?"custom":null),children:[a.jsxs(Ko,{className:"ecr-admin-link-tabs__trigger",children:[a.jsx(Vp,{size:20})," Add Custom Link"]}),a.jsxs(Yo,{className:"ecr-admin-link-dialog",children:[a.jsx(Xo,{children:a.jsx(Jo,{children:"Add Custom Link"})}),a.jsx("div",{className:"ecr-admin-link-tabs__content",children:a.jsx(W0,{handleLinks:g=>{e(b=>[...b,g]),i(null)}})})]})]}),u&&a.jsxs(Go,{open:o==="product",onOpenChange:g=>i(g?"product":null),children:[a.jsxs(Ko,{className:"ecr-admin-link-tabs__trigger",onMouseEnter:m,children:[a.jsx(Zp,{size:20})," Tag Products"]}),a.jsxs(Yo,{className:"ecr-admin-link-dialog",children:[a.jsx(Xo,{children:a.jsx(Jo,{children:"Select Products"})}),a.jsx("div",{className:"ecr-admin-link-tabs__content",children:a.jsx(H0,{handleLinks:g=>{e(g),i(null)},taggedProducts:p,products:c.products,isSearching:c.isSearching,isLoading:c.isLoading,lastProductElementRef:c.lastProductElementRef,searchTerm:c.searchTerm,setSearchTerm:c.setSearchTerm,error:c.error})})]})]})]})})]})},G0=({links:e,onLinksChange:t})=>{const r=o=>{t(i=>i.filter(s=>s.btn_uuid!==o))},n=e[0]?.btn_type==="product"?"Product":"Link";return a.jsxs("div",{className:"ecr-admin-links",children:[a.jsx("p",{className:"ecr-admin-links__title",children:`${n}${e.length>1?"s":""}`}),e.length>0?a.jsxs(a.Fragment,{children:[e.map(o=>a.jsxs("div",{className:`ecr-admin-links__item ${o.btn_type==="custom"?o.customClass??"":""}`,children:[a.jsx("span",{children:o.buttonText}),a.jsx(ne,{onClick:()=>r(o.btn_uuid),size:"icon-sm",variant:"link",className:"ecr-admin-links__remove",children:a.jsx(Qp,{size:16})})]},o.btn_uuid)),a.jsxs(Je,{children:[a.jsxs(Ze,{className:"ecr-admin-links__upgrade",children:["+ Add Another ",a.jsx(at,{size:20})]}),a.jsx(Qe,{className:"ecr-admin-links__popover",children:a.jsx(ft,{name:"Multiple Links",text:a.jsx(a.Fragment,{children:"Unlock the ability to add multiple custom links, seamlessly redirecting users to your pages from the videos!"})})})]})]}):a.jsx(q0,{setLinks:t,linkCount:e.length,linkType:n,links:e})]})},K0=({togglePlayPause:e,isMuted:t,file:r,videoRef:n,onEnded:o})=>{const[i,s]=_.useState(!1);return a.jsx("video",{ref:n,className:$("ecr-admin-reelvideo",i?"ecr-admin-reelvideo--portrait":"ecr-admin-reelvideo--landscape"),src:r?.url,muted:t,playsInline:!0,preload:"metadata",onClick:e,autoPlay:!0,draggable:!1,onEnded:o,onError:o,"webkit-playsinline":"true",onLoadedMetadata:l=>{const c=l.currentTarget,d=c.videoWidth,u=c.videoHeight;s(()=>u>d)}})},Y0=({index:e,setIsAttemptingDelete:t,file:r,file_uuid:n,dragStart:o,dragEnter:i,dragEnd:s})=>{const[l,c]=_.useState(!0),[d,u]=_.useState(!1),p=_.useRef(null),m=()=>{p.current&&(d?p.current.play():p.current.pause(),u(b=>!b))},g=()=>{p.current&&(p.current.muted=!l,c(b=>!b))};return a.jsxs("div",{draggable:!0,onDragStart:()=>o(e),onDragEnter:()=>i(e),onDragEnd:s,className:$("ecr-admin-customization__panel"),children:[a.jsx(er,{className:"ecr-admin-customization__remove",size:20,onClick:()=>t(n)}),a.jsx(K0,{togglePlayPause:m,isMuted:l,file:r,videoRef:p,onEnded:()=>u(!0)}),a.jsxs("div",{className:"ecr-admin-customization__controls",children:[d?a.jsx(Jn,{size:18,className:"ecr-admin-customization__control",onClick:m}):a.jsx(Xn,{size:18,className:"ecr-admin-customization__control",onClick:m}),l?a.jsx(Qn,{size:18,className:"ecr-admin-customization__control",onClick:g}):a.jsx(Zn,{size:18,className:"ecr-admin-customization__control",onClick:g})]})]})},X0=({uploadedFiles:e,setIsAttemptingDelete:t,setUploadedFiles:r})=>{const n=_.useRef(null),o=_.useRef(null),i=c=>{n.current=c},s=c=>{o.current=c},l=()=>{if(n.current===null||o.current===null)return;const c=[...e],d=c[n.current];c.splice(n.current,1),c.splice(o.current,0,d),n.current=null,o.current=null,r(c)};return a.jsxs("div",{className:"ecr-admin-customization",children:[e.map((c,d)=>a.jsx(Y0,{setIsAttemptingDelete:t,file:c,file_uuid:c.file_uuid,index:d,dragStart:i,dragEnter:s,dragEnd:l},d)),a.jsxs(Je,{children:[a.jsxs(Ze,{className:"ecr-admin-customization__add",children:[a.jsx("img",{className:"ecr-admin-customization__icon",src:Uo,alt:"Upload"}),a.jsx("span",{className:"ecr-admin-customization__label",children:"Upload another video"}),a.jsx(at,{size:20,className:"ecr-admin-customization__lock"})]}),a.jsx(Qe,{side:"right",className:"ecr-admin-customization__popover",children:a.jsx(ft,{name:"Multiple Videos",text:a.jsxs(a.Fragment,{children:["Unlock the power of ",a.jsx("strong",{children:"Multiple Video"})," uploads, boosting engagement and variety in every Reels!"]})})})]})]})};function J0(e){return V({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 Z0=({setUploadedFiles:e,setThumbnail:t,usedFor:r="video",mode:n="files",multiple:o=!1,className:i})=>{const[s,l]=_.useState(!1),c=()=>{const d=window.wp.media({title:"Select image or video files",button:{text:"Use this file"},multiple:o,library:{type:[r]}});d.on("select",()=>{const u=d.state().get("selection").toJSON();if(n==="thumbnail"){const m=u[0];m&&t&&t(m.url);return}if(!e)return;const p=u.map(m=>({url:m.url,mime_type:m.mime,file_uuid:_n()}));e(m=>[...m,...p])}),d.open()};return a.jsx("div",{className:$("ecr-admin-upload",s?"ecr-admin-upload--active":"ecr-admin-upload--idle",i),onDragOver:d=>{d.preventDefault(),l(!0)},onDragLeave:()=>l(!1),onDrop:d=>{d.preventDefault(),l(!1),c()},children:a.jsxs("label",{className:"ecr-admin-upload__label",htmlFor:"file",onClick:c,children:[a.jsx("img",{className:"ecr-admin-upload__icon",src:Uo,alt:"Upload"}),a.jsx("span",{className:"ecr-admin-upload__text",children:s?a.jsx("span",{className:"ecr-admin-upload__text-strong",children:"Drop files here..."}):a.jsxs("span",{className:"ecr-admin-upload__text-stack",children:[a.jsxs("span",{className:"ecr-admin-upload__text-item",children:["Upload ",r]}),n==="files"?a.jsx("span",{className:"ecr-admin-upload__text-item",children:"Click or Drag and drop files here"}):null]})})]})})},Q0=({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(J0,{className:"ecr-admin-thumbnail__remove",size:20,onClick:()=>t(null)})]}):a.jsx(Z0,{mode:"thumbnail",usedFor:"image",setThumbnail:t,className:"ecr-admin-thumbnail__uploader"})]}),eb=()=>{const e=Ne(),[t]=Zt(),r=_.useMemo(()=>t.get("sid"),[t]),n=_.useRef(null),[o,i]=_.useState({files:[],title:"",links:[],thumbnail:null}),[s,l]=_.useState(!1),[c,d]=_.useState(null),u=_.useCallback(h=>{i(v=>({...v,title:typeof h=="function"?h(v.title):h}))},[]),p=_.useCallback(h=>{i(v=>({...v,files:typeof h=="function"?h(v.files):h}))},[]),m=_.useCallback(h=>{i(v=>({...v,links:typeof h=="function"?h(v.links):h}))},[]),g=_.useCallback(h=>{i(v=>({...v,thumbnail:typeof h=="function"?h(v.thumbnail):h}))},[]),b=()=>{c&&(p(h=>h.filter(v=>v.file_uuid!==c)),d(null))},f=_.useCallback(async h=>{try{l(!0);const v=await he.get(`story/${h}`);i({title:v.data.title,files:v.data.files,links:v.data.links,thumbnail:v.data.thumbnail})}catch(v){v instanceof Error?G.error(v.message):G.error("Something went wrong. Try again later!"),n.current=setTimeout(()=>e(-1),1e3)}finally{l(!1)}},[e]);return _.useEffect(()=>{r&&f(r)},[r,f]),_.useEffect(()=>()=>{n.current&&clearTimeout(n.current)},[]),s?a.jsx(Lr,{}):a.jsxs(a.Fragment,{children:[a.jsx(th,{uploadedFiles:o.files,links:o.links,thumbnail:o.thumbnail,storyTitle:o.title,setStoryTitle:u}),a.jsxs("div",{className:"ecr-admin-create",children:[a.jsxs("div",{className:"ecr-admin-create__panel ecr-admin-create__panel--main",children:[a.jsx("p",{className:"ecr-admin-create__title",children:"Select video"}),c&&a.jsx(Or,{onReject:()=>d(null),onAccept:b,isLoading:!1,message:"Are you sure, You want to remove this file?"}),o.files.length>0?a.jsx(X0,{uploadedFiles:o.files,setUploadedFiles:p,setIsAttemptingDelete:d}):a.jsx(w0,{setUploadedFiles:p})]}),a.jsxs("div",{className:"ecr-admin-create__panel ecr-admin-create__panel--side",children:[a.jsx(Q0,{thumbnail:o.thumbnail,onThumbnailChange:g}),a.jsx(bn,{className:"ecr-admin-create__separator"}),a.jsx(G0,{links:o.links,onLinksChange:m})]})]})]})};function Hl(e){return V({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 Vl=({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 Zo,Wl;function tb(){return Wl||(Wl=1,Zo=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()}}),Zo}var Qo,ql;function rb(){if(ql)return Qo;ql=1;var e=tb(),t={"text/plain":"Text","text/html":"Url",default:"Text"},r="Copy to clipboard: #{key}, Enter";function n(i){var s=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return i.replace(/#{\s*key\s*}/g,s)}function o(i,s){var l,c,d,u,p,m,g=!1;s||(s={}),l=s.debug||!1;try{d=e(),u=document.createRange(),p=document.getSelection(),m=document.createElement("span"),m.textContent=i,m.ariaHidden="true",m.style.all="unset",m.style.position="fixed",m.style.top=0,m.style.clip="rect(0, 0, 0, 0)",m.style.whiteSpace="pre",m.style.webkitUserSelect="text",m.style.MozUserSelect="text",m.style.msUserSelect="text",m.style.userSelect="text",m.addEventListener("copy",function(f){if(f.stopPropagation(),s.format)if(f.preventDefault(),typeof f.clipboardData>"u"){l&&console.warn("unable to use e.clipboardData"),l&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var h=t[s.format]||t.default;window.clipboardData.setData(h,i)}else f.clipboardData.clearData(),f.clipboardData.setData(s.format,i);s.onCopy&&(f.preventDefault(),s.onCopy(f.clipboardData))}),document.body.appendChild(m),u.selectNodeContents(m),p.addRange(u);var b=document.execCommand("copy");if(!b)throw new Error("copy command was unsuccessful");g=!0}catch(f){l&&console.error("unable to copy using execCommand: ",f),l&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(s.format||"text",i),s.onCopy&&s.onCopy(window.clipboardData),g=!0}catch(h){l&&console.error("unable to copy using clipboardData: ",h),l&&console.error("falling back to prompt"),c=n("message"in s?s.message:r),window.prompt(c,i)}}finally{p&&(typeof p.removeRange=="function"?p.removeRange(u):p.removeAllRanges()),m&&document.body.removeChild(m),d()}return g}return Qo=o,Qo}var nb=rb();const Gl=Td(nb);function Kl({className:e,...t}){return a.jsx("div",{"data-slot":"table-container",className:"ecr-table__container",children:a.jsx("table",{"data-slot":"table",className:$("ecr-table",e),...t})})}function Yl({className:e,...t}){return a.jsx("thead",{"data-slot":"table-header",className:$("ecr-table__header",e),...t})}function Xl({className:e,...t}){return a.jsx("tbody",{"data-slot":"table-body",className:$("ecr-table__body",e),...t})}function kn({className:e,...t}){return a.jsx("tr",{"data-slot":"table-row",className:$("ecr-table__row",e),...t})}function Jl({className:e,...t}){return a.jsx("th",{"data-slot":"table-head",className:$("ecr-table__head",e),...t})}function Me({className:e,...t}){return a.jsx("td",{"data-slot":"table-cell",className:$("ecr-table__cell",e),...t})}function Zl({className:e,...t}){return a.jsx("caption",{"data-slot":"table-caption",className:$("ecr-table__caption",e),...t})}const ob=[{label:"No.",width:80,align:"center"},{label:"Group Name",width:250,align:"start"},{label:"Short Code",align:"start"},{label:"Action",width:150,align:"center"}],ab=({tableData:e,setIsAttemptingDelete:t})=>{const[r,n]=_.useState(null),o=_.useRef(null),i=(s,l)=>{Gl(s),n(l),o.current=setTimeout(()=>{n(null)},700)};return _.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]),a.jsxs(Kl,{className:"ecr-admin-groups__table",children:[!e.length&&a.jsx(Zl,{className:"ecr-admin-groups__caption",children:a.jsxs("div",{className:"ecr-admin-groups__empty",children:[a.jsx(lt,{className:"ecr-admin-groups__empty-icon"}),"You did not create any reel group yet!"]})}),e.length?a.jsxs(a.Fragment,{children:[a.jsx(Yl,{children:a.jsx(kn,{children:ob.map((s,l)=>a.jsx(Jl,{className:"ecr-admin-groups__head",style:{width:s?.width||"auto",textAlign:s?.align},children:s.label},l))})}),a.jsx(Xl,{children:e.map((s,l)=>a.jsxs(kn,{className:$("ecr-admin-groups__row",l%2===0&&"ecr-admin-groups__row--alt"),children:[a.jsx(Me,{className:"ecr-admin-groups__cell ecr-admin-groups__cell--center ecr-admin-groups__cell--strong",children:l+1}),a.jsx(Me,{children:a.jsx("div",{className:"ecr-admin-groups__name",children:s.group_name})}),a.jsx(Me,{children:a.jsxs("div",{className:"ecr-admin-groups__shortcode",children:[a.jsx("span",{className:"ecr-admin-groups__shortcode-text",children:`[reelswp-group id='${s.id}']`}),a.jsxs("div",{className:"ecr-admin-groups__copy",children:[a.jsx("button",{onClick:()=>i(`[reelswp-group id='${s.id}']`,l),className:"ecr-admin-groups__copy-button",title:"Copy",children:a.jsx(lp,{className:"ecr-admin-groups__copy-icon"})}),a.jsx("span",{className:$("ecr-admin-groups__copy-tooltip",r===l&&"ecr-admin-groups__copy-tooltip--visible"),children:"Copied!"})]})]})}),a.jsx(Me,{children:a.jsxs("div",{className:"ecr-admin-groups__actions",children:[a.jsx(ne,{title:"Statistics",variant:"link",size:"icon-sm",asChild:!0,className:"ecr-admin-groups__action-button",children:a.jsx(vt,{to:`?view=${X.stat}&group=${s.id}&name=${s.group_name}`,children:a.jsx(bi,{className:"ecr-admin-groups__icon ecr-admin-groups__icon--neutral"})})}),a.jsx(ne,{title:"Update Stories",variant:"link",size:"icon-sm",asChild:!0,className:"ecr-admin-groups__action-button",children:a.jsx(vt,{to:`?view=${X.mg}&gid=${s.id}`,children:a.jsx(Pr,{className:"ecr-admin-groups__icon ecr-admin-groups__icon--neutral"})})}),a.jsx(ne,{title:"Delete Group",onClick:()=>t(s.id),variant:"link",size:"icon-sm",className:"ecr-admin-groups__action-button",children:a.jsx(fp,{className:"ecr-admin-groups__icon ecr-admin-groups__icon--danger"})})]})})]},s.id??l))})]}):null]})},Ql=()=>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))})]}),ib=()=>{const[e,t]=_.useState([]),[r,n]=_.useState(""),[o,i]=_.useState(!1),[s,l]=_.useState(!1),[c,d]=_.useState(!1),[u,p]=_.useState(""),[m,g]=_.useState(1),[b]=_.useState(20),[f,h]=_.useState(0),[v,y]=_.useState(1),w=fo(u,500),j=_.useCallback(async E=>{const T=new AbortController,A=E===1;try{A?i(!0):l(!0),n("");const R=await he.get("groups",{params:{page:E,per_page:b,...w&&{q:w}},signal:T.signal}),L=Number(R.headers?.["x-wp-total"]??0),B=Number(R.headers?.["x-wp-totalpages"]??1),M=Math.max(1,B||1);t(O=>{if(A)return R.data;const P=new Set(O.map(I=>I.id)),z=R.data.filter(I=>!P.has(I.id));return[...O,...z]}),h(L),y(M),E>M&&g(M)}catch(R){if(T.signal.aborted)return;R instanceof Error?n(R.message):n("Something went wrong. Try again later!")}finally{T.signal.aborted||(A?i(!1):l(!1))}},[b,w]),C=_.useCallback(()=>{g(E=>o||s||E>=v?E:E+1)},[o,s,v]),N=_.useCallback(async()=>{if(m!==1){g(1);return}await j(1)},[m,j]),S=_.useCallback(async E=>{try{d(!0),await he.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 _.useEffect(()=>{j(m)},[m,j,w]),{groups:e,groupError:r,isLoading:o,isLoadingMore:s,isDeleting:c,searchTerm:u,setSearchTerm:p,perPage:b,total:f,totalPages:v,hasMore:m<=v,loadMore:C,refreshGroups:N,deleteGroup:S}},ec={docs:"https://reelswp.com/docs/",rateUs:"https://wordpress.org/support/plugin/ecomm-reels/reviews/#new-post"},sb=()=>{const[e,t]=_.useState(null),{groups:r,groupError:n,isLoading:o,isLoadingMore:i,isDeleting:s,deleteGroup:l,hasMore:c,loadMore:d,searchTerm:u,setSearchTerm:p}=ib(),m=_.useRef(null),g=async()=>{e&&(await l(e),t(null))};return _.useEffect(()=>{if(!m.current||!c)return;const b=new IntersectionObserver(f=>{const[h]=f;h.isIntersecting&&d()},{root:null,rootMargin:"200px",threshold:0});return b.observe(m.current),()=>b.disconnect()},[c,d]),a.jsxs(a.Fragment,{children:[a.jsx(kt,{left:[a.jsx(St,{name:"All Widgets",Icon:gp},"page")],center:[a.jsx(Ir,{},"reel-wp")],right:[a.jsxs("a",{href:ec.rateUs,className:"ecr-admin-docs-link",target:"_blank",children:[a.jsx(Hl,{size:14}),a.jsx("span",{children:"Rate Us"})]},"rate-us"),a.jsxs("a",{href:ec.docs,className:"ecr-admin-docs-link",target:"_blank",children:[a.jsx(Up,{size:14}),a.jsx("span",{children:"Documentation"})]},"view-documentation"),a.jsx(Rr,{to:`?view=${X.cr}`,text:"Add Reel",Icon:yt},"add-reel-reel-group")]}),a.jsxs("div",{className:"ecr-admin-card ecr-admin-groups",children:[e&&a.jsx(Or,{onAccept:g,onReject:()=>t(null),isLoading:s}),a.jsxs("div",{className:"ecr-admin-groups__header",children:[a.jsx("h2",{className:"ecr-admin-groups__title",children:"Reel Widgets"}),a.jsxs("div",{className:"ecr-admin-groups_action_wrapper",children:[a.jsxs("div",{className:"ecr-admin-groups-header__search",children:[a.jsx("input",{type:"text",placeholder:"Search widgets...",value:u,onChange:b=>p(b.target.value),className:"ecr-admin-groups-search-input"}),a.jsxs("div",{className:"ecr-admin-groups-header__icon-wrapper",children:[u&&a.jsx(ne,{onClick:()=>p(""),variant:"link",size:"icon-sm",children:a.jsx(qn,{size:16,className:"ecr-admin-groups-header__clear-icon"})}),a.jsx(ii,{size:16,className:"ecr-admin-groups-header__search-icon"})]})]}),a.jsx(Rr,{to:`?view=${X.mg}`,text:"Create Widget",Icon:yt,className:"ecr-admin-groups__create-button",textColor:"#2563eb"})]})]}),o?a.jsx(Ql,{}):n?a.jsx(Vl,{}):a.jsxs(a.Fragment,{children:[a.jsx(ab,{tableData:r,setIsAttemptingDelete:t}),c&&a.jsx("div",{ref:m,className:"ecr-admin-groups__load-more","aria-live":"polite",children:i?a.jsx(Wp,{className:"ecr-admin-groups__load-more__icon"}):null})]})]})]})},lb=()=>{const[e,t]=_.useState(!1),[r,n]=_.useState({rateLimit:2,timeLimit:1}),[o,i]=_.useState(!1),[s,l]=_.useState(!1),[c,d]=_.useState(!1),u=_.useCallback((m,g)=>{t(!0),n(b=>({...b,[m]:g}))},[]),p=_.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),d(!1),await he.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!"),d(!0)}finally{l(!1)}},[r.rateLimit,r.timeLimit]);return _.useEffect(()=>{const m=new AbortController;return(async()=>{try{i(!0),d(!1);const b=await he.get("settings",{signal:m.signal});n({rateLimit:b.data.rate_limit,timeLimit:b.data.time_limit}),t(!1)}catch(b){if(m.signal.aborted)return;b instanceof Error?G.error(b.message):G.error("Something went wrong. Try again later!"),d(!0)}finally{m.signal.aborted||i(!1)}})(),()=>m.abort()},[]),{limit:r,isEdited:e,isLoading:o,isSaving:s,isError:c,handleOnChange:u,handleSave:p}},cb=()=>{const{limit:e,isEdited:t,isLoading:r,isSaving:n,isError:o,handleOnChange:i,handleSave:s}=lb();return a.jsxs(a.Fragment,{children:[r&&a.jsx(Lr,{}),a.jsx(kt,{left:[a.jsx(St,{name:"Settings",Icon:Pp},"Settings"),a.jsx(tr,{},"back-settings")],center:[a.jsx(Ir,{},"Settings-widget-name")],right:[a.jsx(ho,{onSave:s,isSaving:n,disabled:!t},"save")]}),a.jsx(rr,{breads:[{label:"Dashboard",href:`?view=${X.ag}`},{label:"Settings"}]}),a.jsxs("div",{className:"ecr-admin-card ecr-admin-card--settings",children:[a.jsx("div",{className:"ecr-admin-card__header",children:a.jsx("h2",{className:"ecr-admin-card__title",children:"ReelsWP Settings"})}),o&&a.jsx("div",{className:"ecr-admin-form__row",children:a.jsx("span",{children:"Unable to load settings. Please try again."})}),a.jsxs("form",{action:"",className:"ecr-admin-form",children:[a.jsxs("div",{className:"ecr-admin-form__row",children:[a.jsx("label",{htmlFor:"ecommreels_rate_limit",className:"ecr-admin-form__label",children:"Rate Limit:"}),a.jsx("input",{type:"number",id:"ecommreels_rate_limit",name:"ecommreels_rate_limit",value:e.rateLimit,onChange:l=>i("rateLimit",l.target.value),className:"ecr-admin-form__input",min:"1"})]}),a.jsxs("div",{className:"ecr-admin-form__row",children:[a.jsx("label",{htmlFor:"ecommreels_time_limit",className:"ecr-admin-form__label",children:"Time Limit (minutes):"}),a.jsx("input",{type:"number",id:"ecommreels_time_limit",name:"ecommreels_time_limit",value:e.timeLimit,onChange:l=>i("timeLimit",l.target.value),className:"ecr-admin-form__input",min:"1"})]})]})]})]})},db=[{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"}],ub=({tableData:e})=>a.jsxs(Kl,{className:"ecr-admin-stats__table",children:[!e.length&&a.jsx(Zl,{className:"ecr-admin-stats__caption",children:a.jsxs("div",{className:"ecr-admin-stats__empty",children:[a.jsx(lt,{className:"ecr-admin-stats__empty-icon"}),"You did not create any reel group yet!"]})}),a.jsx(Yl,{children:a.jsx(kn,{children:db.map((t,r)=>a.jsx(Jl,{className:"ecr-admin-stats__head",style:{...t.width&&{width:`${t.width}px`},textAlign:t.align},children:t.label},r))})}),!!e.length&&a.jsx(Xl,{children:e.map((t,r)=>a.jsxs(kn,{className:$("ecr-admin-stats__row",r%2===0&&"ecr-admin-stats__row--alt"),children:[a.jsx(Me,{className:"ecr-admin-stats__cell ecr-admin-stats__cell--center",children:r+1}),a.jsx(Me,{className:"ecr-admin-stats__cell",children:t.storyTitle}),a.jsx(Me,{className:"ecr-admin-stats__cell",children:t.campaignName}),a.jsx(Me,{className:"ecr-admin-stats__cell",children:t.buttonText}),a.jsx(Me,{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(Me,{className:"ecr-admin-stats__cell ecr-admin-stats__cell--center",children:t.clickCount})]},t.id))})]}),pb=()=>{const[e]=Zt(),t=e.get("group"),r=e.get("name"),[n,o]=_.useState([]),[i,s]=_.useState([]),[l,c]=_.useState(!1),[d,u]=_.useState(!1);_.useEffect(()=>{t&&(async()=>{try{c(!0);const g=await he.get(`/group/${t}/stats`);o(g.data.stories),s(g.data.buttons)}catch(g){g instanceof Error?G.error(g.message):G.error("Something went wrong. Try again later!"),u(!0)}finally{c(!1)}})()},[t]);const p=n.length>0?n.reduce((m,g)=>m+=g.view_count??0,0):0;return a.jsxs(a.Fragment,{children:[a.jsx(kt,{left:[a.jsx(St,{name:"Statistics",Icon:bi},"Statistics"),a.jsx(tr,{},"Statistics-back")],center:[a.jsx(Ir,{},"Statistics-widget-name")]}),a.jsx(rr,{breads:[{label:"Dashboard",href:`?view=${X.ag}`},{label:"Statistics"}]}),a.jsxs("div",{className:"ecr-admin-card ecr-admin-stats",children:[a.jsxs("div",{className:"ecr-admin-stats__header",children:[a.jsxs("h2",{className:"ecr-admin-stats__title",children:["Group: ",r]}),l?a.jsx("div",{className:"ecr-admin-stats__summary-skeleton"}):a.jsxs("div",{className:"ecr-admin-stats__summary",children:[a.jsx("span",{children:"Total View:"})," ",a.jsx("span",{children:p})]})]}),a.jsx("div",{className:"ecr-admin-stats__body",children:l?a.jsx(Ql,{}):d?a.jsx(Vl,{}):i.length===0?a.jsxs("div",{className:"ecr-admin-stats__empty",children:[a.jsx(lt,{className:"ecr-admin-stats__empty-icon"}),a.jsx("span",{children:"No Stats available for this group"})]}):a.jsx(ub,{tableData:i})})]})]})};function mb(e){return V({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 fb(e){return V({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 hb=({isExpanded:e,setIsExpanded:t})=>a.jsx("button",{onClick:()=>t(r=>!r),className:$("ecr-admin-side-toggle",e?"ecr-admin-side-toggle--active":""),title:"Side Panel",children:a.jsx(mb,{size:24})}),gb=({...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"})]})}),ea=_.forwardRef(({className:e,type:t,...r},n)=>a.jsx(W.input,{ref:n,type:t,"data-slot":"input",className:$("ecr-input",e),...r}));ea.displayName="Input";const ta=({label:e,min:t,max:r,value:n,onChange:o,name:i,id:s,wrapperStyles:l,hideSlider:c})=>{const[d,u]=_.useState(n),p=_.useRef(null);_.useEffect(()=>{u(n)},[n]);const m=b=>{const f=Math.min(r,Math.max(t,Number(b)));o(f)},g=b=>{const f=Number(b);u(f),p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{m(f>r?r:f<t?t:f)},1e3)};return a.jsxs("div",{style:l,className:"ecr-admin-range",children:[a.jsxs("label",{htmlFor:s,className:"ecr-admin-range__label",children:[e,":"]}),a.jsxs("div",{className:"ecr-admin-range__row",children:[!c&&a.jsx("input",{type:"range",id:s,name:i,min:t,max:r,value:n,onChange:b=>{const f=Number(b.target.value);u(f),m(f)},className:"ecr-admin-range__slider"}),a.jsxs("div",{className:"ecr-admin-range__value",children:[a.jsx(ea,{type:"number",min:t,max:r,value:d,onChange:b=>g(b.target.value)}),a.jsx("span",{className:"ecr-admin-range__unit",children:"px"})]})]})]})};function D(){return D=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},D.apply(null,arguments)}function Be(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var Dt=255,et=100,pr=e=>{var{r:t,g:r,b:n,a:o}=e,i=Math.max(t,r,n),s=i-Math.min(t,r,n),l=s?i===t?(r-n)/s:i===r?2+(n-t)/s:4+(t-r)/s:0;return{h:60*(l<0?l+6:l),s:i?s/i*et:0,v:i/Dt*et,a:o}},tc=e=>{var{h:t,s:r,l:n,a:o}=rc(e);return"hsla("+t+", "+r+"%, "+n+"%, "+o+")"},rc=e=>{var{h:t,s:r,v:n,a:o}=e,i=(200-r)*n/et;return{h:t,s:i>0&&i<200?r*n/et/(i<=et?i:200-i)*et:0,l:i/2,a:o}},nc=e=>{var{r:t,g:r,b:n}=e,o=t<<16|r<<8|n;return"#"+(i=>new Array(7-i.length).join("0")+i)(o.toString(16))},xb=e=>{var{r:t,g:r,b:n,a:o}=e,i=typeof o=="number"&&(o*255|256).toString(16).slice(1);return""+nc({r:t,g:r,b:n})+(i||"")},mr=e=>pr(bb(e)),bb=e=>{var t=e.replace("#","");/^#?/.test(e)&&t.length===3&&(e="#"+t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2));var r=new RegExp("[A-Za-z0-9]{2}","g"),[n,o,i=0,s]=e.match(r).map(l=>parseInt(l,16));return{r:n,g:o,b:i,a:(s??255)/Dt}},Sn=e=>{var{h:t,s:r,v:n,a:o}=e,i=t/60,s=r/et,l=n/et,c=Math.floor(i)%6,d=i-Math.floor(i),u=Dt*l*(1-s),p=Dt*l*(1-s*d),m=Dt*l*(1-s*(1-d));l*=Dt;var g={};switch(c){case 0:g.r=l,g.g=m,g.b=u;break;case 1:g.r=p,g.g=l,g.b=u;break;case 2:g.r=u,g.g=l,g.b=m;break;case 3:g.r=u,g.g=p,g.b=l;break;case 4:g.r=m,g.g=u,g.b=l;break;case 5:g.r=l,g.g=u,g.b=p;break}return g.r=Math.round(g.r),g.g=Math.round(g.g),g.b=Math.round(g.b),D({},g,{a:o})},_b=e=>{var{r:t,g:r,b:n,a:o}=Sn(e);return"rgba("+t+", "+r+", "+n+", "+o+")"},vb=e=>{var{r:t,g:r,b:n}=e;return{r:t,g:r,b:n}},yb=e=>{var{h:t,s:r,l:n}=e;return{h:t,s:r,l:n}},ra=e=>nc(Sn(e)),wb=e=>{var{h:t,s:r,v:n}=e;return{h:t,s:r,v:n}},jb=e=>{var{r:t,g:r,b:n}=e,o=function(u){return u<=.04045?u/12.92:Math.pow((u+.055)/1.055,2.4)},i=o(t/255),s=o(r/255),l=o(n/255),c={};return c.x=i*.4124+s*.3576+l*.1805,c.y=i*.2126+s*.7152+l*.0722,c.bri=i*.0193+s*.1192+l*.9505,c},$t=e=>{var t,r,n,o,i,s,l,c,d;return typeof e=="string"&&na(e)?(s=mr(e),c=e):typeof e!="string"&&(s=e),s&&(n=wb(s),i=rc(s),o=Sn(s),d=xb(o),c=ra(s),r=yb(i),t=vb(o),l=jb(t)),{rgb:t,hsl:r,hsv:n,rgba:o,hsla:i,hsva:s,hex:c,hexa:d,xy:l}},na=e=>/^#?([A-Fa-f0-9]{3,4}){1,2}$/.test(e);function oc(e){var t=_.useRef(e);return _.useEffect(()=>{t.current=e}),_.useCallback((r,n)=>t.current&&t.current(r,n),[])}var fr=e=>"touches"in e,ac=e=>{!fr(e)&&e.preventDefault&&e.preventDefault()},ic=function(t,r,n){return r===void 0&&(r=0),n===void 0&&(n=1),t>n?n:t<r?r:t},sc=(e,t)=>{var r=e.getBoundingClientRect(),n=fr(t)?t.touches[0]:t;return{left:ic((n.pageX-(r.left+window.pageXOffset))/r.width),top:ic((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)}},kb=["prefixCls","className","onMove","onDown"],oa=_.forwardRef((e,t)=>{var{prefixCls:r="w-color-interactive",className:n,onMove:o,onDown:i}=e,s=Be(e,kb),l=_.useRef(null),c=_.useRef(!1),[d,u]=_.useState(!1),p=oc(o),m=oc(i),g=y=>c.current&&!fr(y)?!1:(c.current=fr(y),!0),b=_.useCallback(y=>{if(ac(y),!!l.current){var w=fr(y)?y.touches.length>0:y.buttons>0;if(!w){u(!1);return}p?.(sc(l.current,y),y)}},[p]),f=_.useCallback(()=>u(!1),[]),h=_.useCallback(y=>{y?(window.addEventListener(c.current?"touchmove":"mousemove",b),window.addEventListener(c.current?"touchend":"mouseup",f)):(window.removeEventListener("mousemove",b),window.removeEventListener("mouseup",f),window.removeEventListener("touchmove",b),window.removeEventListener("touchend",f))},[b,f]);_.useEffect(()=>(h(d),()=>{h(!1)}),[d,b,f,h]);var v=_.useCallback(y=>{var w=document.activeElement;w?.blur(),ac(y.nativeEvent),g(y.nativeEvent)&&l.current&&(m?.(sc(l.current,y.nativeEvent),y.nativeEvent),u(!0))},[m]);return a.jsx("div",D({},s,{className:[r,n||""].filter(Boolean).join(" "),style:D({},s.style,{touchAction:"none"}),ref:l,tabIndex:0,onMouseDown:v,onTouchStart:v}))});oa.displayName="Interactive";var Sb=e=>{var{className:t,color:r,left:n,top:o,prefixCls:i}=e,s={position:"absolute",top:o,left:n},l={"--saturation-pointer-box-shadow":"rgb(255 255 255) 0px 0px 0px 1.5px, rgb(0 0 0 / 30%) 0px 0px 1px 1px inset, rgb(0 0 0 / 40%) 0px 0px 1px 2px",width:6,height:6,transform:"translate(-3px, -3px)",boxShadow:"var(--saturation-pointer-box-shadow)",borderRadius:"50%",backgroundColor:r};return _.useMemo(()=>a.jsx("div",{className:i+"-pointer "+(t||""),style:s,children:a.jsx("div",{className:i+"-fill",style:l})}),[o,n,r,t,i])},Cb=["prefixCls","radius","pointer","className","hue","style","hsva","onChange"],lc=_.forwardRef((e,t)=>{var r,{prefixCls:n="w-color-saturation",radius:o=0,pointer:i,className:s,hue:l=0,style:c,hsva:d,onChange:u}=e,p=Be(e,Cb),m=D({width:200,height:200,borderRadius:o},c,{position:"relative"}),g=(v,y)=>{u&&d&&u({h:d.h,s:v.left*100,v:(1-v.top)*100,a:d.a})},b=_.useCallback(v=>{if(!(!d||!u)){var y=1,w=d.s,j=d.v,C=!1;switch(v.key){case"ArrowLeft":w=Math.max(0,d.s-y),C=!0,v.preventDefault();break;case"ArrowRight":w=Math.min(100,d.s+y),C=!0,v.preventDefault();break;case"ArrowUp":j=Math.min(100,d.v+y),C=!0,v.preventDefault();break;case"ArrowDown":j=Math.max(0,d.v-y),C=!0,v.preventDefault();break;default:return}C&&u({h:d.h,s:w,v:j,a:d.a})}},[d,u]),f=_.useMemo(()=>{if(!d)return null;var v={top:100-d.v+"%",left:d.s+"%",color:tc(d)};return i&&typeof i=="function"?i(D({prefixCls:n},v)):a.jsx(Sb,D({prefixCls:n},v))},[d,i,n]),h=_.useCallback(v=>{v.target.focus()},[]);return a.jsx(oa,D({className:[n,s||""].filter(Boolean).join(" ")},p,{style:D({position:"absolute",inset:0,cursor:"crosshair",backgroundImage:"linear-gradient(0deg, #000, transparent), linear-gradient(90deg, #fff, hsl("+((r=d?.h)!=null?r:l)+", 100%, 50%))"},m,{outline:"none"}),ref:t,onMove:g,onDown:g,onKeyDown:b,onClick:h,children:f}))});lc.displayName="Saturation";var Nb=["className","prefixCls","left","top","style","fillProps"],Eb=e=>{var{className:t,prefixCls:r,left:n,top:o,style:i,fillProps:s}=e,l=Be(e,Nb),c=D({},i,{position:"absolute",left:n,top:o}),d=D({width:18,height:18,boxShadow:"var(--alpha-pointer-box-shadow)",borderRadius:"50%",backgroundColor:"var(--alpha-pointer-background-color)"},s?.style,{transform:n?"translate(-9px, -1px)":"translate(-1px, -9px)"});return a.jsx("div",D({className:r+"-pointer "+(t||""),style:c},l,{children:a.jsx("div",D({className:r+"-fill"},s,{style:d}))}))},Tb=["prefixCls","className","hsva","background","bgProps","innerProps","pointerProps","radius","width","height","direction","style","onChange","pointer"],Ab="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg==",Cn=_.forwardRef((e,t)=>{var{prefixCls:r="w-color-alpha",className:n,hsva:o,background:i,bgProps:s={},innerProps:l={},pointerProps:c={},radius:d=0,width:u,height:p=16,direction:m="horizontal",style:g,onChange:b,pointer:f}=e,h=Be(e,Tb),v=T=>{b&&b(D({},o,{a:m==="horizontal"?T.left:T.top}),T)},y=tc(Object.assign({},o,{a:1})),w="linear-gradient(to "+(m==="horizontal"?"right":"bottom")+", rgba(244, 67, 54, 0) 0%, "+y+" 100%)",j={};m==="horizontal"?j.left=o.a*100+"%":j.top=o.a*100+"%";var C=D({"--alpha-background-color":"#fff","--alpha-pointer-background-color":"rgb(248, 248, 248)","--alpha-pointer-box-shadow":"rgb(0 0 0 / 37%) 0px 1px 4px 0px",borderRadius:d,background:"url("+Ab+") left center",backgroundColor:"var(--alpha-background-color)"},{width:u,height:p},g,{position:"relative"}),N=_.useCallback(T=>{var A=.01,R=o.a,L=R;switch(T.key){case"ArrowLeft":m==="horizontal"&&(L=Math.max(0,R-A),T.preventDefault());break;case"ArrowRight":m==="horizontal"&&(L=Math.min(1,R+A),T.preventDefault());break;case"ArrowUp":m==="vertical"&&(L=Math.max(0,R-A),T.preventDefault());break;case"ArrowDown":m==="vertical"&&(L=Math.min(1,R+A),T.preventDefault());break;default:return}if(L!==R){var B={left:m==="horizontal"?L:o.a,top:m==="vertical"?L:o.a,width:0,height:0,x:0,y:0};b&&b(D({},o,{a:L}),B)}},[o,m,b]),S=_.useCallback(T=>{T.target.focus()},[]),E=f&&typeof f=="function"?f(D({prefixCls:r},c,j)):a.jsx(Eb,D({},c,{prefixCls:r},j));return a.jsxs("div",D({},h,{className:[r,r+"-"+m,n||""].filter(Boolean).join(" "),style:C,ref:t,children:[a.jsx("div",D({},s,{style:D({inset:0,position:"absolute",background:i||w,borderRadius:d},s.style)})),a.jsx(oa,D({},l,{style:D({},l.style,{inset:0,zIndex:1,position:"absolute",outline:"none"}),onMove:v,onDown:v,onClick:S,onKeyDown:N,children:E}))]}))});Cn.displayName="Alpha";var Pb=["prefixCls","placement","label","value","className","style","labelStyle","inputStyle","onChange","onBlur","renderInput"],Ob=e=>/^#?([A-Fa-f0-9]{3,4}){1,2}$/.test(e),Rb=e=>Number(String(e).replace(/%/g,"")),Ft=_.forwardRef((e,t)=>{var{prefixCls:r="w-color-editable-input",placement:n="bottom",label:o,value:i,className:s,style:l,labelStyle:c,inputStyle:d,onChange:u,onBlur:p,renderInput:m}=e,g=Be(e,Pb),[b,f]=_.useState(i),h=_.useRef(!1);_.useEffect(()=>{e.value!==b&&(h.current||f(e.value))},[e.value]);function v(S,E){var T=(E||S.target.value).trim().replace(/^#/,"");Ob(T)&&u&&u(S,T);var A=Rb(T);isNaN(A)||u&&u(S,A),f(T)}function y(S){h.current=!1,f(e.value),p&&p(S)}var w={};n==="bottom"&&(w.flexDirection="column"),n==="top"&&(w.flexDirection="column-reverse"),n==="left"&&(w.flexDirection="row-reverse");var j=D({"--editable-input-label-color":"rgb(153, 153, 153)","--editable-input-box-shadow":"rgb(204 204 204) 0px 0px 0px 1px inset","--editable-input-color":"#666",position:"relative",alignItems:"center",display:"flex",fontSize:11},w,l),C=D({width:"100%",paddingTop:2,paddingBottom:2,paddingLeft:3,paddingRight:3,fontSize:11,background:"transparent",boxSizing:"border-box",border:"none",color:"var(--editable-input-color)",boxShadow:"var(--editable-input-box-shadow)"},d),N=D({value:b,onChange:v,onBlur:y,autoComplete:"off",onFocus:()=>h.current=!0},g,{style:C,onFocusCapture:S=>{var E=S.target;E.setSelectionRange(E.value.length,E.value.length)}});return a.jsxs("div",{className:[r,s||""].filter(Boolean).join(" "),style:j,children:[m?m(N,t):a.jsx("input",D({ref:t},N)),o&&a.jsx("span",{style:D({color:"var(--editable-input-label-color)",textTransform:"capitalize"},c),children:o})]})});Ft.displayName="EditableInput";var Lb=["prefixCls","hsva","placement","rProps","gProps","bProps","aProps","className","style","onChange"],cc=_.forwardRef((e,t)=>{var{prefixCls:r="w-color-editable-input-rgba",hsva:n,placement:o="bottom",rProps:i={},gProps:s={},bProps:l={},aProps:c={},className:d,style:u,onChange:p}=e,m=Be(e,Lb),g=n?Sn(n):{};function b(y){var w=Number(y.target.value);w&&w>255&&(y.target.value="255"),w&&w<0&&(y.target.value="0")}var f=y=>{var w=Number(y.target.value);w&&w>100&&(y.target.value="100"),w&&w<0&&(y.target.value="0")},h=(y,w,j)=>{typeof y=="number"&&(w==="a"&&(y<0&&(y=0),y>100&&(y=100),p&&p($t(pr(D({},g,{a:y/100}))))),y>255&&(y=255,j.target.value="255"),y<0&&(y=0,j.target.value="0"),w==="r"&&p&&p($t(pr(D({},g,{r:y})))),w==="g"&&p&&p($t(pr(D({},g,{g:y})))),w==="b"&&p&&p($t(pr(D({},g,{b:y})))))},v=g.a?Math.round(g.a*100)/100:0;return a.jsxs("div",D({ref:t,className:[r,d||""].filter(Boolean).join(" ")},m,{style:D({fontSize:11,display:"flex"},u),children:[a.jsx(Ft,D({label:"R",value:g.r||0,onBlur:b,placement:o,onChange:(y,w)=>h(w,"r",y)},i,{style:D({},i.style)})),a.jsx(Ft,D({label:"G",value:g.g||0,onBlur:b,placement:o,onChange:(y,w)=>h(w,"g",y)},s,{style:D({marginLeft:5},i.style)})),a.jsx(Ft,D({label:"B",value:g.b||0,onBlur:b,placement:o,onChange:(y,w)=>h(w,"b",y)},l,{style:D({marginLeft:5},l.style)})),c&&a.jsx(Ft,D({label:"A",value:parseInt(String(v*100),10),onBlur:f,placement:o,onChange:(y,w)=>h(w,"a",y)},c,{style:D({marginLeft:5},c.style)}))]}))});cc.displayName="EditableInputRGBA";var Ib=["prefixCls","className","hue","onChange","direction"],dc=_.forwardRef((e,t)=>{var{prefixCls:r="w-color-hue",className:n,hue:o=0,onChange:i,direction:s="horizontal"}=e,l=Be(e,Ib);return a.jsx(Cn,D({ref:t,className:r+" "+(n||"")},l,{direction:s,background:"linear-gradient(to "+(s==="horizontal"?"right":"bottom")+", rgb(255, 0, 0) 0%, rgb(255, 255, 0) 17%, rgb(0, 255, 0) 33%, rgb(0, 255, 255) 50%, rgb(0, 0, 255) 67%, rgb(255, 0, 255) 83%, rgb(255, 0, 0) 100%)",hsva:{h:o,s:100,v:100,a:o/360},onChange:(c,d)=>{i&&i({h:s==="horizontal"?360*d.left:360*d.top})}}))});dc.displayName="Hue";var Mb=["prefixCls","className","color","colors","style","rectProps","onChange","addonAfter","addonBefore","rectRender"],uc=_.forwardRef((e,t)=>{var{prefixCls:r="w-color-swatch",className:n,color:o,colors:i=[],style:s,rectProps:l={},onChange:c,addonAfter:d,addonBefore:u,rectRender:p}=e,m=Be(e,Mb),g=D({"--swatch-background-color":"rgb(144, 19, 254)",background:"var(--swatch-background-color)",height:15,width:15,marginRight:5,marginBottom:5,cursor:"pointer",position:"relative",outline:"none",borderRadius:2},l.style),b=(f,h)=>{c&&c(mr(f),$t(mr(f)),h)};return a.jsxs("div",D({ref:t},m,{className:[r,n||""].filter(Boolean).join(" "),style:D({display:"flex",flexWrap:"wrap",position:"relative"},s),children:[u&&_.isValidElement(u)&&u,i&&Array.isArray(i)&&i.map((f,h)=>{var v="",y="";typeof f=="string"&&(v=f,y=f),typeof f=="object"&&f.color&&(v=f.title||f.color,y=f.color);var w=o&&o.toLocaleLowerCase()===y.toLocaleLowerCase(),j=p&&p({title:v,color:y,checked:!!w,style:D({},g,{background:y}),onClick:N=>b(y,N)});if(j)return a.jsx(_.Fragment,{children:j},h);var C=l.children&&_.isValidElement(l.children)?_.cloneElement(l.children,{color:y,checked:w}):null;return a.jsx("div",D({tabIndex:0,title:v,onClick:N=>b(y,N)},l,{children:C,style:D({},g,{background:y})}),h)}),d&&_.isValidElement(d)&&d]}))});uc.displayName="Swatch";var zb=["prefixCls","className","onChange","width","presetColors","color","editableDisable","disableAlpha","style"],Db=["#D0021B","#F5A623","#f8e61b","#8B572A","#7ED321","#417505","#BD10E0","#9013FE","#4A90E2","#50E3C2","#B8E986","#000000","#4A4A4A","#9B9B9B","#FFFFFF"],pc=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"}}),mc=_.forwardRef((e,t)=>{var{prefixCls:r="w-color-sketch",className:n,onChange:o,width:i=218,presetColors:s=Db,color:l,editableDisable:c=!0,disableAlpha:d=!1,style:u}=e,p=Be(e,zb),[m,g]=_.useState({h:209,s:36,v:90,a:1});_.useEffect(()=>{typeof l=="string"&&na(l)&&g(mr(l)),typeof l=="object"&&g(l)},[l]);var b=N=>{g(N),o&&o($t(N))},f=(N,S)=>{typeof N=="string"&&na(N)&&/(3|6)/.test(String(N.length))&&b(mr(N))},h=N=>b(D({},m,{a:N.a})),v=N=>b(D({},m,N,{a:m.a})),y=D({"--sketch-background":"rgb(255, 255, 255)","--sketch-box-shadow":"rgb(0 0 0 / 15%) 0px 0px 0px 1px, rgb(0 0 0 / 15%) 0px 8px 16px","--sketch-swatch-box-shadow":"rgb(0 0 0 / 15%) 0px 0px 0px 1px inset","--sketch-alpha-box-shadow":"rgb(0 0 0 / 15%) 0px 0px 0px 1px inset, rgb(0 0 0 / 25%) 0px 0px 4px inset","--sketch-swatch-border-top":"1px solid rgb(238, 238, 238)",background:"var(--sketch-background)",borderRadius:4,boxShadow:"var(--sketch-box-shadow)",width:i},u),w={borderRadius:2,background:_b(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",D({},p,{className:r+" "+(n||""),ref:t,style:y,children:[a.jsxs("div",{style:{padding:"10px 10px 8px"},children:[a.jsx(lc,{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(dc,{width:"auto",height:10,hue:m.h,pointer:pc,innerProps:{style:{marginLeft:1,marginRight:5}},onChange:N=>b(D({},m,N))}),!d&&a.jsx(Cn,{width:"auto",height:10,hsva:m,pointer:pc,style:{marginTop:4},innerProps:{style:{marginLeft:1,marginRight:5}},onChange:h})]}),!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(_.Fragment,{})})]})]}),c&&a.jsxs("div",{style:{display:"flex",margin:"0 10px 3px 10px"},children:[a.jsx(Ft,{label:"Hex",value:ra(m).replace(/^#/,"").toLocaleUpperCase(),onChange:(N,S)=>f(S),style:{minWidth:58}}),a.jsx(cc,{hsva:m,style:{marginLeft:6},aProps:d?!1:{},onChange:N=>b(N.hsva)})]}),s&&s.length>0&&a.jsx(uc,{style:j,colors:s,color:ra(m),onChange:N=>b(N),rectProps:{style:C}})]}))});mc.displayName="Sketch";const fc=({selectedColor:e,handleColor:t,text:r,wrapperStyles:n})=>a.jsxs("div",{style:n,className:"ecr-admin-control",children:[a.jsxs("p",{className:"ecr-admin-control__label",children:[r,":"]}),a.jsxs("div",{className:"ecr-admin-control__row ecr-admin-control__row--color",children:[a.jsxs(Je,{children:[a.jsx(Ze,{style:{padding:0,backgroundColor:"transparent"},children:a.jsx("div",{style:{backgroundColor:e},className:"ecr-admin-control__swatch"})}),a.jsx(Qe,{className:"ecr-admin-popover ecr-admin-color-selector-popover",children:a.jsx(mc,{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:fm},{value:"center",title:"Align Center",Icon:hm},{value:"right",title:"Align Right",Icon:gm},{value:"hidden",title:"Hidden",Icon:xm}],Fb=({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(ne,{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))})]}),Bb=({styles:e,setStyles:t,setIsEdited:r})=>{const n=o=>{t(i=>{const s=o(i);return r(!0),s})};return a.jsxs("div",{className:"ecr-admin-group-title-customization__content",children:[a.jsx(Fb,{alignment:e.widgetTitle?.alignment??"hidden",handleWidgetTitleAlignment:o=>n(i=>({...i,widgetTitle:{...i.widgetTitle,alignment:o}}))}),a.jsx(fc,{selectedColor:e.widgetTitle?.color??"#000000",handleColor:o=>n(i=>({...i,widgetTitle:{...i.widgetTitle,color:o}})),text:"Title Color",wrapperStyles:{flexDirection:"row",justifyContent:"space-between",alignItems:"center"}}),a.jsx(ta,{label:"Font size",min:10,max:200,value:e?.widgetTitle?.fontSize??24,onChange:o=>n(i=>({...i,widgetTitle:{...i.widgetTitle,fontSize:o}})),name:"font_size",id:"font-size",hideSlider:!0,wrapperStyles:{flexDirection:"row",justifyContent:"space-between",alignItems:"center"}})]})},Ub=(e=700)=>{const[t,r]=_.useState(!1),n=_.useRef(null),o=_.useCallback(i=>{Gl(i),r(!0),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{r(!1)},e)},[e]);return _.useEffect(()=>()=>{n.current&&clearTimeout(n.current)},[]),[t,o]},Hb=({gid:e})=>{const[t,r]=Ub(),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(Bp,{color:"#ffffff",size:12})}),a.jsx("span",{className:$("ecr-admin-shortcode__tooltip",t?"ecr-admin-shortcode__tooltip--visible":"ecr-admin-shortcode__tooltip--hidden"),children:"Copied!"})]})]})},hc=_.createContext({requestLeave:e=>e()}),Vb=({value:e,children:t})=>a.jsx(hc.Provider,{value:e,children:t}),gc=()=>_.useContext(hc),Wb=({link:e,usedFor:t})=>a.jsx("div",{className:"ecr-product-card-one",style:{width:"100%"},children:a.jsx(qb,{link:e,usedFor:t})}),qb=({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||wn,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||wn,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(Hl,{className:"ecr-product-card-one__star"}),Number(e.rating).toString()]}):null,a.jsx("div",{className:"ecr-product-card-one__price",dangerouslySetInnerHTML:{__html:e.price}})]})]})]})}),Gb=({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})})},Nn=({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(Gb,{link:e,usedFor:t},e.btn_uuid)}),Bt=({title:e,styles:t})=>a.jsx("p",{className:"ecr-reel_title",style:t,children:e}),xc=({reel:e,styles:t,gid:r,togglingId:n,onRemove:o})=>{const i=Ne(),{requestLeave:s}=gc(),l=n===e.story_uuid,c=`?view=${X.cr}&from=${X.mg}&sid=${e.id}${r?`&gid=${r}`:""}`,d=t.appearance??"overlay",u={border:`${t?.border?.border_width}px solid ${t?.border?.border_color}`,borderRadius:t?.shape==="rectangle"?`${t?.border?.border_radius}px`:"50%",aspectRatio:t?.shape==="rectangle"?"9/16":"1/1"},p=t.border.border_radius,m=p>50?p+16:p>20?p:0,g=e.links&&e.links.length>0?e.links[0]:null,b=d==="none",f=d==="title",h=t.shape==="rectangle",v=!b&&!f&&g;return a.jsxs("div",{className:$("ecr-admin-reelitem",t?.hoverEffect),children:[a.jsxs("div",{style:u,className:"ecr-admin-reelitem__frame",children:[a.jsx(to,{story:e,styles:t}),!b&&!f&&h?v?a.jsx(Nn,{link:g,usedFor:"admin",usedIn:"thumb",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"4px",width:"calc(100% - 8px)",borderRadius:"6px"}}):a.jsx(Bt,{title:e.title,styles:{width:`calc(95% - ${m}px)`}}):null,a.jsxs("div",{className:"ecr-admin-reelitem__actions",children:[a.jsx(ne,{title:"Edit Story",size:"icon-sm",asChild:!0,className:"ecr-admin-reelitem__button",disabled:l,children:a.jsx(vt,{to:c,className:$("ecr-admin-reelitem__link",l?"ecr-admin-reelitem__link--disabled":"ecr-admin-reelitem__link--active"),onClick:y=>{y.preventDefault(),s(()=>i(c))},children:a.jsx(Pr,{className:"ecr-admin-reelitem__icon"})})}),a.jsx(ne,{onClick:()=>o(e,"remove"),className:"ecr-admin-reelitem__button ecr-admin-reelitem__button--danger",size:"icon-sm",title:"Remove Story",disabled:l,children:l?a.jsx(it,{className:"ecr-admin-reelitem__spinner",size:18}):a.jsx(Gn,{size:18})})]})]}),f?a.jsx("p",{className:"ecr-admin-reel__title",children:e.title}):null]})},bc=(e,t)=>{const r=_.useRef(null),n=_.useRef(null),o=_.useRef(null),[i,s]=_.useState(!1),[l,c]=_.useState(!1),[d,u]=_.useState(!1),[p,m]=_.useState(300),g=()=>{const f=r.current;if(!f)return;const h=f.scrollLeft,v=f.scrollWidth,y=f.clientWidth;c(h>0),u(h+y<v-1)};_.useEffect(()=>{const f=r.current,h=n.current;f&&h&&(s(h.scrollWidth>f.clientWidth),m(f.clientWidth-100),g())},[e,t]);const b=f=>{const h=r.current;h&&(h.scrollBy({left:f,behavior:"smooth"}),o.current&&clearTimeout(o.current),o.current=setTimeout(g,300))};return _.useEffect(()=>{const f=r.current;if(!f)return;let h=!1,v,y;const w=A=>{h=!0,v=A.pageX-f.offsetLeft,y=f.scrollLeft,f.style.cursor="grabbing"},j=()=>{h=!1,f.style.cursor="default"},C=()=>{h=!1,f.style.cursor="default"},N=A=>{if(!h)return;A.preventDefault();const L=(A.pageX-f.offsetLeft-v)*1.5;f.scrollLeft=y-L,g()},S=A=>{h=!0,v=A.touches[0].pageX-f.offsetLeft,y=f.scrollLeft},E=()=>{h=!1},T=A=>{if(!h)return;const L=(A.touches[0].pageX-f.offsetLeft-v)*1.5;f.scrollLeft=y-L,g()};return f.addEventListener("mousedown",w),f.addEventListener("mouseleave",j),f.addEventListener("mouseup",C),f.addEventListener("mousemove",N),f.addEventListener("touchstart",S,{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",S),f.removeEventListener("touchend",E),f.removeEventListener("touchmove",T)}},[t]),_.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]),{thumbsContainerRef:r,thumbsWrapperRef:n,isOverflowing:i,canScrollLeft:l,canScrollRight:d,scrollBy:b,scrollStep:p}},_c=({reels:e,styles:t,gid:r,togglingId:n,handleRemoveReel:o})=>{const{thumbsContainerRef:i,thumbsWrapperRef:s,isOverflowing:l,canScrollLeft:c,canScrollRight:d,scrollBy:u,scrollStep:p}=bc([e],!0);return a.jsxs("div",{className:"ecr-admin-editor-carousel",children:[a.jsx("div",{ref:i,className:"ecr-admin-editor-carousel__viewport",children:a.jsx("div",{ref:s,style:{...!e.length&&{margin:"auto"}},className:$("ecr-admin-editor-carousel__track",t.hoverEffect==="zoom-in"&&"ecr-admin-editor-carousel__track--padded"),children:e.length>0?e.map(m=>a.jsx(xc,{reel:m,styles:t,gid:r,togglingId:n,onRemove:o},m.id)):a.jsx("div",{className:"ecr-admin-editor-carousel__empty",children:a.jsxs("p",{className:"ecr-admin-editor-carousel__empty-text",children:[a.jsx(lt,{className:"ecr-admin-editor-carousel__empty-icon"}),a.jsx("span",{children:"No reels have been added to this widget yet. Select some from the list on the left to get started."})]})})})}),l&&c&&a.jsx("button",{onClick:()=>u(-p),className:"ecr-admin-editor-carousel__nav ecr-admin-editor-carousel__nav--left",children:a.jsx(Vn,{size:20})}),l&&d&&a.jsx("button",{onClick:()=>u(p),className:"ecr-admin-editor-carousel__nav ecr-admin-editor-carousel__nav--right",children:a.jsx(Wn,{size:20})})]})},Kb=({reels:e,styles:t,gid:r,togglingId:n,handleRemoveReel:o})=>a.jsx("div",{className:$("ecr-admin-editor-grid",t?.hoverEffect==="zoom-in"&&"ecr-admin-editor-grid--padded"),children:e.length>0?e.map(i=>a.jsx(xc,{reel:i,styles:t,gid:r,togglingId:n,onRemove:o},i.id)):a.jsx("div",{className:"ecr-admin-editor-grid__empty",children:a.jsxs("p",{className:"ecr-admin-editor-grid__empty-text",children:[a.jsx(lt,{className:"ecr-admin-editor-grid__empty-icon"}),a.jsx("span",{children:"No reels have been added to this widget yet. Select some from the list on the left to get started."})]})})}),Yb=({reel:e,styles:t})=>{const r=Ar("(min-width: 1024px)"),n=e?.files?.[0],o=!!n?.mime_type?.startsWith("image"),[i,s]=_.useState(!1),[l,c]=_.useState(!0),[d,u]=_.useState(!1),p=_.useRef(null);_.useEffect(()=>{p.current&&(p.current.muted=l)},[l]),_.useEffect(()=>{p.current&&(i?p.current.pause():p.current.play().catch(()=>{}))},[i]);const m=()=>{p.current&&s(h=>!h)},g=()=>{p.current&&c(h=>!h)},b=t?.playerAppearance??"overlay",f=e.links&&e.links.length>0?e.links[0]:null;return a.jsxs("div",{className:"ecr-preview-player",children:[a.jsxs("div",{className:"ecr-preview-player__stage",children:[a.jsx(wt,{className:"ecr-player__nav--left ecr-preview-player__nav--disabled",type:"button",disabled:!0,"aria-disabled":"true",children:a.jsx(pi,{size:24})}),a.jsx(wt,{className:"ecr-player__nav--right ecr-preview-player__nav--disabled",type:"button",disabled:!0,"aria-disabled":"true",children:a.jsx(mi,{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,{size:r?20:24,className:"ecr-player__close-icon"})}),n?a.jsx("div",{className:"ecr-player__media-frame",children:o?a.jsx("img",{src:n.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:p,className:"ecr-preview-player__media-item",src:n.url,poster:e?.thumbnail,autoPlay:!0,muted:l,loop:!0,playsInline:!0,onClick:m,onLoadedMetadata:h=>{const v=h.currentTarget,y=v.videoWidth,w=v.videoHeight;u(()=>w>y)}}),a.jsxs("div",{className:"ecr-player__controls",children:[i?a.jsx(Jn,{size:r?20:24,className:"ecr-player__control-icon",onClick:m}):a.jsx(Xn,{size:r?20:24,className:"ecr-player__control-icon",onClick:m}),l?a.jsx(Qn,{size:r?20:24,className:"ecr-player__control-icon",onClick:g}):a.jsx(Zn,{size:r?20:24,className:"ecr-player__control-icon",onClick:g})]})]})}):a.jsx("div",{className:"ecr-preview-player__empty",children:"No preview available"})]}),b==="overlay"?f?a.jsx(Nn,{link:f,usedFor:"admin",usedIn:"thumb",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"8px",width:"95%",borderRadius:"6px"}}):a.jsx(Bt,{title:e.title}):null,b==="title"?a.jsx(Bt,{title:e.title}):null]}),a.jsxs("p",{className:"ecr-preview-message",children:["This is simply a ",a.jsx("strong",{children:"visual"})," representation intended to show how the preview will appear to end users."]})]})},Xb={carousel:_c,grid:Kb},Jb=({gid:e,reels:t,styles:r,handleRemoveReel:n,togglingId:o,currentTab:i})=>{const s=r.template??"carousel",l=Xb[s]||_c;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(Hb,{gid:e})]}),a.jsx("div",{className:"scrollbarThin ecr-admin-existing__body",children:i==="thumbnail"?a.jsx("div",{style:{"--thumbnail-size":`${r?.size}px`,"--thumbnail-size-tab":`${r?.sizeOnTab??r?.size}px`,"--thumbnail-size-mobile":`${r?.sizeOnMobile??r?.size}px`,"--thumbnail-gap":`${r?.gap}px`,"--thumbnail-gap-tab":`${r?.gapOnTab??r?.gap}px`,"--thumbnail-gap-mobile":`${r?.gapOnMobile??r?.gap}px`,"--thumbnail-border-radius":`${r?.border?.border_radius}px`},children:a.jsx(l,{reels:t,styles:r,gid:e,togglingId:o,handleRemoveReel:n})}):t.length>0?a.jsx(Yb,{reel:t[0],styles:r}):a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,alignItems:"center"},children:[a.jsx(lt,{style:{width:"40px",height:"40px",color:"#f59e0b"}}),"No reels available for preview."]})})]})},vc=()=>a.jsx("div",{className:"ecr-admin-reellist__loader",children:a.jsx("div",{className:"ecr-admin-reellist__spinner"})}),Zb=({gid:e,allReels:t,handleSelectReel:r,searchTerm:n,setSearchTerm:o,isSearching:i,togglingId:s,lastStoryElementRef:l})=>{const c=Ne(),{requestLeave:d}=gc(),u=`?view=${X.cr}&from=${X.mg}${e?`&gid=${e}`:""}`,p=t.filter(m=>!m?.files[0]?.mime_type.startsWith("image"));return a.jsxs("div",{className:"ecr-admin-reellist",children:[a.jsxs("div",{className:"ecr-admin-reellist__header",children:[a.jsx("p",{className:"ecr-admin-reellist__title",children:"All reels"}),a.jsx("small",{className:"ecr-admin-reellist__subtitle",children:"Choose reels to attach in this widget"})]}),a.jsxs("div",{className:"ecr-admin-reellist__body",children:[a.jsx(Rr,{to:u,text:"Add Reel",Icon:yt,className:"ecr-admin-reellist__add-button",textColor:"#2563eb",onNavigate:m=>d(()=>c(m))}),a.jsx("div",{className:"ecr-admin-reellist__search",children:a.jsx("input",{type:"text",placeholder:"Search reels...",value:n,onChange:m=>o(m.target.value),className:"ecr-admin-reellist__search-input"})}),a.jsx("div",{className:"scrollbarThin ecr-admin-reellist__grid",children:i&&t.length===0?a.jsx(vc,{}):a.jsxs("div",{className:"ecr-admin-reellist__items",children:[p.length===0?a.jsx("p",{className:"ecr-admin-reellist__empty",children:"No reels are available to add."}):p.map((m,g)=>a.jsx("div",{ref:p.length===g+1?l:null,className:"ecr-admin-reellist__item",children:a.jsxs("button",{title:"Click to add this reel",onClick:()=>r(m,"add"),disabled:s==m.story_uuid,className:"ecr-admin-reellist__card",children:[a.jsx("div",{className:"ecr-admin-reellist__media",children:a.jsx("video",{className:"ecr-admin-reellist__thumb",src:m?.files[0]?.url,poster:m?.thumbnail})}),a.jsx("span",{className:"ecr-admin-reellist__label",children:m.title||`Reel #${m.id}`}),s==m.story_uuid?a.jsx("div",{className:"ecr-admin-reellist__overlay",children:a.jsx(it,{className:"ecr-admin-reellist__overlay-icon"})}):null]})},m.id)),i&&t.length>0&&a.jsx(vc,{})]})})]})]})};function yc(e){const t=e+"CollectionProvider",[r,n]=Ve(t),[o,i]=r(t,{collectionRef:{current:null},itemMap:new Map}),s=f=>{const{scope:h,children:v}=f,y=_.useRef(null),w=_.useRef(new Map).current;return a.jsx(o,{scope:h,itemMap:w,collectionRef:y,children:v})};s.displayName=t;const l=e+"CollectionSlot",c=st(l),d=_.forwardRef((f,h)=>{const{scope:v,children:y}=f,w=i(l,v),j=J(h,w.collectionRef);return a.jsx(c,{ref:j,children:y})});d.displayName=l;const u=e+"CollectionItemSlot",p="data-radix-collection-item",m=st(u),g=_.forwardRef((f,h)=>{const{scope:v,children:y,...w}=f,j=_.useRef(null),C=J(h,j),N=i(u,v);return _.useEffect(()=>(N.itemMap.set(j,{ref:j,...w}),()=>void N.itemMap.delete(j))),a.jsx(m,{[p]:"",ref:C,children:y})});g.displayName=u;function b(f){const h=i(e+"CollectionConsumer",f);return _.useCallback(()=>{const y=h.collectionRef.current;if(!y)return[];const w=Array.from(y.querySelectorAll(`[${p}]`));return Array.from(h.itemMap.values()).sort((N,S)=>w.indexOf(N.ref.current)-w.indexOf(S.ref.current))},[h.collectionRef,h.itemMap])}return[{Provider:s,Slot:d,ItemSlot:g},b,n]}var Qb=x.createContext(void 0);function aa(e){const t=x.useContext(Qb);return e||t||"ltr"}var ia="rovingFocusGroup.onEntryFocus",e_={bubbles:!1,cancelable:!0},hr="RovingFocusGroup",[sa,wc,t_]=yc(hr),[r_,jc]=Ve(hr,[t_]),[n_,o_]=r_(hr),kc=x.forwardRef((e,t)=>a.jsx(sa.Provider,{scope:e.__scopeRovingFocusGroup,children:a.jsx(sa.Slot,{scope:e.__scopeRovingFocusGroup,children:a.jsx(a_,{...e,ref:t})})}));kc.displayName=hr;var a_=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:u=!1,...p}=e,m=x.useRef(null),g=J(t,m),b=aa(i),[f,h]=mt({prop:s,defaultProp:l??null,onChange:c,caller:hr}),[v,y]=x.useState(!1),w=We(d),j=wc(r),C=x.useRef(!1),[N,S]=x.useState(0);return x.useEffect(()=>{const E=m.current;if(E)return E.addEventListener(ia,w),()=>E.removeEventListener(ia,w)},[w]),a.jsx(n_,{scope:r,orientation:n,dir:b,loop:o,currentTabStopId:f,onItemFocus:x.useCallback(E=>h(E),[h]),onItemShiftTab:x.useCallback(()=>y(!0),[]),onFocusableItemAdd:x.useCallback(()=>S(E=>E+1),[]),onFocusableItemRemove:x.useCallback(()=>S(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:H(e.onMouseDown,()=>{C.current=!0}),onFocus:H(e.onFocus,E=>{const T=!C.current;if(E.target===E.currentTarget&&T&&!v){const A=new CustomEvent(ia,e_);if(E.currentTarget.dispatchEvent(A),!A.defaultPrevented){const R=j().filter(P=>P.focusable),L=R.find(P=>P.active),B=R.find(P=>P.id===f),O=[L,B,...R].filter(Boolean).map(P=>P.ref.current);Nc(O,u)}}C.current=!1}),onBlur:H(e.onBlur,()=>y(!1))})})}),Sc="RovingFocusGroupItem",Cc=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:o=!1,tabStopId:i,children:s,...l}=e,c=Ae(),d=i||c,u=o_(Sc,r),p=u.currentTabStopId===d,m=wc(r),{onFocusableItemAdd:g,onFocusableItemRemove:b,currentTabStopId:f}=u;return x.useEffect(()=>{if(n)return g(),()=>b()},[n,g,b]),a.jsx(sa.ItemSlot,{scope:r,id:d,focusable:n,active:o,children:a.jsx(W.span,{tabIndex:p?0:-1,"data-orientation":u.orientation,...l,ref:t,onMouseDown:H(e.onMouseDown,h=>{n?u.onItemFocus(d):h.preventDefault()}),onFocus:H(e.onFocus,()=>u.onItemFocus(d)),onKeyDown:H(e.onKeyDown,h=>{if(h.key==="Tab"&&h.shiftKey){u.onItemShiftTab();return}if(h.target!==h.currentTarget)return;const v=l_(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?c_(w,j+1):w.slice(j+1)}setTimeout(()=>Nc(w))}}),children:typeof s=="function"?s({isCurrentTabStop:p,hasTabStop:f!=null}):s})})});Cc.displayName=Sc;var i_={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function s_(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function l_(e,t,r){const n=s_(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return i_[n]}function Nc(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function c_(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var d_=kc,u_=Cc,En="Tabs",[p_]=Ve(En,[jc]),Ec=jc(),[m_,la]=p_(En),Tc=x.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,onValueChange:o,defaultValue:i,orientation:s="horizontal",dir:l,activationMode:c="automatic",...d}=e,u=aa(l),[p,m]=mt({prop:n,onChange:o,defaultProp:i??"",caller:En});return a.jsx(m_,{scope:r,baseId:Ae(),value:p,onValueChange:m,orientation:s,dir:u,activationMode:c,children:a.jsx(W.div,{dir:u,"data-orientation":s,...d,ref:t})})});Tc.displayName=En;var Ac="TabsList",Pc=x.forwardRef((e,t)=>{const{__scopeTabs:r,loop:n=!0,...o}=e,i=la(Ac,r),s=Ec(r);return a.jsx(d_,{asChild:!0,...s,orientation:i.orientation,dir:i.dir,loop:n,children:a.jsx(W.div,{role:"tablist","aria-orientation":i.orientation,...o,ref:t})})});Pc.displayName=Ac;var Oc="TabsTrigger",Rc=x.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,disabled:o=!1,...i}=e,s=la(Oc,r),l=Ec(r),c=Mc(s.baseId,n),d=zc(s.baseId,n),u=n===s.value;return a.jsx(u_,{asChild:!0,...l,focusable:!o,active:u,children:a.jsx(W.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":d,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:c,...i,ref:t,onMouseDown:H(e.onMouseDown,p=>{!o&&p.button===0&&p.ctrlKey===!1?s.onValueChange(n):p.preventDefault()}),onKeyDown:H(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&s.onValueChange(n)}),onFocus:H(e.onFocus,()=>{const p=s.activationMode!=="manual";!u&&!o&&p&&s.onValueChange(n)})})})});Rc.displayName=Oc;var Lc="TabsContent",Ic=x.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,forceMount:o,children:i,...s}=e,l=la(Lc,r),c=Mc(l.baseId,n),d=zc(l.baseId,n),u=n===l.value,p=x.useRef(u);return x.useEffect(()=>{const m=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(m)},[]),a.jsx(Ye,{present:o||u,children:({present:m})=>a.jsx(W.div,{"data-state":u?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!m,id:d,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:m&&i})})});Ic.displayName=Lc;function Mc(e,t){return`${e}-trigger-${t}`}function zc(e,t){return`${e}-content-${t}`}var f_=Tc,h_=Pc,g_=Rc,x_=Ic;function b_({className:e,...t}){return a.jsx(f_,{"data-slot":"tabs",className:$("ecr-tabs",e),...t})}function __({className:e,...t}){return a.jsx(h_,{"data-slot":"tabs-list",className:$("ecr-tabs__list",e),...t})}function Dc({className:e,...t}){return a.jsx(g_,{"data-slot":"tabs-trigger",className:$("ecr-tabs__trigger",e),...t})}function $c({className:e,...t}){return a.jsx(x_,{"data-slot":"tabs-content",className:$("ecr-tabs__content",e),...t})}const Ut=({label:e,text:t})=>a.jsxs(Je,{children:[a.jsx(Ze,{style:{textAlign:"left",padding:0,backgroundColor:"transparent"},children:a.jsxs("label",{className:"ecr-admin-switch",children:[a.jsxs("span",{className:"ecr-admin-switch__label",children:[e,": ",a.jsx(at,{size:20})]}),a.jsx(fb,{className:"ecr-admin-switch__icon",size:24})]})}),a.jsx(Qe,{className:"ecr-admin-popover",children:a.jsx(ft,{name:e,text:t})})]});function Fc(e,[t,r]){return Math.min(r,Math.max(t,e))}function v_(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 Bc=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"}),y_="VisuallyHidden",w_=x.forwardRef((e,t)=>a.jsx(W.span,{...e,ref:t,style:{...Bc,...e.style}}));w_.displayName=y_;var j_=[" ","Enter","ArrowUp","ArrowDown"],k_=[" ","Enter"],gt="Select",[Tn,An,S_]=yc(gt),[Ht]=Ve(gt,[S_,on]),Pn=on(),[C_,tt]=Ht(gt),[N_,E_]=Ht(gt),Uc=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:o,onOpenChange:i,value:s,defaultValue:l,onValueChange:c,dir:d,name:u,autoComplete:p,disabled:m,required:g,form:b}=e,f=Pn(t),[h,v]=x.useState(null),[y,w]=x.useState(null),[j,C]=x.useState(!1),N=aa(d),[S,E]=mt({prop:n,defaultProp:o??!1,onChange:i,caller:gt}),[T,A]=mt({prop:s,defaultProp:l,onChange:c,caller:gt}),R=x.useRef(null),L=h?b||!!h.closest("form"):!0,[B,M]=x.useState(new Set),O=Array.from(B).map(P=>P.props.value).join(";");return a.jsx(Ys,{...f,children:a.jsxs(C_,{required:g,scope:t,trigger:h,onTriggerChange:v,valueNode:y,onValueNodeChange:w,valueNodeHasChildren:j,onValueNodeHasChildrenChange:C,contentId:Ae(),value:T,onValueChange:A,open:S,onOpenChange:E,dir:N,triggerPointerDownPosRef:R,disabled:m,children:[a.jsx(Tn.Provider,{scope:t,children:a.jsx(N_,{scope:e.__scopeSelect,onNativeOptionAdd:x.useCallback(P=>{M(z=>new Set(z).add(P))},[]),onNativeOptionRemove:x.useCallback(P=>{M(z=>{const I=new Set(z);return I.delete(P),I})},[]),children:r})}),L?a.jsxs(dd,{"aria-hidden":!0,required:g,tabIndex:-1,name:u,autoComplete:p,value:T,onChange:P=>A(P.target.value),disabled:m,form:b,children:[T===void 0?a.jsx("option",{value:""}):null,Array.from(B)]},O):null]})})};Uc.displayName=gt;var Hc="SelectTrigger",Vc=x.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...o}=e,i=Pn(r),s=tt(Hc,r),l=s.disabled||n,c=J(t,s.onTriggerChange),d=An(r),u=x.useRef("touch"),[p,m,g]=pd(f=>{const h=d().filter(w=>!w.disabled),v=h.find(w=>w.value===s.value),y=md(h,f,v);y!==void 0&&s.onValueChange(y.value)}),b=f=>{l||(s.onOpenChange(!0),g()),f&&(s.triggerPointerDownPosRef.current={x:Math.round(f.pageX),y:Math.round(f.pageY)})};return a.jsx(Lo,{asChild:!0,...i,children:a.jsx(W.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":ud(s.value)?"":void 0,...o,ref:c,onClick:H(o.onClick,f=>{f.currentTarget.focus(),u.current!=="mouse"&&b(f)}),onPointerDown:H(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:H(o.onKeyDown,f=>{const h=p.current!=="";!(f.ctrlKey||f.altKey||f.metaKey)&&f.key.length===1&&m(f.key),!(h&&f.key===" ")&&j_.includes(f.key)&&(b(),f.preventDefault())})})})});Vc.displayName=Hc;var Wc="SelectValue",qc=x.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,children:i,placeholder:s="",...l}=e,c=tt(Wc,r),{onValueNodeHasChildrenChange:d}=c,u=i!==void 0,p=J(t,c.onValueNodeChange);return le(()=>{d(u)},[d,u]),a.jsx(W.span,{...l,ref:p,style:{pointerEvents:"none"},children:ud(c.value)?a.jsx(a.Fragment,{children:s}):i})});qc.displayName=Wc;var T_="SelectIcon",Gc=x.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...o}=e;return a.jsx(W.span,{"aria-hidden":!0,...o,ref:t,children:n||"▼"})});Gc.displayName=T_;var A_="SelectPortal",Kc=e=>a.jsx(an,{asChild:!0,...e});Kc.displayName=A_;var xt="SelectContent",Yc=x.forwardRef((e,t)=>{const r=tt(xt,e.__scopeSelect),[n,o]=x.useState();if(le(()=>{o(new DocumentFragment)},[]),!r.open){const i=n;return i?xr.createPortal(a.jsx(Xc,{scope:e.__scopeSelect,children:a.jsx(Tn.Slot,{scope:e.__scopeSelect,children:a.jsx("div",{children:e.children})})}),i):null}return a.jsx(Jc,{...e,ref:t})});Yc.displayName=xt;var Ce=10,[Xc,rt]=Ht(xt),P_="SelectContentImpl",O_=st("SelectContent.RemoveScroll"),Jc=x.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:s,side:l,sideOffset:c,align:d,alignOffset:u,arrowPadding:p,collisionBoundary:m,collisionPadding:g,sticky:b,hideWhenDetached:f,avoidCollisions:h,...v}=e,y=tt(xt,r),[w,j]=x.useState(null),[C,N]=x.useState(null),S=J(t,F=>j(F)),[E,T]=x.useState(null),[A,R]=x.useState(null),L=An(r),[B,M]=x.useState(!1),O=x.useRef(!1);x.useEffect(()=>{if(w)return Mo(w)},[w]),bo();const P=x.useCallback(F=>{const[Y,...se]=L().map(ae=>ae.ref.current),[Z]=se.slice(-1),ee=document.activeElement;for(const ae of F)if(ae===ee||(ae?.scrollIntoView({block:"nearest"}),ae===Y&&C&&(C.scrollTop=0),ae===Z&&C&&(C.scrollTop=C.scrollHeight),ae?.focus(),document.activeElement!==ee))return},[L,C]),z=x.useCallback(()=>P([E,w]),[P,E,w]);x.useEffect(()=>{B&&z()},[B,z]);const{onOpenChange:I,triggerPointerDownPosRef:q}=y;x.useEffect(()=>{if(w){let F={x:0,y:0};const Y=Z=>{F={x:Math.abs(Math.round(Z.pageX)-(q.current?.x??0)),y:Math.abs(Math.round(Z.pageY)-(q.current?.y??0))}},se=Z=>{F.x<=10&&F.y<=10?Z.preventDefault():w.contains(Z.target)||I(!1),document.removeEventListener("pointermove",Y),q.current=null};return q.current!==null&&(document.addEventListener("pointermove",Y),document.addEventListener("pointerup",se,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Y),document.removeEventListener("pointerup",se,{capture:!0})}}},[w,I,q]),x.useEffect(()=>{const F=()=>I(!1);return window.addEventListener("blur",F),window.addEventListener("resize",F),()=>{window.removeEventListener("blur",F),window.removeEventListener("resize",F)}},[I]);const[te,oe]=pd(F=>{const Y=L().filter(ee=>!ee.disabled),se=Y.find(ee=>ee.ref.current===document.activeElement),Z=md(Y,F,se);Z&&setTimeout(()=>Z.ref.current.focus())}),ge=x.useCallback((F,Y,se)=>{const Z=!O.current&&!se;(y.value!==void 0&&y.value===Y||Z)&&(T(F),Z&&(O.current=!0))},[y.value]),_e=x.useCallback(()=>w?.focus(),[w]),pe=x.useCallback((F,Y,se)=>{const Z=!O.current&&!se;(y.value!==void 0&&y.value===Y||Z)&&R(F)},[y.value]),K=n==="popper"?ca:Zc,de=K===ca?{side:l,sideOffset:c,align:d,alignOffset:u,arrowPadding:p,collisionBoundary:m,collisionPadding:g,sticky:b,hideWhenDetached:f,avoidCollisions:h}:{};return a.jsx(Xc,{scope:r,content:w,viewport:C,onViewportChange:N,itemRefCallback:ge,selectedItem:E,onItemLeave:_e,itemTextRefCallback:pe,focusSelectedItem:z,selectedItemText:A,position:n,isPositioned:B,searchRef:te,children:a.jsx(hn,{as:O_,allowPinchZoom:!0,children:a.jsx(Gr,{asChild:!0,trapped:y.open,onMountAutoFocus:F=>{F.preventDefault()},onUnmountAutoFocus:H(o,F=>{y.trigger?.focus({preventScroll:!0}),F.preventDefault()}),children:a.jsx(qr,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:F=>F.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:a.jsx(K,{role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed",dir:y.dir,onContextMenu:F=>F.preventDefault(),...v,...de,onPlaced:()=>M(!0),ref:S,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:H(v.onKeyDown,F=>{const Y=F.ctrlKey||F.altKey||F.metaKey;if(F.key==="Tab"&&F.preventDefault(),!Y&&F.key.length===1&&oe(F.key),["ArrowUp","ArrowDown","Home","End"].includes(F.key)){let Z=L().filter(ee=>!ee.disabled).map(ee=>ee.ref.current);if(["ArrowUp","End"].includes(F.key)&&(Z=Z.slice().reverse()),["ArrowUp","ArrowDown"].includes(F.key)){const ee=F.target,ae=Z.indexOf(ee);Z=Z.slice(ae+1)}setTimeout(()=>P(Z)),F.preventDefault()}})})})})})})});Jc.displayName=P_;var R_="SelectItemAlignedPosition",Zc=x.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...o}=e,i=tt(xt,r),s=rt(xt,r),[l,c]=x.useState(null),[d,u]=x.useState(null),p=J(t,S=>u(S)),m=An(r),g=x.useRef(!1),b=x.useRef(!0),{viewport:f,selectedItem:h,selectedItemText:v,focusSelectedItem:y}=s,w=x.useCallback(()=>{if(i.trigger&&i.valueNode&&l&&d&&f&&h&&v){const S=i.trigger.getBoundingClientRect(),E=d.getBoundingClientRect(),T=i.valueNode.getBoundingClientRect(),A=v.getBoundingClientRect();if(i.dir!=="rtl"){const ee=A.left-E.left,ae=T.left-ee,ve=S.left-ae,bt=S.width+ve,_a=Math.max(bt,E.width),va=window.innerWidth-Ce,ya=Fc(ae,[Ce,Math.max(Ce,va-_a)]);l.style.minWidth=bt+"px",l.style.left=ya+"px"}else{const ee=E.right-A.right,ae=window.innerWidth-T.right-ee,ve=window.innerWidth-S.right-ae,bt=S.width+ve,_a=Math.max(bt,E.width),va=window.innerWidth-Ce,ya=Fc(ae,[Ce,Math.max(Ce,va-_a)]);l.style.minWidth=bt+"px",l.style.right=ya+"px"}const R=m(),L=window.innerHeight-Ce*2,B=f.scrollHeight,M=window.getComputedStyle(d),O=parseInt(M.borderTopWidth,10),P=parseInt(M.paddingTop,10),z=parseInt(M.borderBottomWidth,10),I=parseInt(M.paddingBottom,10),q=O+P+B+I+z,te=Math.min(h.offsetHeight*5,q),oe=window.getComputedStyle(f),ge=parseInt(oe.paddingTop,10),_e=parseInt(oe.paddingBottom,10),pe=S.top+S.height/2-Ce,K=L-pe,de=h.offsetHeight/2,F=h.offsetTop+de,Y=O+P+F,se=q-Y;if(Y<=pe){const ee=R.length>0&&h===R[R.length-1].ref.current;l.style.bottom="0px";const ae=d.clientHeight-f.offsetTop-f.offsetHeight,ve=Math.max(K,de+(ee?_e:0)+ae+z),bt=Y+ve;l.style.height=bt+"px"}else{const ee=R.length>0&&h===R[0].ref.current;l.style.top="0px";const ve=Math.max(pe,O+f.offsetTop+(ee?ge:0)+de)+se;l.style.height=ve+"px",f.scrollTop=Y-pe+f.offsetTop}l.style.margin=`${Ce}px 0`,l.style.minHeight=te+"px",l.style.maxHeight=L+"px",n?.(),requestAnimationFrame(()=>g.current=!0)}},[m,i.trigger,i.valueNode,l,d,f,h,v,i.dir,n]);le(()=>w(),[w]);const[j,C]=x.useState();le(()=>{d&&C(window.getComputedStyle(d).zIndex)},[d]);const N=x.useCallback(S=>{S&&b.current===!0&&(w(),y?.(),b.current=!1)},[w,y]);return a.jsx(I_,{scope:r,contentWrapper:l,shouldExpandOnScrollRef:g,onScrollButtonChange:N,children:a.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:j},children:a.jsx(W.div,{...o,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});Zc.displayName=R_;var L_="SelectPopperPosition",ca=x.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:o=Ce,...i}=e,s=Pn(r);return a.jsx(Xs,{...s,...i,ref:t,align:n,collisionPadding:o,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});ca.displayName=L_;var[I_,da]=Ht(xt,{}),ua="SelectViewport",Qc=x.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...o}=e,i=rt(ua,r),s=da(ua,r),l=J(t,i.onViewportChange),c=x.useRef(0);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),a.jsx(Tn.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:H(o.onScroll,d=>{const u=d.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:m}=s;if(m?.current&&p){const g=Math.abs(c.current-u.scrollTop);if(g>0){const b=window.innerHeight-Ce*2,f=parseFloat(p.style.minHeight),h=parseFloat(p.style.height),v=Math.max(f,h);if(v<b){const y=v+g,w=Math.min(b,y),j=y-w;p.style.height=w+"px",p.style.bottom==="0px"&&(u.scrollTop=j>0?j:0,p.style.justifyContent="flex-end")}}}c.current=u.scrollTop})})})]})});Qc.displayName=ua;var ed="SelectGroup",[M_,z_]=Ht(ed),D_=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=Ae();return a.jsx(M_,{scope:r,id:o,children:a.jsx(W.div,{role:"group","aria-labelledby":o,...n,ref:t})})});D_.displayName=ed;var td="SelectLabel",$_=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=z_(td,r);return a.jsx(W.div,{id:o.id,...n,ref:t})});$_.displayName=td;var On="SelectItem",[F_,rd]=Ht(On),nd=x.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:o=!1,textValue:i,...s}=e,l=tt(On,r),c=rt(On,r),d=l.value===n,[u,p]=x.useState(i??""),[m,g]=x.useState(!1),b=J(t,y=>c.itemRefCallback?.(y,n,o)),f=Ae(),h=x.useRef("touch"),v=()=>{o||(l.onValueChange(n),l.onOpenChange(!1))};if(n==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return a.jsx(F_,{scope:r,value:n,disabled:o,textId:f,isSelected:d,onItemTextChange:x.useCallback(y=>{p(w=>w||(y?.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,...s,ref:b,onFocus:H(s.onFocus,()=>g(!0)),onBlur:H(s.onBlur,()=>g(!1)),onClick:H(s.onClick,()=>{h.current!=="mouse"&&v()}),onPointerUp:H(s.onPointerUp,()=>{h.current==="mouse"&&v()}),onPointerDown:H(s.onPointerDown,y=>{h.current=y.pointerType}),onPointerMove:H(s.onPointerMove,y=>{h.current=y.pointerType,o?c.onItemLeave?.():h.current==="mouse"&&y.currentTarget.focus({preventScroll:!0})}),onPointerLeave:H(s.onPointerLeave,y=>{y.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:H(s.onKeyDown,y=>{c.searchRef?.current!==""&&y.key===" "||(k_.includes(y.key)&&v(),y.key===" "&&y.preventDefault())})})})})});nd.displayName=On;var gr="SelectItemText",od=x.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,...i}=e,s=tt(gr,r),l=rt(gr,r),c=rd(gr,r),d=E_(gr,r),[u,p]=x.useState(null),m=J(t,v=>p(v),c.onItemTextChange,v=>l.itemTextRefCallback?.(v,c.value,c.disabled)),g=u?.textContent,b=x.useMemo(()=>a.jsx("option",{value:c.value,disabled:c.disabled,children:g},c.value),[c.disabled,c.value,g]),{onNativeOptionAdd:f,onNativeOptionRemove:h}=d;return le(()=>(f(b),()=>h(b)),[f,h,b]),a.jsxs(a.Fragment,{children:[a.jsx(W.span,{id:c.textId,...i,ref:m}),c.isSelected&&s.valueNode&&!s.valueNodeHasChildren?xr.createPortal(i.children,s.valueNode):null]})});od.displayName=gr;var ad="SelectItemIndicator",id=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return rd(ad,r).isSelected?a.jsx(W.span,{"aria-hidden":!0,...n,ref:t}):null});id.displayName=ad;var pa="SelectScrollUpButton",sd=x.forwardRef((e,t)=>{const r=rt(pa,e.__scopeSelect),n=da(pa,e.__scopeSelect),[o,i]=x.useState(!1),s=J(t,n.onScrollButtonChange);return le(()=>{if(r.viewport&&r.isPositioned){let l=function(){const d=c.scrollTop>0;i(d)};const c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),o?a.jsx(cd,{...e,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});sd.displayName=pa;var ma="SelectScrollDownButton",ld=x.forwardRef((e,t)=>{const r=rt(ma,e.__scopeSelect),n=da(ma,e.__scopeSelect),[o,i]=x.useState(!1),s=J(t,n.onScrollButtonChange);return le(()=>{if(r.viewport&&r.isPositioned){let l=function(){const d=c.scrollHeight-c.clientHeight,u=Math.ceil(c.scrollTop)<d;i(u)};const c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),o?a.jsx(cd,{...e,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});ld.displayName=ma;var cd=x.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...o}=e,i=rt("SelectScrollButton",r),s=x.useRef(null),l=An(r),c=x.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return x.useEffect(()=>()=>c(),[c]),le(()=>{l().find(u=>u.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),a.jsx(W.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:H(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(n,50))}),onPointerMove:H(o.onPointerMove,()=>{i.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(n,50))}),onPointerLeave:H(o.onPointerLeave,()=>{c()})})}),B_="SelectSeparator",U_=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return a.jsx(W.div,{"aria-hidden":!0,...n,ref:t})});U_.displayName=B_;var fa="SelectArrow",H_=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=Pn(r),i=tt(fa,r),s=rt(fa,r);return i.open&&s.position==="popper"?a.jsx(Js,{...o,...n,ref:t}):null});H_.displayName=fa;var V_="SelectBubbleInput",dd=x.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const o=x.useRef(null),i=J(n,o),s=v_(t);return x.useEffect(()=>{const l=o.current;if(!l)return;const c=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(c,"value").set;if(s!==t&&u){const p=new Event("change",{bubbles:!0});u.call(l,t),l.dispatchEvent(p)}},[s,t]),a.jsx(W.select,{...r,style:{...Bc,...r.style},ref:i,defaultValue:t})});dd.displayName=V_;function ud(e){return e===""||e===void 0}function pd(e){const t=We(e),r=x.useRef(""),n=x.useRef(0),o=x.useCallback(s=>{const l=r.current+s;t(l),(function c(d){r.current=d,window.clearTimeout(n.current),d!==""&&(n.current=window.setTimeout(()=>c(""),1e3))})(l)},[t]),i=x.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return x.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,o,i]}function md(e,t,r){const o=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,i=r?e.indexOf(r):-1;let s=W_(e,Math.max(i,0));o.length===1&&(s=s.filter(d=>d!==r));const c=s.find(d=>d.textValue.toLowerCase().startsWith(o.toLowerCase()));return c!==r?c:void 0}function W_(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var q_=Uc,G_=Vc,K_=qc,Y_=Gc,X_=Kc,J_=Yc,Z_=Qc,Q_=nd,ev=od,tv=id,rv=sd,nv=ld;function Vt({...e}){return a.jsx(q_,{"data-slot":"select",...e})}function Wt({...e}){return a.jsx(K_,{"data-slot":"select-value",...e})}function qt({className:e,size:t="default",children:r,...n}){return a.jsxs(G_,{"data-slot":"select-trigger","data-size":t,className:$("ecr-select__trigger",e),...n,children:[r,a.jsx(Y_,{asChild:!0,children:a.jsx(Yn,{className:"ecr-select__icon"})})]})}function Gt({className:e,children:t,position:r="popper",align:n="center",...o}){const i=typeof document<"u"?document.getElementById("ecommreels-admin-app")??document.body:void 0;return a.jsx(X_,{container:i,children:a.jsxs(J_,{"data-slot":"select-content",className:$("ecr-select__content",e),position:r,align:n,...o,children:[a.jsx(ov,{}),a.jsx(Z_,{className:$("ecr-select__viewport"),children:t}),a.jsx(av,{})]})})}function Kt({className:e,children:t,...r}){return a.jsxs(Q_,{"data-slot":"select-item",className:$("ecr-select__item",e),...r,children:[a.jsx("span",{className:"ecr-select__check",children:a.jsx(tv,{children:a.jsx($p,{className:"ecr-select__check-icon"})})}),a.jsx(ev,{children:t})]})}function ov({className:e,...t}){return a.jsx(rv,{"data-slot":"select-scroll-up-button",className:$("ecr-select__scroll-button",e),...t,children:a.jsx(Fp,{className:"ecr-select__icon"})})}function av({className:e,...t}){return a.jsx(nv,{"data-slot":"select-scroll-down-button",className:$("ecr-select__scroll-button",e),...t,children:a.jsx(Yn,{className:"ecr-select__icon"})})}const iv=({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(Vt,{value:e,onValueChange:t,children:[a.jsx(qt,{className:"ecr-admin-control__trigger",children:a.jsx(Wt,{placeholder:"Layout"})}),a.jsx(Gt,{children:Qu.map(r=>a.jsx(Kt,{value:r.value,className:"ecr-admin-control__option",children:r.label},r.value))})]})]}),sv={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 lv(){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(Vt,{defaultValue:ti[0].value,children:[a.jsx(qt,{className:"ecr-admin-control__trigger",children:a.jsx(Wt,{placeholder:"Layout"})}),a.jsxs(Gt,{children:[ti.map(e=>a.jsx(Kt,{value:e.value,className:"ecr-admin-control__option",children:e.label},e.value)),Xu.map(e=>a.jsx("div",{children:a.jsxs(Je,{modal:!0,children:[a.jsxs(Ze,{className:"ecr-admin-control__lock-trigger",children:[a.jsx("span",{className:"ecr-admin-control__option",children:e.label}),a.jsx(at,{size:18})]}),a.jsx(Qe,{className:"ecr-admin-control__popover",children:a.jsx(ft,{name:e.label,text:sv[e.value]})})]})},e.value))]})]})]})}const cv=({styles:e,updateStyles:t})=>a.jsxs("div",{className:"ecr-admin-thumb-controls",children:[a.jsx(Ut,{label:"Disable Preview",text:a.jsx(a.Fragment,{children:"Turn off previews for a cleaner look and a more focused browsing experience!"})}),a.jsx(lv,{}),a.jsx(iv,{appearance:e?.playerAppearance??"overlay",handleLinkLayout:r=>t(n=>({...n,playerAppearance:r}))})]});var Rn="Collapsible",[dv]=Ve(Rn),[uv,ha]=dv(Rn),fd=x.forwardRef((e,t)=>{const{__scopeCollapsible:r,open:n,defaultOpen:o,disabled:i,onOpenChange:s,...l}=e,[c,d]=mt({prop:n,defaultProp:o??!1,onChange:s,caller:Rn});return a.jsx(uv,{scope:r,disabled:i,contentId:Ae(),open:c,onOpenToggle:x.useCallback(()=>d(u=>!u),[d]),children:a.jsx(W.div,{"data-state":xa(c),"data-disabled":i?"":void 0,...l,ref:t})})});fd.displayName=Rn;var hd="CollapsibleTrigger",gd=x.forwardRef((e,t)=>{const{__scopeCollapsible:r,...n}=e,o=ha(hd,r);return a.jsx(W.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":xa(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...n,ref:t,onClick:H(e.onClick,o.onOpenToggle)})});gd.displayName=hd;var ga="CollapsibleContent",xd=x.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=ha(ga,e.__scopeCollapsible);return a.jsx(Ye,{present:r||o.open,children:({present:i})=>a.jsx(pv,{...n,ref:t,present:i})})});xd.displayName=ga;var pv=x.forwardRef((e,t)=>{const{__scopeCollapsible:r,present:n,children:o,...i}=e,s=ha(ga,r),[l,c]=x.useState(n),d=x.useRef(null),u=J(t,d),p=x.useRef(0),m=p.current,g=x.useRef(0),b=g.current,f=s.open||l,h=x.useRef(f),v=x.useRef(void 0);return x.useEffect(()=>{const y=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(y)},[]),le(()=>{const y=d.current;if(y){v.current=v.current||{transitionDuration:y.style.transitionDuration,animationName:y.style.animationName},y.style.transitionDuration="0s",y.style.animationName="none";const w=y.getBoundingClientRect();p.current=w.height,g.current=w.width,h.current||(y.style.transitionDuration=v.current.transitionDuration,y.style.animationName=v.current.animationName),c(n)}},[s.open,n]),a.jsx(W.div,{"data-state":xa(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!f,...i,ref:u,style:{"--radix-collapsible-content-height":m?`${m}px`:void 0,"--radix-collapsible-content-width":b?`${b}px`:void 0,...e.style},children:f&&o})});function xa(e){return e?"open":"closed"}var mv=fd,fv=gd,hv=xd;function bd({className:e,...t}){return a.jsx(mv,{"data-slot":"collapsible",className:$("ecr-collapsible",e),...t})}function _d({className:e,children:t,...r}){return a.jsxs(fv,{"data-slot":"collapsible-trigger",className:$("ecr-collapsible__trigger",e),...r,children:[a.jsx("span",{className:"ecr-collapsible__trigger-label",children:t}),a.jsx(Yn,{className:"ecr-collapsible__trigger-icon"})]})}function vd({className:e,...t}){return a.jsx(hv,{"data-slot":"collapsible-content",className:$("ecr-collapsible__content",e),...t})}const gv={modern:a.jsx(a.Fragment,{children:"Give your reel’s product card a sleek, modern appearance that feels fresh, clean, and visually engaging."}),classic:a.jsx(a.Fragment,{children:"Give your reel’s product card a timeless, classic appearance that feels familiar, simple, and easy to recognize."})},xv=({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(Vt,{value:e,onValueChange:t,children:[a.jsx(qt,{className:"ecr-admin-control__trigger",children:a.jsx(Wt,{placeholder:"Layout"})}),a.jsxs(Gt,{children:[Ju.map(r=>a.jsx(Kt,{value:r.value,className:"ecr-admin-control__option",children:r.label},r.value)),Zu.map(r=>a.jsx("div",{children:a.jsxs(Je,{modal:!0,children:[a.jsxs(Ze,{className:"ecr-admin-control__lock-trigger",children:[a.jsx("span",{className:"ecr-admin-control__option",children:r.label}),a.jsx(at,{size:18})]}),a.jsx(Qe,{className:"ecr-admin-control__popover",children:a.jsx(ft,{name:r.label,text:gv[r.value]})})]})},r.value))]})]})]}),bv=[{Icon:qp,label:"Desktop",value:"desktop"},{Icon:Jp,label:"Tab",value:"tab"},{Icon:Kp,label:"Mobile",value:"mobile"}],yd=({label:e,min:t,max:r,value:n,onChange:o,name:i,id:s,wrapperStyles:l,hideSlider:c,device:d,setDevice:u})=>{const[p,m]=_.useState(n),g=_.useRef(null);_.useEffect(()=>{m(n)},[n]);const b=h=>{const v=Math.min(r,Math.max(t,Number(h)));o(v)},f=h=>{const v=Number(h);m(v),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{b(v>r?r:v<t?t:v)},1e3)};return a.jsxs("div",{style:l,className:"ecr-admin-range",children:[a.jsxs("label",{htmlFor:s,className:"ecr-admin-range__label",children:[e,":",a.jsxs(Vt,{value:d,onValueChange:h=>u(h),children:[a.jsx(qt,{style:{padding:"4px 4px 0px",height:"24px",gap:"4px"},children:a.jsx(Wt,{})}),a.jsx(Gt,{style:{minWidth:"60px"},children:bv.map(h=>a.jsx(Kt,{value:h.value,title:h.label,children:a.jsx(h.Icon,{size:16})},h.value))})]})]}),a.jsxs("div",{className:"ecr-admin-range__row",children:[!c&&a.jsx("input",{type:"range",id:s,name:i,min:t,max:r,value:n,onChange:h=>{const v=Number(h.target.value);m(v),b(v)},className:"ecr-admin-range__slider"}),a.jsxs("div",{className:"ecr-admin-range__value",children:[a.jsx(ea,{type:"number",min:t,max:r,value:p,onChange:h=>f(h.target.value)}),a.jsx("span",{className:"ecr-admin-range__unit",children:"px"})]})]})]})},_v=({styles:e,updateStyles:t})=>{const[r,n]=_.useState("desktop"),i={mobile:e?.gapOnMobile,tab:e?.gapOnTab,desktop:e?.gap}[r]??e?.gap,s=l=>{switch(r){case"mobile":t(c=>({...c,gapOnMobile:l}));break;case"tab":t(c=>({...c,gapOnTab:l}));break;default:t(c=>({...c,gap:l}));break}};return a.jsx(yd,{label:"Gap",min:0,max:80,value:i,onChange:s,name:"column_gap",id:"column-gap",device:r,setDevice:n})},vv=({styles:e,updateStyles:t})=>{const[r,n]=_.useState("desktop"),i={mobile:e?.sizeOnMobile,tab:e?.sizeOnTab,desktop:e?.size}[r]??e?.size,s=l=>{switch(r){case"mobile":t(c=>({...c,sizeOnMobile:l}));break;case"tab":t(c=>({...c,sizeOnTab:l}));break;default:t(c=>({...c,size:l}));break}};return a.jsx(yd,{label:"Size",min:150,max:400,value:i,onChange:s,name:"size",id:"size",device:r,setDevice:n})},yv=[{value:"rectangle",label:"Rectangle"},{value:"circle",label:"Circle"}],wv=({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:yv.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(vm,{color:"#2563eb",size:16}):a.jsx(ym,{color:"#8c95a9",size:16}),n.label]})]},n.value))})]})},jv=Object.values(ei),kv={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!"})},Sv=({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(Vt,{value:e,onValueChange:t,children:[a.jsx(qt,{className:"ecr-admin-control__trigger",children:a.jsx(Wt,{placeholder:"Layout"})}),a.jsxs(Gt,{children:[jv.map(r=>a.jsx(Kt,{value:r,className:"ecr-admin-control__option",children:r},r)),Ku.map(r=>a.jsx("div",{children:a.jsxs(Je,{modal:!0,children:[a.jsxs(Ze,{className:"ecr-admin-control__lock-trigger",children:[a.jsx("span",{className:"ecr-admin-control__option",children:r}),a.jsx(at,{size:18})]}),a.jsx(Qe,{className:"ecr-admin-control__popover",children:a.jsx(ft,{name:r,text:kv[r]})})]})},r))]})]})]}),Cv=({isLayoutOpen:e,handleSectionOpen:t,styles:r,updateStyles:n})=>a.jsxs(bd,{open:e,className:"ecr-admin-thumb-controls__section",children:[a.jsxs(_d,{className:"ecr-admin-thumb-controls__section-trigger",type:"button",onClick:()=>t("layout"),children:[a.jsx(Hp,{size:16})," ",a.jsx("span",{children:"Layout"})]}),a.jsxs(vd,{className:"ecr-admin-thumb-controls__section-content",children:[a.jsx(wv,{selectedShape:r?.shape,handleShape:o=>n(i=>({...i,shape:o}))}),a.jsx(Sv,{selectedLayout:r?.template??"carousel",handleLayout:o=>n(i=>({...i,template:o}))}),a.jsx(xv,{linkLayout:r?.appearance??"overlay",handleLinkLayout:o=>n(i=>({...i,appearance:o}))}),a.jsx(vv,{styles:r,updateStyles:n}),a.jsx(_v,{styles:r,updateStyles:n}),a.jsx(Ut,{label:"Show Ratings",text:a.jsx(a.Fragment,{children:"Hide Ratings to remove distractions and provide a cleaner, more focused visual experience!"})}),a.jsx(Ut,{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(Ut,{label:"Autoplay",text:a.jsx(a.Fragment,{children:"Enable autoplay for videos on your product and pages, capturing users' attention instantly!"})}),a.jsx(Ut,{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(Ut,{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!"})})]})]}),Nv=({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(Vt,{value:e,onValueChange:t,children:[a.jsx(qt,{className:"ecr-admin-control__trigger",children:a.jsx(Wt,{placeholder:"Layout"})}),a.jsx(Gt,{children:Yu.map(r=>a.jsx(Kt,{value:r.value,className:"ecr-admin-control__option",children:r.label},r.value))})]})]}),Ev=({isStyleOpen:e,handleSectionOpen:t,styles:r,updateStyles:n})=>a.jsxs(bd,{open:e,className:"ecr-admin-thumb-controls__section",children:[a.jsxs(_d,{className:"ecr-admin-thumb-controls__section-trigger",type:"button",onClick:()=>t("style"),children:[a.jsx(Gp,{size:16}),a.jsx("span",{children:"Styles"})]}),a.jsxs(vd,{className:"ecr-admin-thumb-controls__section-content",children:[a.jsx(ta,{label:"Border Width",min:0,max:12,value:r?.border?.border_width??0,onChange:o=>n(i=>({...i,border:{...i.border,border_width:o}})),name:"border_width",id:"border-width"}),a.jsx(fc,{selectedColor:r?.border?.border_color,handleColor:o=>n(i=>({...i,border:{...i.border,border_color:o}})),text:"Border Color"}),r?.shape==="rectangle"&&a.jsx(ta,{label:"Border Radius",min:0,max:99,value:r?.border?.border_radius??0,onChange:o=>n(i=>({...i,border:{...i.border,border_radius:o}})),name:"border_radius",id:"border-radius"}),a.jsx(Nv,{hoverEffect:r?.hoverEffect||"none",handleHoverEffect:o=>n(i=>({...i,hoverEffect:o}))})]})]}),Tv=({styles:e,updateStyles:t})=>{const[r,n]=_.useState("layout"),o=r==="layout",i=r==="style",s=l=>{n(r!==l?l:null)};return a.jsxs("div",{className:"ecr-admin-thumb-controls",children:[a.jsx(Cv,{handleSectionOpen:s,isLayoutOpen:o,styles:e,updateStyles:t}),a.jsx(Ev,{isStyleOpen:i,handleSectionOpen:s,styles:e,updateStyles:t})]})},Av=({styles:e,setStyles:t,isExpanded:r,setIsExpanded:n,setIsEdited:o,tabs:i,currentTab:s,setCurrentTab:l})=>{const c=u=>{t(p=>{const m=u(p);return o(!0),m})},d=u=>{(u===i.thumbnail||u===i.preview)&&l(u)};return a.jsxs("div",{className:$("ecr-admin-sidepanel",r?"ecr-admin-sidepanel--expanded":"ecr-admin-sidepanel--collapsed"),children:[r&&a.jsx("div",{className:"ecr-admin-mobile-overlay",onClick:()=>n(!1)}),a.jsxs("div",{className:"ecr-admin-sidepanel-content",children:[a.jsxs("div",{className:"ecr-admin-sidepanel__header",children:[a.jsx("p",{className:"ecr-admin-sidepanel__title",children:"Customization"}),a.jsx("small",{className:"ecr-admin-sidepanel__subtitle",children:"Customize your widget however you like"})]}),a.jsx("div",{className:"ecr-admin-sidepanel__body",children:a.jsxs(b_,{value:s,onValueChange:d,className:"ecr-admin-sidepanel__tabs",children:[a.jsxs(__,{className:"ecr-admin-sidepanel__tabs-list",children:[a.jsx(Dc,{value:i.thumbnail,children:"Thumbnail"}),a.jsx(Dc,{value:i.preview,children:"Preview"})]}),a.jsx($c,{value:i.thumbnail,children:a.jsx(Tv,{styles:e,updateStyles:c})}),a.jsx($c,{value:i.preview,children:a.jsx(cv,{styles:e,updateStyles:c})})]})})]})]})},Pv=e=>{const t=Ne(),[r,n]=_.useState(""),[o,i]=_.useState([]),[s,l]=_.useState(ot),[c,d]=_.useState(!0),[u,p]=_.useState(!1),[m,g]=_.useState(!1);_.useEffect(()=>{(async()=>{if(!e){d(!1);return}d(!0);try{const y=(await he.get(`stories/${e}`)).data;n(y.group_name),i(y.stories),l(y.styles??ot)}catch(v){v instanceof Error?G.error(v.message):G.error("Something went wrong. Try again later!")}finally{d(!1)}})()},[e]);const b=async h=>{const v=o.map(j=>j.id),y={group_name:r,styles:s,story_ids:v};e&&(y.group_id=e);const w=await he.post("stories/manage-group-stories",y);if(!e){const j=w.data.group_id;t(`?view=${X.mg}&gid=${j}`,{replace:!0})}return{...w.data,isNewGroup:!e}};return{groupTitle:r,setGroupTitle:n,thisGroupReels:o,setThisGroupReels:i,styles:s,setStyles:l,isLoading:c,isSaving:u,isEdited:m,setIsEdited:g,handleSave:async()=>{try{p(!0);const h=await b();return g(!1),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)}}}},Ov=e=>{const[t,r]=_.useState(!1),n=_.useRef(null),o=_.useRef(null),i=_.useRef(!1),s=_.useRef(typeof window<"u"?window.location.hash:"");return _.useEffect(()=>{e||(n.current=null,o.current=null,r(!1))},[e]),_.useEffect(()=>{if(!e)return;const p=m=>{m.preventDefault(),m.returnValue=""};return window.addEventListener("beforeunload",p),()=>window.removeEventListener("beforeunload",p)},[e]),_.useEffect(()=>{const p=()=>{const m=window.location.hash;if(!e){s.current=m;return}if(i.current){i.current=!1,s.current=m;return}m!==s.current&&(o.current=m,window.location.hash=s.current,r(!0))};return window.addEventListener("hashchange",p),()=>window.removeEventListener("hashchange",p)},[e]),{showLeaveModal:t,requestLeave:p=>{if(!e){p();return}n.current=p,r(!0)},confirmLeave:()=>{if(r(!1),n.current){const p=n.current;n.current=null,i.current=!0,p();return}if(o.current){const p=o.current;o.current=null,i.current=!0,window.location.hash=p}},cancelLeave:()=>{n.current=null,o.current=null,r(!1)},allowNextNavigation:p=>{i.current=!0,p()}}},wd={thumbnail:"thumbnail",preview:"preview"},Rv=()=>{const e=Ne(),[t]=Zt(),r=t.get("gid"),n=Ar("(min-width: 1024px)"),{groupTitle:o,setGroupTitle:i,thisGroupReels:s,setThisGroupReels:l,styles:c,setStyles:d,isLoading:u,isSaving:p,isEdited:m,setIsEdited:g,handleSave:b}=Pv(r),{allReels:f,searchTerm:h,setSearchTerm:v,isSearching:y,lastStoryElementRef:w,refreshReels:j}=as(r),[C,N]=_.useState(""),[S,E]=_.useState(n),[T,A]=_.useState(wd.thumbnail),[R,L]=_.useState([]),B=_.useMemo(()=>new Set(s.map(K=>K.story_uuid)),[s]),M=_.useMemo(()=>h.trim().toLowerCase(),[h]),O=_.useMemo(()=>M?R.filter(K=>K.title.toLowerCase().includes(M)):R,[R,M]),P=_.useMemo(()=>{const K=new Map;for(const de of O)K.set(de.story_uuid,de);for(const de of f)K.has(de.story_uuid)||K.set(de.story_uuid,de);return Array.from(K.values())},[O,f]),z=_.useMemo(()=>P.filter(K=>!B.has(K.story_uuid)),[P,B]);_.useEffect(()=>{E(n)},[n]),_.useEffect(()=>{L([])},[r]);const{showLeaveModal:I,requestLeave:q,confirmLeave:te,cancelLeave:oe,allowNextNavigation:ge}=Ov(m),_e=async(K,de)=>{try{N(K.story_uuid);const F=de==="add"?[K,...s]:s.filter(Y=>Y.story_uuid!==K.story_uuid);l(F),L(de==="add"?Y=>Y.filter(se=>se.story_uuid!==K.story_uuid):Y=>Y.some(se=>se.story_uuid===K.story_uuid)?Y:[K,...Y]),g(!0)}catch(F){F instanceof Error?G.error(F.message):G.error("Something went wrong. Please try again later!")}finally{N("")}},pe=async()=>{const K=await b();K&&(L([]),j()),K?.isNewGroup&&ge(()=>{e(`?view=${X.mg}&gid=${K.group_id}`,{replace:!0})})};return u?a.jsx(Lr,{}):a.jsxs(Vb,{value:{requestLeave:q},children:[a.jsx(kt,{left:[a.jsx(St,{name:"Manage Widget",Icon:Pr},"page"),a.jsx(tr,{cb:()=>q(()=>e(`?view=${X.ag}`))},"back")],center:[a.jsxs("div",{className:"ecr-admin-group-title__wrapper",children:[a.jsx(is,{placeholder:"Enter group title",title:o,setTitle:i,setIsEdited:g,style:{paddingInline:"32px"}}),o&&a.jsxs(Go,{children:[a.jsx(Ko,{className:"ecr-admin-group-title-customization__trigger",children:a.jsx(gb,{})}),a.jsxs(Yo,{className:"ecr-admin-group-title-customization-dialog",children:[a.jsx(Xo,{children:a.jsx(Jo,{children:"Customize title appearance"})}),a.jsx(Bb,{styles:c,setStyles:d,setIsEdited:g}),a.jsx("div",{style:{display:"flex",justifyContent:"end",marginTop:40},children:a.jsx(B0,{asChild:!0,children:a.jsx(ne,{style:{paddingInline:40},variant:"outline",children:"Ok"})})})]})]})]},"title")],right:[a.jsx(hb,{isExpanded:S,setIsExpanded:E},"toggle"),a.jsx(ho,{onSave:pe,isSaving:p,disabled:!m},"save")],rightClass:"ecr-admin-nav-btn-reverse"}),a.jsx(rr,{breads:[{label:"Dashboard",href:`?view=${X.ag}`},{label:"Manage Widget"}],onNavigate:K=>q(()=>e(K))}),a.jsxs("div",{className:"ecr-admin-group-edit",children:[a.jsx(Zb,{allReels:z,gid:r,handleSelectReel:_e,searchTerm:h,setSearchTerm:v,isSearching:y,togglingId:C,lastStoryElementRef:w}),a.jsx(Jb,{gid:r,reels:s,styles:c,handleRemoveReel:_e,togglingId:C,currentTab:T}),S&&a.jsx(Av,{isExpanded:S,setIsExpanded:E,setIsEdited:g,styles:c,setStyles:d,tabs:wd,setCurrentTab:A,currentTab:T})]}),I&&a.jsx(Or,{onReject:oe,onAccept:te,isLoading:!1,message:"You have unsaved changes. Leave this page without saving?"})]})};function Lv(){const[e]=Zt(),t=e.get("view")||X.ag;let r;switch(t){case X.settings:r=a.jsx(cb,{});break;case X.ar:r=a.jsx(Qf,{});break;case X.stat:r=a.jsx(pb,{});break;case X.cr:r=a.jsx(eb,{});break;case X.mg:r=a.jsx(Rv,{});break;default:r=a.jsx(sb,{})}return a.jsxs("div",{children:[r,a.jsx(Gu,{position:"top-right",toastOptions:{style:{padding:"16px",marginTop:"24px",fontSize:"16px"}}})]})}const jd=async(e,t,r,n={})=>{try{if(await he.post(`group/${e}/story/${t}/view`),n.isActive&&!n.isActive())return;r(o=>({...o,[t]:Number(o[t]||0)+1}))}catch{}},kd=e=>!!e?.files?.[0]?.mime_type?.startsWith("video"),Iv=()=>{const e=_.useContext(ba);if(!e)throw new Error("useVideoPlayer must be used inside PublicStoryContext");const{styles:t,stories:r,groupId:n,isPlaying:o,setIsPlaying:i,setStoryViews:s}=e,[l,c]=_.useState(r.length-1),[d,u]=_.useState(null),[p,m]=_.useState(!0),[g,b]=_.useState(0),[f,h]=_.useState(!1),[v,y]=_.useState(!1),[w,j]=_.useState({index:0,story_uuid:r[0]?.story_uuid??""}),C=d?.links&&d.links.length>0?d.links[0]:null,N=t?.playerAppearance??"overlay",S=_.useRef({bodyOverflow:"",bodyPosition:"",bodyTop:"",bodyWidth:"",bodyScrollBehavior:"",htmlOverflow:"",htmlScrollBehavior:"",scrollY:0}),E=_.useCallback((O,P=1)=>{if(r.length===0)return null;let z=O;for(let I=0;I<r.length;I+=1){const q=r[z];if(kd(q))return{story:q,index:z};z=(z+P+r.length)%r.length}return null},[r]),T=_.useCallback(()=>{c(r.length-1);const O=r.findIndex(I=>String(I.story_uuid)===o),P=O>=0?r[O]:null,z=kd(P)?{story:P,index:O}:E(Math.max(O,0),1);if(!z?.story){u(null),m(!1);return}u(z.story),O!==z.index&&z.story.story_uuid!==o&&i(z.story.story_uuid),j({index:0,story_uuid:z.story.story_uuid}),m(!1)},[E,o,i,r]);_.useEffect(()=>{T()},[T]),_.useEffect(()=>{const{body:O,documentElement:P}=document;return S.current={bodyOverflow:O.style.overflow,bodyPosition:O.style.position,bodyTop:O.style.top,bodyWidth:O.style.width,bodyScrollBehavior:O.style.scrollBehavior,htmlOverflow:P.style.overflow,htmlScrollBehavior:P.style.scrollBehavior,scrollY:window.scrollY},P.style.overflow="hidden",O.style.overflow="hidden",O.style.position="fixed",O.style.top=`-${S.current.scrollY}px`,O.style.width="100%",()=>{const z=S.current;P.style.overflow=z.htmlOverflow,O.style.overflow=z.bodyOverflow,O.style.position=z.bodyPosition,O.style.top=z.bodyTop,O.style.width=z.bodyWidth,P.style.scrollBehavior="auto",O.style.scrollBehavior="auto",window.scrollTo({top:z.scrollY,left:0,behavior:"auto"}),P.style.scrollBehavior=z.htmlScrollBehavior,O.style.scrollBehavior=z.bodyScrollBehavior}},[]);const A=_.useCallback(()=>{i(null)},[i]),R=_.useCallback((O=1)=>{m(!0);const P=r.findIndex(oe=>String(oe.story_uuid)===String(o)),z=O>0?1:-1,I=O>0?l>P?P+1:0:P>0?P-1:l,q=E(I,z);if(!q?.story){m(!1);return}const te=q.story;if(te.story_uuid===o){m(!1),A();return}j({index:0,story_uuid:te.story_uuid}),n&&jd(n,te.id,s),i(te.story_uuid),m(!1)},[A,E,n,o,l,i,s,r]),L=_.useCallback(()=>{const O=d?.files??[];if(w.index>0){j(P=>({index:P.index-1,story_uuid:O[P.index-1].story_uuid??""}));return}R(-1)},[w.index,R,d?.files]),B=_.useCallback(()=>{const O=d?.files??[];if(w.index+1<O.length){j(P=>({index:P.index+1,story_uuid:O[P.index+1].story_uuid??""}));return}R(1)},[w.index,R,d?.files]),M=_.useCallback(O=>{O.target===O.currentTarget&&A()},[A]);return{closePlayer:A,currentFileIndex:w,duration:g,handleBackdropClick:M,handleNextFile:B,handlePrevFile:L,isLoadingNext:p,isMuted:v,isPaused:f,playingStory:d,setDuration:b,setIsPaused:h,setIsMuted:y,setIsPlaying:i,firstLink:C,playerAppearance:N}},Mv=()=>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"})]})})}),zv=()=>{const e=Ar("(min-width: 1024px)"),{closePlayer:t,currentFileIndex:r,duration:n,handleBackdropClick:o,handleNextFile:i,handlePrevFile:s,isLoadingNext:l,isMuted:c,isPaused:d,playerAppearance:u,playingStory:p,firstLink:m,setDuration:g,setIsMuted:b,setIsPaused:f,setIsPlaying:h}=Iv();return a.jsx("div",{onClick:o,className:"ecommreels-story-modal ecr-player",children:p&&a.jsxs("div",{className:"ecr-player__stage",children:[a.jsx(wt,{onClick:s,className:"ecr-player__nav--left",children:a.jsx(pi,{size:24})}),a.jsx(wt,{onClick:i,className:"ecr-player__nav--right",children:a.jsx(mi,{size:24})}),a.jsxs("div",{id:"player",className:"ecr-player__frame",children:[p&&a.jsx(ci,{playingStory:p,duration:n,currentFileIndex:r,isPaused:d},`${p.story_uuid}-${r.index}`),a.jsx("div",{onClick:t,className:"ecr-player__close",children:a.jsx(er,{size:e?20:24,className:"ecr-player__close-icon"})}),l?a.jsx(Mv,{}):p?.files.length>0&&a.jsx(xi,{currentFileIndex:r,files:p?.files,setDuration:g,setIsPlaying:h,isPaused:d,setIsPaused:f,isMuted:c,setIsMuted:b,handlePrevFile:s,handleNextFile:i,storyId:p.id,storyTitle:p?.title}),u==="overlay"?m?a.jsx(Nn,{link:m,usedFor:"user",usedIn:"player",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"8px",width:"95%",borderRadius:"6px"}}):a.jsx(Bt,{title:p.title}):null,u==="title"?a.jsx(Bt,{title:p.title}):null]})]})})},Sd=({story:e,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o})=>{const i=t.appearance??"overlay",s=e.links&&e.links.length>0?e.links[0]:null,l=i==="none",c=i==="title",d=t.shape==="rectangle",u=!l&&!c&&s,p=t.border.border_radius,m=p>50?p+16:p>20?p:0;return a.jsxs("div",{className:`ecr-thumb ${t.hoverEffect??""}`,children:[a.jsxs("div",{onClick:()=>r({sid:e.id,story_uuid:e.story_uuid}),className:"ecr-thumb__frame",style:{border:`${t?.border?.border_width}px solid ${t?.border?.border_color}`,borderRadius:t.shape==="rectangle"?`${t?.border?.border_radius}px`:"50%",aspectRatio:t.shape==="rectangle"?"9/16":"1/1"},children:[a.jsx(to,{story:e,styles:t,storyViews:n,setStoryViews:o}),!l&&!c&&d?u?a.jsx(Nn,{link:s,usedFor:"user",usedIn:"thumb",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"4px",width:"calc(100% - 8px)",borderRadius:"6px"}}):a.jsx(Bt,{title:e.title,styles:{width:`calc(95% - ${m}px)`}}):null]}),c?a.jsx("p",{className:"ecr-reel__title",children:e.title}):null]})},Dv=({stories:e,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o})=>{const{thumbsContainerRef:i,thumbsWrapperRef:s,isOverflowing:l,canScrollLeft:c,canScrollRight:d,scrollBy:u,scrollStep:p}=bc([e],!0);return a.jsxs("div",{className:"ecr-front-carousel",children:[a.jsx("div",{ref:i,className:"ecr-front-carousel__viewport",children:a.jsx("div",{ref:s,className:t.hoverEffect==="zoom-in"?"ecr-front-carousel__track ecr-front-carousel__track--zoom":"ecr-front-carousel__track",children:e?.map(m=>m?.files[0]?.mime_type.startsWith("video")?a.jsx(Sd,{story:m,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o},m.story_uuid):null)})}),l&&c&&a.jsx("button",{onClick:()=>u(-p),className:"ecr-front-carousel__nav ecr-front-carousel__nav--left",children:a.jsx(Vn,{size:20,style:{width:"20px",height:"20px"}})}),l&&d&&a.jsx("button",{onClick:()=>u(p),className:"ecr-front-carousel__nav ecr-front-carousel__nav--right",children:a.jsx(Wn,{size:20,style:{width:"20px",height:"20px"}})})]})},Cd=({stories:e,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o})=>a.jsx("div",{className:"ecr-front-grid",children:a.jsx("div",{style:{padding:t.hoverEffect==="zoom-in"?16:0},className:"ecr-front-grid__list",children:e?.map(i=>i?.files[0]?.mime_type.startsWith("video")?a.jsx(Sd,{story:i,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o},i.story_uuid):null)})}),$v={carousel:Dv,grid:Cd},Fv=()=>{const e=_.useContext(ba),{groupTitle:t,styles:r,stories:n,groupId:o,setIsPlaying:i,storyViews:s,setStoryViews:l}=e,c=_.useRef(!0);_.useEffect(()=>(c.current=!0,()=>{c.current=!1}),[]);const d=r.template??"carousel",u=$v[d]||Cd,p=({sid:m,story_uuid:g})=>{i(g),o&&jd(o,m,l,{isActive:()=>c.current})};return a.jsxs("div",{style:{"--thumbnail-size":r.template==="grid"?"auto":`${r?.size}px`,"--thumbnail-size-grid":`${r?.size}px`,"--thumbnail-size-tab":r.template==="grid"?"auto":`${r?.sizeOnTab??r?.size}px`,"--thumbnail-size-grid-tab":`${r?.sizeOnTab??r?.size}px`,"--thumbnail-size-mobile":r.template==="grid"?"auto":`${r?.sizeOnMobile??r?.size}px`,"--thumbnail-size-grid-mobile":`${r?.sizeOnMobile??r?.size}px`,"--thumbnail-gap":`${r?.gap}px`,"--thumbnail-gap-tab":`${r?.gapOnTab??r?.gap}px`,"--thumbnail-gap-mobile":`${r?.gapOnMobile??r?.gap}px`,"--thumbnail-border-radius":`${r?.border?.border_radius}px`},children:[r?.widgetTitle&&r?.widgetTitle?.alignment!=="hidden"&&t?a.jsx("h2",{style:{textAlign:r.widgetTitle?.alignment,fontSize:r.widgetTitle?.fontSize,color:r.widgetTitle?.color,marginBottom:24},children:t}):null,a.jsx(u,{stories:n,styles:r,handlePlaying:p,storyViews:s,setStoryViews:l})]})},Bv=e=>{const[t,r]=_.useState(""),[n,o]=_.useState([]),[i,s]=_.useState(ot),[l,c]=_.useState(!1),[d,u]=_.useState(null),p=_.useCallback(async()=>{const m=e?.trim();if(!m){o([]),s(ot),c(!1),u(null);return}const g=new AbortController;c(!0),u(null);try{const b=await he.get(`stories/${m}`,{signal:g.signal});if(g.signal.aborted)return;r(b.data.group_name),o(b.data.stories),s(b.data.styles||ot)}catch(b){if(g.signal.aborted)return;u(b)}finally{c(!1)}return()=>{g.abort()}},[e]);return _.useEffect(()=>{p()},[e]),{groupTitle:t,stories:n,styles:i,isLoading:l,error:d}},ba=_.createContext(void 0),Nd=({groupId:e})=>{const[t,r]=_.useState(null),[n,o]=_.useState({}),{groupTitle:i,stories:s,styles:l}=Bv(e);return a.jsxs(ba.Provider,{value:{groupTitle:i,groupId:e,stories:s,styles:l,isPlaying:t,setIsPlaying:r,storyViews:n,setStoryViews:o},children:[t&&a.jsx(zv,{}),a.jsx(Fv,{})]})};wa(()=>{const e=document.getElementById("ecommreels-admin-app");e&&Ln.createRoot(e).render(a.jsx(ru,{children:a.jsx(Lv,{})}))}),wa(()=>{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(Nd,{groupId:o}))}),t.forEach(r=>{const n=r,o=n.dataset.id;if(!o)return;Ln.createRoot(n).render(a.jsx(Nd,{groupId:o}))})})})(React,wp.domReady,wp.element,ReactDOM); -
ecomm-reels/tags/4.1.8/ecomm-reels.php
r3469230 r3470148 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.1. 75 * Version: 4.1.8 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.1. 7');22 define('WP_REELS_VER', '4.1.8'); 23 23 24 24 // 1) Composer autoloader (optional, guarded) -
ecomm-reels/tags/4.1.8/readme.txt
r3469230 r3470148 5 5 Tested up to: 6.9 6 6 Requires PHP: 7.4 7 Stable tag: 4.1. 77 Stable tag: 4.1.8 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 103 103 == Changelog == 104 104 105 = 4.1.8 - 2026-02-26 = 106 - New: Added a Rate Us link in the admin header. 107 105 108 = 4.1.7 - 2026-02-25 = 106 109 - Tweak: Updated Product Card border opacity and reduced the rating icon size for a cleaner look. -
ecomm-reels/trunk/CHANGELOG.md
r3469230 r3470148 1 1 # Changelog 2 3 ## [4.1.8](https://github.com/dstudio-asia/reels-wp/compare/v4.1.7...v4.1.8) (2026-02-26) 4 5 6 ### Features 7 8 * add Rate Us link in admin header ([3f4e194](https://github.com/dstudio-asia/reels-wp/commit/3f4e194e947aeccdb705cc6c2266752e54a4fe02)) 9 * add Rate Us link in admin header ([2786b1f](https://github.com/dstudio-asia/reels-wp/commit/2786b1fd8b0237ea16371b97f9b63912c8e9cb21)) 2 10 3 11 ## [4.1.7](https://github.com/dstudio-asia/reels-wp/compare/v4.1.6...v4.1.7) (2026-02-25) -
ecomm-reels/trunk/build/index.js
r3469230 r3470148 1 1 (function(_,wa,Ln,ja){"use strict";var ka=document.createElement("style");ka.textContent=`:root{--color-primary: #2563eb;--color-primary-foreground: #ffffff;--color-secondary: #e5e7eb;--color-secondary-foreground: #111827;--color-foreground: #111827;--color-muted: #f3f4f6;--color-muted-foreground: #6b7280;--color-accent: #f3f4f6;--color-border: #e5e7eb;--color-ring: #60a5fa}#ecommreels-admin-app,.ecommreels-short-code,.reelswp-group-short-code,.reelswp-reel-short-code{box-sizing:border-box;color:var(--color-foreground, #111);font-family:Inter,Segoe UI,system-ui,-apple-system,sans-serif}#ecommreels-admin-app *,#ecommreels-admin-app *:before,#ecommreels-admin-app *:after,.ecommreels-short-code *,.ecommreels-short-code *:before,.ecommreels-short-code *:after,.reelswp-group-short-code *,.reelswp-group-short-code *:before,.reelswp-group-short-code *:after,.reelswp-reel-short-code *,.reelswp-reel-short-code *:before,.reelswp-reel-short-code *:after{box-sizing:inherit}#ecommreels-admin-app input,#ecommreels-admin-app select,#ecommreels-admin-app textarea,.ecommreels-short-code input,.ecommreels-short-code select,.ecommreels-short-code textarea,.reelswp-group-short-code input,.reelswp-group-short-code select,.reelswp-group-short-code textarea,.reelswp-reel-short-code input,.reelswp-reel-short-code select,.reelswp-reel-short-code textarea{font:inherit;color:inherit}#ecommreels-admin-app button,.ecommreels-short-code button,.reelswp-group-short-code button,.reelswp-reel-short-code button{border:none}#ecommreels-admin-app input[type=checkbox],#ecommreels-admin-app input[type=radio],.ecommreels-short-code input[type=checkbox],.ecommreels-short-code input[type=radio],.reelswp-group-short-code input[type=checkbox],.reelswp-group-short-code input[type=radio],.reelswp-reel-short-code input[type=checkbox],.reelswp-reel-short-code input[type=radio]{margin:0}#ecommreels-admin-app input[type=number]::-webkit-inner-spin-button,#ecommreels-admin-app input[type=number]::-webkit-outer-spin-button,.ecommreels-short-code input[type=number]::-webkit-inner-spin-button,.ecommreels-short-code input[type=number]::-webkit-outer-spin-button,.reelswp-group-short-code input[type=number]::-webkit-inner-spin-button,.reelswp-group-short-code input[type=number]::-webkit-outer-spin-button,.reelswp-reel-short-code input[type=number]::-webkit-inner-spin-button,.reelswp-reel-short-code input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}#ecommreels-admin-app input[type=number],.ecommreels-short-code input[type=number],.reelswp-group-short-code input[type=number],.reelswp-reel-short-code input[type=number]{-moz-appearance:textfield}#ecommreels-admin-app input,.ecommreels-short-code input,.reelswp-group-short-code input,.reelswp-reel-short-code input{min-height:auto}#ecommreels-admin-app img,.ecommreels-short-code img,.reelswp-group-short-code img,.reelswp-reel-short-code img{max-width:100%;display:block}#ecommreels-admin-app h1,#ecommreels-admin-app h2,#ecommreels-admin-app h3,#ecommreels-admin-app h4,#ecommreels-admin-app h5,#ecommreels-admin-app h6,.ecommreels-short-code h1,.ecommreels-short-code h2,.ecommreels-short-code h3,.ecommreels-short-code h4,.ecommreels-short-code h5,.ecommreels-short-code h6,.reelswp-group-short-code h1,.reelswp-group-short-code h2,.reelswp-group-short-code h3,.reelswp-group-short-code h4,.reelswp-group-short-code h5,.reelswp-group-short-code h6,.reelswp-reel-short-code h1,.reelswp-reel-short-code h2,.reelswp-reel-short-code h3,.reelswp-reel-short-code h4,.reelswp-reel-short-code h5,.reelswp-reel-short-code h6{margin:0;font-weight:600}#ecommreels-admin-app p,.ecommreels-short-code p,.reelswp-group-short-code p,.reelswp-reel-short-code p{margin:0}#ecommreels-admin-app .ecr-admin-panel{position:relative;margin:24px;min-height:50vh;border-radius:6px;border:1px solid #d1d5db;background:#fff;padding:16px}#ecommreels-admin-app .ecr-admin-panel--reels{padding:16px}#ecommreels-admin-app .ecr-button{display:inline-flex;align-items:center;justify-content:center;gap:8px;border:1px solid transparent;border-radius:6px;font-size:14px;font-weight:600;line-height:1;padding:8px 16px;background:#111;color:#fff;cursor:pointer;transition:background-color .2s ease,border-color .2s ease,color .2s ease,box-shadow .2s ease,transform .2s ease}#ecommreels-admin-app .ecr-button:disabled{opacity:.6;cursor:not-allowed}#ecommreels-admin-app .ecr-button--primary{background:#2563eb;color:#fff}#ecommreels-admin-app .ecr-button--primary:hover{background:#1f29371a}#ecommreels-admin-app .ecr-button--secondary{background:#e5e7eb;color:#111827}#ecommreels-admin-app .ecr-button--secondary:hover{background:#e5e7eb1a}#ecommreels-admin-app .ecr-button--outline{background:transparent;border-color:#2563eb;color:#2563eb}#ecommreels-admin-app .ecr-button--outline:hover{background:#2563eb1a}#ecommreels-admin-app .ecr-button--outline-danger{background:transparent;border-color:#dc2626;color:#dc2626}#ecommreels-admin-app .ecr-button--outline-danger:hover{background:#dc26261a}#ecommreels-admin-app .ecr-button--ghost{background:transparent;color:#111827}#ecommreels-admin-app .ecr-button--ghost:hover{background:#f3f4f6}#ecommreels-admin-app .ecr-button--link{background:none;border-color:transparent;padding:0;color:#2563eb;text-decoration:none}#ecommreels-admin-app .ecr-button--link:hover{text-decoration:underline}#ecommreels-admin-app .ecr-button--danger{background:#dc2626;color:#fff}#ecommreels-admin-app .ecr-button--danger:hover{background:#b91c1c}#ecommreels-admin-app .ecr-button--sm{height:32px;padding:0 12px;font-size:13px}#ecommreels-admin-app .ecr-button--md{height:36px;padding:0 16px}#ecommreels-admin-app .ecr-button--lg{height:40px;padding:0 20px;font-size:15px}#ecommreels-admin-app .ecr-button--icon,#ecommreels-admin-app .ecr-button--icon-sm,#ecommreels-admin-app .ecr-button--icon-lg{padding:0;width:36px;height:36px}#ecommreels-admin-app .ecr-button--icon-sm{width:32px;height:32px}#ecommreels-admin-app .ecr-button--icon-lg{width:40px;height:40px}#ecommreels-admin-app .ecr-admin-reels-header{margin-bottom:16px;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px}#ecommreels-admin-app .ecr-admin-reels-header__left{display:flex;align-items:center;gap:32px}#ecommreels-admin-app .ecr-admin-reels-header__right{display:flex;flex-wrap:wrap;align-items:center;gap:16px}#ecommreels-admin-app .ecr-admin-reels-header__title{margin:0;padding:6px 0;font-size:20px;font-weight:700}#ecommreels-admin-app .ecr-admin-reels-header__actions{display:flex;align-items:center;gap:16px}#ecommreels-admin-app .ecr-admin-reels-header__action{padding:0;font-weight:600;background:none;border:none;box-shadow:none}#ecommreels-admin-app .ecr-admin-reels-header__action--primary{color:#2563eb}#ecommreels-admin-app .ecr-admin-reels-header__action--danger{color:#ef4444}#ecommreels-admin-app .ecr-admin-reels-header__search{position:relative;width:100%}@media(min-width:640px){#ecommreels-admin-app .ecr-admin-reels-header__search{width:280px}}#ecommreels-admin-app .ecr-admin-search-input{width:100%;padding:8px 16px;border-radius:6px;border:1px solid #e5e7eb;background:#fff;font-size:14px;line-height:1.4}#ecommreels-admin-app .ecr-admin-search-input:focus{outline:none;box-shadow:none;border-color:#cbd5f5}#ecommreels-admin-app .ecr-admin-reels-header__icon-wrapper{position:absolute;top:50%;right:8px;transform:translateY(-50%);width:fit-content;height:20px;display:flex;align-items:center}#ecommreels-admin-app .ecr-admin-reels-header__search-icon{color:#d1d5db;flex-shrink:0}#ecommreels-admin-app .ecr-admin-reels-header__clear-icon{color:#f50808;flex-shrink:0}#ecommreels-admin-app .ecr-admin-reels-header__create{border:1px solid #3b82f6;background:#fff;color:#3b82f6}#ecommreels-admin-app .ecr-admin-reels-header__create:hover{background:#ffffffe6}#ecommreels-admin-app .ecr-admin-reels-header__spinner{animation:ecr-reels-spin 1s linear infinite}@keyframes ecr-reels-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-admin-reels-empty{display:flex;align-items:center;justify-content:center;padding-top:50px}#ecommreels-admin-app .ecr-admin-reels-empty__text{margin:0;display:flex;width:320px;flex-direction:column;align-items:center;gap:8px;text-align:center;font-size:14px}#ecommreels-admin-app .ecr-admin-reels-loading{display:flex;align-items:center;justify-content:center;padding:16px 0}#ecommreels-admin-app .ecr-admin-reels-loading--fullscreen{position:absolute;inset:0}#ecommreels-admin-app .ecr-admin-reels-loading__icon{width:48px;height:48px;color:#3b82f6;animation:ecr-reels-loading-spin 1s linear infinite}@keyframes ecr-reels-loading-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-player__progress,.ecommreels-short-code .ecr-player__progress,.reelswp-group-short-code .ecr-player__progress,.reelswp-reel-short-code .ecr-player__progress{position:absolute;top:4px;left:50%;z-index:2;display:flex;width:90%;transform:translate(-50%);gap:4px;overflow:hidden;border-radius:999px}#ecommreels-admin-app .ecr-player__progress-track,.ecommreels-short-code .ecr-player__progress-track,.reelswp-group-short-code .ecr-player__progress-track,.reelswp-reel-short-code .ecr-player__progress-track{width:100%;height:3px;background:#ffffff80;border-radius:999px}#ecommreels-admin-app .ecr-player__progress-fill,.ecommreels-short-code .ecr-player__progress-fill,.reelswp-group-short-code .ecr-player__progress-fill,.reelswp-reel-short-code .ecr-player__progress-fill{height:3px;background:#fff;border-radius:999px;width:0}#ecommreels-admin-app .ecr-player__progress-fill--active,.ecommreels-short-code .ecr-player__progress-fill--active,.reelswp-group-short-code .ecr-player__progress-fill--active,.reelswp-reel-short-code .ecr-player__progress-fill--active{animation:ecr-progress var(--reels-wp-animation-time) linear forwards}#ecommreels-admin-app .ecr-player__progress-fill--complete,.ecommreels-short-code .ecr-player__progress-fill--complete,.reelswp-group-short-code .ecr-player__progress-fill--complete,.reelswp-reel-short-code .ecr-player__progress-fill--complete{width:100%}#ecommreels-admin-app .ecr-player__progress-fill--empty,.ecommreels-short-code .ecr-player__progress-fill--empty,.reelswp-group-short-code .ecr-player__progress-fill--empty,.reelswp-reel-short-code .ecr-player__progress-fill--empty{width:0}@keyframes ecr-progress{0%{width:0}to{width:100%}}#ecommreels-admin-app .ecr-player__nav,.ecommreels-short-code .ecr-player__nav,.reelswp-group-short-code .ecr-player__nav,.reelswp-reel-short-code .ecr-player__nav{position:absolute;top:50%;z-index:5;display:none;width:40px;height:40px;padding:0;transform:translateY(-50%);border:none;border-radius:999px;background:#ffffffd9;color:#374151;cursor:pointer;align-items:center;justify-content:center;transition:scale .3s ease}:is(#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):active{scale:.95}@media(min-width:1024px){#ecommreels-admin-app .ecr-player__nav,.ecommreels-short-code .ecr-player__nav,.reelswp-group-short-code .ecr-player__nav,.reelswp-reel-short-code .ecr-player__nav{display:grid}}#ecommreels-admin-app .ecr-player__nav--left,.ecommreels-short-code .ecr-player__nav--left,.reelswp-group-short-code .ecr-player__nav--left,.reelswp-reel-short-code .ecr-player__nav--left{left:0;transform:translate(-120%,-50%)}#ecommreels-admin-app .ecr-player__nav--right,.ecommreels-short-code .ecr-player__nav--right,.reelswp-group-short-code .ecr-player__nav--right,.reelswp-reel-short-code .ecr-player__nav--right{right:0;transform:translate(120%,-50%)}#ecommreels-admin-app .ecr-player__nav:hover,.ecommreels-short-code .ecr-player__nav:hover,.reelswp-group-short-code .ecr-player__nav:hover,.reelswp-reel-short-code .ecr-player__nav:hover{background:#fff}#ecommreels-admin-app .ecr-player__media-frame,.ecommreels-short-code .ecr-player__media-frame,.reelswp-group-short-code .ecr-player__media-frame,.reelswp-reel-short-code .ecr-player__media-frame{position:relative;display:flex;width:100%;height:100%;align-items:center;justify-content:center;overflow:hidden;border-radius:16px}@media screen and (max-width:767.98px){#ecommreels-admin-app .ecr-player__media-frame,.ecommreels-short-code .ecr-player__media-frame,.reelswp-group-short-code .ecr-player__media-frame,.reelswp-reel-short-code .ecr-player__media-frame{border-radius:0}}#ecommreels-admin-app .ecr-player__media,.ecommreels-short-code .ecr-player__media,.reelswp-group-short-code .ecr-player__media,.reelswp-reel-short-code .ecr-player__media{width:100%;height:auto}#ecommreels-admin-app .ecr-player__media--portrait,.ecommreels-short-code .ecr-player__media--portrait,.reelswp-group-short-code .ecr-player__media--portrait,.reelswp-reel-short-code .ecr-player__media--portrait{width:100%;height:100%;object-fit:cover}#ecommreels-admin-app .ecr-player__media--auto,.ecommreels-short-code .ecr-player__media--auto,.reelswp-group-short-code .ecr-player__media--auto,.reelswp-reel-short-code .ecr-player__media--auto{height:auto}#ecommreels-admin-app .ecr-player__slider,.ecommreels-short-code .ecr-player__slider,.reelswp-group-short-code .ecr-player__slider,.reelswp-reel-short-code .ecr-player__slider{position:absolute;top:0;display:flex;background:#000;transition:left .2s ease}#ecommreels-admin-app .ecr-player__slide,.ecommreels-short-code .ecr-player__slide,.reelswp-group-short-code .ecr-player__slide,.reelswp-reel-short-code .ecr-player__slide{position:relative;display:flex;align-items:center;justify-content:center;height:90vh;max-width:100vw;aspect-ratio:9 / 16}#ecommreels-admin-app .ecr-player__controls,.ecommreels-short-code .ecr-player__controls,.reelswp-group-short-code .ecr-player__controls,.reelswp-reel-short-code .ecr-player__controls{position:absolute;top:8px;right:40px;z-index:5;display:inline-flex;align-items:center;gap:10px;color:#fff;mix-blend-mode:difference}#ecommreels-admin-app .ecr-player__control-icon,.ecommreels-short-code .ecr-player__control-icon,.reelswp-group-short-code .ecr-player__control-icon,.reelswp-reel-short-code .ecr-player__control-icon{cursor:pointer}#ecommreels-admin-app .ecommreels-story-modal,.ecommreels-short-code .ecommreels-story-modal,.reelswp-group-short-code .ecommreels-story-modal,.reelswp-reel-short-code .ecommreels-story-modal{max-width:100%!important;z-index:2147483647;background-color:#000c;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}#ecommreels-admin-app #player *,.ecommreels-short-code #player *,.reelswp-group-short-code #player *,.reelswp-reel-short-code #player *{scrollbar-width:none;-ms-overflow-style:none}#ecommreels-admin-app #player *::-webkit-scrollbar,.ecommreels-short-code #player *::-webkit-scrollbar,.reelswp-group-short-code #player *::-webkit-scrollbar,.reelswp-reel-short-code #player *::-webkit-scrollbar{display:none}#ecommreels-admin-app .ecr-player,.ecommreels-short-code .ecr-player,.reelswp-group-short-code .ecr-player,.reelswp-reel-short-code .ecr-player{position:fixed!important;top:0!important;left:0!important;display:grid;place-items:center;width:100vw!important;height:100vh!important}#ecommreels-admin-app .ecr-player__stage,.ecommreels-short-code .ecr-player__stage,.reelswp-group-short-code .ecr-player__stage,.reelswp-reel-short-code .ecr-player__stage{position:relative;width:fit-content;height:fit-content}#ecommreels-admin-app .ecr-player__frame,.ecommreels-short-code .ecr-player__frame,.reelswp-group-short-code .ecr-player__frame,.reelswp-reel-short-code .ecr-player__frame{position:relative;aspect-ratio:9 / 16;height:90vh;max-width:100vw;overflow:hidden;border-radius:24px}@media screen and (max-width:767.98px){#ecommreels-admin-app .ecr-player__frame,.ecommreels-short-code .ecr-player__frame,.reelswp-group-short-code .ecr-player__frame,.reelswp-reel-short-code .ecr-player__frame{height:100vh;border-radius:0}}#ecommreels-admin-app .ecr-player__close,.ecommreels-short-code .ecr-player__close,.reelswp-group-short-code .ecr-player__close,.reelswp-reel-short-code .ecr-player__close{position:absolute;top:8px;right:8px;z-index:5;color:#fff;cursor:pointer;mix-blend-mode:difference;line-height:1}#ecommreels-admin-app .ecr-player__close-icon,.ecommreels-short-code .ecr-player__close-icon,.reelswp-group-short-code .ecr-player__close-icon,.reelswp-reel-short-code .ecr-player__close-icon{font-size:22px;font-weight:800}#ecommreels-admin-app .ecr-admin-reels-grid{display:grid;gap:16px;grid-template-columns:repeat(auto-fill,minmax(150px,1fr))}#ecommreels-admin-app .ecr-thumb__media,.ecommreels-short-code .ecr-thumb__media,.reelswp-group-short-code .ecr-thumb__media,.reelswp-reel-short-code .ecr-thumb__media{position:relative;width:100%;height:100%}#ecommreels-admin-app .ecr-thumb__video,.ecommreels-short-code .ecr-thumb__video,.reelswp-group-short-code .ecr-thumb__video,.reelswp-reel-short-code .ecr-thumb__video{pointer-events:none;width:100%;height:100%;object-fit:cover}#ecommreels-admin-app .ecr-thumb__placeholder,.ecommreels-short-code .ecr-thumb__placeholder,.reelswp-group-short-code .ecr-thumb__placeholder,.reelswp-reel-short-code .ecr-thumb__placeholder{display:flex;width:100%;height:100%;align-items:center;justify-content:center;background:#e5e7eb;color:#6b7280;font-size:13px}#ecommreels-admin-app .ecr-thumb__views,.ecommreels-short-code .ecr-thumb__views,.reelswp-group-short-code .ecr-thumb__views,.reelswp-reel-short-code .ecr-thumb__views{position:absolute;top:8px;z-index:4;display:inline-flex;align-items:center;gap:4px;background:#6b7280;color:#fff;padding:2.4px 5.6px;font-size:11px;border-radius:4px;word-break:normal}#ecommreels-admin-app .ecr-admin-reel-card{display:block}#ecommreels-admin-app .ecr-admin-reel-card__frame{position:relative;overflow:hidden;border-radius:6px;border:2px solid #e5e7eb;transition:border-color .2s ease,box-shadow .2s ease}#ecommreels-admin-app .ecr-admin-reel-card__frame--selected{border-color:#3b82f6;box-shadow:0 0 0 2px #2b7fff}#ecommreels-admin-app .ecr-admin-reel-card__actions{position:absolute;top:100%;z-index:5;display:flex;width:100%;height:50%;align-items:center;justify-content:center;gap:12px;background:#bfdbfee6;transition:top .2s ease}#ecommreels-admin-app .ecr-admin-reel-card__frame:hover .ecr-admin-reel-card__actions--hover{top:50%}#ecommreels-admin-app .ecr-admin-reel-card__action{background:#fff;color:#111827}#ecommreels-admin-app .ecr-admin-reel-card__action:hover{background:#fff}#ecommreels-admin-app .ecr-admin-reel-card__action--danger{color:#ef4444}#ecommreels-admin-app .ecr-admin-reel-card__icon{width:16px;height:16px}#ecommreels-admin-app .ecr-admin-reel-card__icon--primary{color:#2563eb}#ecommreels-admin-app .ecr-admin-reel-card__icon--danger{color:#ef4444}#ecommreels-admin-app .ecr-admin-reel-card__corner{position:absolute;display:flex;top:-2px;right:-2px;z-index:6;width:42px;height:42px;transition:transform .2s ease}#ecommreels-admin-app .ecr-admin-reel-card__corner--hidden{transform:translate(100%,-100%)}#ecommreels-admin-app .ecr-admin-reel-card__frame:hover .ecr-admin-reel-card__corner--hidden{transform:translate(0)}#ecommreels-admin-app .ecr-admin-reel-card__corner--selected{background:#3b82f6}#ecommreels-admin-app .ecr-admin-reel-card__corner--idle{background:#fff}#ecommreels-admin-app .ecr-admin-reel-card__select{margin-left:auto;width:24px;height:24px;border-radius:4px;background:transparent;padding:4px}#ecommreels-admin-app .ecr-admin-reel-card__select:hover{background:none}#ecommreels-admin-app .ecr-admin-reel-card__check{color:#6b7280}#ecommreels-admin-app .ecr-admin-reel-card__check--active{color:#fff}#ecommreels-admin-app .ecr-admin-reel-card__title{width:100%;margin:6px 0 0;text-align:center;font-size:13px;font-weight:500;text-transform:capitalize;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#ecommreels-admin-app .ecr-admin-back-button{background:none;border:none;padding:0;color:#6b7280;cursor:pointer;transition:color .15s ease}#ecommreels-admin-app .ecr-admin-back-button:hover{color:#2563eb}#ecommreels-admin-app .ecr-admin-breadcrumb{margin-top:12px;padding:0 24px;font-size:13px;color:#6b7280}#ecommreels-admin-app .ecr-admin-breadcrumb__list{display:flex;flex-wrap:wrap;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-breadcrumb__item{display:inline-flex;align-items:center}#ecommreels-admin-app .ecr-admin-breadcrumb__link{color:#2563eb;text-decoration:none;transition:color .15s ease}#ecommreels-admin-app .ecr-admin-breadcrumb__current{font-weight:600;color:#1f2937}#ecommreels-admin-app .ecr-admin-breadcrumb__separator{margin:0 4px;font-size:18px;color:#9ca3af}#ecommreels-admin-app .ecr-admin-modal{position:fixed;inset:0;z-index:2147483647;display:grid;place-items:center;background:#000c}#ecommreels-admin-app .ecr-admin-modal__panel{border-radius:8px;background:#fff;padding:24px;min-width:320px;max-width:500px}#ecommreels-admin-app .ecr-admin-modal__content{margin-bottom:16px}#ecommreels-admin-app .ecr-admin-modal__icon{margin-bottom:8px;display:flex;justify-content:center}#ecommreels-admin-app .ecr-admin-modal__message{margin:0;font-size:16px;font-weight:600;color:#111827;text-align:center}#ecommreels-admin-app .ecr-admin-modal__actions{display:flex;width:100%;align-items:center;justify-content:center;gap:8px}#ecommreels-admin-app .ecr-admin-modal__button{border-radius:6px;border:1px solid transparent;padding:6px 24px;font-size:14px;font-weight:600;cursor:pointer}#ecommreels-admin-app .ecr-admin-modal__button:disabled{opacity:.5;cursor:not-allowed}#ecommreels-admin-app .ecr-admin-modal__button--cancel{border-color:#3b82f6;background:#fff;color:#3b82f6}#ecommreels-admin-app .ecr-admin-modal__button--danger{display:inline-flex;align-items:center;gap:6px;border-color:#ef4444;background:#ef4444;color:#fff}#ecommreels-admin-app .ecr-admin-modal__spinner{animation:ecr-modal-spin 1s linear infinite}@keyframes ecr-modal-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-admin-link-button{display:inline-flex;align-items:center;justify-content:center;gap:8px;border-radius:6px;background:#3b82f6;padding:8px 16px;font-size:14px;font-weight:600;text-decoration:none;transition:background-color .15s ease;margin-inline-start:auto;white-space:nowrap}#ecommreels-admin-app .ecr-admin-link-button:hover{background:#1d4ed8}#ecommreels-admin-app .ecr-admin-loader{position:fixed;inset:0;z-index:5;display:grid;place-items:center;background:#fffc;color:#3b82f6}#ecommreels-admin-app .ecr-admin-loader__icon{animation:ecr-admin-spin 1s linear infinite}@keyframes ecr-admin-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-admin-navbar{display:flex;align-items:center;justify-content:space-between;background:#fff;padding:16px 24px;gap:16px;flex-wrap:wrap}#ecommreels-admin-app .ecr-admin-navbar__section{display:flex;align-items:center;gap:16px}@media(max-width:1024px){#ecommreels-admin-app .ecr-admin-navbar{justify-content:center}}#ecommreels-admin-app .ecr-admin-page-name{margin:0;display:inline-flex;align-items:center;gap:4px;font-size:20px;font-weight:600;-webkit-user-select:none;user-select:none;white-space:nowrap}#ecommreels-admin-app .ecr-admin-widget-name{display:inline-flex;align-items:center;justify-content:center;gap:4px;width:320px;border-radius:6px;background:#e5e7eb;padding:8px;font-size:14px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-create{margin:16px 24px 0;display:flex;gap:24px}@media(max-width:1024px){#ecommreels-admin-app .ecr-admin-create{flex-direction:column}}#ecommreels-admin-app .ecr-admin-create__panel{position:relative;overflow-x:hidden;border-radius:16px;background:#fff;padding:16px 20px 20px}#ecommreels-admin-app .ecr-admin-create__panel--main{flex:1;min-width:0}#ecommreels-admin-app .ecr-admin-create__panel--side{width:300px;flex-shrink:0}@media(max-width:1024px){#ecommreels-admin-app .ecr-admin-create__panel--side{width:100%}}#ecommreels-admin-app .ecr-admin-create__title{margin:0 0 8px;font-size:16px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-create__separator{margin:12px 0}#ecommreels-admin-app .ecr-admin-save-button{background:#3b82f6;color:#fff;text-transform:capitalize}#ecommreels-admin-app .ecr-admin-save-button:hover{background:#2563eb}#ecommreels-admin-app .ecr-admin-save-button:disabled{background:#6b7280}#ecommreels-admin-app .ecr-admin-save-button__icon{font-size:16px}#ecommreels-admin-app .ecr-admin-save-button__icon--spin{animation:ecr-save-spin 1s linear infinite}@keyframes ecr-save-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-admin-title-input{width:320px;border-radius:6px;border:1px solid transparent;background:#e5e7eb;padding:8px;text-align:center;font-size:14px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-popover{border-radius:10px;border:1px solid var(--color-border, #e5e7eb);background:#fff;color:var(--color-foreground, #111827);padding-block:16px;width:288px;box-shadow:0 10px 30px #00000026;z-index:999}#ecommreels-admin-app .ecr-popover[data-state=open]{animation:ecr-popover-in .15s ease-out}@keyframes ecr-popover-in{0%{opacity:0;transform:translateY(4px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}.ecr-separator{background:var(--color-border, #e5e7eb);flex-shrink:0}.ecr-separator[data-orientation=horizontal]{height:1px;width:100%}.ecr-separator[data-orientation=vertical]{width:1px;height:100%}.ecr-admin-upgrade__title{margin:0;display:inline-flex;align-items:center;gap:6px;font-weight:600;padding-inline:16px}.ecr-admin-upgrade__name{text-transform:capitalize}.ecr-admin-upgrade__tag{display:inline-block;padding:0 4px;border-radius:2px;background:#2563eb;color:#fff;font-size:10px;letter-spacing:.32px}.ecr-admin-upgrade__text{margin:0;font-size:13px;color:#374151;line-height:1.4;padding-inline:16px}.ecr-admin-upgrade__actions{display:flex;justify-content:flex-end;padding-inline:16px}.ecr-admin-upgrade__button{background:#3b82f6;color:#fff}.ecr-admin-upgrade__button:hover{background:#2563eb}.ecr-admin-upgrade__link{font-size:13px;text-decoration:none}.ecr-admin-separator{margin:12px 0}#ecommreels-admin-app .ecr-admin-upload{display:grid;width:260px;aspect-ratio:9 / 16;place-items:center;border-radius:12px;border:2px dashed #d1d5db;background:#eff6ff;position:relative}#ecommreels-admin-app .ecr-admin-upload--active{border-color:#3b82f6;background:#eff6ff}#ecommreels-admin-app .ecr-admin-upload--idle{border-color:#d1d5db}#ecommreels-admin-app .ecr-admin-upload__label{display:flex;flex-direction:column;justify-content:center;align-items:center;cursor:pointer;text-align:center;height:100%;background-color:transparent}#ecommreels-admin-app .ecr-admin-upload__text-icon_wrapper{display:grid;place-items:center;text-align:center}#ecommreels-admin-app .ecr-admin-upload__icon{width:40%;transition:transform .2s ease}#ecommreels-admin-app .ecr-admin-upload__label:hover .ecr-admin-upload__icon{transform:scale(1.02)}#ecommreels-admin-app .ecr-admin-upload__text{margin:8px 0 0;color:#6b7280;font-size:13px}#ecommreels-admin-app .ecr-admin-upload__text-stack{display:flex;flex-direction:column;gap:8px}#ecommreels-admin-app .ecr-admin-upload__text-item{font-size:13px}#ecommreels-admin-app .ecr-admin-upload__text-strong{font-weight:600}#ecommreels-admin-app .ecr-admin-video-upload-options{position:absolute;inset:2px;border-radius:10px;background-color:#fff;box-shadow:0 0 4px 8px #f5f5f5;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:12px}#ecommreels-admin-app .ecr-admin-upload-source-panel{position:absolute;inset:6px;z-index:3;border-radius:10px;border:1px solid #dbeafe;background:#fff;box-shadow:0 12px 24px #0f172a26;padding:12px;display:flex;flex-direction:column}#ecommreels-admin-app .ecr-admin-upload-source-panel__close{align-self:flex-end;width:28px;height:28px;border:1px solid #e5e7eb;border-radius:6px;background:#fff;color:#6b7280;cursor:pointer;display:inline-flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-admin-upload-source-panel__close:hover{color:#111827}#ecommreels-admin-app .ecr-admin-upload-source-popover__title{margin:0;font-size:14px;font-weight:700;color:#111827}#ecommreels-admin-app .ecr-admin-upload-source-popover__description{margin:4px 0 0;font-size:12px;color:#6b7280}#ecommreels-admin-app .ecr-admin-upload-source-popover__options{margin-top:12px;display:flex;flex-direction:column;gap:8px}#ecommreels-admin-app .ecr-admin-upload-source-option{width:100%;padding:12px;border:1px solid #dbeafe;border-radius:8px;background:#eff6ff;color:#1d4ed8;text-align:left;font-weight:600;font-size:13px;transition:all .2s ease}#ecommreels-admin-app .ecr-admin-upload-source-option:hover{border-color:#3b82f6;background:#3b82f6;color:#fff}#ecommreels-admin-app .ecr-admin-upload-vimeo-video-btn{padding:12px;border-radius:6px;background:#eff6ff;width:100%;text-align:center;transition:all .2s ease;cursor:pointer;display:flex;align-items:center;gap:8px;opacity:.8}#ecommreels-admin-app .ecr-admin-upload-native-video-btn{padding:12px;border-radius:6px;background:#eff6ff;width:100%;text-align:center;transition:all .2s ease;cursor:pointer;display:flex;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-upload-native-video-btn:hover{background-color:#3b82f6;color:#fff}#ecommreels-admin-app .ecr-dialog__overlay{position:fixed;inset:0;background:#0f172abf;z-index:5}#ecommreels-admin-app .ecr-dialog__overlay[data-state=open]{animation:ecr-dialog-overlay-in .15s ease-out}#ecommreels-admin-app .ecr-dialog__content{position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);width:min(500px,92vw);max-height:85vh;overflow:auto;border-radius:12px;border:1px solid var(--color-border, #e5e7eb);background:#fff;color:var(--color-foreground, #111827);padding:20px;box-shadow:0 25px 60px #0f172a40;z-index:6}#ecommreels-admin-app .ecr-dialog__content[data-state=open]{animation:ecr-dialog-content-in .2s ease-out}#ecommreels-admin-app .ecr-dialog__close{position:absolute;right:12px;top:12px;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:8px;border:1px solid var(--color-border, #e5e7eb);background:#fff;color:var(--color-muted-foreground, #6b7280);cursor:pointer}#ecommreels-admin-app .ecr-dialog__close:hover{color:var(--color-foreground, #111827)}#ecommreels-admin-app .ecr-dialog__close-icon{width:16px;height:16px}#ecommreels-admin-app .ecr-dialog__header{display:flex;flex-direction:column;gap:6px;padding-right:36px;margin-bottom:16px}#ecommreels-admin-app .ecr-dialog__title{font-size:16px;font-weight:600;text-transform:none}#ecommreels-admin-app .ecr-dialog__description{font-size:13px;color:var(--color-muted-foreground, #6b7280)}@keyframes ecr-dialog-overlay-in{0%{opacity:0}to{opacity:1}}@keyframes ecr-dialog-content-in{0%{opacity:0;transform:translate(-50%,-48%) scale(.98)}to{opacity:1;transform:translate(-50%,-50%) scale(1)}}#ecommreels-admin-app .ecr-admin-link-tabs{width:100%;max-height:550px}#ecommreels-admin-app .ecr-admin-link-tabs__list{width:100%;display:grid;grid-template-columns:1fr;gap:8px;border-radius:10px;padding:3px}#ecommreels-admin-app .ecr-admin-link-tabs__trigger,#ecommreels-admin-app .ecr-admin-link-tabs__lock{display:flex;cursor:pointer;align-items:center;justify-content:center;gap:4px;border:1px solid #3b82f6;border-radius:8px;padding:8px;font-size:13px;font-weight:600;background:#fff;color:#6b7280;text-transform:none}#ecommreels-admin-app .ecr-admin-link-tabs__lock{border-color:#969eab}#ecommreels-admin-app .ecr-admin-link-tabs__trigger{color:#3b82f6}#ecommreels-admin-app .ecr-admin-link-tabs__popover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-link-tabs__content{display:flex;flex-direction:column;gap:20px}#ecommreels-admin-app .ecr-admin-link-dialog{max-width:560px}#ecommreels-admin-app .ecr-admin-product-link__search-input{width:100%;border-radius:4px;border:1px solid #e5e7eb;padding:8px 12px;font-size:13px}#ecommreels-admin-app .ecr-admin-product-link__list{height:100%;max-height:300px;width:100%;overflow-y:auto}#ecommreels-admin-app .ecr-admin-product-link__list-inner{display:flex;flex-direction:column;gap:8px;width:100%}#ecommreels-admin-app .ecr-admin-product-link__empty{padding:24px 0;text-align:center;font-size:14px;color:#6b7280}#ecommreels-admin-app .ecr-admin-product-link__item{width:100%}#ecommreels-admin-app .ecr-admin-product-link__button{height:auto;width:100%;justify-content:flex-start;border:1px solid #e5e7eb;background:#f7f7f7;color:#111827;padding:8px;font-weight:400;text-align:left;font-size:13px;display:flex;align-items:center;gap:8px;border-radius:6px}#ecommreels-admin-app .ecr-admin-product-link__button--selected{border-color:#2563eb;background:#eff6ff}#ecommreels-admin-app .ecr-admin-product-link__button--unselected:hover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-product-link__thumb{pointer-events:none;width:40px;height:40px;flex:0 0 auto}#ecommreels-admin-app .ecr-admin-product-link__error{margin:0 0 8px;text-align:left;font-size:14px;color:#ef4444}#ecommreels-admin-app .ecr-admin-product-link__actions{display:flex;justify-content:end}#ecommreels-admin-app .ecr-admin-product-link__actions .ecr-button{text-transform:capitalize;padding:12px 32px}#ecommreels-admin-app .ecr-admin-product-link__loader{display:flex;justify-content:center;padding:24px 0}#ecommreels-admin-app .ecr-admin-product-link__spinner{width:24px;height:24px;border-radius:999px;border-bottom:2px solid #3b82f6;animation:ecr-admin-product-link-spin 1s linear infinite}@keyframes ecr-admin-product-link-spin{to{transform:rotate(360deg)}}.scrollbarThin{--sb-track: transparent;--sb-thumb: rgba(0, 0, 0, .35);--sb-thumb-hover: rgba(0, 0, 0, .5);--sb-thumb-radius: 6px;--sb-size: 8px;scrollbar-width:thin;scrollbar-color:var(--sb-thumb) var(--sb-track);-ms-overflow-style:auto}.scrollbarThin::-webkit-scrollbar{width:var(--sb-size);height:var(--sb-size)}.scrollbarThin::-webkit-scrollbar-track{background:var(--sb-track)}.scrollbarThin::-webkit-scrollbar-thumb{background-color:var(--sb-thumb);border-radius:var(--sb-thumb-radius);border:2px solid transparent;background-clip:padding-box}.scrollbarThin::-webkit-scrollbar-thumb:hover{background-color:var(--sb-thumb-hover)}.scrollbarThin::-webkit-scrollbar-thumb:active{background-color:var(--sb-thumb-hover)}.scrollbarThin::-webkit-scrollbar-corner{background:var(--sb-track)}.scrollbarThin:focus-within::-webkit-scrollbar-thumb{box-shadow:0 0 0 1px #0000000f inset}#ecommreels-admin-app .ecr-admin-link__label{display:block;text-align:left;font-size:14px;font-weight:600;text-transform:capitalize;margin-bottom:4px}#ecommreels-admin-app .ecr-admin-link__input{width:100%;border-radius:6px;border:1px solid #6b7280;padding:6px 8px}#ecommreels-admin-app .ecr-admin-link__input--normal{border-color:#6b7280}#ecommreels-admin-app .ecr-admin-link__input--error{border-color:#ef4444}#ecommreels-admin-app .ecr-admin-link__input:focus{outline:none;border-color:#3b82f6;box-shadow:0 0 0 2px #3b82f626}#ecommreels-admin-app .ecr-admin-link__error{margin:4px 0 0;text-align:left;font-size:12px;color:#ef4444}#ecommreels-admin-app .ecr-admin-link__toggle{display:flex;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-link__checkbox{width:16px;height:16px}#ecommreels-admin-app .ecr-admin-link__toggle-label{cursor:pointer;font-size:14px;font-weight:600}#ecommreels-admin-app .ecr-admin-link__actions{margin-top:12px;display:flex;gap:8px}#ecommreels-admin-app .ecr-admin-link__actions .ecr-button{text-transform:capitalize;width:100%}#ecommreels-admin-app .ecr-admin-links{display:flex;flex-direction:column;gap:8px}#ecommreels-admin-app .ecr-admin-links__title{margin:0;font-size:16px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-links__wrapper{display:flex;flex-direction:column;gap:4px;max-height:380px;overflow-y:auto}#ecommreels-admin-app .ecr-admin-links__item{display:flex;align-items:center;justify-content:space-between;gap:8px;border-radius:6px;background:#eff6ff;padding:2px 8px 2px 16px}#ecommreels-admin-app .ecr-admin-links__remove{color:#ef4444}#ecommreels-admin-app .ecr-admin-links__add-more_btn{margin-top:8px;display:flex;width:100%;cursor:pointer;align-items:center;justify-content:center;gap:4px;border-radius:6px;background:#3b82f6;padding:8px;font-size:13px;color:#fff;text-transform:capitalize}#ecommreels-admin-app .ecr-admin-links__upgrade{margin-top:12px;display:flex;width:100%;cursor:pointer;align-items:center;justify-content:center;gap:4px;border-radius:6px;background:#3b82f6b3;padding:6px;font-size:13px;color:#fff;text-transform:capitalize}#ecommreels-admin-app .ecr-admin-links__popover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-reelvideo{width:100%;border-radius:12px;display:block}#ecommreels-admin-app .ecr-admin-reelvideo--portrait{width:100%;height:100%;object-fit:cover}#ecommreels-admin-app .ecr-admin-reelvideo--landscape{width:100%}#ecommreels-admin-app .ecr-admin-customization__panel{position:relative;display:flex;width:260px;aspect-ratio:9 / 16;cursor:grab;align-items:center;justify-content:center;overflow:hidden;border-radius:12px;background:#000;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-admin-customization__panel:active{cursor:grabbing}#ecommreels-admin-app .ecr-admin-customization__remove{position:absolute;top:8px;left:8px;z-index:3;cursor:pointer;color:#fff;mix-blend-mode:difference}#ecommreels-admin-app .ecr-admin-customization__controls{position:absolute;top:8px;right:8px;z-index:5;display:flex;gap:8px;font-size:18px;color:#fff;mix-blend-mode:difference}#ecommreels-admin-app .ecr-admin-customization__control{cursor:pointer}#ecommreels-admin-app .ecr-admin-customization{display:flex;width:fit-content;flex-wrap:wrap;gap:16px}#ecommreels-admin-app .ecr-admin-customization__add{position:relative;display:flex;width:260px;aspect-ratio:9 / 16;flex-direction:column;align-items:center;justify-content:center;gap:8px;border-radius:12px;border:2px dashed #d1d5db;background:#e5e7eb;padding:20px;cursor:pointer}#ecommreels-admin-app .ecr-admin-customization__icon{width:40%;transition:transform .2s ease}#ecommreels-admin-app .ecr-admin-customization__add:hover .ecr-admin-customization__icon{transform:scale(1.02)}#ecommreels-admin-app .ecr-admin-customization__label{font-size:13px;color:#4b5563}#ecommreels-admin-app .ecr-admin-customization__lock{position:absolute;top:8px;right:8px;color:#6b7280}#ecommreels-admin-app .ecr-admin-customization__popover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-thumbnail{display:flex;flex-direction:column}#ecommreels-admin-app .ecr-admin-thumbnail__title{margin:0 0 8px;font-size:16px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-thumbnail__preview{position:relative;margin:0 auto;width:100%;aspect-ratio:9 / 16;overflow:hidden;border-radius:12px}#ecommreels-admin-app .ecr-admin-thumbnail__image{width:100%;height:100%;object-fit:cover}#ecommreels-admin-app .ecr-admin-thumbnail__remove{position:absolute;top:8px;right:8px;z-index:3;cursor:pointer;color:#fff;mix-blend-mode:difference}#ecommreels-admin-app .ecr-admin-thumbnail__uploader{width:100%}@media(max-width:767px){#ecommreels-admin-app .ecr-admin-thumbnail__uploader{width:260px}}#ecommreels-admin-app .ecr-admin-card{margin:24px auto 0;max-width:1024px;border:1px solid #6b7280;border-radius:6px;background:#fff;padding:24px;box-shadow:0 0 8px #aaa}#ecommreels-admin-app .ecr-admin-card--settings{width:fit-content}#ecommreels-admin-app .ecr-admin-card__header{display:flex;align-items:center;justify-content:space-between;gap:16px}#ecommreels-admin-app .ecr-admin-card__title{margin:0;font-size:20px;font-weight:700}#ecommreels-admin-app .ecr-admin-groups{display:flex;flex-direction:column;gap:16px}#ecommreels-admin-app .ecr-admin-groups__header{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px}#ecommreels-admin-app .ecr-admin-groups__title{margin:0;font-size:20px;font-weight:700;color:#111827}#ecommreels-admin-app .ecr-admin-groups__create-button{border:1px solid #2563eb;background:#fff;color:#2563eb}#ecommreels-admin-app .ecr-admin-groups__create-button:hover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-groups__load-more{display:flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-admin-groups__load-more__icon{width:48px;height:48px;color:#3b82f6;animation:ecr-load-more-spin 1s linear infinite}@keyframes ecr-load-more-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-admin-groups_action_wrapper{display:flex;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-groups-header__search{position:relative;width:100%}@media(min-width:640px){#ecommreels-admin-app .ecr-admin-groups-header__search{width:280px}}#ecommreels-admin-app .ecr-admin-groups-search-input{width:100%;padding:8px 16px;border-radius:6px;border:1px solid #e5e7eb;background:#fff;font-size:14px;line-height:1.4}#ecommreels-admin-app .ecr-admin-groups-search-input:focus{outline:none;box-shadow:none;border-color:#cbd5f5}#ecommreels-admin-app .ecr-admin-groups-header__icon-wrapper{position:absolute;top:50%;right:8px;transform:translateY(-50%);width:fit-content;height:20px;display:flex;align-items:center}#ecommreels-admin-app .ecr-admin-groups-header__search-icon{color:#d1d5db;flex-shrink:0}#ecommreels-admin-app .ecr-admin-groups-header__clear-icon{color:#f50808;flex-shrink:0}#ecommreels-admin-app .ecr-admin-docs-link{color:#2563eb;display:flex;align-items:center;text-decoration:none;gap:4px;transition:color .15s ease}#ecommreels-admin-app .ecr-admin-docs-link:focus{box-shadow:none}#ecommreels-admin-app .ecr-admin-error{margin-top:16px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;border-radius:6px;border:1px solid #fecaca;background:#fef2f2;padding:24px;color:#dc2626}#ecommreels-admin-app .ecr-admin-error__icon{width:28px;height:28px}#ecommreels-admin-app .ecr-admin-error__text{margin:0;text-align:center;font-weight:600}.ecr-table__container{width:100%;overflow-x:auto}.ecr-table{width:100%;border-collapse:collapse;font-size:13px}.ecr-table__header tr{border-bottom:1px solid var(--color-border, #e5e7eb)}.ecr-table__row{border-bottom:1px solid var(--color-border, #e5e7eb);transition:background-color .2s ease}.ecr-table__row:hover,.ecr-table__row[data-state=selected]{background:var(--color-muted, #f3f4f6)}.ecr-table__head,.ecr-table__cell{padding:8px;text-align:left;vertical-align:middle;white-space:nowrap}.ecr-table__head{font-weight:600;color:var(--color-foreground, #111827)}.ecr-table__footer{border-top:1px solid var(--color-border, #e5e7eb);font-weight:600;background:var(--color-muted, #f3f4f6)}.ecr-table__caption{margin-top:16px;font-size:12px;color:var(--color-muted-foreground, #6b7280)}#ecommreels-admin-app .ecr-admin-groups__head{background:#1f2937;color:#fff;border:1px solid #374151;padding:8px;font-size:13px;font-weight:600}#ecommreels-admin-app .ecr-admin-groups__row{background:#fff}#ecommreels-admin-app .ecr-admin-groups__row--alt{background:#f3f4f6}#ecommreels-admin-app .ecr-admin-groups__cell--center{text-align:center}#ecommreels-admin-app .ecr-admin-groups__cell--strong{font-weight:600}#ecommreels-admin-app .ecr-admin-groups__name{display:flex;align-items:center;gap:8px;font-weight:600;color:#1f2937}#ecommreels-admin-app .ecr-admin-groups__shortcode{display:flex;align-items:center;gap:16px}#ecommreels-admin-app .ecr-admin-groups__shortcode-text{font-family:Courier New,monospace;font-size:13px;color:#111827}#ecommreels-admin-app .ecr-admin-groups__copy{position:relative;isolation:isolate}#ecommreels-admin-app .ecr-admin-groups__copy-button{border:none;border-radius:4px;background:#1f2937;color:#fff;padding:4px 6px;cursor:pointer;transition:transform .15s ease}#ecommreels-admin-app .ecr-admin-groups__copy-button:active{transform:scale(.95)}#ecommreels-admin-app .ecr-admin-groups__copy-icon{display:block;width:12px;height:12px}#ecommreels-admin-app .ecr-admin-groups__copy-tooltip{position:absolute;top:-8px;right:8px;transform:translate(33%,-100%) scale(0);transform-origin:bottom right;border-radius:4px;background:#6b7280;padding:4px 8px;font-size:12px;font-weight:600;letter-spacing:.32px;color:#fff;transition:transform .2s ease}#ecommreels-admin-app .ecr-admin-groups__copy-tooltip:after{content:"";position:absolute;bottom:-4px;left:50%;width:12px;height:12px;transform:translate(-50%) rotate(45deg);background:#6b7280;z-index:-1}#ecommreels-admin-app .ecr-admin-groups__copy-tooltip--visible{transform:translate(33%,-100%) scale(1)}#ecommreels-admin-app .ecr-admin-groups__actions{display:flex;align-items:center;justify-content:center;gap:6px}#ecommreels-admin-app .ecr-admin-groups__action-button{color:inherit}#ecommreels-admin-app .ecr-admin-groups__icon{width:18px;height:18px}#ecommreels-admin-app .ecr-admin-groups__icon--neutral{color:#475569}#ecommreels-admin-app .ecr-admin-groups__icon--danger{color:#f43f5e}#ecommreels-admin-app .ecr-admin-groups__caption{margin-top:16px}#ecommreels-admin-app .ecr-admin-groups__empty{display:flex;align-items:center;justify-content:center;gap:8px;font-size:15px;font-weight:600;color:#374151}#ecommreels-admin-app .ecr-admin-groups__empty-icon{width:20px;height:20px;color:#f59e0b}#ecommreels-admin-app .ecr-admin-groups__skeleton-table{width:100%;border-collapse:collapse}#ecommreels-admin-app .ecr-admin-groups__skeleton-head{background:#1f2937}#ecommreels-admin-app .ecr-admin-groups__skeleton-row{background:#fff}#ecommreels-admin-app .ecr-admin-groups__skeleton-row--alt{background:#f9fafb}#ecommreels-admin-app .ecr-admin-groups__skeleton-cell{border:1px solid #e5e7eb;padding:8px}#ecommreels-admin-app .ecr-admin-groups__skeleton-cell--center{text-align:center}#ecommreels-admin-app .ecr-admin-groups__skeleton-block,#ecommreels-admin-app .ecr-admin-groups__skeleton-line{border-radius:4px;background:#d1d5db;animation:ecr-groups-pulse 1.6s ease-in-out infinite}#ecommreels-admin-app .ecr-admin-groups__skeleton-block{height:24px}#ecommreels-admin-app .ecr-admin-groups__skeleton-line{height:16px;margin:4px 0}#ecommreels-admin-app .ecr-admin-groups__skeleton-block--tiny,#ecommreels-admin-app .ecr-admin-groups__skeleton-line--tiny{width:32px;margin-inline:auto}#ecommreels-admin-app .ecr-admin-groups__skeleton-block--small,#ecommreels-admin-app .ecr-admin-groups__skeleton-line--small{width:96px;margin-inline:auto}#ecommreels-admin-app .ecr-admin-groups__skeleton-block--medium,#ecommreels-admin-app .ecr-admin-groups__skeleton-line--medium{width:160px}#ecommreels-admin-app .ecr-admin-groups__skeleton-block--large,#ecommreels-admin-app .ecr-admin-groups__skeleton-line--large{width:220px}@keyframes ecr-groups-pulse{0%,to{opacity:1}50%{opacity:.5}}#ecommreels-admin-app .ecr-admin-form{margin-top:24px;display:flex;flex-direction:column;gap:16px}#ecommreels-admin-app .ecr-admin-form__row{display:grid;grid-template-columns:1fr;align-items:center;gap:24px}@media(min-width:640px){#ecommreels-admin-app .ecr-admin-form__row{grid-template-columns:repeat(2,minmax(0,1fr))}}#ecommreels-admin-app .ecr-admin-form__label{font-size:14px;font-weight:600}#ecommreels-admin-app .ecr-admin-form__input{width:128px;border-radius:6px;border:1px solid #d1d5db;padding:8px;font-size:14px}#ecommreels-admin-app .ecr-admin-stats{display:flex;flex-direction:column;gap:16px}#ecommreels-admin-app .ecr-admin-stats__header{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px}#ecommreels-admin-app .ecr-admin-stats__title{margin:0;font-size:20px;font-weight:700;color:#111827}#ecommreels-admin-app .ecr-admin-stats__summary{font-size:15px;font-weight:700;color:#111827}#ecommreels-admin-app .ecr-admin-stats__summary-skeleton{width:64px;height:24px;border-radius:6px;background:#d1d5db;animation:ecr-stats-pulse 1.6s ease-in-out infinite}#ecommreels-admin-app .ecr-admin-stats__body{margin-top:16px}@keyframes ecr-stats-pulse{0%,to{opacity:1}50%{opacity:.5}}#ecommreels-admin-app .ecr-admin-stats__table{margin-top:8px}#ecommreels-admin-app .ecr-admin-stats__head{background:#1f2937;color:#fff;border:1px solid #374151;padding:8px;font-size:13px;font-weight:600}#ecommreels-admin-app .ecr-admin-stats__row{background:#fff}#ecommreels-admin-app .ecr-admin-stats__row--alt{background:#f3f4f6}#ecommreels-admin-app .ecr-admin-stats__cell{border:1px solid #e5e7eb;padding:8px;font-size:13px;color:#111827}#ecommreels-admin-app .ecr-admin-stats__cell--center{text-align:center}#ecommreels-admin-app .ecr-admin-stats__cell--link{word-break:break-word}#ecommreels-admin-app .ecr-admin-stats__link{color:#2563eb;text-decoration:underline}#ecommreels-admin-app .ecr-admin-stats__caption{margin-top:16px}#ecommreels-admin-app .ecr-admin-stats__empty{display:flex;align-items:center;justify-content:center;gap:8px;font-size:14px;font-weight:600;color:#374151}#ecommreels-admin-app .ecr-admin-stats__empty-icon{width:20px;height:20px;color:#f59e0b}#ecommreels-admin-app .ecr-admin-group-edit{margin-top:24px;padding:0 24px;display:flex;flex-direction:column;gap:16px;position:relative}@media(min-width:1200px){#ecommreels-admin-app .ecr-admin-group-edit{flex-direction:row}}#ecommreels-admin-app .ecr-admin-group-title__wrapper{position:relative}#ecommreels-admin-app .ecr-admin-group-title-customization__trigger{position:absolute;top:50%;translate:0 -50%;right:0;background-color:transparent;color:gray;padding:0 8px}#ecommreels-admin-app .ecr-admin-group-title-customization-dialog{max-width:350px}#ecommreels-admin-app .ecr-admin-nav-btn-reverse{flex-direction:row-reverse}@media(min-width:640px){#ecommreels-admin-app .ecr-admin-nav-btn-reverse{flex-direction:row}}#ecommreels-admin-app .ecr-admin-side-toggle{background:none;border:none;padding:0;color:#6b7280;cursor:pointer}#ecommreels-admin-app .ecr-admin-side-toggle--active{color:#2563eb}.ecr-input{width:100%;min-width:0;border:1px solid transparent;border-radius:6px;background:#f3f4f6;color:inherit;padding:6.4px 12px;font-size:14px;line-height:1.4;transition:border-color .2s ease,box-shadow .2s ease,background-color .2s ease}.ecr-input:focus{outline:none;border-color:var(--color-ring, #60a5fa);box-shadow:0 0 0 3px color-mix(in srgb,#60a5fa 35%,transparent);background:#fff}.ecr-input::placeholder{color:var(--color-muted-foreground, #9ca3af)}.ecr-input:disabled{opacity:.6;cursor:not-allowed}#ecommreels-admin-app .ecr-admin-range{display:flex;flex-direction:column;align-items:flex-start;gap:4px}#ecommreels-admin-app .ecr-admin-range__label{font-size:13px;font-weight:600;white-space:nowrap;color:#374151;display:flex;align-items:center;gap:4px}#ecommreels-admin-app .ecr-admin-range__row{display:flex;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-range__slider{width:112px;cursor:pointer;accent-color:#2563eb}#ecommreels-admin-app .ecr-admin-range__value{display:inline-flex;align-items:center;gap:6px}#ecommreels-admin-app .ecr-admin-range__value .ecr-input{width:80px;padding:6px 8px}#ecommreels-admin-app .ecr-admin-range__unit{font-size:12px;color:#6b7280}#ecommreels-admin-app .ecr-admin-group-title_alignment{display:flex;align-items:center;flex-wrap:wrap;gap:8px;justify-content:space-between}#ecommreels-admin-app .ecr-admin-group-title_alignment-label{margin:0;font-size:13px;font-weight:600;white-space:nowrap;color:#374151}#ecommreels-admin-app .ecr-admin-group-title_alignment-options{display:flex;align-items:center;gap:0;background-color:#dfdfdf;border-radius:8px;overflow:hidden}#ecommreels-admin-app .ecr-admin-group-title_alignment-options button{border-radius:0;color:#3d3d3d}#ecommreels-admin-app .ecr-admin-group-title_alignment-options button:not(:last-child){border-right:1px solid gray}#ecommreels-admin-app .ecr-admin-group-title-customization__content{display:flex;flex-direction:column;gap:16px;margin-top:40px}#ecommreels-admin-app .ecr-admin-color-selector-popover{width:auto;padding:0;z-index:9}#ecommreels-admin-app .ecr-admin-shortcode{display:flex;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-shortcode__badge{border-radius:4px;background:#e5e7eb;padding:4px 8px;font-family:Courier New,monospace;font-size:14px;color:#111827;font-weight:900}#ecommreels-admin-app .ecr-admin-shortcode__copy{position:relative;isolation:isolate}#ecommreels-admin-app .ecr-admin-shortcode__button{cursor:pointer;border:none;border-radius:4px;background:#1f2937;padding:4px 6px;color:#fff}#ecommreels-admin-app .ecr-admin-shortcode__button:active{transform:scale(.95)}#ecommreels-admin-app .ecr-admin-shortcode__tooltip{position:absolute;top:50%;right:150%;transform:translateY(-50%) scale(0);transform-origin:center;border-radius:4px;background:#6b7280;padding:4px 8px;font-size:12px;font-weight:600;letter-spacing:.32px;color:#fff;transition:transform .2s ease}#ecommreels-admin-app .ecr-admin-shortcode__tooltip:after{content:"";position:absolute;top:50%;right:-4px;width:12px;height:12px;transform:translateY(-50%) rotate(45deg);background:#6b7280;z-index:-1}#ecommreels-admin-app .ecr-admin-shortcode__tooltip--visible{transform:translateY(-50%) scale(1)}#ecommreels-admin-app .ecr-admin-shortcode__tooltip--hidden{transform:translateY(-50%) scale(0)}#ecommreels-admin-app .ecr-admin-reelitem{display:inline-flex;flex-direction:column;width:var(--thumbnail-size, 150px)}@media screen and (max-width:640px){#ecommreels-admin-app .ecr-admin-reelitem{width:var(--thumbnail-size-mobile, 150px)}}@media screen and (max-width:991px)and (min-width:640px){#ecommreels-admin-app .ecr-admin-reelitem{width:var(--thumbnail-size-tab, 150px)}}#ecommreels-admin-app .ecr-admin-reelitem__frame{position:relative;display:flex;align-items:center;justify-content:center;overflow:hidden;transition:aspect-ratio .2s ease}#ecommreels-admin-app .ecr-admin-reelitem__actions{position:absolute;top:100%;left:0;z-index:1;display:flex;height:50%;width:100%;cursor:pointer;align-items:center;justify-content:center;gap:12px;background:#bfdbfee6;transition:top .2s ease}#ecommreels-admin-app .ecr-admin-reelitem__frame:hover .ecr-admin-reelitem__actions{top:50%}#ecommreels-admin-app .ecr-admin-reelitem__button{background:#fff;color:#111827;padding:4px;border-radius:6px}#ecommreels-admin-app .ecr-admin-reelitem__button:hover{background:#fff}#ecommreels-admin-app .ecr-admin-reelitem__button--danger{color:#ef4444}#ecommreels-admin-app .ecr-admin-reelitem__icon{width:16px;height:16px}#ecommreels-admin-app .ecr-admin-reelitem__spinner{animation:ecr-reelitem-spin 1s linear infinite}#ecommreels-admin-app .ecr-admin-reelitem__link{display:inline-flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-admin-reelitem__link--disabled{pointer-events:none}#ecommreels-admin-app .ecr-admin-reelitem__link--active{pointer-events:auto}#ecommreels-admin-app .zoom-in,#ecommreels-admin-app .zoom-out{transition:transform .2s ease}#ecommreels-admin-app .zoom-in:hover{transform:scale(1.05)}#ecommreels-admin-app .zoom-out:hover{transform:scale(.95)}#ecommreels-admin-app .ecr-admin-reel__title{width:100%;margin:6px 0 0;text-align:center;font-size:13px;font-weight:500;text-transform:capitalize;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@keyframes ecr-reelitem-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-product-card-one,.ecommreels-short-code .ecr-product-card-one,.reelswp-group-short-code .ecr-product-card-one,.reelswp-reel-short-code .ecr-product-card-one{display:flex;flex-direction:column;align-items:stretch;gap:16px;background-color:#0003;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);border-radius:8px;padding:8px;overflow:hidden;border:1px solid rgba(255,255,255,.2);flex-shrink:0;border-bottom-left-radius:max(calc(var(--thumbnail-border-radius, 0px) - 4px),8px);border-bottom-right-radius:max(calc(var(--thumbnail-border-radius, 0px) - 4px),8px);transition:all .3s ease-in-out;min-height:var(--thumbnail-border-radius);padding-inline:max(var(--thumbnail-border-radius, 8px) / 5,8px)}#ecommreels-admin-app .ecr-product-card-one-content-wrapper,.ecommreels-short-code .ecr-product-card-one-content-wrapper,.reelswp-group-short-code .ecr-product-card-one-content-wrapper,.reelswp-reel-short-code .ecr-product-card-one-content-wrapper{display:flex;align-items:center;gap:8px;flex-shrink:0}#ecommreels-admin-app .ecr-product-card-one__thumb,.ecommreels-short-code .ecr-product-card-one__thumb,.reelswp-group-short-code .ecr-product-card-one__thumb,.reelswp-reel-short-code .ecr-product-card-one__thumb{pointer-events:none;width:40px;height:40px;flex-shrink:0;border-radius:4px}#ecommreels-admin-app .ecr-product-card-one__content,.ecommreels-short-code .ecr-product-card-one__content,.reelswp-group-short-code .ecr-product-card-one__content,.reelswp-reel-short-code .ecr-product-card-one__content{flex-grow:1;display:flex;flex-direction:column;align-items:flex-start;gap:4px;overflow:hidden}#ecommreels-admin-app .ecr-product-card-one p.ecr-product-card-one__title,.ecommreels-short-code .ecr-product-card-one p.ecr-product-card-one__title,.reelswp-group-short-code .ecr-product-card-one p.ecr-product-card-one__title,.reelswp-reel-short-code .ecr-product-card-one p.ecr-product-card-one__title,#ecommreels-admin-app .ecr-product-card-one a.ecr-product-card-one__title,.ecommreels-short-code .ecr-product-card-one a.ecr-product-card-one__title,.reelswp-group-short-code .ecr-product-card-one a.ecr-product-card-one__title,.reelswp-reel-short-code .ecr-product-card-one a.ecr-product-card-one__title{max-width:100%;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;font-weight:500;line-height:1.2;color:#fff;text-decoration:none}:is(#ecommreels-admin-app .ecr-product-card-one p.ecr-product-card-one__title,.ecommreels-short-code .ecr-product-card-one p.ecr-product-card-one__title,.reelswp-group-short-code .ecr-product-card-one p.ecr-product-card-one__title,.reelswp-reel-short-code .ecr-product-card-one p.ecr-product-card-one__title,#ecommreels-admin-app .ecr-product-card-one a.ecr-product-card-one__title,.ecommreels-short-code .ecr-product-card-one a.ecr-product-card-one__title,.reelswp-group-short-code .ecr-product-card-one a.ecr-product-card-one__title,.reelswp-reel-short-code .ecr-product-card-one a.ecr-product-card-one__title):hover{text-decoration:underline}#ecommreels-admin-app .ecr-product-card-one__meta,.ecommreels-short-code .ecr-product-card-one__meta,.reelswp-group-short-code .ecr-product-card-one__meta,.reelswp-reel-short-code .ecr-product-card-one__meta{display:flex;flex-wrap:wrap;column-gap:8px;row-gap:4px}#ecommreels-admin-app .ecr-product-card-one__rating,.ecommreels-short-code .ecr-product-card-one__rating,.reelswp-group-short-code .ecr-product-card-one__rating,.reelswp-reel-short-code .ecr-product-card-one__rating{margin-left:4px;display:flex;align-items:center;gap:4px;font-size:12px;color:#fff}#ecommreels-admin-app .ecr-product-card-one__star,.ecommreels-short-code .ecr-product-card-one__star,.reelswp-group-short-code .ecr-product-card-one__star,.reelswp-reel-short-code .ecr-product-card-one__star{width:12px;height:12px;color:#fff}#ecommreels-admin-app .ecr-product-card-one__price,.ecommreels-short-code .ecr-product-card-one__price,.reelswp-group-short-code .ecr-product-card-one__price,.reelswp-reel-short-code .ecr-product-card-one__price{display:flex;align-items:center;gap:.25ch;color:#fff}#ecommreels-admin-app .ecr-product-card-one__price *,.ecommreels-short-code .ecr-product-card-one__price *,.reelswp-group-short-code .ecr-product-card-one__price *,.reelswp-reel-short-code .ecr-product-card-one__price *{line-height:1;background-color:transparent;color:#fff;font-size:12px}#ecommreels-admin-app .ecr-product-card-one__price span.woocommerce-Price-amount,.ecommreels-short-code .ecr-product-card-one__price span.woocommerce-Price-amount,.reelswp-group-short-code .ecr-product-card-one__price span.woocommerce-Price-amount,.reelswp-reel-short-code .ecr-product-card-one__price span.woocommerce-Price-amount{line-height:normal}#ecommreels-admin-app .ecr-product-card-one__price ins,.ecommreels-short-code .ecr-product-card-one__price ins,.reelswp-group-short-code .ecr-product-card-one__price ins,.reelswp-reel-short-code .ecr-product-card-one__price ins{text-decoration:none}#ecommreels-admin-app .ecr-thumb__link-wrapper,.ecommreels-short-code .ecr-thumb__link-wrapper,.reelswp-group-short-code .ecr-thumb__link-wrapper,.reelswp-reel-short-code .ecr-thumb__link-wrapper{display:flex;flex-direction:column;gap:4px;flex-shrink:0}#ecommreels-admin-app .ecr-thumb__link-wrapper a.ecr-thumb__link,.ecommreels-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link,.reelswp-group-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link,.reelswp-reel-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link{display:grid;place-items:center;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;border-radius:8px;background-color:transparent;position:relative;min-height:max(var(--thumbnail-border-radius, 48px),48px);text-align:center;font-size:16px;font-weight:600;color:#fff;text-decoration:none;border:1px solid #fff;border-bottom-left-radius:max(var(--thumbnail-border-radius, 8px),8px);border-bottom-right-radius:max(var(--thumbnail-border-radius, 8px),8px);transition:all .3s ease-in-out;isolation:isolate}:is(#ecommreels-admin-app .ecr-thumb__link-wrapper a.ecr-thumb__link,.ecommreels-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link,.reelswp-group-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link,.reelswp-reel-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link):hover{text-decoration:underline}:is(#ecommreels-admin-app .ecr-thumb__link-wrapper a.ecr-thumb__link,.ecommreels-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link,.reelswp-group-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link,.reelswp-reel-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link):before{content:"";position:absolute;inset:0;background-color:#0003;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);border-radius:8px;border-bottom-left-radius:max(var(--thumbnail-border-radius, 8px),8px);border-bottom-right-radius:max(var(--thumbnail-border-radius, 8px),8px);overflow:hidden;z-index:-1;transition:all .3s ease-in-out}#ecommreels-admin-app .ecr-admin-reelitem-links,.ecommreels-short-code .ecr-admin-reelitem-links,.reelswp-group-short-code .ecr-admin-reelitem-links,.reelswp-reel-short-code .ecr-admin-reelitem-links{display:flex;align-items:center;gap:8px;overflow:hidden;margin-top:8px;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-admin-reelitem-links[data-dragging=true] *,.ecommreels-short-code .ecr-admin-reelitem-links[data-dragging=true] *,.reelswp-group-short-code .ecr-admin-reelitem-links[data-dragging=true] *,.reelswp-reel-short-code .ecr-admin-reelitem-links[data-dragging=true] *{pointer-events:none}#ecommreels-admin-app .ecr-reel_title,.ecommreels-short-code .ecr-reel_title,.reelswp-group-short-code .ecr-reel_title,.reelswp-reel-short-code .ecr-reel_title{position:absolute;left:50%;transform:translate(-50%);bottom:8px;text-transform:capitalize;background-color:#0003;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);padding:4px 8px;color:#fff;width:95%;border-radius:8px;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-bottom:0}#ecommreels-admin-app .ecr-admin-editor-carousel{position:relative;max-width:100%}#ecommreels-admin-app .ecr-admin-editor-carousel__viewport{cursor:grab;overflow:hidden;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-admin-editor-carousel__viewport:active{cursor:grabbing}#ecommreels-admin-app .ecr-admin-editor-carousel__track{display:flex;width:max-content;flex-wrap:nowrap;padding:16px 0;gap:var(--thumbnail-gap, 16px)}@media screen and (max-width:640px){#ecommreels-admin-app .ecr-admin-editor-carousel__track{gap:var(--thumbnail-gap-mobile, 16px)}}@media screen and (max-width:991px)and (min-width:640px){#ecommreels-admin-app .ecr-admin-editor-carousel__track{gap:var(--thumbnail-gap-tab, 16px)}}#ecommreels-admin-app .ecr-admin-editor-carousel__track--padded{padding:16px}#ecommreels-admin-app .ecr-admin-editor-carousel__empty{display:flex;width:100%;justify-content:center}#ecommreels-admin-app .ecr-admin-editor-carousel__empty-text{margin:0;display:flex;width:320px;flex-direction:column;align-items:center;gap:8px;text-align:center;font-size:15px;color:#374151}#ecommreels-admin-app .ecr-admin-editor-carousel__empty-icon{width:40px;height:40px;color:#f59e0b}#ecommreels-admin-app .ecr-admin-editor-carousel__nav{position:absolute;top:50%;z-index:2;transform:translateY(-50%);border:none;background:#fff;padding:6px 8px;color:#374151;cursor:pointer;width:32px;height:40px;transition:background-color .2s ease;display:flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-admin-editor-carousel__nav:hover{background:#dbeafe}#ecommreels-admin-app .ecr-admin-editor-carousel__nav--left{left:0;border-radius:0 999px 999px 0}#ecommreels-admin-app .ecr-admin-editor-carousel__nav--right{right:0;border-radius:999px 0 0 999px}#ecommreels-admin-app .ecr-admin-editor-grid{display:flex;flex-wrap:wrap;row-gap:16px;column-gap:var(--thumbnail-gap, 16px)}@media screen and (max-width:640px){#ecommreels-admin-app .ecr-admin-editor-grid{column-gap:var(--thumbnail-gap-mobile, 16px)}}@media screen and (max-width:991px)and (min-width:640px){#ecommreels-admin-app .ecr-admin-editor-grid{column-gap:var(--thumbnail-gap-tab, 16px)}}#ecommreels-admin-app .ecr-admin-editor-grid--padded{padding:16px}#ecommreels-admin-app .ecr-admin-editor-grid__empty{display:flex;width:100%;justify-content:center;padding-top:160px}#ecommreels-admin-app .ecr-admin-editor-grid__empty-text{margin:0;display:flex;width:320px;flex-direction:column;align-items:center;gap:8px;text-align:center;font-size:15px;color:#374151}#ecommreels-admin-app .ecr-admin-editor-grid__empty-icon{width:40px;height:40px;color:#f59e0b}#ecommreels-admin-app .ecr-admin-existing{width:100%;flex:1;overflow:hidden;border-radius:8px;border:1px solid #e5e7eb;background:#fff}#ecommreels-admin-app .ecr-admin-existing__header{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px;border-bottom:1px solid #e5e7eb;padding:16px 16px 8px}#ecommreels-admin-app .ecr-admin-existing__title-wrapper{display:flex;flex-direction:column}#ecommreels-admin-app .ecr-admin-existing__title{margin:0;font-size:16px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-existing__body{max-height:800px;overflow-y:auto;padding:8px 16px 16px}#ecommreels-admin-app .ecr-preview-player{background-color:#000000b3;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);display:grid;place-items:center;padding:24px;width:100%;min-height:320px;border-radius:4px;container-type:inline-size}#ecommreels-admin-app .ecr-preview-player__stage{position:relative;width:fit-content;height:fit-content}#ecommreels-admin-app .ecr-preview-player .ecr-player__frame{position:relative;aspect-ratio:9 / 16;height:min(70vh,560px);max-width:90vw;overflow:hidden;border-radius:24px}#ecommreels-admin-app .ecr-preview-player__media{width:100%;height:100%}#ecommreels-admin-app .ecr-preview-player__media-item{width:100%;object-fit:cover;display:block}#ecommreels-admin-app .ecr-preview-player__nav--disabled{opacity:.4;cursor:not-allowed}#ecommreels-admin-app .ecr-player__close{position:absolute;top:8px;right:8px;z-index:5;color:#fff;cursor:pointer;mix-blend-mode:difference;line-height:1;background:transparent;border:none}#ecommreels-admin-app .ecr-player__close-icon{font-size:22px;font-weight:800}#ecommreels-admin-app .ecr-player__controls{position:absolute;top:8px;right:40px;z-index:5;display:inline-flex;align-items:center;gap:10px;color:#fff;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-preview-message{font-size:12px;color:#e9e8e8;width:100%;max-width:300px;margin-left:auto;padding-top:12px}@container (width > 992px){#ecommreels-admin-app .ecr-preview-message{position:absolute;right:0;bottom:6px}}#ecommreels-admin-app .ecr-admin-reellist{display:flex;flex-direction:column;min-height:100%;width:100%;flex-shrink:0;overflow-y:auto;border-radius:8px;border:1px solid #e5e7eb;background:#fff;box-shadow:0 1px 2px #0000000d}@media(min-width:1200px){#ecommreels-admin-app .ecr-admin-reellist{width:280px}}#ecommreels-admin-app .ecr-admin-reellist__header{border-bottom:1px solid #e5e7eb;padding:16px 16px 8px;display:flex;flex-direction:column}#ecommreels-admin-app .ecr-admin-reellist__title{margin:0;font-size:16px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-reellist__body{margin-top:8px;display:flex;flex-direction:column;gap:12px;padding:0 16px 16px}#ecommreels-admin-app .ecr-admin-reellist__add-button{width:100%;flex-shrink:0;margin-inline-start:0;border:1px solid #2563eb;background:#fff}#ecommreels-admin-app .ecr-admin-reellist__add-button:hover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-reellist__search-input{width:100%;border-radius:4px;border:1px solid #e5e7eb;padding:8px 12px;font-size:13px}#ecommreels-admin-app .ecr-admin-reellist__search-input:focus{outline:none;border-color:#93c5fd;box-shadow:0 0 0 2px #3b82f626}#ecommreels-admin-app .ecr-admin-reellist__grid{margin-top:16px;max-height:60vh;width:100%;overflow-y:auto}#ecommreels-admin-app .ecr-admin-reellist__items{width:100%;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}@media(min-width:767px)and (max-width:1199px){#ecommreels-admin-app .ecr-admin-reellist__items{grid-template-columns:repeat(4,minmax(0,1fr))}}@media(min-width:1200px){#ecommreels-admin-app .ecr-admin-reellist__items{grid-template-columns:repeat(2,minmax(0,1fr))}}#ecommreels-admin-app .ecr-admin-reellist__empty{grid-column:1 / -1;padding:24px 0;text-align:center;font-size:13px;color:#6b7280}#ecommreels-admin-app .ecr-admin-reellist__item{width:100%}#ecommreels-admin-app .ecr-admin-reellist__card{position:relative;width:100%;overflow:hidden;border-radius:6px;border:2px solid #e5e7eb;transition:border-color .2s ease;padding:0}#ecommreels-admin-app .ecr-admin-reellist__card:hover{border-color:#3b82f6}#ecommreels-admin-app .ecr-admin-reellist__media{aspect-ratio:9 / 16;width:100%}#ecommreels-admin-app .ecr-admin-reellist__thumb{pointer-events:none;display:block;width:100%;height:100%;object-fit:cover}#ecommreels-admin-app .ecr-admin-reellist__label{position:absolute;bottom:0;left:0;width:100%;padding:4px;background:linear-gradient(0deg,#fff 20%,#fff0);font-size:13px;font-weight:600;color:#111827;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#ecommreels-admin-app .ecr-admin-reellist__overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:#ffffffbf}#ecommreels-admin-app .ecr-admin-reellist__overlay-icon{width:24px;height:24px;color:#3b82f6;animation:ecr-reellist-spin 1s linear infinite}#ecommreels-admin-app .ecr-admin-reellist__loader{grid-column:1 / -1;display:flex;justify-content:center;padding:24px 0}#ecommreels-admin-app .ecr-admin-reellist__spinner{width:24px;height:24px;border-radius:999px;border:2px solid #cbd5e1;border-top-color:#3b82f6;animation:ecr-reellist-spin 1s linear infinite}@keyframes ecr-reellist-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-tabs{display:flex;flex-direction:column;gap:8px}#ecommreels-admin-app .ecr-tabs__list{display:inline-flex;align-items:center;background:var(--color-muted, #f3f4f6);border-radius:10px;padding:3px;width:fit-content}#ecommreels-admin-app .ecr-tabs__trigger{border:1px solid transparent;border-radius:8px;padding:8px;font-size:13px;font-weight:600;color:var(--color-muted-foreground, #6b7280);background:transparent;transition:background-color .2s ease,color .2s ease,border-color .2s ease}#ecommreels-admin-app .ecr-tabs__trigger[data-state=active]{background:#fff;color:var(--color-foreground, #111827);border-color:var(--color-border, #e5e7eb);box-shadow:0 1px 2px #0000000f}#ecommreels-admin-app .ecr-tabs__content{outline:none}#ecommreels-admin-app .ecr-admin-sidepanel{position:relative;display:flex;flex-direction:column;min-height:100%;max-height:100%;flex-shrink:0;overflow:hidden;border-radius:8px;transition:width .2s ease}#ecommreels-admin-app .ecr-admin-sidepanel--expanded{width:100%;max-height:100%;position:absolute;right:16px;top:0}#ecommreels-admin-app .ecr-admin-mobile-overlay{position:fixed;top:0;left:0;width:100vw;height:100vh;background:#0f172abf;z-index:5}#ecommreels-admin-app .ecr-admin-sidepanel-content{width:280px;background:#fff;margin-left:auto;border:2px solid #e5e7eb;height:100vh;position:fixed;top:0;right:0}@media(max-width:1024px)and (min-width:640px){#ecommreels-admin-app .ecr-admin-sidepanel-content{padding-top:32px}}@media(max-width:1200px){#ecommreels-admin-app .ecr-admin-sidepanel-content{z-index:999}}@media(min-width:1200px){#ecommreels-admin-app .ecr-admin-sidepanel--expanded{position:static}#ecommreels-admin-app .ecr-admin-mobile-overlay{display:none}#ecommreels-admin-app .ecr-admin-sidepanel-content{position:static;width:280px;background:#fff;margin-left:0;border:2px solid #e5e7eb;height:100%;border-radius:8px}#ecommreels-admin-app .ecr-admin-sidepanel--expanded{width:fit-content}}#ecommreels-admin-app .ecr-admin-sidepanel--collapsed{width:0;border:0;pointer-events:none}#ecommreels-admin-app .ecr-admin-sidepanel__header{position:relative;display:flex;flex-direction:column;border-bottom:1px solid #e5e7eb;padding:16px 16px 8px}#ecommreels-admin-app .ecr-admin-sidepanel__title{margin:0;font-size:15px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-sidepanel__body{height:100%;overflow-x:hidden;padding:8px 16px 16px}#ecommreels-admin-app .ecr-admin-sidepanel__tabs,#ecommreels-admin-app .ecr-admin-sidepanel__tabs-list{width:100%}#ecommreels-admin-app .ecr-admin-sidepanel__tabs-list{display:grid;grid-template-columns:1fr 1fr}#ecommreels-admin-app .ecr-admin-sidepanel__lock-trigger{display:flex;cursor:pointer;align-items:center;justify-content:center;gap:4px;font-size:13px;color:#6b7280;text-transform:capitalize;padding:8px}#ecommreels-admin-app .ecr-admin-sidepanel__popover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-switch{display:inline-flex;align-items:center;gap:8px;cursor:pointer;font-size:14px;font-weight:500;color:#6b7280}#ecommreels-admin-app .ecr-admin-switch__label{display:inline-flex;align-items:center;gap:4px}#ecommreels-admin-app .ecr-admin-switch__icon{color:#6b7280}#ecommreels-admin-app .ecr-admin-popover{background:#eff6ff}#ecommreels-admin-app .ecr-select__trigger{display:inline-flex;align-items:center;justify-content:space-between;gap:8px;border:1px solid var(--color-border, #d1d5db);border-radius:6px;padding:7.2px 12px;font-size:13px;background:#fff;color:var(--color-foreground, #111827);min-width:fit-content}#ecommreels-admin-app .ecr-select__trigger[data-size=sm]{height:32px}#ecommreels-admin-app .ecr-select__trigger[data-size=default]{height:36px}#ecommreels-admin-app .ecr-select__trigger:focus-visible{outline:none;border-color:var(--color-ring, #60a5fa);box-shadow:0 0 0 3px color-mix(in srgb,#60a5fa 35%,transparent)}#ecommreels-admin-app .ecr-select__icon{width:16px;height:16px;opacity:.6}#ecommreels-admin-app .ecr-select__content{background:#fff;color:var(--color-foreground, #111827);border:1px solid var(--color-border, #d1d5db);border-radius:8px;box-shadow:0 10px 30px #00000026;overflow:hidden;min-width:140px;z-index:999}#ecommreels-admin-app .ecr-select__content[data-side=bottom]{animation:ecr-fade-down .15s ease-out}#ecommreels-admin-app .ecr-select__content[data-side=top]{animation:ecr-fade-up .15s ease-out}#ecommreels-admin-app .ecr-select__viewport{padding:5.6px}#ecommreels-admin-app .ecr-select__item{display:flex;align-items:center;gap:8px;border-radius:6px;padding:8px;font-size:13px;cursor:pointer;text-transform:capitalize}#ecommreels-admin-app .ecr-select__item[data-highlighted]{background:var(--color-accent, #f3f4f6)}#ecommreels-admin-app .ecr-select__item[data-disabled]{opacity:.5;cursor:not-allowed}#ecommreels-admin-app .ecr-select__label{padding:5.6px 8px;font-size:12px;color:var(--color-muted-foreground, #6b7280)}#ecommreels-admin-app .ecr-select__separator{height:1px;margin:4px 0;background:var(--color-border, #e5e7eb)}#ecommreels-admin-app .ecr-select__check{position:absolute;right:8px;width:14px;height:14px;display:inline-flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-select__check-icon{width:14px;height:14px}#ecommreels-admin-app .ecr-select__scroll-button{display:flex;align-items:center;justify-content:center;padding:4px 0;cursor:default}@keyframes ecr-fade-down{0%{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:translateY(0)}}@keyframes ecr-fade-up{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}#ecommreels-admin-app .ecr-admin-thumb-controls{display:flex;flex-direction:column;gap:16px}#ecommreels-admin-app .ecr-admin-thumb-controls__section{border:1px solid var(--color-border, #e5e7eb);border-radius:10px;padding:12px;background:#fff;display:flex;flex-direction:column}#ecommreels-admin-app .ecr-admin-thumb-controls__section-trigger{align-items:center;background:transparent;border:none;color:var(--color-foreground, #111827);cursor:pointer;display:flex;font-size:13px;font-weight:600;justify-content:space-between;padding:0;text-align:left}#ecommreels-admin-app .ecr-admin-thumb-controls__section-content{display:flex;flex-direction:column;gap:16px}#ecommreels-admin-app .ecr-admin-thumb-controls__section-content[data-state=open]{margin-top:12px;padding-top:12px;border-top:1px solid #e5e7eb}#ecommreels-admin-app .ecr-collapsible__trigger{align-items:center;display:inline-flex;gap:8px;justify-content:space-between;width:100%}#ecommreels-admin-app .ecr-collapsible__trigger-label{align-items:center;display:inline-flex;gap:4px}#ecommreels-admin-app .ecr-collapsible__trigger-icon{height:16px;width:16px;transition:transform .2s ease}#ecommreels-admin-app .ecr-collapsible__trigger[data-state=open] .ecr-collapsible__trigger-icon{transform:rotate(180deg)}#ecommreels-admin-app .ecr-admin-control{display:flex;flex-direction:column;align-items:flex-start;gap:4px}#ecommreels-admin-app .ecr-admin-control--row,#ecommreels-admin-app .ecr-admin-control--inline{flex-direction:row;align-items:center;flex-wrap:wrap;gap:8px}#ecommreels-admin-app .ecr-admin-control__label{margin:0;font-size:13px;font-weight:600;white-space:nowrap;color:#374151}#ecommreels-admin-app .ecr-admin-control__row{display:flex;align-items:center;gap:12px}#ecommreels-admin-app .ecr-admin-control__row--color{position:relative}#ecommreels-admin-app .ecr-admin-control__choice{display:flex;align-items:center;gap:4px}#ecommreels-admin-app .ecr-admin-control__choice-label{cursor:pointer;display:flex;align-items:center;gap:4px}#ecommreels-admin-app .ecr-admin-control__trigger,#ecommreels-admin-app .ecr-admin-control__option{text-transform:capitalize}.ecr-admin-control__lock-trigger{display:flex;width:100%;align-items:center;justify-content:space-between;gap:8px;padding:6px 8px;font-size:13px;color:#6b7280;cursor:pointer;border:none}.ecr-admin-control__lock-trigger:hover{background:#f3f4f6}.ecr-admin-control__popover{background:#eff6ff}.ecr-admin-control__swatch{width:24px;height:24px;cursor:pointer;border-radius:4px;border:2px solid #6b7280}#ecommreels-admin-app .ecr-admin-control__picker{position:absolute;top:100%;left:0;z-index:9;box-shadow:0 8px 16px #0000001f;outline:none}#ecommreels-admin-app .ecr-admin-control__hex{width:80px;border-radius:4px;border:1px solid #6b7280;padding:6px 8px}#ecommreels-admin-app,.ecommreels-short-code,.reelswp-group-short-code,.reelswp-reel-short-code{--reels-wp-animation-time: 3s;--reels-wp-marquee-time: 20s}#ecommreels-admin-app .ecr-player__loader,.ecommreels-short-code .ecr-player__loader,.reelswp-group-short-code .ecr-player__loader,.reelswp-reel-short-code .ecr-player__loader{height:90vh;max-width:100vw;aspect-ratio:9 / 16;border-radius:16px;border:1px solid #e5e7eb;display:flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-loader,.ecommreels-short-code .ecr-loader,.reelswp-group-short-code .ecr-loader,.reelswp-reel-short-code .ecr-loader{width:100%;height:100%;display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:10px}#ecommreels-admin-app .ecr-loader__ball,.ecommreels-short-code .ecr-loader__ball,.reelswp-group-short-code .ecr-loader__ball,.reelswp-reel-short-code .ecr-loader__ball{width:20px;height:20px;border-radius:50%;background:#919191;animation:ecr-bounce 1s alternate infinite}#ecommreels-admin-app .ecr-loader__ball:nth-child(2),.ecommreels-short-code .ecr-loader__ball:nth-child(2),.reelswp-group-short-code .ecr-loader__ball:nth-child(2),.reelswp-reel-short-code .ecr-loader__ball:nth-child(2){animation-delay:.25s}#ecommreels-admin-app .ecr-loader__ball:nth-child(3),.ecommreels-short-code .ecr-loader__ball:nth-child(3),.reelswp-group-short-code .ecr-loader__ball:nth-child(3),.reelswp-reel-short-code .ecr-loader__ball:nth-child(3){animation-delay:.5s}@keyframes ecr-bounce{0%{transform:scale(2)}to{transform:scale(1)}}#ecommreels-admin-app .ecr-thumb,.ecommreels-short-code .ecr-thumb,.reelswp-group-short-code .ecr-thumb,.reelswp-reel-short-code .ecr-thumb{display:block;width:var(--thumbnail-size, 150px)}@media screen and (max-width:640px){#ecommreels-admin-app .ecr-thumb,.ecommreels-short-code .ecr-thumb,.reelswp-group-short-code .ecr-thumb,.reelswp-reel-short-code .ecr-thumb{width:var(--thumbnail-size-mobile, 150px)}}@media screen and (max-width:991px)and (min-width:640px){#ecommreels-admin-app .ecr-thumb,.ecommreels-short-code .ecr-thumb,.reelswp-group-short-code .ecr-thumb,.reelswp-reel-short-code .ecr-thumb{width:var(--thumbnail-size-tab, 150px)}}#ecommreels-admin-app .ecr-thumb__frame,.ecommreels-short-code .ecr-thumb__frame,.reelswp-group-short-code .ecr-thumb__frame,.reelswp-reel-short-code .ecr-thumb__frame{overflow:hidden;width:100%;position:relative}#ecommreels-admin-app .zoom-in,.ecommreels-short-code .zoom-in,.reelswp-group-short-code .zoom-in,.reelswp-reel-short-code .zoom-in,#ecommreels-admin-app .zoom-out,.ecommreels-short-code .zoom-out,.reelswp-group-short-code .zoom-out,.reelswp-reel-short-code .zoom-out{transition:transform .2s ease-in-out}#ecommreels-admin-app .zoom-in:hover,.ecommreels-short-code .zoom-in:hover,.reelswp-group-short-code .zoom-in:hover,.reelswp-reel-short-code .zoom-in:hover{transform:scale(1.05)}#ecommreels-admin-app .zoom-out:hover,.ecommreels-short-code .zoom-out:hover,.reelswp-group-short-code .zoom-out:hover,.reelswp-reel-short-code .zoom-out:hover{transform:scale(.95)}#ecommreels-admin-app .ecr-reel__title,.ecommreels-short-code .ecr-reel__title,.reelswp-group-short-code .ecr-reel__title,.reelswp-reel-short-code .ecr-reel__title{width:100%;margin:6px 0 0;text-align:center;font-size:13px;font-weight:500;text-transform:capitalize;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#ecommreels-admin-app .ecr-front-carousel,.ecommreels-short-code .ecr-front-carousel,.reelswp-group-short-code .ecr-front-carousel,.reelswp-reel-short-code .ecr-front-carousel{position:relative;max-width:100%}#ecommreels-admin-app .ecr-front-carousel__viewport,.ecommreels-short-code .ecr-front-carousel__viewport,.reelswp-group-short-code .ecr-front-carousel__viewport,.reelswp-reel-short-code .ecr-front-carousel__viewport{cursor:grab;overflow:hidden;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-front-carousel__track,.ecommreels-short-code .ecr-front-carousel__track,.reelswp-group-short-code .ecr-front-carousel__track,.reelswp-reel-short-code .ecr-front-carousel__track{display:flex;flex-wrap:nowrap;width:max-content;gap:var(--thumbnail-gap, 16px)}@media screen and (max-width:640px){#ecommreels-admin-app .ecr-front-carousel__track,.ecommreels-short-code .ecr-front-carousel__track,.reelswp-group-short-code .ecr-front-carousel__track,.reelswp-reel-short-code .ecr-front-carousel__track{gap:var(--thumbnail-gap-mobile, 16px)}}@media screen and (max-width:991px)and (min-width:640px){#ecommreels-admin-app .ecr-front-carousel__track,.ecommreels-short-code .ecr-front-carousel__track,.reelswp-group-short-code .ecr-front-carousel__track,.reelswp-reel-short-code .ecr-front-carousel__track{gap:var(--thumbnail-gap-tab, 16px)}}#ecommreels-admin-app .ecr-front-carousel__track--zoom,.ecommreels-short-code .ecr-front-carousel__track--zoom,.reelswp-group-short-code .ecr-front-carousel__track--zoom,.reelswp-reel-short-code .ecr-front-carousel__track--zoom{padding:16px}#ecommreels-admin-app .ecr-front-carousel__nav,.ecommreels-short-code .ecr-front-carousel__nav,.reelswp-group-short-code .ecr-front-carousel__nav,.reelswp-reel-short-code .ecr-front-carousel__nav{position:absolute;top:50%;z-index:1;transform:translateY(-50%);border:none;background:#fff;color:#1f2937;cursor:pointer;width:32px;height:40px;padding:0;display:flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-front-carousel__nav--left,.ecommreels-short-code .ecr-front-carousel__nav--left,.reelswp-group-short-code .ecr-front-carousel__nav--left,.reelswp-reel-short-code .ecr-front-carousel__nav--left{left:0;border-top-right-radius:999px;border-bottom-right-radius:999px}#ecommreels-admin-app .ecr-front-carousel__nav--right,.ecommreels-short-code .ecr-front-carousel__nav--right,.reelswp-group-short-code .ecr-front-carousel__nav--right,.reelswp-reel-short-code .ecr-front-carousel__nav--right{right:0;border-top-left-radius:999px;border-bottom-left-radius:999px}#ecommreels-admin-app .ecr-front-carousel__nav:hover,.ecommreels-short-code .ecr-front-carousel__nav:hover,.reelswp-group-short-code .ecr-front-carousel__nav:hover,.reelswp-reel-short-code .ecr-front-carousel__nav:hover{background:#dbeafe}#ecommreels-admin-app .ecr-front-grid,.ecommreels-short-code .ecr-front-grid,.reelswp-group-short-code .ecr-front-grid,.reelswp-reel-short-code .ecr-front-grid{cursor:default;overflow:hidden;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-front-grid__list,.ecommreels-short-code .ecr-front-grid__list,.reelswp-group-short-code .ecr-front-grid__list,.reelswp-reel-short-code .ecr-front-grid__list{display:grid;grid-template-columns:repeat(auto-fill,minmax(var(--thumbnail-size-grid, 150px),1fr));row-gap:16px;column-gap:var(--thumbnail-gap, 16px)}@media screen and (max-width:640px){#ecommreels-admin-app .ecr-front-grid__list,.ecommreels-short-code .ecr-front-grid__list,.reelswp-group-short-code .ecr-front-grid__list,.reelswp-reel-short-code .ecr-front-grid__list{column-gap:var(--thumbnail-gap-mobile, 16px);grid-template-columns:repeat(auto-fill,minmax(var(--thumbnail-size-grid-mobile, 150px),1fr))}}@media screen and (max-width:991px)and (min-width:640px){#ecommreels-admin-app .ecr-front-grid__list,.ecommreels-short-code .ecr-front-grid__list,.reelswp-group-short-code .ecr-front-grid__list,.reelswp-reel-short-code .ecr-front-grid__list{column-gap:var(--thumbnail-gap-tab, 16px);grid-template-columns:repeat(auto-fill,minmax(var(--thumbnail-size-grid-tab, 150px),1fr))}} 2 /*$vite$:1*/`,document.head.appendChild(ka);function Sa(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=Sa(_),xr=Sa(ja);function Nd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var In={exports:{}},Yt={};/**2 /*$vite$:1*/`,document.head.appendChild(ka);function Sa(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=Sa(_),xr=Sa(ja);function Td(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var In={exports:{}},Yt={};/** 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 Ca;function Ed(){if(Ca)return Yt;Ca=1;var e=_,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,i={key:!0,ref:!0,__self:!0,__source:!0};function s(l,c,d){var u,p={},m=null,g=null;d!==void 0&&(m=""+d),c.key!==void 0&&(m=""+c.key),c.ref!==void 0&&(g=c.ref);for(u in c)n.call(c,u)&&!i.hasOwnProperty(u)&&(p[u]=c[u]);if(l&&l.defaultProps)for(u in c=l.defaultProps,c)p[u]===void 0&&(p[u]=c[u]);return{$$typeof:t,type:l,key:m,ref:g,props:p,_owner:o.current}}return Yt.Fragment=r,Yt.jsx=s,Yt.jsxs=s,Yt}var Na;function Td(){return Na||(Na=1,In.exports=Ed()),In.exports}var a=Td();/**10 */var Ca;function Ad(){if(Ca)return Yt;Ca=1;var e=_,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,i={key:!0,ref:!0,__self:!0,__source:!0};function s(l,c,d){var u,p={},m=null,g=null;d!==void 0&&(m=""+d),c.key!==void 0&&(m=""+c.key),c.ref!==void 0&&(g=c.ref);for(u in c)n.call(c,u)&&!i.hasOwnProperty(u)&&(p[u]=c[u]);if(l&&l.defaultProps)for(u in c=l.defaultProps,c)p[u]===void 0&&(p[u]=c[u]);return{$$typeof:t,type:l,key:m,ref:g,props:p,_owner:o.current}}return Yt.Fragment=r,Yt.jsx=s,Yt.jsxs=s,Yt}var Na;function Pd(){return Na||(Na=1,In.exports=Ad()),In.exports}var a=Pd();/** 11 11 * @remix-run/router v1.23.2 12 12 * … … 17 17 * 18 18 * @license MIT 19 */function Xt(){return Xt=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},Xt.apply(this,arguments)}var nt;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(nt||(nt={}));const Ea="popstate";function Ad(e){e===void 0&&(e={});function t(o,i){let{pathname:s="/",search:l="",hash:c=""}=Jt(o.location.hash.substr(1));return!s.startsWith("/")&&!s.startsWith(".")&&(s="/"+s),Mn("",{pathname:s,search:l,hash:c},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function r(o,i){let s=o.document.querySelector("base"),l="";if(s&&s.getAttribute("href")){let c=o.location.href,d=c.indexOf("#");l=d===-1?c:c.slice(0,d)}return l+"#"+(typeof i=="string"?i:br(i))}function n(o,i){Ta(o.pathname.charAt(0)==="/","relative pathnames are not supported in hash history.push("+JSON.stringify(i)+")")}return Od(t,r,n,e)}function ye(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Ta(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 Aa(e,t){return{usr:e.state,key:e.key,idx:t}}function Mn(e,t,r,n){return r===void 0&&(r=null),Xt({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Jt(t):t,{state:r,key:t&&t.key||n||Pd()})}function br(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 Jt(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 Od(e,t,r,n){n===void 0&&(n={});let{window:o=document.defaultView,v5Compat:i=!1}=n,s=o.history,l=nt.Pop,c=null,d=u();d==null&&(d=0,s.replaceState(Xt({},s.state,{idx:d}),""));function u(){return(s.state||{idx:null}).idx}function p(){l=nt.Pop;let h=u(),v=h==null?null:h-d;d=h,c&&c({action:l,location:f.location,delta:v})}function m(h,v){l=nt.Push;let y=Mn(f.location,h,v);r&&r(y,h),d=u()+1;let w=Aa(y,d),j=f.createHref(y);try{s.pushState(w,"",j)}catch(C){if(C instanceof DOMException&&C.name==="DataCloneError")throw C;o.location.assign(j)}i&&c&&c({action:l,location:f.location,delta:1})}function g(h,v){l=nt.Replace;let y=Mn(f.location,h,v);r&&r(y,h),d=u();let w=Aa(y,d),j=f.createHref(y);s.replaceState(w,"",j),i&&c&&c({action:l,location:f.location,delta:0})}function b(h){let v=o.location.origin!=="null"?o.location.origin:o.location.href,y=typeof h=="string"?h:br(h);return y=y.replace(/ $/,"%20"),ye(v,"No window.location.(origin|href) available to create URL for href: "+y),new URL(y,v)}let f={get action(){return l},get location(){return e(o,s)},listen(h){if(c)throw new Error("A history only accepts one active listener");return o.addEventListener(Ea,p),c=h,()=>{o.removeEventListener(Ea,p),c=null}},createHref(h){return t(o,h)},createURL:b,encodeLocation(h){let v=b(h);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:m,replace:g,go(h){return s.go(h)}};return f}var Pa;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Pa||(Pa={}));function Oa(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 Rd=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ld=e=>Rd.test(e);function Id(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:o=""}=typeof e=="string"?Jt(e):e,i;if(r)if(Ld(r))i=r;else{if(r.includes("//")){let s=r;r=r.replace(/\/\/+/g,"/"),Ta(!1,"Pathnames cannot have embedded double slashes - normalizing "+(s+" -> "+r))}r.startsWith("/")?i=Ra(r.substring(1),"/"):i=Ra(r,t)}else i=t;return{pathname:i,search:zd(n),hash:Dd(o)}}function Ra(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 zn(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 Md(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function La(e,t){let r=Md(e);return t?r.map((n,o)=>o===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function Ia(e,t,r,n){n===void 0&&(n=!1);let o;typeof e=="string"?o=Jt(e):(o=Xt({},e),ye(!o.pathname||!o.pathname.includes("?"),zn("?","pathname","search",o)),ye(!o.pathname||!o.pathname.includes("#"),zn("#","pathname","hash",o)),ye(!o.search||!o.search.includes("#"),zn("#","search","hash",o)));let i=e===""||o.pathname==="",s=i?"/":o.pathname,l;if(s==null)l=r;else{let p=t.length-1;if(!n&&s.startsWith("..")){let m=s.split("/");for(;m[0]==="..";)m.shift(),p-=1;o.pathname=m.join("/")}l=p>=0?t[p]:"/"}let c=Id(o,l),d=s&&s!=="/"&&s.endsWith("/"),u=(i||s===".")&&r.endsWith("/");return!c.pathname.endsWith("/")&&(d||u)&&(c.pathname+="/"),c}const Ma=e=>e.join("/").replace(/\/\/+/g,"/"),zd=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Dd=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,za=["post","put","patch","delete"];new Set(za);const $d=["get",...za];new Set($d);/**19 */function Xt(){return Xt=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},Xt.apply(this,arguments)}var nt;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(nt||(nt={}));const Ea="popstate";function Od(e){e===void 0&&(e={});function t(o,i){let{pathname:s="/",search:l="",hash:c=""}=Jt(o.location.hash.substr(1));return!s.startsWith("/")&&!s.startsWith(".")&&(s="/"+s),Mn("",{pathname:s,search:l,hash:c},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function r(o,i){let s=o.document.querySelector("base"),l="";if(s&&s.getAttribute("href")){let c=o.location.href,d=c.indexOf("#");l=d===-1?c:c.slice(0,d)}return l+"#"+(typeof i=="string"?i:br(i))}function n(o,i){Ta(o.pathname.charAt(0)==="/","relative pathnames are not supported in hash history.push("+JSON.stringify(i)+")")}return Ld(t,r,n,e)}function ye(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Ta(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Rd(){return Math.random().toString(36).substr(2,8)}function Aa(e,t){return{usr:e.state,key:e.key,idx:t}}function Mn(e,t,r,n){return r===void 0&&(r=null),Xt({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Jt(t):t,{state:r,key:t&&t.key||n||Rd()})}function br(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 Jt(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 Ld(e,t,r,n){n===void 0&&(n={});let{window:o=document.defaultView,v5Compat:i=!1}=n,s=o.history,l=nt.Pop,c=null,d=u();d==null&&(d=0,s.replaceState(Xt({},s.state,{idx:d}),""));function u(){return(s.state||{idx:null}).idx}function p(){l=nt.Pop;let h=u(),v=h==null?null:h-d;d=h,c&&c({action:l,location:f.location,delta:v})}function m(h,v){l=nt.Push;let y=Mn(f.location,h,v);r&&r(y,h),d=u()+1;let w=Aa(y,d),j=f.createHref(y);try{s.pushState(w,"",j)}catch(C){if(C instanceof DOMException&&C.name==="DataCloneError")throw C;o.location.assign(j)}i&&c&&c({action:l,location:f.location,delta:1})}function g(h,v){l=nt.Replace;let y=Mn(f.location,h,v);r&&r(y,h),d=u();let w=Aa(y,d),j=f.createHref(y);s.replaceState(w,"",j),i&&c&&c({action:l,location:f.location,delta:0})}function b(h){let v=o.location.origin!=="null"?o.location.origin:o.location.href,y=typeof h=="string"?h:br(h);return y=y.replace(/ $/,"%20"),ye(v,"No window.location.(origin|href) available to create URL for href: "+y),new URL(y,v)}let f={get action(){return l},get location(){return e(o,s)},listen(h){if(c)throw new Error("A history only accepts one active listener");return o.addEventListener(Ea,p),c=h,()=>{o.removeEventListener(Ea,p),c=null}},createHref(h){return t(o,h)},createURL:b,encodeLocation(h){let v=b(h);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:m,replace:g,go(h){return s.go(h)}};return f}var Pa;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Pa||(Pa={}));function Oa(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 Id=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Md=e=>Id.test(e);function zd(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:o=""}=typeof e=="string"?Jt(e):e,i;if(r)if(Md(r))i=r;else{if(r.includes("//")){let s=r;r=r.replace(/\/\/+/g,"/"),Ta(!1,"Pathnames cannot have embedded double slashes - normalizing "+(s+" -> "+r))}r.startsWith("/")?i=Ra(r.substring(1),"/"):i=Ra(r,t)}else i=t;return{pathname:i,search:$d(n),hash:Fd(o)}}function Ra(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 zn(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 Dd(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function La(e,t){let r=Dd(e);return t?r.map((n,o)=>o===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function Ia(e,t,r,n){n===void 0&&(n=!1);let o;typeof e=="string"?o=Jt(e):(o=Xt({},e),ye(!o.pathname||!o.pathname.includes("?"),zn("?","pathname","search",o)),ye(!o.pathname||!o.pathname.includes("#"),zn("#","pathname","hash",o)),ye(!o.search||!o.search.includes("#"),zn("#","search","hash",o)));let i=e===""||o.pathname==="",s=i?"/":o.pathname,l;if(s==null)l=r;else{let p=t.length-1;if(!n&&s.startsWith("..")){let m=s.split("/");for(;m[0]==="..";)m.shift(),p-=1;o.pathname=m.join("/")}l=p>=0?t[p]:"/"}let c=zd(o,l),d=s&&s!=="/"&&s.endsWith("/"),u=(i||s===".")&&r.endsWith("/");return!c.pathname.endsWith("/")&&(d||u)&&(c.pathname+="/"),c}const Ma=e=>e.join("/").replace(/\/\/+/g,"/"),$d=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Fd=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,za=["post","put","patch","delete"];new Set(za);const Bd=["get",...za];new Set(Bd);/** 20 20 * React Router v6.30.3 21 21 * … … 26 26 * 27 27 * @license MIT 28 */function _r(){return _r=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},_r.apply(this,arguments)}const Da=x.createContext(null),_t=x.createContext(null),Dn=x.createContext(null),vr=x.createContext({outlet:null,matches:[],isDataRoute:!1});function Fd(e,t){let{relative:r}=t===void 0?{}:t;yr()||ye(!1);let{basename:n,navigator:o}=x.useContext(_t),{hash:i,pathname:s,search:l}=Fa(e,{relative:r}),c=s;return n!=="/"&&(c=s==="/"?n:Ma([n,s])),o.createHref({pathname:c,search:l,hash:i})}function yr(){return x.useContext(Dn)!=null}function wr(){return yr()||ye(!1),x.useContext(Dn).location}function $a(e){x.useContext(_t).static||x.useLayoutEffect(e)}function Ne(){let{isDataRoute:e}=x.useContext(vr);return e?Wd():Bd()}function Bd(){yr()||ye(!1);let e=x.useContext(Da),{basename:t,future:r,navigator:n}=x.useContext(_t),{matches:o}=x.useContext(vr),{pathname:i}=wr(),s=JSON.stringify(La(o,r.v7_relativeSplatPath)),l=x.useRef(!1);return $a(()=>{l.current=!0}),x.useCallback(function(d,u){if(u===void 0&&(u={}),!l.current)return;if(typeof d=="number"){n.go(d);return}let p=Ia(d,JSON.parse(s),i,u.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:Ma([t,p.pathname])),(u.replace?n.replace:n.push)(p,u.state,u)},[t,n,s,i,e])}function Fa(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=x.useContext(_t),{matches:o}=x.useContext(vr),{pathname:i}=wr(),s=JSON.stringify(La(o,n.v7_relativeSplatPath));return x.useMemo(()=>Ia(e,JSON.parse(s),i,r==="path"),[e,s,i,r])}var Ba=(function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e})(Ba||{}),Ua=(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})(Ua||{});function Ud(e){let t=x.useContext(Da);return t||ye(!1),t}function Hd(e){let t=x.useContext(vr);return t||ye(!1),t}function Vd(e){let t=Hd(),r=t.matches[t.matches.length-1];return r.route.id||ye(!1),r.route.id}function Wd(){let{router:e}=Ud(Ba.UseNavigateStable),t=Vd(Ua.UseNavigateStable),r=x.useRef(!1);return $a(()=>{r.current=!0}),x.useCallback(function(o,i){i===void 0&&(i={}),r.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,_r({fromRouteId:t},i)))},[e,t])}function qd(e,t){e?.v7_startTransition,e?.v7_relativeSplatPath}function Gd(e){let{basename:t="/",children:r=null,location:n,navigationType:o=nt.Pop,navigator:i,static:s=!1,future:l}=e;yr()&&ye(!1);let c=t.replace(/^\/*/,"/"),d=x.useMemo(()=>({basename:c,navigator:i,static:s,future:_r({v7_relativeSplatPath:!1},l)}),[c,l,i,s]);typeof n=="string"&&(n=Jt(n));let{pathname:u="/",search:p="",hash:m="",state:g=null,key:b="default"}=n,f=x.useMemo(()=>{let h=Oa(u,c);return h==null?null:{location:{pathname:h,search:p,hash:m,state:g,key:b},navigationType:o}},[c,u,p,m,g,b,o]);return f==null?null:x.createElement(_t.Provider,{value:d},x.createElement(Dn.Provider,{children:r,value:f}))}new Promise(()=>{});/**28 */function _r(){return _r=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},_r.apply(this,arguments)}const Da=x.createContext(null),_t=x.createContext(null),Dn=x.createContext(null),vr=x.createContext({outlet:null,matches:[],isDataRoute:!1});function Ud(e,t){let{relative:r}=t===void 0?{}:t;yr()||ye(!1);let{basename:n,navigator:o}=x.useContext(_t),{hash:i,pathname:s,search:l}=Fa(e,{relative:r}),c=s;return n!=="/"&&(c=s==="/"?n:Ma([n,s])),o.createHref({pathname:c,search:l,hash:i})}function yr(){return x.useContext(Dn)!=null}function wr(){return yr()||ye(!1),x.useContext(Dn).location}function $a(e){x.useContext(_t).static||x.useLayoutEffect(e)}function Ne(){let{isDataRoute:e}=x.useContext(vr);return e?Gd():Hd()}function Hd(){yr()||ye(!1);let e=x.useContext(Da),{basename:t,future:r,navigator:n}=x.useContext(_t),{matches:o}=x.useContext(vr),{pathname:i}=wr(),s=JSON.stringify(La(o,r.v7_relativeSplatPath)),l=x.useRef(!1);return $a(()=>{l.current=!0}),x.useCallback(function(d,u){if(u===void 0&&(u={}),!l.current)return;if(typeof d=="number"){n.go(d);return}let p=Ia(d,JSON.parse(s),i,u.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:Ma([t,p.pathname])),(u.replace?n.replace:n.push)(p,u.state,u)},[t,n,s,i,e])}function Fa(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=x.useContext(_t),{matches:o}=x.useContext(vr),{pathname:i}=wr(),s=JSON.stringify(La(o,n.v7_relativeSplatPath));return x.useMemo(()=>Ia(e,JSON.parse(s),i,r==="path"),[e,s,i,r])}var Ba=(function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e})(Ba||{}),Ua=(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})(Ua||{});function Vd(e){let t=x.useContext(Da);return t||ye(!1),t}function Wd(e){let t=x.useContext(vr);return t||ye(!1),t}function qd(e){let t=Wd(),r=t.matches[t.matches.length-1];return r.route.id||ye(!1),r.route.id}function Gd(){let{router:e}=Vd(Ba.UseNavigateStable),t=qd(Ua.UseNavigateStable),r=x.useRef(!1);return $a(()=>{r.current=!0}),x.useCallback(function(o,i){i===void 0&&(i={}),r.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,_r({fromRouteId:t},i)))},[e,t])}function Kd(e,t){e?.v7_startTransition,e?.v7_relativeSplatPath}function Yd(e){let{basename:t="/",children:r=null,location:n,navigationType:o=nt.Pop,navigator:i,static:s=!1,future:l}=e;yr()&&ye(!1);let c=t.replace(/^\/*/,"/"),d=x.useMemo(()=>({basename:c,navigator:i,static:s,future:_r({v7_relativeSplatPath:!1},l)}),[c,l,i,s]);typeof n=="string"&&(n=Jt(n));let{pathname:u="/",search:p="",hash:m="",state:g=null,key:b="default"}=n,f=x.useMemo(()=>{let h=Oa(u,c);return h==null?null:{location:{pathname:h,search:p,hash:m,state:g,key:b},navigationType:o}},[c,u,p,m,g,b,o]);return f==null?null:x.createElement(_t.Provider,{value:d},x.createElement(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 Kd(e,t){if(e==null)return{};var r={},n=Object.keys(e),o,i;for(i=0;i<n.length;i++)o=n[i],!(t.indexOf(o)>=0)&&(r[o]=e[o]);return r}function Yd(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Xd(e,t){return e.button===0&&(!t||t==="_self")&&!Yd(e)}function Fn(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 Jd(e,t){let r=Fn(e);return t&&t.forEach((n,o)=>{r.has(o)||t.getAll(o).forEach(i=>{r.append(o,i)})}),r}const Zd=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Qd="6";try{window.__reactRouterVersion=Qd}catch{}const Ha=x["startTransition"];function eu(e){let{basename:t,children:r,future:n,window:o}=e,i=x.useRef();i.current==null&&(i.current=Ad({window:o,v5Compat:!0}));let s=i.current,[l,c]=x.useState({action:s.action,location:s.location}),{v7_startTransition:d}=n||{},u=x.useCallback(p=>{d&&Ha?Ha(()=>c(p)):c(p)},[c,d]);return x.useLayoutEffect(()=>s.listen(u),[s,u]),x.useEffect(()=>qd(n),[n]),x.createElement(Gd,{basename:t,children:r,location:l.location,navigationType:l.action,navigator:s,future:n})}const tu=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",ru=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,vt=x.forwardRef(function(t,r){let{onClick:n,relative:o,reloadDocument:i,replace:s,state:l,target:c,to:d,preventScrollReset:u,viewTransition:p}=t,m=Kd(t,Zd),{basename:g}=x.useContext(_t),b,f=!1;if(typeof d=="string"&&ru.test(d)&&(b=d,tu))try{let w=new URL(window.location.href),j=d.startsWith("//")?new URL(w.protocol+d):new URL(d),C=Oa(j.pathname,g);j.origin===w.origin&&C!=null?d=C+j.search+j.hash:f=!0}catch{}let h=Fd(d,{relative:o}),v=nu(d,{replace:s,state:l,target:c,preventScrollReset:u,relative:o,viewTransition:p});function y(w){n&&n(w),w.defaultPrevented||v(w)}return x.createElement("a",$n({},m,{href:b||h,onClick:f||i?n:y,ref:r,target:c}))});var Va;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Va||(Va={}));var Wa;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Wa||(Wa={}));function nu(e,t){let{target:r,replace:n,state:o,preventScrollReset:i,relative:s,viewTransition:l}=t===void 0?{}:t,c=Ne(),d=wr(),u=Fa(e,{relative:s});return x.useCallback(p=>{if(Xd(p,r)){p.preventDefault();let m=n!==void 0?n:br(d)===br(u);c(e,{replace:m,state:o,preventScrollReset:i,relative:s,viewTransition:l})}},[d,c,u,n,o,r,e,i,s,l])}function Zt(e){let t=x.useRef(Fn(e)),r=x.useRef(!1),n=wr(),o=x.useMemo(()=>Jd(n.search,r.current?null:t.current),[n.search]),i=Ne(),s=x.useCallback((l,c)=>{const d=Fn(typeof l=="function"?l(o):l);r.current=!0,i("?"+d,c)},[i,o]);return[o,s]}let ou={data:""},au=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||ou},iu=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,su=/\/\*[^]*?\*\/| +/g,qa=/\n+/g,Ue=(e,t)=>{let r="",n="",o="";for(let i in e){let s=e[i];i[0]=="@"?i[1]=="i"?r=i+" "+s+";":n+=i[1]=="f"?Ue(s,i):i+"{"+Ue(s,i[1]=="k"?"":t)+"}":typeof s=="object"?n+=Ue(s,t?t.replace(/([^,])+/g,l=>i.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,c=>/&/.test(c)?c.replace(/&/g,l):l?l+" "+c:c)):i):s!=null&&(i=/^--/.test(i)?i:i.replace(/[A-Z]/g,"-$&").toLowerCase(),o+=Ue.p?Ue.p(i,s):i+":"+s+";")}return r+(t&&o?t+"{"+o+"}":o)+n},ze={},Ga=e=>{if(typeof e=="object"){let t="";for(let r in e)t+=r+Ga(e[r]);return t}return e},lu=(e,t,r,n,o)=>{let i=Ga(e),s=ze[i]||(ze[i]=(c=>{let d=0,u=11;for(;d<c.length;)u=101*u+c.charCodeAt(d++)>>>0;return"go"+u})(i));if(!ze[s]){let c=i!==e?e:(d=>{let u,p,m=[{}];for(;u=iu.exec(d.replace(su,""));)u[4]?m.shift():u[3]?(p=u[3].replace(qa," ").trim(),m.unshift(m[0][p]=m[0][p]||{})):m[0][u[1]]=u[2].replace(qa," ").trim();return m[0]})(e);ze[s]=Ue(o?{["@keyframes "+s]:c}:c,r?"":"."+s)}let l=r&&ze.g?ze.g:null;return r&&(ze.g=ze[s]),((c,d,u,p)=>{p?d.data=d.data.replace(p,c):d.data.indexOf(c)===-1&&(d.data=u?c+d.data:d.data+c)})(ze[s],t,n,l),s},cu=(e,t,r)=>e.reduce((n,o,i)=>{let s=t[i];if(s&&s.call){let l=s(r),c=l&&l.props&&l.props.className||/^go/.test(l)&&l;s=c?"."+c:l&&typeof l=="object"?l.props?"":Ue(l,""):l===!1?"":l}return n+o+(s??"")},"");function jr(e){let t=this||{},r=e.call?e(t.p):e;return lu(r.unshift?r.raw?cu(r,[].slice.call(arguments,1),t.p):r.reduce((n,o)=>Object.assign(n,o&&o.call?o(t.p):o),{}):r,au(t.target),t.g,t.o,t.k)}let Ka,Bn,Un;jr.bind({g:1});let De=jr.bind({k:1});function du(e,t,r,n){Ue.p=t,Ka=e,Bn=r,Un=n}function He(e,t){let r=this||{};return function(){let n=arguments;function o(i,s){let l=Object.assign({},i),c=l.className||o.className;r.p=Object.assign({theme:Bn&&Bn()},l),r.o=/ *go\d+/.test(c),l.className=jr.apply(r,n)+(c?" "+c:"");let d=e;return e[0]&&(d=l.as||e,delete l.as),Un&&d[0]&&Un(l),Ka(d,l)}return o}}var uu=e=>typeof e=="function",kr=(e,t)=>uu(e)?e(t):e,pu=(()=>{let e=0;return()=>(++e).toString()})(),Ya=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),mu=20,Hn="default",Xa=(e,t)=>{let{toastLimit:r}=e.settings;switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,r)};case 1:return{...e,toasts:e.toasts.map(s=>s.id===t.toast.id?{...s,...t.toast}:s)};case 2:let{toast:n}=t;return Xa(e,{type:e.toasts.find(s=>s.id===n.id)?1:0,toast:n});case 3:let{toastId:o}=t;return{...e,toasts:e.toasts.map(s=>s.id===o||o===void 0?{...s,dismissed:!0,visible:!1}:s)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(s=>s.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let i=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(s=>({...s,pauseDuration:s.pauseDuration+i}))}}},Sr=[],Ja={toasts:[],pausedAt:void 0,settings:{toastLimit:mu}},Ee={},Za=(e,t=Hn)=>{Ee[t]=Xa(Ee[t]||Ja,e),Sr.forEach(([r,n])=>{r===t&&n(Ee[t])})},Qa=e=>Object.keys(Ee).forEach(t=>Za(e,t)),fu=e=>Object.keys(Ee).find(t=>Ee[t].toasts.some(r=>r.id===e)),Cr=(e=Hn)=>t=>{Za(t,e)},hu={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},gu=(e={},t=Hn)=>{let[r,n]=_.useState(Ee[t]||Ja),o=_.useRef(Ee[t]);_.useEffect(()=>(o.current!==Ee[t]&&n(Ee[t]),Sr.push([t,n]),()=>{let s=Sr.findIndex(([l])=>l===t);s>-1&&Sr.splice(s,1)}),[t]);let i=r.toasts.map(s=>{var l,c,d;return{...e,...e[s.type],...s,removeDelay:s.removeDelay||((l=e[s.type])==null?void 0:l.removeDelay)||e?.removeDelay,duration:s.duration||((c=e[s.type])==null?void 0:c.duration)||e?.duration||hu[s.type],style:{...e.style,...(d=e[s.type])==null?void 0:d.style,...s.style}}});return{...r,toasts:i}},xu=(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||pu()}),Qt=e=>(t,r)=>{let n=xu(t,e,r);return Cr(n.toasterId||fu(n.id))({type:2,toast:n}),n.id},ie=(e,t)=>Qt("blank")(e,t);ie.error=Qt("error"),ie.success=Qt("success"),ie.loading=Qt("loading"),ie.custom=Qt("custom"),ie.dismiss=(e,t)=>{let r={type:3,toastId:e};t?Cr(t)(r):Qa(r)},ie.dismissAll=e=>ie.dismiss(void 0,e),ie.remove=(e,t)=>{let r={type:4,toastId:e};t?Cr(t)(r):Qa(r)},ie.removeAll=e=>ie.remove(void 0,e),ie.promise=(e,t,r)=>{let n=ie.loading(t.loading,{...r,...r?.loading});return typeof e=="function"&&(e=e()),e.then(o=>{let i=t.success?kr(t.success,o):void 0;return i?ie.success(i,{id:n,...r,...r?.success}):ie.dismiss(n),o}).catch(o=>{let i=t.error?kr(t.error,o):void 0;i?ie.error(i,{id:n,...r,...r?.error}):ie.dismiss(n)}),e};var bu=1e3,_u=(e,t="default")=>{let{toasts:r,pausedAt:n}=gu(e,t),o=_.useRef(new Map).current,i=_.useCallback((p,m=bu)=>{if(o.has(p))return;let g=setTimeout(()=>{o.delete(p),s({type:4,toastId:p})},m);o.set(p,g)},[]);_.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&&ie.dismiss(g.id);return}return setTimeout(()=>ie.dismiss(g.id,t),b)});return()=>{m.forEach(g=>g&&clearTimeout(g))}},[r,n,t]);let s=_.useCallback(Cr(t),[t]),l=_.useCallback(()=>{s({type:5,time:Date.now()})},[s]),c=_.useCallback((p,m)=>{s({type:1,toast:{id:p,height:m}})},[s]),d=_.useCallback(()=>{n&&s({type:6,time:Date.now()})},[n,s]),u=_.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),y=h.filter((w,j)=>j<v&&w.visible).length;return h.filter(w=>w.visible).slice(...g?[y+1]:[0,y]).reduce((w,j)=>w+(j.height||0)+b,0)},[r]);return _.useEffect(()=>{r.forEach(p=>{if(p.dismissed)i(p.id,p.removeDelay);else{let m=o.get(p.id);m&&(clearTimeout(m),o.delete(p.id))}})},[r,i]),{toasts:r,handlers:{updateHeight:c,startPause:l,endPause:d,calculateOffset:u}}},vu=De`37 */function $n(){return $n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},$n.apply(this,arguments)}function Xd(e,t){if(e==null)return{};var r={},n=Object.keys(e),o,i;for(i=0;i<n.length;i++)o=n[i],!(t.indexOf(o)>=0)&&(r[o]=e[o]);return r}function Jd(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Zd(e,t){return e.button===0&&(!t||t==="_self")&&!Jd(e)}function Fn(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 Qd(e,t){let r=Fn(e);return t&&t.forEach((n,o)=>{r.has(o)||t.getAll(o).forEach(i=>{r.append(o,i)})}),r}const eu=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],tu="6";try{window.__reactRouterVersion=tu}catch{}const Ha=x["startTransition"];function ru(e){let{basename:t,children:r,future:n,window:o}=e,i=x.useRef();i.current==null&&(i.current=Od({window:o,v5Compat:!0}));let s=i.current,[l,c]=x.useState({action:s.action,location:s.location}),{v7_startTransition:d}=n||{},u=x.useCallback(p=>{d&&Ha?Ha(()=>c(p)):c(p)},[c,d]);return x.useLayoutEffect(()=>s.listen(u),[s,u]),x.useEffect(()=>Kd(n),[n]),x.createElement(Yd,{basename:t,children:r,location:l.location,navigationType:l.action,navigator:s,future:n})}const nu=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",ou=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,vt=x.forwardRef(function(t,r){let{onClick:n,relative:o,reloadDocument:i,replace:s,state:l,target:c,to:d,preventScrollReset:u,viewTransition:p}=t,m=Xd(t,eu),{basename:g}=x.useContext(_t),b,f=!1;if(typeof d=="string"&&ou.test(d)&&(b=d,nu))try{let w=new URL(window.location.href),j=d.startsWith("//")?new URL(w.protocol+d):new URL(d),C=Oa(j.pathname,g);j.origin===w.origin&&C!=null?d=C+j.search+j.hash:f=!0}catch{}let h=Ud(d,{relative:o}),v=au(d,{replace:s,state:l,target:c,preventScrollReset:u,relative:o,viewTransition:p});function y(w){n&&n(w),w.defaultPrevented||v(w)}return x.createElement("a",$n({},m,{href:b||h,onClick:f||i?n:y,ref:r,target:c}))});var Va;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Va||(Va={}));var Wa;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Wa||(Wa={}));function au(e,t){let{target:r,replace:n,state:o,preventScrollReset:i,relative:s,viewTransition:l}=t===void 0?{}:t,c=Ne(),d=wr(),u=Fa(e,{relative:s});return x.useCallback(p=>{if(Zd(p,r)){p.preventDefault();let m=n!==void 0?n:br(d)===br(u);c(e,{replace:m,state:o,preventScrollReset:i,relative:s,viewTransition:l})}},[d,c,u,n,o,r,e,i,s,l])}function Zt(e){let t=x.useRef(Fn(e)),r=x.useRef(!1),n=wr(),o=x.useMemo(()=>Qd(n.search,r.current?null:t.current),[n.search]),i=Ne(),s=x.useCallback((l,c)=>{const d=Fn(typeof l=="function"?l(o):l);r.current=!0,i("?"+d,c)},[i,o]);return[o,s]}let iu={data:""},su=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||iu},lu=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,cu=/\/\*[^]*?\*\/| +/g,qa=/\n+/g,Ue=(e,t)=>{let r="",n="",o="";for(let i in e){let s=e[i];i[0]=="@"?i[1]=="i"?r=i+" "+s+";":n+=i[1]=="f"?Ue(s,i):i+"{"+Ue(s,i[1]=="k"?"":t)+"}":typeof s=="object"?n+=Ue(s,t?t.replace(/([^,])+/g,l=>i.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,c=>/&/.test(c)?c.replace(/&/g,l):l?l+" "+c:c)):i):s!=null&&(i=/^--/.test(i)?i:i.replace(/[A-Z]/g,"-$&").toLowerCase(),o+=Ue.p?Ue.p(i,s):i+":"+s+";")}return r+(t&&o?t+"{"+o+"}":o)+n},ze={},Ga=e=>{if(typeof e=="object"){let t="";for(let r in e)t+=r+Ga(e[r]);return t}return e},du=(e,t,r,n,o)=>{let i=Ga(e),s=ze[i]||(ze[i]=(c=>{let d=0,u=11;for(;d<c.length;)u=101*u+c.charCodeAt(d++)>>>0;return"go"+u})(i));if(!ze[s]){let c=i!==e?e:(d=>{let u,p,m=[{}];for(;u=lu.exec(d.replace(cu,""));)u[4]?m.shift():u[3]?(p=u[3].replace(qa," ").trim(),m.unshift(m[0][p]=m[0][p]||{})):m[0][u[1]]=u[2].replace(qa," ").trim();return m[0]})(e);ze[s]=Ue(o?{["@keyframes "+s]:c}:c,r?"":"."+s)}let l=r&&ze.g?ze.g:null;return r&&(ze.g=ze[s]),((c,d,u,p)=>{p?d.data=d.data.replace(p,c):d.data.indexOf(c)===-1&&(d.data=u?c+d.data:d.data+c)})(ze[s],t,n,l),s},uu=(e,t,r)=>e.reduce((n,o,i)=>{let s=t[i];if(s&&s.call){let l=s(r),c=l&&l.props&&l.props.className||/^go/.test(l)&&l;s=c?"."+c:l&&typeof l=="object"?l.props?"":Ue(l,""):l===!1?"":l}return n+o+(s??"")},"");function jr(e){let t=this||{},r=e.call?e(t.p):e;return du(r.unshift?r.raw?uu(r,[].slice.call(arguments,1),t.p):r.reduce((n,o)=>Object.assign(n,o&&o.call?o(t.p):o),{}):r,su(t.target),t.g,t.o,t.k)}let Ka,Bn,Un;jr.bind({g:1});let De=jr.bind({k:1});function pu(e,t,r,n){Ue.p=t,Ka=e,Bn=r,Un=n}function He(e,t){let r=this||{};return function(){let n=arguments;function o(i,s){let l=Object.assign({},i),c=l.className||o.className;r.p=Object.assign({theme:Bn&&Bn()},l),r.o=/ *go\d+/.test(c),l.className=jr.apply(r,n)+(c?" "+c:"");let d=e;return e[0]&&(d=l.as||e,delete l.as),Un&&d[0]&&Un(l),Ka(d,l)}return o}}var mu=e=>typeof e=="function",kr=(e,t)=>mu(e)?e(t):e,fu=(()=>{let e=0;return()=>(++e).toString()})(),Ya=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),hu=20,Hn="default",Xa=(e,t)=>{let{toastLimit:r}=e.settings;switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,r)};case 1:return{...e,toasts:e.toasts.map(s=>s.id===t.toast.id?{...s,...t.toast}:s)};case 2:let{toast:n}=t;return Xa(e,{type:e.toasts.find(s=>s.id===n.id)?1:0,toast:n});case 3:let{toastId:o}=t;return{...e,toasts:e.toasts.map(s=>s.id===o||o===void 0?{...s,dismissed:!0,visible:!1}:s)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(s=>s.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let i=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(s=>({...s,pauseDuration:s.pauseDuration+i}))}}},Sr=[],Ja={toasts:[],pausedAt:void 0,settings:{toastLimit:hu}},Ee={},Za=(e,t=Hn)=>{Ee[t]=Xa(Ee[t]||Ja,e),Sr.forEach(([r,n])=>{r===t&&n(Ee[t])})},Qa=e=>Object.keys(Ee).forEach(t=>Za(e,t)),gu=e=>Object.keys(Ee).find(t=>Ee[t].toasts.some(r=>r.id===e)),Cr=(e=Hn)=>t=>{Za(t,e)},xu={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},bu=(e={},t=Hn)=>{let[r,n]=_.useState(Ee[t]||Ja),o=_.useRef(Ee[t]);_.useEffect(()=>(o.current!==Ee[t]&&n(Ee[t]),Sr.push([t,n]),()=>{let s=Sr.findIndex(([l])=>l===t);s>-1&&Sr.splice(s,1)}),[t]);let i=r.toasts.map(s=>{var l,c,d;return{...e,...e[s.type],...s,removeDelay:s.removeDelay||((l=e[s.type])==null?void 0:l.removeDelay)||e?.removeDelay,duration:s.duration||((c=e[s.type])==null?void 0:c.duration)||e?.duration||xu[s.type],style:{...e.style,...(d=e[s.type])==null?void 0:d.style,...s.style}}});return{...r,toasts:i}},_u=(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||fu()}),Qt=e=>(t,r)=>{let n=_u(t,e,r);return Cr(n.toasterId||gu(n.id))({type:2,toast:n}),n.id},ie=(e,t)=>Qt("blank")(e,t);ie.error=Qt("error"),ie.success=Qt("success"),ie.loading=Qt("loading"),ie.custom=Qt("custom"),ie.dismiss=(e,t)=>{let r={type:3,toastId:e};t?Cr(t)(r):Qa(r)},ie.dismissAll=e=>ie.dismiss(void 0,e),ie.remove=(e,t)=>{let r={type:4,toastId:e};t?Cr(t)(r):Qa(r)},ie.removeAll=e=>ie.remove(void 0,e),ie.promise=(e,t,r)=>{let n=ie.loading(t.loading,{...r,...r?.loading});return typeof e=="function"&&(e=e()),e.then(o=>{let i=t.success?kr(t.success,o):void 0;return i?ie.success(i,{id:n,...r,...r?.success}):ie.dismiss(n),o}).catch(o=>{let i=t.error?kr(t.error,o):void 0;i?ie.error(i,{id:n,...r,...r?.error}):ie.dismiss(n)}),e};var vu=1e3,yu=(e,t="default")=>{let{toasts:r,pausedAt:n}=bu(e,t),o=_.useRef(new Map).current,i=_.useCallback((p,m=vu)=>{if(o.has(p))return;let g=setTimeout(()=>{o.delete(p),s({type:4,toastId:p})},m);o.set(p,g)},[]);_.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&&ie.dismiss(g.id);return}return setTimeout(()=>ie.dismiss(g.id,t),b)});return()=>{m.forEach(g=>g&&clearTimeout(g))}},[r,n,t]);let s=_.useCallback(Cr(t),[t]),l=_.useCallback(()=>{s({type:5,time:Date.now()})},[s]),c=_.useCallback((p,m)=>{s({type:1,toast:{id:p,height:m}})},[s]),d=_.useCallback(()=>{n&&s({type:6,time:Date.now()})},[n,s]),u=_.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),y=h.filter((w,j)=>j<v&&w.visible).length;return h.filter(w=>w.visible).slice(...g?[y+1]:[0,y]).reduce((w,j)=>w+(j.height||0)+b,0)},[r]);return _.useEffect(()=>{r.forEach(p=>{if(p.dismissed)i(p.id,p.removeDelay);else{let m=o.get(p.id);m&&(clearTimeout(m),o.delete(p.id))}})},[r,i]),{toasts:r,handlers:{updateHeight:c,startPause:l,endPause:d,calculateOffset:u}}},wu=De` 38 38 from { 39 39 transform: scale(0) rotate(45deg); … … 43 43 transform: scale(1) rotate(45deg); 44 44 opacity: 1; 45 }`, yu=De`45 }`,ju=De` 46 46 from { 47 47 transform: scale(0); … … 51 51 transform: scale(1); 52 52 opacity: 1; 53 }`, wu=De`53 }`,ku=De` 54 54 from { 55 55 transform: scale(0) rotate(90deg); … … 59 59 transform: scale(1) rotate(90deg); 60 60 opacity: 1; 61 }`, ju=He("div")`61 }`,Su=He("div")` 62 62 width: 20px; 63 63 opacity: 0; … … 68 68 transform: rotate(45deg); 69 69 70 animation: ${ vu} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)70 animation: ${wu} 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: ${ yu} 0.15s ease-out forwards;77 animation: ${ju} 0.15s ease-out forwards; 78 78 animation-delay: 150ms; 79 79 position: absolute; … … 88 88 89 89 &:before { 90 animation: ${ wu} 0.15s ease-out forwards;90 animation: ${ku} 0.15s ease-out forwards; 91 91 animation-delay: 180ms; 92 92 transform: rotate(90deg); 93 93 } 94 `, ku=De`94 `,Cu=De` 95 95 from { 96 96 transform: rotate(0deg); … … 99 99 transform: rotate(360deg); 100 100 } 101 `, Su=He("div")`101 `,Nu=He("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: ${ ku} 1s linear infinite;110 `, Cu=De`109 animation: ${Cu} 1s linear infinite; 110 `,Eu=De` 111 111 from { 112 112 transform: scale(0) rotate(45deg); … … 116 116 transform: scale(1) rotate(45deg); 117 117 opacity: 1; 118 }`, Nu=De`118 }`,Tu=De` 119 119 0% { 120 120 height: 0; … … 130 130 opacity: 1; 131 131 height: 10px; 132 }`, Eu=He("div")`132 }`,Au=He("div")` 133 133 width: 20px; 134 134 opacity: 0; … … 139 139 transform: rotate(45deg); 140 140 141 animation: ${ Cu} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)141 animation: ${Eu} 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: ${ Nu} 0.2s ease-out forwards;147 animation: ${Tu} 0.2s ease-out forwards; 148 148 opacity: 0; 149 149 animation-delay: 200ms; … … 157 157 width: 6px; 158 158 } 159 `, Tu=He("div")`159 `,Pu=He("div")` 160 160 position: absolute; 161 `, Au=He("div")`161 `,Ou=He("div")` 162 162 position: relative; 163 163 display: flex; … … 166 166 min-width: 20px; 167 167 min-height: 20px; 168 `, Pu=De`168 `,Ru=De` 169 169 from { 170 170 transform: scale(0.6); … … 174 174 transform: scale(1); 175 175 opacity: 1; 176 }`, Ou=He("div")`176 }`,Lu=He("div")` 177 177 position: relative; 178 178 transform: scale(0.6); 179 179 opacity: 0.4; 180 180 min-width: 20px; 181 animation: ${ Pu} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)181 animation: ${Ru} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275) 182 182 forwards; 183 `, Ru=({toast:e})=>{let{icon:t,type:r,iconTheme:n}=e;return t!==void 0?typeof t=="string"?x.createElement(Ou,null,t):t:r==="blank"?null:x.createElement(Au,null,x.createElement(Su,{...n}),r!=="loading"&&x.createElement(Tu,null,r==="error"?x.createElement(ju,{...n}):x.createElement(Eu,{...n})))},Lu=e=>`183 `,Iu=({toast:e})=>{let{icon:t,type:r,iconTheme:n}=e;return t!==void 0?typeof t=="string"?x.createElement(Lu,null,t):t:r==="blank"?null:x.createElement(Ou,null,x.createElement(Nu,{...n}),r!=="loading"&&x.createElement(Pu,null,r==="error"?x.createElement(Su,{...n}):x.createElement(Au,{...n})))},Mu=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 `, Iu=e=>`186 `,zu=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 `, Mu="0%{opacity:0;} 100%{opacity:1;}",zu="0%{opacity:1;} 100%{opacity:0;}",Du=He("div")`189 `,Du="0%{opacity:0;} 100%{opacity:1;}",$u="0%{opacity:1;} 100%{opacity:0;}",Fu=He("div")` 190 190 display: flex; 191 191 align-items: center; … … 199 199 padding: 8px 10px; 200 200 border-radius: 8px; 201 `, $u=He("div")`201 `,Bu=He("div")` 202 202 display: flex; 203 203 justify-content: center; … … 206 206 flex: 1 1 auto; 207 207 white-space: pre-line; 208 `, Fu=(e,t)=>{let r=e.includes("top")?1:-1,[n,o]=Ya()?[Mu,zu]:[Lu(r),Iu(r)];return{animation:t?`${De(n)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${De(o)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},Bu=x.memo(({toast:e,position:t,style:r,children:n})=>{let o=e.height?Fu(e.position||t||"top-center",e.visible):{opacity:0},i=x.createElement(Ru,{toast:e}),s=x.createElement($u,{...e.ariaProps},kr(e.message,e));return x.createElement(Du,{className:e.className,style:{...o,...r,...e.style}},typeof n=="function"?n({icon:i,message:s}):x.createElement(x.Fragment,null,i,s))});du(x.createElement);var Uu=({id:e,className:t,style:r,onHeightUpdate:n,children:o})=>{let i=x.useCallback(s=>{if(s){let l=()=>{let c=s.getBoundingClientRect().height;n(e,c)};l(),new MutationObserver(l).observe(s,{subtree:!0,childList:!0,characterData:!0})}},[e,n]);return x.createElement("div",{ref:i,className:t,style:r},o)},Hu=(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:Ya()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(r?1:-1)}px)`,...n,...o}},Vu=jr`208 `,Uu=(e,t)=>{let r=e.includes("top")?1:-1,[n,o]=Ya()?[Du,$u]:[Mu(r),zu(r)];return{animation:t?`${De(n)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${De(o)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},Hu=x.memo(({toast:e,position:t,style:r,children:n})=>{let o=e.height?Uu(e.position||t||"top-center",e.visible):{opacity:0},i=x.createElement(Iu,{toast:e}),s=x.createElement(Bu,{...e.ariaProps},kr(e.message,e));return x.createElement(Fu,{className:e.className,style:{...o,...r,...e.style}},typeof n=="function"?n({icon:i,message:s}):x.createElement(x.Fragment,null,i,s))});pu(x.createElement);var Vu=({id:e,className:t,style:r,onHeightUpdate:n,children:o})=>{let i=x.useCallback(s=>{if(s){let l=()=>{let c=s.getBoundingClientRect().height;n(e,c)};l(),new MutationObserver(l).observe(s,{subtree:!0,childList:!0,characterData:!0})}},[e,n]);return x.createElement("div",{ref:i,className:t,style:r},o)},Wu=(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:Ya()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(r?1:-1)}px)`,...n,...o}},qu=jr` 209 209 z-index: 9999; 210 210 > * { 211 211 pointer-events: auto; 212 212 } 213 `,Nr=16, Wu=({reverseOrder:e,position:t="top-center",toastOptions:r,gutter:n,children:o,toasterId:i,containerStyle:s,containerClassName:l})=>{let{toasts:c,handlers:d}=_u(r,i);return x.createElement("div",{"data-rht-toaster":i||"",style:{position:"fixed",zIndex:9999,top:Nr,left:Nr,right:Nr,bottom:Nr,pointerEvents:"none",...s},className:l,onMouseEnter:d.startPause,onMouseLeave:d.endPause},c.map(u=>{let p=u.position||t,m=d.calculateOffset(u,{reverseOrder:e,gutter:n,defaultPosition:t}),g=Hu(p,m);return x.createElement(Uu,{id:u.id,key:u.id,onHeightUpdate:d.updateHeight,className:u.visible?Vu:"",style:g},u.type==="custom"?kr(u.message,u):o?o(u):x.createElement(Bu,{toast:u,position:p}))}))},G=ie;const ei={carousel:"carousel",grid:"grid"},qu=["marquee","stacked"],ot={topBottomSpacing:0,gap:16,gapOnTab:16,gapOnMobile:16,shape:"rectangle",size:200,sizeOnTab:150,sizeOnMobile:150,hoverEffect:"none",border:{border_width:2,border_color:"#9ca3af",border_radius:6},shadow:{shadow_size:16},template:ei.carousel,appearance:"overlay",widgetTitle:{alignment:"hidden",fontSize:24,color:"#000000"},playerAppearance:"overlay"},X={settings:"settings",stat:"statistics",cr:"create-reel",mg:"manage-group",ag:"all-groups",ar:"all-reels"},Gu=[{label:"None",value:"none"},{label:"zoom in",value:"zoom-in"},{label:"zoom out",value:"zoom-out"}],ti=[{label:"Horizontal",value:"horizontal"}],Ku=[{label:"Vertical",value:"vertical"}],Yu=[{label:"Overlay",value:"overlay"},{label:"Only Title",value:"title"},{label:"None",value:"none"}],Xu=[{label:"Modern",value:"modern"},{label:"Classic",value:"classic"}],Ju=[{label:"Overlay",value:"overlay"},{label:"Only Tile",value:"title"},{label:"None",value:"none"}];var ri={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},ni=_.createContext&&_.createContext(ri),Zu=["attr","size","title"];function Qu(e,t){if(e==null)return{};var r=ep(e,t),n,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function ep(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 oi(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 Tr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?oi(Object(r),!0).forEach(function(n){tp(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):oi(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function tp(e,t,r){return t=rp(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function rp(e){var t=np(e,"string");return typeof t=="symbol"?t:t+""}function np(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 ai(e){return e&&e.map((t,r)=>_.createElement(t.tag,Tr({key:r},t.attr),ai(t.child)))}function V(e){return t=>_.createElement(op,Er({attr:Tr({},e.attr)},t),ai(e.child))}function op(e){var t=r=>{var{attr:n,size:o,title:i}=e,s=Qu(e,Zu),l=o||r.size||"1em",c;return r.className&&(c=r.className),e.className&&(c=(c?c+" ":"")+e.className),_.createElement("svg",Er({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,n,s,{className:c,style:Tr(Tr({color:e.color||r.color},r.style),e.style),height:l,width:l,xmlns:"http://www.w3.org/2000/svg"}),i&&_.createElement("title",null,i),e.children)};return ni!==void 0?_.createElement(ni.Consumer,null,r=>t(r)):t(ri)}function ap(e){return V({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M164.44,105.34l-48-32A8,8,0,0,0,104,80v64a8,8,0,0,0,12.44,6.66l48-32a8,8,0,0,0,0-13.32ZM120,129.05V95l25.58,17ZM216,40H40A16,16,0,0,0,24,56V168a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,128H40V56H216V168Zm16,40a8,8,0,0,1-8,8H32a8,8,0,0,1,0-16H224A8,8,0,0,1,232,208Z"},child:[]}]})(e)}function at(e){return V({attr:{version:"1.2",baseProfile:"tiny",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M17 10h-1v-2c0-2.205-1.794-4-4-4s-4 1.795-4 4v2h-1c-1.103 0-2 .896-2 2v7c0 1.104.897 2 2 2h10c1.103 0 2-.896 2-2v-7c0-1.104-.897-2-2-2zm-5 8.299c-.719 0-1.3-.58-1.3-1.299s.581-1.301 1.3-1.301 1.3.582 1.3 1.301-.581 1.299-1.3 1.299zm2-7.299h-4v-3c0-1.104.897-2 2-2s2 .896 2 2v3z"},child:[]}]})(e)}function yt(e){return V({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 Vn(e){return V({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 Wn(e){return V({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 ip(e){return V({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 sp(e){return V({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 lp(e){return V({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"},child:[]},{tag:"path",attr:{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"},child:[]}]})(e)}function it(e){return V({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 cp(e){return V({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 ii(e){return V({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 dp(e){return V({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 up(e){return V({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"},child:[]},{tag:"polyline",attr:{points:"17 8 12 3 7 8"},child:[]},{tag:"line",attr:{x1:"12",x2:"12",y1:"3",y2:"15"},child:[]}]})(e)}function qn(e){return V({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 Gn(e){return V({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 pp(e){return V({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 mp(e){return V({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 fp(e){return V({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 hp(e){return V({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 si(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Kn(...e){return t=>{let r=!1;const n=e.map(o=>{const i=si(o,t);return!r&&typeof i=="function"&&(r=!0),i});if(r)return()=>{for(let o=0;o<n.length;o++){const i=n[o];typeof i=="function"?i():si(e[o],null)}}}}function J(...e){return x.useCallback(Kn(...e),e)}function st(e){const t=xp(e),r=x.forwardRef((n,o)=>{const{children:i,...s}=n,l=x.Children.toArray(i),c=l.find(_p);if(c){const d=c.props.children,u=l.map(p=>p===c?x.Children.count(d)>1?x.Children.only(null):x.isValidElement(d)?d.props.children:null:p);return a.jsx(t,{...s,ref:o,children:x.isValidElement(d)?x.cloneElement(d,void 0,u):null})}return a.jsx(t,{...s,ref:o,children:i})});return r.displayName=`${e}.Slot`,r}var gp=st("Slot");function xp(e){const t=x.forwardRef((r,n)=>{const{children:o,...i}=r;if(x.isValidElement(o)){const s=yp(o),l=vp(i,o.props);return o.type!==x.Fragment&&(l.ref=n?Kn(n,s):s),x.cloneElement(o,l)}return x.Children.count(o)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var bp=Symbol("radix.slottable");function _p(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===bp}function vp(e,t){const r={...t};for(const n in t){const o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...l)=>{const c=i(...l);return o(...l),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}function yp(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 li(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=li(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function jp(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=li(e))&&(n&&(n+=" "),n+=t);return n}function $(...e){return jp(e)}const kp="ecr-button",Sp={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"},Cp={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 ne({className:e,variant:t="default",size:r="default",asChild:n=!1,...o}){const i=n?gp:"button";return a.jsx(i,{"data-slot":"button","data-variant":t,"data-size":r,className:$(kp,Sp[t],Cp[r],e),...o})}function Np({selectedReelIds:e,handleSelectAll:t,clearSelection:r,searchTerm:n,setSearchTerm:o,isCreating:i,handleCreateGroup:s,handleBulkDelete:l}){return a.jsxs("div",{className:"ecr-admin-reels-header",children:[a.jsxs("div",{className:"ecr-admin-reels-header__left",children:[a.jsx("h2",{className:"ecr-admin-reels-header__title",children:"Reels"}),e.length?a.jsxs("div",{className:"ecr-admin-reels-header__actions",children:[a.jsx(ne,{onClick:t,variant:"link",className:"ecr-admin-reels-header__action ecr-admin-reels-header__action--primary",children:"Select all"}),a.jsx(ne,{onClick:r,variant:"link",className:"ecr-admin-reels-header__action ecr-admin-reels-header__action--danger",children:"Clear"}),a.jsxs(ne,{variant:"outline-danger",size:"sm",onClick:l,children:[a.jsx(Gn,{size:22,className:"ecr-admin-reel-card__icon ecr-admin-reel-card__icon--danger"}),"Delete Selected"]})]}):null]}),a.jsxs("div",{className:"ecr-admin-reels-header__right",children:[a.jsxs("div",{className:"ecr-admin-reels-header__search",children:[a.jsx("input",{type:"text",placeholder:"Search reels...",value:n,onChange:c=>o(c.target.value),className:"ecr-admin-search-input"}),a.jsxs("div",{className:"ecr-admin-reels-header__icon-wrapper",children:[n&&a.jsx(ne,{onClick:()=>o(""),variant:"link",size:"icon-sm",children:a.jsx(qn,{size:16,className:"ecr-admin-reels-header__clear-icon"})}),a.jsx(ii,{size:16,className:"ecr-admin-reels-header__search-icon"})]})," "]}),e.length?a.jsxs(ne,{disabled:i,onClick:s,className:"ecr-admin-reels-header__create",children:[i?a.jsx(it,{className:"ecr-admin-reels-header__spinner"}):a.jsx(yt,{})," ","Create Widget"]}):null]})]})}function Ep(e){return V({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 Tp(e){return V({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M262.29 192.31a64 64 0 1 0 57.4 57.4 64.13 64.13 0 0 0-57.4-57.4zM416.39 256a154.34 154.34 0 0 1-1.53 20.79l45.21 35.46a10.81 10.81 0 0 1 2.45 13.75l-42.77 74a10.81 10.81 0 0 1-13.14 4.59l-44.9-18.08a16.11 16.11 0 0 0-15.17 1.75A164.48 164.48 0 0 1 325 400.8a15.94 15.94 0 0 0-8.82 12.14l-6.73 47.89a11.08 11.08 0 0 1-10.68 9.17h-85.54a11.11 11.11 0 0 1-10.69-8.87l-6.72-47.82a16.07 16.07 0 0 0-9-12.22 155.3 155.3 0 0 1-21.46-12.57 16 16 0 0 0-15.11-1.71l-44.89 18.07a10.81 10.81 0 0 1-13.14-4.58l-42.77-74a10.8 10.8 0 0 1 2.45-13.75l38.21-30a16.05 16.05 0 0 0 6-14.08c-.36-4.17-.58-8.33-.58-12.5s.21-8.27.58-12.35a16 16 0 0 0-6.07-13.94l-38.19-30A10.81 10.81 0 0 1 49.48 186l42.77-74a10.81 10.81 0 0 1 13.14-4.59l44.9 18.08a16.11 16.11 0 0 0 15.17-1.75A164.48 164.48 0 0 1 187 111.2a15.94 15.94 0 0 0 8.82-12.14l6.73-47.89A11.08 11.08 0 0 1 213.23 42h85.54a11.11 11.11 0 0 1 10.69 8.87l6.72 47.82a16.07 16.07 0 0 0 9 12.22 155.3 155.3 0 0 1 21.46 12.57 16 16 0 0 0 15.11 1.71l44.89-18.07a10.81 10.81 0 0 1 13.14 4.58l42.77 74a10.8 10.8 0 0 1-2.45 13.75l-38.21 30a16.05 16.05 0 0 0-6.05 14.08c.33 4.14.55 8.3.55 12.47z"},child:[]}]})(e)}function lt(e){return V({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 Ap(){return a.jsx("div",{className:"ecr-admin-reels-empty",children:a.jsxs("p",{className:"ecr-admin-reels-empty__text",children:[a.jsx(lt,{color:"#FFA500",size:40}),a.jsx("span",{children:"You did not have any reel yet."})]})})}function Pp({isFullScreen:e}){return a.jsx("div",{className:$("ecr-admin-reels-loading",e&&"ecr-admin-reels-loading--fullscreen"),children:a.jsx(it,{className:"ecr-admin-reels-loading__icon"})})}const ci=({playingStory:e,duration:t,currentFileIndex:r,isPaused:n})=>a.jsx("div",{className:"ecr-player__progress",children:e?.files?.map((o,i)=>a.jsx("div",{className:"ecr-player__progress-track",children:a.jsx("div",{style:{"--reels-wp-animation-time":`${t}s`,animationPlayState:n?"paused":"running"},className:$("ecr-player__progress-fill",i===r?.index?"ecr-player__progress-fill--active":i<r?.index?"ecr-player__progress-fill--complete":"ecr-player__progress-fill--empty")})},i))}),wt=({className:e,children:t,...r})=>a.jsx("button",{className:$("ecr-player__nav",e),...r,children:t});/**214 * @license lucide-react v0.552.0 - ISC 215 * 216 * This source code is licensed under the ISC license. 217 * See the LICENSE file in the root directory of this source tree. 218 */const Op=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Rp=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,n)=>n?n.toUpperCase():r.toLowerCase()),di=e=>{const t=Rp(e);return t.charAt(0).toUpperCase()+t.slice(1)},ui=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim(),Lp=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**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 */var Ip={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"};/**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 */const Mp=_.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:o="",children:i,iconNode:s,...l},c)=>_.createElement("svg",{ref:c,...Ip,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:ui("lucide",o),...!i&&!Lp(l)&&{"aria-hidden":"true"},...l},[...s.map(([d,u])=>_.createElement(d,u)),...Array.isArray(i)?i:[i]]));/**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 Q=(e,t)=>{const r=_.forwardRef(({className:n,...o},i)=>_.createElement( Mp,{ref:i,iconNode:t,className:ui(`lucide-${Op(di(e))}`,`lucide-${e}`,n),...o}));return r.displayName=di(e),r};/**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 zp=Q("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**213 `,Nr=16,Gu=({reverseOrder:e,position:t="top-center",toastOptions:r,gutter:n,children:o,toasterId:i,containerStyle:s,containerClassName:l})=>{let{toasts:c,handlers:d}=yu(r,i);return x.createElement("div",{"data-rht-toaster":i||"",style:{position:"fixed",zIndex:9999,top:Nr,left:Nr,right:Nr,bottom:Nr,pointerEvents:"none",...s},className:l,onMouseEnter:d.startPause,onMouseLeave:d.endPause},c.map(u=>{let p=u.position||t,m=d.calculateOffset(u,{reverseOrder:e,gutter:n,defaultPosition:t}),g=Wu(p,m);return x.createElement(Vu,{id:u.id,key:u.id,onHeightUpdate:d.updateHeight,className:u.visible?qu:"",style:g},u.type==="custom"?kr(u.message,u):o?o(u):x.createElement(Hu,{toast:u,position:p}))}))},G=ie;const ei={carousel:"carousel",grid:"grid"},Ku=["marquee","stacked"],ot={topBottomSpacing:0,gap:16,gapOnTab:16,gapOnMobile:16,shape:"rectangle",size:200,sizeOnTab:150,sizeOnMobile:150,hoverEffect:"none",border:{border_width:2,border_color:"#9ca3af",border_radius:6},shadow:{shadow_size:16},template:ei.carousel,appearance:"overlay",widgetTitle:{alignment:"hidden",fontSize:24,color:"#000000"},playerAppearance:"overlay"},X={settings:"settings",stat:"statistics",cr:"create-reel",mg:"manage-group",ag:"all-groups",ar:"all-reels"},Yu=[{label:"None",value:"none"},{label:"zoom in",value:"zoom-in"},{label:"zoom out",value:"zoom-out"}],ti=[{label:"Horizontal",value:"horizontal"}],Xu=[{label:"Vertical",value:"vertical"}],Ju=[{label:"Overlay",value:"overlay"},{label:"Only Title",value:"title"},{label:"None",value:"none"}],Zu=[{label:"Modern",value:"modern"},{label:"Classic",value:"classic"}],Qu=[{label:"Overlay",value:"overlay"},{label:"Only Tile",value:"title"},{label:"None",value:"none"}];var ri={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},ni=_.createContext&&_.createContext(ri),ep=["attr","size","title"];function tp(e,t){if(e==null)return{};var r=rp(e,t),n,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function rp(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 oi(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 Tr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?oi(Object(r),!0).forEach(function(n){np(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):oi(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function np(e,t,r){return t=op(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function op(e){var t=ap(e,"string");return typeof t=="symbol"?t:t+""}function ap(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 ai(e){return e&&e.map((t,r)=>_.createElement(t.tag,Tr({key:r},t.attr),ai(t.child)))}function V(e){return t=>_.createElement(ip,Er({attr:Tr({},e.attr)},t),ai(e.child))}function ip(e){var t=r=>{var{attr:n,size:o,title:i}=e,s=tp(e,ep),l=o||r.size||"1em",c;return r.className&&(c=r.className),e.className&&(c=(c?c+" ":"")+e.className),_.createElement("svg",Er({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,n,s,{className:c,style:Tr(Tr({color:e.color||r.color},r.style),e.style),height:l,width:l,xmlns:"http://www.w3.org/2000/svg"}),i&&_.createElement("title",null,i),e.children)};return ni!==void 0?_.createElement(ni.Consumer,null,r=>t(r)):t(ri)}function sp(e){return V({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M164.44,105.34l-48-32A8,8,0,0,0,104,80v64a8,8,0,0,0,12.44,6.66l48-32a8,8,0,0,0,0-13.32ZM120,129.05V95l25.58,17ZM216,40H40A16,16,0,0,0,24,56V168a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,128H40V56H216V168Zm16,40a8,8,0,0,1-8,8H32a8,8,0,0,1,0-16H224A8,8,0,0,1,232,208Z"},child:[]}]})(e)}function at(e){return V({attr:{version:"1.2",baseProfile:"tiny",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M17 10h-1v-2c0-2.205-1.794-4-4-4s-4 1.795-4 4v2h-1c-1.103 0-2 .896-2 2v7c0 1.104.897 2 2 2h10c1.103 0 2-.896 2-2v-7c0-1.104-.897-2-2-2zm-5 8.299c-.719 0-1.3-.58-1.3-1.299s.581-1.301 1.3-1.301 1.3.582 1.3 1.301-.581 1.299-1.3 1.299zm2-7.299h-4v-3c0-1.104.897-2 2-2s2 .896 2 2v3z"},child:[]}]})(e)}function yt(e){return V({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 Vn(e){return V({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 Wn(e){return V({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 lp(e){return V({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 cp(e){return V({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 dp(e){return V({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"},child:[]},{tag:"path",attr:{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"},child:[]}]})(e)}function it(e){return V({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 up(e){return V({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 ii(e){return V({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 pp(e){return V({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 mp(e){return V({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"},child:[]},{tag:"polyline",attr:{points:"17 8 12 3 7 8"},child:[]},{tag:"line",attr:{x1:"12",x2:"12",y1:"3",y2:"15"},child:[]}]})(e)}function qn(e){return V({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 Gn(e){return V({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 fp(e){return V({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 V({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 gp(e){return V({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 xp(e){return V({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 si(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Kn(...e){return t=>{let r=!1;const n=e.map(o=>{const i=si(o,t);return!r&&typeof i=="function"&&(r=!0),i});if(r)return()=>{for(let o=0;o<n.length;o++){const i=n[o];typeof i=="function"?i():si(e[o],null)}}}}function J(...e){return x.useCallback(Kn(...e),e)}function st(e){const t=_p(e),r=x.forwardRef((n,o)=>{const{children:i,...s}=n,l=x.Children.toArray(i),c=l.find(yp);if(c){const d=c.props.children,u=l.map(p=>p===c?x.Children.count(d)>1?x.Children.only(null):x.isValidElement(d)?d.props.children:null:p);return a.jsx(t,{...s,ref:o,children:x.isValidElement(d)?x.cloneElement(d,void 0,u):null})}return a.jsx(t,{...s,ref:o,children:i})});return r.displayName=`${e}.Slot`,r}var bp=st("Slot");function _p(e){const t=x.forwardRef((r,n)=>{const{children:o,...i}=r;if(x.isValidElement(o)){const s=kp(o),l=jp(i,o.props);return o.type!==x.Fragment&&(l.ref=n?Kn(n,s):s),x.cloneElement(o,l)}return x.Children.count(o)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var vp=Symbol("radix.slottable");function yp(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===vp}function jp(e,t){const r={...t};for(const n in t){const o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...l)=>{const c=i(...l);return o(...l),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}function kp(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 li(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=li(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Sp(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=li(e))&&(n&&(n+=" "),n+=t);return n}function $(...e){return Sp(e)}const Cp="ecr-button",Np={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"},Ep={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 ne({className:e,variant:t="default",size:r="default",asChild:n=!1,...o}){const i=n?bp:"button";return a.jsx(i,{"data-slot":"button","data-variant":t,"data-size":r,className:$(Cp,Np[t],Ep[r],e),...o})}function Tp({selectedReelIds:e,handleSelectAll:t,clearSelection:r,searchTerm:n,setSearchTerm:o,isCreating:i,handleCreateGroup:s,handleBulkDelete:l}){return a.jsxs("div",{className:"ecr-admin-reels-header",children:[a.jsxs("div",{className:"ecr-admin-reels-header__left",children:[a.jsx("h2",{className:"ecr-admin-reels-header__title",children:"Reels"}),e.length?a.jsxs("div",{className:"ecr-admin-reels-header__actions",children:[a.jsx(ne,{onClick:t,variant:"link",className:"ecr-admin-reels-header__action ecr-admin-reels-header__action--primary",children:"Select all"}),a.jsx(ne,{onClick:r,variant:"link",className:"ecr-admin-reels-header__action ecr-admin-reels-header__action--danger",children:"Clear"}),a.jsxs(ne,{variant:"outline-danger",size:"sm",onClick:l,children:[a.jsx(Gn,{size:22,className:"ecr-admin-reel-card__icon ecr-admin-reel-card__icon--danger"}),"Delete Selected"]})]}):null]}),a.jsxs("div",{className:"ecr-admin-reels-header__right",children:[a.jsxs("div",{className:"ecr-admin-reels-header__search",children:[a.jsx("input",{type:"text",placeholder:"Search reels...",value:n,onChange:c=>o(c.target.value),className:"ecr-admin-search-input"}),a.jsxs("div",{className:"ecr-admin-reels-header__icon-wrapper",children:[n&&a.jsx(ne,{onClick:()=>o(""),variant:"link",size:"icon-sm",children:a.jsx(qn,{size:16,className:"ecr-admin-reels-header__clear-icon"})}),a.jsx(ii,{size:16,className:"ecr-admin-reels-header__search-icon"})]})," "]}),e.length?a.jsxs(ne,{disabled:i,onClick:s,className:"ecr-admin-reels-header__create",children:[i?a.jsx(it,{className:"ecr-admin-reels-header__spinner"}):a.jsx(yt,{})," ","Create Widget"]}):null]})]})}function Ap(e){return V({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 Pp(e){return V({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M262.29 192.31a64 64 0 1 0 57.4 57.4 64.13 64.13 0 0 0-57.4-57.4zM416.39 256a154.34 154.34 0 0 1-1.53 20.79l45.21 35.46a10.81 10.81 0 0 1 2.45 13.75l-42.77 74a10.81 10.81 0 0 1-13.14 4.59l-44.9-18.08a16.11 16.11 0 0 0-15.17 1.75A164.48 164.48 0 0 1 325 400.8a15.94 15.94 0 0 0-8.82 12.14l-6.73 47.89a11.08 11.08 0 0 1-10.68 9.17h-85.54a11.11 11.11 0 0 1-10.69-8.87l-6.72-47.82a16.07 16.07 0 0 0-9-12.22 155.3 155.3 0 0 1-21.46-12.57 16 16 0 0 0-15.11-1.71l-44.89 18.07a10.81 10.81 0 0 1-13.14-4.58l-42.77-74a10.8 10.8 0 0 1 2.45-13.75l38.21-30a16.05 16.05 0 0 0 6-14.08c-.36-4.17-.58-8.33-.58-12.5s.21-8.27.58-12.35a16 16 0 0 0-6.07-13.94l-38.19-30A10.81 10.81 0 0 1 49.48 186l42.77-74a10.81 10.81 0 0 1 13.14-4.59l44.9 18.08a16.11 16.11 0 0 0 15.17-1.75A164.48 164.48 0 0 1 187 111.2a15.94 15.94 0 0 0 8.82-12.14l6.73-47.89A11.08 11.08 0 0 1 213.23 42h85.54a11.11 11.11 0 0 1 10.69 8.87l6.72 47.82a16.07 16.07 0 0 0 9 12.22 155.3 155.3 0 0 1 21.46 12.57 16 16 0 0 0 15.11 1.71l44.89-18.07a10.81 10.81 0 0 1 13.14 4.58l42.77 74a10.8 10.8 0 0 1-2.45 13.75l-38.21 30a16.05 16.05 0 0 0-6.05 14.08c.33 4.14.55 8.3.55 12.47z"},child:[]}]})(e)}function lt(e){return V({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 Op(){return a.jsx("div",{className:"ecr-admin-reels-empty",children:a.jsxs("p",{className:"ecr-admin-reels-empty__text",children:[a.jsx(lt,{color:"#FFA500",size:40}),a.jsx("span",{children:"You did not have any reel yet."})]})})}function Rp({isFullScreen:e}){return a.jsx("div",{className:$("ecr-admin-reels-loading",e&&"ecr-admin-reels-loading--fullscreen"),children:a.jsx(it,{className:"ecr-admin-reels-loading__icon"})})}const ci=({playingStory:e,duration:t,currentFileIndex:r,isPaused:n})=>a.jsx("div",{className:"ecr-player__progress",children:e?.files?.map((o,i)=>a.jsx("div",{className:"ecr-player__progress-track",children:a.jsx("div",{style:{"--reels-wp-animation-time":`${t}s`,animationPlayState:n?"paused":"running"},className:$("ecr-player__progress-fill",i===r?.index?"ecr-player__progress-fill--active":i<r?.index?"ecr-player__progress-fill--complete":"ecr-player__progress-fill--empty")})},i))}),wt=({className:e,children:t,...r})=>a.jsx("button",{className:$("ecr-player__nav",e),...r,children:t});/** 214 * @license lucide-react v0.552.0 - ISC 215 * 216 * This source code is licensed under the ISC license. 217 * See the LICENSE file in the root directory of this source tree. 218 */const Lp=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Ip=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,n)=>n?n.toUpperCase():r.toLowerCase()),di=e=>{const t=Ip(e);return t.charAt(0).toUpperCase()+t.slice(1)},ui=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim(),Mp=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/** 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 */var zp={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"};/** 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 */const Dp=_.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:o="",children:i,iconNode:s,...l},c)=>_.createElement("svg",{ref:c,...zp,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:ui("lucide",o),...!i&&!Mp(l)&&{"aria-hidden":"true"},...l},[...s.map(([d,u])=>_.createElement(d,u)),...Array.isArray(i)?i:[i]]));/** 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 Q=(e,t)=>{const r=_.forwardRef(({className:n,...o},i)=>_.createElement(Dp,{ref:i,iconNode:t,className:ui(`lucide-${Lp(di(e))}`,`lucide-${e}`,n),...o}));return r.displayName=di(e),r};/** 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 $p=Q("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** 239 239 * @license lucide-react v0.552.0 - ISC 240 240 * … … 256 256 * This source code is licensed under the ISC license. 257 257 * See the LICENSE file in the root directory of this source tree. 258 */const Dp=Q("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**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 $p=Q("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"}]]);/**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 Fp=Q("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"}]]);/**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 Bp=Q("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"}]]);/**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 Up=Q("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"}]]);/**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 Hp=Q("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**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 Vp=Q("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"}]]);/**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 Wp=Q("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"}]]);/**258 */const Fp=Q("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** 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 Bp=Q("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"}]]);/** 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 Up=Q("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"}]]);/** 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 Hp=Q("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"}]]);/** 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 Vp=Q("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"}]]);/** 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 Wp=Q("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** 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 qp=Q("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"}]]);/** 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 Gp=Q("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"}]]);/** 294 294 * @license lucide-react v0.552.0 - ISC 295 295 * … … 306 306 * This source code is licensed under the ISC license. 307 307 * See the LICENSE file in the root directory of this source tree. 308 */const qp=Q("smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);/**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 Gp=Q("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"}]]);/**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 Kp=Q("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**319 * @license lucide-react v0.552.0 - ISC 320 * 321 * This source code is licensed under the ISC license. 322 * See the LICENSE file in the root directory of this source tree. 323 */const Yp=Q("tablet",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["line",{x1:"12",x2:"12.01",y1:"18",y2:"18",key:"1dp563"}]]);/**324 * @license lucide-react v0.552.0 - ISC 325 * 326 * This source code is licensed under the ISC license. 327 * See the LICENSE file in the root directory of this source tree. 328 */const Xp=Q("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"}]]);/**329 * @license lucide-react v0.552.0 - ISC 330 * 331 * This source code is licensed under the ISC license. 332 * See the LICENSE file in the root directory of this source tree. 333 */const Jp=Q("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"}]]);/**334 * @license lucide-react v0.552.0 - ISC 335 * 336 * This source code is licensed under the ISC license. 337 * See the LICENSE file in the root directory of this source tree. 338 */const Zp=Q("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**308 */const Kp=Q("smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);/** 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 Yp=Q("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"}]]);/** 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 Xp=Q("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/** 319 * @license lucide-react v0.552.0 - ISC 320 * 321 * This source code is licensed under the ISC license. 322 * See the LICENSE file in the root directory of this source tree. 323 */const Jp=Q("tablet",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["line",{x1:"12",x2:"12.01",y1:"18",y2:"18",key:"1dp563"}]]);/** 324 * @license lucide-react v0.552.0 - ISC 325 * 326 * This source code is licensed under the ISC license. 327 * See the LICENSE file in the root directory of this source tree. 328 */const Zp=Q("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"}]]);/** 329 * @license lucide-react v0.552.0 - ISC 330 * 331 * This source code is licensed under the ISC license. 332 * See the LICENSE file in the root directory of this source tree. 333 */const Qp=Q("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"}]]);/** 334 * @license lucide-react v0.552.0 - ISC 335 * 336 * This source code is licensed under the ISC license. 337 * See the LICENSE file in the root directory of this source tree. 338 */const em=Q("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** 339 339 * @license lucide-react v0.552.0 - ISC 340 340 * … … 351 351 * This source code is licensed under the ISC license. 352 352 * See the LICENSE file in the root directory of this source tree. 353 */const er=Q("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]), Qp="Left",em="Right",tm="Up",rm="Down",jt={delta:10,preventScrollOnSwipe:!1,rotationAngle:0,trackMouse:!1,trackTouch:!0,swipeDuration:1/0,touchEventOptions:{passive:!0}},eo={first:!0,initial:[0,0],start:0,swiping:!1,xy:[0,0]},fi="mousemove",hi="mouseup",nm="touchend",om="touchmove",am="touchstart";function im(e,t,r,n){return e>t?r>0?em:Qp:n>0?rm:tm}function gi(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 sm(e,t){const r=u=>{const p="touches"in u;p&&u.touches.length>1||e((m,g)=>{g.trackMouse&&!p&&(document.addEventListener(fi,n),document.addEventListener(hi,s));const{clientX:b,clientY:f}=p?u.touches[0]:u,h=gi([b,f],g.rotationAngle);return g.onTouchStartOrOnMouseDown&&g.onTouchStartOrOnMouseDown({event:u}),Object.assign(Object.assign(Object.assign({},m),eo),{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]=gi([b,f],m.rotationAngle),y=h-p.xy[0],w=v-p.xy[1],j=Math.abs(y),C=Math.abs(w),N=(u.timeStamp||0)-p.start,S=Math.sqrt(j*j+C*C)/(N||1),E=[y/(N||1),w/(N||1)],T=im(j,C,y,w),A=typeof m.delta=="number"?m.delta:m.delta[T.toLowerCase()]||jt.delta;if(j<A&&C<A&&!p.swiping)return p;const R={absX:j,absY:C,deltaX:y,deltaY:w,dir:T,event:u,first:p.first,initial:p.initial,velocity:S,vxvy:E};R.first&&m.onSwipeStart&&m.onSwipeStart(R),m.onSwiping&&m.onSwiping(R);let L=!1;return(m.onSwiping||m.onSwiped||m[`onSwiped${T}`])&&(L=!0),L&&m.preventScrollOnSwipe&&m.trackTouch&&u.cancelable&&u.preventDefault(),Object.assign(Object.assign({},p),{first:!1,eventData:R,swiping:!0})})},o=u=>{e((p,m)=>{let g;if(p.swiping&&p.eventData){if(u.timeStamp-p.start<m.swipeDuration){g=Object.assign(Object.assign({},p.eventData),{event:u}),m.onSwiped&&m.onSwiped(g);const b=m[`onSwiped${g.dir}`];b&&b(g)}}else m.onTap&&m.onTap({event:u});return m.onTouchEndOrOnMouseUp&&m.onTouchEndOrOnMouseUp({event:u}),Object.assign(Object.assign(Object.assign({},p),eo),{eventData:g})})},i=()=>{document.removeEventListener(fi,n),document.removeEventListener(hi,s)},s=u=>{i(),o(u)},l=(u,p)=>{let m=()=>{};if(u&&u.addEventListener){const g=Object.assign(Object.assign({},jt.touchEventOptions),p.touchEventOptions),b=[[am,r,g],[om,n,Object.assign(Object.assign({},g),p.preventScrollOnSwipe?{passive:!1}:{})],[nm,o,g]];b.forEach(([f,h,v])=>u.addEventListener(f,h,v)),m=()=>b.forEach(([f,h])=>u.removeEventListener(f,h))}return m},d={ref:u=>{u!==null&&e((p,m)=>{if(p.el===u)return p;const g={};return p.el&&p.el!==u&&p.cleanUpTouch&&(p.cleanUpTouch(),g.cleanUpTouch=void 0),m.trackTouch&&u&&(g.cleanUpTouch=l(u,m)),Object.assign(Object.assign(Object.assign({},p),{el:u}),g)})}};return t.trackMouse&&(d.onMouseDown=r),[d,l]}function lm(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 cm(e){const{trackMouse:t}=e,r=x.useRef(Object.assign({},eo)),n=x.useRef(Object.assign({},jt)),o=x.useRef(Object.assign({},n.current));o.current=Object.assign({},n.current),n.current=Object.assign(Object.assign({},jt),e);let i;for(i in jt)n.current[i]===void 0&&(n.current[i]=jt[i]);const[s,l]=x.useMemo(()=>sm(c=>r.current=c(r.current,n.current),{trackMouse:t}),[t]);return r.current=lm(r.current,n.current,o.current,l),s}const Ar=e=>{const[t,r]=_.useState(()=>typeof window>"u"?!1:window.matchMedia(e).matches);return _.useEffect(()=>{if(typeof window>"u")return;const n=window.matchMedia(e),o=i=>{r(i.matches)};return n.addEventListener("change",o),()=>n.removeEventListener("change",o)},[e]),t},dm=({videoRefs:e,file:t,isMuted:r,isPaused:n,i:o,togglePlayPause:i,handleNextFile:s,setDuration:l})=>{const[c,d]=_.useState(!1);return a.jsx("div",{className:"ecr-player__media-frame",children:a.jsx("video",{preload:"metadata",playsInline:!0,"webkit-playsinline":"true",muted:r,autoPlay:!n,controls:!1,loop:!1,"aria-label":"Reel video",disablePictureInPicture:!0,controlsList:"nodownload noplaybackrate noremoteplayback",ref:u=>{u&&(e.current[o]=u,u.setAttribute("webkit-playsinline","true"),u.setAttribute("x-webkit-airplay","allow"),u.setAttribute("airplay","allow"))},className:c?"ecr-player__media ecr-player__media--portrait":"ecr-player__media",src:t?.url,onClick:()=>i(o),onEnded:s,onError:s,onLoadedMetadata:u=>{const p=u.currentTarget,m=p.videoWidth,g=p.videoHeight;d(g>m),l(p.duration)}})})},xi=({currentFileIndex:e,files:t,setDuration:r,setIsPlaying:n,setPreviewReel:o,isPaused:i,setIsPaused:s,isMuted:l,setIsMuted:c,handlePrevFile:d,handleNextFile:u})=>{const p=Ar("(min-width: 1024px)"),[m,g]=_.useState(l??!1),b=typeof l=="boolean"&&typeof c=="function",f=b?l:m,h=b?c:g,v=_.useRef([]);_.useEffect(()=>{v.current=[]},[t]);const y=N=>{const S=v.current[N];S&&(i?S.play().catch(()=>{}):S.pause(),s(E=>!E))},w=N=>{const S=v.current[N];S&&(S.muted=!l,h(E=>!E))},j=typeof window<"u"&&window.matchMedia("(max-width: 767px)").matches,C=cm({trackMouse:!0,onSwipedRight:d,onSwipedLeft:u,onSwipedUp:()=>{j&&u()},onSwipedDown:()=>{if(j){d();return}n&&n(null),o&&o(null)}});return a.jsx("div",{style:{left:`${-100*e?.index}%`},className:"ecr-player__slider",...C,children:Array.isArray(t)&&t.map((N,S)=>a.jsx("div",{className:"ecr-player__slide",children:N?.mime_type?.startsWith("image")?null:a.jsxs("div",{className:"ecr-player__media-frame",children:[a.jsx(dm,{videoRefs:v,file:N,isMuted:f,i:S,togglePlayPause:y,handleNextFile:u,setDuration:r,isPaused:i},N.file_uuid),a.jsxs("div",{className:"ecr-player__controls",children:[i?a.jsx(Jn,{size:p?20:24,className:"ecr-player__control-icon",onClick:()=>y(S)}):a.jsx(Xn,{size:p?20:24,className:"ecr-player__control-icon",onClick:()=>y(S)}),l?a.jsx(Qn,{size:p?20:24,className:"ecr-player__control-icon",onClick:()=>w(S)}):a.jsx(Zn,{size:p?20:24,className:"ecr-player__control-icon",onClick:()=>w(S)})]})]})},S))})},um=({previewReel:e,setPreviewReel:t})=>{const[r,n]=_.useState({index:0,story_uuid:e?.story_uuid}),[o,i]=_.useState(!1),[s,l]=_.useState(3);_.useEffect(()=>(document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}),[]);const c=()=>{const m=e?.files??[];r?.index>0?n(g=>({index:g.index-1,story_uuid:m[g.index-1].story_uuid})):t(null)},d=()=>{const m=e?.files??[];r?.index+1<m.length?n(g=>({index:g.index+1,story_uuid:m[g.index+1].story_uuid})):t(null)},u=e.files.length,p=m=>{m.target===m.currentTarget&&t(null)};return a.jsx("div",{onClick:p,style:{zIndex:999999999999999,backgroundColor:"rgba(0,0,0,0.8)",backdropFilter:"blur(8px)"},className:"ecommreels-story-modal ecr-player",children:e&&a.jsxs("div",{className:"ecr-player__stage",children:[u>1?a.jsxs(a.Fragment,{children:[r.index>0?a.jsx(wt,{onClick:c,className:"ecr-player__nav--left",children:a.jsx(Vn,{size:24})}):null,r.index<u-1?a.jsx(wt,{onClick:d,className:"ecr-player__nav--right",children:a.jsx(Wn,{size:24})}):null]}):null,a.jsxs("div",{id:"player",className:"ecr-player__frame",children:[e&&a.jsx(ci,{playingStory:e,duration:s,currentFileIndex:r,isPaused:o},`${e.story_uuid}-${r.index}`),a.jsx("div",{onClick:()=>t(null),className:"ecr-player__close",children:a.jsx(qn,{className:"ecr-player__close-icon"})}),e?.files.length>0&&a.jsx(xi,{currentFileIndex:r,files:e?.files,setDuration:l,setPreviewReel:t,isPaused:o,setIsPaused:i,handlePrevFile:c,handleNextFile:d,storyId:e.id,storyTitle:e?.title})]})]})})};function pm(e){return V({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 19h16v2H4zm0-4h11v2H4zm0-4h16v2H4zm0-8h16v2H4zm0 4h11v2H4z"},child:[]}]})(e)}function mm(e){return V({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 19h16v2H4zm3-4h10v2H7zm-3-4h16v2H4zm0-8h16v2H4zm3 4h10v2H7z"},child:[]}]})(e)}function fm(e){return V({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 19h16v2H4zm5-4h11v2H9zm-5-4h16v2H4zm0-8h16v2H4zm5 4h11v2H9z"},child:[]}]})(e)}function Pr(e){return V({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 hm(e){return V({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 bi(e){return V({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 gm(e){return V({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 xm(e){return V({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 bm(e){return V({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 _m(e){return V({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 vm=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`},ym=({story:e,styles:t,storyViews:r,setStoryViews:n})=>{_.useEffect(()=>{n&&n(s=>({...s,[e.id]:e.view_count}))},[e]);const o=e?.files[0]?.mime_type.startsWith("video"),i=e.thumbnail||void 0;return a.jsxs("div",{className:"ecr-thumb__media",children:[o?a.jsx("video",{className:"ecr-thumb__video",src:e?.files[0]?.url,muted:!0,playsInline:!0,"webkit-playsinline":"true",preload:"metadata",poster:i}):a.jsx("div",{className:"ecr-thumb__placeholder",children:"No Video"}),(r?.[e.id]??e.view_count)>0&&a.jsxs("div",{style:{left:t?.shape==="circle"?"50%":"100%",transform:`translateX(${t?.shape==="circle"?"-50%":`calc(-120% - ${t.border.border_radius/2}px)`})`,transition:"all 0.3s ease-in-out"},className:"ecr-thumb__views",children:[a.jsx("span",{children:vm(r?.[e.id]??e.view_count)}),a.jsx(sp,{size:14})]})]})},to=_.memo(ym);function wm({reel:e,styles:t,isSelected:r,onSelect:n,onDelete:o,onPreview:i,isAnyReelSelected:s}){return a.jsxs("div",{className:`ecr-admin-reel-card ${t?.hoverEffect??""}`,children:[a.jsxs("div",{style:{aspectRatio:t?.shape==="rectangle"?"9/16":"1/1"},className:$("ecr-admin-reel-card__frame",r?"ecr-admin-reel-card__frame--selected":""),children:[a.jsx(to,{story:e,styles:t}),a.jsxs("div",{className:$("ecr-admin-reel-card__actions",s?"":"ecr-admin-reel-card__actions--hover"),children:[e.files[0]?.mime_type.startsWith("image")?null:a.jsx(ne,{onClick:()=>i(e),className:"ecr-admin-reel-card__action ecr-admin-reel-card__action--primary",size:"icon-sm",title:"Preview Reel",children:a.jsx(hp,{size:18,className:"ecr-admin-reel-card__icon ecr-admin-reel-card__icon--primary"})}),a.jsx(ne,{title:"Edit Reel",size:"icon-sm",asChild:!0,className:"ecr-admin-reel-card__action",children:a.jsx(vt,{to:`?view=${X.cr}&from=${X.ar}&sid=${e.id}`,children:a.jsx(Pr,{className:"ecr-admin-reel-card__icon"})})}),a.jsx(ne,{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(Gn,{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:$("ecr-admin-reel-card__corner",s?"":"ecr-admin-reel-card__corner--hidden",r?"ecr-admin-reel-card__corner--selected":"ecr-admin-reel-card__corner--idle"),children:a.jsx(ne,{onClick:()=>n(e.id),size:"icon-sm",className:"ecr-admin-reel-card__select",children:r?a.jsx(gm,{size:18,className:"ecr-admin-reel-card__check ecr-admin-reel-card__check--active"}):a.jsx(xm,{size:18,className:"ecr-admin-reel-card__check"})})})]}),e.title&&a.jsx("p",{className:"ecr-admin-reel-card__title",children:e.title})]})}function jm({reels:e,styles:t,selectedReelIds:r,onSelectReel:n,onDeleteReel:o,onPreviewReel:i,lastStoryElementRef:s}){return a.jsx("div",{className:"ecr-admin-reels-grid",children:e?.map((l,c)=>a.jsx("div",{ref:e.length===c+1?s:null,children:a.jsx(wm,{reel:l,styles:t,isSelected:r.includes(l.id),onSelect:n,onDelete:o,onPreview:i,isAnyReelSelected:r.length>0})},l.id))})}const tr=({cb:e})=>{const t=Ne(),r=()=>{e?e():t(-1)};return a.jsx("button",{title:"Back",onClick:r,className:"ecr-admin-back-button",children:a.jsx(Ep,{size:24})})};function km(e){return V({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(vt,{to:r.href,className:"ecr-admin-breadcrumb__link",onClick:i=>{if(!t)return;const s=r.href;s&&(i.preventDefault(),t(s))},children:r.label}):a.jsx("span",{className:"ecr-admin-breadcrumb__current",children:r.label}),n<e.length-1&&a.jsx(km,{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=_.useRef(null);return _.useEffect(()=>{o.current&&o.current.focus()},[]),a.jsx("div",{className:"ecr-admin-modal",children:a.jsxs("div",{ref:o,tabIndex:-1,className:"ecr-admin-modal__panel",onBlur:i=>{i.currentTarget.contains(i.relatedTarget)||e(null)},children:[a.jsxs("div",{className:"ecr-admin-modal__content",children:[a.jsx("div",{className:"ecr-admin-modal__icon",children:a.jsx(dp,{size:40,color:"#ffa500"})}),a.jsx("p",{className:"ecr-admin-modal__message",children:n})]}),a.jsxs("div",{className:"ecr-admin-modal__actions",children:[a.jsx("button",{disabled:r,onClick:()=>e(null),className:"ecr-admin-modal__button ecr-admin-modal__button--cancel",children:"No"}),a.jsxs("button",{disabled:r,onClick:t,className:"ecr-admin-modal__button ecr-admin-modal__button--danger",children:[r&&a.jsx(it,{className:"ecr-admin-modal__spinner"}),"Yes"]})]})]})})},Rr=({to:e,Icon:t,textColor:r="#fff",text:n,className:o,onNavigate:i})=>a.jsxs(vt,{style:{color:r},to:e,className:$("ecr-admin-link-button",o),onClick:s=>{i&&(s.preventDefault(),i(e))},children:[t&&a.jsx(t,{}),n]}),Lr=({className:e})=>a.jsx("div",{className:$("ecr-admin-loader",e),children:a.jsx(it,{className:"ecr-admin-loader__icon",size:64})}),kt=({left:e=[],center:t=[],right:r=[],leftClass:n="",centerClass:o="",rightClass:i=""})=>a.jsxs("div",{className:"ecr-admin-navbar",children:[a.jsx("div",{className:`ecr-admin-navbar__section ${n}`.trim(),children:e.map((s,l)=>a.jsx(_.Fragment,{children:s},l))}),a.jsx("div",{className:`ecr-admin-navbar__section ${o}`.trim(),children:t.map((s,l)=>a.jsx(_.Fragment,{children:s},l))}),a.jsx("div",{className:`ecr-admin-navbar__section ${i}`.trim(),children:r.map((s,l)=>a.jsx(_.Fragment,{children:s},l))})]}),St=({name:e,Icon:t})=>a.jsxs("h1",{className:"ecr-admin-page-name",children:[a.jsx(t,{}),e]});function Sm(e){return V({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(Sm,{}),"ReelsWP"]});function _i(e,t){return function(){return e.apply(t,arguments)}}const{toString:Cm}=Object.prototype,{getPrototypeOf:ro}=Object,{iterator:Mr,toStringTag:vi}=Symbol,zr=(e=>t=>{const r=Cm.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),we=e=>(e=e.toLowerCase(),t=>zr(t)===e),Dr=e=>t=>typeof t===e,{isArray:Ct}=Array,Nt=Dr("undefined");function nr(e){return e!==null&&!Nt(e)&&e.constructor!==null&&!Nt(e.constructor)&&me(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const yi=we("ArrayBuffer");function Nm(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&yi(e.buffer),t}const Em=Dr("string"),me=Dr("function"),wi=Dr("number"),or=e=>e!==null&&typeof e=="object",Tm=e=>e===!0||e===!1,$r=e=>{if(zr(e)!=="object")return!1;const t=ro(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(vi in e)&&!(Mr in e)},Am=e=>{if(!or(e)||nr(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Pm=we("Date"),Om=we("File"),Rm=we("Blob"),Lm=we("FileList"),Im=e=>or(e)&&me(e.pipe),Mm=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||me(e.append)&&((t=zr(e))==="formdata"||t==="object"&&me(e.toString)&&e.toString()==="[object FormData]"))},zm=we("URLSearchParams"),[Dm,$m,Fm,Bm]=["ReadableStream","Request","Response","Headers"].map(we),Um=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]),Ct(e))for(n=0,o=e.length;n<o;n++)t.call(null,e[n],n,e);else{if(nr(e))return;const i=r?Object.getOwnPropertyNames(e):Object.keys(e),s=i.length;let l;for(n=0;n<s;n++)l=i[n],t.call(null,e[l],l,e)}}function ji(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 ct=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,ki=e=>!Nt(e)&&e!==ct;function no(){const{caseless:e,skipUndefined:t}=ki(this)&&this||{},r={},n=(o,i)=>{const s=e&&ji(r,i)||i;$r(r[s])&&$r(o)?r[s]=no(r[s],o):$r(o)?r[s]=no({},o):Ct(o)?r[s]=o.slice():(!t||!Nt(o))&&(r[s]=o)};for(let o=0,i=arguments.length;o<i;o++)arguments[o]&&ar(arguments[o],n);return r}const Hm=(e,t,r,{allOwnKeys:n}={})=>(ar(t,(o,i)=>{r&&me(o)?e[i]=_i(o,r):e[i]=o},{allOwnKeys:n}),e),Vm=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Wm=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},qm=(e,t,r,n)=>{let o,i,s;const l={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)s=o[i],(!n||n(s,e,t))&&!l[s]&&(t[s]=e[s],l[s]=!0);e=r!==!1&&ro(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},Gm=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},Km=e=>{if(!e)return null;if(Ct(e))return e;let t=e.length;if(!wi(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"&&ro(Uint8Array)),Xm=(e,t)=>{const n=(e&&e[Mr]).call(e);let o;for(;(o=n.next())&&!o.done;){const i=o.value;t.call(e,i[0],i[1])}},Jm=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},Zm=we("HTMLFormElement"),Qm=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,o){return n.toUpperCase()+o}),Si=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),ef=we("RegExp"),Ci=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};ar(r,(o,i)=>{let s;(s=t(o,i,e))!==!1&&(n[i]=s||o)}),Object.defineProperties(e,n)},tf=e=>{Ci(e,(t,r)=>{if(me(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(me(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},rf=(e,t)=>{const r={},n=o=>{o.forEach(i=>{r[i]=!0})};return Ct(e)?n(e):n(String(e).split(t)),r},nf=()=>{},of=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function af(e){return!!(e&&me(e.append)&&e[vi]==="FormData"&&e[Mr])}const sf=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 i=Ct(n)?[]:{};return ar(n,(s,l)=>{const c=r(s,o+1);!Nt(c)&&(i[l]=c)}),t[o]=void 0,i}}return n};return r(e,0)},lf=we("AsyncFunction"),cf=e=>e&&(or(e)||me(e))&&me(e.then)&&me(e.catch),Ni=((e,t)=>e?setImmediate:t?((r,n)=>(ct.addEventListener("message",({source:o,data:i})=>{o===ct&&i===r&&n.length&&n.shift()()},!1),o=>{n.push(o),ct.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",me(ct.postMessage)),df=typeof queueMicrotask<"u"?queueMicrotask.bind(ct):typeof process<"u"&&process.nextTick||Ni,k={isArray:Ct,isArrayBuffer:yi,isBuffer:nr,isFormData:Mm,isArrayBufferView:Nm,isString:Em,isNumber:wi,isBoolean:Tm,isObject:or,isPlainObject:$r,isEmptyObject:Am,isReadableStream:Dm,isRequest:$m,isResponse:Fm,isHeaders:Bm,isUndefined:Nt,isDate:Pm,isFile:Om,isBlob:Rm,isRegExp:ef,isFunction:me,isStream:Im,isURLSearchParams:zm,isTypedArray:Ym,isFileList:Lm,forEach:ar,merge:no,extend:Hm,trim:Um,stripBOM:Vm,inherits:Wm,toFlatObject:qm,kindOf:zr,kindOfTest:we,endsWith:Gm,toArray:Km,forEachEntry:Xm,matchAll:Jm,isHTMLForm:Zm,hasOwnProperty:Si,hasOwnProp:Si,reduceDescriptors:Ci,freezeMethods:tf,toObjectSet:rf,toCamelCase:Qm,noop:nf,toFiniteNumber:of,findKey:ji,global:ct,isContextDefined:ki,isSpecCompliantForm:af,toJSONObject:sf,isAsyncFn:lf,isThenable:cf,setImmediate:Ni,asap:df,isIterable:e=>e!=null&&me(e[Mr])};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)}k.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:k.toJSONObject(this.config),code:this.code,status:this.status}}});const Ei=U.prototype,Ti={};["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=>{Ti[e]={value:e}}),Object.defineProperties(U,Ti),Object.defineProperty(Ei,"isAxiosError",{value:!0}),U.from=(e,t,r,n,o,i)=>{const s=Object.create(Ei);k.toFlatObject(e,s,function(u){return u!==Error.prototype},d=>d!=="isAxiosError");const l=e&&e.message?e.message:"Error",c=t==null&&e?e.code:t;return U.call(s,l,c,r,n,o),e&&s.cause==null&&Object.defineProperty(s,"cause",{value:e,configurable:!0}),s.name=e&&e.name||"Error",i&&Object.assign(s,i),s};const uf=null;function oo(e){return k.isPlainObject(e)||k.isArray(e)}function Ai(e){return k.endsWith(e,"[]")?e.slice(0,-2):e}function Pi(e,t,r){return e?e.concat(t).map(function(o,i){return o=Ai(o),!r&&i?"["+o+"]":o}).join(r?".":""):t}function pf(e){return k.isArray(e)&&!e.some(oo)}const mf=k.toFlatObject(k,{},null,function(t){return/^is[A-Z]/.test(t)});function Fr(e,t,r){if(!k.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=k.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(f,h){return!k.isUndefined(h[f])});const n=r.metaTokens,o=r.visitor||u,i=r.dots,s=r.indexes,c=(r.Blob||typeof Blob<"u"&&Blob)&&k.isSpecCompliantForm(t);if(!k.isFunction(o))throw new TypeError("visitor must be a function");function d(b){if(b===null)return"";if(k.isDate(b))return b.toISOString();if(k.isBoolean(b))return b.toString();if(!c&&k.isBlob(b))throw new U("Blob is not supported. Use a Buffer instead.");return k.isArrayBuffer(b)||k.isTypedArray(b)?c&&typeof Blob=="function"?new Blob([b]):Buffer.from(b):b}function u(b,f,h){let v=b;if(b&&!h&&typeof b=="object"){if(k.endsWith(f,"{}"))f=n?f:f.slice(0,-2),b=JSON.stringify(b);else if(k.isArray(b)&&pf(b)||(k.isFileList(b)||k.endsWith(f,"[]"))&&(v=k.toArray(b)))return f=Ai(f),v.forEach(function(w,j){!(k.isUndefined(w)||w===null)&&t.append(s===!0?Pi([f],j,i):s===null?f:f+"[]",d(w))}),!1}return oo(b)?!0:(t.append(Pi(h,f,i),d(b)),!1)}const p=[],m=Object.assign(mf,{defaultVisitor:u,convertValue:d,isVisitable:oo});function g(b,f){if(!k.isUndefined(b)){if(p.indexOf(b)!==-1)throw Error("Circular reference detected in "+f.join("."));p.push(b),k.forEach(b,function(v,y){(!(k.isUndefined(v)||v===null)&&o.call(t,v,k.isString(y)?y.trim():y,f,m))===!0&&g(v,f?f.concat(y):[y])}),p.pop()}}if(!k.isObject(e))throw new TypeError("data must be an object");return g(e),t}function Oi(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function ao(e,t){this._pairs=[],e&&Fr(e,this,t)}const Ri=ao.prototype;Ri.append=function(t,r){this._pairs.push([t,r])},Ri.toString=function(t){const r=t?function(n){return t.call(this,n,Oi)}:Oi;return this._pairs.map(function(o){return r(o[0])+"="+r(o[1])},"").join("&")};function ff(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Li(e,t,r){if(!t)return e;const n=r&&r.encode||ff;k.isFunction(r)&&(r={serialize:r});const o=r&&r.serialize;let i;if(o?i=o(t,r):i=k.isURLSearchParams(t)?t.toString():new ao(t,r).toString(n),i){const s=e.indexOf("#");s!==-1&&(e=e.slice(0,s)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class Ii{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){k.forEach(this.handlers,function(n){n!==null&&t(n)})}}const Mi={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},hf={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:ao,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},io=typeof window<"u"&&typeof document<"u",so=typeof navigator=="object"&&navigator||void 0,gf=io&&(!so||["ReactNative","NativeScript","NS"].indexOf(so.product)<0),xf=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",bf=io&&window.location.href||"http://localhost",ue={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:io,hasStandardBrowserEnv:gf,hasStandardBrowserWebWorkerEnv:xf,navigator:so,origin:bf},Symbol.toStringTag,{value:"Module"})),...hf};function _f(e,t){return Fr(e,new ue.classes.URLSearchParams,{visitor:function(r,n,o,i){return ue.isNode&&k.isBuffer(r)?(this.append(n,r.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}function vf(e){return k.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function yf(e){const t={},r=Object.keys(e);let n;const o=r.length;let i;for(n=0;n<o;n++)i=r[n],t[i]=e[i];return t}function zi(e){function t(r,n,o,i){let s=r[i++];if(s==="__proto__")return!0;const l=Number.isFinite(+s),c=i>=r.length;return s=!s&&k.isArray(o)?o.length:s,c?(k.hasOwnProp(o,s)?o[s]=[o[s],n]:o[s]=n,!l):((!o[s]||!k.isObject(o[s]))&&(o[s]=[]),t(r,n,o[s],i)&&k.isArray(o[s])&&(o[s]=yf(o[s])),!l)}if(k.isFormData(e)&&k.isFunction(e.entries)){const r={};return k.forEachEntry(e,(n,o)=>{t(vf(n),o,r,0)}),r}return null}function wf(e,t,r){if(k.isString(e))try{return(t||JSON.parse)(e),k.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const ir={transitional:Mi,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",o=n.indexOf("application/json")>-1,i=k.isObject(t);if(i&&k.isHTMLForm(t)&&(t=new FormData(t)),k.isFormData(t))return o?JSON.stringify(zi(t)):t;if(k.isArrayBuffer(t)||k.isBuffer(t)||k.isStream(t)||k.isFile(t)||k.isBlob(t)||k.isReadableStream(t))return t;if(k.isArrayBufferView(t))return t.buffer;if(k.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return _f(t,this.formSerializer).toString();if((l=k.isFileList(t))||n.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return Fr(l?{"files[]":t}:t,c&&new c,this.formSerializer)}}return i||o?(r.setContentType("application/json",!1),wf(t)):t}],transformResponse:[function(t){const r=this.transitional||ir.transitional,n=r&&r.forcedJSONParsing,o=this.responseType==="json";if(k.isResponse(t)||k.isReadableStream(t))return t;if(t&&k.isString(t)&&(n&&!this.responseType||o)){const s=!(r&&r.silentJSONParsing)&&o;try{return JSON.parse(t,this.parseReviver)}catch(l){if(s)throw l.name==="SyntaxError"?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:ue.classes.FormData,Blob:ue.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};k.forEach(["delete","get","head","post","put","patch"],e=>{ir.headers[e]={}});const jf=k.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"]),kf=e=>{const t={};let r,n,o;return e&&e.split(`354 `).forEach(function(s){o=s.indexOf(":"),r=s.substring(0,o).trim().toLowerCase(),n=s.substring(o+1).trim(),!(!r||t[r]&& jf[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t},Di=Symbol("internals");function sr(e){return e&&String(e).trim().toLowerCase()}function Br(e){return e===!1||e==null?e:k.isArray(e)?e.map(Br):String(e)}function Sf(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 Cf=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function lo(e,t,r,n,o){if(k.isFunction(n))return n.call(this,t,r);if(o&&(t=r),!!k.isString(t)){if(k.isString(n))return t.indexOf(n)!==-1;if(k.isRegExp(n))return n.test(t)}}function Nf(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function Ef(e,t){const r=k.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(o,i,s){return this[n].call(this,t,o,i,s)},configurable:!0})})}let fe=class{constructor(t){t&&this.set(t)}set(t,r,n){const o=this;function i(l,c,d){const u=sr(c);if(!u)throw new Error("header name must be a non-empty string");const p=k.findKey(o,u);(!p||o[p]===void 0||d===!0||d===void 0&&o[p]!==!1)&&(o[p||c]=Br(l))}const s=(l,c)=>k.forEach(l,(d,u)=>i(d,u,c));if(k.isPlainObject(t)||t instanceof this.constructor)s(t,r);else if(k.isString(t)&&(t=t.trim())&&!Cf(t))s(kf(t),r);else if(k.isObject(t)&&k.isIterable(t)){let l={},c,d;for(const u of t){if(!k.isArray(u))throw TypeError("Object iterator must return a key-value pair");l[d=u[0]]=(c=l[d])?k.isArray(c)?[...c,u[1]]:[c,u[1]]:u[1]}s(l,r)}else t!=null&&i(r,t,n);return this}get(t,r){if(t=sr(t),t){const n=k.findKey(this,t);if(n){const o=this[n];if(!r)return o;if(r===!0)return Sf(o);if(k.isFunction(r))return r.call(this,o,n);if(k.isRegExp(r))return r.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=sr(t),t){const n=k.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||lo(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let o=!1;function i(s){if(s=sr(s),s){const l=k.findKey(n,s);l&&(!r||lo(n,n[l],l,r))&&(delete n[l],o=!0)}}return k.isArray(t)?t.forEach(i):i(t),o}clear(t){const r=Object.keys(this);let n=r.length,o=!1;for(;n--;){const i=r[n];(!t||lo(this,this[i],i,t,!0))&&(delete this[i],o=!0)}return o}normalize(t){const r=this,n={};return k.forEach(this,(o,i)=>{const s=k.findKey(n,i);if(s){r[s]=Br(o),delete r[i];return}const l=t?Nf(i):String(i).trim();l!==i&&delete r[i],r[l]=Br(o),n[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return k.forEach(this,(n,o)=>{n!=null&&n!==!1&&(r[o]=t&&k.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(`355 `)}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[Di]=this[Di]={accessors:{}}).accessors,o=this.prototype;function i(s){const l=sr(s);n[l]||( Ef(o,s),n[l]=!0)}return k.isArray(t)?t.forEach(i):i(t),this}};fe.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),k.reduceDescriptors(fe.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}}),k.freezeMethods(fe);function co(e,t){const r=this||ir,n=t||r,o=fe.from(n.headers);let i=n.data;return k.forEach(e,function(l){i=l.call(r,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function $i(e){return!!(e&&e.__CANCEL__)}function Et(e,t,r){U.call(this,e??"canceled",U.ERR_CANCELED,t,r),this.name="CanceledError"}k.inherits(Et,U,{__CANCEL__:!0});function Fi(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 Tf(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Af(e,t){e=e||10;const r=new Array(e),n=new Array(e);let o=0,i=0,s;return t=t!==void 0?t:1e3,function(c){const d=Date.now(),u=n[i];s||(s=d),r[o]=c,n[o]=d;let p=i,m=0;for(;p!==o;)m+=r[p++],p=p%e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),d-s<t)return;const g=u&&d-u;return g?Math.round(m*1e3/g):void 0}}function Pf(e,t){let r=0,n=1e3/t,o,i;const s=(d,u=Date.now())=>{r=u,o=null,i&&(clearTimeout(i),i=null),e(...d)};return[(...d)=>{const u=Date.now(),p=u-r;p>=n?s(d,u):(o=d,i||(i=setTimeout(()=>{i=null,s(o)},n-p)))},()=>o&&s(o)]}const Ur=(e,t,r=3)=>{let n=0;const o=Af(50,250);return Pf(i=>{const s=i.loaded,l=i.lengthComputable?i.total:void 0,c=s-n,d=o(c),u=s<=l;n=s;const p={loaded:s,total:l,progress:l?s/l:void 0,bytes:c,rate:d||void 0,estimated:d&&l&&u?(l-s)/d:void 0,event:i,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(p)},r)},Bi=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},Ui=e=>(...t)=>k.asap(()=>e(...t)),Of=ue.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,ue.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(ue.origin),ue.navigator&&/(msie|trident)/i.test(ue.navigator.userAgent)):()=>!0,Rf=ue.hasStandardBrowserEnv?{write(e,t,r,n,o,i,s){if(typeof document>"u")return;const l=[`${e}=${encodeURIComponent(t)}`];k.isNumber(r)&&l.push(`expires=${new Date(r).toUTCString()}`),k.isString(n)&&l.push(`path=${n}`),k.isString(o)&&l.push(`domain=${o}`),i===!0&&l.push("secure"),k.isString(s)&&l.push(`SameSite=${s}`),document.cookie=l.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Lf(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function If(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Hi(e,t,r){let n=!Lf(t);return e&&(n||r==!1)?If(e,t):t}const Vi=e=>e instanceof fe?{...e}:e;function dt(e,t){t=t||{};const r={};function n(d,u,p,m){return k.isPlainObject(d)&&k.isPlainObject(u)?k.merge.call({caseless:m},d,u):k.isPlainObject(u)?k.merge({},u):k.isArray(u)?u.slice():u}function o(d,u,p,m){if(k.isUndefined(u)){if(!k.isUndefined(d))return n(void 0,d,p,m)}else return n(d,u,p,m)}function i(d,u){if(!k.isUndefined(u))return n(void 0,u)}function s(d,u){if(k.isUndefined(u)){if(!k.isUndefined(d))return n(void 0,d)}else return n(void 0,u)}function l(d,u,p){if(p in t)return n(d,u);if(p in e)return n(void 0,d)}const c={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:l,headers:(d,u,p)=>o(Vi(d),Vi(u),p,!0)};return k.forEach(Object.keys({...e,...t}),function(u){const p=c[u]||o,m=p(e[u],t[u],u);k.isUndefined(m)&&p!==l||(r[u]=m)}),r}const Wi=e=>{const t=dt({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:o,xsrfCookieName:i,headers:s,auth:l}=t;if(t.headers=s=fe.from(s),t.url=Li(Hi(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),l&&s.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),k.isFormData(r)){if(ue.hasStandardBrowserEnv||ue.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(k.isFunction(r.getHeaders)){const c=r.getHeaders(),d=["content-type","content-length"];Object.entries(c).forEach(([u,p])=>{d.includes(u.toLowerCase())&&s.set(u,p)})}}if(ue.hasStandardBrowserEnv&&(n&&k.isFunction(n)&&(n=n(t)),n||n!==!1&&Of(t.url))){const c=o&&i&&Rf.read(i);c&&s.set(o,c)}return t},Mf=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(r,n){const o=Wi(e);let i=o.data;const s=fe.from(o.headers).normalize();let{responseType:l,onUploadProgress:c,onDownloadProgress:d}=o,u,p,m,g,b;function f(){g&&g(),b&&b(),o.cancelToken&&o.cancelToken.unsubscribe(u),o.signal&&o.signal.removeEventListener("abort",u)}let h=new XMLHttpRequest;h.open(o.method.toUpperCase(),o.url,!0),h.timeout=o.timeout;function v(){if(!h)return;const w=fe.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),C={data:!l||l==="text"||l==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:w,config:e,request:h};Fi(function(S){r(S),f()},function(S){n(S),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||Mi;o.timeoutErrorMessage&&(j=o.timeoutErrorMessage),n(new U(j,C.clarifyTimeoutError?U.ETIMEDOUT:U.ECONNABORTED,e,h)),h=null},i===void 0&&s.setContentType(null),"setRequestHeader"in h&&k.forEach(s.toJSON(),function(j,C){h.setRequestHeader(C,j)}),k.isUndefined(o.withCredentials)||(h.withCredentials=!!o.withCredentials),l&&l!=="json"&&(h.responseType=o.responseType),d&&([m,b]=Ur(d,!0),h.addEventListener("progress",m)),c&&h.upload&&([p,g]=Ur(c),h.upload.addEventListener("progress",p),h.upload.addEventListener("loadend",g)),(o.cancelToken||o.signal)&&(u=w=>{h&&(n(!w||w.type?new Et(null,e,h):w),h.abort(),h=null)},o.cancelToken&&o.cancelToken.subscribe(u),o.signal&&(o.signal.aborted?u():o.signal.addEventListener("abort",u)));const y=Tf(o.url);if(y&&ue.protocols.indexOf(y)===-1){n(new U("Unsupported protocol "+y+":",U.ERR_BAD_REQUEST,e));return}h.send(i||null)})},zf=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let n=new AbortController,o;const i=function(d){if(!o){o=!0,l();const u=d instanceof Error?d:this.reason;n.abort(u instanceof U?u:new Et(u instanceof Error?u.message:u))}};let s=t&&setTimeout(()=>{s=null,i(new U(`timeout ${t} of ms exceeded`,U.ETIMEDOUT))},t);const l=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(d=>{d.unsubscribe?d.unsubscribe(i):d.removeEventListener("abort",i)}),e=null)};e.forEach(d=>d.addEventListener("abort",i));const{signal:c}=n;return c.unsubscribe=()=>k.asap(l),c}},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},$f=async function*(e,t){for await(const r of Ff(e))yield*Df(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()}},qi=(e,t,r,n)=>{const o=$f(e,t);let i=0,s,l=c=>{s||(s=!0,n&&n(c))};return new ReadableStream({async pull(c){try{const{done:d,value:u}=await o.next();if(d){l(),c.close();return}let p=u.byteLength;if(r){let m=i+=p;r(m)}c.enqueue(new Uint8Array(u))}catch(d){throw l(d),d}},cancel(c){return l(c),o.return()}},{highWaterMark:2})},Gi=64*1024,{isFunction:Hr}=k,Bf=(({Request:e,Response:t})=>({Request:e,Response:t}))(k.global),{ReadableStream:Ki,TextEncoder:Yi}=k.global,Xi=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Uf=e=>{e=k.merge.call({skipUndefined:!0},Bf,e);const{fetch:t,Request:r,Response:n}=e,o=t?Hr(t):typeof fetch=="function",i=Hr(r),s=Hr(n);if(!o)return!1;const l=o&&Hr(Ki),c=o&&(typeof Yi=="function"?(b=>f=>b.encode(f))(new Yi):async b=>new Uint8Array(await new r(b).arrayBuffer())),d=i&&l&&Xi(()=>{let b=!1;const f=new r(ue.origin,{body:new Ki,method:"POST",get duplex(){return b=!0,"half"}}).headers.has("Content-Type");return b&&!f}),u=s&&l&&Xi(()=>k.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(k.isBlob(b))return b.size;if(k.isSpecCompliantForm(b))return(await new r(ue.origin,{method:"POST",body:b}).arrayBuffer()).byteLength;if(k.isArrayBufferView(b)||k.isArrayBuffer(b))return b.byteLength;if(k.isURLSearchParams(b)&&(b=b+""),k.isString(b))return(await c(b)).byteLength},g=async(b,f)=>{const h=k.toFiniteNumber(b.getContentLength());return h??m(f)};return async b=>{let{url:f,method:h,data:v,signal:y,cancelToken:w,timeout:j,onDownloadProgress:C,onUploadProgress:N,responseType:S,headers:E,withCredentials:T="same-origin",fetchOptions:A}=Wi(b),R=t||fetch;S=S?(S+"").toLowerCase():"text";let L=zf([y,w&&w.toAbortSignal()],j),B=null;const M=L&&L.unsubscribe&&(()=>{L.unsubscribe()});let O;try{if(N&&d&&h!=="get"&&h!=="head"&&(O=await g(E,v))!==0){let oe=new r(f,{method:"POST",body:v,duplex:"half"}),ge;if(k.isFormData(v)&&(ge=oe.headers.get("content-type"))&&E.setContentType(ge),oe.body){const[_e,pe]=Bi(O,Ur(Ui(N)));v=qi(oe.body,Gi,_e,pe)}}k.isString(T)||(T=T?"include":"omit");const P=i&&"credentials"in r.prototype,z={...A,signal:L,method:h.toUpperCase(),headers:E.normalize().toJSON(),body:v,duplex:"half",credentials:P?T:void 0};B=i&&new r(f,z);let I=await(i?R(B,A):R(f,z));const q=u&&(S==="stream"||S==="response");if(u&&(C||q&&M)){const oe={};["status","statusText","headers"].forEach(K=>{oe[K]=I[K]});const ge=k.toFiniteNumber(I.headers.get("content-length")),[_e,pe]=C&&Bi(ge,Ur(Ui(C),!0))||[];I=new n(qi(I.body,Gi,_e,()=>{pe&&pe(),M&&M()}),oe)}S=S||"text";let te=await p[k.findKey(p,S)||"text"](I,b);return!q&&M&&M(),await new Promise((oe,ge)=>{Fi(oe,ge,{data:te,headers:fe.from(I.headers),status:I.status,statusText:I.statusText,config:b,request:B})})}catch(P){throw M&&M(),P&&P.name==="TypeError"&&/Load failed|fetch/i.test(P.message)?Object.assign(new U("Network Error",U.ERR_NETWORK,b,B),{cause:P.cause||P}):U.from(P,P&&P.code,b,B)}}},Hf=new Map,Ji=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:o}=t,i=[n,o,r];let s=i.length,l=s,c,d,u=Hf;for(;l--;)c=i[l],d=u.get(c),d===void 0&&u.set(c,d=l?new Map:Uf(t)),u=d;return d};Ji();const uo={http:uf,xhr:Mf,fetch:{get:Ji}};k.forEach(uo,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Zi=e=>`- ${e}`,Vf=e=>k.isFunction(e)||e===null||e===!1;function Wf(e,t){e=k.isArray(e)?e:[e];const{length:r}=e;let n,o;const i={};for(let s=0;s<r;s++){n=e[s];let l;if(o=n,!Vf(n)&&(o=uo[(l=String(n)).toLowerCase()],o===void 0))throw new U(`Unknown adapter '${l}'`);if(o&&(k.isFunction(o)||(o=o.get(t))))break;i[l||"#"+s]=o}if(!o){const s=Object.entries(i).map(([c,d])=>`adapter ${c} `+(d===!1?"is not supported by the environment":"is not available in the build"));let l=r?s.length>1?`since :353 */const er=Q("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),tm="Left",rm="Right",nm="Up",om="Down",jt={delta:10,preventScrollOnSwipe:!1,rotationAngle:0,trackMouse:!1,trackTouch:!0,swipeDuration:1/0,touchEventOptions:{passive:!0}},eo={first:!0,initial:[0,0],start:0,swiping:!1,xy:[0,0]},fi="mousemove",hi="mouseup",am="touchend",im="touchmove",sm="touchstart";function lm(e,t,r,n){return e>t?r>0?rm:tm:n>0?om:nm}function gi(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 cm(e,t){const r=u=>{const p="touches"in u;p&&u.touches.length>1||e((m,g)=>{g.trackMouse&&!p&&(document.addEventListener(fi,n),document.addEventListener(hi,s));const{clientX:b,clientY:f}=p?u.touches[0]:u,h=gi([b,f],g.rotationAngle);return g.onTouchStartOrOnMouseDown&&g.onTouchStartOrOnMouseDown({event:u}),Object.assign(Object.assign(Object.assign({},m),eo),{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]=gi([b,f],m.rotationAngle),y=h-p.xy[0],w=v-p.xy[1],j=Math.abs(y),C=Math.abs(w),N=(u.timeStamp||0)-p.start,S=Math.sqrt(j*j+C*C)/(N||1),E=[y/(N||1),w/(N||1)],T=lm(j,C,y,w),A=typeof m.delta=="number"?m.delta:m.delta[T.toLowerCase()]||jt.delta;if(j<A&&C<A&&!p.swiping)return p;const R={absX:j,absY:C,deltaX:y,deltaY:w,dir:T,event:u,first:p.first,initial:p.initial,velocity:S,vxvy:E};R.first&&m.onSwipeStart&&m.onSwipeStart(R),m.onSwiping&&m.onSwiping(R);let L=!1;return(m.onSwiping||m.onSwiped||m[`onSwiped${T}`])&&(L=!0),L&&m.preventScrollOnSwipe&&m.trackTouch&&u.cancelable&&u.preventDefault(),Object.assign(Object.assign({},p),{first:!1,eventData:R,swiping:!0})})},o=u=>{e((p,m)=>{let g;if(p.swiping&&p.eventData){if(u.timeStamp-p.start<m.swipeDuration){g=Object.assign(Object.assign({},p.eventData),{event:u}),m.onSwiped&&m.onSwiped(g);const b=m[`onSwiped${g.dir}`];b&&b(g)}}else m.onTap&&m.onTap({event:u});return m.onTouchEndOrOnMouseUp&&m.onTouchEndOrOnMouseUp({event:u}),Object.assign(Object.assign(Object.assign({},p),eo),{eventData:g})})},i=()=>{document.removeEventListener(fi,n),document.removeEventListener(hi,s)},s=u=>{i(),o(u)},l=(u,p)=>{let m=()=>{};if(u&&u.addEventListener){const g=Object.assign(Object.assign({},jt.touchEventOptions),p.touchEventOptions),b=[[sm,r,g],[im,n,Object.assign(Object.assign({},g),p.preventScrollOnSwipe?{passive:!1}:{})],[am,o,g]];b.forEach(([f,h,v])=>u.addEventListener(f,h,v)),m=()=>b.forEach(([f,h])=>u.removeEventListener(f,h))}return m},d={ref:u=>{u!==null&&e((p,m)=>{if(p.el===u)return p;const g={};return p.el&&p.el!==u&&p.cleanUpTouch&&(p.cleanUpTouch(),g.cleanUpTouch=void 0),m.trackTouch&&u&&(g.cleanUpTouch=l(u,m)),Object.assign(Object.assign(Object.assign({},p),{el:u}),g)})}};return t.trackMouse&&(d.onMouseDown=r),[d,l]}function dm(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 um(e){const{trackMouse:t}=e,r=x.useRef(Object.assign({},eo)),n=x.useRef(Object.assign({},jt)),o=x.useRef(Object.assign({},n.current));o.current=Object.assign({},n.current),n.current=Object.assign(Object.assign({},jt),e);let i;for(i in jt)n.current[i]===void 0&&(n.current[i]=jt[i]);const[s,l]=x.useMemo(()=>cm(c=>r.current=c(r.current,n.current),{trackMouse:t}),[t]);return r.current=dm(r.current,n.current,o.current,l),s}const Ar=e=>{const[t,r]=_.useState(()=>typeof window>"u"?!1:window.matchMedia(e).matches);return _.useEffect(()=>{if(typeof window>"u")return;const n=window.matchMedia(e),o=i=>{r(i.matches)};return n.addEventListener("change",o),()=>n.removeEventListener("change",o)},[e]),t},pm=({videoRefs:e,file:t,isMuted:r,isPaused:n,i:o,togglePlayPause:i,handleNextFile:s,setDuration:l})=>{const[c,d]=_.useState(!1);return a.jsx("div",{className:"ecr-player__media-frame",children:a.jsx("video",{preload:"metadata",playsInline:!0,"webkit-playsinline":"true",muted:r,autoPlay:!n,controls:!1,loop:!1,"aria-label":"Reel video",disablePictureInPicture:!0,controlsList:"nodownload noplaybackrate noremoteplayback",ref:u=>{u&&(e.current[o]=u,u.setAttribute("webkit-playsinline","true"),u.setAttribute("x-webkit-airplay","allow"),u.setAttribute("airplay","allow"))},className:c?"ecr-player__media ecr-player__media--portrait":"ecr-player__media",src:t?.url,onClick:()=>i(o),onEnded:s,onError:s,onLoadedMetadata:u=>{const p=u.currentTarget,m=p.videoWidth,g=p.videoHeight;d(g>m),l(p.duration)}})})},xi=({currentFileIndex:e,files:t,setDuration:r,setIsPlaying:n,setPreviewReel:o,isPaused:i,setIsPaused:s,isMuted:l,setIsMuted:c,handlePrevFile:d,handleNextFile:u})=>{const p=Ar("(min-width: 1024px)"),[m,g]=_.useState(l??!1),b=typeof l=="boolean"&&typeof c=="function",f=b?l:m,h=b?c:g,v=_.useRef([]);_.useEffect(()=>{v.current=[]},[t]);const y=N=>{const S=v.current[N];S&&(i?S.play().catch(()=>{}):S.pause(),s(E=>!E))},w=N=>{const S=v.current[N];S&&(S.muted=!l,h(E=>!E))},j=typeof window<"u"&&window.matchMedia("(max-width: 767px)").matches,C=um({trackMouse:!0,onSwipedRight:d,onSwipedLeft:u,onSwipedUp:()=>{j&&u()},onSwipedDown:()=>{if(j){d();return}n&&n(null),o&&o(null)}});return a.jsx("div",{style:{left:`${-100*e?.index}%`},className:"ecr-player__slider",...C,children:Array.isArray(t)&&t.map((N,S)=>a.jsx("div",{className:"ecr-player__slide",children:N?.mime_type?.startsWith("image")?null:a.jsxs("div",{className:"ecr-player__media-frame",children:[a.jsx(pm,{videoRefs:v,file:N,isMuted:f,i:S,togglePlayPause:y,handleNextFile:u,setDuration:r,isPaused:i},N.file_uuid),a.jsxs("div",{className:"ecr-player__controls",children:[i?a.jsx(Jn,{size:p?20:24,className:"ecr-player__control-icon",onClick:()=>y(S)}):a.jsx(Xn,{size:p?20:24,className:"ecr-player__control-icon",onClick:()=>y(S)}),l?a.jsx(Qn,{size:p?20:24,className:"ecr-player__control-icon",onClick:()=>w(S)}):a.jsx(Zn,{size:p?20:24,className:"ecr-player__control-icon",onClick:()=>w(S)})]})]})},S))})},mm=({previewReel:e,setPreviewReel:t})=>{const[r,n]=_.useState({index:0,story_uuid:e?.story_uuid}),[o,i]=_.useState(!1),[s,l]=_.useState(3);_.useEffect(()=>(document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}),[]);const c=()=>{const m=e?.files??[];r?.index>0?n(g=>({index:g.index-1,story_uuid:m[g.index-1].story_uuid})):t(null)},d=()=>{const m=e?.files??[];r?.index+1<m.length?n(g=>({index:g.index+1,story_uuid:m[g.index+1].story_uuid})):t(null)},u=e.files.length,p=m=>{m.target===m.currentTarget&&t(null)};return a.jsx("div",{onClick:p,style:{zIndex:999999999999999,backgroundColor:"rgba(0,0,0,0.8)",backdropFilter:"blur(8px)"},className:"ecommreels-story-modal ecr-player",children:e&&a.jsxs("div",{className:"ecr-player__stage",children:[u>1?a.jsxs(a.Fragment,{children:[r.index>0?a.jsx(wt,{onClick:c,className:"ecr-player__nav--left",children:a.jsx(Vn,{size:24})}):null,r.index<u-1?a.jsx(wt,{onClick:d,className:"ecr-player__nav--right",children:a.jsx(Wn,{size:24})}):null]}):null,a.jsxs("div",{id:"player",className:"ecr-player__frame",children:[e&&a.jsx(ci,{playingStory:e,duration:s,currentFileIndex:r,isPaused:o},`${e.story_uuid}-${r.index}`),a.jsx("div",{onClick:()=>t(null),className:"ecr-player__close",children:a.jsx(qn,{className:"ecr-player__close-icon"})}),e?.files.length>0&&a.jsx(xi,{currentFileIndex:r,files:e?.files,setDuration:l,setPreviewReel:t,isPaused:o,setIsPaused:i,handlePrevFile:c,handleNextFile:d,storyId:e.id,storyTitle:e?.title})]})]})})};function fm(e){return V({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 19h16v2H4zm0-4h11v2H4zm0-4h16v2H4zm0-8h16v2H4zm0 4h11v2H4z"},child:[]}]})(e)}function hm(e){return V({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 19h16v2H4zm3-4h10v2H7zm-3-4h16v2H4zm0-8h16v2H4zm3 4h10v2H7z"},child:[]}]})(e)}function gm(e){return V({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 19h16v2H4zm5-4h11v2H9zm-5-4h16v2H4zm0-8h16v2H4zm5 4h11v2H9z"},child:[]}]})(e)}function Pr(e){return V({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 xm(e){return V({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 bi(e){return V({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 bm(e){return V({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 _m(e){return V({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 vm(e){return V({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 ym(e){return V({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 wm=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`},jm=({story:e,styles:t,storyViews:r,setStoryViews:n})=>{_.useEffect(()=>{n&&n(s=>({...s,[e.id]:e.view_count}))},[e]);const o=e?.files[0]?.mime_type.startsWith("video"),i=e.thumbnail||void 0;return a.jsxs("div",{className:"ecr-thumb__media",children:[o?a.jsx("video",{className:"ecr-thumb__video",src:e?.files[0]?.url,muted:!0,playsInline:!0,"webkit-playsinline":"true",preload:"metadata",poster:i}):a.jsx("div",{className:"ecr-thumb__placeholder",children:"No Video"}),(r?.[e.id]??e.view_count)>0&&a.jsxs("div",{style:{left:t?.shape==="circle"?"50%":"100%",transform:`translateX(${t?.shape==="circle"?"-50%":`calc(-120% - ${t.border.border_radius/2}px)`})`,transition:"all 0.3s ease-in-out"},className:"ecr-thumb__views",children:[a.jsx("span",{children:wm(r?.[e.id]??e.view_count)}),a.jsx(cp,{size:14})]})]})},to=_.memo(jm);function km({reel:e,styles:t,isSelected:r,onSelect:n,onDelete:o,onPreview:i,isAnyReelSelected:s}){return a.jsxs("div",{className:`ecr-admin-reel-card ${t?.hoverEffect??""}`,children:[a.jsxs("div",{style:{aspectRatio:t?.shape==="rectangle"?"9/16":"1/1"},className:$("ecr-admin-reel-card__frame",r?"ecr-admin-reel-card__frame--selected":""),children:[a.jsx(to,{story:e,styles:t}),a.jsxs("div",{className:$("ecr-admin-reel-card__actions",s?"":"ecr-admin-reel-card__actions--hover"),children:[e.files[0]?.mime_type.startsWith("image")?null:a.jsx(ne,{onClick:()=>i(e),className:"ecr-admin-reel-card__action ecr-admin-reel-card__action--primary",size:"icon-sm",title:"Preview Reel",children:a.jsx(xp,{size:18,className:"ecr-admin-reel-card__icon ecr-admin-reel-card__icon--primary"})}),a.jsx(ne,{title:"Edit Reel",size:"icon-sm",asChild:!0,className:"ecr-admin-reel-card__action",children:a.jsx(vt,{to:`?view=${X.cr}&from=${X.ar}&sid=${e.id}`,children:a.jsx(Pr,{className:"ecr-admin-reel-card__icon"})})}),a.jsx(ne,{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(Gn,{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:$("ecr-admin-reel-card__corner",s?"":"ecr-admin-reel-card__corner--hidden",r?"ecr-admin-reel-card__corner--selected":"ecr-admin-reel-card__corner--idle"),children:a.jsx(ne,{onClick:()=>n(e.id),size:"icon-sm",className:"ecr-admin-reel-card__select",children:r?a.jsx(bm,{size:18,className:"ecr-admin-reel-card__check ecr-admin-reel-card__check--active"}):a.jsx(_m,{size:18,className:"ecr-admin-reel-card__check"})})})]}),e.title&&a.jsx("p",{className:"ecr-admin-reel-card__title",children:e.title})]})}function Sm({reels:e,styles:t,selectedReelIds:r,onSelectReel:n,onDeleteReel:o,onPreviewReel:i,lastStoryElementRef:s}){return a.jsx("div",{className:"ecr-admin-reels-grid",children:e?.map((l,c)=>a.jsx("div",{ref:e.length===c+1?s:null,children:a.jsx(km,{reel:l,styles:t,isSelected:r.includes(l.id),onSelect:n,onDelete:o,onPreview:i,isAnyReelSelected:r.length>0})},l.id))})}const tr=({cb:e})=>{const t=Ne(),r=()=>{e?e():t(-1)};return a.jsx("button",{title:"Back",onClick:r,className:"ecr-admin-back-button",children:a.jsx(Ap,{size:24})})};function Cm(e){return V({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(vt,{to:r.href,className:"ecr-admin-breadcrumb__link",onClick:i=>{if(!t)return;const s=r.href;s&&(i.preventDefault(),t(s))},children:r.label}):a.jsx("span",{className:"ecr-admin-breadcrumb__current",children:r.label}),n<e.length-1&&a.jsx(Cm,{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=_.useRef(null);return _.useEffect(()=>{o.current&&o.current.focus()},[]),a.jsx("div",{className:"ecr-admin-modal",children:a.jsxs("div",{ref:o,tabIndex:-1,className:"ecr-admin-modal__panel",onBlur:i=>{i.currentTarget.contains(i.relatedTarget)||e(null)},children:[a.jsxs("div",{className:"ecr-admin-modal__content",children:[a.jsx("div",{className:"ecr-admin-modal__icon",children:a.jsx(pp,{size:40,color:"#ffa500"})}),a.jsx("p",{className:"ecr-admin-modal__message",children:n})]}),a.jsxs("div",{className:"ecr-admin-modal__actions",children:[a.jsx("button",{disabled:r,onClick:()=>e(null),className:"ecr-admin-modal__button ecr-admin-modal__button--cancel",children:"No"}),a.jsxs("button",{disabled:r,onClick:t,className:"ecr-admin-modal__button ecr-admin-modal__button--danger",children:[r&&a.jsx(it,{className:"ecr-admin-modal__spinner"}),"Yes"]})]})]})})},Rr=({to:e,Icon:t,textColor:r="#fff",text:n,className:o,onNavigate:i})=>a.jsxs(vt,{style:{color:r},to:e,className:$("ecr-admin-link-button",o),onClick:s=>{i&&(s.preventDefault(),i(e))},children:[t&&a.jsx(t,{}),n]}),Lr=({className:e})=>a.jsx("div",{className:$("ecr-admin-loader",e),children:a.jsx(it,{className:"ecr-admin-loader__icon",size:64})}),kt=({left:e=[],center:t=[],right:r=[],leftClass:n="",centerClass:o="",rightClass:i=""})=>a.jsxs("div",{className:"ecr-admin-navbar",children:[a.jsx("div",{className:`ecr-admin-navbar__section ${n}`.trim(),children:e.map((s,l)=>a.jsx(_.Fragment,{children:s},l))}),a.jsx("div",{className:`ecr-admin-navbar__section ${o}`.trim(),children:t.map((s,l)=>a.jsx(_.Fragment,{children:s},l))}),a.jsx("div",{className:`ecr-admin-navbar__section ${i}`.trim(),children:r.map((s,l)=>a.jsx(_.Fragment,{children:s},l))})]}),St=({name:e,Icon:t})=>a.jsxs("h1",{className:"ecr-admin-page-name",children:[a.jsx(t,{}),e]});function Nm(e){return V({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(Nm,{}),"ReelsWP"]});function _i(e,t){return function(){return e.apply(t,arguments)}}const{toString:Em}=Object.prototype,{getPrototypeOf:ro}=Object,{iterator:Mr,toStringTag:vi}=Symbol,zr=(e=>t=>{const r=Em.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),we=e=>(e=e.toLowerCase(),t=>zr(t)===e),Dr=e=>t=>typeof t===e,{isArray:Ct}=Array,Nt=Dr("undefined");function nr(e){return e!==null&&!Nt(e)&&e.constructor!==null&&!Nt(e.constructor)&&me(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const yi=we("ArrayBuffer");function Tm(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&yi(e.buffer),t}const Am=Dr("string"),me=Dr("function"),wi=Dr("number"),or=e=>e!==null&&typeof e=="object",Pm=e=>e===!0||e===!1,$r=e=>{if(zr(e)!=="object")return!1;const t=ro(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(vi in e)&&!(Mr 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}},Rm=we("Date"),Lm=we("File"),Im=we("Blob"),Mm=we("FileList"),zm=e=>or(e)&&me(e.pipe),Dm=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||me(e.append)&&((t=zr(e))==="formdata"||t==="object"&&me(e.toString)&&e.toString()==="[object FormData]"))},$m=we("URLSearchParams"),[Fm,Bm,Um,Hm]=["ReadableStream","Request","Response","Headers"].map(we),Vm=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]),Ct(e))for(n=0,o=e.length;n<o;n++)t.call(null,e[n],n,e);else{if(nr(e))return;const i=r?Object.getOwnPropertyNames(e):Object.keys(e),s=i.length;let l;for(n=0;n<s;n++)l=i[n],t.call(null,e[l],l,e)}}function ji(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 ct=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,ki=e=>!Nt(e)&&e!==ct;function no(){const{caseless:e,skipUndefined:t}=ki(this)&&this||{},r={},n=(o,i)=>{const s=e&&ji(r,i)||i;$r(r[s])&&$r(o)?r[s]=no(r[s],o):$r(o)?r[s]=no({},o):Ct(o)?r[s]=o.slice():(!t||!Nt(o))&&(r[s]=o)};for(let o=0,i=arguments.length;o<i;o++)arguments[o]&&ar(arguments[o],n);return r}const Wm=(e,t,r,{allOwnKeys:n}={})=>(ar(t,(o,i)=>{r&&me(o)?e[i]=_i(o,r):e[i]=o},{allOwnKeys:n}),e),qm=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Gm=(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)},Km=(e,t,r,n)=>{let o,i,s;const l={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)s=o[i],(!n||n(s,e,t))&&!l[s]&&(t[s]=e[s],l[s]=!0);e=r!==!1&&ro(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},Xm=e=>{if(!e)return null;if(Ct(e))return e;let t=e.length;if(!wi(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"&&ro(Uint8Array)),Zm=(e,t)=>{const n=(e&&e[Mr]).call(e);let o;for(;(o=n.next())&&!o.done;){const i=o.value;t.call(e,i[0],i[1])}},Qm=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},ef=we("HTMLFormElement"),tf=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,o){return n.toUpperCase()+o}),Si=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),rf=we("RegExp"),Ci=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};ar(r,(o,i)=>{let s;(s=t(o,i,e))!==!1&&(n[i]=s||o)}),Object.defineProperties(e,n)},nf=e=>{Ci(e,(t,r)=>{if(me(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(me(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},of=(e,t)=>{const r={},n=o=>{o.forEach(i=>{r[i]=!0})};return Ct(e)?n(e):n(String(e).split(t)),r},af=()=>{},sf=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function lf(e){return!!(e&&me(e.append)&&e[vi]==="FormData"&&e[Mr])}const cf=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 i=Ct(n)?[]:{};return ar(n,(s,l)=>{const c=r(s,o+1);!Nt(c)&&(i[l]=c)}),t[o]=void 0,i}}return n};return r(e,0)},df=we("AsyncFunction"),uf=e=>e&&(or(e)||me(e))&&me(e.then)&&me(e.catch),Ni=((e,t)=>e?setImmediate:t?((r,n)=>(ct.addEventListener("message",({source:o,data:i})=>{o===ct&&i===r&&n.length&&n.shift()()},!1),o=>{n.push(o),ct.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",me(ct.postMessage)),pf=typeof queueMicrotask<"u"?queueMicrotask.bind(ct):typeof process<"u"&&process.nextTick||Ni,k={isArray:Ct,isArrayBuffer:yi,isBuffer:nr,isFormData:Dm,isArrayBufferView:Tm,isString:Am,isNumber:wi,isBoolean:Pm,isObject:or,isPlainObject:$r,isEmptyObject:Om,isReadableStream:Fm,isRequest:Bm,isResponse:Um,isHeaders:Hm,isUndefined:Nt,isDate:Rm,isFile:Lm,isBlob:Im,isRegExp:rf,isFunction:me,isStream:zm,isURLSearchParams:$m,isTypedArray:Jm,isFileList:Mm,forEach:ar,merge:no,extend:Wm,trim:Vm,stripBOM:qm,inherits:Gm,toFlatObject:Km,kindOf:zr,kindOfTest:we,endsWith:Ym,toArray:Xm,forEachEntry:Zm,matchAll:Qm,isHTMLForm:ef,hasOwnProperty:Si,hasOwnProp:Si,reduceDescriptors:Ci,freezeMethods:nf,toObjectSet:of,toCamelCase:tf,noop:af,toFiniteNumber:sf,findKey:ji,global:ct,isContextDefined:ki,isSpecCompliantForm:lf,toJSONObject:cf,isAsyncFn:df,isThenable:uf,setImmediate:Ni,asap:pf,isIterable:e=>e!=null&&me(e[Mr])};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)}k.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:k.toJSONObject(this.config),code:this.code,status:this.status}}});const Ei=U.prototype,Ti={};["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=>{Ti[e]={value:e}}),Object.defineProperties(U,Ti),Object.defineProperty(Ei,"isAxiosError",{value:!0}),U.from=(e,t,r,n,o,i)=>{const s=Object.create(Ei);k.toFlatObject(e,s,function(u){return u!==Error.prototype},d=>d!=="isAxiosError");const l=e&&e.message?e.message:"Error",c=t==null&&e?e.code:t;return U.call(s,l,c,r,n,o),e&&s.cause==null&&Object.defineProperty(s,"cause",{value:e,configurable:!0}),s.name=e&&e.name||"Error",i&&Object.assign(s,i),s};const mf=null;function oo(e){return k.isPlainObject(e)||k.isArray(e)}function Ai(e){return k.endsWith(e,"[]")?e.slice(0,-2):e}function Pi(e,t,r){return e?e.concat(t).map(function(o,i){return o=Ai(o),!r&&i?"["+o+"]":o}).join(r?".":""):t}function ff(e){return k.isArray(e)&&!e.some(oo)}const hf=k.toFlatObject(k,{},null,function(t){return/^is[A-Z]/.test(t)});function Fr(e,t,r){if(!k.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=k.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(f,h){return!k.isUndefined(h[f])});const n=r.metaTokens,o=r.visitor||u,i=r.dots,s=r.indexes,c=(r.Blob||typeof Blob<"u"&&Blob)&&k.isSpecCompliantForm(t);if(!k.isFunction(o))throw new TypeError("visitor must be a function");function d(b){if(b===null)return"";if(k.isDate(b))return b.toISOString();if(k.isBoolean(b))return b.toString();if(!c&&k.isBlob(b))throw new U("Blob is not supported. Use a Buffer instead.");return k.isArrayBuffer(b)||k.isTypedArray(b)?c&&typeof Blob=="function"?new Blob([b]):Buffer.from(b):b}function u(b,f,h){let v=b;if(b&&!h&&typeof b=="object"){if(k.endsWith(f,"{}"))f=n?f:f.slice(0,-2),b=JSON.stringify(b);else if(k.isArray(b)&&ff(b)||(k.isFileList(b)||k.endsWith(f,"[]"))&&(v=k.toArray(b)))return f=Ai(f),v.forEach(function(w,j){!(k.isUndefined(w)||w===null)&&t.append(s===!0?Pi([f],j,i):s===null?f:f+"[]",d(w))}),!1}return oo(b)?!0:(t.append(Pi(h,f,i),d(b)),!1)}const p=[],m=Object.assign(hf,{defaultVisitor:u,convertValue:d,isVisitable:oo});function g(b,f){if(!k.isUndefined(b)){if(p.indexOf(b)!==-1)throw Error("Circular reference detected in "+f.join("."));p.push(b),k.forEach(b,function(v,y){(!(k.isUndefined(v)||v===null)&&o.call(t,v,k.isString(y)?y.trim():y,f,m))===!0&&g(v,f?f.concat(y):[y])}),p.pop()}}if(!k.isObject(e))throw new TypeError("data must be an object");return g(e),t}function Oi(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function ao(e,t){this._pairs=[],e&&Fr(e,this,t)}const Ri=ao.prototype;Ri.append=function(t,r){this._pairs.push([t,r])},Ri.toString=function(t){const r=t?function(n){return t.call(this,n,Oi)}:Oi;return this._pairs.map(function(o){return r(o[0])+"="+r(o[1])},"").join("&")};function gf(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Li(e,t,r){if(!t)return e;const n=r&&r.encode||gf;k.isFunction(r)&&(r={serialize:r});const o=r&&r.serialize;let i;if(o?i=o(t,r):i=k.isURLSearchParams(t)?t.toString():new ao(t,r).toString(n),i){const s=e.indexOf("#");s!==-1&&(e=e.slice(0,s)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class Ii{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){k.forEach(this.handlers,function(n){n!==null&&t(n)})}}const Mi={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},xf={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:ao,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},io=typeof window<"u"&&typeof document<"u",so=typeof navigator=="object"&&navigator||void 0,bf=io&&(!so||["ReactNative","NativeScript","NS"].indexOf(so.product)<0),_f=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",vf=io&&window.location.href||"http://localhost",ue={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:io,hasStandardBrowserEnv:bf,hasStandardBrowserWebWorkerEnv:_f,navigator:so,origin:vf},Symbol.toStringTag,{value:"Module"})),...xf};function yf(e,t){return Fr(e,new ue.classes.URLSearchParams,{visitor:function(r,n,o,i){return ue.isNode&&k.isBuffer(r)?(this.append(n,r.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}function wf(e){return k.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function jf(e){const t={},r=Object.keys(e);let n;const o=r.length;let i;for(n=0;n<o;n++)i=r[n],t[i]=e[i];return t}function zi(e){function t(r,n,o,i){let s=r[i++];if(s==="__proto__")return!0;const l=Number.isFinite(+s),c=i>=r.length;return s=!s&&k.isArray(o)?o.length:s,c?(k.hasOwnProp(o,s)?o[s]=[o[s],n]:o[s]=n,!l):((!o[s]||!k.isObject(o[s]))&&(o[s]=[]),t(r,n,o[s],i)&&k.isArray(o[s])&&(o[s]=jf(o[s])),!l)}if(k.isFormData(e)&&k.isFunction(e.entries)){const r={};return k.forEachEntry(e,(n,o)=>{t(wf(n),o,r,0)}),r}return null}function kf(e,t,r){if(k.isString(e))try{return(t||JSON.parse)(e),k.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const ir={transitional:Mi,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",o=n.indexOf("application/json")>-1,i=k.isObject(t);if(i&&k.isHTMLForm(t)&&(t=new FormData(t)),k.isFormData(t))return o?JSON.stringify(zi(t)):t;if(k.isArrayBuffer(t)||k.isBuffer(t)||k.isStream(t)||k.isFile(t)||k.isBlob(t)||k.isReadableStream(t))return t;if(k.isArrayBufferView(t))return t.buffer;if(k.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return yf(t,this.formSerializer).toString();if((l=k.isFileList(t))||n.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return Fr(l?{"files[]":t}:t,c&&new c,this.formSerializer)}}return i||o?(r.setContentType("application/json",!1),kf(t)):t}],transformResponse:[function(t){const r=this.transitional||ir.transitional,n=r&&r.forcedJSONParsing,o=this.responseType==="json";if(k.isResponse(t)||k.isReadableStream(t))return t;if(t&&k.isString(t)&&(n&&!this.responseType||o)){const s=!(r&&r.silentJSONParsing)&&o;try{return JSON.parse(t,this.parseReviver)}catch(l){if(s)throw l.name==="SyntaxError"?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:ue.classes.FormData,Blob:ue.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};k.forEach(["delete","get","head","post","put","patch"],e=>{ir.headers[e]={}});const Sf=k.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"]),Cf=e=>{const t={};let r,n,o;return e&&e.split(` 354 `).forEach(function(s){o=s.indexOf(":"),r=s.substring(0,o).trim().toLowerCase(),n=s.substring(o+1).trim(),!(!r||t[r]&&Sf[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t},Di=Symbol("internals");function sr(e){return e&&String(e).trim().toLowerCase()}function Br(e){return e===!1||e==null?e:k.isArray(e)?e.map(Br):String(e)}function Nf(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 Ef=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function lo(e,t,r,n,o){if(k.isFunction(n))return n.call(this,t,r);if(o&&(t=r),!!k.isString(t)){if(k.isString(n))return t.indexOf(n)!==-1;if(k.isRegExp(n))return n.test(t)}}function Tf(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function Af(e,t){const r=k.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(o,i,s){return this[n].call(this,t,o,i,s)},configurable:!0})})}let fe=class{constructor(t){t&&this.set(t)}set(t,r,n){const o=this;function i(l,c,d){const u=sr(c);if(!u)throw new Error("header name must be a non-empty string");const p=k.findKey(o,u);(!p||o[p]===void 0||d===!0||d===void 0&&o[p]!==!1)&&(o[p||c]=Br(l))}const s=(l,c)=>k.forEach(l,(d,u)=>i(d,u,c));if(k.isPlainObject(t)||t instanceof this.constructor)s(t,r);else if(k.isString(t)&&(t=t.trim())&&!Ef(t))s(Cf(t),r);else if(k.isObject(t)&&k.isIterable(t)){let l={},c,d;for(const u of t){if(!k.isArray(u))throw TypeError("Object iterator must return a key-value pair");l[d=u[0]]=(c=l[d])?k.isArray(c)?[...c,u[1]]:[c,u[1]]:u[1]}s(l,r)}else t!=null&&i(r,t,n);return this}get(t,r){if(t=sr(t),t){const n=k.findKey(this,t);if(n){const o=this[n];if(!r)return o;if(r===!0)return Nf(o);if(k.isFunction(r))return r.call(this,o,n);if(k.isRegExp(r))return r.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=sr(t),t){const n=k.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||lo(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let o=!1;function i(s){if(s=sr(s),s){const l=k.findKey(n,s);l&&(!r||lo(n,n[l],l,r))&&(delete n[l],o=!0)}}return k.isArray(t)?t.forEach(i):i(t),o}clear(t){const r=Object.keys(this);let n=r.length,o=!1;for(;n--;){const i=r[n];(!t||lo(this,this[i],i,t,!0))&&(delete this[i],o=!0)}return o}normalize(t){const r=this,n={};return k.forEach(this,(o,i)=>{const s=k.findKey(n,i);if(s){r[s]=Br(o),delete r[i];return}const l=t?Tf(i):String(i).trim();l!==i&&delete r[i],r[l]=Br(o),n[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return k.forEach(this,(n,o)=>{n!=null&&n!==!1&&(r[o]=t&&k.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(` 355 `)}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[Di]=this[Di]={accessors:{}}).accessors,o=this.prototype;function i(s){const l=sr(s);n[l]||(Af(o,s),n[l]=!0)}return k.isArray(t)?t.forEach(i):i(t),this}};fe.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),k.reduceDescriptors(fe.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}}),k.freezeMethods(fe);function co(e,t){const r=this||ir,n=t||r,o=fe.from(n.headers);let i=n.data;return k.forEach(e,function(l){i=l.call(r,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function $i(e){return!!(e&&e.__CANCEL__)}function Et(e,t,r){U.call(this,e??"canceled",U.ERR_CANCELED,t,r),this.name="CanceledError"}k.inherits(Et,U,{__CANCEL__:!0});function Fi(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 Pf(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Of(e,t){e=e||10;const r=new Array(e),n=new Array(e);let o=0,i=0,s;return t=t!==void 0?t:1e3,function(c){const d=Date.now(),u=n[i];s||(s=d),r[o]=c,n[o]=d;let p=i,m=0;for(;p!==o;)m+=r[p++],p=p%e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),d-s<t)return;const g=u&&d-u;return g?Math.round(m*1e3/g):void 0}}function Rf(e,t){let r=0,n=1e3/t,o,i;const s=(d,u=Date.now())=>{r=u,o=null,i&&(clearTimeout(i),i=null),e(...d)};return[(...d)=>{const u=Date.now(),p=u-r;p>=n?s(d,u):(o=d,i||(i=setTimeout(()=>{i=null,s(o)},n-p)))},()=>o&&s(o)]}const Ur=(e,t,r=3)=>{let n=0;const o=Of(50,250);return Rf(i=>{const s=i.loaded,l=i.lengthComputable?i.total:void 0,c=s-n,d=o(c),u=s<=l;n=s;const p={loaded:s,total:l,progress:l?s/l:void 0,bytes:c,rate:d||void 0,estimated:d&&l&&u?(l-s)/d:void 0,event:i,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(p)},r)},Bi=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},Ui=e=>(...t)=>k.asap(()=>e(...t)),Lf=ue.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,ue.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(ue.origin),ue.navigator&&/(msie|trident)/i.test(ue.navigator.userAgent)):()=>!0,If=ue.hasStandardBrowserEnv?{write(e,t,r,n,o,i,s){if(typeof document>"u")return;const l=[`${e}=${encodeURIComponent(t)}`];k.isNumber(r)&&l.push(`expires=${new Date(r).toUTCString()}`),k.isString(n)&&l.push(`path=${n}`),k.isString(o)&&l.push(`domain=${o}`),i===!0&&l.push("secure"),k.isString(s)&&l.push(`SameSite=${s}`),document.cookie=l.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Mf(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function zf(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Hi(e,t,r){let n=!Mf(t);return e&&(n||r==!1)?zf(e,t):t}const Vi=e=>e instanceof fe?{...e}:e;function dt(e,t){t=t||{};const r={};function n(d,u,p,m){return k.isPlainObject(d)&&k.isPlainObject(u)?k.merge.call({caseless:m},d,u):k.isPlainObject(u)?k.merge({},u):k.isArray(u)?u.slice():u}function o(d,u,p,m){if(k.isUndefined(u)){if(!k.isUndefined(d))return n(void 0,d,p,m)}else return n(d,u,p,m)}function i(d,u){if(!k.isUndefined(u))return n(void 0,u)}function s(d,u){if(k.isUndefined(u)){if(!k.isUndefined(d))return n(void 0,d)}else return n(void 0,u)}function l(d,u,p){if(p in t)return n(d,u);if(p in e)return n(void 0,d)}const c={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:l,headers:(d,u,p)=>o(Vi(d),Vi(u),p,!0)};return k.forEach(Object.keys({...e,...t}),function(u){const p=c[u]||o,m=p(e[u],t[u],u);k.isUndefined(m)&&p!==l||(r[u]=m)}),r}const Wi=e=>{const t=dt({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:o,xsrfCookieName:i,headers:s,auth:l}=t;if(t.headers=s=fe.from(s),t.url=Li(Hi(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),l&&s.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),k.isFormData(r)){if(ue.hasStandardBrowserEnv||ue.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(k.isFunction(r.getHeaders)){const c=r.getHeaders(),d=["content-type","content-length"];Object.entries(c).forEach(([u,p])=>{d.includes(u.toLowerCase())&&s.set(u,p)})}}if(ue.hasStandardBrowserEnv&&(n&&k.isFunction(n)&&(n=n(t)),n||n!==!1&&Lf(t.url))){const c=o&&i&&If.read(i);c&&s.set(o,c)}return t},Df=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(r,n){const o=Wi(e);let i=o.data;const s=fe.from(o.headers).normalize();let{responseType:l,onUploadProgress:c,onDownloadProgress:d}=o,u,p,m,g,b;function f(){g&&g(),b&&b(),o.cancelToken&&o.cancelToken.unsubscribe(u),o.signal&&o.signal.removeEventListener("abort",u)}let h=new XMLHttpRequest;h.open(o.method.toUpperCase(),o.url,!0),h.timeout=o.timeout;function v(){if(!h)return;const w=fe.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),C={data:!l||l==="text"||l==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:w,config:e,request:h};Fi(function(S){r(S),f()},function(S){n(S),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||Mi;o.timeoutErrorMessage&&(j=o.timeoutErrorMessage),n(new U(j,C.clarifyTimeoutError?U.ETIMEDOUT:U.ECONNABORTED,e,h)),h=null},i===void 0&&s.setContentType(null),"setRequestHeader"in h&&k.forEach(s.toJSON(),function(j,C){h.setRequestHeader(C,j)}),k.isUndefined(o.withCredentials)||(h.withCredentials=!!o.withCredentials),l&&l!=="json"&&(h.responseType=o.responseType),d&&([m,b]=Ur(d,!0),h.addEventListener("progress",m)),c&&h.upload&&([p,g]=Ur(c),h.upload.addEventListener("progress",p),h.upload.addEventListener("loadend",g)),(o.cancelToken||o.signal)&&(u=w=>{h&&(n(!w||w.type?new Et(null,e,h):w),h.abort(),h=null)},o.cancelToken&&o.cancelToken.subscribe(u),o.signal&&(o.signal.aborted?u():o.signal.addEventListener("abort",u)));const y=Pf(o.url);if(y&&ue.protocols.indexOf(y)===-1){n(new U("Unsupported protocol "+y+":",U.ERR_BAD_REQUEST,e));return}h.send(i||null)})},$f=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let n=new AbortController,o;const i=function(d){if(!o){o=!0,l();const u=d instanceof Error?d:this.reason;n.abort(u instanceof U?u:new Et(u instanceof Error?u.message:u))}};let s=t&&setTimeout(()=>{s=null,i(new U(`timeout ${t} of ms exceeded`,U.ETIMEDOUT))},t);const l=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(d=>{d.unsubscribe?d.unsubscribe(i):d.removeEventListener("abort",i)}),e=null)};e.forEach(d=>d.addEventListener("abort",i));const{signal:c}=n;return c.unsubscribe=()=>k.asap(l),c}},Ff=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},Bf=async function*(e,t){for await(const r of Uf(e))yield*Ff(r,t)},Uf=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()}},qi=(e,t,r,n)=>{const o=Bf(e,t);let i=0,s,l=c=>{s||(s=!0,n&&n(c))};return new ReadableStream({async pull(c){try{const{done:d,value:u}=await o.next();if(d){l(),c.close();return}let p=u.byteLength;if(r){let m=i+=p;r(m)}c.enqueue(new Uint8Array(u))}catch(d){throw l(d),d}},cancel(c){return l(c),o.return()}},{highWaterMark:2})},Gi=64*1024,{isFunction:Hr}=k,Hf=(({Request:e,Response:t})=>({Request:e,Response:t}))(k.global),{ReadableStream:Ki,TextEncoder:Yi}=k.global,Xi=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Vf=e=>{e=k.merge.call({skipUndefined:!0},Hf,e);const{fetch:t,Request:r,Response:n}=e,o=t?Hr(t):typeof fetch=="function",i=Hr(r),s=Hr(n);if(!o)return!1;const l=o&&Hr(Ki),c=o&&(typeof Yi=="function"?(b=>f=>b.encode(f))(new Yi):async b=>new Uint8Array(await new r(b).arrayBuffer())),d=i&&l&&Xi(()=>{let b=!1;const f=new r(ue.origin,{body:new Ki,method:"POST",get duplex(){return b=!0,"half"}}).headers.has("Content-Type");return b&&!f}),u=s&&l&&Xi(()=>k.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(k.isBlob(b))return b.size;if(k.isSpecCompliantForm(b))return(await new r(ue.origin,{method:"POST",body:b}).arrayBuffer()).byteLength;if(k.isArrayBufferView(b)||k.isArrayBuffer(b))return b.byteLength;if(k.isURLSearchParams(b)&&(b=b+""),k.isString(b))return(await c(b)).byteLength},g=async(b,f)=>{const h=k.toFiniteNumber(b.getContentLength());return h??m(f)};return async b=>{let{url:f,method:h,data:v,signal:y,cancelToken:w,timeout:j,onDownloadProgress:C,onUploadProgress:N,responseType:S,headers:E,withCredentials:T="same-origin",fetchOptions:A}=Wi(b),R=t||fetch;S=S?(S+"").toLowerCase():"text";let L=$f([y,w&&w.toAbortSignal()],j),B=null;const M=L&&L.unsubscribe&&(()=>{L.unsubscribe()});let O;try{if(N&&d&&h!=="get"&&h!=="head"&&(O=await g(E,v))!==0){let oe=new r(f,{method:"POST",body:v,duplex:"half"}),ge;if(k.isFormData(v)&&(ge=oe.headers.get("content-type"))&&E.setContentType(ge),oe.body){const[_e,pe]=Bi(O,Ur(Ui(N)));v=qi(oe.body,Gi,_e,pe)}}k.isString(T)||(T=T?"include":"omit");const P=i&&"credentials"in r.prototype,z={...A,signal:L,method:h.toUpperCase(),headers:E.normalize().toJSON(),body:v,duplex:"half",credentials:P?T:void 0};B=i&&new r(f,z);let I=await(i?R(B,A):R(f,z));const q=u&&(S==="stream"||S==="response");if(u&&(C||q&&M)){const oe={};["status","statusText","headers"].forEach(K=>{oe[K]=I[K]});const ge=k.toFiniteNumber(I.headers.get("content-length")),[_e,pe]=C&&Bi(ge,Ur(Ui(C),!0))||[];I=new n(qi(I.body,Gi,_e,()=>{pe&&pe(),M&&M()}),oe)}S=S||"text";let te=await p[k.findKey(p,S)||"text"](I,b);return!q&&M&&M(),await new Promise((oe,ge)=>{Fi(oe,ge,{data:te,headers:fe.from(I.headers),status:I.status,statusText:I.statusText,config:b,request:B})})}catch(P){throw M&&M(),P&&P.name==="TypeError"&&/Load failed|fetch/i.test(P.message)?Object.assign(new U("Network Error",U.ERR_NETWORK,b,B),{cause:P.cause||P}):U.from(P,P&&P.code,b,B)}}},Wf=new Map,Ji=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:o}=t,i=[n,o,r];let s=i.length,l=s,c,d,u=Wf;for(;l--;)c=i[l],d=u.get(c),d===void 0&&u.set(c,d=l?new Map:Vf(t)),u=d;return d};Ji();const uo={http:mf,xhr:Df,fetch:{get:Ji}};k.forEach(uo,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Zi=e=>`- ${e}`,qf=e=>k.isFunction(e)||e===null||e===!1;function Gf(e,t){e=k.isArray(e)?e:[e];const{length:r}=e;let n,o;const i={};for(let s=0;s<r;s++){n=e[s];let l;if(o=n,!qf(n)&&(o=uo[(l=String(n)).toLowerCase()],o===void 0))throw new U(`Unknown adapter '${l}'`);if(o&&(k.isFunction(o)||(o=o.get(t))))break;i[l||"#"+s]=o}if(!o){const s=Object.entries(i).map(([c,d])=>`adapter ${c} `+(d===!1?"is not supported by the environment":"is not available in the build"));let l=r?s.length>1?`since : 356 356 `+s.map(Zi).join(` 357 `):" "+Zi(s[0]):"as no adapter specified";throw new U("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return o}const Qi={getAdapter: Wf,adapters:uo};function po(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Et(null,e)}function es(e){return po(e),e.headers=fe.from(e.headers),e.data=co.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Qi.getAdapter(e.adapter||ir.adapter,e)(e).then(function(n){return po(e),n.data=co.call(e,e.transformResponse,n),n.headers=fe.from(n.headers),n},function(n){return $i(n)||(po(e),n&&n.response&&(n.response.data=co.call(e,e.transformResponse,n.response),n.response.headers=fe.from(n.response.headers))),Promise.reject(n)})}const ts="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 rs={};Vr.transitional=function(t,r,n){function o(i,s){return"[Axios v"+ts+"] Transitional option '"+i+"'"+s+(n?". "+n:"")}return(i,s,l)=>{if(t===!1)throw new U(o(s," has been removed"+(r?" in "+r:"")),U.ERR_DEPRECATED);return r&&!rs[s]&&(rs[s]=!0,console.warn(o(s," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(i,s,l):!0}},Vr.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function qf(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 i=n[o],s=t[i];if(s){const l=e[i],c=l===void 0||s(l,i,e);if(c!==!0)throw new U("option "+i+" must be "+c,U.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new U("Unknown option "+i,U.ERR_BAD_OPTION)}}const Wr={assertOptions:qf,validators:Vr},Te=Wr.validators;let ut=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Ii,response:new Ii}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const i=o.stack?o.stack.replace(/^.+\n/,""):"";try{n.stack?i&&!String(n.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(n.stack+=`358 `+i):n.stack=i}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=dt(this.defaults,r);const{transitional:n,paramsSerializer:o,headers:i}=r;n!==void 0&&Wr.assertOptions(n,{silentJSONParsing:Te.transitional(Te.boolean),forcedJSONParsing:Te.transitional(Te.boolean),clarifyTimeoutError:Te.transitional(Te.boolean)},!1),o!=null&&(k.isFunction(o)?r.paramsSerializer={serialize:o}:Wr.assertOptions(o,{encode:Te.function,serialize:Te.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),Wr.assertOptions(r,{baseUrl:Te.spelling("baseURL"),withXsrfToken:Te.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let s=i&&k.merge(i.common,i[r.method]);i&&k.forEach(["delete","get","head","post","put","patch","common"],b=>{delete i[b]}),r.headers=fe.concat(s,i);const l=[];let c=!0;this.interceptors.request.forEach(function(f){typeof f.runWhen=="function"&&f.runWhen(r)===!1||(c=c&&f.synchronous,l.unshift(f.fulfilled,f.rejected))});const d=[];this.interceptors.response.forEach(function(f){d.push(f.fulfilled,f.rejected)});let u,p=0,m;if(!c){const b=[es.bind(this),void 0];for(b.unshift(...l),b.push(...d),m=b.length,u=Promise.resolve(r);p<m;)u=u.then(b[p++],b[p++]);return u}m=l.length;let g=r;for(;p<m;){const b=l[p++],f=l[p++];try{g=b(g)}catch(h){f.call(this,h);break}}try{u=es.call(this,g)}catch(b){return Promise.reject(b)}for(p=0,m=d.length;p<m;)u=u.then(d[p++],d[p++]);return u}getUri(t){t=dt(this.defaults,t);const r=Hi(t.baseURL,t.url,t.allowAbsoluteUrls);return Li(r,t.params,t.paramsSerializer)}};k.forEach(["delete","get","head","options"],function(t){ut.prototype[t]=function(r,n){return this.request(dt(n||{},{method:t,url:r,data:(n||{}).data}))}}),k.forEach(["post","put","patch"],function(t){function r(n){return function(i,s,l){return this.request(dt(l||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:s}))}}ut.prototype[t]=r(),ut.prototype[t+"Form"]=r(!0)});let Gf=class Cd{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(i){r=i});const n=this;this.promise.then(o=>{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](o);n._listeners=null}),this.promise.then=o=>{let i;const s=new Promise(l=>{n.subscribe(l),i=l}).then(o);return s.cancel=function(){n.unsubscribe(i)},s},t(function(i,s,l){n.reason||(n.reason=new Et(i,s,l),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new Cd(function(o){t=o}),cancel:t}}};function Kf(e){return function(r){return e.apply(null,r)}}function Yf(e){return k.isObject(e)&&e.isAxiosError===!0}const mo={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(mo).forEach(([e,t])=>{mo[t]=e});function ns(e){const t=new ut(e),r=_i(ut.prototype.request,t);return k.extend(r,ut.prototype,t,{allOwnKeys:!0}),k.extend(r,t,null,{allOwnKeys:!0}),r.create=function(o){return ns(dt(e,o))},r}const re=ns(ir);re.Axios=ut,re.CanceledError=Et,re.CancelToken=Gf,re.isCancel=$i,re.VERSION=ts,re.toFormData=Fr,re.AxiosError=U,re.Cancel=re.CanceledError,re.all=function(t){return Promise.all(t)},re.spread=Kf,re.isAxiosError=Yf,re.mergeConfig=dt,re.AxiosHeaders=fe,re.formToJSON=e=>zi(k.isHTMLForm(e)?new FormData(e):e),re.getAdapter=Qi.getAdapter,re.HttpStatusCode=mo,re.default=re;const{Axios:_1,AxiosError:v1,CanceledError:y1,isCancel:w1,CancelToken:j1,VERSION:k1,all:S1,Cancel:C1,isAxiosError:N1,spread:E1,toFormData:T1,AxiosHeaders:A1,HttpStatusCode:P1,formToJSON:O1,getAdapter:R1,mergeConfig:L1}=re,os=ecommreelsInfo,he=re.create({baseURL:`${os.apiBase}`,headers:{"X-WP-Nonce":os.nonce,"Content-Type":"application/json"}}),Xf=()=>{const[e,t]=_.useState(!1),[r,n]=_.useState(!1),o=_.useCallback(async s=>{try{t(!0);const l={styles:ot,story_ids:s},c=await he.post("stories/manage-group-stories",l);return G.success("Group created successfully!"),c.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)}},[]),i=_.useCallback(async(s,l,c)=>{try{return n(!0),await he.delete(`story/${s}`),l(d=>d.filter(u=>u.id!==s)),c?.silent||G.success("Reel deleted successfully!"),{ok:!0}}catch(d){const u=d instanceof Error?d.message:"Something went wrong. Try again later!";return c?.silent||G.error(u),{ok:!1,message:u}}finally{n(!1)}},[]);return{styles:ot,isCreating:e,isDeleting:r,createGroup:o,deleteReel:i}};function fo(e,t){const[r,n]=_.useState(e);return _.useEffect(()=>{const o=setTimeout(()=>{n(e)},t);return()=>{clearTimeout(o)}},[e,t]),r}const as=e=>{const[t,r]=_.useState([]),[n,o]=_.useState(1),[i,s]=_.useState(!0),[l,c]=_.useState(!1),[d,u]=_.useState(!1),[p,m]=_.useState(""),g=fo(p,500),b=_.useRef(!0),f=_.useCallback(async w=>{w===1&&b.current?u(!0):c(!0);try{const j={page:w,per_page:20};e&&(j.group_id=e),g&&(j.search=g);const C=await he.get("stories",{params:j}),N=C.data,S=parseInt(C.headers["x-wp-totalpages"]);r(E=>w===1?N:[...E,...N]),o(w+1),s(w<S)}catch(j){j instanceof Error?G.error(j.message):G.error("Something went wrong. Try again later!")}finally{b.current&&(b.current=!1),c(!1),u(!1)}},[e,g]),h=_.useCallback(()=>{o(1),r([]),f(1)},[f]);_.useEffect(()=>{h()},[g,h]);const v=_.useRef(null),y=_.useCallback(w=>{l||(v.current&&v.current.disconnect(),v.current=new IntersectionObserver(j=>{j[0].isIntersecting&&i&&f(n)}),w&&v.current.observe(w))},[l,i,n,f]);return _.useEffect(()=>()=>{v.current&&v.current.disconnect()},[]),{allReels:t,setAllReels:r,searchTerm:p,setSearchTerm:m,isSearching:l,isLoading:d,lastStoryElementRef:y,refreshReels:h}};function Jf(){const e=Ne(),{allReels:t,setAllReels:r,isSearching:n,lastStoryElementRef:o,searchTerm:i,setSearchTerm:s,isLoading:l}=as(null),{styles:c,isCreating:d,isDeleting:u,createGroup:p,deleteReel:m}=Xf(),[g,b]=_.useState(null),[f,h]=_.useState(null),[v,y]=_.useState(null),[w,j]=_.useState([]),C=async()=>{const A=await p(w);A&&e(`?view=${X.mg}&gid=${A}`)},N=()=>{j(t.map(A=>A.id))},S=A=>{j(R=>R.includes(A)?R.filter(L=>L!==A):[...R,A])},E=()=>{w.length&&h(w)},T=_.useCallback(async()=>{if(g){await m(g,r),b(null);return}if(f?.length){const A=await Promise.all(f.map(M=>m(M,r,{silent:!0}))),R=f.filter((M,O)=>A[O]?.ok),L=R.length,B=f.length-L;L&&(r(M=>M.filter(O=>!R.includes(O.id))),j(M=>M.filter(O=>!R.includes(O)))),L&&G.success(`${L} reels deleted successfully!`),B&&G.error(`${B} reels failed to delete.`),h(null)}},[m,g,f,r]);return l&&!t.length?a.jsx(Lr,{}):a.jsxs(a.Fragment,{children:[(g||f)&&a.jsx(Or,{onReject:()=>{b(null),h(null)},onAccept:T,isLoading:u,message:f?.length?`Are you sure you want to remove ${f.length} reels?`:"Are you sure you want to remove this reel?"}),a.jsx(kt,{left:[a.jsx(St,{name:"All Reels",Icon:ap},"page"),a.jsx(tr,{cb:()=>e(`?view=${X.ag}`)},"back")],center:[a.jsx(Ir,{},"reel-wp")],right:[a.jsx(Rr,{to:`?view=${X.cr}&from=${X.ar}`,text:"Add Reel",Icon:yt},"add-reel-all-reel")]}),a.jsx(rr,{breads:[{label:"Dashboard",href:`?view=${X.ag}`},{label:"All Reels"}]}),a.jsxs("div",{className:"ecr-admin-panel ecr-admin-panel--reels",children:[a.jsx(Np,{selectedReelIds:w,handleSelectAll:N,clearSelection:()=>j([]),searchTerm:i,setSearchTerm:s,isCreating:d,handleCreateGroup:C,handleBulkDelete:E}),t.length?a.jsx(jm,{reels:t,styles:c,selectedReelIds:w,onSelectReel:S,onDeleteReel:b,onPreviewReel:y,lastStoryElementRef:o}):!n&&!l?a.jsx(Ap,{}):null,n&&a.jsx(Pp,{isFullScreen:!t.length})]}),!!v&&a.jsx(um,{previewReel:v,setPreviewReel:y})]})}const Zf=()=>{const[e,t]=_.useState(!1),r=_.useCallback(async({storyId:n,storyTitle:o,uploadedFiles:i,links:s,thumbnail:l})=>{try{t(!0);const c={story_title:o,files:i,thumbnail:l,links:s};n&&(c.story_id=n);const d=await he.post("files",c);return G.success(`Story ${n?"updated":"created"} successfully!`),d.data.story_id}catch(c){return c instanceof Error?G.error(c.message):G.error("Something went wrong. Try again later!"),null}finally{t(!1)}},[]);return{isSaving:e,saveStory:r}},ho=({isSaving:e,onSave:t,text:r="Save",className:n,...o})=>a.jsxs(ne,{onClick:t,className:$("ecr-admin-save-button",n),...o,children:[e?a.jsx(it,{className:"ecr-admin-save-button__icon ecr-admin-save-button__icon--spin"}):a.jsx(cp,{className:"ecr-admin-save-button__icon"})," ",r]}),is=({setIsEdited:e,title:t,setTitle:r,placeholder:n,style:o})=>a.jsx("div",{children:a.jsx("input",{style:o,className:"ecr-admin-title-input",type:"text",value:t,placeholder:n,onChange:i=>{e&&e(!0),r(i.target.value)}})}),Qf=({uploadedFiles:e,links:t,storyTitle:r,setStoryTitle:n,thumbnail:o})=>{const i=Ne(),[s]=Zt(),l=s.get("sid"),c=s.get("from")||X.ag,d=s.get("gid"),{isSaving:u,saveStory:p}=Zf(),m=async()=>{u||!await p({storyId:l,storyTitle:r,uploadedFiles:e,links:t,thumbnail:o})||i(`?view=${c}${d?`&gid=${d}`:""}`,{replace:!0})};return a.jsxs(a.Fragment,{children:[a.jsx(kt,{left:[a.jsx(St,{name:l?"Update Reel":"Add Reel",Icon:yt},"page"),a.jsx(tr,{},"back")],center:[a.jsx(is,{placeholder:"Enter reel title",title:r,setTitle:n},"title")],right:[a.jsx(ho,{onSave:m,isSaving:u,disabled:!e.length},"save")]}),a.jsx(rr,{breads:[{label:"Dashboard",href:"?view=my-reels"},{label:l?"Update Reel":"Add Reel"}]})]})};function H(e,t,{checkForDefaultPrevented:r=!0}={}){return function(o){if(e?.(o),r===!1||!o.defaultPrevented)return t?.(o)}}function eh(e,t){const r=x.createContext(t),n=i=>{const{children:s,...l}=i,c=x.useMemo(()=>l,Object.values(l));return a.jsx(r.Provider,{value:c,children:s})};n.displayName=e+"Provider";function o(i){const s=x.useContext(r);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[n,o]}function Ve(e,t=[]){let r=[];function n(i,s){const l=x.createContext(s),c=r.length;r=[...r,s];const d=p=>{const{scope:m,children:g,...b}=p,f=m?.[e]?.[c]||l,h=x.useMemo(()=>b,Object.values(b));return a.jsx(f.Provider,{value:h,children:g})};d.displayName=i+"Provider";function u(p,m){const g=m?.[e]?.[c]||l,b=x.useContext(g);if(b)return b;if(s!==void 0)return s;throw new Error(`\`${p}\` must be used within \`${i}\``)}return[d,u]}const o=()=>{const i=r.map(s=>x.createContext(s));return function(l){const c=l?.[e]||i;return x.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return o.scopeName=e,[n,th(o,...t)]}function th(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=n.reduce((l,{useScope:c,scopeName:d})=>{const p=c(i)[`__scope${d}`];return{...l,...p}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return r.scopeName=t.scopeName,r}var rh=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],W=rh.reduce((e,t)=>{const r=st(`Primitive.${t}`),n=x.forwardRef((o,i)=>{const{asChild:s,...l}=o,c=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function nh(e,t){e&&xr.flushSync(()=>e.dispatchEvent(t))}function We(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...r)=>t.current?.(...r),[])}function oh(e,t=globalThis?.document){const r=We(e);x.useEffect(()=>{const n=o=>{o.key==="Escape"&&r(o)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var ah="DismissableLayer",go="dismissableLayer.update",ih="dismissableLayer.pointerDownOutside",sh="dismissableLayer.focusOutside",ss,ls=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),qr=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:l,...c}=e,d=x.useContext(ls),[u,p]=x.useState(null),m=u?.ownerDocument??globalThis?.document,[,g]=x.useState({}),b=J(t,S=>p(S)),f=Array.from(d.layers),[h]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),v=f.indexOf(h),y=u?f.indexOf(u):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,j=y>=v,C=dh(S=>{const E=S.target,T=[...d.branches].some(A=>A.contains(E));!j||T||(o?.(S),s?.(S),S.defaultPrevented||l?.())},m),N=uh(S=>{const E=S.target;[...d.branches].some(A=>A.contains(E))||(i?.(S),s?.(S),S.defaultPrevented||l?.())},m);return oh(S=>{y===d.layers.size-1&&(n?.(S),!S.defaultPrevented&&l&&(S.preventDefault(),l()))},m),x.useEffect(()=>{if(u)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(ss=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(u)),d.layers.add(u),cs(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=ss)}},[u,m,r,d]),x.useEffect(()=>()=>{u&&(d.layers.delete(u),d.layersWithOutsidePointerEventsDisabled.delete(u),cs())},[u,d]),x.useEffect(()=>{const S=()=>g({});return document.addEventListener(go,S),()=>document.removeEventListener(go,S)},[]),a.jsx(W.div,{...c,ref:b,style:{pointerEvents:w?j?"auto":"none":void 0,...e.style},onFocusCapture:H(e.onFocusCapture,N.onFocusCapture),onBlurCapture:H(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:H(e.onPointerDownCapture,C.onPointerDownCapture)})});qr.displayName=ah;var lh="DismissableLayerBranch",ch=x.forwardRef((e,t)=>{const r=x.useContext(ls),n=x.useRef(null),o=J(t,n);return x.useEffect(()=>{const i=n.current;if(i)return r.branches.add(i),()=>{r.branches.delete(i)}},[r.branches]),a.jsx(W.div,{...e,ref:o})});ch.displayName=lh;function dh(e,t=globalThis?.document){const r=We(e),n=x.useRef(!1),o=x.useRef(()=>{});return x.useEffect(()=>{const i=l=>{if(l.target&&!n.current){let c=function(){ds(ih,r,d,{discrete:!0})};const d={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);n.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function uh(e,t=globalThis?.document){const r=We(e),n=x.useRef(!1);return x.useEffect(()=>{const o=i=>{i.target&&!n.current&&ds(sh,r,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function cs(){const e=new CustomEvent(go);document.dispatchEvent(e)}function ds(e,t,r,{discrete:n}){const o=r.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?nh(o,i):o.dispatchEvent(i)}var xo=0;function bo(){x.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??us()),document.body.insertAdjacentElement("beforeend",e[1]??us()),xo++,()=>{xo===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),xo--}},[])}function us(){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 _o="focusScope.autoFocusOnMount",vo="focusScope.autoFocusOnUnmount",ps={bubbles:!1,cancelable:!0},ph="FocusScope",Gr=x.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[l,c]=x.useState(null),d=We(o),u=We(i),p=x.useRef(null),m=J(t,f=>c(f)),g=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(n){let f=function(w){if(g.paused||!l)return;const j=w.target;l.contains(j)?p.current=j:qe(p.current,{select:!0})},h=function(w){if(g.paused||!l)return;const j=w.relatedTarget;j!==null&&(l.contains(j)||qe(p.current,{select:!0}))},v=function(w){if(document.activeElement===document.body)for(const C of w)C.removedNodes.length>0&&qe(l)};document.addEventListener("focusin",f),document.addEventListener("focusout",h);const y=new MutationObserver(v);return l&&y.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",f),document.removeEventListener("focusout",h),y.disconnect()}}},[n,l,g.paused]),x.useEffect(()=>{if(l){hs.add(g);const f=document.activeElement;if(!l.contains(f)){const v=new CustomEvent(_o,ps);l.addEventListener(_o,d),l.dispatchEvent(v),v.defaultPrevented||(mh(bh(ms(l)),{select:!0}),document.activeElement===f&&qe(l))}return()=>{l.removeEventListener(_o,d),setTimeout(()=>{const v=new CustomEvent(vo,ps);l.addEventListener(vo,u),l.dispatchEvent(v),v.defaultPrevented||qe(f??document.body,{select:!0}),l.removeEventListener(vo,u),hs.remove(g)},0)}}},[l,d,u,g]);const b=x.useCallback(f=>{if(!r&&!n||g.paused)return;const h=f.key==="Tab"&&!f.altKey&&!f.ctrlKey&&!f.metaKey,v=document.activeElement;if(h&&v){const y=f.currentTarget,[w,j]=fh(y);w&&j?!f.shiftKey&&v===j?(f.preventDefault(),r&&qe(w,{select:!0})):f.shiftKey&&v===w&&(f.preventDefault(),r&&qe(j,{select:!0})):v===y&&f.preventDefault()}},[r,n,g.paused]);return a.jsx(W.div,{tabIndex:-1,...s,ref:m,onKeyDown:b})});Gr.displayName=ph;function mh(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(qe(n,{select:t}),document.activeElement!==r)return}function fh(e){const t=ms(e),r=fs(t,e),n=fs(t.reverse(),e);return[r,n]}function ms(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 fs(e,t){for(const r of e)if(!hh(r,{upTo:t}))return r}function hh(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 gh(e){return e instanceof HTMLInputElement&&"select"in e}function qe(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&gh(e)&&t&&e.select()}}var hs=xh();function xh(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=gs(e,t),e.unshift(t)},remove(t){e=gs(e,t),e[0]?.resume()}}}function gs(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function bh(e){return e.filter(t=>t.tagName!=="A")}var le=globalThis?.document?x.useLayoutEffect:()=>{},_h=x[" useId ".trim().toString()]||(()=>{}),vh=0;function Ae(e){const[t,r]=x.useState(_h());return le(()=>{r(n=>n??String(vh++))},[e]),e||(t?`radix-${t}`:"")}const yh=["top","right","bottom","left"],Ge=Math.min,xe=Math.max,Kr=Math.round,Yr=Math.floor,Pe=e=>({x:e,y:e}),wh={left:"right",right:"left",bottom:"top",top:"bottom"},jh={start:"end",end:"start"};function yo(e,t,r){return xe(e,Ge(t,r))}function $e(e,t){return typeof e=="function"?e(t):e}function Fe(e){return e.split("-")[0]}function Tt(e){return e.split("-")[1]}function wo(e){return e==="x"?"y":"x"}function jo(e){return e==="y"?"height":"width"}const kh=new Set(["top","bottom"]);function Oe(e){return kh.has(Fe(e))?"y":"x"}function ko(e){return wo(Oe(e))}function Sh(e,t,r){r===void 0&&(r=!1);const n=Tt(e),o=ko(e),i=jo(o);let s=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Xr(s)),[s,Xr(s)]}function Ch(e){const t=Xr(e);return[So(e),t,So(t)]}function So(e){return e.replace(/start|end/g,t=>jh[t])}const xs=["left","right"],bs=["right","left"],Nh=["top","bottom"],Eh=["bottom","top"];function Th(e,t,r){switch(e){case"top":case"bottom":return r?t?bs:xs:t?xs:bs;case"left":case"right":return t?Nh:Eh;default:return[]}}function Ah(e,t,r,n){const o=Tt(e);let i=Th(Fe(e),r==="start",n);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(So)))),i}function Xr(e){return e.replace(/left|right|bottom|top/g,t=>wh[t])}function Ph(e){return{top:0,right:0,bottom:0,left:0,...e}}function _s(e){return typeof e!="number"?Ph(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 vs(e,t,r){let{reference:n,floating:o}=e;const i=Oe(t),s=ko(t),l=jo(s),c=Fe(t),d=i==="y",u=n.x+n.width/2-o.width/2,p=n.y+n.height/2-o.height/2,m=n[l]/2-o[l]/2;let g;switch(c){case"top":g={x:u,y:n.y-o.height};break;case"bottom":g={x:u,y:n.y+n.height};break;case"right":g={x:n.x+n.width,y:p};break;case"left":g={x:n.x-o.width,y:p};break;default:g={x:n.x,y:n.y}}switch(Tt(t)){case"start":g[s]-=m*(r&&d?-1:1);break;case"end":g[s]+=m*(r&&d?-1:1);break}return g}const Oh=async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:i=[],platform:s}=r,l=i.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(t));let d=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:p}=vs(d,n,c),m=n,g={},b=0;for(let f=0;f<l.length;f++){const{name:h,fn:v}=l[f],{x:y,y:w,data:j,reset:C}=await v({x:u,y:p,initialPlacement:n,placement:m,strategy:o,middlewareData:g,rects:d,platform:s,elements:{reference:e,floating:t}});u=y??u,p=w??p,g={...g,[h]:{...g[h],...j}},C&&b<=50&&(b++,typeof C=="object"&&(C.placement&&(m=C.placement),C.rects&&(d=C.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):C.rects),{x:u,y:p}=vs(d,m,c)),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:i,rects:s,elements:l,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:p="floating",altBoundary:m=!1,padding:g=0}=$e(t,e),b=_s(g),h=l[m?p==="floating"?"reference":"floating":p],v=Jr(await i.getClippingRect({element:(r=await(i.isElement==null?void 0:i.isElement(h)))==null||r?h:h.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:d,rootBoundary:u,strategy:c})),y=p==="floating"?{x:n,y:o,width:s.floating.width,height:s.floating.height}:s.reference,w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),j=await(i.isElement==null?void 0:i.isElement(w))?await(i.getScale==null?void 0:i.getScale(w))||{x:1,y:1}:{x:1,y:1},C=Jr(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:w,strategy:c}):y);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 Rh=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:i,platform:s,elements:l,middlewareData:c}=t,{element:d,padding:u=0}=$e(e,t)||{};if(d==null)return{};const p=_s(u),m={x:r,y:n},g=ko(o),b=jo(g),f=await s.getDimensions(d),h=g==="y",v=h?"top":"left",y=h?"bottom":"right",w=h?"clientHeight":"clientWidth",j=i.reference[b]+i.reference[g]-m[g]-i.floating[b],C=m[g]-i.reference[g],N=await(s.getOffsetParent==null?void 0:s.getOffsetParent(d));let S=N?N[w]:0;(!S||!await(s.isElement==null?void 0:s.isElement(N)))&&(S=l.floating[w]||i.floating[b]);const E=j/2-C/2,T=S/2-f[b]/2-1,A=Ge(p[v],T),R=Ge(p[y],T),L=A,B=S-f[b]-R,M=S/2-f[b]/2+E,O=yo(L,M,B),P=!c.arrow&&Tt(o)!=null&&M!==O&&i.reference[b]/2-(M<L?A:R)-f[b]/2<0,z=P?M<L?M-L:M-B:0;return{[g]:m[g]+z,data:{[g]:O,centerOffset:M-O-z,...P&&{alignmentOffset:z}},reset:P}}}),Lh=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:i,rects:s,initialPlacement:l,platform:c,elements:d}=t,{mainAxis:u=!0,crossAxis:p=!0,fallbackPlacements:m,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:f=!0,...h}=$e(e,t);if((r=i.arrow)!=null&&r.alignmentOffset)return{};const v=Fe(o),y=Oe(l),w=Fe(l)===l,j=await(c.isRTL==null?void 0:c.isRTL(d.floating)),C=m||(w||!f?[Xr(l)]:Ch(l)),N=b!=="none";!m&&N&&C.push(...Ah(l,f,b,j));const S=[l,...C],E=await lr(t,h),T=[];let A=((n=i.flip)==null?void 0:n.overflows)||[];if(u&&T.push(E[v]),p){const M=Sh(o,s,j);T.push(E[M[0]],E[M[1]])}if(A=[...A,{placement:o,overflows:T}],!T.every(M=>M<=0)){var R,L;const M=(((R=i.flip)==null?void 0:R.index)||0)+1,O=S[M];if(O&&(!(p==="alignment"?y!==Oe(O):!1)||A.every(I=>Oe(I.placement)===y?I.overflows[0]>0:!0)))return{data:{index:M,overflows:A},reset:{placement:O}};let P=(L=A.filter(z=>z.overflows[0]<=0).sort((z,I)=>z.overflows[1]-I.overflows[1])[0])==null?void 0:L.placement;if(!P)switch(g){case"bestFit":{var B;const z=(B=A.filter(I=>{if(N){const q=Oe(I.placement);return q===y||q==="y"}return!0}).map(I=>[I.placement,I.overflows.filter(q=>q>0).reduce((q,te)=>q+te,0)]).sort((I,q)=>I[1]-q[1])[0])==null?void 0:B[0];z&&(P=z);break}case"initialPlacement":P=l;break}if(o!==P)return{reset:{placement:P}}}return{}}}};function ys(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ws(e){return yh.some(t=>e[t]>=0)}const Ih=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...o}=$e(e,t);switch(n){case"referenceHidden":{const i=await lr(t,{...o,elementContext:"reference"}),s=ys(i,r.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:ws(s)}}}case"escaped":{const i=await lr(t,{...o,altBoundary:!0}),s=ys(i,r.floating);return{data:{escapedOffsets:s,escaped:ws(s)}}}default:return{}}}}},js=new Set(["left","top"]);async function Mh(e,t){const{placement:r,platform:n,elements:o}=e,i=await(n.isRTL==null?void 0:n.isRTL(o.floating)),s=Fe(r),l=Tt(r),c=Oe(r)==="y",d=js.has(s)?-1:1,u=i&&c?-1:1,p=$e(t,e);let{mainAxis:m,crossAxis:g,alignmentAxis:b}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return l&&typeof b=="number"&&(g=l==="end"?b*-1:b),c?{x:g*u,y:m*d}:{x:m*d,y:g*u}}const zh=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:i,placement:s,middlewareData:l}=t,c=await Mh(t,e);return s===((r=l.offset)==null?void 0:r.placement)&&(n=l.arrow)!=null&&n.alignmentOffset?{}:{x:o+c.x,y:i+c.y,data:{...c,placement:s}}}}},Dh=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:l={fn:h=>{let{x:v,y}=h;return{x:v,y}}},...c}=$e(e,t),d={x:r,y:n},u=await lr(t,c),p=Oe(Fe(o)),m=wo(p);let g=d[m],b=d[p];if(i){const h=m==="y"?"top":"left",v=m==="y"?"bottom":"right",y=g+u[h],w=g-u[v];g=yo(y,g,w)}if(s){const h=p==="y"?"top":"left",v=p==="y"?"bottom":"right",y=b+u[h],w=b-u[v];b=yo(y,b,w)}const f=l.fn({...t,[m]:g,[p]:b});return{...f,data:{x:f.x-r,y:f.y-n,enabled:{[m]:i,[p]:s}}}}}},$h=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:i,middlewareData:s}=t,{offset:l=0,mainAxis:c=!0,crossAxis:d=!0}=$e(e,t),u={x:r,y:n},p=Oe(o),m=wo(p);let g=u[m],b=u[p];const f=$e(l,t),h=typeof f=="number"?{mainAxis:f,crossAxis:0}:{mainAxis:0,crossAxis:0,...f};if(c){const w=m==="y"?"height":"width",j=i.reference[m]-i.floating[w]+h.mainAxis,C=i.reference[m]+i.reference[w]-h.mainAxis;g<j?g=j:g>C&&(g=C)}if(d){var v,y;const w=m==="y"?"width":"height",j=js.has(Fe(o)),C=i.reference[p]-i.floating[w]+(j&&((v=s.offset)==null?void 0:v[p])||0)+(j?0:h.crossAxis),N=i.reference[p]+i.reference[w]+(j?0:((y=s.offset)==null?void 0:y[p])||0)-(j?h.crossAxis:0);b<C?b=C:b>N&&(b=N)}return{[m]:g,[p]:b}}}},Fh=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:o,rects:i,platform:s,elements:l}=t,{apply:c=()=>{},...d}=$e(e,t),u=await lr(t,d),p=Fe(o),m=Tt(o),g=Oe(o)==="y",{width:b,height:f}=i.floating;let h,v;p==="top"||p==="bottom"?(h=p,v=m===(await(s.isRTL==null?void 0:s.isRTL(l.floating))?"start":"end")?"left":"right"):(v=p,h=m==="end"?"top":"bottom");const y=f-u.top-u.bottom,w=b-u.left-u.right,j=Ge(f-u[h],y),C=Ge(b-u[v],w),N=!t.middlewareData.shift;let S=j,E=C;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(E=w),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(S=y),N&&!m){const A=xe(u.left,0),R=xe(u.right,0),L=xe(u.top,0),B=xe(u.bottom,0);g?E=b-2*(A!==0||R!==0?A+R:xe(u.left,u.right)):S=f-2*(L!==0||B!==0?L+B:xe(u.top,u.bottom))}await c({...t,availableWidth:E,availableHeight:S});const T=await s.getDimensions(l.floating);return b!==T.width||f!==T.height?{reset:{rects:!0}}:{}}}};function Zr(){return typeof window<"u"}function At(e){return ks(e)?(e.nodeName||"").toLowerCase():"#document"}function be(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Re(e){var t;return(t=(ks(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ks(e){return Zr()?e instanceof Node||e instanceof be(e).Node:!1}function je(e){return Zr()?e instanceof Element||e instanceof be(e).Element:!1}function Le(e){return Zr()?e instanceof HTMLElement||e instanceof be(e).HTMLElement:!1}function Ss(e){return!Zr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof be(e).ShadowRoot}const Bh=new Set(["inline","contents"]);function cr(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=ke(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!Bh.has(o)}const Uh=new Set(["table","td","th"]);function Hh(e){return Uh.has(At(e))}const Vh=[":popover-open",":modal"];function Qr(e){return Vh.some(t=>{try{return e.matches(t)}catch{return!1}})}const Wh=["transform","translate","scale","rotate","perspective"],qh=["transform","translate","scale","rotate","perspective","filter"],Gh=["paint","layout","strict","content"];function Co(e){const t=No(),r=je(e)?ke(e):e;return Wh.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)||qh.some(n=>(r.willChange||"").includes(n))||Gh.some(n=>(r.contain||"").includes(n))}function Kh(e){let t=Ke(e);for(;Le(t)&&!Pt(t);){if(Co(t))return t;if(Qr(t))return null;t=Ke(t)}return null}function No(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Yh=new Set(["html","body","#document"]);function Pt(e){return Yh.has(At(e))}function ke(e){return be(e).getComputedStyle(e)}function en(e){return je(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ke(e){if(At(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ss(e)&&e.host||Re(e);return Ss(t)?t.host:t}function Cs(e){const t=Ke(e);return Pt(t)?e.ownerDocument?e.ownerDocument.body:e.body:Le(t)&&cr(t)?t:Cs(t)}function dr(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=Cs(e),i=o===((n=e.ownerDocument)==null?void 0:n.body),s=be(o);if(i){const l=Eo(s);return t.concat(s,s.visualViewport||[],cr(o)?o:[],l&&r?dr(l):[])}return t.concat(o,dr(o,[],r))}function Eo(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ns(e){const t=ke(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=Le(e),i=o?e.offsetWidth:r,s=o?e.offsetHeight:n,l=Kr(r)!==i||Kr(n)!==s;return l&&(r=i,n=s),{width:r,height:n,$:l}}function To(e){return je(e)?e:e.contextElement}function Ot(e){const t=To(e);if(!Le(t))return Pe(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:i}=Ns(t);let s=(i?Kr(r.width):r.width)/n,l=(i?Kr(r.height):r.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const Xh=Pe(0);function Es(e){const t=be(e);return!No()||!t.visualViewport?Xh:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Jh(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==be(e)?!1:t}function pt(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),i=To(e);let s=Pe(1);t&&(n?je(n)&&(s=Ot(n)):s=Ot(e));const l=Jh(i,r,n)?Es(i):Pe(0);let c=(o.left+l.x)/s.x,d=(o.top+l.y)/s.y,u=o.width/s.x,p=o.height/s.y;if(i){const m=be(i),g=n&&je(n)?be(n):n;let b=m,f=Eo(b);for(;f&&n&&g!==b;){const h=Ot(f),v=f.getBoundingClientRect(),y=ke(f),w=v.left+(f.clientLeft+parseFloat(y.paddingLeft))*h.x,j=v.top+(f.clientTop+parseFloat(y.paddingTop))*h.y;c*=h.x,d*=h.y,u*=h.x,p*=h.y,c+=w,d+=j,b=be(f),f=Eo(b)}}return Jr({width:u,height:p,x:c,y:d})}function tn(e,t){const r=en(e).scrollLeft;return t?t.left+r:pt(Re(e)).left+r}function Ts(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 Zh(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const i=o==="fixed",s=Re(n),l=t?Qr(t.floating):!1;if(n===s||l&&i)return r;let c={scrollLeft:0,scrollTop:0},d=Pe(1);const u=Pe(0),p=Le(n);if((p||!p&&!i)&&((At(n)!=="body"||cr(s))&&(c=en(n)),Le(n))){const g=pt(n);d=Ot(n),u.x=g.x+n.clientLeft,u.y=g.y+n.clientTop}const m=s&&!p&&!i?Ts(s,c):Pe(0);return{width:r.width*d.x,height:r.height*d.y,x:r.x*d.x-c.scrollLeft*d.x+u.x+m.x,y:r.y*d.y-c.scrollTop*d.y+u.y+m.y}}function Qh(e){return Array.from(e.getClientRects())}function eg(e){const t=Re(e),r=en(e),n=e.ownerDocument.body,o=xe(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=xe(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let s=-r.scrollLeft+tn(e);const l=-r.scrollTop;return ke(n).direction==="rtl"&&(s+=xe(t.clientWidth,n.clientWidth)-o),{width:o,height:i,x:s,y:l}}const As=25;function tg(e,t){const r=be(e),n=Re(e),o=r.visualViewport;let i=n.clientWidth,s=n.clientHeight,l=0,c=0;if(o){i=o.width,s=o.height;const u=No();(!u||u&&t==="fixed")&&(l=o.offsetLeft,c=o.offsetTop)}const d=tn(n);if(d<=0){const u=n.ownerDocument,p=u.body,m=getComputedStyle(p),g=u.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,b=Math.abs(n.clientWidth-p.clientWidth-g);b<=As&&(i-=b)}else d<=As&&(i+=d);return{width:i,height:s,x:l,y:c}}const rg=new Set(["absolute","fixed"]);function ng(e,t){const r=pt(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,i=Le(e)?Ot(e):Pe(1),s=e.clientWidth*i.x,l=e.clientHeight*i.y,c=o*i.x,d=n*i.y;return{width:s,height:l,x:c,y:d}}function Ps(e,t,r){let n;if(t==="viewport")n=tg(e,r);else if(t==="document")n=eg(Re(e));else if(je(t))n=ng(t,r);else{const o=Es(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Jr(n)}function Os(e,t){const r=Ke(e);return r===t||!je(r)||Pt(r)?!1:ke(r).position==="fixed"||Os(r,t)}function og(e,t){const r=t.get(e);if(r)return r;let n=dr(e,[],!1).filter(l=>je(l)&&At(l)!=="body"),o=null;const i=ke(e).position==="fixed";let s=i?Ke(e):e;for(;je(s)&&!Pt(s);){const l=ke(s),c=Co(s);!c&&l.position==="fixed"&&(o=null),(i?!c&&!o:!c&&l.position==="static"&&!!o&&rg.has(o.position)||cr(s)&&!c&&Os(e,s))?n=n.filter(u=>u!==s):o=l,s=Ke(s)}return t.set(e,n),n}function ag(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const s=[...r==="clippingAncestors"?Qr(t)?[]:og(t,this._c):[].concat(r),n],l=s[0],c=s.reduce((d,u)=>{const p=Ps(t,u,o);return d.top=xe(p.top,d.top),d.right=Ge(p.right,d.right),d.bottom=Ge(p.bottom,d.bottom),d.left=xe(p.left,d.left),d},Ps(t,l,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function ig(e){const{width:t,height:r}=Ns(e);return{width:t,height:r}}function sg(e,t,r){const n=Le(t),o=Re(t),i=r==="fixed",s=pt(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const c=Pe(0);function d(){c.x=tn(o)}if(n||!n&&!i)if((At(t)!=="body"||cr(o))&&(l=en(t)),n){const g=pt(t,!0,i,t);c.x=g.x+t.clientLeft,c.y=g.y+t.clientTop}else o&&d();i&&!n&&o&&d();const u=o&&!n&&!i?Ts(o,l):Pe(0),p=s.left+l.scrollLeft-c.x-u.x,m=s.top+l.scrollTop-c.y-u.y;return{x:p,y:m,width:s.width,height:s.height}}function Ao(e){return ke(e).position==="static"}function Rs(e,t){if(!Le(e)||ke(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Re(e)===r&&(r=r.ownerDocument.body),r}function Ls(e,t){const r=be(e);if(Qr(e))return r;if(!Le(e)){let o=Ke(e);for(;o&&!Pt(o);){if(je(o)&&!Ao(o))return o;o=Ke(o)}return r}let n=Rs(e,t);for(;n&&Hh(n)&&Ao(n);)n=Rs(n,t);return n&&Pt(n)&&Ao(n)&&!Co(n)?r:n||Kh(e)||r}const lg=async function(e){const t=this.getOffsetParent||Ls,r=this.getDimensions,n=await r(e.floating);return{reference:sg(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function cg(e){return ke(e).direction==="rtl"}const dg={convertOffsetParentRelativeRectToViewportRelativeRect:Zh,getDocumentElement:Re,getClippingRect:ag,getOffsetParent:Ls,getElementRects:lg,getClientRects:Qh,getDimensions:ig,getScale:Ot,isElement:je,isRTL:cg};function Is(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ug(e,t){let r=null,n;const o=Re(e);function i(){var l;clearTimeout(n),(l=r)==null||l.disconnect(),r=null}function s(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),i();const d=e.getBoundingClientRect(),{left:u,top:p,width:m,height:g}=d;if(l||t(),!m||!g)return;const b=Yr(p),f=Yr(o.clientWidth-(u+m)),h=Yr(o.clientHeight-(p+g)),v=Yr(u),w={rootMargin:-b+"px "+-f+"px "+-h+"px "+-v+"px",threshold:xe(0,Ge(1,c))||1};let j=!0;function C(N){const S=N[0].intersectionRatio;if(S!==c){if(!j)return s();S?s(!1,S):n=setTimeout(()=>{s(!1,1e-7)},1e3)}S===1&&!Is(d,e.getBoundingClientRect())&&s(),j=!1}try{r=new IntersectionObserver(C,{...w,root:o.ownerDocument})}catch{r=new IntersectionObserver(C,w)}r.observe(e)}return s(!0),i}function pg(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,d=To(e),u=o||i?[...d?dr(d):[],...dr(t)]:[];u.forEach(v=>{o&&v.addEventListener("scroll",r,{passive:!0}),i&&v.addEventListener("resize",r)});const p=d&&l?ug(d,r):null;let m=-1,g=null;s&&(g=new ResizeObserver(v=>{let[y]=v;y&&y.target===d&&g&&(g.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var w;(w=g)==null||w.observe(t)})),r()}),d&&!c&&g.observe(d),g.observe(t));let b,f=c?pt(e):null;c&&h();function h(){const v=pt(e);f&&!Is(f,v)&&r(),f=v,b=requestAnimationFrame(h)}return r(),()=>{var v;u.forEach(y=>{o&&y.removeEventListener("scroll",r),i&&y.removeEventListener("resize",r)}),p?.(),(v=g)==null||v.disconnect(),g=null,c&&cancelAnimationFrame(b)}}const mg=zh,fg=Dh,hg=Lh,gg=Fh,xg=Ih,Ms=Rh,bg=$h,_g=(e,t,r)=>{const n=new Map,o={platform:dg,...r},i={...o.platform,_c:n};return Oh(e,t,{...o,platform:i})};var vg=typeof document<"u",yg=function(){},rn=vg?_.useLayoutEffect:yg;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 i=o[n];if(!(i==="_owner"&&e.$$typeof)&&!nn(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function zs(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ds(e,t){const r=zs(e);return Math.round(t*r)/r}function Po(e){const t=x.useRef(e);return rn(()=>{t.current=e}),t}function wg(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:i,floating:s}={},transform:l=!0,whileElementsMounted:c,open:d}=e,[u,p]=x.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[m,g]=x.useState(n);nn(m,n)||g(n);const[b,f]=x.useState(null),[h,v]=x.useState(null),y=x.useCallback(I=>{I!==N.current&&(N.current=I,f(I))},[]),w=x.useCallback(I=>{I!==S.current&&(S.current=I,v(I))},[]),j=i||b,C=s||h,N=x.useRef(null),S=x.useRef(null),E=x.useRef(u),T=c!=null,A=Po(c),R=Po(o),L=Po(d),B=x.useCallback(()=>{if(!N.current||!S.current)return;const I={placement:t,strategy:r,middleware:m};R.current&&(I.platform=R.current),_g(N.current,S.current,I).then(q=>{const te={...q,isPositioned:L.current!==!1};M.current&&!nn(E.current,te)&&(E.current=te,xr.flushSync(()=>{p(te)}))})},[m,t,r,R,L]);rn(()=>{d===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,p(I=>({...I,isPositioned:!1})))},[d]);const M=x.useRef(!1);rn(()=>(M.current=!0,()=>{M.current=!1}),[]),rn(()=>{if(j&&(N.current=j),C&&(S.current=C),j&&C){if(A.current)return A.current(j,C,B);B()}},[j,C,B,A,T]);const O=x.useMemo(()=>({reference:N,floating:S,setReference:y,setFloating:w}),[y,w]),P=x.useMemo(()=>({reference:j,floating:C}),[j,C]),z=x.useMemo(()=>{const I={position:r,left:0,top:0};if(!P.floating)return I;const q=Ds(P.floating,u.x),te=Ds(P.floating,u.y);return l?{...I,transform:"translate("+q+"px, "+te+"px)",...zs(P.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:q,top:te}},[r,l,P.floating,u.x,u.y]);return x.useMemo(()=>({...u,update:B,refs:O,elements:P,floatingStyles:z}),[u,B,O,P,z])}const jg=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?Ms({element:n.current,padding:o}).fn(r):{}:n?Ms({element:n,padding:o}).fn(r):{}}}},kg=(e,t)=>({...mg(e),options:[e,t]}),Sg=(e,t)=>({...fg(e),options:[e,t]}),Cg=(e,t)=>({...bg(e),options:[e,t]}),Ng=(e,t)=>({...hg(e),options:[e,t]}),Eg=(e,t)=>({...gg(e),options:[e,t]}),Tg=(e,t)=>({...xg(e),options:[e,t]}),Ag=(e,t)=>({...jg(e),options:[e,t]});var Pg="Arrow",$s=x.forwardRef((e,t)=>{const{children:r,width:n=10,height:o=5,...i}=e;return a.jsx(W.svg,{...i,ref:t,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:a.jsx("polygon",{points:"0,0 30,0 15,10"})})});$s.displayName=Pg;var Og=$s;function Rg(e){const[t,r]=x.useState(void 0);return le(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,l;if("borderBoxSize"in i){const c=i.borderBoxSize,d=Array.isArray(c)?c[0]:c;s=d.inlineSize,l=d.blockSize}else s=e.offsetWidth,l=e.offsetHeight;r({width:s,height:l})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var Oo="Popper",[Fs,on]=Ve(Oo),[Lg,Bs]=Fs(Oo),Us=e=>{const{__scopePopper:t,children:r}=e,[n,o]=x.useState(null);return a.jsx(Lg,{scope:t,anchor:n,onAnchorChange:o,children:r})};Us.displayName=Oo;var Hs="PopperAnchor",Vs=x.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...o}=e,i=Bs(Hs,r),s=x.useRef(null),l=J(t,s),c=x.useRef(null);return x.useEffect(()=>{const d=c.current;c.current=n?.current||s.current,d!==c.current&&i.onAnchorChange(c.current)}),n?null:a.jsx(W.div,{...o,ref:l})});Vs.displayName=Hs;var Ro="PopperContent",[Ig,Mg]=Fs(Ro),Ws=x.forwardRef((e,t)=>{const{__scopePopper:r,side:n="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:u=0,sticky:p="partial",hideWhenDetached:m=!1,updatePositionStrategy:g="optimized",onPlaced:b,...f}=e,h=Bs(Ro,r),[v,y]=x.useState(null),w=J(t,F=>y(F)),[j,C]=x.useState(null),N=Rg(j),S=N?.width??0,E=N?.height??0,T=n+(i!=="center"?"-"+i:""),A=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},R=Array.isArray(d)?d:[d],L=R.length>0,B={padding:A,boundary:R.filter(Dg),altBoundary:L},{refs:M,floatingStyles:O,placement:P,isPositioned:z,middlewareData:I}=wg({strategy:"fixed",placement:T,whileElementsMounted:(...F)=>pg(...F,{animationFrame:g==="always"}),elements:{reference:h.anchor},middleware:[kg({mainAxis:o+E,alignmentAxis:s}),c&&Sg({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?Cg():void 0,...B}),c&&Ng({...B}),Eg({...B,apply:({elements:F,rects:Y,availableWidth:se,availableHeight:Z})=>{const{width:ee,height:ae}=Y.reference,ve=F.floating.style;ve.setProperty("--radix-popper-available-width",`${se}px`),ve.setProperty("--radix-popper-available-height",`${Z}px`),ve.setProperty("--radix-popper-anchor-width",`${ee}px`),ve.setProperty("--radix-popper-anchor-height",`${ae}px`)}}),j&&Ag({element:j,padding:l}),$g({arrowWidth:S,arrowHeight:E}),m&&Tg({strategy:"referenceHidden",...B})]}),[q,te]=Ks(P),oe=We(b);le(()=>{z&&oe?.()},[z,oe]);const ge=I.arrow?.x,_e=I.arrow?.y,pe=I.arrow?.centerOffset!==0,[K,de]=x.useState();return le(()=>{v&&de(window.getComputedStyle(v).zIndex)},[v]),a.jsx("div",{ref:M.setFloating,"data-radix-popper-content-wrapper":"",style:{...O,transform:z?O.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:K,"--radix-popper-transform-origin":[I.transformOrigin?.x,I.transformOrigin?.y].join(" "),...I.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:a.jsx(Ig,{scope:r,placedSide:q,onArrowChange:C,arrowX:ge,arrowY:_e,shouldHideArrow:pe,children:a.jsx(W.div,{"data-side":q,"data-align":te,...f,ref:w,style:{...f.style,animation:z?void 0:"none"}})})})});Ws.displayName=Ro;var qs="PopperArrow",zg={top:"bottom",right:"left",bottom:"top",left:"right"},Gs=x.forwardRef(function(t,r){const{__scopePopper:n,...o}=t,i=Mg(qs,n),s=zg[i.placedSide];return a.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:a.jsx(Og,{...o,ref:r,style:{...o.style,display:"block"}})})});Gs.displayName=qs;function Dg(e){return e!==null}var $g=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:n,middlewareData:o}=t,s=o.arrow?.centerOffset!==0,l=s?0:e.arrowWidth,c=s?0:e.arrowHeight,[d,u]=Ks(r),p={start:"0%",center:"50%",end:"100%"}[u],m=(o.arrow?.x??0)+l/2,g=(o.arrow?.y??0)+c/2;let b="",f="";return d==="bottom"?(b=s?p:`${m}px`,f=`${-c}px`):d==="top"?(b=s?p:`${m}px`,f=`${n.floating.height+c}px`):d==="right"?(b=`${-c}px`,f=s?p:`${g}px`):d==="left"&&(b=`${n.floating.width+c}px`,f=s?p:`${g}px`),{data:{x:b,y:f}}}});function Ks(e){const[t,r="center"]=e.split("-");return[t,r]}var Ys=Us,Lo=Vs,Xs=Ws,Js=Gs,Fg="Portal",an=x.forwardRef((e,t)=>{const{container:r,...n}=e,[o,i]=x.useState(!1);le(()=>i(!0),[]);const s=r||o&&globalThis?.document?.body;return s?ja.createPortal(a.jsx(W.div,{...n,ref:t}),s):null});an.displayName=Fg;function Bg(e,t){return x.useReducer((r,n)=>t[r][n]??r,e)}var Ye=e=>{const{present:t,children:r}=e,n=Ug(t),o=typeof r=="function"?r({present:n.isPresent}):x.Children.only(r),i=J(n.ref,Hg(o));return typeof r=="function"||n.isPresent?x.cloneElement(o,{ref:i}):null};Ye.displayName="Presence";function Ug(e){const[t,r]=x.useState(),n=x.useRef(null),o=x.useRef(e),i=x.useRef("none"),s=e?"mounted":"unmounted",[l,c]=Bg(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const d=sn(n.current);i.current=l==="mounted"?d:"none"},[l]),le(()=>{const d=n.current,u=o.current;if(u!==e){const m=i.current,g=sn(d);e?c("MOUNT"):g==="none"||d?.display==="none"?c("UNMOUNT"):c(u&&m!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),le(()=>{if(t){let d;const u=t.ownerDocument.defaultView??window,p=g=>{const f=sn(n.current).includes(CSS.escape(g.animationName));if(g.target===t&&f&&(c("ANIMATION_END"),!o.current)){const h=t.style.animationFillMode;t.style.animationFillMode="forwards",d=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=h)})}},m=g=>{g.target===t&&(i.current=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 c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:x.useCallback(d=>{n.current=d?getComputedStyle(d):null,r(d)},[])}}function sn(e){return e?.animationName||"none"}function Hg(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 Vg=x[" useInsertionEffect ".trim().toString()]||le;function mt({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[o,i,s]=Wg({defaultProp:t,onChange:r}),l=e!==void 0,c=l?e:o;{const u=x.useRef(e!==void 0);x.useEffect(()=>{const p=u.current;p!==l&&console.warn(`${n} is changing from ${p?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=l},[l,n])}const d=x.useCallback(u=>{if(l){const p=qg(u)?u(e):u;p!==e&&s.current?.(p)}else i(u)},[l,e,i,s]);return[c,d]}function Wg({defaultProp:e,onChange:t}){const[r,n]=x.useState(e),o=x.useRef(r),i=x.useRef(t);return Vg(()=>{i.current=t},[t]),x.useEffect(()=>{o.current!==r&&(i.current?.(r),o.current=r)},[r,o]),[r,n,i]}function qg(e){return typeof e=="function"}var Gg=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Rt=new WeakMap,ln=new WeakMap,cn={},Io=0,Zs=function(e){return e&&(e.host||Zs(e.parentNode))},Kg=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=Zs(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})},Yg=function(e,t,r,n){var o=Kg(t,Array.isArray(e)?e:[e]);cn[r]||(cn[r]=new WeakMap);var i=cn[r],s=[],l=new Set,c=new Set(o),d=function(p){!p||l.has(p)||(l.add(p),d(p.parentNode))};o.forEach(d);var u=function(p){!p||c.has(p)||Array.prototype.forEach.call(p.children,function(m){if(l.has(m))u(m);else try{var g=m.getAttribute(n),b=g!==null&&g!=="false",f=(Rt.get(m)||0)+1,h=(i.get(m)||0)+1;Rt.set(m,f),i.set(m,h),s.push(m),f===1&&b&&ln.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(),Io++,function(){s.forEach(function(p){var m=Rt.get(p)-1,g=i.get(p)-1;Rt.set(p,m),i.set(p,g),m||(ln.has(p)||p.removeAttribute(n),ln.delete(p)),g||p.removeAttribute(r)}),Io--,Io||(Rt=new WeakMap,Rt=new WeakMap,ln=new WeakMap,cn={})}},Mo=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=Gg(e);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live], script"))),Yg(n,o,r,"aria-hidden")):function(){return null}},Ie=function(){return Ie=Object.assign||function(t){for(var r,n=1,o=arguments.length;n<o;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},Ie.apply(this,arguments)};function Qs(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 Xg(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,i;n<o;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var dn="right-scroll-bar-position",un="width-before-scroll-bar",Jg="with-scroll-bars-hidden",Zg="--removed-body-scroll-bar-size";function zo(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Qg(e,t){var r=_.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 ex=typeof window<"u"?x.useLayoutEffect:x.useEffect,el=new WeakMap;function tx(e,t){var r=Qg(null,function(n){return e.forEach(function(o){return zo(o,n)})});return ex(function(){var n=el.get(r);if(n){var o=new Set(n),i=new Set(e),s=r.current;o.forEach(function(l){i.has(l)||zo(l,null)}),i.forEach(function(l){o.has(l)||zo(l,s)})}el.set(r,e)},[e]),r}function rx(e){return e}function nx(e,t){t===void 0&&(t=rx);var r=[],n=!1,o={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(i){var s=t(i,n);return r.push(s),function(){r=r.filter(function(l){return l!==s})}},assignSyncMedium:function(i){for(n=!0;r.length;){var s=r;r=[],s.forEach(i)}r={push:function(l){return i(l)},filter:function(){return r}}},assignMedium:function(i){n=!0;var s=[];if(r.length){var l=r;r=[],l.forEach(i),s=r}var c=function(){var u=s;s=[],u.forEach(i)},d=function(){return Promise.resolve().then(c)};d(),r={push:function(u){s.push(u),d()},filter:function(u){return s=s.filter(u),r}}}};return o}function ox(e){e===void 0&&(e={});var t=nx(null);return t.options=Ie({async:!0,ssr:!1},e),t}var tl=function(e){var t=e.sideCar,r=Qs(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return x.createElement(n,Ie({},r))};tl.isSideCarExport=!0;function ax(e,t){return e.useMedium(t),tl}var rl=ox(),Do=function(){},pn=x.forwardRef(function(e,t){var r=x.useRef(null),n=x.useState({onScrollCapture:Do,onWheelCapture:Do,onTouchMoveCapture:Do}),o=n[0],i=n[1],s=e.forwardProps,l=e.children,c=e.className,d=e.removeScrollBar,u=e.enabled,p=e.shards,m=e.sideCar,g=e.noRelative,b=e.noIsolation,f=e.inert,h=e.allowPinchZoom,v=e.as,y=v===void 0?"div":v,w=e.gapMode,j=Qs(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=m,N=tx([r,t]),S=Ie(Ie({},j),o);return x.createElement(x.Fragment,null,u&&x.createElement(C,{sideCar:rl,removeScrollBar:d,shards:p,noRelative:g,noIsolation:b,inert:f,setCallbacks:i,allowPinchZoom:!!h,lockRef:r,gapMode:w}),s?x.cloneElement(x.Children.only(l),Ie(Ie({},S),{ref:N})):x.createElement(y,Ie({},S,{className:c,ref:N}),l))});pn.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},pn.classNames={fullWidth:un,zeroRight:dn};var ix=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function sx(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=ix();return t&&e.setAttribute("nonce",t),e}function lx(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function cx(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var dx=function(){var e=0,t=null;return{add:function(r){e==0&&(t=sx())&&(lx(t,r),cx(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},ux=function(){var e=dx();return function(t,r){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},nl=function(){var e=ux(),t=function(r){var n=r.styles,o=r.dynamic;return e(n,o),null};return t},px={left:0,top:0,right:0,gap:0},$o=function(e){return parseInt(e||"",10)||0},mx=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[$o(r),$o(n),$o(o)]},fx=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return px;var t=mx(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])}},hx=nl(),Lt="data-scroll-locked",gx=function(e,t,r,n){var o=e.left,i=e.top,s=e.right,l=e.gap;return r===void 0&&(r="margin"),`359 .`.concat( Jg,` {357 `):" "+Zi(s[0]):"as no adapter specified";throw new U("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return o}const Qi={getAdapter:Gf,adapters:uo};function po(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Et(null,e)}function es(e){return po(e),e.headers=fe.from(e.headers),e.data=co.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Qi.getAdapter(e.adapter||ir.adapter,e)(e).then(function(n){return po(e),n.data=co.call(e,e.transformResponse,n),n.headers=fe.from(n.headers),n},function(n){return $i(n)||(po(e),n&&n.response&&(n.response.data=co.call(e,e.transformResponse,n.response),n.response.headers=fe.from(n.response.headers))),Promise.reject(n)})}const ts="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 rs={};Vr.transitional=function(t,r,n){function o(i,s){return"[Axios v"+ts+"] Transitional option '"+i+"'"+s+(n?". "+n:"")}return(i,s,l)=>{if(t===!1)throw new U(o(s," has been removed"+(r?" in "+r:"")),U.ERR_DEPRECATED);return r&&!rs[s]&&(rs[s]=!0,console.warn(o(s," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(i,s,l):!0}},Vr.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function Kf(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 i=n[o],s=t[i];if(s){const l=e[i],c=l===void 0||s(l,i,e);if(c!==!0)throw new U("option "+i+" must be "+c,U.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new U("Unknown option "+i,U.ERR_BAD_OPTION)}}const Wr={assertOptions:Kf,validators:Vr},Te=Wr.validators;let ut=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Ii,response:new Ii}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const i=o.stack?o.stack.replace(/^.+\n/,""):"";try{n.stack?i&&!String(n.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(n.stack+=` 358 `+i):n.stack=i}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=dt(this.defaults,r);const{transitional:n,paramsSerializer:o,headers:i}=r;n!==void 0&&Wr.assertOptions(n,{silentJSONParsing:Te.transitional(Te.boolean),forcedJSONParsing:Te.transitional(Te.boolean),clarifyTimeoutError:Te.transitional(Te.boolean)},!1),o!=null&&(k.isFunction(o)?r.paramsSerializer={serialize:o}:Wr.assertOptions(o,{encode:Te.function,serialize:Te.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),Wr.assertOptions(r,{baseUrl:Te.spelling("baseURL"),withXsrfToken:Te.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let s=i&&k.merge(i.common,i[r.method]);i&&k.forEach(["delete","get","head","post","put","patch","common"],b=>{delete i[b]}),r.headers=fe.concat(s,i);const l=[];let c=!0;this.interceptors.request.forEach(function(f){typeof f.runWhen=="function"&&f.runWhen(r)===!1||(c=c&&f.synchronous,l.unshift(f.fulfilled,f.rejected))});const d=[];this.interceptors.response.forEach(function(f){d.push(f.fulfilled,f.rejected)});let u,p=0,m;if(!c){const b=[es.bind(this),void 0];for(b.unshift(...l),b.push(...d),m=b.length,u=Promise.resolve(r);p<m;)u=u.then(b[p++],b[p++]);return u}m=l.length;let g=r;for(;p<m;){const b=l[p++],f=l[p++];try{g=b(g)}catch(h){f.call(this,h);break}}try{u=es.call(this,g)}catch(b){return Promise.reject(b)}for(p=0,m=d.length;p<m;)u=u.then(d[p++],d[p++]);return u}getUri(t){t=dt(this.defaults,t);const r=Hi(t.baseURL,t.url,t.allowAbsoluteUrls);return Li(r,t.params,t.paramsSerializer)}};k.forEach(["delete","get","head","options"],function(t){ut.prototype[t]=function(r,n){return this.request(dt(n||{},{method:t,url:r,data:(n||{}).data}))}}),k.forEach(["post","put","patch"],function(t){function r(n){return function(i,s,l){return this.request(dt(l||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:s}))}}ut.prototype[t]=r(),ut.prototype[t+"Form"]=r(!0)});let Yf=class Ed{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(i){r=i});const n=this;this.promise.then(o=>{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](o);n._listeners=null}),this.promise.then=o=>{let i;const s=new Promise(l=>{n.subscribe(l),i=l}).then(o);return s.cancel=function(){n.unsubscribe(i)},s},t(function(i,s,l){n.reason||(n.reason=new Et(i,s,l),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new Ed(function(o){t=o}),cancel:t}}};function Xf(e){return function(r){return e.apply(null,r)}}function Jf(e){return k.isObject(e)&&e.isAxiosError===!0}const mo={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(mo).forEach(([e,t])=>{mo[t]=e});function ns(e){const t=new ut(e),r=_i(ut.prototype.request,t);return k.extend(r,ut.prototype,t,{allOwnKeys:!0}),k.extend(r,t,null,{allOwnKeys:!0}),r.create=function(o){return ns(dt(e,o))},r}const re=ns(ir);re.Axios=ut,re.CanceledError=Et,re.CancelToken=Yf,re.isCancel=$i,re.VERSION=ts,re.toFormData=Fr,re.AxiosError=U,re.Cancel=re.CanceledError,re.all=function(t){return Promise.all(t)},re.spread=Xf,re.isAxiosError=Jf,re.mergeConfig=dt,re.AxiosHeaders=fe,re.formToJSON=e=>zi(k.isHTMLForm(e)?new FormData(e):e),re.getAdapter=Qi.getAdapter,re.HttpStatusCode=mo,re.default=re;const{Axios:_1,AxiosError:v1,CanceledError:y1,isCancel:w1,CancelToken:j1,VERSION:k1,all:S1,Cancel:C1,isAxiosError:N1,spread:E1,toFormData:T1,AxiosHeaders:A1,HttpStatusCode:P1,formToJSON:O1,getAdapter:R1,mergeConfig:L1}=re,os=ecommreelsInfo,he=re.create({baseURL:`${os.apiBase}`,headers:{"X-WP-Nonce":os.nonce,"Content-Type":"application/json"}}),Zf=()=>{const[e,t]=_.useState(!1),[r,n]=_.useState(!1),o=_.useCallback(async s=>{try{t(!0);const l={styles:ot,story_ids:s},c=await he.post("stories/manage-group-stories",l);return G.success("Group created successfully!"),c.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)}},[]),i=_.useCallback(async(s,l,c)=>{try{return n(!0),await he.delete(`story/${s}`),l(d=>d.filter(u=>u.id!==s)),c?.silent||G.success("Reel deleted successfully!"),{ok:!0}}catch(d){const u=d instanceof Error?d.message:"Something went wrong. Try again later!";return c?.silent||G.error(u),{ok:!1,message:u}}finally{n(!1)}},[]);return{styles:ot,isCreating:e,isDeleting:r,createGroup:o,deleteReel:i}};function fo(e,t){const[r,n]=_.useState(e);return _.useEffect(()=>{const o=setTimeout(()=>{n(e)},t);return()=>{clearTimeout(o)}},[e,t]),r}const as=e=>{const[t,r]=_.useState([]),[n,o]=_.useState(1),[i,s]=_.useState(!0),[l,c]=_.useState(!1),[d,u]=_.useState(!1),[p,m]=_.useState(""),g=fo(p,500),b=_.useRef(!0),f=_.useCallback(async w=>{w===1&&b.current?u(!0):c(!0);try{const j={page:w,per_page:20};e&&(j.group_id=e),g&&(j.search=g);const C=await he.get("stories",{params:j}),N=C.data,S=parseInt(C.headers["x-wp-totalpages"]);r(E=>w===1?N:[...E,...N]),o(w+1),s(w<S)}catch(j){j instanceof Error?G.error(j.message):G.error("Something went wrong. Try again later!")}finally{b.current&&(b.current=!1),c(!1),u(!1)}},[e,g]),h=_.useCallback(()=>{o(1),r([]),f(1)},[f]);_.useEffect(()=>{h()},[g,h]);const v=_.useRef(null),y=_.useCallback(w=>{l||(v.current&&v.current.disconnect(),v.current=new IntersectionObserver(j=>{j[0].isIntersecting&&i&&f(n)}),w&&v.current.observe(w))},[l,i,n,f]);return _.useEffect(()=>()=>{v.current&&v.current.disconnect()},[]),{allReels:t,setAllReels:r,searchTerm:p,setSearchTerm:m,isSearching:l,isLoading:d,lastStoryElementRef:y,refreshReels:h}};function Qf(){const e=Ne(),{allReels:t,setAllReels:r,isSearching:n,lastStoryElementRef:o,searchTerm:i,setSearchTerm:s,isLoading:l}=as(null),{styles:c,isCreating:d,isDeleting:u,createGroup:p,deleteReel:m}=Zf(),[g,b]=_.useState(null),[f,h]=_.useState(null),[v,y]=_.useState(null),[w,j]=_.useState([]),C=async()=>{const A=await p(w);A&&e(`?view=${X.mg}&gid=${A}`)},N=()=>{j(t.map(A=>A.id))},S=A=>{j(R=>R.includes(A)?R.filter(L=>L!==A):[...R,A])},E=()=>{w.length&&h(w)},T=_.useCallback(async()=>{if(g){await m(g,r),b(null);return}if(f?.length){const A=await Promise.all(f.map(M=>m(M,r,{silent:!0}))),R=f.filter((M,O)=>A[O]?.ok),L=R.length,B=f.length-L;L&&(r(M=>M.filter(O=>!R.includes(O.id))),j(M=>M.filter(O=>!R.includes(O)))),L&&G.success(`${L} reels deleted successfully!`),B&&G.error(`${B} reels failed to delete.`),h(null)}},[m,g,f,r]);return l&&!t.length?a.jsx(Lr,{}):a.jsxs(a.Fragment,{children:[(g||f)&&a.jsx(Or,{onReject:()=>{b(null),h(null)},onAccept:T,isLoading:u,message:f?.length?`Are you sure you want to remove ${f.length} reels?`:"Are you sure you want to remove this reel?"}),a.jsx(kt,{left:[a.jsx(St,{name:"All Reels",Icon:sp},"page"),a.jsx(tr,{cb:()=>e(`?view=${X.ag}`)},"back")],center:[a.jsx(Ir,{},"reel-wp")],right:[a.jsx(Rr,{to:`?view=${X.cr}&from=${X.ar}`,text:"Add Reel",Icon:yt},"add-reel-all-reel")]}),a.jsx(rr,{breads:[{label:"Dashboard",href:`?view=${X.ag}`},{label:"All Reels"}]}),a.jsxs("div",{className:"ecr-admin-panel ecr-admin-panel--reels",children:[a.jsx(Tp,{selectedReelIds:w,handleSelectAll:N,clearSelection:()=>j([]),searchTerm:i,setSearchTerm:s,isCreating:d,handleCreateGroup:C,handleBulkDelete:E}),t.length?a.jsx(Sm,{reels:t,styles:c,selectedReelIds:w,onSelectReel:S,onDeleteReel:b,onPreviewReel:y,lastStoryElementRef:o}):!n&&!l?a.jsx(Op,{}):null,n&&a.jsx(Rp,{isFullScreen:!t.length})]}),!!v&&a.jsx(mm,{previewReel:v,setPreviewReel:y})]})}const eh=()=>{const[e,t]=_.useState(!1),r=_.useCallback(async({storyId:n,storyTitle:o,uploadedFiles:i,links:s,thumbnail:l})=>{try{t(!0);const c={story_title:o,files:i,thumbnail:l,links:s};n&&(c.story_id=n);const d=await he.post("files",c);return G.success(`Story ${n?"updated":"created"} successfully!`),d.data.story_id}catch(c){return c instanceof Error?G.error(c.message):G.error("Something went wrong. Try again later!"),null}finally{t(!1)}},[]);return{isSaving:e,saveStory:r}},ho=({isSaving:e,onSave:t,text:r="Save",className:n,...o})=>a.jsxs(ne,{onClick:t,className:$("ecr-admin-save-button",n),...o,children:[e?a.jsx(it,{className:"ecr-admin-save-button__icon ecr-admin-save-button__icon--spin"}):a.jsx(up,{className:"ecr-admin-save-button__icon"})," ",r]}),is=({setIsEdited:e,title:t,setTitle:r,placeholder:n,style:o})=>a.jsx("div",{children:a.jsx("input",{style:o,className:"ecr-admin-title-input",type:"text",value:t,placeholder:n,onChange:i=>{e&&e(!0),r(i.target.value)}})}),th=({uploadedFiles:e,links:t,storyTitle:r,setStoryTitle:n,thumbnail:o})=>{const i=Ne(),[s]=Zt(),l=s.get("sid"),c=s.get("from")||X.ag,d=s.get("gid"),{isSaving:u,saveStory:p}=eh(),m=async()=>{u||!await p({storyId:l,storyTitle:r,uploadedFiles:e,links:t,thumbnail:o})||i(`?view=${c}${d?`&gid=${d}`:""}`,{replace:!0})};return a.jsxs(a.Fragment,{children:[a.jsx(kt,{left:[a.jsx(St,{name:l?"Update Reel":"Add Reel",Icon:yt},"page"),a.jsx(tr,{},"back")],center:[a.jsx(is,{placeholder:"Enter reel title",title:r,setTitle:n},"title")],right:[a.jsx(ho,{onSave:m,isSaving:u,disabled:!e.length},"save")]}),a.jsx(rr,{breads:[{label:"Dashboard",href:"?view=my-reels"},{label:l?"Update Reel":"Add Reel"}]})]})};function H(e,t,{checkForDefaultPrevented:r=!0}={}){return function(o){if(e?.(o),r===!1||!o.defaultPrevented)return t?.(o)}}function rh(e,t){const r=x.createContext(t),n=i=>{const{children:s,...l}=i,c=x.useMemo(()=>l,Object.values(l));return a.jsx(r.Provider,{value:c,children:s})};n.displayName=e+"Provider";function o(i){const s=x.useContext(r);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[n,o]}function Ve(e,t=[]){let r=[];function n(i,s){const l=x.createContext(s),c=r.length;r=[...r,s];const d=p=>{const{scope:m,children:g,...b}=p,f=m?.[e]?.[c]||l,h=x.useMemo(()=>b,Object.values(b));return a.jsx(f.Provider,{value:h,children:g})};d.displayName=i+"Provider";function u(p,m){const g=m?.[e]?.[c]||l,b=x.useContext(g);if(b)return b;if(s!==void 0)return s;throw new Error(`\`${p}\` must be used within \`${i}\``)}return[d,u]}const o=()=>{const i=r.map(s=>x.createContext(s));return function(l){const c=l?.[e]||i;return x.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return o.scopeName=e,[n,nh(o,...t)]}function nh(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=n.reduce((l,{useScope:c,scopeName:d})=>{const p=c(i)[`__scope${d}`];return{...l,...p}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return r.scopeName=t.scopeName,r}var oh=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],W=oh.reduce((e,t)=>{const r=st(`Primitive.${t}`),n=x.forwardRef((o,i)=>{const{asChild:s,...l}=o,c=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function ah(e,t){e&&xr.flushSync(()=>e.dispatchEvent(t))}function We(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...r)=>t.current?.(...r),[])}function ih(e,t=globalThis?.document){const r=We(e);x.useEffect(()=>{const n=o=>{o.key==="Escape"&&r(o)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var sh="DismissableLayer",go="dismissableLayer.update",lh="dismissableLayer.pointerDownOutside",ch="dismissableLayer.focusOutside",ss,ls=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),qr=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:l,...c}=e,d=x.useContext(ls),[u,p]=x.useState(null),m=u?.ownerDocument??globalThis?.document,[,g]=x.useState({}),b=J(t,S=>p(S)),f=Array.from(d.layers),[h]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),v=f.indexOf(h),y=u?f.indexOf(u):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,j=y>=v,C=ph(S=>{const E=S.target,T=[...d.branches].some(A=>A.contains(E));!j||T||(o?.(S),s?.(S),S.defaultPrevented||l?.())},m),N=mh(S=>{const E=S.target;[...d.branches].some(A=>A.contains(E))||(i?.(S),s?.(S),S.defaultPrevented||l?.())},m);return ih(S=>{y===d.layers.size-1&&(n?.(S),!S.defaultPrevented&&l&&(S.preventDefault(),l()))},m),x.useEffect(()=>{if(u)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(ss=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(u)),d.layers.add(u),cs(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=ss)}},[u,m,r,d]),x.useEffect(()=>()=>{u&&(d.layers.delete(u),d.layersWithOutsidePointerEventsDisabled.delete(u),cs())},[u,d]),x.useEffect(()=>{const S=()=>g({});return document.addEventListener(go,S),()=>document.removeEventListener(go,S)},[]),a.jsx(W.div,{...c,ref:b,style:{pointerEvents:w?j?"auto":"none":void 0,...e.style},onFocusCapture:H(e.onFocusCapture,N.onFocusCapture),onBlurCapture:H(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:H(e.onPointerDownCapture,C.onPointerDownCapture)})});qr.displayName=sh;var dh="DismissableLayerBranch",uh=x.forwardRef((e,t)=>{const r=x.useContext(ls),n=x.useRef(null),o=J(t,n);return x.useEffect(()=>{const i=n.current;if(i)return r.branches.add(i),()=>{r.branches.delete(i)}},[r.branches]),a.jsx(W.div,{...e,ref:o})});uh.displayName=dh;function ph(e,t=globalThis?.document){const r=We(e),n=x.useRef(!1),o=x.useRef(()=>{});return x.useEffect(()=>{const i=l=>{if(l.target&&!n.current){let c=function(){ds(lh,r,d,{discrete:!0})};const d={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);n.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function mh(e,t=globalThis?.document){const r=We(e),n=x.useRef(!1);return x.useEffect(()=>{const o=i=>{i.target&&!n.current&&ds(ch,r,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function cs(){const e=new CustomEvent(go);document.dispatchEvent(e)}function ds(e,t,r,{discrete:n}){const o=r.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?ah(o,i):o.dispatchEvent(i)}var xo=0;function bo(){x.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??us()),document.body.insertAdjacentElement("beforeend",e[1]??us()),xo++,()=>{xo===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),xo--}},[])}function us(){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 _o="focusScope.autoFocusOnMount",vo="focusScope.autoFocusOnUnmount",ps={bubbles:!1,cancelable:!0},fh="FocusScope",Gr=x.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[l,c]=x.useState(null),d=We(o),u=We(i),p=x.useRef(null),m=J(t,f=>c(f)),g=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(n){let f=function(w){if(g.paused||!l)return;const j=w.target;l.contains(j)?p.current=j:qe(p.current,{select:!0})},h=function(w){if(g.paused||!l)return;const j=w.relatedTarget;j!==null&&(l.contains(j)||qe(p.current,{select:!0}))},v=function(w){if(document.activeElement===document.body)for(const C of w)C.removedNodes.length>0&&qe(l)};document.addEventListener("focusin",f),document.addEventListener("focusout",h);const y=new MutationObserver(v);return l&&y.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",f),document.removeEventListener("focusout",h),y.disconnect()}}},[n,l,g.paused]),x.useEffect(()=>{if(l){hs.add(g);const f=document.activeElement;if(!l.contains(f)){const v=new CustomEvent(_o,ps);l.addEventListener(_o,d),l.dispatchEvent(v),v.defaultPrevented||(hh(vh(ms(l)),{select:!0}),document.activeElement===f&&qe(l))}return()=>{l.removeEventListener(_o,d),setTimeout(()=>{const v=new CustomEvent(vo,ps);l.addEventListener(vo,u),l.dispatchEvent(v),v.defaultPrevented||qe(f??document.body,{select:!0}),l.removeEventListener(vo,u),hs.remove(g)},0)}}},[l,d,u,g]);const b=x.useCallback(f=>{if(!r&&!n||g.paused)return;const h=f.key==="Tab"&&!f.altKey&&!f.ctrlKey&&!f.metaKey,v=document.activeElement;if(h&&v){const y=f.currentTarget,[w,j]=gh(y);w&&j?!f.shiftKey&&v===j?(f.preventDefault(),r&&qe(w,{select:!0})):f.shiftKey&&v===w&&(f.preventDefault(),r&&qe(j,{select:!0})):v===y&&f.preventDefault()}},[r,n,g.paused]);return a.jsx(W.div,{tabIndex:-1,...s,ref:m,onKeyDown:b})});Gr.displayName=fh;function hh(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(qe(n,{select:t}),document.activeElement!==r)return}function gh(e){const t=ms(e),r=fs(t,e),n=fs(t.reverse(),e);return[r,n]}function ms(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 fs(e,t){for(const r of e)if(!xh(r,{upTo:t}))return r}function xh(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 bh(e){return e instanceof HTMLInputElement&&"select"in e}function qe(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&bh(e)&&t&&e.select()}}var hs=_h();function _h(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=gs(e,t),e.unshift(t)},remove(t){e=gs(e,t),e[0]?.resume()}}}function gs(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function vh(e){return e.filter(t=>t.tagName!=="A")}var le=globalThis?.document?x.useLayoutEffect:()=>{},yh=x[" useId ".trim().toString()]||(()=>{}),wh=0;function Ae(e){const[t,r]=x.useState(yh());return le(()=>{r(n=>n??String(wh++))},[e]),e||(t?`radix-${t}`:"")}const jh=["top","right","bottom","left"],Ge=Math.min,xe=Math.max,Kr=Math.round,Yr=Math.floor,Pe=e=>({x:e,y:e}),kh={left:"right",right:"left",bottom:"top",top:"bottom"},Sh={start:"end",end:"start"};function yo(e,t,r){return xe(e,Ge(t,r))}function $e(e,t){return typeof e=="function"?e(t):e}function Fe(e){return e.split("-")[0]}function Tt(e){return e.split("-")[1]}function wo(e){return e==="x"?"y":"x"}function jo(e){return e==="y"?"height":"width"}const Ch=new Set(["top","bottom"]);function Oe(e){return Ch.has(Fe(e))?"y":"x"}function ko(e){return wo(Oe(e))}function Nh(e,t,r){r===void 0&&(r=!1);const n=Tt(e),o=ko(e),i=jo(o);let s=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Xr(s)),[s,Xr(s)]}function Eh(e){const t=Xr(e);return[So(e),t,So(t)]}function So(e){return e.replace(/start|end/g,t=>Sh[t])}const xs=["left","right"],bs=["right","left"],Th=["top","bottom"],Ah=["bottom","top"];function Ph(e,t,r){switch(e){case"top":case"bottom":return r?t?bs:xs:t?xs:bs;case"left":case"right":return t?Th:Ah;default:return[]}}function Oh(e,t,r,n){const o=Tt(e);let i=Ph(Fe(e),r==="start",n);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(So)))),i}function Xr(e){return e.replace(/left|right|bottom|top/g,t=>kh[t])}function Rh(e){return{top:0,right:0,bottom:0,left:0,...e}}function _s(e){return typeof e!="number"?Rh(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 vs(e,t,r){let{reference:n,floating:o}=e;const i=Oe(t),s=ko(t),l=jo(s),c=Fe(t),d=i==="y",u=n.x+n.width/2-o.width/2,p=n.y+n.height/2-o.height/2,m=n[l]/2-o[l]/2;let g;switch(c){case"top":g={x:u,y:n.y-o.height};break;case"bottom":g={x:u,y:n.y+n.height};break;case"right":g={x:n.x+n.width,y:p};break;case"left":g={x:n.x-o.width,y:p};break;default:g={x:n.x,y:n.y}}switch(Tt(t)){case"start":g[s]-=m*(r&&d?-1:1);break;case"end":g[s]+=m*(r&&d?-1:1);break}return g}const Lh=async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:i=[],platform:s}=r,l=i.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(t));let d=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:p}=vs(d,n,c),m=n,g={},b=0;for(let f=0;f<l.length;f++){const{name:h,fn:v}=l[f],{x:y,y:w,data:j,reset:C}=await v({x:u,y:p,initialPlacement:n,placement:m,strategy:o,middlewareData:g,rects:d,platform:s,elements:{reference:e,floating:t}});u=y??u,p=w??p,g={...g,[h]:{...g[h],...j}},C&&b<=50&&(b++,typeof C=="object"&&(C.placement&&(m=C.placement),C.rects&&(d=C.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):C.rects),{x:u,y:p}=vs(d,m,c)),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:i,rects:s,elements:l,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:p="floating",altBoundary:m=!1,padding:g=0}=$e(t,e),b=_s(g),h=l[m?p==="floating"?"reference":"floating":p],v=Jr(await i.getClippingRect({element:(r=await(i.isElement==null?void 0:i.isElement(h)))==null||r?h:h.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:d,rootBoundary:u,strategy:c})),y=p==="floating"?{x:n,y:o,width:s.floating.width,height:s.floating.height}:s.reference,w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),j=await(i.isElement==null?void 0:i.isElement(w))?await(i.getScale==null?void 0:i.getScale(w))||{x:1,y:1}:{x:1,y:1},C=Jr(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:w,strategy:c}):y);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 Ih=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:i,platform:s,elements:l,middlewareData:c}=t,{element:d,padding:u=0}=$e(e,t)||{};if(d==null)return{};const p=_s(u),m={x:r,y:n},g=ko(o),b=jo(g),f=await s.getDimensions(d),h=g==="y",v=h?"top":"left",y=h?"bottom":"right",w=h?"clientHeight":"clientWidth",j=i.reference[b]+i.reference[g]-m[g]-i.floating[b],C=m[g]-i.reference[g],N=await(s.getOffsetParent==null?void 0:s.getOffsetParent(d));let S=N?N[w]:0;(!S||!await(s.isElement==null?void 0:s.isElement(N)))&&(S=l.floating[w]||i.floating[b]);const E=j/2-C/2,T=S/2-f[b]/2-1,A=Ge(p[v],T),R=Ge(p[y],T),L=A,B=S-f[b]-R,M=S/2-f[b]/2+E,O=yo(L,M,B),P=!c.arrow&&Tt(o)!=null&&M!==O&&i.reference[b]/2-(M<L?A:R)-f[b]/2<0,z=P?M<L?M-L:M-B:0;return{[g]:m[g]+z,data:{[g]:O,centerOffset:M-O-z,...P&&{alignmentOffset:z}},reset:P}}}),Mh=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:i,rects:s,initialPlacement:l,platform:c,elements:d}=t,{mainAxis:u=!0,crossAxis:p=!0,fallbackPlacements:m,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:f=!0,...h}=$e(e,t);if((r=i.arrow)!=null&&r.alignmentOffset)return{};const v=Fe(o),y=Oe(l),w=Fe(l)===l,j=await(c.isRTL==null?void 0:c.isRTL(d.floating)),C=m||(w||!f?[Xr(l)]:Eh(l)),N=b!=="none";!m&&N&&C.push(...Oh(l,f,b,j));const S=[l,...C],E=await lr(t,h),T=[];let A=((n=i.flip)==null?void 0:n.overflows)||[];if(u&&T.push(E[v]),p){const M=Nh(o,s,j);T.push(E[M[0]],E[M[1]])}if(A=[...A,{placement:o,overflows:T}],!T.every(M=>M<=0)){var R,L;const M=(((R=i.flip)==null?void 0:R.index)||0)+1,O=S[M];if(O&&(!(p==="alignment"?y!==Oe(O):!1)||A.every(I=>Oe(I.placement)===y?I.overflows[0]>0:!0)))return{data:{index:M,overflows:A},reset:{placement:O}};let P=(L=A.filter(z=>z.overflows[0]<=0).sort((z,I)=>z.overflows[1]-I.overflows[1])[0])==null?void 0:L.placement;if(!P)switch(g){case"bestFit":{var B;const z=(B=A.filter(I=>{if(N){const q=Oe(I.placement);return q===y||q==="y"}return!0}).map(I=>[I.placement,I.overflows.filter(q=>q>0).reduce((q,te)=>q+te,0)]).sort((I,q)=>I[1]-q[1])[0])==null?void 0:B[0];z&&(P=z);break}case"initialPlacement":P=l;break}if(o!==P)return{reset:{placement:P}}}return{}}}};function ys(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ws(e){return jh.some(t=>e[t]>=0)}const zh=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...o}=$e(e,t);switch(n){case"referenceHidden":{const i=await lr(t,{...o,elementContext:"reference"}),s=ys(i,r.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:ws(s)}}}case"escaped":{const i=await lr(t,{...o,altBoundary:!0}),s=ys(i,r.floating);return{data:{escapedOffsets:s,escaped:ws(s)}}}default:return{}}}}},js=new Set(["left","top"]);async function Dh(e,t){const{placement:r,platform:n,elements:o}=e,i=await(n.isRTL==null?void 0:n.isRTL(o.floating)),s=Fe(r),l=Tt(r),c=Oe(r)==="y",d=js.has(s)?-1:1,u=i&&c?-1:1,p=$e(t,e);let{mainAxis:m,crossAxis:g,alignmentAxis:b}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return l&&typeof b=="number"&&(g=l==="end"?b*-1:b),c?{x:g*u,y:m*d}:{x:m*d,y:g*u}}const $h=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:i,placement:s,middlewareData:l}=t,c=await Dh(t,e);return s===((r=l.offset)==null?void 0:r.placement)&&(n=l.arrow)!=null&&n.alignmentOffset?{}:{x:o+c.x,y:i+c.y,data:{...c,placement:s}}}}},Fh=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:l={fn:h=>{let{x:v,y}=h;return{x:v,y}}},...c}=$e(e,t),d={x:r,y:n},u=await lr(t,c),p=Oe(Fe(o)),m=wo(p);let g=d[m],b=d[p];if(i){const h=m==="y"?"top":"left",v=m==="y"?"bottom":"right",y=g+u[h],w=g-u[v];g=yo(y,g,w)}if(s){const h=p==="y"?"top":"left",v=p==="y"?"bottom":"right",y=b+u[h],w=b-u[v];b=yo(y,b,w)}const f=l.fn({...t,[m]:g,[p]:b});return{...f,data:{x:f.x-r,y:f.y-n,enabled:{[m]:i,[p]:s}}}}}},Bh=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:i,middlewareData:s}=t,{offset:l=0,mainAxis:c=!0,crossAxis:d=!0}=$e(e,t),u={x:r,y:n},p=Oe(o),m=wo(p);let g=u[m],b=u[p];const f=$e(l,t),h=typeof f=="number"?{mainAxis:f,crossAxis:0}:{mainAxis:0,crossAxis:0,...f};if(c){const w=m==="y"?"height":"width",j=i.reference[m]-i.floating[w]+h.mainAxis,C=i.reference[m]+i.reference[w]-h.mainAxis;g<j?g=j:g>C&&(g=C)}if(d){var v,y;const w=m==="y"?"width":"height",j=js.has(Fe(o)),C=i.reference[p]-i.floating[w]+(j&&((v=s.offset)==null?void 0:v[p])||0)+(j?0:h.crossAxis),N=i.reference[p]+i.reference[w]+(j?0:((y=s.offset)==null?void 0:y[p])||0)-(j?h.crossAxis:0);b<C?b=C:b>N&&(b=N)}return{[m]:g,[p]:b}}}},Uh=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:o,rects:i,platform:s,elements:l}=t,{apply:c=()=>{},...d}=$e(e,t),u=await lr(t,d),p=Fe(o),m=Tt(o),g=Oe(o)==="y",{width:b,height:f}=i.floating;let h,v;p==="top"||p==="bottom"?(h=p,v=m===(await(s.isRTL==null?void 0:s.isRTL(l.floating))?"start":"end")?"left":"right"):(v=p,h=m==="end"?"top":"bottom");const y=f-u.top-u.bottom,w=b-u.left-u.right,j=Ge(f-u[h],y),C=Ge(b-u[v],w),N=!t.middlewareData.shift;let S=j,E=C;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(E=w),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(S=y),N&&!m){const A=xe(u.left,0),R=xe(u.right,0),L=xe(u.top,0),B=xe(u.bottom,0);g?E=b-2*(A!==0||R!==0?A+R:xe(u.left,u.right)):S=f-2*(L!==0||B!==0?L+B:xe(u.top,u.bottom))}await c({...t,availableWidth:E,availableHeight:S});const T=await s.getDimensions(l.floating);return b!==T.width||f!==T.height?{reset:{rects:!0}}:{}}}};function Zr(){return typeof window<"u"}function At(e){return ks(e)?(e.nodeName||"").toLowerCase():"#document"}function be(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Re(e){var t;return(t=(ks(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ks(e){return Zr()?e instanceof Node||e instanceof be(e).Node:!1}function je(e){return Zr()?e instanceof Element||e instanceof be(e).Element:!1}function Le(e){return Zr()?e instanceof HTMLElement||e instanceof be(e).HTMLElement:!1}function Ss(e){return!Zr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof be(e).ShadowRoot}const Hh=new Set(["inline","contents"]);function cr(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=ke(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!Hh.has(o)}const Vh=new Set(["table","td","th"]);function Wh(e){return Vh.has(At(e))}const qh=[":popover-open",":modal"];function Qr(e){return qh.some(t=>{try{return e.matches(t)}catch{return!1}})}const Gh=["transform","translate","scale","rotate","perspective"],Kh=["transform","translate","scale","rotate","perspective","filter"],Yh=["paint","layout","strict","content"];function Co(e){const t=No(),r=je(e)?ke(e):e;return Gh.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)||Kh.some(n=>(r.willChange||"").includes(n))||Yh.some(n=>(r.contain||"").includes(n))}function Xh(e){let t=Ke(e);for(;Le(t)&&!Pt(t);){if(Co(t))return t;if(Qr(t))return null;t=Ke(t)}return null}function No(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Jh=new Set(["html","body","#document"]);function Pt(e){return Jh.has(At(e))}function ke(e){return be(e).getComputedStyle(e)}function en(e){return je(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ke(e){if(At(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ss(e)&&e.host||Re(e);return Ss(t)?t.host:t}function Cs(e){const t=Ke(e);return Pt(t)?e.ownerDocument?e.ownerDocument.body:e.body:Le(t)&&cr(t)?t:Cs(t)}function dr(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=Cs(e),i=o===((n=e.ownerDocument)==null?void 0:n.body),s=be(o);if(i){const l=Eo(s);return t.concat(s,s.visualViewport||[],cr(o)?o:[],l&&r?dr(l):[])}return t.concat(o,dr(o,[],r))}function Eo(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ns(e){const t=ke(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=Le(e),i=o?e.offsetWidth:r,s=o?e.offsetHeight:n,l=Kr(r)!==i||Kr(n)!==s;return l&&(r=i,n=s),{width:r,height:n,$:l}}function To(e){return je(e)?e:e.contextElement}function Ot(e){const t=To(e);if(!Le(t))return Pe(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:i}=Ns(t);let s=(i?Kr(r.width):r.width)/n,l=(i?Kr(r.height):r.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const Zh=Pe(0);function Es(e){const t=be(e);return!No()||!t.visualViewport?Zh:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Qh(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==be(e)?!1:t}function pt(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),i=To(e);let s=Pe(1);t&&(n?je(n)&&(s=Ot(n)):s=Ot(e));const l=Qh(i,r,n)?Es(i):Pe(0);let c=(o.left+l.x)/s.x,d=(o.top+l.y)/s.y,u=o.width/s.x,p=o.height/s.y;if(i){const m=be(i),g=n&&je(n)?be(n):n;let b=m,f=Eo(b);for(;f&&n&&g!==b;){const h=Ot(f),v=f.getBoundingClientRect(),y=ke(f),w=v.left+(f.clientLeft+parseFloat(y.paddingLeft))*h.x,j=v.top+(f.clientTop+parseFloat(y.paddingTop))*h.y;c*=h.x,d*=h.y,u*=h.x,p*=h.y,c+=w,d+=j,b=be(f),f=Eo(b)}}return Jr({width:u,height:p,x:c,y:d})}function tn(e,t){const r=en(e).scrollLeft;return t?t.left+r:pt(Re(e)).left+r}function Ts(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 eg(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const i=o==="fixed",s=Re(n),l=t?Qr(t.floating):!1;if(n===s||l&&i)return r;let c={scrollLeft:0,scrollTop:0},d=Pe(1);const u=Pe(0),p=Le(n);if((p||!p&&!i)&&((At(n)!=="body"||cr(s))&&(c=en(n)),Le(n))){const g=pt(n);d=Ot(n),u.x=g.x+n.clientLeft,u.y=g.y+n.clientTop}const m=s&&!p&&!i?Ts(s,c):Pe(0);return{width:r.width*d.x,height:r.height*d.y,x:r.x*d.x-c.scrollLeft*d.x+u.x+m.x,y:r.y*d.y-c.scrollTop*d.y+u.y+m.y}}function tg(e){return Array.from(e.getClientRects())}function rg(e){const t=Re(e),r=en(e),n=e.ownerDocument.body,o=xe(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=xe(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let s=-r.scrollLeft+tn(e);const l=-r.scrollTop;return ke(n).direction==="rtl"&&(s+=xe(t.clientWidth,n.clientWidth)-o),{width:o,height:i,x:s,y:l}}const As=25;function ng(e,t){const r=be(e),n=Re(e),o=r.visualViewport;let i=n.clientWidth,s=n.clientHeight,l=0,c=0;if(o){i=o.width,s=o.height;const u=No();(!u||u&&t==="fixed")&&(l=o.offsetLeft,c=o.offsetTop)}const d=tn(n);if(d<=0){const u=n.ownerDocument,p=u.body,m=getComputedStyle(p),g=u.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,b=Math.abs(n.clientWidth-p.clientWidth-g);b<=As&&(i-=b)}else d<=As&&(i+=d);return{width:i,height:s,x:l,y:c}}const og=new Set(["absolute","fixed"]);function ag(e,t){const r=pt(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,i=Le(e)?Ot(e):Pe(1),s=e.clientWidth*i.x,l=e.clientHeight*i.y,c=o*i.x,d=n*i.y;return{width:s,height:l,x:c,y:d}}function Ps(e,t,r){let n;if(t==="viewport")n=ng(e,r);else if(t==="document")n=rg(Re(e));else if(je(t))n=ag(t,r);else{const o=Es(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Jr(n)}function Os(e,t){const r=Ke(e);return r===t||!je(r)||Pt(r)?!1:ke(r).position==="fixed"||Os(r,t)}function ig(e,t){const r=t.get(e);if(r)return r;let n=dr(e,[],!1).filter(l=>je(l)&&At(l)!=="body"),o=null;const i=ke(e).position==="fixed";let s=i?Ke(e):e;for(;je(s)&&!Pt(s);){const l=ke(s),c=Co(s);!c&&l.position==="fixed"&&(o=null),(i?!c&&!o:!c&&l.position==="static"&&!!o&&og.has(o.position)||cr(s)&&!c&&Os(e,s))?n=n.filter(u=>u!==s):o=l,s=Ke(s)}return t.set(e,n),n}function sg(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const s=[...r==="clippingAncestors"?Qr(t)?[]:ig(t,this._c):[].concat(r),n],l=s[0],c=s.reduce((d,u)=>{const p=Ps(t,u,o);return d.top=xe(p.top,d.top),d.right=Ge(p.right,d.right),d.bottom=Ge(p.bottom,d.bottom),d.left=xe(p.left,d.left),d},Ps(t,l,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function lg(e){const{width:t,height:r}=Ns(e);return{width:t,height:r}}function cg(e,t,r){const n=Le(t),o=Re(t),i=r==="fixed",s=pt(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const c=Pe(0);function d(){c.x=tn(o)}if(n||!n&&!i)if((At(t)!=="body"||cr(o))&&(l=en(t)),n){const g=pt(t,!0,i,t);c.x=g.x+t.clientLeft,c.y=g.y+t.clientTop}else o&&d();i&&!n&&o&&d();const u=o&&!n&&!i?Ts(o,l):Pe(0),p=s.left+l.scrollLeft-c.x-u.x,m=s.top+l.scrollTop-c.y-u.y;return{x:p,y:m,width:s.width,height:s.height}}function Ao(e){return ke(e).position==="static"}function Rs(e,t){if(!Le(e)||ke(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Re(e)===r&&(r=r.ownerDocument.body),r}function Ls(e,t){const r=be(e);if(Qr(e))return r;if(!Le(e)){let o=Ke(e);for(;o&&!Pt(o);){if(je(o)&&!Ao(o))return o;o=Ke(o)}return r}let n=Rs(e,t);for(;n&&Wh(n)&&Ao(n);)n=Rs(n,t);return n&&Pt(n)&&Ao(n)&&!Co(n)?r:n||Xh(e)||r}const dg=async function(e){const t=this.getOffsetParent||Ls,r=this.getDimensions,n=await r(e.floating);return{reference:cg(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function ug(e){return ke(e).direction==="rtl"}const pg={convertOffsetParentRelativeRectToViewportRelativeRect:eg,getDocumentElement:Re,getClippingRect:sg,getOffsetParent:Ls,getElementRects:dg,getClientRects:tg,getDimensions:lg,getScale:Ot,isElement:je,isRTL:ug};function Is(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function mg(e,t){let r=null,n;const o=Re(e);function i(){var l;clearTimeout(n),(l=r)==null||l.disconnect(),r=null}function s(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),i();const d=e.getBoundingClientRect(),{left:u,top:p,width:m,height:g}=d;if(l||t(),!m||!g)return;const b=Yr(p),f=Yr(o.clientWidth-(u+m)),h=Yr(o.clientHeight-(p+g)),v=Yr(u),w={rootMargin:-b+"px "+-f+"px "+-h+"px "+-v+"px",threshold:xe(0,Ge(1,c))||1};let j=!0;function C(N){const S=N[0].intersectionRatio;if(S!==c){if(!j)return s();S?s(!1,S):n=setTimeout(()=>{s(!1,1e-7)},1e3)}S===1&&!Is(d,e.getBoundingClientRect())&&s(),j=!1}try{r=new IntersectionObserver(C,{...w,root:o.ownerDocument})}catch{r=new IntersectionObserver(C,w)}r.observe(e)}return s(!0),i}function fg(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,d=To(e),u=o||i?[...d?dr(d):[],...dr(t)]:[];u.forEach(v=>{o&&v.addEventListener("scroll",r,{passive:!0}),i&&v.addEventListener("resize",r)});const p=d&&l?mg(d,r):null;let m=-1,g=null;s&&(g=new ResizeObserver(v=>{let[y]=v;y&&y.target===d&&g&&(g.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var w;(w=g)==null||w.observe(t)})),r()}),d&&!c&&g.observe(d),g.observe(t));let b,f=c?pt(e):null;c&&h();function h(){const v=pt(e);f&&!Is(f,v)&&r(),f=v,b=requestAnimationFrame(h)}return r(),()=>{var v;u.forEach(y=>{o&&y.removeEventListener("scroll",r),i&&y.removeEventListener("resize",r)}),p?.(),(v=g)==null||v.disconnect(),g=null,c&&cancelAnimationFrame(b)}}const hg=$h,gg=Fh,xg=Mh,bg=Uh,_g=zh,Ms=Ih,vg=Bh,yg=(e,t,r)=>{const n=new Map,o={platform:pg,...r},i={...o.platform,_c:n};return Lh(e,t,{...o,platform:i})};var wg=typeof document<"u",jg=function(){},rn=wg?_.useLayoutEffect:jg;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 i=o[n];if(!(i==="_owner"&&e.$$typeof)&&!nn(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function zs(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ds(e,t){const r=zs(e);return Math.round(t*r)/r}function Po(e){const t=x.useRef(e);return rn(()=>{t.current=e}),t}function kg(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:i,floating:s}={},transform:l=!0,whileElementsMounted:c,open:d}=e,[u,p]=x.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[m,g]=x.useState(n);nn(m,n)||g(n);const[b,f]=x.useState(null),[h,v]=x.useState(null),y=x.useCallback(I=>{I!==N.current&&(N.current=I,f(I))},[]),w=x.useCallback(I=>{I!==S.current&&(S.current=I,v(I))},[]),j=i||b,C=s||h,N=x.useRef(null),S=x.useRef(null),E=x.useRef(u),T=c!=null,A=Po(c),R=Po(o),L=Po(d),B=x.useCallback(()=>{if(!N.current||!S.current)return;const I={placement:t,strategy:r,middleware:m};R.current&&(I.platform=R.current),yg(N.current,S.current,I).then(q=>{const te={...q,isPositioned:L.current!==!1};M.current&&!nn(E.current,te)&&(E.current=te,xr.flushSync(()=>{p(te)}))})},[m,t,r,R,L]);rn(()=>{d===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,p(I=>({...I,isPositioned:!1})))},[d]);const M=x.useRef(!1);rn(()=>(M.current=!0,()=>{M.current=!1}),[]),rn(()=>{if(j&&(N.current=j),C&&(S.current=C),j&&C){if(A.current)return A.current(j,C,B);B()}},[j,C,B,A,T]);const O=x.useMemo(()=>({reference:N,floating:S,setReference:y,setFloating:w}),[y,w]),P=x.useMemo(()=>({reference:j,floating:C}),[j,C]),z=x.useMemo(()=>{const I={position:r,left:0,top:0};if(!P.floating)return I;const q=Ds(P.floating,u.x),te=Ds(P.floating,u.y);return l?{...I,transform:"translate("+q+"px, "+te+"px)",...zs(P.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:q,top:te}},[r,l,P.floating,u.x,u.y]);return x.useMemo(()=>({...u,update:B,refs:O,elements:P,floatingStyles:z}),[u,B,O,P,z])}const Sg=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?Ms({element:n.current,padding:o}).fn(r):{}:n?Ms({element:n,padding:o}).fn(r):{}}}},Cg=(e,t)=>({...hg(e),options:[e,t]}),Ng=(e,t)=>({...gg(e),options:[e,t]}),Eg=(e,t)=>({...vg(e),options:[e,t]}),Tg=(e,t)=>({...xg(e),options:[e,t]}),Ag=(e,t)=>({...bg(e),options:[e,t]}),Pg=(e,t)=>({..._g(e),options:[e,t]}),Og=(e,t)=>({...Sg(e),options:[e,t]});var Rg="Arrow",$s=x.forwardRef((e,t)=>{const{children:r,width:n=10,height:o=5,...i}=e;return a.jsx(W.svg,{...i,ref:t,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:a.jsx("polygon",{points:"0,0 30,0 15,10"})})});$s.displayName=Rg;var Lg=$s;function Ig(e){const[t,r]=x.useState(void 0);return le(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,l;if("borderBoxSize"in i){const c=i.borderBoxSize,d=Array.isArray(c)?c[0]:c;s=d.inlineSize,l=d.blockSize}else s=e.offsetWidth,l=e.offsetHeight;r({width:s,height:l})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var Oo="Popper",[Fs,on]=Ve(Oo),[Mg,Bs]=Fs(Oo),Us=e=>{const{__scopePopper:t,children:r}=e,[n,o]=x.useState(null);return a.jsx(Mg,{scope:t,anchor:n,onAnchorChange:o,children:r})};Us.displayName=Oo;var Hs="PopperAnchor",Vs=x.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...o}=e,i=Bs(Hs,r),s=x.useRef(null),l=J(t,s),c=x.useRef(null);return x.useEffect(()=>{const d=c.current;c.current=n?.current||s.current,d!==c.current&&i.onAnchorChange(c.current)}),n?null:a.jsx(W.div,{...o,ref:l})});Vs.displayName=Hs;var Ro="PopperContent",[zg,Dg]=Fs(Ro),Ws=x.forwardRef((e,t)=>{const{__scopePopper:r,side:n="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:u=0,sticky:p="partial",hideWhenDetached:m=!1,updatePositionStrategy:g="optimized",onPlaced:b,...f}=e,h=Bs(Ro,r),[v,y]=x.useState(null),w=J(t,F=>y(F)),[j,C]=x.useState(null),N=Ig(j),S=N?.width??0,E=N?.height??0,T=n+(i!=="center"?"-"+i:""),A=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},R=Array.isArray(d)?d:[d],L=R.length>0,B={padding:A,boundary:R.filter(Fg),altBoundary:L},{refs:M,floatingStyles:O,placement:P,isPositioned:z,middlewareData:I}=kg({strategy:"fixed",placement:T,whileElementsMounted:(...F)=>fg(...F,{animationFrame:g==="always"}),elements:{reference:h.anchor},middleware:[Cg({mainAxis:o+E,alignmentAxis:s}),c&&Ng({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?Eg():void 0,...B}),c&&Tg({...B}),Ag({...B,apply:({elements:F,rects:Y,availableWidth:se,availableHeight:Z})=>{const{width:ee,height:ae}=Y.reference,ve=F.floating.style;ve.setProperty("--radix-popper-available-width",`${se}px`),ve.setProperty("--radix-popper-available-height",`${Z}px`),ve.setProperty("--radix-popper-anchor-width",`${ee}px`),ve.setProperty("--radix-popper-anchor-height",`${ae}px`)}}),j&&Og({element:j,padding:l}),Bg({arrowWidth:S,arrowHeight:E}),m&&Pg({strategy:"referenceHidden",...B})]}),[q,te]=Ks(P),oe=We(b);le(()=>{z&&oe?.()},[z,oe]);const ge=I.arrow?.x,_e=I.arrow?.y,pe=I.arrow?.centerOffset!==0,[K,de]=x.useState();return le(()=>{v&&de(window.getComputedStyle(v).zIndex)},[v]),a.jsx("div",{ref:M.setFloating,"data-radix-popper-content-wrapper":"",style:{...O,transform:z?O.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:K,"--radix-popper-transform-origin":[I.transformOrigin?.x,I.transformOrigin?.y].join(" "),...I.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:a.jsx(zg,{scope:r,placedSide:q,onArrowChange:C,arrowX:ge,arrowY:_e,shouldHideArrow:pe,children:a.jsx(W.div,{"data-side":q,"data-align":te,...f,ref:w,style:{...f.style,animation:z?void 0:"none"}})})})});Ws.displayName=Ro;var qs="PopperArrow",$g={top:"bottom",right:"left",bottom:"top",left:"right"},Gs=x.forwardRef(function(t,r){const{__scopePopper:n,...o}=t,i=Dg(qs,n),s=$g[i.placedSide];return a.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:a.jsx(Lg,{...o,ref:r,style:{...o.style,display:"block"}})})});Gs.displayName=qs;function Fg(e){return e!==null}var Bg=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:n,middlewareData:o}=t,s=o.arrow?.centerOffset!==0,l=s?0:e.arrowWidth,c=s?0:e.arrowHeight,[d,u]=Ks(r),p={start:"0%",center:"50%",end:"100%"}[u],m=(o.arrow?.x??0)+l/2,g=(o.arrow?.y??0)+c/2;let b="",f="";return d==="bottom"?(b=s?p:`${m}px`,f=`${-c}px`):d==="top"?(b=s?p:`${m}px`,f=`${n.floating.height+c}px`):d==="right"?(b=`${-c}px`,f=s?p:`${g}px`):d==="left"&&(b=`${n.floating.width+c}px`,f=s?p:`${g}px`),{data:{x:b,y:f}}}});function Ks(e){const[t,r="center"]=e.split("-");return[t,r]}var Ys=Us,Lo=Vs,Xs=Ws,Js=Gs,Ug="Portal",an=x.forwardRef((e,t)=>{const{container:r,...n}=e,[o,i]=x.useState(!1);le(()=>i(!0),[]);const s=r||o&&globalThis?.document?.body;return s?ja.createPortal(a.jsx(W.div,{...n,ref:t}),s):null});an.displayName=Ug;function Hg(e,t){return x.useReducer((r,n)=>t[r][n]??r,e)}var Ye=e=>{const{present:t,children:r}=e,n=Vg(t),o=typeof r=="function"?r({present:n.isPresent}):x.Children.only(r),i=J(n.ref,Wg(o));return typeof r=="function"||n.isPresent?x.cloneElement(o,{ref:i}):null};Ye.displayName="Presence";function Vg(e){const[t,r]=x.useState(),n=x.useRef(null),o=x.useRef(e),i=x.useRef("none"),s=e?"mounted":"unmounted",[l,c]=Hg(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const d=sn(n.current);i.current=l==="mounted"?d:"none"},[l]),le(()=>{const d=n.current,u=o.current;if(u!==e){const m=i.current,g=sn(d);e?c("MOUNT"):g==="none"||d?.display==="none"?c("UNMOUNT"):c(u&&m!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),le(()=>{if(t){let d;const u=t.ownerDocument.defaultView??window,p=g=>{const f=sn(n.current).includes(CSS.escape(g.animationName));if(g.target===t&&f&&(c("ANIMATION_END"),!o.current)){const h=t.style.animationFillMode;t.style.animationFillMode="forwards",d=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=h)})}},m=g=>{g.target===t&&(i.current=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 c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:x.useCallback(d=>{n.current=d?getComputedStyle(d):null,r(d)},[])}}function sn(e){return e?.animationName||"none"}function Wg(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 qg=x[" useInsertionEffect ".trim().toString()]||le;function mt({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[o,i,s]=Gg({defaultProp:t,onChange:r}),l=e!==void 0,c=l?e:o;{const u=x.useRef(e!==void 0);x.useEffect(()=>{const p=u.current;p!==l&&console.warn(`${n} is changing from ${p?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=l},[l,n])}const d=x.useCallback(u=>{if(l){const p=Kg(u)?u(e):u;p!==e&&s.current?.(p)}else i(u)},[l,e,i,s]);return[c,d]}function Gg({defaultProp:e,onChange:t}){const[r,n]=x.useState(e),o=x.useRef(r),i=x.useRef(t);return qg(()=>{i.current=t},[t]),x.useEffect(()=>{o.current!==r&&(i.current?.(r),o.current=r)},[r,o]),[r,n,i]}function Kg(e){return typeof e=="function"}var Yg=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Rt=new WeakMap,ln=new WeakMap,cn={},Io=0,Zs=function(e){return e&&(e.host||Zs(e.parentNode))},Xg=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=Zs(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})},Jg=function(e,t,r,n){var o=Xg(t,Array.isArray(e)?e:[e]);cn[r]||(cn[r]=new WeakMap);var i=cn[r],s=[],l=new Set,c=new Set(o),d=function(p){!p||l.has(p)||(l.add(p),d(p.parentNode))};o.forEach(d);var u=function(p){!p||c.has(p)||Array.prototype.forEach.call(p.children,function(m){if(l.has(m))u(m);else try{var g=m.getAttribute(n),b=g!==null&&g!=="false",f=(Rt.get(m)||0)+1,h=(i.get(m)||0)+1;Rt.set(m,f),i.set(m,h),s.push(m),f===1&&b&&ln.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(),Io++,function(){s.forEach(function(p){var m=Rt.get(p)-1,g=i.get(p)-1;Rt.set(p,m),i.set(p,g),m||(ln.has(p)||p.removeAttribute(n),ln.delete(p)),g||p.removeAttribute(r)}),Io--,Io||(Rt=new WeakMap,Rt=new WeakMap,ln=new WeakMap,cn={})}},Mo=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=Yg(e);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live], script"))),Jg(n,o,r,"aria-hidden")):function(){return null}},Ie=function(){return Ie=Object.assign||function(t){for(var r,n=1,o=arguments.length;n<o;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},Ie.apply(this,arguments)};function Qs(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 Zg(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,i;n<o;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var dn="right-scroll-bar-position",un="width-before-scroll-bar",Qg="with-scroll-bars-hidden",ex="--removed-body-scroll-bar-size";function zo(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function tx(e,t){var r=_.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 rx=typeof window<"u"?x.useLayoutEffect:x.useEffect,el=new WeakMap;function nx(e,t){var r=tx(null,function(n){return e.forEach(function(o){return zo(o,n)})});return rx(function(){var n=el.get(r);if(n){var o=new Set(n),i=new Set(e),s=r.current;o.forEach(function(l){i.has(l)||zo(l,null)}),i.forEach(function(l){o.has(l)||zo(l,s)})}el.set(r,e)},[e]),r}function ox(e){return e}function ax(e,t){t===void 0&&(t=ox);var r=[],n=!1,o={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(i){var s=t(i,n);return r.push(s),function(){r=r.filter(function(l){return l!==s})}},assignSyncMedium:function(i){for(n=!0;r.length;){var s=r;r=[],s.forEach(i)}r={push:function(l){return i(l)},filter:function(){return r}}},assignMedium:function(i){n=!0;var s=[];if(r.length){var l=r;r=[],l.forEach(i),s=r}var c=function(){var u=s;s=[],u.forEach(i)},d=function(){return Promise.resolve().then(c)};d(),r={push:function(u){s.push(u),d()},filter:function(u){return s=s.filter(u),r}}}};return o}function ix(e){e===void 0&&(e={});var t=ax(null);return t.options=Ie({async:!0,ssr:!1},e),t}var tl=function(e){var t=e.sideCar,r=Qs(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return x.createElement(n,Ie({},r))};tl.isSideCarExport=!0;function sx(e,t){return e.useMedium(t),tl}var rl=ix(),Do=function(){},pn=x.forwardRef(function(e,t){var r=x.useRef(null),n=x.useState({onScrollCapture:Do,onWheelCapture:Do,onTouchMoveCapture:Do}),o=n[0],i=n[1],s=e.forwardProps,l=e.children,c=e.className,d=e.removeScrollBar,u=e.enabled,p=e.shards,m=e.sideCar,g=e.noRelative,b=e.noIsolation,f=e.inert,h=e.allowPinchZoom,v=e.as,y=v===void 0?"div":v,w=e.gapMode,j=Qs(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=m,N=nx([r,t]),S=Ie(Ie({},j),o);return x.createElement(x.Fragment,null,u&&x.createElement(C,{sideCar:rl,removeScrollBar:d,shards:p,noRelative:g,noIsolation:b,inert:f,setCallbacks:i,allowPinchZoom:!!h,lockRef:r,gapMode:w}),s?x.cloneElement(x.Children.only(l),Ie(Ie({},S),{ref:N})):x.createElement(y,Ie({},S,{className:c,ref:N}),l))});pn.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},pn.classNames={fullWidth:un,zeroRight:dn};var lx=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function cx(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=lx();return t&&e.setAttribute("nonce",t),e}function dx(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function ux(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var px=function(){var e=0,t=null;return{add:function(r){e==0&&(t=cx())&&(dx(t,r),ux(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},mx=function(){var e=px();return function(t,r){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},nl=function(){var e=mx(),t=function(r){var n=r.styles,o=r.dynamic;return e(n,o),null};return t},fx={left:0,top:0,right:0,gap:0},$o=function(e){return parseInt(e||"",10)||0},hx=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[$o(r),$o(n),$o(o)]},gx=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return fx;var t=hx(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])}},xx=nl(),Lt="data-scroll-locked",bx=function(e,t,r,n){var o=e.left,i=e.top,s=e.right,l=e.gap;return r===void 0&&(r="margin"),` 359 .`.concat(Qg,` { 360 360 overflow: hidden `).concat(n,`; 361 361 padding-right: `).concat(l,"px ").concat(n,`; … … 391 391 392 392 body[`).concat(Lt,`] { 393 `).concat( Zg,": ").concat(l,`px;394 } 395 `)},ol=function(){var e=parseInt(document.body.getAttribute(Lt)||"0",10);return isFinite(e)?e:0}, xx=function(){x.useEffect(function(){return document.body.setAttribute(Lt,(ol()+1).toString()),function(){var e=ol()-1;e<=0?document.body.removeAttribute(Lt):document.body.setAttribute(Lt,e.toString())}},[])},bx=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,o=n===void 0?"margin":n;xx();var i=x.useMemo(function(){return fx(o)},[o]);return x.createElement(hx,{styles:gx(i,!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 It=Fo?{passive:!1}:!1,_x=function(e){return e.tagName==="TEXTAREA"},al=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!_x(e)&&r[t]==="visible")},vx=function(e){return al(e,"overflowY")},yx=function(e){return al(e,"overflowX")},il=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var o=sl(e,n);if(o){var i=ll(e,n),s=i[1],l=i[2];if(s>l)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},wx=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},jx=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},sl=function(e,t){return e==="v"?vx(t):yx(t)},ll=function(e,t){return e==="v"?wx(t):jx(t)},kx=function(e,t){return e==="h"&&t==="rtl"?-1:1},Sx=function(e,t,r,n,o){var i=kx(e,window.getComputedStyle(t).direction),s=i*n,l=r.target,c=t.contains(l),d=!1,u=s>0,p=0,m=0;do{if(!l)break;var g=ll(e,l),b=g[0],f=g[1],h=g[2],v=f-h-i*b;(b||v)&&sl(e,l)&&(p+=v,m+=b);var y=l.parentNode;l=y&&y.nodeType===Node.DOCUMENT_FRAGMENT_NODE?y.host:y}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(u&&Math.abs(p)<1||!u&&Math.abs(m)<1)&&(d=!0),d},fn=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},cl=function(e){return[e.deltaX,e.deltaY]},dl=function(e){return e&&"current"in e?e.current:e},Cx=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Nx=function(e){return`393 `).concat(ex,": ").concat(l,`px; 394 } 395 `)},ol=function(){var e=parseInt(document.body.getAttribute(Lt)||"0",10);return isFinite(e)?e:0},_x=function(){x.useEffect(function(){return document.body.setAttribute(Lt,(ol()+1).toString()),function(){var e=ol()-1;e<=0?document.body.removeAttribute(Lt):document.body.setAttribute(Lt,e.toString())}},[])},vx=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,o=n===void 0?"margin":n;_x();var i=x.useMemo(function(){return gx(o)},[o]);return x.createElement(xx,{styles:bx(i,!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 It=Fo?{passive:!1}:!1,yx=function(e){return e.tagName==="TEXTAREA"},al=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!yx(e)&&r[t]==="visible")},wx=function(e){return al(e,"overflowY")},jx=function(e){return al(e,"overflowX")},il=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var o=sl(e,n);if(o){var i=ll(e,n),s=i[1],l=i[2];if(s>l)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},kx=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},Sx=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},sl=function(e,t){return e==="v"?wx(t):jx(t)},ll=function(e,t){return e==="v"?kx(t):Sx(t)},Cx=function(e,t){return e==="h"&&t==="rtl"?-1:1},Nx=function(e,t,r,n,o){var i=Cx(e,window.getComputedStyle(t).direction),s=i*n,l=r.target,c=t.contains(l),d=!1,u=s>0,p=0,m=0;do{if(!l)break;var g=ll(e,l),b=g[0],f=g[1],h=g[2],v=f-h-i*b;(b||v)&&sl(e,l)&&(p+=v,m+=b);var y=l.parentNode;l=y&&y.nodeType===Node.DOCUMENT_FRAGMENT_NODE?y.host:y}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(u&&Math.abs(p)<1||!u&&Math.abs(m)<1)&&(d=!0),d},fn=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},cl=function(e){return[e.deltaX,e.deltaY]},dl=function(e){return e&&"current"in e?e.current:e},Ex=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Tx=function(e){return` 396 396 .block-interactivity-`.concat(e,` {pointer-events: none;} 397 397 .allow-interactivity-`).concat(e,` {pointer-events: all;} 398 `)}, Ex=0,Mt=[];function Tx(e){var t=x.useRef([]),r=x.useRef([0,0]),n=x.useRef(),o=x.useState(Ex++)[0],i=x.useState(nl)[0],s=x.useRef(e);x.useEffect(function(){s.current=e},[e]),x.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var f=Xg([e.lockRef.current],(e.shards||[]).map(dl),!0).filter(Boolean);return f.forEach(function(h){return h.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),f.forEach(function(h){return h.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=x.useCallback(function(f,h){if("touches"in f&&f.touches.length===2||f.type==="wheel"&&f.ctrlKey)return!s.current.allowPinchZoom;var v=fn(f),y=r.current,w="deltaX"in f?f.deltaX:y[0]-v[0],j="deltaY"in f?f.deltaY:y[1]-v[1],C,N=f.target,S=Math.abs(w)>Math.abs(j)?"h":"v";if("touches"in f&&S==="h"&&N.type==="range")return!1;var E=il(S,N);if(!E)return!0;if(E?C=S:(C=S==="v"?"h":"v",E=il(S,N)),!E)return!1;if(!n.current&&"changedTouches"in f&&(w||j)&&(n.current=C),!C)return!0;var T=n.current||C;return Sx(T,h,f,T==="h"?w:j)},[]),c=x.useCallback(function(f){var h=f;if(!(!Mt.length||Mt[Mt.length-1]!==i)){var v="deltaY"in h?cl(h):fn(h),y=t.current.filter(function(C){return C.name===h.type&&(C.target===h.target||h.target===C.shadowParent)&&Cx(C.delta,v)})[0];if(y&&y.should){h.cancelable&&h.preventDefault();return}if(!y){var w=(s.current.shards||[]).map(dl).filter(Boolean).filter(function(C){return C.contains(h.target)}),j=w.length>0?l(h,w[0]):!s.current.noIsolation;j&&h.cancelable&&h.preventDefault()}}},[]),d=x.useCallback(function(f,h,v,y){var w={name:f,delta:h,target:v,should:y,shadowParent:Ax(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=fn(f),n.current=void 0},[]),p=x.useCallback(function(f){d(f.type,cl(f),f.target,l(f,e.lockRef.current))},[]),m=x.useCallback(function(f){d(f.type,fn(f),f.target,l(f,e.lockRef.current))},[]);x.useEffect(function(){return Mt.push(i),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",c,It),document.addEventListener("touchmove",c,It),document.addEventListener("touchstart",u,It),function(){Mt=Mt.filter(function(f){return f!==i}),document.removeEventListener("wheel",c,It),document.removeEventListener("touchmove",c,It),document.removeEventListener("touchstart",u,It)}},[]);var g=e.removeScrollBar,b=e.inert;return x.createElement(x.Fragment,null,b?x.createElement(i,{styles:Nx(o)}):null,g?x.createElement(bx,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Ax(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Px=ax(rl,Tx);var hn=x.forwardRef(function(e,t){return x.createElement(pn,Ie({},e,{ref:t,sideCar:Px}))});hn.classNames=pn.classNames;var gn="Popover",[ul]=Ve(gn,[on]),ur=on(),[Ox,Xe]=ul(gn),pl=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:o,onOpenChange:i,modal:s=!1}=e,l=ur(t),c=x.useRef(null),[d,u]=x.useState(!1),[p,m]=mt({prop:n,defaultProp:o??!1,onChange:i,caller:gn});return a.jsx(Ys,{...l,children:a.jsx(Ox,{scope:t,contentId:Ae(),triggerRef:c,open:p,onOpenChange:m,onOpenToggle:x.useCallback(()=>m(g=>!g),[m]),hasCustomAnchor:d,onCustomAnchorAdd:x.useCallback(()=>u(!0),[]),onCustomAnchorRemove:x.useCallback(()=>u(!1),[]),modal:s,children:r})})};pl.displayName=gn;var ml="PopoverAnchor",Rx=x.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Xe(ml,r),i=ur(r),{onCustomAnchorAdd:s,onCustomAnchorRemove:l}=o;return x.useEffect(()=>(s(),()=>l()),[s,l]),a.jsx(Lo,{...i,...n,ref:t})});Rx.displayName=ml;var fl="PopoverTrigger",hl=x.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Xe(fl,r),i=ur(r),s=J(t,o.triggerRef),l=a.jsx(W.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":vl(o.open),...n,ref:s,onClick:H(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?l:a.jsx(Lo,{asChild:!0,...i,children:l})});hl.displayName=fl;var Bo="PopoverPortal",[Lx,Ix]=ul(Bo,{forceMount:void 0}),gl=e=>{const{__scopePopover:t,forceMount:r,children:n,container:o}=e,i=Xe(Bo,t);return a.jsx(Lx,{scope:t,forceMount:r,children:a.jsx(Ye,{present:r||i.open,children:a.jsx(an,{asChild:!0,container:o,children:n})})})};gl.displayName=Bo;var zt="PopoverContent",xl=x.forwardRef((e,t)=>{const r=Ix(zt,e.__scopePopover),{forceMount:n=r.forceMount,...o}=e,i=Xe(zt,e.__scopePopover);return a.jsx(Ye,{present:n||i.open,children:i.modal?a.jsx(zx,{...o,ref:t}):a.jsx(Dx,{...o,ref:t})})});xl.displayName=zt;var Mx=st("PopoverContent.RemoveScroll"),zx=x.forwardRef((e,t)=>{const r=Xe(zt,e.__scopePopover),n=x.useRef(null),o=J(t,n),i=x.useRef(!1);return x.useEffect(()=>{const s=n.current;if(s)return Mo(s)},[]),a.jsx(hn,{as:Mx,allowPinchZoom:!0,children:a.jsx(bl,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:H(e.onCloseAutoFocus,s=>{s.preventDefault(),i.current||r.triggerRef.current?.focus()}),onPointerDownOutside:H(e.onPointerDownOutside,s=>{const l=s.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,d=l.button===2||c;i.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:H(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),Dx=x.forwardRef((e,t)=>{const r=Xe(zt,e.__scopePopover),n=x.useRef(!1),o=x.useRef(!1);return a.jsx(bl,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(n.current||r.triggerRef.current?.focus(),i.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;r.triggerRef.current?.contains(s)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),bl=x.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:u,...p}=e,m=Xe(zt,r),g=ur(r);return bo(),a.jsx(Gr,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:i,children:a.jsx(qr,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:u,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onDismiss:()=>m.onOpenChange(!1),children:a.jsx(Xs,{"data-state":vl(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)"}})})})}),_l="PopoverClose",$x=x.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Xe(_l,r);return a.jsx(W.button,{type:"button",...n,ref:t,onClick:H(e.onClick,()=>o.onOpenChange(!1))})});$x.displayName=_l;var Fx="PopoverArrow",Bx=x.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=ur(r);return a.jsx(Js,{...o,...n,ref:t})});Bx.displayName=Fx;function vl(e){return e?"open":"closed"}var Ux=pl,Hx=hl,Vx=gl,Wx=xl;function Je({...e}){return a.jsx(Ux,{"data-slot":"popover",...e})}function Ze({...e}){return a.jsx(Hx,{"data-slot":"popover-trigger",...e})}function Qe({className:e,align:t="center",sideOffset:r=4,...n}){const o=typeof document<"u"?document.getElementById("ecommreels-admin-app")??document.body:void 0;return a.jsx(Vx,{container:o,children:a.jsx(Wx,{"data-slot":"popover-content",align:t,sideOffset:r,className:$("ecr-popover",e),...n})})}const Uo="data:image/svg+xml,%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Transformed%20by:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20fill='%23919191'%20width='800px'%20height='800px'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%20stroke='%23919191'%3e%3cg%20id='SVGRepo_bgCarrier'%20stroke-width='0'/%3e%3cg%20id='SVGRepo_tracerCarrier'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cg%20id='SVGRepo_iconCarrier'%3e%3cg%20data-name='Layer%202'%3e%3cg%20data-name='file-add'%3e%3crect%20width='24'%20height='24'%20opacity='0'/%3e%3cpath%20d='M19.74%207.33l-4.44-5a1%201%200%200%200-.74-.33h-8A2.53%202.53%200%200%200%204%204.5v15A2.53%202.53%200%200%200%206.56%2022h10.88A2.53%202.53%200%200%200%2020%2019.5V8a1%201%200%200%200-.26-.67zM14%2015h-1v1a1%201%200%200%201-2%200v-1h-1a1%201%200%200%201%200-2h1v-1a1%201%200%200%201%202%200v1h1a1%201%200%200%201%200%202zm.71-7a.79.79%200%200%201-.71-.85V4l3.74%204z'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e";var qx=Symbol.for("react.lazy"),xn=x[" use ".trim().toString()];function Gx(e){return typeof e=="object"&&e!==null&&"then"in e}function yl(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===qx&&"_payload"in e&&Gx(e._payload)}function Kx(e){const t=Yx(e),r=x.forwardRef((n,o)=>{let{children:i,...s}=n;yl(i)&&typeof xn=="function"&&(i=xn(i._payload));const l=x.Children.toArray(i),c=l.find(Jx);if(c){const d=c.props.children,u=l.map(p=>p===c?x.Children.count(d)>1?x.Children.only(null):x.isValidElement(d)?d.props.children:null:p);return a.jsx(t,{...s,ref:o,children:x.isValidElement(d)?x.cloneElement(d,void 0,u):null})}return a.jsx(t,{...s,ref:o,children:i})});return r.displayName=`${e}.Slot`,r}function Yx(e){const t=x.forwardRef((r,n)=>{let{children:o,...i}=r;if(yl(o)&&typeof xn=="function"&&(o=xn(o._payload)),x.isValidElement(o)){const s=Qx(o),l=Zx(i,o.props);return o.type!==x.Fragment&&(l.ref=n?Kn(n,s):s),x.cloneElement(o,l)}return x.Children.count(o)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Xx=Symbol("radix.slottable");function Jx(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Xx}function Zx(e,t){const r={...t};for(const n in t){const o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...l)=>{const c=i(...l);return o(...l),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}function Qx(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 e0=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],t0=e0.reduce((e,t)=>{const r=Kx(`Primitive.${t}`),n=x.forwardRef((o,i)=>{const{asChild:s,...l}=o,c=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),r0="Separator",wl="horizontal",n0=["horizontal","vertical"],jl=x.forwardRef((e,t)=>{const{decorative:r,orientation:n=wl,...o}=e,i=o0(n)?n:wl,l=r?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return a.jsx(t0.div,{"data-orientation":i,...l,...o,ref:t})});jl.displayName=r0;function o0(e){return n0.includes(e)}var a0=jl;function bn({className:e,orientation:t="horizontal",decorative:r=!0,...n}){return a.jsx(a0,{"data-slot":"separator",decorative:r,orientation:t,className:$("ecr-separator",e),...n})}const ft=({name:e,text:t})=>{const r=ecommreelsInfo.isProActive,n=ecommreelsInfo.isLicenseActive,o=ecommreelsInfo.license_page;return a.jsxs("div",{className:"ecr-admin-upgrade__modal",children:[a.jsxs("h4",{className:"ecr-admin-upgrade__title",children:[a.jsx("span",{className:"ecr-admin-upgrade__name",children:e}),a.jsx("span",{className:"ecr-admin-upgrade__tag",children:"PRO"})]}),a.jsx(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(ne,{asChild:!0,className:"ecr-admin-upgrade__button",size:"sm",children:a.jsx("a",{href:r&&!n?o:"https://reelswp.com/pricing/",style:{color:"#fff"},target:"_blank",rel:"noreferrer",className:"ecr-admin-upgrade__link",children:r&&!n?"Active":"Upgrade to Pro"})})})]})},ce=[];for(let e=0;e<256;++e)ce.push((e+256).toString(16).slice(1));function i0(e,t=0){return(ce[e[t+0]]+ce[e[t+1]]+ce[e[t+2]]+ce[e[t+3]]+"-"+ce[e[t+4]]+ce[e[t+5]]+"-"+ce[e[t+6]]+ce[e[t+7]]+"-"+ce[e[t+8]]+ce[e[t+9]]+"-"+ce[e[t+10]]+ce[e[t+11]]+ce[e[t+12]]+ce[e[t+13]]+ce[e[t+14]]+ce[e[t+15]]).toLowerCase()}let Ho;const s0=new Uint8Array(16);function l0(){if(!Ho){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Ho=crypto.getRandomValues.bind(crypto)}return Ho(s0)}const kl={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function c0(e,t,r){e=e||{};const n=e.random??e.rng?.()??l0();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,i0(n)}function _n(e,t,r){return kl.randomUUID&&!e?kl.randomUUID():c0(e)}const d0=new Set(["video/mp4"]),u0=[".mp4",".m4v"],p0=e=>(e.mime||"").toLowerCase().trim(),m0=e=>(e.url||"").toLowerCase().trim(),f0=e=>e.split("?")[0].split("#")[0],h0=e=>{const t=f0(e);return u0.some(r=>t.endsWith(r))},g0=()=>{if(typeof document>"u")return!0;const t=document.createElement("video").canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"');return t==="probably"||t==="maybe"},x0=e=>{const t=p0(e),r=m0(e),n=t&&d0.has(t),o=r&&h0(r);return!n&&!o?!1:g0()},b0=e=>{const t=[],r=[];for(const n of e)x0(n)?t.push(n):r.push(n);return{compatible:t,incompatible:r}},_0=({setUploadedFiles:e,setShowOptions:t})=>{const r=()=>{if(!window.wp?.media){G.error("Media library is not available.");return}const n=window.wp.media({title:"Select image or video files",button:{text:"Use this file"},multiple:!1,library:{type:["video"]}});n.on("select",()=>{const o=n.state().get("selection").toJSON();if(!e)return;const{incompatible:i}=b0(o);i.length>0&&G(a.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:8},children:[a.jsx(Zp,{style:{flexShrink:0},color:"oklch(66.6% 0.179 58.318)"}),i.length," video(s) may not play reliably on iOS/macOS Safari. Recommended format: MP4 (H.264/AAC)."]}));const s=o.map(l=>({url:l.url,mime_type:l.mime,file_uuid:_n(),source:"native"}));e(l=>[...l,...s]),t(!1)}),n.open()};return a.jsxs("button",{className:"ecr-admin-upload-native-video-btn",type:"button",onClick:r,children:[a.jsx(up,{})," Choose from Media"]})},v0=({setUploadedFiles:e})=>{const[t,r]=_.useState(!1);return a.jsxs("div",{className:"ecr-admin-upload",children:[a.jsx("button",{type:"button",className:"ecr-admin-upload__label",onClick:()=>r(!0),children:a.jsxs("span",{className:"ecr-admin-upload__text-icon_wrapper",children:[a.jsx("img",{className:"ecr-admin-upload__icon",src:Uo,alt:"Upload"}),a.jsx("span",{className:"ecr-admin-upload__text",children:a.jsxs("span",{className:"ecr-admin-upload__text-stack",children:[a.jsx("span",{className:"ecr-admin-upload__text-item",children:"Upload videos"}),a.jsx("span",{className:"ecr-admin-upload__text-item",children:"Click here to upload videos"})]})})]})}),t?a.jsxs("div",{className:"ecr-admin-upload-source-panel",children:[a.jsx("button",{type:"button",className:"ecr-admin-upload-source-panel__close",onClick:()=>r(!1),"aria-label":"Close upload source picker",children:a.jsx(er,{size:16})}),a.jsx("p",{className:"ecr-admin-upload-source-popover__title",children:"Add Videos"}),a.jsx("p",{className:"ecr-admin-upload-source-popover__description",children:"Upload from media library or paste Vimeo links."}),a.jsxs("div",{className:"ecr-admin-upload-source-popover__options",children:[a.jsx(_0,{setUploadedFiles:e,setShowOptions:r}),a.jsxs(Je,{children:[a.jsx(Ze,{asChild:!0,children:a.jsxs("button",{className:"ecr-admin-upload-vimeo-video-btn",type:"button",children:[a.jsx(lp,{})," Add Vimeo Videos ",a.jsx(at,{size:20})]})}),a.jsx(Qe,{className:"ecr-admin-links__popover",children:a.jsx(ft,{name:"Vimeo Videos",text:a.jsx(a.Fragment,{children:"To embed Vimeo videos directly into your reels, giving your content a professional, seamless, and engaging playback experience for your audience."})})})]})]})]}):null]})};var vn="Dialog",[Sl]=Ve(vn),[y0,Se]=Sl(vn),Cl=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:o,onOpenChange:i,modal:s=!0}=e,l=x.useRef(null),c=x.useRef(null),[d,u]=mt({prop:n,defaultProp:o??!1,onChange:i,caller:vn});return a.jsx(y0,{scope:t,triggerRef:l,contentRef:c,contentId:Ae(),titleId:Ae(),descriptionId:Ae(),open:d,onOpenChange:u,onOpenToggle:x.useCallback(()=>u(p=>!p),[u]),modal:s,children:r})};Cl.displayName=vn;var Nl="DialogTrigger",El=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=Se(Nl,r),i=J(t,o.triggerRef);return a.jsx(W.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":qo(o.open),...n,ref:i,onClick:H(e.onClick,o.onOpenToggle)})});El.displayName=Nl;var Vo="DialogPortal",[w0,Tl]=Sl(Vo,{forceMount:void 0}),Al=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:o}=e,i=Se(Vo,t);return a.jsx(w0,{scope:t,forceMount:r,children:x.Children.map(n,s=>a.jsx(Ye,{present:r||i.open,children:a.jsx(an,{asChild:!0,container:o,children:s})}))})};Al.displayName=Vo;var yn="DialogOverlay",Pl=x.forwardRef((e,t)=>{const r=Tl(yn,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,i=Se(yn,e.__scopeDialog);return i.modal?a.jsx(Ye,{present:n||i.open,children:a.jsx(k0,{...o,ref:t})}):null});Pl.displayName=yn;var j0=st("DialogOverlay.RemoveScroll"),k0=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=Se(yn,r);return a.jsx(hn,{as:j0,allowPinchZoom:!0,shards:[o.contentRef],children:a.jsx(W.div,{"data-state":qo(o.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),ht="DialogContent",Ol=x.forwardRef((e,t)=>{const r=Tl(ht,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,i=Se(ht,e.__scopeDialog);return a.jsx(Ye,{present:n||i.open,children:i.modal?a.jsx(S0,{...o,ref:t}):a.jsx(C0,{...o,ref:t})})});Ol.displayName=ht;var S0=x.forwardRef((e,t)=>{const r=Se(ht,e.__scopeDialog),n=x.useRef(null),o=J(t,r.contentRef,n);return x.useEffect(()=>{const i=n.current;if(i)return Mo(i)},[]),a.jsx(Rl,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:H(e.onCloseAutoFocus,i=>{i.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:H(e.onPointerDownOutside,i=>{const s=i.detail.originalEvent,l=s.button===0&&s.ctrlKey===!0;(s.button===2||l)&&i.preventDefault()}),onFocusOutside:H(e.onFocusOutside,i=>i.preventDefault())})}),C0=x.forwardRef((e,t)=>{const r=Se(ht,e.__scopeDialog),n=x.useRef(!1),o=x.useRef(!1);return a.jsx(Rl,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(n.current||r.triggerRef.current?.focus(),i.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;r.triggerRef.current?.contains(s)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),Rl=x.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:i,...s}=e,l=Se(ht,r),c=x.useRef(null),d=J(t,c);return bo(),a.jsxs(a.Fragment,{children:[a.jsx(Gr,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:i,children:a.jsx(qr,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":qo(l.open),...s,ref:d,onDismiss:()=>l.onOpenChange(!1)})}),a.jsxs(a.Fragment,{children:[a.jsx(E0,{titleId:l.titleId}),a.jsx(A0,{contentRef:c,descriptionId:l.descriptionId})]})]})}),Wo="DialogTitle",Ll=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=Se(Wo,r);return a.jsx(W.h2,{id:o.titleId,...n,ref:t})});Ll.displayName=Wo;var Il="DialogDescription",N0=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=Se(Il,r);return a.jsx(W.p,{id:o.descriptionId,...n,ref:t})});N0.displayName=Il;var Ml="DialogClose",zl=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=Se(Ml,r);return a.jsx(W.button,{type:"button",...n,ref:t,onClick:H(e.onClick,()=>o.onOpenChange(!1))})});zl.displayName=Ml;function qo(e){return e?"open":"closed"}var Dl="DialogTitleWarning",[M1,$l]=eh(Dl,{contentName:ht,titleName:Wo,docsSlug:"dialog"}),E0=({titleId:e})=>{const t=$l(Dl),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.398 `)},Ax=0,Mt=[];function Px(e){var t=x.useRef([]),r=x.useRef([0,0]),n=x.useRef(),o=x.useState(Ax++)[0],i=x.useState(nl)[0],s=x.useRef(e);x.useEffect(function(){s.current=e},[e]),x.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var f=Zg([e.lockRef.current],(e.shards||[]).map(dl),!0).filter(Boolean);return f.forEach(function(h){return h.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),f.forEach(function(h){return h.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=x.useCallback(function(f,h){if("touches"in f&&f.touches.length===2||f.type==="wheel"&&f.ctrlKey)return!s.current.allowPinchZoom;var v=fn(f),y=r.current,w="deltaX"in f?f.deltaX:y[0]-v[0],j="deltaY"in f?f.deltaY:y[1]-v[1],C,N=f.target,S=Math.abs(w)>Math.abs(j)?"h":"v";if("touches"in f&&S==="h"&&N.type==="range")return!1;var E=il(S,N);if(!E)return!0;if(E?C=S:(C=S==="v"?"h":"v",E=il(S,N)),!E)return!1;if(!n.current&&"changedTouches"in f&&(w||j)&&(n.current=C),!C)return!0;var T=n.current||C;return Nx(T,h,f,T==="h"?w:j)},[]),c=x.useCallback(function(f){var h=f;if(!(!Mt.length||Mt[Mt.length-1]!==i)){var v="deltaY"in h?cl(h):fn(h),y=t.current.filter(function(C){return C.name===h.type&&(C.target===h.target||h.target===C.shadowParent)&&Ex(C.delta,v)})[0];if(y&&y.should){h.cancelable&&h.preventDefault();return}if(!y){var w=(s.current.shards||[]).map(dl).filter(Boolean).filter(function(C){return C.contains(h.target)}),j=w.length>0?l(h,w[0]):!s.current.noIsolation;j&&h.cancelable&&h.preventDefault()}}},[]),d=x.useCallback(function(f,h,v,y){var w={name:f,delta:h,target:v,should:y,shadowParent:Ox(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=fn(f),n.current=void 0},[]),p=x.useCallback(function(f){d(f.type,cl(f),f.target,l(f,e.lockRef.current))},[]),m=x.useCallback(function(f){d(f.type,fn(f),f.target,l(f,e.lockRef.current))},[]);x.useEffect(function(){return Mt.push(i),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",c,It),document.addEventListener("touchmove",c,It),document.addEventListener("touchstart",u,It),function(){Mt=Mt.filter(function(f){return f!==i}),document.removeEventListener("wheel",c,It),document.removeEventListener("touchmove",c,It),document.removeEventListener("touchstart",u,It)}},[]);var g=e.removeScrollBar,b=e.inert;return x.createElement(x.Fragment,null,b?x.createElement(i,{styles:Tx(o)}):null,g?x.createElement(vx,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Ox(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Rx=sx(rl,Px);var hn=x.forwardRef(function(e,t){return x.createElement(pn,Ie({},e,{ref:t,sideCar:Rx}))});hn.classNames=pn.classNames;var gn="Popover",[ul]=Ve(gn,[on]),ur=on(),[Lx,Xe]=ul(gn),pl=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:o,onOpenChange:i,modal:s=!1}=e,l=ur(t),c=x.useRef(null),[d,u]=x.useState(!1),[p,m]=mt({prop:n,defaultProp:o??!1,onChange:i,caller:gn});return a.jsx(Ys,{...l,children:a.jsx(Lx,{scope:t,contentId:Ae(),triggerRef:c,open:p,onOpenChange:m,onOpenToggle:x.useCallback(()=>m(g=>!g),[m]),hasCustomAnchor:d,onCustomAnchorAdd:x.useCallback(()=>u(!0),[]),onCustomAnchorRemove:x.useCallback(()=>u(!1),[]),modal:s,children:r})})};pl.displayName=gn;var ml="PopoverAnchor",Ix=x.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Xe(ml,r),i=ur(r),{onCustomAnchorAdd:s,onCustomAnchorRemove:l}=o;return x.useEffect(()=>(s(),()=>l()),[s,l]),a.jsx(Lo,{...i,...n,ref:t})});Ix.displayName=ml;var fl="PopoverTrigger",hl=x.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Xe(fl,r),i=ur(r),s=J(t,o.triggerRef),l=a.jsx(W.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":vl(o.open),...n,ref:s,onClick:H(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?l:a.jsx(Lo,{asChild:!0,...i,children:l})});hl.displayName=fl;var Bo="PopoverPortal",[Mx,zx]=ul(Bo,{forceMount:void 0}),gl=e=>{const{__scopePopover:t,forceMount:r,children:n,container:o}=e,i=Xe(Bo,t);return a.jsx(Mx,{scope:t,forceMount:r,children:a.jsx(Ye,{present:r||i.open,children:a.jsx(an,{asChild:!0,container:o,children:n})})})};gl.displayName=Bo;var zt="PopoverContent",xl=x.forwardRef((e,t)=>{const r=zx(zt,e.__scopePopover),{forceMount:n=r.forceMount,...o}=e,i=Xe(zt,e.__scopePopover);return a.jsx(Ye,{present:n||i.open,children:i.modal?a.jsx($x,{...o,ref:t}):a.jsx(Fx,{...o,ref:t})})});xl.displayName=zt;var Dx=st("PopoverContent.RemoveScroll"),$x=x.forwardRef((e,t)=>{const r=Xe(zt,e.__scopePopover),n=x.useRef(null),o=J(t,n),i=x.useRef(!1);return x.useEffect(()=>{const s=n.current;if(s)return Mo(s)},[]),a.jsx(hn,{as:Dx,allowPinchZoom:!0,children:a.jsx(bl,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:H(e.onCloseAutoFocus,s=>{s.preventDefault(),i.current||r.triggerRef.current?.focus()}),onPointerDownOutside:H(e.onPointerDownOutside,s=>{const l=s.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,d=l.button===2||c;i.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:H(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),Fx=x.forwardRef((e,t)=>{const r=Xe(zt,e.__scopePopover),n=x.useRef(!1),o=x.useRef(!1);return a.jsx(bl,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(n.current||r.triggerRef.current?.focus(),i.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;r.triggerRef.current?.contains(s)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),bl=x.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:u,...p}=e,m=Xe(zt,r),g=ur(r);return bo(),a.jsx(Gr,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:i,children:a.jsx(qr,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:u,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onDismiss:()=>m.onOpenChange(!1),children:a.jsx(Xs,{"data-state":vl(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)"}})})})}),_l="PopoverClose",Bx=x.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Xe(_l,r);return a.jsx(W.button,{type:"button",...n,ref:t,onClick:H(e.onClick,()=>o.onOpenChange(!1))})});Bx.displayName=_l;var Ux="PopoverArrow",Hx=x.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=ur(r);return a.jsx(Js,{...o,...n,ref:t})});Hx.displayName=Ux;function vl(e){return e?"open":"closed"}var Vx=pl,Wx=hl,qx=gl,Gx=xl;function Je({...e}){return a.jsx(Vx,{"data-slot":"popover",...e})}function Ze({...e}){return a.jsx(Wx,{"data-slot":"popover-trigger",...e})}function Qe({className:e,align:t="center",sideOffset:r=4,...n}){const o=typeof document<"u"?document.getElementById("ecommreels-admin-app")??document.body:void 0;return a.jsx(qx,{container:o,children:a.jsx(Gx,{"data-slot":"popover-content",align:t,sideOffset:r,className:$("ecr-popover",e),...n})})}const Uo="data:image/svg+xml,%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Transformed%20by:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20fill='%23919191'%20width='800px'%20height='800px'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%20stroke='%23919191'%3e%3cg%20id='SVGRepo_bgCarrier'%20stroke-width='0'/%3e%3cg%20id='SVGRepo_tracerCarrier'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cg%20id='SVGRepo_iconCarrier'%3e%3cg%20data-name='Layer%202'%3e%3cg%20data-name='file-add'%3e%3crect%20width='24'%20height='24'%20opacity='0'/%3e%3cpath%20d='M19.74%207.33l-4.44-5a1%201%200%200%200-.74-.33h-8A2.53%202.53%200%200%200%204%204.5v15A2.53%202.53%200%200%200%206.56%2022h10.88A2.53%202.53%200%200%200%2020%2019.5V8a1%201%200%200%200-.26-.67zM14%2015h-1v1a1%201%200%200%201-2%200v-1h-1a1%201%200%200%201%200-2h1v-1a1%201%200%200%201%202%200v1h1a1%201%200%200%201%200%202zm.71-7a.79.79%200%200%201-.71-.85V4l3.74%204z'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e";var Kx=Symbol.for("react.lazy"),xn=x[" use ".trim().toString()];function Yx(e){return typeof e=="object"&&e!==null&&"then"in e}function yl(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Kx&&"_payload"in e&&Yx(e._payload)}function Xx(e){const t=Jx(e),r=x.forwardRef((n,o)=>{let{children:i,...s}=n;yl(i)&&typeof xn=="function"&&(i=xn(i._payload));const l=x.Children.toArray(i),c=l.find(Qx);if(c){const d=c.props.children,u=l.map(p=>p===c?x.Children.count(d)>1?x.Children.only(null):x.isValidElement(d)?d.props.children:null:p);return a.jsx(t,{...s,ref:o,children:x.isValidElement(d)?x.cloneElement(d,void 0,u):null})}return a.jsx(t,{...s,ref:o,children:i})});return r.displayName=`${e}.Slot`,r}function Jx(e){const t=x.forwardRef((r,n)=>{let{children:o,...i}=r;if(yl(o)&&typeof xn=="function"&&(o=xn(o._payload)),x.isValidElement(o)){const s=t0(o),l=e0(i,o.props);return o.type!==x.Fragment&&(l.ref=n?Kn(n,s):s),x.cloneElement(o,l)}return x.Children.count(o)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Zx=Symbol("radix.slottable");function Qx(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Zx}function e0(e,t){const r={...t};for(const n in t){const o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...l)=>{const c=i(...l);return o(...l),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}function t0(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 r0=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],n0=r0.reduce((e,t)=>{const r=Xx(`Primitive.${t}`),n=x.forwardRef((o,i)=>{const{asChild:s,...l}=o,c=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),o0="Separator",wl="horizontal",a0=["horizontal","vertical"],jl=x.forwardRef((e,t)=>{const{decorative:r,orientation:n=wl,...o}=e,i=i0(n)?n:wl,l=r?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return a.jsx(n0.div,{"data-orientation":i,...l,...o,ref:t})});jl.displayName=o0;function i0(e){return a0.includes(e)}var s0=jl;function bn({className:e,orientation:t="horizontal",decorative:r=!0,...n}){return a.jsx(s0,{"data-slot":"separator",decorative:r,orientation:t,className:$("ecr-separator",e),...n})}const ft=({name:e,text:t})=>{const r=ecommreelsInfo.isProActive,n=ecommreelsInfo.isLicenseActive,o=ecommreelsInfo.license_page;return a.jsxs("div",{className:"ecr-admin-upgrade__modal",children:[a.jsxs("h4",{className:"ecr-admin-upgrade__title",children:[a.jsx("span",{className:"ecr-admin-upgrade__name",children:e}),a.jsx("span",{className:"ecr-admin-upgrade__tag",children:"PRO"})]}),a.jsx(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(ne,{asChild:!0,className:"ecr-admin-upgrade__button",size:"sm",children:a.jsx("a",{href:r&&!n?o:"https://reelswp.com/pricing/",style:{color:"#fff"},target:"_blank",rel:"noreferrer",className:"ecr-admin-upgrade__link",children:r&&!n?"Active":"Upgrade to Pro"})})})]})},ce=[];for(let e=0;e<256;++e)ce.push((e+256).toString(16).slice(1));function l0(e,t=0){return(ce[e[t+0]]+ce[e[t+1]]+ce[e[t+2]]+ce[e[t+3]]+"-"+ce[e[t+4]]+ce[e[t+5]]+"-"+ce[e[t+6]]+ce[e[t+7]]+"-"+ce[e[t+8]]+ce[e[t+9]]+"-"+ce[e[t+10]]+ce[e[t+11]]+ce[e[t+12]]+ce[e[t+13]]+ce[e[t+14]]+ce[e[t+15]]).toLowerCase()}let Ho;const c0=new Uint8Array(16);function d0(){if(!Ho){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Ho=crypto.getRandomValues.bind(crypto)}return Ho(c0)}const kl={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function u0(e,t,r){e=e||{};const n=e.random??e.rng?.()??d0();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,l0(n)}function _n(e,t,r){return kl.randomUUID&&!e?kl.randomUUID():u0(e)}const p0=new Set(["video/mp4"]),m0=[".mp4",".m4v"],f0=e=>(e.mime||"").toLowerCase().trim(),h0=e=>(e.url||"").toLowerCase().trim(),g0=e=>e.split("?")[0].split("#")[0],x0=e=>{const t=g0(e);return m0.some(r=>t.endsWith(r))},b0=()=>{if(typeof document>"u")return!0;const t=document.createElement("video").canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"');return t==="probably"||t==="maybe"},_0=e=>{const t=f0(e),r=h0(e),n=t&&p0.has(t),o=r&&x0(r);return!n&&!o?!1:b0()},v0=e=>{const t=[],r=[];for(const n of e)_0(n)?t.push(n):r.push(n);return{compatible:t,incompatible:r}},y0=({setUploadedFiles:e,setShowOptions:t})=>{const r=()=>{if(!window.wp?.media){G.error("Media library is not available.");return}const n=window.wp.media({title:"Select image or video files",button:{text:"Use this file"},multiple:!1,library:{type:["video"]}});n.on("select",()=>{const o=n.state().get("selection").toJSON();if(!e)return;const{incompatible:i}=v0(o);i.length>0&&G(a.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:8},children:[a.jsx(em,{style:{flexShrink:0},color:"oklch(66.6% 0.179 58.318)"}),i.length," video(s) may not play reliably on iOS/macOS Safari. Recommended format: MP4 (H.264/AAC)."]}));const s=o.map(l=>({url:l.url,mime_type:l.mime,file_uuid:_n(),source:"native"}));e(l=>[...l,...s]),t(!1)}),n.open()};return a.jsxs("button",{className:"ecr-admin-upload-native-video-btn",type:"button",onClick:r,children:[a.jsx(mp,{})," Choose from Media"]})},w0=({setUploadedFiles:e})=>{const[t,r]=_.useState(!1);return a.jsxs("div",{className:"ecr-admin-upload",children:[a.jsx("button",{type:"button",className:"ecr-admin-upload__label",onClick:()=>r(!0),children:a.jsxs("span",{className:"ecr-admin-upload__text-icon_wrapper",children:[a.jsx("img",{className:"ecr-admin-upload__icon",src:Uo,alt:"Upload"}),a.jsx("span",{className:"ecr-admin-upload__text",children:a.jsxs("span",{className:"ecr-admin-upload__text-stack",children:[a.jsx("span",{className:"ecr-admin-upload__text-item",children:"Upload videos"}),a.jsx("span",{className:"ecr-admin-upload__text-item",children:"Click here to upload videos"})]})})]})}),t?a.jsxs("div",{className:"ecr-admin-upload-source-panel",children:[a.jsx("button",{type:"button",className:"ecr-admin-upload-source-panel__close",onClick:()=>r(!1),"aria-label":"Close upload source picker",children:a.jsx(er,{size:16})}),a.jsx("p",{className:"ecr-admin-upload-source-popover__title",children:"Add Videos"}),a.jsx("p",{className:"ecr-admin-upload-source-popover__description",children:"Upload from media library or paste Vimeo links."}),a.jsxs("div",{className:"ecr-admin-upload-source-popover__options",children:[a.jsx(y0,{setUploadedFiles:e,setShowOptions:r}),a.jsxs(Je,{children:[a.jsx(Ze,{asChild:!0,children:a.jsxs("button",{className:"ecr-admin-upload-vimeo-video-btn",type:"button",children:[a.jsx(dp,{})," Add Vimeo Videos ",a.jsx(at,{size:20})]})}),a.jsx(Qe,{className:"ecr-admin-links__popover",children:a.jsx(ft,{name:"Vimeo Videos",text:a.jsx(a.Fragment,{children:"To embed Vimeo videos directly into your reels, giving your content a professional, seamless, and engaging playback experience for your audience."})})})]})]})]}):null]})};var vn="Dialog",[Sl]=Ve(vn),[j0,Se]=Sl(vn),Cl=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:o,onOpenChange:i,modal:s=!0}=e,l=x.useRef(null),c=x.useRef(null),[d,u]=mt({prop:n,defaultProp:o??!1,onChange:i,caller:vn});return a.jsx(j0,{scope:t,triggerRef:l,contentRef:c,contentId:Ae(),titleId:Ae(),descriptionId:Ae(),open:d,onOpenChange:u,onOpenToggle:x.useCallback(()=>u(p=>!p),[u]),modal:s,children:r})};Cl.displayName=vn;var Nl="DialogTrigger",El=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=Se(Nl,r),i=J(t,o.triggerRef);return a.jsx(W.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":qo(o.open),...n,ref:i,onClick:H(e.onClick,o.onOpenToggle)})});El.displayName=Nl;var Vo="DialogPortal",[k0,Tl]=Sl(Vo,{forceMount:void 0}),Al=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:o}=e,i=Se(Vo,t);return a.jsx(k0,{scope:t,forceMount:r,children:x.Children.map(n,s=>a.jsx(Ye,{present:r||i.open,children:a.jsx(an,{asChild:!0,container:o,children:s})}))})};Al.displayName=Vo;var yn="DialogOverlay",Pl=x.forwardRef((e,t)=>{const r=Tl(yn,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,i=Se(yn,e.__scopeDialog);return i.modal?a.jsx(Ye,{present:n||i.open,children:a.jsx(C0,{...o,ref:t})}):null});Pl.displayName=yn;var S0=st("DialogOverlay.RemoveScroll"),C0=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=Se(yn,r);return a.jsx(hn,{as:S0,allowPinchZoom:!0,shards:[o.contentRef],children:a.jsx(W.div,{"data-state":qo(o.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),ht="DialogContent",Ol=x.forwardRef((e,t)=>{const r=Tl(ht,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,i=Se(ht,e.__scopeDialog);return a.jsx(Ye,{present:n||i.open,children:i.modal?a.jsx(N0,{...o,ref:t}):a.jsx(E0,{...o,ref:t})})});Ol.displayName=ht;var N0=x.forwardRef((e,t)=>{const r=Se(ht,e.__scopeDialog),n=x.useRef(null),o=J(t,r.contentRef,n);return x.useEffect(()=>{const i=n.current;if(i)return Mo(i)},[]),a.jsx(Rl,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:H(e.onCloseAutoFocus,i=>{i.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:H(e.onPointerDownOutside,i=>{const s=i.detail.originalEvent,l=s.button===0&&s.ctrlKey===!0;(s.button===2||l)&&i.preventDefault()}),onFocusOutside:H(e.onFocusOutside,i=>i.preventDefault())})}),E0=x.forwardRef((e,t)=>{const r=Se(ht,e.__scopeDialog),n=x.useRef(!1),o=x.useRef(!1);return a.jsx(Rl,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(n.current||r.triggerRef.current?.focus(),i.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;r.triggerRef.current?.contains(s)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),Rl=x.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:i,...s}=e,l=Se(ht,r),c=x.useRef(null),d=J(t,c);return bo(),a.jsxs(a.Fragment,{children:[a.jsx(Gr,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:i,children:a.jsx(qr,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":qo(l.open),...s,ref:d,onDismiss:()=>l.onOpenChange(!1)})}),a.jsxs(a.Fragment,{children:[a.jsx(A0,{titleId:l.titleId}),a.jsx(O0,{contentRef:c,descriptionId:l.descriptionId})]})]})}),Wo="DialogTitle",Ll=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=Se(Wo,r);return a.jsx(W.h2,{id:o.titleId,...n,ref:t})});Ll.displayName=Wo;var Il="DialogDescription",T0=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=Se(Il,r);return a.jsx(W.p,{id:o.descriptionId,...n,ref:t})});T0.displayName=Il;var Ml="DialogClose",zl=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=Se(Ml,r);return a.jsx(W.button,{type:"button",...n,ref:t,onClick:H(e.onClick,()=>o.onOpenChange(!1))})});zl.displayName=Ml;function qo(e){return e?"open":"closed"}var Dl="DialogTitleWarning",[M1,$l]=rh(Dl,{contentName:ht,titleName:Wo,docsSlug:"dialog"}),A0=({titleId:e})=>{const t=$l(Dl),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. 399 399 400 400 If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. 401 401 402 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}, T0="DialogDescriptionWarning",A0=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${$l(T0).contentName}}.`;return x.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},P0=Cl,O0=El,R0=Al,L0=Pl,I0=Ol,M0=Ll,Fl=zl;function Go({...e}){return a.jsx(P0,{"data-slot":"dialog",...e})}function Ko({...e}){return a.jsx(O0,{"data-slot":"dialog-trigger",...e})}function z0({...e}){const t=typeof document<"u"?document.getElementById("ecommreels-admin-app")??document.body:void 0;return a.jsx(R0,{"data-slot":"dialog-portal",container:t,...e})}function D0({className:e,...t}){return a.jsx(L0,{"data-slot":"dialog-overlay",className:$("ecr-dialog__overlay",e),...t})}function Yo({className:e,children:t,...r}){return a.jsxs(z0,{children:[a.jsx(D0,{}),a.jsxs(I0,{"data-slot":"dialog-content",className:$("ecr-dialog__content",e),...r,children:[t,a.jsx(Fl,{className:"ecr-dialog__close","aria-label":"Close dialog",children:a.jsx(er,{className:"ecr-dialog__close-icon"})})]})]})}function Xo({className:e,...t}){return a.jsx("div",{className:$("ecr-dialog__header",e),...t})}function Jo({className:e,...t}){return a.jsx(M0,{"data-slot":"dialog-title",className:$("ecr-dialog__title",e),...t})}function $0({...e}){return a.jsx(Fl,{"data-slot":"dialog-close",...e})}const F0=(e={})=>{const{enabled:t=!0}=e,r=typeof ecommreelsInfo<"u"?ecommreelsInfo?.url:"",n=typeof ecommreelsInfo<"u"?ecommreelsInfo?.nonce:"",[o,i]=_.useState([]),[s,l]=_.useState(1),[c,d]=_.useState(!0),[u,p]=_.useState(!1),[m,g]=_.useState(!1),[b,f]=_.useState(""),h=fo(b,500),v=_.useRef(!0),y=_.useRef(0),w=_.useRef(null),[j,C]=_.useState(null),N=_.useCallback(async T=>{if(!r||!n){C("Missing API configuration."),g(!1),p(!1);return}const A=++y.current;w.current&&w.current.abort();const R=new AbortController;w.current=R,T===1&&v.current?g(!0):p(!0);try{const L={page:T,per_page:50};h&&(L.search=h);const B=await re.get(`${r}wc/v3/products`,{headers:{"X-WP-Nonce":n},withCredentials:!0,params:L,signal:R.signal}),M=B.data,O=parseInt(B.headers["x-wp-totalpages"]||"1",10);A===y.current&&(i(P=>T===1?M:[...P,...M]),l(T+1),d(T<O))}catch(L){if(R.signal.aborted)return;L instanceof Error?C(L.message):C("An unknown error occurred")}finally{v.current&&(v.current=!1),A===y.current&&!R.signal.aborted&&(p(!1),g(!1))}},[h,n,r]);_.useEffect(()=>{t&&(l(1),i([]),C(null),v.current=!0,N(1))},[h,N,t]);const S=_.useRef(null),E=_.useCallback(T=>{u||(S.current&&S.current.disconnect(),S.current=new IntersectionObserver(A=>{A[0].isIntersecting&&c&&N(s)}),T&&S.current.observe(T))},[u,c,s,N]);return _.useEffect(()=>()=>{S.current&&S.current.disconnect(),w.current&&w.current.abort()},[]),{products:o,setProducts:i,searchTerm:b,setSearchTerm:f,isSearching:u,isLoading:m,error:j,lastProductElementRef:E}},wn="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",Bl=({name:e,handleClick:t})=>a.jsx("button",{onClick:t,className:$("ecr-button ecr-button--sm",e==="add"?"ecr-button--primary":"ecr-button--danger"),children:e}),B0=({handleLinks:e,taggedProducts:t,products:r,isSearching:n,isLoading:o,lastProductElementRef:i,searchTerm:s,setSearchTerm:l,error:c})=>{const[d,u]=_.useState(t.map(f=>f.product_id)),[p,m]=_.useState(!1),g=f=>{m(!1),u(h=>h.includes(f.id)?h.filter(v=>v!==f.id):[f.id])},b=f=>{if(f.preventDefault(),d.length===0){m(!0);return}const h=new Set(d),v=[];for(const y of r)h.has(y.id)&&v.push({btn_type:"product",btn_uuid:_n(),buttonText:y.name,buttonUrl:y.permalink,rating:y.average_rating,price:y.price_html,thumbnail:y.images?.[0]?.thumbnail||y.images?.[0]?.src||wn,product_id:y.id});e(v),u([])};return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"ecr-admin-product-link__search",children:a.jsx("input",{type:"text",placeholder:"Search products...",value:s,onChange:f=>l(f.target.value),className:"ecr-admin-product-link__search-input"})}),a.jsx("div",{className:"scrollbarThin ecr-admin-product-link__list",children:o&&r.length===0?a.jsx(Ul,{}):a.jsxs("div",{className:"ecr-admin-product-link__list-inner",children:[r.length===0?a.jsx("p",{className:"ecr-admin-product-link__empty",children:c||"No products are available to add."}):r.map((f,h)=>{const v=d.includes(f.id);return a.jsx("div",{ref:r.length===h+1?i:null,className:"ecr-admin-product-link__item",style:d.length>0&&!v?{opacity:.5,pointerEvents:"none"}:{},children:a.jsxs(ne,{type:"button",onClick:()=>g(f),className:$("ecr-admin-product-link__button",v?"ecr-admin-product-link__button--selected":"ecr-admin-product-link__button--unselected"),children:[v?a.jsx(Gp,{size:20,color:"#2563eb"}):a.jsx(Kp,{size:20,color:"#8c95a9"}),a.jsx("img",{className:"ecr-admin-product-link__thumb",src:f.images?.[0]?.thumbnail||f.images?.[0]?.src||wn,alt:"Product thumbnail"}),a.jsx("span",{children:f.name||`Product #${f.id}`})]})},f.id)}),n&&r.length>0&&a.jsx(Ul,{})]})}),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(Bl,{name:"add",handleClick:b})})]})]})},Ul=()=>a.jsx("div",{className:"ecr-admin-product-link__loader",children:a.jsx("div",{className:"ecr-admin-product-link__spinner"})}),U0=/^(https?|ftp):\/\/[^\s/$.?#].[^\s]*$/i,H0=({handleLinks:e})=>{const[t,r]=_.useState(""),[n,o]=_.useState(""),[i,s]=_.useState(""),[l,c]=_.useState(!0),[d,u]=_.useState(""),[p,m]=_.useState([]),g=()=>{const b=[];t||b.push("text"),n&&U0.test(n)||b.push("url"),i||b.push("campaign"),m(b),!(b.length>0)&&e({btn_type:"custom",btn_uuid:_n(),buttonText:t,buttonUrl:n,openInNewTab:l,campaignName:i,customClass:d,clickCount:0})};return a.jsxs(a.Fragment,{children:[a.jsxs("div",{children:[a.jsx(jn,{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(jn,{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(jn,{error:p.includes("campaign"),type:"text",name:"campaignName",label:"Campaign Name",placeholder:"e.g Summer sale",value:i,setValue:s}),p.includes("campaign")&&a.jsx("p",{className:"ecr-admin-link__error",children:"Campaign name is required!"})]}),a.jsxs("div",{className:"ecr-admin-link__toggle",children:[a.jsx("input",{checked:l,onChange:b=>c(b.target.checked),className:"ecr-admin-link__checkbox",type:"checkbox",name:"",id:"newTab"}),a.jsx("label",{className:"ecr-admin-link__toggle-label",htmlFor:"newTab",children:"Open in new tab"})]}),a.jsx("div",{children:a.jsx(jn,{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(Bl,{name:"add",handleClick:g})})]})};function jn({error:e,type:t,name:r,label:n,placeholder:o,value:i,setValue:s}){return a.jsxs(a.Fragment,{children:[a.jsx("label",{className:"ecr-admin-link__label",htmlFor:r,children:n}),a.jsx("input",{id:r,name:r,type:t,placeholder:o,value:i,onChange:l=>s(l.target.value),className:$("ecr-admin-link__input",e?"ecr-admin-link__input--error":"ecr-admin-link__input--normal")})]})}const V0=({setLinks:e,linkCount:t,linkType:r,links:n})=>{const[o,i]=_.useState(null),[s,l]=_.useState(!1),c=F0({enabled:s}),d=t===0||r==="Link",u=t===0||r==="Product",p=n.filter(g=>g.btn_type==="product"),m=()=>l(!0);return a.jsxs(a.Fragment,{children:[t?a.jsx(bn,{}):null,a.jsx("div",{className:"ecr-admin-link-tabs",children:a.jsxs("div",{className:"ecr-admin-link-tabs__list",children:[d&&a.jsxs(Go,{open:o==="custom",onOpenChange:g=>i(g?"custom":null),children:[a.jsxs(Ko,{className:"ecr-admin-link-tabs__trigger",children:[a.jsx(Up,{size:20})," Add Custom Link"]}),a.jsxs(Yo,{className:"ecr-admin-link-dialog",children:[a.jsx(Xo,{children:a.jsx(Jo,{children:"Add Custom Link"})}),a.jsx("div",{className:"ecr-admin-link-tabs__content",children:a.jsx(H0,{handleLinks:g=>{e(b=>[...b,g]),i(null)}})})]})]}),u&&a.jsxs(Go,{open:o==="product",onOpenChange:g=>i(g?"product":null),children:[a.jsxs(Ko,{className:"ecr-admin-link-tabs__trigger",onMouseEnter:m,children:[a.jsx(Xp,{size:20})," Tag Products"]}),a.jsxs(Yo,{className:"ecr-admin-link-dialog",children:[a.jsx(Xo,{children:a.jsx(Jo,{children:"Select Products"})}),a.jsx("div",{className:"ecr-admin-link-tabs__content",children:a.jsx(B0,{handleLinks:g=>{e(g),i(null)},taggedProducts:p,products:c.products,isSearching:c.isSearching,isLoading:c.isLoading,lastProductElementRef:c.lastProductElementRef,searchTerm:c.searchTerm,setSearchTerm:c.setSearchTerm,error:c.error})})]})]})]})})]})},W0=({links:e,onLinksChange:t})=>{const r=o=>{t(i=>i.filter(s=>s.btn_uuid!==o))},n=e[0]?.btn_type==="product"?"Product":"Link";return a.jsxs("div",{className:"ecr-admin-links",children:[a.jsx("p",{className:"ecr-admin-links__title",children:`${n}${e.length>1?"s":""}`}),e.length>0?a.jsxs(a.Fragment,{children:[e.map(o=>a.jsxs("div",{className:`ecr-admin-links__item ${o.btn_type==="custom"?o.customClass??"":""}`,children:[a.jsx("span",{children:o.buttonText}),a.jsx(ne,{onClick:()=>r(o.btn_uuid),size:"icon-sm",variant:"link",className:"ecr-admin-links__remove",children:a.jsx(Jp,{size:16})})]},o.btn_uuid)),a.jsxs(Je,{children:[a.jsxs(Ze,{className:"ecr-admin-links__upgrade",children:["+ Add Another ",a.jsx(at,{size:20})]}),a.jsx(Qe,{className:"ecr-admin-links__popover",children:a.jsx(ft,{name:"Multiple Links",text:a.jsx(a.Fragment,{children:"Unlock the ability to add multiple custom links, seamlessly redirecting users to your pages from the videos!"})})})]})]}):a.jsx(V0,{setLinks:t,linkCount:e.length,linkType:n,links:e})]})},q0=({togglePlayPause:e,isMuted:t,file:r,videoRef:n,onEnded:o})=>{const[i,s]=_.useState(!1);return a.jsx("video",{ref:n,className:$("ecr-admin-reelvideo",i?"ecr-admin-reelvideo--portrait":"ecr-admin-reelvideo--landscape"),src:r?.url,muted:t,playsInline:!0,preload:"metadata",onClick:e,autoPlay:!0,draggable:!1,onEnded:o,onError:o,"webkit-playsinline":"true",onLoadedMetadata:l=>{const c=l.currentTarget,d=c.videoWidth,u=c.videoHeight;s(()=>u>d)}})},G0=({index:e,setIsAttemptingDelete:t,file:r,file_uuid:n,dragStart:o,dragEnter:i,dragEnd:s})=>{const[l,c]=_.useState(!0),[d,u]=_.useState(!1),p=_.useRef(null),m=()=>{p.current&&(d?p.current.play():p.current.pause(),u(b=>!b))},g=()=>{p.current&&(p.current.muted=!l,c(b=>!b))};return a.jsxs("div",{draggable:!0,onDragStart:()=>o(e),onDragEnter:()=>i(e),onDragEnd:s,className:$("ecr-admin-customization__panel"),children:[a.jsx(er,{className:"ecr-admin-customization__remove",size:20,onClick:()=>t(n)}),a.jsx(q0,{togglePlayPause:m,isMuted:l,file:r,videoRef:p,onEnded:()=>u(!0)}),a.jsxs("div",{className:"ecr-admin-customization__controls",children:[d?a.jsx(Jn,{size:18,className:"ecr-admin-customization__control",onClick:m}):a.jsx(Xn,{size:18,className:"ecr-admin-customization__control",onClick:m}),l?a.jsx(Qn,{size:18,className:"ecr-admin-customization__control",onClick:g}):a.jsx(Zn,{size:18,className:"ecr-admin-customization__control",onClick:g})]})]})},K0=({uploadedFiles:e,setIsAttemptingDelete:t,setUploadedFiles:r})=>{const n=_.useRef(null),o=_.useRef(null),i=c=>{n.current=c},s=c=>{o.current=c},l=()=>{if(n.current===null||o.current===null)return;const c=[...e],d=c[n.current];c.splice(n.current,1),c.splice(o.current,0,d),n.current=null,o.current=null,r(c)};return a.jsxs("div",{className:"ecr-admin-customization",children:[e.map((c,d)=>a.jsx(G0,{setIsAttemptingDelete:t,file:c,file_uuid:c.file_uuid,index:d,dragStart:i,dragEnter:s,dragEnd:l},d)),a.jsxs(Je,{children:[a.jsxs(Ze,{className:"ecr-admin-customization__add",children:[a.jsx("img",{className:"ecr-admin-customization__icon",src:Uo,alt:"Upload"}),a.jsx("span",{className:"ecr-admin-customization__label",children:"Upload another video"}),a.jsx(at,{size:20,className:"ecr-admin-customization__lock"})]}),a.jsx(Qe,{side:"right",className:"ecr-admin-customization__popover",children:a.jsx(ft,{name:"Multiple Videos",text:a.jsxs(a.Fragment,{children:["Unlock the power of ",a.jsx("strong",{children:"Multiple Video"})," uploads, boosting engagement and variety in every Reels!"]})})})]})]})};function Y0(e){return V({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 X0=({setUploadedFiles:e,setThumbnail:t,usedFor:r="video",mode:n="files",multiple:o=!1,className:i})=>{const[s,l]=_.useState(!1),c=()=>{const d=window.wp.media({title:"Select image or video files",button:{text:"Use this file"},multiple:o,library:{type:[r]}});d.on("select",()=>{const u=d.state().get("selection").toJSON();if(n==="thumbnail"){const m=u[0];m&&t&&t(m.url);return}if(!e)return;const p=u.map(m=>({url:m.url,mime_type:m.mime,file_uuid:_n()}));e(m=>[...m,...p])}),d.open()};return a.jsx("div",{className:$("ecr-admin-upload",s?"ecr-admin-upload--active":"ecr-admin-upload--idle",i),onDragOver:d=>{d.preventDefault(),l(!0)},onDragLeave:()=>l(!1),onDrop:d=>{d.preventDefault(),l(!1),c()},children:a.jsxs("label",{className:"ecr-admin-upload__label",htmlFor:"file",onClick:c,children:[a.jsx("img",{className:"ecr-admin-upload__icon",src:Uo,alt:"Upload"}),a.jsx("span",{className:"ecr-admin-upload__text",children:s?a.jsx("span",{className:"ecr-admin-upload__text-strong",children:"Drop files here..."}):a.jsxs("span",{className:"ecr-admin-upload__text-stack",children:[a.jsxs("span",{className:"ecr-admin-upload__text-item",children:["Upload ",r]}),n==="files"?a.jsx("span",{className:"ecr-admin-upload__text-item",children:"Click or Drag and drop files here"}):null]})})]})})},J0=({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(Y0,{className:"ecr-admin-thumbnail__remove",size:20,onClick:()=>t(null)})]}):a.jsx(X0,{mode:"thumbnail",usedFor:"image",setThumbnail:t,className:"ecr-admin-thumbnail__uploader"})]}),Z0=()=>{const e=Ne(),[t]=Zt(),r=_.useMemo(()=>t.get("sid"),[t]),n=_.useRef(null),[o,i]=_.useState({files:[],title:"",links:[],thumbnail:null}),[s,l]=_.useState(!1),[c,d]=_.useState(null),u=_.useCallback(h=>{i(v=>({...v,title:typeof h=="function"?h(v.title):h}))},[]),p=_.useCallback(h=>{i(v=>({...v,files:typeof h=="function"?h(v.files):h}))},[]),m=_.useCallback(h=>{i(v=>({...v,links:typeof h=="function"?h(v.links):h}))},[]),g=_.useCallback(h=>{i(v=>({...v,thumbnail:typeof h=="function"?h(v.thumbnail):h}))},[]),b=()=>{c&&(p(h=>h.filter(v=>v.file_uuid!==c)),d(null))},f=_.useCallback(async h=>{try{l(!0);const v=await he.get(`story/${h}`);i({title:v.data.title,files:v.data.files,links:v.data.links,thumbnail:v.data.thumbnail})}catch(v){v instanceof Error?G.error(v.message):G.error("Something went wrong. Try again later!"),n.current=setTimeout(()=>e(-1),1e3)}finally{l(!1)}},[e]);return _.useEffect(()=>{r&&f(r)},[r,f]),_.useEffect(()=>()=>{n.current&&clearTimeout(n.current)},[]),s?a.jsx(Lr,{}):a.jsxs(a.Fragment,{children:[a.jsx(Qf,{uploadedFiles:o.files,links:o.links,thumbnail:o.thumbnail,storyTitle:o.title,setStoryTitle:u}),a.jsxs("div",{className:"ecr-admin-create",children:[a.jsxs("div",{className:"ecr-admin-create__panel ecr-admin-create__panel--main",children:[a.jsx("p",{className:"ecr-admin-create__title",children:"Select video"}),c&&a.jsx(Or,{onReject:()=>d(null),onAccept:b,isLoading:!1,message:"Are you sure, You want to remove this file?"}),o.files.length>0?a.jsx(K0,{uploadedFiles:o.files,setUploadedFiles:p,setIsAttemptingDelete:d}):a.jsx(v0,{setUploadedFiles:p})]}),a.jsxs("div",{className:"ecr-admin-create__panel ecr-admin-create__panel--side",children:[a.jsx(J0,{thumbnail:o.thumbnail,onThumbnailChange:g}),a.jsx(bn,{className:"ecr-admin-create__separator"}),a.jsx(W0,{links:o.links,onLinksChange:m})]})]})]})},Hl=({message:e="Something went wrong. Please try again."})=>a.jsxs("div",{className:"ecr-admin-error",children:[a.jsx(mp,{className:"ecr-admin-error__icon"}),a.jsx("p",{className:"ecr-admin-error__text",children:e})]});var Zo,Vl;function Q0(){return Vl||(Vl=1,Zo=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()}}),Zo}var Qo,Wl;function eb(){if(Wl)return Qo;Wl=1;var e=Q0(),t={"text/plain":"Text","text/html":"Url",default:"Text"},r="Copy to clipboard: #{key}, Enter";function n(i){var s=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return i.replace(/#{\s*key\s*}/g,s)}function o(i,s){var l,c,d,u,p,m,g=!1;s||(s={}),l=s.debug||!1;try{d=e(),u=document.createRange(),p=document.getSelection(),m=document.createElement("span"),m.textContent=i,m.ariaHidden="true",m.style.all="unset",m.style.position="fixed",m.style.top=0,m.style.clip="rect(0, 0, 0, 0)",m.style.whiteSpace="pre",m.style.webkitUserSelect="text",m.style.MozUserSelect="text",m.style.msUserSelect="text",m.style.userSelect="text",m.addEventListener("copy",function(f){if(f.stopPropagation(),s.format)if(f.preventDefault(),typeof f.clipboardData>"u"){l&&console.warn("unable to use e.clipboardData"),l&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var h=t[s.format]||t.default;window.clipboardData.setData(h,i)}else f.clipboardData.clearData(),f.clipboardData.setData(s.format,i);s.onCopy&&(f.preventDefault(),s.onCopy(f.clipboardData))}),document.body.appendChild(m),u.selectNodeContents(m),p.addRange(u);var b=document.execCommand("copy");if(!b)throw new Error("copy command was unsuccessful");g=!0}catch(f){l&&console.error("unable to copy using execCommand: ",f),l&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(s.format||"text",i),s.onCopy&&s.onCopy(window.clipboardData),g=!0}catch(h){l&&console.error("unable to copy using clipboardData: ",h),l&&console.error("falling back to prompt"),c=n("message"in s?s.message:r),window.prompt(c,i)}}finally{p&&(typeof p.removeRange=="function"?p.removeRange(u):p.removeAllRanges()),m&&document.body.removeChild(m),d()}return g}return Qo=o,Qo}var tb=eb();const ql=Nd(tb);function Gl({className:e,...t}){return a.jsx("div",{"data-slot":"table-container",className:"ecr-table__container",children:a.jsx("table",{"data-slot":"table",className:$("ecr-table",e),...t})})}function Kl({className:e,...t}){return a.jsx("thead",{"data-slot":"table-header",className:$("ecr-table__header",e),...t})}function Yl({className:e,...t}){return a.jsx("tbody",{"data-slot":"table-body",className:$("ecr-table__body",e),...t})}function kn({className:e,...t}){return a.jsx("tr",{"data-slot":"table-row",className:$("ecr-table__row",e),...t})}function Xl({className:e,...t}){return a.jsx("th",{"data-slot":"table-head",className:$("ecr-table__head",e),...t})}function Me({className:e,...t}){return a.jsx("td",{"data-slot":"table-cell",className:$("ecr-table__cell",e),...t})}function Jl({className:e,...t}){return a.jsx("caption",{"data-slot":"table-caption",className:$("ecr-table__caption",e),...t})}const rb=[{label:"No.",width:80,align:"center"},{label:"Group Name",width:250,align:"start"},{label:"Short Code",align:"start"},{label:"Action",width:150,align:"center"}],nb=({tableData:e,setIsAttemptingDelete:t})=>{const[r,n]=_.useState(null),o=_.useRef(null),i=(s,l)=>{ql(s),n(l),o.current=setTimeout(()=>{n(null)},700)};return _.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]),a.jsxs(Gl,{className:"ecr-admin-groups__table",children:[!e.length&&a.jsx(Jl,{className:"ecr-admin-groups__caption",children:a.jsxs("div",{className:"ecr-admin-groups__empty",children:[a.jsx(lt,{className:"ecr-admin-groups__empty-icon"}),"You did not create any reel group yet!"]})}),e.length?a.jsxs(a.Fragment,{children:[a.jsx(Kl,{children:a.jsx(kn,{children:rb.map((s,l)=>a.jsx(Xl,{className:"ecr-admin-groups__head",style:{width:s?.width||"auto",textAlign:s?.align},children:s.label},l))})}),a.jsx(Yl,{children:e.map((s,l)=>a.jsxs(kn,{className:$("ecr-admin-groups__row",l%2===0&&"ecr-admin-groups__row--alt"),children:[a.jsx(Me,{className:"ecr-admin-groups__cell ecr-admin-groups__cell--center ecr-admin-groups__cell--strong",children:l+1}),a.jsx(Me,{children:a.jsx("div",{className:"ecr-admin-groups__name",children:s.group_name})}),a.jsx(Me,{children:a.jsxs("div",{className:"ecr-admin-groups__shortcode",children:[a.jsx("span",{className:"ecr-admin-groups__shortcode-text",children:`[reelswp-group id='${s.id}']`}),a.jsxs("div",{className:"ecr-admin-groups__copy",children:[a.jsx("button",{onClick:()=>i(`[reelswp-group id='${s.id}']`,l),className:"ecr-admin-groups__copy-button",title:"Copy",children:a.jsx(ip,{className:"ecr-admin-groups__copy-icon"})}),a.jsx("span",{className:$("ecr-admin-groups__copy-tooltip",r===l&&"ecr-admin-groups__copy-tooltip--visible"),children:"Copied!"})]})]})}),a.jsx(Me,{children:a.jsxs("div",{className:"ecr-admin-groups__actions",children:[a.jsx(ne,{title:"Statistics",variant:"link",size:"icon-sm",asChild:!0,className:"ecr-admin-groups__action-button",children:a.jsx(vt,{to:`?view=${X.stat}&group=${s.id}&name=${s.group_name}`,children:a.jsx(bi,{className:"ecr-admin-groups__icon ecr-admin-groups__icon--neutral"})})}),a.jsx(ne,{title:"Update Stories",variant:"link",size:"icon-sm",asChild:!0,className:"ecr-admin-groups__action-button",children:a.jsx(vt,{to:`?view=${X.mg}&gid=${s.id}`,children:a.jsx(Pr,{className:"ecr-admin-groups__icon ecr-admin-groups__icon--neutral"})})}),a.jsx(ne,{title:"Delete Group",onClick:()=>t(s.id),variant:"link",size:"icon-sm",className:"ecr-admin-groups__action-button",children:a.jsx(pp,{className:"ecr-admin-groups__icon ecr-admin-groups__icon--danger"})})]})})]},s.id??l))})]}):null]})},Zl=()=>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))})]}),ob=()=>{const[e,t]=_.useState([]),[r,n]=_.useState(""),[o,i]=_.useState(!1),[s,l]=_.useState(!1),[c,d]=_.useState(!1),[u,p]=_.useState(""),[m,g]=_.useState(1),[b]=_.useState(20),[f,h]=_.useState(0),[v,y]=_.useState(1),w=fo(u,500),j=_.useCallback(async E=>{const T=new AbortController,A=E===1;try{A?i(!0):l(!0),n("");const R=await he.get("groups",{params:{page:E,per_page:b,...w&&{q:w}},signal:T.signal}),L=Number(R.headers?.["x-wp-total"]??0),B=Number(R.headers?.["x-wp-totalpages"]??1),M=Math.max(1,B||1);t(O=>{if(A)return R.data;const P=new Set(O.map(I=>I.id)),z=R.data.filter(I=>!P.has(I.id));return[...O,...z]}),h(L),y(M),E>M&&g(M)}catch(R){if(T.signal.aborted)return;R instanceof Error?n(R.message):n("Something went wrong. Try again later!")}finally{T.signal.aborted||(A?i(!1):l(!1))}},[b,w]),C=_.useCallback(()=>{g(E=>o||s||E>=v?E:E+1)},[o,s,v]),N=_.useCallback(async()=>{if(m!==1){g(1);return}await j(1)},[m,j]),S=_.useCallback(async E=>{try{d(!0),await he.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 _.useEffect(()=>{j(m)},[m,j,w]),{groups:e,groupError:r,isLoading:o,isLoadingMore:s,isDeleting:c,searchTerm:u,setSearchTerm:p,perPage:b,total:f,totalPages:v,hasMore:m<=v,loadMore:C,refreshGroups:N,deleteGroup:S}},ab={docs:"https://reelswp.com/docs/"},ib=()=>{const[e,t]=_.useState(null),{groups:r,groupError:n,isLoading:o,isLoadingMore:i,isDeleting:s,deleteGroup:l,hasMore:c,loadMore:d,searchTerm:u,setSearchTerm:p}=ob(),m=_.useRef(null),g=async()=>{e&&(await l(e),t(null))};return _.useEffect(()=>{if(!m.current||!c)return;const b=new IntersectionObserver(f=>{const[h]=f;h.isIntersecting&&d()},{root:null,rootMargin:"200px",threshold:0});return b.observe(m.current),()=>b.disconnect()},[c,d]),a.jsxs(a.Fragment,{children:[a.jsx(kt,{left:[a.jsx(St,{name:"All Widgets",Icon:fp},"page")],center:[a.jsx(Ir,{},"reel-wp")],right:[a.jsxs("a",{href:ab.docs,className:"ecr-admin-docs-link",target:"_blank",children:[a.jsx(Fp,{size:14}),a.jsx("span",{children:"Documentation"})]},"view-documentation"),a.jsx(Rr,{to:`?view=${X.cr}`,text:"Add Reel",Icon:yt},"add-reel-reel-group")]}),a.jsxs("div",{className:"ecr-admin-card ecr-admin-groups",children:[e&&a.jsx(Or,{onAccept:g,onReject:()=>t(null),isLoading:s}),a.jsxs("div",{className:"ecr-admin-groups__header",children:[a.jsx("h2",{className:"ecr-admin-groups__title",children:"Reel Widgets"}),a.jsxs("div",{className:"ecr-admin-groups_action_wrapper",children:[a.jsxs("div",{className:"ecr-admin-groups-header__search",children:[a.jsx("input",{type:"text",placeholder:"Search widgets...",value:u,onChange:b=>p(b.target.value),className:"ecr-admin-groups-search-input"}),a.jsxs("div",{className:"ecr-admin-groups-header__icon-wrapper",children:[u&&a.jsx(ne,{onClick:()=>p(""),variant:"link",size:"icon-sm",children:a.jsx(qn,{size:16,className:"ecr-admin-groups-header__clear-icon"})}),a.jsx(ii,{size:16,className:"ecr-admin-groups-header__search-icon"})]})]}),a.jsx(Rr,{to:`?view=${X.mg}`,text:"Create Widget",Icon:yt,className:"ecr-admin-groups__create-button",textColor:"#2563eb"})]})]}),o?a.jsx(Zl,{}):n?a.jsx(Hl,{}):a.jsxs(a.Fragment,{children:[a.jsx(nb,{tableData:r,setIsAttemptingDelete:t}),c&&a.jsx("div",{ref:m,className:"ecr-admin-groups__load-more","aria-live":"polite",children:i?a.jsx(Hp,{className:"ecr-admin-groups__load-more__icon"}):null})]})]})]})},sb=()=>{const[e,t]=_.useState(!1),[r,n]=_.useState({rateLimit:2,timeLimit:1}),[o,i]=_.useState(!1),[s,l]=_.useState(!1),[c,d]=_.useState(!1),u=_.useCallback((m,g)=>{t(!0),n(b=>({...b,[m]:g}))},[]),p=_.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),d(!1),await he.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!"),d(!0)}finally{l(!1)}},[r.rateLimit,r.timeLimit]);return _.useEffect(()=>{const m=new AbortController;return(async()=>{try{i(!0),d(!1);const b=await he.get("settings",{signal:m.signal});n({rateLimit:b.data.rate_limit,timeLimit:b.data.time_limit}),t(!1)}catch(b){if(m.signal.aborted)return;b instanceof Error?G.error(b.message):G.error("Something went wrong. Try again later!"),d(!0)}finally{m.signal.aborted||i(!1)}})(),()=>m.abort()},[]),{limit:r,isEdited:e,isLoading:o,isSaving:s,isError:c,handleOnChange:u,handleSave:p}},lb=()=>{const{limit:e,isEdited:t,isLoading:r,isSaving:n,isError:o,handleOnChange:i,handleSave:s}=sb();return a.jsxs(a.Fragment,{children:[r&&a.jsx(Lr,{}),a.jsx(kt,{left:[a.jsx(St,{name:"Settings",Icon:Tp},"Settings"),a.jsx(tr,{},"back-settings")],center:[a.jsx(Ir,{},"Settings-widget-name")],right:[a.jsx(ho,{onSave:s,isSaving:n,disabled:!t},"save")]}),a.jsx(rr,{breads:[{label:"Dashboard",href:`?view=${X.ag}`},{label:"Settings"}]}),a.jsxs("div",{className:"ecr-admin-card ecr-admin-card--settings",children:[a.jsx("div",{className:"ecr-admin-card__header",children:a.jsx("h2",{className:"ecr-admin-card__title",children:"ReelsWP Settings"})}),o&&a.jsx("div",{className:"ecr-admin-form__row",children:a.jsx("span",{children:"Unable to load settings. Please try again."})}),a.jsxs("form",{action:"",className:"ecr-admin-form",children:[a.jsxs("div",{className:"ecr-admin-form__row",children:[a.jsx("label",{htmlFor:"ecommreels_rate_limit",className:"ecr-admin-form__label",children:"Rate Limit:"}),a.jsx("input",{type:"number",id:"ecommreels_rate_limit",name:"ecommreels_rate_limit",value:e.rateLimit,onChange:l=>i("rateLimit",l.target.value),className:"ecr-admin-form__input",min:"1"})]}),a.jsxs("div",{className:"ecr-admin-form__row",children:[a.jsx("label",{htmlFor:"ecommreels_time_limit",className:"ecr-admin-form__label",children:"Time Limit (minutes):"}),a.jsx("input",{type:"number",id:"ecommreels_time_limit",name:"ecommreels_time_limit",value:e.timeLimit,onChange:l=>i("timeLimit",l.target.value),className:"ecr-admin-form__input",min:"1"})]})]})]})]})},cb=[{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"}],db=({tableData:e})=>a.jsxs(Gl,{className:"ecr-admin-stats__table",children:[!e.length&&a.jsx(Jl,{className:"ecr-admin-stats__caption",children:a.jsxs("div",{className:"ecr-admin-stats__empty",children:[a.jsx(lt,{className:"ecr-admin-stats__empty-icon"}),"You did not create any reel group yet!"]})}),a.jsx(Kl,{children:a.jsx(kn,{children:cb.map((t,r)=>a.jsx(Xl,{className:"ecr-admin-stats__head",style:{...t.width&&{width:`${t.width}px`},textAlign:t.align},children:t.label},r))})}),!!e.length&&a.jsx(Yl,{children:e.map((t,r)=>a.jsxs(kn,{className:$("ecr-admin-stats__row",r%2===0&&"ecr-admin-stats__row--alt"),children:[a.jsx(Me,{className:"ecr-admin-stats__cell ecr-admin-stats__cell--center",children:r+1}),a.jsx(Me,{className:"ecr-admin-stats__cell",children:t.storyTitle}),a.jsx(Me,{className:"ecr-admin-stats__cell",children:t.campaignName}),a.jsx(Me,{className:"ecr-admin-stats__cell",children:t.buttonText}),a.jsx(Me,{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(Me,{className:"ecr-admin-stats__cell ecr-admin-stats__cell--center",children:t.clickCount})]},t.id))})]}),ub=()=>{const[e]=Zt(),t=e.get("group"),r=e.get("name"),[n,o]=_.useState([]),[i,s]=_.useState([]),[l,c]=_.useState(!1),[d,u]=_.useState(!1);_.useEffect(()=>{t&&(async()=>{try{c(!0);const g=await he.get(`/group/${t}/stats`);o(g.data.stories),s(g.data.buttons)}catch(g){g instanceof Error?G.error(g.message):G.error("Something went wrong. Try again later!"),u(!0)}finally{c(!1)}})()},[t]);const p=n.length>0?n.reduce((m,g)=>m+=g.view_count??0,0):0;return a.jsxs(a.Fragment,{children:[a.jsx(kt,{left:[a.jsx(St,{name:"Statistics",Icon:bi},"Statistics"),a.jsx(tr,{},"Statistics-back")],center:[a.jsx(Ir,{},"Statistics-widget-name")]}),a.jsx(rr,{breads:[{label:"Dashboard",href:`?view=${X.ag}`},{label:"Statistics"}]}),a.jsxs("div",{className:"ecr-admin-card ecr-admin-stats",children:[a.jsxs("div",{className:"ecr-admin-stats__header",children:[a.jsxs("h2",{className:"ecr-admin-stats__title",children:["Group: ",r]}),l?a.jsx("div",{className:"ecr-admin-stats__summary-skeleton"}):a.jsxs("div",{className:"ecr-admin-stats__summary",children:[a.jsx("span",{children:"Total View:"})," ",a.jsx("span",{children:p})]})]}),a.jsx("div",{className:"ecr-admin-stats__body",children:l?a.jsx(Zl,{}):d?a.jsx(Hl,{}):i.length===0?a.jsxs("div",{className:"ecr-admin-stats__empty",children:[a.jsx(lt,{className:"ecr-admin-stats__empty-icon"}),a.jsx("span",{children:"No Stats available for this group"})]}):a.jsx(db,{tableData:i})})]})]})};function pb(e){return V({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 mb(e){return V({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 fb=({isExpanded:e,setIsExpanded:t})=>a.jsx("button",{onClick:()=>t(r=>!r),className:$("ecr-admin-side-toggle",e?"ecr-admin-side-toggle--active":""),title:"Side Panel",children:a.jsx(pb,{size:24})}),hb=({...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"})]})}),ea=_.forwardRef(({className:e,type:t,...r},n)=>a.jsx(W.input,{ref:n,type:t,"data-slot":"input",className:$("ecr-input",e),...r}));ea.displayName="Input";const ta=({label:e,min:t,max:r,value:n,onChange:o,name:i,id:s,wrapperStyles:l,hideSlider:c})=>{const[d,u]=_.useState(n),p=_.useRef(null);_.useEffect(()=>{u(n)},[n]);const m=b=>{const f=Math.min(r,Math.max(t,Number(b)));o(f)},g=b=>{const f=Number(b);u(f),p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{m(f>r?r:f<t?t:f)},1e3)};return a.jsxs("div",{style:l,className:"ecr-admin-range",children:[a.jsxs("label",{htmlFor:s,className:"ecr-admin-range__label",children:[e,":"]}),a.jsxs("div",{className:"ecr-admin-range__row",children:[!c&&a.jsx("input",{type:"range",id:s,name:i,min:t,max:r,value:n,onChange:b=>{const f=Number(b.target.value);u(f),m(f)},className:"ecr-admin-range__slider"}),a.jsxs("div",{className:"ecr-admin-range__value",children:[a.jsx(ea,{type:"number",min:t,max:r,value:d,onChange:b=>g(b.target.value)}),a.jsx("span",{className:"ecr-admin-range__unit",children:"px"})]})]})]})};function D(){return D=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},D.apply(null,arguments)}function Be(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var Dt=255,et=100,pr=e=>{var{r:t,g:r,b:n,a:o}=e,i=Math.max(t,r,n),s=i-Math.min(t,r,n),l=s?i===t?(r-n)/s:i===r?2+(n-t)/s:4+(t-r)/s:0;return{h:60*(l<0?l+6:l),s:i?s/i*et:0,v:i/Dt*et,a:o}},Ql=e=>{var{h:t,s:r,l:n,a:o}=ec(e);return"hsla("+t+", "+r+"%, "+n+"%, "+o+")"},ec=e=>{var{h:t,s:r,v:n,a:o}=e,i=(200-r)*n/et;return{h:t,s:i>0&&i<200?r*n/et/(i<=et?i:200-i)*et:0,l:i/2,a:o}},tc=e=>{var{r:t,g:r,b:n}=e,o=t<<16|r<<8|n;return"#"+(i=>new Array(7-i.length).join("0")+i)(o.toString(16))},gb=e=>{var{r:t,g:r,b:n,a:o}=e,i=typeof o=="number"&&(o*255|256).toString(16).slice(1);return""+tc({r:t,g:r,b:n})+(i||"")},mr=e=>pr(xb(e)),xb=e=>{var t=e.replace("#","");/^#?/.test(e)&&t.length===3&&(e="#"+t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2));var r=new RegExp("[A-Za-z0-9]{2}","g"),[n,o,i=0,s]=e.match(r).map(l=>parseInt(l,16));return{r:n,g:o,b:i,a:(s??255)/Dt}},Sn=e=>{var{h:t,s:r,v:n,a:o}=e,i=t/60,s=r/et,l=n/et,c=Math.floor(i)%6,d=i-Math.floor(i),u=Dt*l*(1-s),p=Dt*l*(1-s*d),m=Dt*l*(1-s*(1-d));l*=Dt;var g={};switch(c){case 0:g.r=l,g.g=m,g.b=u;break;case 1:g.r=p,g.g=l,g.b=u;break;case 2:g.r=u,g.g=l,g.b=m;break;case 3:g.r=u,g.g=p,g.b=l;break;case 4:g.r=m,g.g=u,g.b=l;break;case 5:g.r=l,g.g=u,g.b=p;break}return g.r=Math.round(g.r),g.g=Math.round(g.g),g.b=Math.round(g.b),D({},g,{a:o})},bb=e=>{var{r:t,g:r,b:n,a:o}=Sn(e);return"rgba("+t+", "+r+", "+n+", "+o+")"},_b=e=>{var{r:t,g:r,b:n}=e;return{r:t,g:r,b:n}},vb=e=>{var{h:t,s:r,l:n}=e;return{h:t,s:r,l:n}},ra=e=>tc(Sn(e)),yb=e=>{var{h:t,s:r,v:n}=e;return{h:t,s:r,v:n}},wb=e=>{var{r:t,g:r,b:n}=e,o=function(u){return u<=.04045?u/12.92:Math.pow((u+.055)/1.055,2.4)},i=o(t/255),s=o(r/255),l=o(n/255),c={};return c.x=i*.4124+s*.3576+l*.1805,c.y=i*.2126+s*.7152+l*.0722,c.bri=i*.0193+s*.1192+l*.9505,c},$t=e=>{var t,r,n,o,i,s,l,c,d;return typeof e=="string"&&na(e)?(s=mr(e),c=e):typeof e!="string"&&(s=e),s&&(n=yb(s),i=ec(s),o=Sn(s),d=gb(o),c=ra(s),r=vb(i),t=_b(o),l=wb(t)),{rgb:t,hsl:r,hsv:n,rgba:o,hsla:i,hsva:s,hex:c,hexa:d,xy:l}},na=e=>/^#?([A-Fa-f0-9]{3,4}){1,2}$/.test(e);function rc(e){var t=_.useRef(e);return _.useEffect(()=>{t.current=e}),_.useCallback((r,n)=>t.current&&t.current(r,n),[])}var fr=e=>"touches"in e,nc=e=>{!fr(e)&&e.preventDefault&&e.preventDefault()},oc=function(t,r,n){return r===void 0&&(r=0),n===void 0&&(n=1),t>n?n:t<r?r:t},ac=(e,t)=>{var r=e.getBoundingClientRect(),n=fr(t)?t.touches[0]:t;return{left:oc((n.pageX-(r.left+window.pageXOffset))/r.width),top:oc((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)}},jb=["prefixCls","className","onMove","onDown"],oa=_.forwardRef((e,t)=>{var{prefixCls:r="w-color-interactive",className:n,onMove:o,onDown:i}=e,s=Be(e,jb),l=_.useRef(null),c=_.useRef(!1),[d,u]=_.useState(!1),p=rc(o),m=rc(i),g=y=>c.current&&!fr(y)?!1:(c.current=fr(y),!0),b=_.useCallback(y=>{if(nc(y),!!l.current){var w=fr(y)?y.touches.length>0:y.buttons>0;if(!w){u(!1);return}p?.(ac(l.current,y),y)}},[p]),f=_.useCallback(()=>u(!1),[]),h=_.useCallback(y=>{y?(window.addEventListener(c.current?"touchmove":"mousemove",b),window.addEventListener(c.current?"touchend":"mouseup",f)):(window.removeEventListener("mousemove",b),window.removeEventListener("mouseup",f),window.removeEventListener("touchmove",b),window.removeEventListener("touchend",f))},[b,f]);_.useEffect(()=>(h(d),()=>{h(!1)}),[d,b,f,h]);var v=_.useCallback(y=>{var w=document.activeElement;w?.blur(),nc(y.nativeEvent),g(y.nativeEvent)&&l.current&&(m?.(ac(l.current,y.nativeEvent),y.nativeEvent),u(!0))},[m]);return a.jsx("div",D({},s,{className:[r,n||""].filter(Boolean).join(" "),style:D({},s.style,{touchAction:"none"}),ref:l,tabIndex:0,onMouseDown:v,onTouchStart:v}))});oa.displayName="Interactive";var kb=e=>{var{className:t,color:r,left:n,top:o,prefixCls:i}=e,s={position:"absolute",top:o,left:n},l={"--saturation-pointer-box-shadow":"rgb(255 255 255) 0px 0px 0px 1.5px, rgb(0 0 0 / 30%) 0px 0px 1px 1px inset, rgb(0 0 0 / 40%) 0px 0px 1px 2px",width:6,height:6,transform:"translate(-3px, -3px)",boxShadow:"var(--saturation-pointer-box-shadow)",borderRadius:"50%",backgroundColor:r};return _.useMemo(()=>a.jsx("div",{className:i+"-pointer "+(t||""),style:s,children:a.jsx("div",{className:i+"-fill",style:l})}),[o,n,r,t,i])},Sb=["prefixCls","radius","pointer","className","hue","style","hsva","onChange"],ic=_.forwardRef((e,t)=>{var r,{prefixCls:n="w-color-saturation",radius:o=0,pointer:i,className:s,hue:l=0,style:c,hsva:d,onChange:u}=e,p=Be(e,Sb),m=D({width:200,height:200,borderRadius:o},c,{position:"relative"}),g=(v,y)=>{u&&d&&u({h:d.h,s:v.left*100,v:(1-v.top)*100,a:d.a})},b=_.useCallback(v=>{if(!(!d||!u)){var y=1,w=d.s,j=d.v,C=!1;switch(v.key){case"ArrowLeft":w=Math.max(0,d.s-y),C=!0,v.preventDefault();break;case"ArrowRight":w=Math.min(100,d.s+y),C=!0,v.preventDefault();break;case"ArrowUp":j=Math.min(100,d.v+y),C=!0,v.preventDefault();break;case"ArrowDown":j=Math.max(0,d.v-y),C=!0,v.preventDefault();break;default:return}C&&u({h:d.h,s:w,v:j,a:d.a})}},[d,u]),f=_.useMemo(()=>{if(!d)return null;var v={top:100-d.v+"%",left:d.s+"%",color:Ql(d)};return i&&typeof i=="function"?i(D({prefixCls:n},v)):a.jsx(kb,D({prefixCls:n},v))},[d,i,n]),h=_.useCallback(v=>{v.target.focus()},[]);return a.jsx(oa,D({className:[n,s||""].filter(Boolean).join(" ")},p,{style:D({position:"absolute",inset:0,cursor:"crosshair",backgroundImage:"linear-gradient(0deg, #000, transparent), linear-gradient(90deg, #fff, hsl("+((r=d?.h)!=null?r:l)+", 100%, 50%))"},m,{outline:"none"}),ref:t,onMove:g,onDown:g,onKeyDown:b,onClick:h,children:f}))});ic.displayName="Saturation";var Cb=["className","prefixCls","left","top","style","fillProps"],Nb=e=>{var{className:t,prefixCls:r,left:n,top:o,style:i,fillProps:s}=e,l=Be(e,Cb),c=D({},i,{position:"absolute",left:n,top:o}),d=D({width:18,height:18,boxShadow:"var(--alpha-pointer-box-shadow)",borderRadius:"50%",backgroundColor:"var(--alpha-pointer-background-color)"},s?.style,{transform:n?"translate(-9px, -1px)":"translate(-1px, -9px)"});return a.jsx("div",D({className:r+"-pointer "+(t||""),style:c},l,{children:a.jsx("div",D({className:r+"-fill"},s,{style:d}))}))},Eb=["prefixCls","className","hsva","background","bgProps","innerProps","pointerProps","radius","width","height","direction","style","onChange","pointer"],Tb="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg==",Cn=_.forwardRef((e,t)=>{var{prefixCls:r="w-color-alpha",className:n,hsva:o,background:i,bgProps:s={},innerProps:l={},pointerProps:c={},radius:d=0,width:u,height:p=16,direction:m="horizontal",style:g,onChange:b,pointer:f}=e,h=Be(e,Eb),v=T=>{b&&b(D({},o,{a:m==="horizontal"?T.left:T.top}),T)},y=Ql(Object.assign({},o,{a:1})),w="linear-gradient(to "+(m==="horizontal"?"right":"bottom")+", rgba(244, 67, 54, 0) 0%, "+y+" 100%)",j={};m==="horizontal"?j.left=o.a*100+"%":j.top=o.a*100+"%";var C=D({"--alpha-background-color":"#fff","--alpha-pointer-background-color":"rgb(248, 248, 248)","--alpha-pointer-box-shadow":"rgb(0 0 0 / 37%) 0px 1px 4px 0px",borderRadius:d,background:"url("+Tb+") left center",backgroundColor:"var(--alpha-background-color)"},{width:u,height:p},g,{position:"relative"}),N=_.useCallback(T=>{var A=.01,R=o.a,L=R;switch(T.key){case"ArrowLeft":m==="horizontal"&&(L=Math.max(0,R-A),T.preventDefault());break;case"ArrowRight":m==="horizontal"&&(L=Math.min(1,R+A),T.preventDefault());break;case"ArrowUp":m==="vertical"&&(L=Math.max(0,R-A),T.preventDefault());break;case"ArrowDown":m==="vertical"&&(L=Math.min(1,R+A),T.preventDefault());break;default:return}if(L!==R){var B={left:m==="horizontal"?L:o.a,top:m==="vertical"?L:o.a,width:0,height:0,x:0,y:0};b&&b(D({},o,{a:L}),B)}},[o,m,b]),S=_.useCallback(T=>{T.target.focus()},[]),E=f&&typeof f=="function"?f(D({prefixCls:r},c,j)):a.jsx(Nb,D({},c,{prefixCls:r},j));return a.jsxs("div",D({},h,{className:[r,r+"-"+m,n||""].filter(Boolean).join(" "),style:C,ref:t,children:[a.jsx("div",D({},s,{style:D({inset:0,position:"absolute",background:i||w,borderRadius:d},s.style)})),a.jsx(oa,D({},l,{style:D({},l.style,{inset:0,zIndex:1,position:"absolute",outline:"none"}),onMove:v,onDown:v,onClick:S,onKeyDown:N,children:E}))]}))});Cn.displayName="Alpha";var Ab=["prefixCls","placement","label","value","className","style","labelStyle","inputStyle","onChange","onBlur","renderInput"],Pb=e=>/^#?([A-Fa-f0-9]{3,4}){1,2}$/.test(e),Ob=e=>Number(String(e).replace(/%/g,"")),Ft=_.forwardRef((e,t)=>{var{prefixCls:r="w-color-editable-input",placement:n="bottom",label:o,value:i,className:s,style:l,labelStyle:c,inputStyle:d,onChange:u,onBlur:p,renderInput:m}=e,g=Be(e,Ab),[b,f]=_.useState(i),h=_.useRef(!1);_.useEffect(()=>{e.value!==b&&(h.current||f(e.value))},[e.value]);function v(S,E){var T=(E||S.target.value).trim().replace(/^#/,"");Pb(T)&&u&&u(S,T);var A=Ob(T);isNaN(A)||u&&u(S,A),f(T)}function y(S){h.current=!1,f(e.value),p&&p(S)}var w={};n==="bottom"&&(w.flexDirection="column"),n==="top"&&(w.flexDirection="column-reverse"),n==="left"&&(w.flexDirection="row-reverse");var j=D({"--editable-input-label-color":"rgb(153, 153, 153)","--editable-input-box-shadow":"rgb(204 204 204) 0px 0px 0px 1px inset","--editable-input-color":"#666",position:"relative",alignItems:"center",display:"flex",fontSize:11},w,l),C=D({width:"100%",paddingTop:2,paddingBottom:2,paddingLeft:3,paddingRight:3,fontSize:11,background:"transparent",boxSizing:"border-box",border:"none",color:"var(--editable-input-color)",boxShadow:"var(--editable-input-box-shadow)"},d),N=D({value:b,onChange:v,onBlur:y,autoComplete:"off",onFocus:()=>h.current=!0},g,{style:C,onFocusCapture:S=>{var E=S.target;E.setSelectionRange(E.value.length,E.value.length)}});return a.jsxs("div",{className:[r,s||""].filter(Boolean).join(" "),style:j,children:[m?m(N,t):a.jsx("input",D({ref:t},N)),o&&a.jsx("span",{style:D({color:"var(--editable-input-label-color)",textTransform:"capitalize"},c),children:o})]})});Ft.displayName="EditableInput";var Rb=["prefixCls","hsva","placement","rProps","gProps","bProps","aProps","className","style","onChange"],sc=_.forwardRef((e,t)=>{var{prefixCls:r="w-color-editable-input-rgba",hsva:n,placement:o="bottom",rProps:i={},gProps:s={},bProps:l={},aProps:c={},className:d,style:u,onChange:p}=e,m=Be(e,Rb),g=n?Sn(n):{};function b(y){var w=Number(y.target.value);w&&w>255&&(y.target.value="255"),w&&w<0&&(y.target.value="0")}var f=y=>{var w=Number(y.target.value);w&&w>100&&(y.target.value="100"),w&&w<0&&(y.target.value="0")},h=(y,w,j)=>{typeof y=="number"&&(w==="a"&&(y<0&&(y=0),y>100&&(y=100),p&&p($t(pr(D({},g,{a:y/100}))))),y>255&&(y=255,j.target.value="255"),y<0&&(y=0,j.target.value="0"),w==="r"&&p&&p($t(pr(D({},g,{r:y})))),w==="g"&&p&&p($t(pr(D({},g,{g:y})))),w==="b"&&p&&p($t(pr(D({},g,{b:y})))))},v=g.a?Math.round(g.a*100)/100:0;return a.jsxs("div",D({ref:t,className:[r,d||""].filter(Boolean).join(" ")},m,{style:D({fontSize:11,display:"flex"},u),children:[a.jsx(Ft,D({label:"R",value:g.r||0,onBlur:b,placement:o,onChange:(y,w)=>h(w,"r",y)},i,{style:D({},i.style)})),a.jsx(Ft,D({label:"G",value:g.g||0,onBlur:b,placement:o,onChange:(y,w)=>h(w,"g",y)},s,{style:D({marginLeft:5},i.style)})),a.jsx(Ft,D({label:"B",value:g.b||0,onBlur:b,placement:o,onChange:(y,w)=>h(w,"b",y)},l,{style:D({marginLeft:5},l.style)})),c&&a.jsx(Ft,D({label:"A",value:parseInt(String(v*100),10),onBlur:f,placement:o,onChange:(y,w)=>h(w,"a",y)},c,{style:D({marginLeft:5},c.style)}))]}))});sc.displayName="EditableInputRGBA";var Lb=["prefixCls","className","hue","onChange","direction"],lc=_.forwardRef((e,t)=>{var{prefixCls:r="w-color-hue",className:n,hue:o=0,onChange:i,direction:s="horizontal"}=e,l=Be(e,Lb);return a.jsx(Cn,D({ref:t,className:r+" "+(n||"")},l,{direction:s,background:"linear-gradient(to "+(s==="horizontal"?"right":"bottom")+", rgb(255, 0, 0) 0%, rgb(255, 255, 0) 17%, rgb(0, 255, 0) 33%, rgb(0, 255, 255) 50%, rgb(0, 0, 255) 67%, rgb(255, 0, 255) 83%, rgb(255, 0, 0) 100%)",hsva:{h:o,s:100,v:100,a:o/360},onChange:(c,d)=>{i&&i({h:s==="horizontal"?360*d.left:360*d.top})}}))});lc.displayName="Hue";var Ib=["prefixCls","className","color","colors","style","rectProps","onChange","addonAfter","addonBefore","rectRender"],cc=_.forwardRef((e,t)=>{var{prefixCls:r="w-color-swatch",className:n,color:o,colors:i=[],style:s,rectProps:l={},onChange:c,addonAfter:d,addonBefore:u,rectRender:p}=e,m=Be(e,Ib),g=D({"--swatch-background-color":"rgb(144, 19, 254)",background:"var(--swatch-background-color)",height:15,width:15,marginRight:5,marginBottom:5,cursor:"pointer",position:"relative",outline:"none",borderRadius:2},l.style),b=(f,h)=>{c&&c(mr(f),$t(mr(f)),h)};return a.jsxs("div",D({ref:t},m,{className:[r,n||""].filter(Boolean).join(" "),style:D({display:"flex",flexWrap:"wrap",position:"relative"},s),children:[u&&_.isValidElement(u)&&u,i&&Array.isArray(i)&&i.map((f,h)=>{var v="",y="";typeof f=="string"&&(v=f,y=f),typeof f=="object"&&f.color&&(v=f.title||f.color,y=f.color);var w=o&&o.toLocaleLowerCase()===y.toLocaleLowerCase(),j=p&&p({title:v,color:y,checked:!!w,style:D({},g,{background:y}),onClick:N=>b(y,N)});if(j)return a.jsx(_.Fragment,{children:j},h);var C=l.children&&_.isValidElement(l.children)?_.cloneElement(l.children,{color:y,checked:w}):null;return a.jsx("div",D({tabIndex:0,title:v,onClick:N=>b(y,N)},l,{children:C,style:D({},g,{background:y})}),h)}),d&&_.isValidElement(d)&&d]}))});cc.displayName="Swatch";var Mb=["prefixCls","className","onChange","width","presetColors","color","editableDisable","disableAlpha","style"],zb=["#D0021B","#F5A623","#f8e61b","#8B572A","#7ED321","#417505","#BD10E0","#9013FE","#4A90E2","#50E3C2","#B8E986","#000000","#4A4A4A","#9B9B9B","#FFFFFF"],dc=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"}}),uc=_.forwardRef((e,t)=>{var{prefixCls:r="w-color-sketch",className:n,onChange:o,width:i=218,presetColors:s=zb,color:l,editableDisable:c=!0,disableAlpha:d=!1,style:u}=e,p=Be(e,Mb),[m,g]=_.useState({h:209,s:36,v:90,a:1});_.useEffect(()=>{typeof l=="string"&&na(l)&&g(mr(l)),typeof l=="object"&&g(l)},[l]);var b=N=>{g(N),o&&o($t(N))},f=(N,S)=>{typeof N=="string"&&na(N)&&/(3|6)/.test(String(N.length))&&b(mr(N))},h=N=>b(D({},m,{a:N.a})),v=N=>b(D({},m,N,{a:m.a})),y=D({"--sketch-background":"rgb(255, 255, 255)","--sketch-box-shadow":"rgb(0 0 0 / 15%) 0px 0px 0px 1px, rgb(0 0 0 / 15%) 0px 8px 16px","--sketch-swatch-box-shadow":"rgb(0 0 0 / 15%) 0px 0px 0px 1px inset","--sketch-alpha-box-shadow":"rgb(0 0 0 / 15%) 0px 0px 0px 1px inset, rgb(0 0 0 / 25%) 0px 0px 4px inset","--sketch-swatch-border-top":"1px solid rgb(238, 238, 238)",background:"var(--sketch-background)",borderRadius:4,boxShadow:"var(--sketch-box-shadow)",width:i},u),w={borderRadius:2,background:bb(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",D({},p,{className:r+" "+(n||""),ref:t,style:y,children:[a.jsxs("div",{style:{padding:"10px 10px 8px"},children:[a.jsx(ic,{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(lc,{width:"auto",height:10,hue:m.h,pointer:dc,innerProps:{style:{marginLeft:1,marginRight:5}},onChange:N=>b(D({},m,N))}),!d&&a.jsx(Cn,{width:"auto",height:10,hsva:m,pointer:dc,style:{marginTop:4},innerProps:{style:{marginLeft:1,marginRight:5}},onChange:h})]}),!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(_.Fragment,{})})]})]}),c&&a.jsxs("div",{style:{display:"flex",margin:"0 10px 3px 10px"},children:[a.jsx(Ft,{label:"Hex",value:ra(m).replace(/^#/,"").toLocaleUpperCase(),onChange:(N,S)=>f(S),style:{minWidth:58}}),a.jsx(sc,{hsva:m,style:{marginLeft:6},aProps:d?!1:{},onChange:N=>b(N.hsva)})]}),s&&s.length>0&&a.jsx(cc,{style:j,colors:s,color:ra(m),onChange:N=>b(N),rectProps:{style:C}})]}))});uc.displayName="Sketch";const pc=({selectedColor:e,handleColor:t,text:r,wrapperStyles:n})=>a.jsxs("div",{style:n,className:"ecr-admin-control",children:[a.jsxs("p",{className:"ecr-admin-control__label",children:[r,":"]}),a.jsxs("div",{className:"ecr-admin-control__row ecr-admin-control__row--color",children:[a.jsxs(Je,{children:[a.jsx(Ze,{style:{padding:0,backgroundColor:"transparent"},children:a.jsx("div",{style:{backgroundColor:e},className:"ecr-admin-control__swatch"})}),a.jsx(Qe,{className:"ecr-admin-popover ecr-admin-color-selector-popover",children:a.jsx(uc,{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)})]})]}),Db=[{value:"left",title:"Align Left",Icon:pm},{value:"center",title:"Align Center",Icon:mm},{value:"right",title:"Align Right",Icon:fm},{value:"hidden",title:"Hidden",Icon:hm}],$b=({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:Db.map(({value:r,title:n,Icon:o})=>a.jsx(ne,{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))})]}),Fb=({styles:e,setStyles:t,setIsEdited:r})=>{const n=o=>{t(i=>{const s=o(i);return r(!0),s})};return a.jsxs("div",{className:"ecr-admin-group-title-customization__content",children:[a.jsx($b,{alignment:e.widgetTitle?.alignment??"hidden",handleWidgetTitleAlignment:o=>n(i=>({...i,widgetTitle:{...i.widgetTitle,alignment:o}}))}),a.jsx(pc,{selectedColor:e.widgetTitle?.color??"#000000",handleColor:o=>n(i=>({...i,widgetTitle:{...i.widgetTitle,color:o}})),text:"Title Color",wrapperStyles:{flexDirection:"row",justifyContent:"space-between",alignItems:"center"}}),a.jsx(ta,{label:"Font size",min:10,max:200,value:e?.widgetTitle?.fontSize??24,onChange:o=>n(i=>({...i,widgetTitle:{...i.widgetTitle,fontSize:o}})),name:"font_size",id:"font-size",hideSlider:!0,wrapperStyles:{flexDirection:"row",justifyContent:"space-between",alignItems:"center"}})]})},Bb=(e=700)=>{const[t,r]=_.useState(!1),n=_.useRef(null),o=_.useCallback(i=>{ql(i),r(!0),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{r(!1)},e)},[e]);return _.useEffect(()=>()=>{n.current&&clearTimeout(n.current)},[]),[t,o]},Ub=({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($p,{color:"#ffffff",size:12})}),a.jsx("span",{className:$("ecr-admin-shortcode__tooltip",t?"ecr-admin-shortcode__tooltip--visible":"ecr-admin-shortcode__tooltip--hidden"),children:"Copied!"})]})]})},mc=_.createContext({requestLeave:e=>e()}),Hb=({value:e,children:t})=>a.jsx(mc.Provider,{value:e,children:t}),fc=()=>_.useContext(mc);function Vb(e){return V({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(qb,{link:e,usedFor:t})}),qb=({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||wn,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||wn,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(Vb,{className:"ecr-product-card-one__star"}),Number(e.rating).toString()]}):null,a.jsx("div",{className:"ecr-product-card-one__price",dangerouslySetInnerHTML:{__html:e.price}})]})]})]})}),Gb=({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})})},Nn=({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(Gb,{link:e,usedFor:t},e.btn_uuid)}),Bt=({title:e,styles:t})=>a.jsx("p",{className:"ecr-reel_title",style:t,children:e}),hc=({reel:e,styles:t,gid:r,togglingId:n,onRemove:o})=>{const i=Ne(),{requestLeave:s}=fc(),l=n===e.story_uuid,c=`?view=${X.cr}&from=${X.mg}&sid=${e.id}${r?`&gid=${r}`:""}`,d=t.appearance??"overlay",u={border:`${t?.border?.border_width}px solid ${t?.border?.border_color}`,borderRadius:t?.shape==="rectangle"?`${t?.border?.border_radius}px`:"50%",aspectRatio:t?.shape==="rectangle"?"9/16":"1/1"},p=t.border.border_radius,m=p>50?p+16:p>20?p:0,g=e.links&&e.links.length>0?e.links[0]:null,b=d==="none",f=d==="title",h=t.shape==="rectangle",v=!b&&!f&&g;return a.jsxs("div",{className:$("ecr-admin-reelitem",t?.hoverEffect),children:[a.jsxs("div",{style:u,className:"ecr-admin-reelitem__frame",children:[a.jsx(to,{story:e,styles:t}),!b&&!f&&h?v?a.jsx(Nn,{link:g,usedFor:"admin",usedIn:"thumb",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"4px",width:"calc(100% - 8px)",borderRadius:"6px"}}):a.jsx(Bt,{title:e.title,styles:{width:`calc(95% - ${m}px)`}}):null,a.jsxs("div",{className:"ecr-admin-reelitem__actions",children:[a.jsx(ne,{title:"Edit Story",size:"icon-sm",asChild:!0,className:"ecr-admin-reelitem__button",disabled:l,children:a.jsx(vt,{to:c,className:$("ecr-admin-reelitem__link",l?"ecr-admin-reelitem__link--disabled":"ecr-admin-reelitem__link--active"),onClick:y=>{y.preventDefault(),s(()=>i(c))},children:a.jsx(Pr,{className:"ecr-admin-reelitem__icon"})})}),a.jsx(ne,{onClick:()=>o(e,"remove"),className:"ecr-admin-reelitem__button ecr-admin-reelitem__button--danger",size:"icon-sm",title:"Remove Story",disabled:l,children:l?a.jsx(it,{className:"ecr-admin-reelitem__spinner",size:18}):a.jsx(Gn,{size:18})})]})]}),f?a.jsx("p",{className:"ecr-admin-reel__title",children:e.title}):null]})},gc=(e,t)=>{const r=_.useRef(null),n=_.useRef(null),o=_.useRef(null),[i,s]=_.useState(!1),[l,c]=_.useState(!1),[d,u]=_.useState(!1),[p,m]=_.useState(300),g=()=>{const f=r.current;if(!f)return;const h=f.scrollLeft,v=f.scrollWidth,y=f.clientWidth;c(h>0),u(h+y<v-1)};_.useEffect(()=>{const f=r.current,h=n.current;f&&h&&(s(h.scrollWidth>f.clientWidth),m(f.clientWidth-100),g())},[e,t]);const b=f=>{const h=r.current;h&&(h.scrollBy({left:f,behavior:"smooth"}),o.current&&clearTimeout(o.current),o.current=setTimeout(g,300))};return _.useEffect(()=>{const f=r.current;if(!f)return;let h=!1,v,y;const w=A=>{h=!0,v=A.pageX-f.offsetLeft,y=f.scrollLeft,f.style.cursor="grabbing"},j=()=>{h=!1,f.style.cursor="default"},C=()=>{h=!1,f.style.cursor="default"},N=A=>{if(!h)return;A.preventDefault();const L=(A.pageX-f.offsetLeft-v)*1.5;f.scrollLeft=y-L,g()},S=A=>{h=!0,v=A.touches[0].pageX-f.offsetLeft,y=f.scrollLeft},E=()=>{h=!1},T=A=>{if(!h)return;const L=(A.touches[0].pageX-f.offsetLeft-v)*1.5;f.scrollLeft=y-L,g()};return f.addEventListener("mousedown",w),f.addEventListener("mouseleave",j),f.addEventListener("mouseup",C),f.addEventListener("mousemove",N),f.addEventListener("touchstart",S,{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",S),f.removeEventListener("touchend",E),f.removeEventListener("touchmove",T)}},[t]),_.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]),{thumbsContainerRef:r,thumbsWrapperRef:n,isOverflowing:i,canScrollLeft:l,canScrollRight:d,scrollBy:b,scrollStep:p}},xc=({reels:e,styles:t,gid:r,togglingId:n,handleRemoveReel:o})=>{const{thumbsContainerRef:i,thumbsWrapperRef:s,isOverflowing:l,canScrollLeft:c,canScrollRight:d,scrollBy:u,scrollStep:p}=gc([e],!0);return a.jsxs("div",{className:"ecr-admin-editor-carousel",children:[a.jsx("div",{ref:i,className:"ecr-admin-editor-carousel__viewport",children:a.jsx("div",{ref:s,style:{...!e.length&&{margin:"auto"}},className:$("ecr-admin-editor-carousel__track",t.hoverEffect==="zoom-in"&&"ecr-admin-editor-carousel__track--padded"),children:e.length>0?e.map(m=>a.jsx(hc,{reel:m,styles:t,gid:r,togglingId:n,onRemove:o},m.id)):a.jsx("div",{className:"ecr-admin-editor-carousel__empty",children:a.jsxs("p",{className:"ecr-admin-editor-carousel__empty-text",children:[a.jsx(lt,{className:"ecr-admin-editor-carousel__empty-icon"}),a.jsx("span",{children:"No reels have been added to this widget yet. Select some from the list on the left to get started."})]})})})}),l&&c&&a.jsx("button",{onClick:()=>u(-p),className:"ecr-admin-editor-carousel__nav ecr-admin-editor-carousel__nav--left",children:a.jsx(Vn,{size:20})}),l&&d&&a.jsx("button",{onClick:()=>u(p),className:"ecr-admin-editor-carousel__nav ecr-admin-editor-carousel__nav--right",children:a.jsx(Wn,{size:20})})]})},Kb=({reels:e,styles:t,gid:r,togglingId:n,handleRemoveReel:o})=>a.jsx("div",{className:$("ecr-admin-editor-grid",t?.hoverEffect==="zoom-in"&&"ecr-admin-editor-grid--padded"),children:e.length>0?e.map(i=>a.jsx(hc,{reel:i,styles:t,gid:r,togglingId:n,onRemove:o},i.id)):a.jsx("div",{className:"ecr-admin-editor-grid__empty",children:a.jsxs("p",{className:"ecr-admin-editor-grid__empty-text",children:[a.jsx(lt,{className:"ecr-admin-editor-grid__empty-icon"}),a.jsx("span",{children:"No reels have been added to this widget yet. Select some from the list on the left to get started."})]})})}),Yb=({reel:e,styles:t})=>{const r=Ar("(min-width: 1024px)"),n=e?.files?.[0],o=!!n?.mime_type?.startsWith("image"),[i,s]=_.useState(!1),[l,c]=_.useState(!0),[d,u]=_.useState(!1),p=_.useRef(null);_.useEffect(()=>{p.current&&(p.current.muted=l)},[l]),_.useEffect(()=>{p.current&&(i?p.current.pause():p.current.play().catch(()=>{}))},[i]);const m=()=>{p.current&&s(h=>!h)},g=()=>{p.current&&c(h=>!h)},b=t?.playerAppearance??"overlay",f=e.links&&e.links.length>0?e.links[0]:null;return a.jsxs("div",{className:"ecr-preview-player",children:[a.jsxs("div",{className:"ecr-preview-player__stage",children:[a.jsx(wt,{className:"ecr-player__nav--left ecr-preview-player__nav--disabled",type:"button",disabled:!0,"aria-disabled":"true",children:a.jsx(pi,{size:24})}),a.jsx(wt,{className:"ecr-player__nav--right ecr-preview-player__nav--disabled",type:"button",disabled:!0,"aria-disabled":"true",children:a.jsx(mi,{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,{size:r?20:24,className:"ecr-player__close-icon"})}),n?a.jsx("div",{className:"ecr-player__media-frame",children:o?a.jsx("img",{src:n.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:p,className:"ecr-preview-player__media-item",src:n.url,poster:e?.thumbnail,autoPlay:!0,muted:l,loop:!0,playsInline:!0,onClick:m,onLoadedMetadata:h=>{const v=h.currentTarget,y=v.videoWidth,w=v.videoHeight;u(()=>w>y)}}),a.jsxs("div",{className:"ecr-player__controls",children:[i?a.jsx(Jn,{size:r?20:24,className:"ecr-player__control-icon",onClick:m}):a.jsx(Xn,{size:r?20:24,className:"ecr-player__control-icon",onClick:m}),l?a.jsx(Qn,{size:r?20:24,className:"ecr-player__control-icon",onClick:g}):a.jsx(Zn,{size:r?20:24,className:"ecr-player__control-icon",onClick:g})]})]})}):a.jsx("div",{className:"ecr-preview-player__empty",children:"No preview available"})]}),b==="overlay"?f?a.jsx(Nn,{link:f,usedFor:"admin",usedIn:"thumb",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"8px",width:"95%",borderRadius:"6px"}}):a.jsx(Bt,{title:e.title}):null,b==="title"?a.jsx(Bt,{title:e.title}):null]}),a.jsxs("p",{className:"ecr-preview-message",children:["This is simply a ",a.jsx("strong",{children:"visual"})," representation intended to show how the preview will appear to end users."]})]})},Xb={carousel:xc,grid:Kb},Jb=({gid:e,reels:t,styles:r,handleRemoveReel:n,togglingId:o,currentTab:i})=>{const s=r.template??"carousel",l=Xb[s]||xc;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(Ub,{gid:e})]}),a.jsx("div",{className:"scrollbarThin ecr-admin-existing__body",children:i==="thumbnail"?a.jsx("div",{style:{"--thumbnail-size":`${r?.size}px`,"--thumbnail-size-tab":`${r?.sizeOnTab??r?.size}px`,"--thumbnail-size-mobile":`${r?.sizeOnMobile??r?.size}px`,"--thumbnail-gap":`${r?.gap}px`,"--thumbnail-gap-tab":`${r?.gapOnTab??r?.gap}px`,"--thumbnail-gap-mobile":`${r?.gapOnMobile??r?.gap}px`,"--thumbnail-border-radius":`${r?.border?.border_radius}px`},children:a.jsx(l,{reels:t,styles:r,gid:e,togglingId:o,handleRemoveReel:n})}):t.length>0?a.jsx(Yb,{reel:t[0],styles:r}):a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,alignItems:"center"},children:[a.jsx(lt,{style:{width:"40px",height:"40px",color:"#f59e0b"}}),"No reels available for preview."]})})]})},bc=()=>a.jsx("div",{className:"ecr-admin-reellist__loader",children:a.jsx("div",{className:"ecr-admin-reellist__spinner"})}),Zb=({gid:e,allReels:t,handleSelectReel:r,searchTerm:n,setSearchTerm:o,isSearching:i,togglingId:s,lastStoryElementRef:l})=>{const c=Ne(),{requestLeave:d}=fc(),u=`?view=${X.cr}&from=${X.mg}${e?`&gid=${e}`:""}`,p=t.filter(m=>!m?.files[0]?.mime_type.startsWith("image"));return a.jsxs("div",{className:"ecr-admin-reellist",children:[a.jsxs("div",{className:"ecr-admin-reellist__header",children:[a.jsx("p",{className:"ecr-admin-reellist__title",children:"All reels"}),a.jsx("small",{className:"ecr-admin-reellist__subtitle",children:"Choose reels to attach in this widget"})]}),a.jsxs("div",{className:"ecr-admin-reellist__body",children:[a.jsx(Rr,{to:u,text:"Add Reel",Icon:yt,className:"ecr-admin-reellist__add-button",textColor:"#2563eb",onNavigate:m=>d(()=>c(m))}),a.jsx("div",{className:"ecr-admin-reellist__search",children:a.jsx("input",{type:"text",placeholder:"Search reels...",value:n,onChange:m=>o(m.target.value),className:"ecr-admin-reellist__search-input"})}),a.jsx("div",{className:"scrollbarThin ecr-admin-reellist__grid",children:i&&t.length===0?a.jsx(bc,{}):a.jsxs("div",{className:"ecr-admin-reellist__items",children:[p.length===0?a.jsx("p",{className:"ecr-admin-reellist__empty",children:"No reels are available to add."}):p.map((m,g)=>a.jsx("div",{ref:p.length===g+1?l:null,className:"ecr-admin-reellist__item",children:a.jsxs("button",{title:"Click to add this reel",onClick:()=>r(m,"add"),disabled:s==m.story_uuid,className:"ecr-admin-reellist__card",children:[a.jsx("div",{className:"ecr-admin-reellist__media",children:a.jsx("video",{className:"ecr-admin-reellist__thumb",src:m?.files[0]?.url,poster:m?.thumbnail})}),a.jsx("span",{className:"ecr-admin-reellist__label",children:m.title||`Reel #${m.id}`}),s==m.story_uuid?a.jsx("div",{className:"ecr-admin-reellist__overlay",children:a.jsx(it,{className:"ecr-admin-reellist__overlay-icon"})}):null]})},m.id)),i&&t.length>0&&a.jsx(bc,{})]})})]})]})};function _c(e){const t=e+"CollectionProvider",[r,n]=Ve(t),[o,i]=r(t,{collectionRef:{current:null},itemMap:new Map}),s=f=>{const{scope:h,children:v}=f,y=_.useRef(null),w=_.useRef(new Map).current;return a.jsx(o,{scope:h,itemMap:w,collectionRef:y,children:v})};s.displayName=t;const l=e+"CollectionSlot",c=st(l),d=_.forwardRef((f,h)=>{const{scope:v,children:y}=f,w=i(l,v),j=J(h,w.collectionRef);return a.jsx(c,{ref:j,children:y})});d.displayName=l;const u=e+"CollectionItemSlot",p="data-radix-collection-item",m=st(u),g=_.forwardRef((f,h)=>{const{scope:v,children:y,...w}=f,j=_.useRef(null),C=J(h,j),N=i(u,v);return _.useEffect(()=>(N.itemMap.set(j,{ref:j,...w}),()=>void N.itemMap.delete(j))),a.jsx(m,{[p]:"",ref:C,children:y})});g.displayName=u;function b(f){const h=i(e+"CollectionConsumer",f);return _.useCallback(()=>{const y=h.collectionRef.current;if(!y)return[];const w=Array.from(y.querySelectorAll(`[${p}]`));return Array.from(h.itemMap.values()).sort((N,S)=>w.indexOf(N.ref.current)-w.indexOf(S.ref.current))},[h.collectionRef,h.itemMap])}return[{Provider:s,Slot:d,ItemSlot:g},b,n]}var Qb=x.createContext(void 0);function aa(e){const t=x.useContext(Qb);return e||t||"ltr"}var ia="rovingFocusGroup.onEntryFocus",e_={bubbles:!1,cancelable:!0},hr="RovingFocusGroup",[sa,vc,t_]=_c(hr),[r_,yc]=Ve(hr,[t_]),[n_,o_]=r_(hr),wc=x.forwardRef((e,t)=>a.jsx(sa.Provider,{scope:e.__scopeRovingFocusGroup,children:a.jsx(sa.Slot,{scope:e.__scopeRovingFocusGroup,children:a.jsx(a_,{...e,ref:t})})}));wc.displayName=hr;var a_=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:u=!1,...p}=e,m=x.useRef(null),g=J(t,m),b=aa(i),[f,h]=mt({prop:s,defaultProp:l??null,onChange:c,caller:hr}),[v,y]=x.useState(!1),w=We(d),j=vc(r),C=x.useRef(!1),[N,S]=x.useState(0);return x.useEffect(()=>{const E=m.current;if(E)return E.addEventListener(ia,w),()=>E.removeEventListener(ia,w)},[w]),a.jsx(n_,{scope:r,orientation:n,dir:b,loop:o,currentTabStopId:f,onItemFocus:x.useCallback(E=>h(E),[h]),onItemShiftTab:x.useCallback(()=>y(!0),[]),onFocusableItemAdd:x.useCallback(()=>S(E=>E+1),[]),onFocusableItemRemove:x.useCallback(()=>S(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:H(e.onMouseDown,()=>{C.current=!0}),onFocus:H(e.onFocus,E=>{const T=!C.current;if(E.target===E.currentTarget&&T&&!v){const A=new CustomEvent(ia,e_);if(E.currentTarget.dispatchEvent(A),!A.defaultPrevented){const R=j().filter(P=>P.focusable),L=R.find(P=>P.active),B=R.find(P=>P.id===f),O=[L,B,...R].filter(Boolean).map(P=>P.ref.current);Sc(O,u)}}C.current=!1}),onBlur:H(e.onBlur,()=>y(!1))})})}),jc="RovingFocusGroupItem",kc=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:o=!1,tabStopId:i,children:s,...l}=e,c=Ae(),d=i||c,u=o_(jc,r),p=u.currentTabStopId===d,m=vc(r),{onFocusableItemAdd:g,onFocusableItemRemove:b,currentTabStopId:f}=u;return x.useEffect(()=>{if(n)return g(),()=>b()},[n,g,b]),a.jsx(sa.ItemSlot,{scope:r,id:d,focusable:n,active:o,children:a.jsx(W.span,{tabIndex:p?0:-1,"data-orientation":u.orientation,...l,ref:t,onMouseDown:H(e.onMouseDown,h=>{n?u.onItemFocus(d):h.preventDefault()}),onFocus:H(e.onFocus,()=>u.onItemFocus(d)),onKeyDown:H(e.onKeyDown,h=>{if(h.key==="Tab"&&h.shiftKey){u.onItemShiftTab();return}if(h.target!==h.currentTarget)return;const v=l_(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?c_(w,j+1):w.slice(j+1)}setTimeout(()=>Sc(w))}}),children:typeof s=="function"?s({isCurrentTabStop:p,hasTabStop:f!=null}):s})})});kc.displayName=jc;var i_={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function s_(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function l_(e,t,r){const n=s_(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return i_[n]}function Sc(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function c_(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var d_=wc,u_=kc,En="Tabs",[p_]=Ve(En,[yc]),Cc=yc(),[m_,la]=p_(En),Nc=x.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,onValueChange:o,defaultValue:i,orientation:s="horizontal",dir:l,activationMode:c="automatic",...d}=e,u=aa(l),[p,m]=mt({prop:n,onChange:o,defaultProp:i??"",caller:En});return a.jsx(m_,{scope:r,baseId:Ae(),value:p,onValueChange:m,orientation:s,dir:u,activationMode:c,children:a.jsx(W.div,{dir:u,"data-orientation":s,...d,ref:t})})});Nc.displayName=En;var Ec="TabsList",Tc=x.forwardRef((e,t)=>{const{__scopeTabs:r,loop:n=!0,...o}=e,i=la(Ec,r),s=Cc(r);return a.jsx(d_,{asChild:!0,...s,orientation:i.orientation,dir:i.dir,loop:n,children:a.jsx(W.div,{role:"tablist","aria-orientation":i.orientation,...o,ref:t})})});Tc.displayName=Ec;var Ac="TabsTrigger",Pc=x.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,disabled:o=!1,...i}=e,s=la(Ac,r),l=Cc(r),c=Lc(s.baseId,n),d=Ic(s.baseId,n),u=n===s.value;return a.jsx(u_,{asChild:!0,...l,focusable:!o,active:u,children:a.jsx(W.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":d,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:c,...i,ref:t,onMouseDown:H(e.onMouseDown,p=>{!o&&p.button===0&&p.ctrlKey===!1?s.onValueChange(n):p.preventDefault()}),onKeyDown:H(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&s.onValueChange(n)}),onFocus:H(e.onFocus,()=>{const p=s.activationMode!=="manual";!u&&!o&&p&&s.onValueChange(n)})})})});Pc.displayName=Ac;var Oc="TabsContent",Rc=x.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,forceMount:o,children:i,...s}=e,l=la(Oc,r),c=Lc(l.baseId,n),d=Ic(l.baseId,n),u=n===l.value,p=x.useRef(u);return x.useEffect(()=>{const m=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(m)},[]),a.jsx(Ye,{present:o||u,children:({present:m})=>a.jsx(W.div,{"data-state":u?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!m,id:d,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:m&&i})})});Rc.displayName=Oc;function Lc(e,t){return`${e}-trigger-${t}`}function Ic(e,t){return`${e}-content-${t}`}var f_=Nc,h_=Tc,g_=Pc,x_=Rc;function b_({className:e,...t}){return a.jsx(f_,{"data-slot":"tabs",className:$("ecr-tabs",e),...t})}function __({className:e,...t}){return a.jsx(h_,{"data-slot":"tabs-list",className:$("ecr-tabs__list",e),...t})}function Mc({className:e,...t}){return a.jsx(g_,{"data-slot":"tabs-trigger",className:$("ecr-tabs__trigger",e),...t})}function zc({className:e,...t}){return a.jsx(x_,{"data-slot":"tabs-content",className:$("ecr-tabs__content",e),...t})}const Ut=({label:e,text:t})=>a.jsxs(Je,{children:[a.jsx(Ze,{style:{textAlign:"left",padding:0,backgroundColor:"transparent"},children:a.jsxs("label",{className:"ecr-admin-switch",children:[a.jsxs("span",{className:"ecr-admin-switch__label",children:[e,": ",a.jsx(at,{size:20})]}),a.jsx(mb,{className:"ecr-admin-switch__icon",size:24})]})}),a.jsx(Qe,{className:"ecr-admin-popover",children:a.jsx(ft,{name:e,text:t})})]});function Dc(e,[t,r]){return Math.min(r,Math.max(t,e))}function v_(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 $c=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"}),y_="VisuallyHidden",w_=x.forwardRef((e,t)=>a.jsx(W.span,{...e,ref:t,style:{...$c,...e.style}}));w_.displayName=y_;var j_=[" ","Enter","ArrowUp","ArrowDown"],k_=[" ","Enter"],gt="Select",[Tn,An,S_]=_c(gt),[Ht]=Ve(gt,[S_,on]),Pn=on(),[C_,tt]=Ht(gt),[N_,E_]=Ht(gt),Fc=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:o,onOpenChange:i,value:s,defaultValue:l,onValueChange:c,dir:d,name:u,autoComplete:p,disabled:m,required:g,form:b}=e,f=Pn(t),[h,v]=x.useState(null),[y,w]=x.useState(null),[j,C]=x.useState(!1),N=aa(d),[S,E]=mt({prop:n,defaultProp:o??!1,onChange:i,caller:gt}),[T,A]=mt({prop:s,defaultProp:l,onChange:c,caller:gt}),R=x.useRef(null),L=h?b||!!h.closest("form"):!0,[B,M]=x.useState(new Set),O=Array.from(B).map(P=>P.props.value).join(";");return a.jsx(Ys,{...f,children:a.jsxs(C_,{required:g,scope:t,trigger:h,onTriggerChange:v,valueNode:y,onValueNodeChange:w,valueNodeHasChildren:j,onValueNodeHasChildrenChange:C,contentId:Ae(),value:T,onValueChange:A,open:S,onOpenChange:E,dir:N,triggerPointerDownPosRef:R,disabled:m,children:[a.jsx(Tn.Provider,{scope:t,children:a.jsx(N_,{scope:e.__scopeSelect,onNativeOptionAdd:x.useCallback(P=>{M(z=>new Set(z).add(P))},[]),onNativeOptionRemove:x.useCallback(P=>{M(z=>{const I=new Set(z);return I.delete(P),I})},[]),children:r})}),L?a.jsxs(ld,{"aria-hidden":!0,required:g,tabIndex:-1,name:u,autoComplete:p,value:T,onChange:P=>A(P.target.value),disabled:m,form:b,children:[T===void 0?a.jsx("option",{value:""}):null,Array.from(B)]},O):null]})})};Fc.displayName=gt;var Bc="SelectTrigger",Uc=x.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...o}=e,i=Pn(r),s=tt(Bc,r),l=s.disabled||n,c=J(t,s.onTriggerChange),d=An(r),u=x.useRef("touch"),[p,m,g]=dd(f=>{const h=d().filter(w=>!w.disabled),v=h.find(w=>w.value===s.value),y=ud(h,f,v);y!==void 0&&s.onValueChange(y.value)}),b=f=>{l||(s.onOpenChange(!0),g()),f&&(s.triggerPointerDownPosRef.current={x:Math.round(f.pageX),y:Math.round(f.pageY)})};return a.jsx(Lo,{asChild:!0,...i,children:a.jsx(W.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":cd(s.value)?"":void 0,...o,ref:c,onClick:H(o.onClick,f=>{f.currentTarget.focus(),u.current!=="mouse"&&b(f)}),onPointerDown:H(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:H(o.onKeyDown,f=>{const h=p.current!=="";!(f.ctrlKey||f.altKey||f.metaKey)&&f.key.length===1&&m(f.key),!(h&&f.key===" ")&&j_.includes(f.key)&&(b(),f.preventDefault())})})})});Uc.displayName=Bc;var Hc="SelectValue",Vc=x.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,children:i,placeholder:s="",...l}=e,c=tt(Hc,r),{onValueNodeHasChildrenChange:d}=c,u=i!==void 0,p=J(t,c.onValueNodeChange);return le(()=>{d(u)},[d,u]),a.jsx(W.span,{...l,ref:p,style:{pointerEvents:"none"},children:cd(c.value)?a.jsx(a.Fragment,{children:s}):i})});Vc.displayName=Hc;var T_="SelectIcon",Wc=x.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...o}=e;return a.jsx(W.span,{"aria-hidden":!0,...o,ref:t,children:n||"▼"})});Wc.displayName=T_;var A_="SelectPortal",qc=e=>a.jsx(an,{asChild:!0,...e});qc.displayName=A_;var xt="SelectContent",Gc=x.forwardRef((e,t)=>{const r=tt(xt,e.__scopeSelect),[n,o]=x.useState();if(le(()=>{o(new DocumentFragment)},[]),!r.open){const i=n;return i?xr.createPortal(a.jsx(Kc,{scope:e.__scopeSelect,children:a.jsx(Tn.Slot,{scope:e.__scopeSelect,children:a.jsx("div",{children:e.children})})}),i):null}return a.jsx(Yc,{...e,ref:t})});Gc.displayName=xt;var Ce=10,[Kc,rt]=Ht(xt),P_="SelectContentImpl",O_=st("SelectContent.RemoveScroll"),Yc=x.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:s,side:l,sideOffset:c,align:d,alignOffset:u,arrowPadding:p,collisionBoundary:m,collisionPadding:g,sticky:b,hideWhenDetached:f,avoidCollisions:h,...v}=e,y=tt(xt,r),[w,j]=x.useState(null),[C,N]=x.useState(null),S=J(t,F=>j(F)),[E,T]=x.useState(null),[A,R]=x.useState(null),L=An(r),[B,M]=x.useState(!1),O=x.useRef(!1);x.useEffect(()=>{if(w)return Mo(w)},[w]),bo();const P=x.useCallback(F=>{const[Y,...se]=L().map(ae=>ae.ref.current),[Z]=se.slice(-1),ee=document.activeElement;for(const ae of F)if(ae===ee||(ae?.scrollIntoView({block:"nearest"}),ae===Y&&C&&(C.scrollTop=0),ae===Z&&C&&(C.scrollTop=C.scrollHeight),ae?.focus(),document.activeElement!==ee))return},[L,C]),z=x.useCallback(()=>P([E,w]),[P,E,w]);x.useEffect(()=>{B&&z()},[B,z]);const{onOpenChange:I,triggerPointerDownPosRef:q}=y;x.useEffect(()=>{if(w){let F={x:0,y:0};const Y=Z=>{F={x:Math.abs(Math.round(Z.pageX)-(q.current?.x??0)),y:Math.abs(Math.round(Z.pageY)-(q.current?.y??0))}},se=Z=>{F.x<=10&&F.y<=10?Z.preventDefault():w.contains(Z.target)||I(!1),document.removeEventListener("pointermove",Y),q.current=null};return q.current!==null&&(document.addEventListener("pointermove",Y),document.addEventListener("pointerup",se,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Y),document.removeEventListener("pointerup",se,{capture:!0})}}},[w,I,q]),x.useEffect(()=>{const F=()=>I(!1);return window.addEventListener("blur",F),window.addEventListener("resize",F),()=>{window.removeEventListener("blur",F),window.removeEventListener("resize",F)}},[I]);const[te,oe]=dd(F=>{const Y=L().filter(ee=>!ee.disabled),se=Y.find(ee=>ee.ref.current===document.activeElement),Z=ud(Y,F,se);Z&&setTimeout(()=>Z.ref.current.focus())}),ge=x.useCallback((F,Y,se)=>{const Z=!O.current&&!se;(y.value!==void 0&&y.value===Y||Z)&&(T(F),Z&&(O.current=!0))},[y.value]),_e=x.useCallback(()=>w?.focus(),[w]),pe=x.useCallback((F,Y,se)=>{const Z=!O.current&&!se;(y.value!==void 0&&y.value===Y||Z)&&R(F)},[y.value]),K=n==="popper"?ca:Xc,de=K===ca?{side:l,sideOffset:c,align:d,alignOffset:u,arrowPadding:p,collisionBoundary:m,collisionPadding:g,sticky:b,hideWhenDetached:f,avoidCollisions:h}:{};return a.jsx(Kc,{scope:r,content:w,viewport:C,onViewportChange:N,itemRefCallback:ge,selectedItem:E,onItemLeave:_e,itemTextRefCallback:pe,focusSelectedItem:z,selectedItemText:A,position:n,isPositioned:B,searchRef:te,children:a.jsx(hn,{as:O_,allowPinchZoom:!0,children:a.jsx(Gr,{asChild:!0,trapped:y.open,onMountAutoFocus:F=>{F.preventDefault()},onUnmountAutoFocus:H(o,F=>{y.trigger?.focus({preventScroll:!0}),F.preventDefault()}),children:a.jsx(qr,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:F=>F.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:a.jsx(K,{role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed",dir:y.dir,onContextMenu:F=>F.preventDefault(),...v,...de,onPlaced:()=>M(!0),ref:S,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:H(v.onKeyDown,F=>{const Y=F.ctrlKey||F.altKey||F.metaKey;if(F.key==="Tab"&&F.preventDefault(),!Y&&F.key.length===1&&oe(F.key),["ArrowUp","ArrowDown","Home","End"].includes(F.key)){let Z=L().filter(ee=>!ee.disabled).map(ee=>ee.ref.current);if(["ArrowUp","End"].includes(F.key)&&(Z=Z.slice().reverse()),["ArrowUp","ArrowDown"].includes(F.key)){const ee=F.target,ae=Z.indexOf(ee);Z=Z.slice(ae+1)}setTimeout(()=>P(Z)),F.preventDefault()}})})})})})})});Yc.displayName=P_;var R_="SelectItemAlignedPosition",Xc=x.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...o}=e,i=tt(xt,r),s=rt(xt,r),[l,c]=x.useState(null),[d,u]=x.useState(null),p=J(t,S=>u(S)),m=An(r),g=x.useRef(!1),b=x.useRef(!0),{viewport:f,selectedItem:h,selectedItemText:v,focusSelectedItem:y}=s,w=x.useCallback(()=>{if(i.trigger&&i.valueNode&&l&&d&&f&&h&&v){const S=i.trigger.getBoundingClientRect(),E=d.getBoundingClientRect(),T=i.valueNode.getBoundingClientRect(),A=v.getBoundingClientRect();if(i.dir!=="rtl"){const ee=A.left-E.left,ae=T.left-ee,ve=S.left-ae,bt=S.width+ve,_a=Math.max(bt,E.width),va=window.innerWidth-Ce,ya=Dc(ae,[Ce,Math.max(Ce,va-_a)]);l.style.minWidth=bt+"px",l.style.left=ya+"px"}else{const ee=E.right-A.right,ae=window.innerWidth-T.right-ee,ve=window.innerWidth-S.right-ae,bt=S.width+ve,_a=Math.max(bt,E.width),va=window.innerWidth-Ce,ya=Dc(ae,[Ce,Math.max(Ce,va-_a)]);l.style.minWidth=bt+"px",l.style.right=ya+"px"}const R=m(),L=window.innerHeight-Ce*2,B=f.scrollHeight,M=window.getComputedStyle(d),O=parseInt(M.borderTopWidth,10),P=parseInt(M.paddingTop,10),z=parseInt(M.borderBottomWidth,10),I=parseInt(M.paddingBottom,10),q=O+P+B+I+z,te=Math.min(h.offsetHeight*5,q),oe=window.getComputedStyle(f),ge=parseInt(oe.paddingTop,10),_e=parseInt(oe.paddingBottom,10),pe=S.top+S.height/2-Ce,K=L-pe,de=h.offsetHeight/2,F=h.offsetTop+de,Y=O+P+F,se=q-Y;if(Y<=pe){const ee=R.length>0&&h===R[R.length-1].ref.current;l.style.bottom="0px";const ae=d.clientHeight-f.offsetTop-f.offsetHeight,ve=Math.max(K,de+(ee?_e:0)+ae+z),bt=Y+ve;l.style.height=bt+"px"}else{const ee=R.length>0&&h===R[0].ref.current;l.style.top="0px";const ve=Math.max(pe,O+f.offsetTop+(ee?ge:0)+de)+se;l.style.height=ve+"px",f.scrollTop=Y-pe+f.offsetTop}l.style.margin=`${Ce}px 0`,l.style.minHeight=te+"px",l.style.maxHeight=L+"px",n?.(),requestAnimationFrame(()=>g.current=!0)}},[m,i.trigger,i.valueNode,l,d,f,h,v,i.dir,n]);le(()=>w(),[w]);const[j,C]=x.useState();le(()=>{d&&C(window.getComputedStyle(d).zIndex)},[d]);const N=x.useCallback(S=>{S&&b.current===!0&&(w(),y?.(),b.current=!1)},[w,y]);return a.jsx(I_,{scope:r,contentWrapper:l,shouldExpandOnScrollRef:g,onScrollButtonChange:N,children:a.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:j},children:a.jsx(W.div,{...o,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});Xc.displayName=R_;var L_="SelectPopperPosition",ca=x.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:o=Ce,...i}=e,s=Pn(r);return a.jsx(Xs,{...s,...i,ref:t,align:n,collisionPadding:o,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});ca.displayName=L_;var[I_,da]=Ht(xt,{}),ua="SelectViewport",Jc=x.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...o}=e,i=rt(ua,r),s=da(ua,r),l=J(t,i.onViewportChange),c=x.useRef(0);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),a.jsx(Tn.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:H(o.onScroll,d=>{const u=d.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:m}=s;if(m?.current&&p){const g=Math.abs(c.current-u.scrollTop);if(g>0){const b=window.innerHeight-Ce*2,f=parseFloat(p.style.minHeight),h=parseFloat(p.style.height),v=Math.max(f,h);if(v<b){const y=v+g,w=Math.min(b,y),j=y-w;p.style.height=w+"px",p.style.bottom==="0px"&&(u.scrollTop=j>0?j:0,p.style.justifyContent="flex-end")}}}c.current=u.scrollTop})})})]})});Jc.displayName=ua;var Zc="SelectGroup",[M_,z_]=Ht(Zc),D_=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=Ae();return a.jsx(M_,{scope:r,id:o,children:a.jsx(W.div,{role:"group","aria-labelledby":o,...n,ref:t})})});D_.displayName=Zc;var Qc="SelectLabel",$_=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=z_(Qc,r);return a.jsx(W.div,{id:o.id,...n,ref:t})});$_.displayName=Qc;var On="SelectItem",[F_,ed]=Ht(On),td=x.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:o=!1,textValue:i,...s}=e,l=tt(On,r),c=rt(On,r),d=l.value===n,[u,p]=x.useState(i??""),[m,g]=x.useState(!1),b=J(t,y=>c.itemRefCallback?.(y,n,o)),f=Ae(),h=x.useRef("touch"),v=()=>{o||(l.onValueChange(n),l.onOpenChange(!1))};if(n==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return a.jsx(F_,{scope:r,value:n,disabled:o,textId:f,isSelected:d,onItemTextChange:x.useCallback(y=>{p(w=>w||(y?.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,...s,ref:b,onFocus:H(s.onFocus,()=>g(!0)),onBlur:H(s.onBlur,()=>g(!1)),onClick:H(s.onClick,()=>{h.current!=="mouse"&&v()}),onPointerUp:H(s.onPointerUp,()=>{h.current==="mouse"&&v()}),onPointerDown:H(s.onPointerDown,y=>{h.current=y.pointerType}),onPointerMove:H(s.onPointerMove,y=>{h.current=y.pointerType,o?c.onItemLeave?.():h.current==="mouse"&&y.currentTarget.focus({preventScroll:!0})}),onPointerLeave:H(s.onPointerLeave,y=>{y.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:H(s.onKeyDown,y=>{c.searchRef?.current!==""&&y.key===" "||(k_.includes(y.key)&&v(),y.key===" "&&y.preventDefault())})})})})});td.displayName=On;var gr="SelectItemText",rd=x.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,...i}=e,s=tt(gr,r),l=rt(gr,r),c=ed(gr,r),d=E_(gr,r),[u,p]=x.useState(null),m=J(t,v=>p(v),c.onItemTextChange,v=>l.itemTextRefCallback?.(v,c.value,c.disabled)),g=u?.textContent,b=x.useMemo(()=>a.jsx("option",{value:c.value,disabled:c.disabled,children:g},c.value),[c.disabled,c.value,g]),{onNativeOptionAdd:f,onNativeOptionRemove:h}=d;return le(()=>(f(b),()=>h(b)),[f,h,b]),a.jsxs(a.Fragment,{children:[a.jsx(W.span,{id:c.textId,...i,ref:m}),c.isSelected&&s.valueNode&&!s.valueNodeHasChildren?xr.createPortal(i.children,s.valueNode):null]})});rd.displayName=gr;var nd="SelectItemIndicator",od=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return ed(nd,r).isSelected?a.jsx(W.span,{"aria-hidden":!0,...n,ref:t}):null});od.displayName=nd;var pa="SelectScrollUpButton",ad=x.forwardRef((e,t)=>{const r=rt(pa,e.__scopeSelect),n=da(pa,e.__scopeSelect),[o,i]=x.useState(!1),s=J(t,n.onScrollButtonChange);return le(()=>{if(r.viewport&&r.isPositioned){let l=function(){const d=c.scrollTop>0;i(d)};const c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),o?a.jsx(sd,{...e,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});ad.displayName=pa;var ma="SelectScrollDownButton",id=x.forwardRef((e,t)=>{const r=rt(ma,e.__scopeSelect),n=da(ma,e.__scopeSelect),[o,i]=x.useState(!1),s=J(t,n.onScrollButtonChange);return le(()=>{if(r.viewport&&r.isPositioned){let l=function(){const d=c.scrollHeight-c.clientHeight,u=Math.ceil(c.scrollTop)<d;i(u)};const c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),o?a.jsx(sd,{...e,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});id.displayName=ma;var sd=x.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...o}=e,i=rt("SelectScrollButton",r),s=x.useRef(null),l=An(r),c=x.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return x.useEffect(()=>()=>c(),[c]),le(()=>{l().find(u=>u.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),a.jsx(W.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:H(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(n,50))}),onPointerMove:H(o.onPointerMove,()=>{i.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(n,50))}),onPointerLeave:H(o.onPointerLeave,()=>{c()})})}),B_="SelectSeparator",U_=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return a.jsx(W.div,{"aria-hidden":!0,...n,ref:t})});U_.displayName=B_;var fa="SelectArrow",H_=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=Pn(r),i=tt(fa,r),s=rt(fa,r);return i.open&&s.position==="popper"?a.jsx(Js,{...o,...n,ref:t}):null});H_.displayName=fa;var V_="SelectBubbleInput",ld=x.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const o=x.useRef(null),i=J(n,o),s=v_(t);return x.useEffect(()=>{const l=o.current;if(!l)return;const c=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(c,"value").set;if(s!==t&&u){const p=new Event("change",{bubbles:!0});u.call(l,t),l.dispatchEvent(p)}},[s,t]),a.jsx(W.select,{...r,style:{...$c,...r.style},ref:i,defaultValue:t})});ld.displayName=V_;function cd(e){return e===""||e===void 0}function dd(e){const t=We(e),r=x.useRef(""),n=x.useRef(0),o=x.useCallback(s=>{const l=r.current+s;t(l),(function c(d){r.current=d,window.clearTimeout(n.current),d!==""&&(n.current=window.setTimeout(()=>c(""),1e3))})(l)},[t]),i=x.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return x.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,o,i]}function ud(e,t,r){const o=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,i=r?e.indexOf(r):-1;let s=W_(e,Math.max(i,0));o.length===1&&(s=s.filter(d=>d!==r));const c=s.find(d=>d.textValue.toLowerCase().startsWith(o.toLowerCase()));return c!==r?c:void 0}function W_(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var q_=Fc,G_=Uc,K_=Vc,Y_=Wc,X_=qc,J_=Gc,Z_=Jc,Q_=td,ev=rd,tv=od,rv=ad,nv=id;function Vt({...e}){return a.jsx(q_,{"data-slot":"select",...e})}function Wt({...e}){return a.jsx(K_,{"data-slot":"select-value",...e})}function qt({className:e,size:t="default",children:r,...n}){return a.jsxs(G_,{"data-slot":"select-trigger","data-size":t,className:$("ecr-select__trigger",e),...n,children:[r,a.jsx(Y_,{asChild:!0,children:a.jsx(Yn,{className:"ecr-select__icon"})})]})}function Gt({className:e,children:t,position:r="popper",align:n="center",...o}){const i=typeof document<"u"?document.getElementById("ecommreels-admin-app")??document.body:void 0;return a.jsx(X_,{container:i,children:a.jsxs(J_,{"data-slot":"select-content",className:$("ecr-select__content",e),position:r,align:n,...o,children:[a.jsx(ov,{}),a.jsx(Z_,{className:$("ecr-select__viewport"),children:t}),a.jsx(av,{})]})})}function Kt({className:e,children:t,...r}){return a.jsxs(Q_,{"data-slot":"select-item",className:$("ecr-select__item",e),...r,children:[a.jsx("span",{className:"ecr-select__check",children:a.jsx(tv,{children:a.jsx(zp,{className:"ecr-select__check-icon"})})}),a.jsx(ev,{children:t})]})}function ov({className:e,...t}){return a.jsx(rv,{"data-slot":"select-scroll-up-button",className:$("ecr-select__scroll-button",e),...t,children:a.jsx(Dp,{className:"ecr-select__icon"})})}function av({className:e,...t}){return a.jsx(nv,{"data-slot":"select-scroll-down-button",className:$("ecr-select__scroll-button",e),...t,children:a.jsx(Yn,{className:"ecr-select__icon"})})}const iv=({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(Vt,{value:e,onValueChange:t,children:[a.jsx(qt,{className:"ecr-admin-control__trigger",children:a.jsx(Wt,{placeholder:"Layout"})}),a.jsx(Gt,{children:Ju.map(r=>a.jsx(Kt,{value:r.value,className:"ecr-admin-control__option",children:r.label},r.value))})]})]}),sv={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 lv(){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(Vt,{defaultValue:ti[0].value,children:[a.jsx(qt,{className:"ecr-admin-control__trigger",children:a.jsx(Wt,{placeholder:"Layout"})}),a.jsxs(Gt,{children:[ti.map(e=>a.jsx(Kt,{value:e.value,className:"ecr-admin-control__option",children:e.label},e.value)),Ku.map(e=>a.jsx("div",{children:a.jsxs(Je,{modal:!0,children:[a.jsxs(Ze,{className:"ecr-admin-control__lock-trigger",children:[a.jsx("span",{className:"ecr-admin-control__option",children:e.label}),a.jsx(at,{size:18})]}),a.jsx(Qe,{className:"ecr-admin-control__popover",children:a.jsx(ft,{name:e.label,text:sv[e.value]})})]})},e.value))]})]})]})}const cv=({styles:e,updateStyles:t})=>a.jsxs("div",{className:"ecr-admin-thumb-controls",children:[a.jsx(Ut,{label:"Disable Preview",text:a.jsx(a.Fragment,{children:"Turn off previews for a cleaner look and a more focused browsing experience!"})}),a.jsx(lv,{}),a.jsx(iv,{appearance:e?.playerAppearance??"overlay",handleLinkLayout:r=>t(n=>({...n,playerAppearance:r}))})]});var Rn="Collapsible",[dv]=Ve(Rn),[uv,ha]=dv(Rn),pd=x.forwardRef((e,t)=>{const{__scopeCollapsible:r,open:n,defaultOpen:o,disabled:i,onOpenChange:s,...l}=e,[c,d]=mt({prop:n,defaultProp:o??!1,onChange:s,caller:Rn});return a.jsx(uv,{scope:r,disabled:i,contentId:Ae(),open:c,onOpenToggle:x.useCallback(()=>d(u=>!u),[d]),children:a.jsx(W.div,{"data-state":xa(c),"data-disabled":i?"":void 0,...l,ref:t})})});pd.displayName=Rn;var md="CollapsibleTrigger",fd=x.forwardRef((e,t)=>{const{__scopeCollapsible:r,...n}=e,o=ha(md,r);return a.jsx(W.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":xa(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...n,ref:t,onClick:H(e.onClick,o.onOpenToggle)})});fd.displayName=md;var ga="CollapsibleContent",hd=x.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=ha(ga,e.__scopeCollapsible);return a.jsx(Ye,{present:r||o.open,children:({present:i})=>a.jsx(pv,{...n,ref:t,present:i})})});hd.displayName=ga;var pv=x.forwardRef((e,t)=>{const{__scopeCollapsible:r,present:n,children:o,...i}=e,s=ha(ga,r),[l,c]=x.useState(n),d=x.useRef(null),u=J(t,d),p=x.useRef(0),m=p.current,g=x.useRef(0),b=g.current,f=s.open||l,h=x.useRef(f),v=x.useRef(void 0);return x.useEffect(()=>{const y=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(y)},[]),le(()=>{const y=d.current;if(y){v.current=v.current||{transitionDuration:y.style.transitionDuration,animationName:y.style.animationName},y.style.transitionDuration="0s",y.style.animationName="none";const w=y.getBoundingClientRect();p.current=w.height,g.current=w.width,h.current||(y.style.transitionDuration=v.current.transitionDuration,y.style.animationName=v.current.animationName),c(n)}},[s.open,n]),a.jsx(W.div,{"data-state":xa(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!f,...i,ref:u,style:{"--radix-collapsible-content-height":m?`${m}px`:void 0,"--radix-collapsible-content-width":b?`${b}px`:void 0,...e.style},children:f&&o})});function xa(e){return e?"open":"closed"}var mv=pd,fv=fd,hv=hd;function gd({className:e,...t}){return a.jsx(mv,{"data-slot":"collapsible",className:$("ecr-collapsible",e),...t})}function xd({className:e,children:t,...r}){return a.jsxs(fv,{"data-slot":"collapsible-trigger",className:$("ecr-collapsible__trigger",e),...r,children:[a.jsx("span",{className:"ecr-collapsible__trigger-label",children:t}),a.jsx(Yn,{className:"ecr-collapsible__trigger-icon"})]})}function bd({className:e,...t}){return a.jsx(hv,{"data-slot":"collapsible-content",className:$("ecr-collapsible__content",e),...t})}const gv={modern:a.jsx(a.Fragment,{children:"Give your reel’s product card a sleek, modern appearance that feels fresh, clean, and visually engaging."}),classic:a.jsx(a.Fragment,{children:"Give your reel’s product card a timeless, classic appearance that feels familiar, simple, and easy to recognize."})},xv=({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(Vt,{value:e,onValueChange:t,children:[a.jsx(qt,{className:"ecr-admin-control__trigger",children:a.jsx(Wt,{placeholder:"Layout"})}),a.jsxs(Gt,{children:[Yu.map(r=>a.jsx(Kt,{value:r.value,className:"ecr-admin-control__option",children:r.label},r.value)),Xu.map(r=>a.jsx("div",{children:a.jsxs(Je,{modal:!0,children:[a.jsxs(Ze,{className:"ecr-admin-control__lock-trigger",children:[a.jsx("span",{className:"ecr-admin-control__option",children:r.label}),a.jsx(at,{size:18})]}),a.jsx(Qe,{className:"ecr-admin-control__popover",children:a.jsx(ft,{name:r.label,text:gv[r.value]})})]})},r.value))]})]})]}),bv=[{Icon:Vp,label:"Desktop",value:"desktop"},{Icon:Yp,label:"Tab",value:"tab"},{Icon:qp,label:"Mobile",value:"mobile"}],_d=({label:e,min:t,max:r,value:n,onChange:o,name:i,id:s,wrapperStyles:l,hideSlider:c,device:d,setDevice:u})=>{const[p,m]=_.useState(n),g=_.useRef(null);_.useEffect(()=>{m(n)},[n]);const b=h=>{const v=Math.min(r,Math.max(t,Number(h)));o(v)},f=h=>{const v=Number(h);m(v),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{b(v>r?r:v<t?t:v)},1e3)};return a.jsxs("div",{style:l,className:"ecr-admin-range",children:[a.jsxs("label",{htmlFor:s,className:"ecr-admin-range__label",children:[e,":",a.jsxs(Vt,{value:d,onValueChange:h=>u(h),children:[a.jsx(qt,{style:{padding:"4px 4px 0px",height:"24px",gap:"4px"},children:a.jsx(Wt,{})}),a.jsx(Gt,{style:{minWidth:"60px"},children:bv.map(h=>a.jsx(Kt,{value:h.value,title:h.label,children:a.jsx(h.Icon,{size:16})},h.value))})]})]}),a.jsxs("div",{className:"ecr-admin-range__row",children:[!c&&a.jsx("input",{type:"range",id:s,name:i,min:t,max:r,value:n,onChange:h=>{const v=Number(h.target.value);m(v),b(v)},className:"ecr-admin-range__slider"}),a.jsxs("div",{className:"ecr-admin-range__value",children:[a.jsx(ea,{type:"number",min:t,max:r,value:p,onChange:h=>f(h.target.value)}),a.jsx("span",{className:"ecr-admin-range__unit",children:"px"})]})]})]})},_v=({styles:e,updateStyles:t})=>{const[r,n]=_.useState("desktop"),i={mobile:e?.gapOnMobile,tab:e?.gapOnTab,desktop:e?.gap}[r]??e?.gap,s=l=>{switch(r){case"mobile":t(c=>({...c,gapOnMobile:l}));break;case"tab":t(c=>({...c,gapOnTab:l}));break;default:t(c=>({...c,gap:l}));break}};return a.jsx(_d,{label:"Gap",min:0,max:80,value:i,onChange:s,name:"column_gap",id:"column-gap",device:r,setDevice:n})},vv=({styles:e,updateStyles:t})=>{const[r,n]=_.useState("desktop"),i={mobile:e?.sizeOnMobile,tab:e?.sizeOnTab,desktop:e?.size}[r]??e?.size,s=l=>{switch(r){case"mobile":t(c=>({...c,sizeOnMobile:l}));break;case"tab":t(c=>({...c,sizeOnTab:l}));break;default:t(c=>({...c,size:l}));break}};return a.jsx(_d,{label:"Size",min:150,max:400,value:i,onChange:s,name:"size",id:"size",device:r,setDevice:n})},yv=[{value:"rectangle",label:"Rectangle"},{value:"circle",label:"Circle"}],wv=({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:yv.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(bm,{color:"#2563eb",size:16}):a.jsx(_m,{color:"#8c95a9",size:16}),n.label]})]},n.value))})]})},jv=Object.values(ei),kv={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!"})},Sv=({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(Vt,{value:e,onValueChange:t,children:[a.jsx(qt,{className:"ecr-admin-control__trigger",children:a.jsx(Wt,{placeholder:"Layout"})}),a.jsxs(Gt,{children:[jv.map(r=>a.jsx(Kt,{value:r,className:"ecr-admin-control__option",children:r},r)),qu.map(r=>a.jsx("div",{children:a.jsxs(Je,{modal:!0,children:[a.jsxs(Ze,{className:"ecr-admin-control__lock-trigger",children:[a.jsx("span",{className:"ecr-admin-control__option",children:r}),a.jsx(at,{size:18})]}),a.jsx(Qe,{className:"ecr-admin-control__popover",children:a.jsx(ft,{name:r,text:kv[r]})})]})},r))]})]})]}),Cv=({isLayoutOpen:e,handleSectionOpen:t,styles:r,updateStyles:n})=>a.jsxs(gd,{open:e,className:"ecr-admin-thumb-controls__section",children:[a.jsxs(xd,{className:"ecr-admin-thumb-controls__section-trigger",type:"button",onClick:()=>t("layout"),children:[a.jsx(Bp,{size:16})," ",a.jsx("span",{children:"Layout"})]}),a.jsxs(bd,{className:"ecr-admin-thumb-controls__section-content",children:[a.jsx(wv,{selectedShape:r?.shape,handleShape:o=>n(i=>({...i,shape:o}))}),a.jsx(Sv,{selectedLayout:r?.template??"carousel",handleLayout:o=>n(i=>({...i,template:o}))}),a.jsx(xv,{linkLayout:r?.appearance??"overlay",handleLinkLayout:o=>n(i=>({...i,appearance:o}))}),a.jsx(vv,{styles:r,updateStyles:n}),a.jsx(_v,{styles:r,updateStyles:n}),a.jsx(Ut,{label:"Show Ratings",text:a.jsx(a.Fragment,{children:"Hide Ratings to remove distractions and provide a cleaner, more focused visual experience!"})}),a.jsx(Ut,{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(Ut,{label:"Autoplay",text:a.jsx(a.Fragment,{children:"Enable autoplay for videos on your product and pages, capturing users' attention instantly!"})}),a.jsx(Ut,{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(Ut,{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!"})})]})]}),Nv=({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(Vt,{value:e,onValueChange:t,children:[a.jsx(qt,{className:"ecr-admin-control__trigger",children:a.jsx(Wt,{placeholder:"Layout"})}),a.jsx(Gt,{children:Gu.map(r=>a.jsx(Kt,{value:r.value,className:"ecr-admin-control__option",children:r.label},r.value))})]})]}),Ev=({isStyleOpen:e,handleSectionOpen:t,styles:r,updateStyles:n})=>a.jsxs(gd,{open:e,className:"ecr-admin-thumb-controls__section",children:[a.jsxs(xd,{className:"ecr-admin-thumb-controls__section-trigger",type:"button",onClick:()=>t("style"),children:[a.jsx(Wp,{size:16}),a.jsx("span",{children:"Styles"})]}),a.jsxs(bd,{className:"ecr-admin-thumb-controls__section-content",children:[a.jsx(ta,{label:"Border Width",min:0,max:12,value:r?.border?.border_width??0,onChange:o=>n(i=>({...i,border:{...i.border,border_width:o}})),name:"border_width",id:"border-width"}),a.jsx(pc,{selectedColor:r?.border?.border_color,handleColor:o=>n(i=>({...i,border:{...i.border,border_color:o}})),text:"Border Color"}),r?.shape==="rectangle"&&a.jsx(ta,{label:"Border Radius",min:0,max:99,value:r?.border?.border_radius??0,onChange:o=>n(i=>({...i,border:{...i.border,border_radius:o}})),name:"border_radius",id:"border-radius"}),a.jsx(Nv,{hoverEffect:r?.hoverEffect||"none",handleHoverEffect:o=>n(i=>({...i,hoverEffect:o}))})]})]}),Tv=({styles:e,updateStyles:t})=>{const[r,n]=_.useState("layout"),o=r==="layout",i=r==="style",s=l=>{n(r!==l?l:null)};return a.jsxs("div",{className:"ecr-admin-thumb-controls",children:[a.jsx(Cv,{handleSectionOpen:s,isLayoutOpen:o,styles:e,updateStyles:t}),a.jsx(Ev,{isStyleOpen:i,handleSectionOpen:s,styles:e,updateStyles:t})]})},Av=({styles:e,setStyles:t,isExpanded:r,setIsExpanded:n,setIsEdited:o,tabs:i,currentTab:s,setCurrentTab:l})=>{const c=u=>{t(p=>{const m=u(p);return o(!0),m})},d=u=>{(u===i.thumbnail||u===i.preview)&&l(u)};return a.jsxs("div",{className:$("ecr-admin-sidepanel",r?"ecr-admin-sidepanel--expanded":"ecr-admin-sidepanel--collapsed"),children:[r&&a.jsx("div",{className:"ecr-admin-mobile-overlay",onClick:()=>n(!1)}),a.jsxs("div",{className:"ecr-admin-sidepanel-content",children:[a.jsxs("div",{className:"ecr-admin-sidepanel__header",children:[a.jsx("p",{className:"ecr-admin-sidepanel__title",children:"Customization"}),a.jsx("small",{className:"ecr-admin-sidepanel__subtitle",children:"Customize your widget however you like"})]}),a.jsx("div",{className:"ecr-admin-sidepanel__body",children:a.jsxs(b_,{value:s,onValueChange:d,className:"ecr-admin-sidepanel__tabs",children:[a.jsxs(__,{className:"ecr-admin-sidepanel__tabs-list",children:[a.jsx(Mc,{value:i.thumbnail,children:"Thumbnail"}),a.jsx(Mc,{value:i.preview,children:"Preview"})]}),a.jsx(zc,{value:i.thumbnail,children:a.jsx(Tv,{styles:e,updateStyles:c})}),a.jsx(zc,{value:i.preview,children:a.jsx(cv,{styles:e,updateStyles:c})})]})})]})]})},Pv=e=>{const t=Ne(),[r,n]=_.useState(""),[o,i]=_.useState([]),[s,l]=_.useState(ot),[c,d]=_.useState(!0),[u,p]=_.useState(!1),[m,g]=_.useState(!1);_.useEffect(()=>{(async()=>{if(!e){d(!1);return}d(!0);try{const y=(await he.get(`stories/${e}`)).data;n(y.group_name),i(y.stories),l(y.styles??ot)}catch(v){v instanceof Error?G.error(v.message):G.error("Something went wrong. Try again later!")}finally{d(!1)}})()},[e]);const b=async h=>{const v=o.map(j=>j.id),y={group_name:r,styles:s,story_ids:v};e&&(y.group_id=e);const w=await he.post("stories/manage-group-stories",y);if(!e){const j=w.data.group_id;t(`?view=${X.mg}&gid=${j}`,{replace:!0})}return{...w.data,isNewGroup:!e}};return{groupTitle:r,setGroupTitle:n,thisGroupReels:o,setThisGroupReels:i,styles:s,setStyles:l,isLoading:c,isSaving:u,isEdited:m,setIsEdited:g,handleSave:async()=>{try{p(!0);const h=await b();return g(!1),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)}}}},Ov=e=>{const[t,r]=_.useState(!1),n=_.useRef(null),o=_.useRef(null),i=_.useRef(!1),s=_.useRef(typeof window<"u"?window.location.hash:"");return _.useEffect(()=>{e||(n.current=null,o.current=null,r(!1))},[e]),_.useEffect(()=>{if(!e)return;const p=m=>{m.preventDefault(),m.returnValue=""};return window.addEventListener("beforeunload",p),()=>window.removeEventListener("beforeunload",p)},[e]),_.useEffect(()=>{const p=()=>{const m=window.location.hash;if(!e){s.current=m;return}if(i.current){i.current=!1,s.current=m;return}m!==s.current&&(o.current=m,window.location.hash=s.current,r(!0))};return window.addEventListener("hashchange",p),()=>window.removeEventListener("hashchange",p)},[e]),{showLeaveModal:t,requestLeave:p=>{if(!e){p();return}n.current=p,r(!0)},confirmLeave:()=>{if(r(!1),n.current){const p=n.current;n.current=null,i.current=!0,p();return}if(o.current){const p=o.current;o.current=null,i.current=!0,window.location.hash=p}},cancelLeave:()=>{n.current=null,o.current=null,r(!1)},allowNextNavigation:p=>{i.current=!0,p()}}},vd={thumbnail:"thumbnail",preview:"preview"},Rv=()=>{const e=Ne(),[t]=Zt(),r=t.get("gid"),n=Ar("(min-width: 1024px)"),{groupTitle:o,setGroupTitle:i,thisGroupReels:s,setThisGroupReels:l,styles:c,setStyles:d,isLoading:u,isSaving:p,isEdited:m,setIsEdited:g,handleSave:b}=Pv(r),{allReels:f,searchTerm:h,setSearchTerm:v,isSearching:y,lastStoryElementRef:w,refreshReels:j}=as(r),[C,N]=_.useState(""),[S,E]=_.useState(n),[T,A]=_.useState(vd.thumbnail),[R,L]=_.useState([]),B=_.useMemo(()=>new Set(s.map(K=>K.story_uuid)),[s]),M=_.useMemo(()=>h.trim().toLowerCase(),[h]),O=_.useMemo(()=>M?R.filter(K=>K.title.toLowerCase().includes(M)):R,[R,M]),P=_.useMemo(()=>{const K=new Map;for(const de of O)K.set(de.story_uuid,de);for(const de of f)K.has(de.story_uuid)||K.set(de.story_uuid,de);return Array.from(K.values())},[O,f]),z=_.useMemo(()=>P.filter(K=>!B.has(K.story_uuid)),[P,B]);_.useEffect(()=>{E(n)},[n]),_.useEffect(()=>{L([])},[r]);const{showLeaveModal:I,requestLeave:q,confirmLeave:te,cancelLeave:oe,allowNextNavigation:ge}=Ov(m),_e=async(K,de)=>{try{N(K.story_uuid);const F=de==="add"?[K,...s]:s.filter(Y=>Y.story_uuid!==K.story_uuid);l(F),L(de==="add"?Y=>Y.filter(se=>se.story_uuid!==K.story_uuid):Y=>Y.some(se=>se.story_uuid===K.story_uuid)?Y:[K,...Y]),g(!0)}catch(F){F instanceof Error?G.error(F.message):G.error("Something went wrong. Please try again later!")}finally{N("")}},pe=async()=>{const K=await b();K&&(L([]),j()),K?.isNewGroup&&ge(()=>{e(`?view=${X.mg}&gid=${K.group_id}`,{replace:!0})})};return u?a.jsx(Lr,{}):a.jsxs(Hb,{value:{requestLeave:q},children:[a.jsx(kt,{left:[a.jsx(St,{name:"Manage Widget",Icon:Pr},"page"),a.jsx(tr,{cb:()=>q(()=>e(`?view=${X.ag}`))},"back")],center:[a.jsxs("div",{className:"ecr-admin-group-title__wrapper",children:[a.jsx(is,{placeholder:"Enter group title",title:o,setTitle:i,setIsEdited:g,style:{paddingInline:"32px"}}),o&&a.jsxs(Go,{children:[a.jsx(Ko,{className:"ecr-admin-group-title-customization__trigger",children:a.jsx(hb,{})}),a.jsxs(Yo,{className:"ecr-admin-group-title-customization-dialog",children:[a.jsx(Xo,{children:a.jsx(Jo,{children:"Customize title appearance"})}),a.jsx(Fb,{styles:c,setStyles:d,setIsEdited:g}),a.jsx("div",{style:{display:"flex",justifyContent:"end",marginTop:40},children:a.jsx($0,{asChild:!0,children:a.jsx(ne,{style:{paddingInline:40},variant:"outline",children:"Ok"})})})]})]})]},"title")],right:[a.jsx(fb,{isExpanded:S,setIsExpanded:E},"toggle"),a.jsx(ho,{onSave:pe,isSaving:p,disabled:!m},"save")],rightClass:"ecr-admin-nav-btn-reverse"}),a.jsx(rr,{breads:[{label:"Dashboard",href:`?view=${X.ag}`},{label:"Manage Widget"}],onNavigate:K=>q(()=>e(K))}),a.jsxs("div",{className:"ecr-admin-group-edit",children:[a.jsx(Zb,{allReels:z,gid:r,handleSelectReel:_e,searchTerm:h,setSearchTerm:v,isSearching:y,togglingId:C,lastStoryElementRef:w}),a.jsx(Jb,{gid:r,reels:s,styles:c,handleRemoveReel:_e,togglingId:C,currentTab:T}),S&&a.jsx(Av,{isExpanded:S,setIsExpanded:E,setIsEdited:g,styles:c,setStyles:d,tabs:vd,setCurrentTab:A,currentTab:T})]}),I&&a.jsx(Or,{onReject:oe,onAccept:te,isLoading:!1,message:"You have unsaved changes. Leave this page without saving?"})]})};function Lv(){const[e]=Zt(),t=e.get("view")||X.ag;let r;switch(t){case X.settings:r=a.jsx(lb,{});break;case X.ar:r=a.jsx(Jf,{});break;case X.stat:r=a.jsx(ub,{});break;case X.cr:r=a.jsx(Z0,{});break;case X.mg:r=a.jsx(Rv,{});break;default:r=a.jsx(ib,{})}return a.jsxs("div",{children:[r,a.jsx(Wu,{position:"top-right",toastOptions:{style:{padding:"16px",marginTop:"24px",fontSize:"16px"}}})]})}const yd=async(e,t,r,n={})=>{try{if(await he.post(`group/${e}/story/${t}/view`),n.isActive&&!n.isActive())return;r(o=>({...o,[t]:Number(o[t]||0)+1}))}catch{}},wd=e=>!!e?.files?.[0]?.mime_type?.startsWith("video"),Iv=()=>{const e=_.useContext(ba);if(!e)throw new Error("useVideoPlayer must be used inside PublicStoryContext");const{styles:t,stories:r,groupId:n,isPlaying:o,setIsPlaying:i,setStoryViews:s}=e,[l,c]=_.useState(r.length-1),[d,u]=_.useState(null),[p,m]=_.useState(!0),[g,b]=_.useState(0),[f,h]=_.useState(!1),[v,y]=_.useState(!1),[w,j]=_.useState({index:0,story_uuid:r[0]?.story_uuid??""}),C=d?.links&&d.links.length>0?d.links[0]:null,N=t?.playerAppearance??"overlay",S=_.useRef({bodyOverflow:"",bodyPosition:"",bodyTop:"",bodyWidth:"",bodyScrollBehavior:"",htmlOverflow:"",htmlScrollBehavior:"",scrollY:0}),E=_.useCallback((O,P=1)=>{if(r.length===0)return null;let z=O;for(let I=0;I<r.length;I+=1){const q=r[z];if(wd(q))return{story:q,index:z};z=(z+P+r.length)%r.length}return null},[r]),T=_.useCallback(()=>{c(r.length-1);const O=r.findIndex(I=>String(I.story_uuid)===o),P=O>=0?r[O]:null,z=wd(P)?{story:P,index:O}:E(Math.max(O,0),1);if(!z?.story){u(null),m(!1);return}u(z.story),O!==z.index&&z.story.story_uuid!==o&&i(z.story.story_uuid),j({index:0,story_uuid:z.story.story_uuid}),m(!1)},[E,o,i,r]);_.useEffect(()=>{T()},[T]),_.useEffect(()=>{const{body:O,documentElement:P}=document;return S.current={bodyOverflow:O.style.overflow,bodyPosition:O.style.position,bodyTop:O.style.top,bodyWidth:O.style.width,bodyScrollBehavior:O.style.scrollBehavior,htmlOverflow:P.style.overflow,htmlScrollBehavior:P.style.scrollBehavior,scrollY:window.scrollY},P.style.overflow="hidden",O.style.overflow="hidden",O.style.position="fixed",O.style.top=`-${S.current.scrollY}px`,O.style.width="100%",()=>{const z=S.current;P.style.overflow=z.htmlOverflow,O.style.overflow=z.bodyOverflow,O.style.position=z.bodyPosition,O.style.top=z.bodyTop,O.style.width=z.bodyWidth,P.style.scrollBehavior="auto",O.style.scrollBehavior="auto",window.scrollTo({top:z.scrollY,left:0,behavior:"auto"}),P.style.scrollBehavior=z.htmlScrollBehavior,O.style.scrollBehavior=z.bodyScrollBehavior}},[]);const A=_.useCallback(()=>{i(null)},[i]),R=_.useCallback((O=1)=>{m(!0);const P=r.findIndex(oe=>String(oe.story_uuid)===String(o)),z=O>0?1:-1,I=O>0?l>P?P+1:0:P>0?P-1:l,q=E(I,z);if(!q?.story){m(!1);return}const te=q.story;if(te.story_uuid===o){m(!1),A();return}j({index:0,story_uuid:te.story_uuid}),n&&yd(n,te.id,s),i(te.story_uuid),m(!1)},[A,E,n,o,l,i,s,r]),L=_.useCallback(()=>{const O=d?.files??[];if(w.index>0){j(P=>({index:P.index-1,story_uuid:O[P.index-1].story_uuid??""}));return}R(-1)},[w.index,R,d?.files]),B=_.useCallback(()=>{const O=d?.files??[];if(w.index+1<O.length){j(P=>({index:P.index+1,story_uuid:O[P.index+1].story_uuid??""}));return}R(1)},[w.index,R,d?.files]),M=_.useCallback(O=>{O.target===O.currentTarget&&A()},[A]);return{closePlayer:A,currentFileIndex:w,duration:g,handleBackdropClick:M,handleNextFile:B,handlePrevFile:L,isLoadingNext:p,isMuted:v,isPaused:f,playingStory:d,setDuration:b,setIsPaused:h,setIsMuted:y,setIsPlaying:i,firstLink:C,playerAppearance:N}},Mv=()=>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"})]})})}),zv=()=>{const e=Ar("(min-width: 1024px)"),{closePlayer:t,currentFileIndex:r,duration:n,handleBackdropClick:o,handleNextFile:i,handlePrevFile:s,isLoadingNext:l,isMuted:c,isPaused:d,playerAppearance:u,playingStory:p,firstLink:m,setDuration:g,setIsMuted:b,setIsPaused:f,setIsPlaying:h}=Iv();return a.jsx("div",{onClick:o,className:"ecommreels-story-modal ecr-player",children:p&&a.jsxs("div",{className:"ecr-player__stage",children:[a.jsx(wt,{onClick:s,className:"ecr-player__nav--left",children:a.jsx(pi,{size:24})}),a.jsx(wt,{onClick:i,className:"ecr-player__nav--right",children:a.jsx(mi,{size:24})}),a.jsxs("div",{id:"player",className:"ecr-player__frame",children:[p&&a.jsx(ci,{playingStory:p,duration:n,currentFileIndex:r,isPaused:d},`${p.story_uuid}-${r.index}`),a.jsx("div",{onClick:t,className:"ecr-player__close",children:a.jsx(er,{size:e?20:24,className:"ecr-player__close-icon"})}),l?a.jsx(Mv,{}):p?.files.length>0&&a.jsx(xi,{currentFileIndex:r,files:p?.files,setDuration:g,setIsPlaying:h,isPaused:d,setIsPaused:f,isMuted:c,setIsMuted:b,handlePrevFile:s,handleNextFile:i,storyId:p.id,storyTitle:p?.title}),u==="overlay"?m?a.jsx(Nn,{link:m,usedFor:"user",usedIn:"player",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"8px",width:"95%",borderRadius:"6px"}}):a.jsx(Bt,{title:p.title}):null,u==="title"?a.jsx(Bt,{title:p.title}):null]})]})})},jd=({story:e,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o})=>{const i=t.appearance??"overlay",s=e.links&&e.links.length>0?e.links[0]:null,l=i==="none",c=i==="title",d=t.shape==="rectangle",u=!l&&!c&&s,p=t.border.border_radius,m=p>50?p+16:p>20?p:0;return a.jsxs("div",{className:`ecr-thumb ${t.hoverEffect??""}`,children:[a.jsxs("div",{onClick:()=>r({sid:e.id,story_uuid:e.story_uuid}),className:"ecr-thumb__frame",style:{border:`${t?.border?.border_width}px solid ${t?.border?.border_color}`,borderRadius:t.shape==="rectangle"?`${t?.border?.border_radius}px`:"50%",aspectRatio:t.shape==="rectangle"?"9/16":"1/1"},children:[a.jsx(to,{story:e,styles:t,storyViews:n,setStoryViews:o}),!l&&!c&&d?u?a.jsx(Nn,{link:s,usedFor:"user",usedIn:"thumb",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"4px",width:"calc(100% - 8px)",borderRadius:"6px"}}):a.jsx(Bt,{title:e.title,styles:{width:`calc(95% - ${m}px)`}}):null]}),c?a.jsx("p",{className:"ecr-reel__title",children:e.title}):null]})},Dv=({stories:e,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o})=>{const{thumbsContainerRef:i,thumbsWrapperRef:s,isOverflowing:l,canScrollLeft:c,canScrollRight:d,scrollBy:u,scrollStep:p}=gc([e],!0);return a.jsxs("div",{className:"ecr-front-carousel",children:[a.jsx("div",{ref:i,className:"ecr-front-carousel__viewport",children:a.jsx("div",{ref:s,className:t.hoverEffect==="zoom-in"?"ecr-front-carousel__track ecr-front-carousel__track--zoom":"ecr-front-carousel__track",children:e?.map(m=>m?.files[0]?.mime_type.startsWith("video")?a.jsx(jd,{story:m,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o},m.story_uuid):null)})}),l&&c&&a.jsx("button",{onClick:()=>u(-p),className:"ecr-front-carousel__nav ecr-front-carousel__nav--left",children:a.jsx(Vn,{size:20,style:{width:"20px",height:"20px"}})}),l&&d&&a.jsx("button",{onClick:()=>u(p),className:"ecr-front-carousel__nav ecr-front-carousel__nav--right",children:a.jsx(Wn,{size:20,style:{width:"20px",height:"20px"}})})]})},kd=({stories:e,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o})=>a.jsx("div",{className:"ecr-front-grid",children:a.jsx("div",{style:{padding:t.hoverEffect==="zoom-in"?16:0},className:"ecr-front-grid__list",children:e?.map(i=>i?.files[0]?.mime_type.startsWith("video")?a.jsx(jd,{story:i,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o},i.story_uuid):null)})}),$v={carousel:Dv,grid:kd},Fv=()=>{const e=_.useContext(ba),{groupTitle:t,styles:r,stories:n,groupId:o,setIsPlaying:i,storyViews:s,setStoryViews:l}=e,c=_.useRef(!0);_.useEffect(()=>(c.current=!0,()=>{c.current=!1}),[]);const d=r.template??"carousel",u=$v[d]||kd,p=({sid:m,story_uuid:g})=>{i(g),o&&yd(o,m,l,{isActive:()=>c.current})};return a.jsxs("div",{style:{"--thumbnail-size":r.template==="grid"?"auto":`${r?.size}px`,"--thumbnail-size-grid":`${r?.size}px`,"--thumbnail-size-tab":r.template==="grid"?"auto":`${r?.sizeOnTab??r?.size}px`,"--thumbnail-size-grid-tab":`${r?.sizeOnTab??r?.size}px`,"--thumbnail-size-mobile":r.template==="grid"?"auto":`${r?.sizeOnMobile??r?.size}px`,"--thumbnail-size-grid-mobile":`${r?.sizeOnMobile??r?.size}px`,"--thumbnail-gap":`${r?.gap}px`,"--thumbnail-gap-tab":`${r?.gapOnTab??r?.gap}px`,"--thumbnail-gap-mobile":`${r?.gapOnMobile??r?.gap}px`,"--thumbnail-border-radius":`${r?.border?.border_radius}px`},children:[r?.widgetTitle&&r?.widgetTitle?.alignment!=="hidden"&&t?a.jsx("h2",{style:{textAlign:r.widgetTitle?.alignment,fontSize:r.widgetTitle?.fontSize,color:r.widgetTitle?.color,marginBottom:24},children:t}):null,a.jsx(u,{stories:n,styles:r,handlePlaying:p,storyViews:s,setStoryViews:l})]})},Bv=e=>{const[t,r]=_.useState(""),[n,o]=_.useState([]),[i,s]=_.useState(ot),[l,c]=_.useState(!1),[d,u]=_.useState(null),p=_.useCallback(async()=>{const m=e?.trim();if(!m){o([]),s(ot),c(!1),u(null);return}const g=new AbortController;c(!0),u(null);try{const b=await he.get(`stories/${m}`,{signal:g.signal});if(g.signal.aborted)return;r(b.data.group_name),o(b.data.stories),s(b.data.styles||ot)}catch(b){if(g.signal.aborted)return;u(b)}finally{c(!1)}return()=>{g.abort()}},[e]);return _.useEffect(()=>{p()},[e]),{groupTitle:t,stories:n,styles:i,isLoading:l,error:d}},ba=_.createContext(void 0),Sd=({groupId:e})=>{const[t,r]=_.useState(null),[n,o]=_.useState({}),{groupTitle:i,stories:s,styles:l}=Bv(e);return a.jsxs(ba.Provider,{value:{groupTitle:i,groupId:e,stories:s,styles:l,isPlaying:t,setIsPlaying:r,storyViews:n,setStoryViews:o},children:[t&&a.jsx(zv,{}),a.jsx(Fv,{})]})};wa(()=>{const e=document.getElementById("ecommreels-admin-app");e&&Ln.createRoot(e).render(a.jsx(eu,{children:a.jsx(Lv,{})}))}),wa(()=>{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(Sd,{groupId:o}))}),t.forEach(r=>{const n=r,o=n.dataset.id;if(!o)return;Ln.createRoot(n).render(a.jsx(Sd,{groupId:o}))})})})(React,wp.domReady,wp.element,ReactDOM);402 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",O0=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${$l(P0).contentName}}.`;return x.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},R0=Cl,L0=El,I0=Al,M0=Pl,z0=Ol,D0=Ll,Fl=zl;function Go({...e}){return a.jsx(R0,{"data-slot":"dialog",...e})}function Ko({...e}){return a.jsx(L0,{"data-slot":"dialog-trigger",...e})}function $0({...e}){const t=typeof document<"u"?document.getElementById("ecommreels-admin-app")??document.body:void 0;return a.jsx(I0,{"data-slot":"dialog-portal",container:t,...e})}function F0({className:e,...t}){return a.jsx(M0,{"data-slot":"dialog-overlay",className:$("ecr-dialog__overlay",e),...t})}function Yo({className:e,children:t,...r}){return a.jsxs($0,{children:[a.jsx(F0,{}),a.jsxs(z0,{"data-slot":"dialog-content",className:$("ecr-dialog__content",e),...r,children:[t,a.jsx(Fl,{className:"ecr-dialog__close","aria-label":"Close dialog",children:a.jsx(er,{className:"ecr-dialog__close-icon"})})]})]})}function Xo({className:e,...t}){return a.jsx("div",{className:$("ecr-dialog__header",e),...t})}function Jo({className:e,...t}){return a.jsx(D0,{"data-slot":"dialog-title",className:$("ecr-dialog__title",e),...t})}function B0({...e}){return a.jsx(Fl,{"data-slot":"dialog-close",...e})}const U0=(e={})=>{const{enabled:t=!0}=e,r=typeof ecommreelsInfo<"u"?ecommreelsInfo?.url:"",n=typeof ecommreelsInfo<"u"?ecommreelsInfo?.nonce:"",[o,i]=_.useState([]),[s,l]=_.useState(1),[c,d]=_.useState(!0),[u,p]=_.useState(!1),[m,g]=_.useState(!1),[b,f]=_.useState(""),h=fo(b,500),v=_.useRef(!0),y=_.useRef(0),w=_.useRef(null),[j,C]=_.useState(null),N=_.useCallback(async T=>{if(!r||!n){C("Missing API configuration."),g(!1),p(!1);return}const A=++y.current;w.current&&w.current.abort();const R=new AbortController;w.current=R,T===1&&v.current?g(!0):p(!0);try{const L={page:T,per_page:50};h&&(L.search=h);const B=await re.get(`${r}wc/v3/products`,{headers:{"X-WP-Nonce":n},withCredentials:!0,params:L,signal:R.signal}),M=B.data,O=parseInt(B.headers["x-wp-totalpages"]||"1",10);A===y.current&&(i(P=>T===1?M:[...P,...M]),l(T+1),d(T<O))}catch(L){if(R.signal.aborted)return;L instanceof Error?C(L.message):C("An unknown error occurred")}finally{v.current&&(v.current=!1),A===y.current&&!R.signal.aborted&&(p(!1),g(!1))}},[h,n,r]);_.useEffect(()=>{t&&(l(1),i([]),C(null),v.current=!0,N(1))},[h,N,t]);const S=_.useRef(null),E=_.useCallback(T=>{u||(S.current&&S.current.disconnect(),S.current=new IntersectionObserver(A=>{A[0].isIntersecting&&c&&N(s)}),T&&S.current.observe(T))},[u,c,s,N]);return _.useEffect(()=>()=>{S.current&&S.current.disconnect(),w.current&&w.current.abort()},[]),{products:o,setProducts:i,searchTerm:b,setSearchTerm:f,isSearching:u,isLoading:m,error:j,lastProductElementRef:E}},wn="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",Bl=({name:e,handleClick:t})=>a.jsx("button",{onClick:t,className:$("ecr-button ecr-button--sm",e==="add"?"ecr-button--primary":"ecr-button--danger"),children:e}),H0=({handleLinks:e,taggedProducts:t,products:r,isSearching:n,isLoading:o,lastProductElementRef:i,searchTerm:s,setSearchTerm:l,error:c})=>{const[d,u]=_.useState(t.map(f=>f.product_id)),[p,m]=_.useState(!1),g=f=>{m(!1),u(h=>h.includes(f.id)?h.filter(v=>v!==f.id):[f.id])},b=f=>{if(f.preventDefault(),d.length===0){m(!0);return}const h=new Set(d),v=[];for(const y of r)h.has(y.id)&&v.push({btn_type:"product",btn_uuid:_n(),buttonText:y.name,buttonUrl:y.permalink,rating:y.average_rating,price:y.price_html,thumbnail:y.images?.[0]?.thumbnail||y.images?.[0]?.src||wn,product_id:y.id});e(v),u([])};return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"ecr-admin-product-link__search",children:a.jsx("input",{type:"text",placeholder:"Search products...",value:s,onChange:f=>l(f.target.value),className:"ecr-admin-product-link__search-input"})}),a.jsx("div",{className:"scrollbarThin ecr-admin-product-link__list",children:o&&r.length===0?a.jsx(Ul,{}):a.jsxs("div",{className:"ecr-admin-product-link__list-inner",children:[r.length===0?a.jsx("p",{className:"ecr-admin-product-link__empty",children:c||"No products are available to add."}):r.map((f,h)=>{const v=d.includes(f.id);return a.jsx("div",{ref:r.length===h+1?i:null,className:"ecr-admin-product-link__item",style:d.length>0&&!v?{opacity:.5,pointerEvents:"none"}:{},children:a.jsxs(ne,{type:"button",onClick:()=>g(f),className:$("ecr-admin-product-link__button",v?"ecr-admin-product-link__button--selected":"ecr-admin-product-link__button--unselected"),children:[v?a.jsx(Yp,{size:20,color:"#2563eb"}):a.jsx(Xp,{size:20,color:"#8c95a9"}),a.jsx("img",{className:"ecr-admin-product-link__thumb",src:f.images?.[0]?.thumbnail||f.images?.[0]?.src||wn,alt:"Product thumbnail"}),a.jsx("span",{children:f.name||`Product #${f.id}`})]})},f.id)}),n&&r.length>0&&a.jsx(Ul,{})]})}),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(Bl,{name:"add",handleClick:b})})]})]})},Ul=()=>a.jsx("div",{className:"ecr-admin-product-link__loader",children:a.jsx("div",{className:"ecr-admin-product-link__spinner"})}),V0=/^(https?|ftp):\/\/[^\s/$.?#].[^\s]*$/i,W0=({handleLinks:e})=>{const[t,r]=_.useState(""),[n,o]=_.useState(""),[i,s]=_.useState(""),[l,c]=_.useState(!0),[d,u]=_.useState(""),[p,m]=_.useState([]),g=()=>{const b=[];t||b.push("text"),n&&V0.test(n)||b.push("url"),i||b.push("campaign"),m(b),!(b.length>0)&&e({btn_type:"custom",btn_uuid:_n(),buttonText:t,buttonUrl:n,openInNewTab:l,campaignName:i,customClass:d,clickCount:0})};return a.jsxs(a.Fragment,{children:[a.jsxs("div",{children:[a.jsx(jn,{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(jn,{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(jn,{error:p.includes("campaign"),type:"text",name:"campaignName",label:"Campaign Name",placeholder:"e.g Summer sale",value:i,setValue:s}),p.includes("campaign")&&a.jsx("p",{className:"ecr-admin-link__error",children:"Campaign name is required!"})]}),a.jsxs("div",{className:"ecr-admin-link__toggle",children:[a.jsx("input",{checked:l,onChange:b=>c(b.target.checked),className:"ecr-admin-link__checkbox",type:"checkbox",name:"",id:"newTab"}),a.jsx("label",{className:"ecr-admin-link__toggle-label",htmlFor:"newTab",children:"Open in new tab"})]}),a.jsx("div",{children:a.jsx(jn,{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(Bl,{name:"add",handleClick:g})})]})};function jn({error:e,type:t,name:r,label:n,placeholder:o,value:i,setValue:s}){return a.jsxs(a.Fragment,{children:[a.jsx("label",{className:"ecr-admin-link__label",htmlFor:r,children:n}),a.jsx("input",{id:r,name:r,type:t,placeholder:o,value:i,onChange:l=>s(l.target.value),className:$("ecr-admin-link__input",e?"ecr-admin-link__input--error":"ecr-admin-link__input--normal")})]})}const q0=({setLinks:e,linkCount:t,linkType:r,links:n})=>{const[o,i]=_.useState(null),[s,l]=_.useState(!1),c=U0({enabled:s}),d=t===0||r==="Link",u=t===0||r==="Product",p=n.filter(g=>g.btn_type==="product"),m=()=>l(!0);return a.jsxs(a.Fragment,{children:[t?a.jsx(bn,{}):null,a.jsx("div",{className:"ecr-admin-link-tabs",children:a.jsxs("div",{className:"ecr-admin-link-tabs__list",children:[d&&a.jsxs(Go,{open:o==="custom",onOpenChange:g=>i(g?"custom":null),children:[a.jsxs(Ko,{className:"ecr-admin-link-tabs__trigger",children:[a.jsx(Vp,{size:20})," Add Custom Link"]}),a.jsxs(Yo,{className:"ecr-admin-link-dialog",children:[a.jsx(Xo,{children:a.jsx(Jo,{children:"Add Custom Link"})}),a.jsx("div",{className:"ecr-admin-link-tabs__content",children:a.jsx(W0,{handleLinks:g=>{e(b=>[...b,g]),i(null)}})})]})]}),u&&a.jsxs(Go,{open:o==="product",onOpenChange:g=>i(g?"product":null),children:[a.jsxs(Ko,{className:"ecr-admin-link-tabs__trigger",onMouseEnter:m,children:[a.jsx(Zp,{size:20})," Tag Products"]}),a.jsxs(Yo,{className:"ecr-admin-link-dialog",children:[a.jsx(Xo,{children:a.jsx(Jo,{children:"Select Products"})}),a.jsx("div",{className:"ecr-admin-link-tabs__content",children:a.jsx(H0,{handleLinks:g=>{e(g),i(null)},taggedProducts:p,products:c.products,isSearching:c.isSearching,isLoading:c.isLoading,lastProductElementRef:c.lastProductElementRef,searchTerm:c.searchTerm,setSearchTerm:c.setSearchTerm,error:c.error})})]})]})]})})]})},G0=({links:e,onLinksChange:t})=>{const r=o=>{t(i=>i.filter(s=>s.btn_uuid!==o))},n=e[0]?.btn_type==="product"?"Product":"Link";return a.jsxs("div",{className:"ecr-admin-links",children:[a.jsx("p",{className:"ecr-admin-links__title",children:`${n}${e.length>1?"s":""}`}),e.length>0?a.jsxs(a.Fragment,{children:[e.map(o=>a.jsxs("div",{className:`ecr-admin-links__item ${o.btn_type==="custom"?o.customClass??"":""}`,children:[a.jsx("span",{children:o.buttonText}),a.jsx(ne,{onClick:()=>r(o.btn_uuid),size:"icon-sm",variant:"link",className:"ecr-admin-links__remove",children:a.jsx(Qp,{size:16})})]},o.btn_uuid)),a.jsxs(Je,{children:[a.jsxs(Ze,{className:"ecr-admin-links__upgrade",children:["+ Add Another ",a.jsx(at,{size:20})]}),a.jsx(Qe,{className:"ecr-admin-links__popover",children:a.jsx(ft,{name:"Multiple Links",text:a.jsx(a.Fragment,{children:"Unlock the ability to add multiple custom links, seamlessly redirecting users to your pages from the videos!"})})})]})]}):a.jsx(q0,{setLinks:t,linkCount:e.length,linkType:n,links:e})]})},K0=({togglePlayPause:e,isMuted:t,file:r,videoRef:n,onEnded:o})=>{const[i,s]=_.useState(!1);return a.jsx("video",{ref:n,className:$("ecr-admin-reelvideo",i?"ecr-admin-reelvideo--portrait":"ecr-admin-reelvideo--landscape"),src:r?.url,muted:t,playsInline:!0,preload:"metadata",onClick:e,autoPlay:!0,draggable:!1,onEnded:o,onError:o,"webkit-playsinline":"true",onLoadedMetadata:l=>{const c=l.currentTarget,d=c.videoWidth,u=c.videoHeight;s(()=>u>d)}})},Y0=({index:e,setIsAttemptingDelete:t,file:r,file_uuid:n,dragStart:o,dragEnter:i,dragEnd:s})=>{const[l,c]=_.useState(!0),[d,u]=_.useState(!1),p=_.useRef(null),m=()=>{p.current&&(d?p.current.play():p.current.pause(),u(b=>!b))},g=()=>{p.current&&(p.current.muted=!l,c(b=>!b))};return a.jsxs("div",{draggable:!0,onDragStart:()=>o(e),onDragEnter:()=>i(e),onDragEnd:s,className:$("ecr-admin-customization__panel"),children:[a.jsx(er,{className:"ecr-admin-customization__remove",size:20,onClick:()=>t(n)}),a.jsx(K0,{togglePlayPause:m,isMuted:l,file:r,videoRef:p,onEnded:()=>u(!0)}),a.jsxs("div",{className:"ecr-admin-customization__controls",children:[d?a.jsx(Jn,{size:18,className:"ecr-admin-customization__control",onClick:m}):a.jsx(Xn,{size:18,className:"ecr-admin-customization__control",onClick:m}),l?a.jsx(Qn,{size:18,className:"ecr-admin-customization__control",onClick:g}):a.jsx(Zn,{size:18,className:"ecr-admin-customization__control",onClick:g})]})]})},X0=({uploadedFiles:e,setIsAttemptingDelete:t,setUploadedFiles:r})=>{const n=_.useRef(null),o=_.useRef(null),i=c=>{n.current=c},s=c=>{o.current=c},l=()=>{if(n.current===null||o.current===null)return;const c=[...e],d=c[n.current];c.splice(n.current,1),c.splice(o.current,0,d),n.current=null,o.current=null,r(c)};return a.jsxs("div",{className:"ecr-admin-customization",children:[e.map((c,d)=>a.jsx(Y0,{setIsAttemptingDelete:t,file:c,file_uuid:c.file_uuid,index:d,dragStart:i,dragEnter:s,dragEnd:l},d)),a.jsxs(Je,{children:[a.jsxs(Ze,{className:"ecr-admin-customization__add",children:[a.jsx("img",{className:"ecr-admin-customization__icon",src:Uo,alt:"Upload"}),a.jsx("span",{className:"ecr-admin-customization__label",children:"Upload another video"}),a.jsx(at,{size:20,className:"ecr-admin-customization__lock"})]}),a.jsx(Qe,{side:"right",className:"ecr-admin-customization__popover",children:a.jsx(ft,{name:"Multiple Videos",text:a.jsxs(a.Fragment,{children:["Unlock the power of ",a.jsx("strong",{children:"Multiple Video"})," uploads, boosting engagement and variety in every Reels!"]})})})]})]})};function J0(e){return V({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 Z0=({setUploadedFiles:e,setThumbnail:t,usedFor:r="video",mode:n="files",multiple:o=!1,className:i})=>{const[s,l]=_.useState(!1),c=()=>{const d=window.wp.media({title:"Select image or video files",button:{text:"Use this file"},multiple:o,library:{type:[r]}});d.on("select",()=>{const u=d.state().get("selection").toJSON();if(n==="thumbnail"){const m=u[0];m&&t&&t(m.url);return}if(!e)return;const p=u.map(m=>({url:m.url,mime_type:m.mime,file_uuid:_n()}));e(m=>[...m,...p])}),d.open()};return a.jsx("div",{className:$("ecr-admin-upload",s?"ecr-admin-upload--active":"ecr-admin-upload--idle",i),onDragOver:d=>{d.preventDefault(),l(!0)},onDragLeave:()=>l(!1),onDrop:d=>{d.preventDefault(),l(!1),c()},children:a.jsxs("label",{className:"ecr-admin-upload__label",htmlFor:"file",onClick:c,children:[a.jsx("img",{className:"ecr-admin-upload__icon",src:Uo,alt:"Upload"}),a.jsx("span",{className:"ecr-admin-upload__text",children:s?a.jsx("span",{className:"ecr-admin-upload__text-strong",children:"Drop files here..."}):a.jsxs("span",{className:"ecr-admin-upload__text-stack",children:[a.jsxs("span",{className:"ecr-admin-upload__text-item",children:["Upload ",r]}),n==="files"?a.jsx("span",{className:"ecr-admin-upload__text-item",children:"Click or Drag and drop files here"}):null]})})]})})},Q0=({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(J0,{className:"ecr-admin-thumbnail__remove",size:20,onClick:()=>t(null)})]}):a.jsx(Z0,{mode:"thumbnail",usedFor:"image",setThumbnail:t,className:"ecr-admin-thumbnail__uploader"})]}),eb=()=>{const e=Ne(),[t]=Zt(),r=_.useMemo(()=>t.get("sid"),[t]),n=_.useRef(null),[o,i]=_.useState({files:[],title:"",links:[],thumbnail:null}),[s,l]=_.useState(!1),[c,d]=_.useState(null),u=_.useCallback(h=>{i(v=>({...v,title:typeof h=="function"?h(v.title):h}))},[]),p=_.useCallback(h=>{i(v=>({...v,files:typeof h=="function"?h(v.files):h}))},[]),m=_.useCallback(h=>{i(v=>({...v,links:typeof h=="function"?h(v.links):h}))},[]),g=_.useCallback(h=>{i(v=>({...v,thumbnail:typeof h=="function"?h(v.thumbnail):h}))},[]),b=()=>{c&&(p(h=>h.filter(v=>v.file_uuid!==c)),d(null))},f=_.useCallback(async h=>{try{l(!0);const v=await he.get(`story/${h}`);i({title:v.data.title,files:v.data.files,links:v.data.links,thumbnail:v.data.thumbnail})}catch(v){v instanceof Error?G.error(v.message):G.error("Something went wrong. Try again later!"),n.current=setTimeout(()=>e(-1),1e3)}finally{l(!1)}},[e]);return _.useEffect(()=>{r&&f(r)},[r,f]),_.useEffect(()=>()=>{n.current&&clearTimeout(n.current)},[]),s?a.jsx(Lr,{}):a.jsxs(a.Fragment,{children:[a.jsx(th,{uploadedFiles:o.files,links:o.links,thumbnail:o.thumbnail,storyTitle:o.title,setStoryTitle:u}),a.jsxs("div",{className:"ecr-admin-create",children:[a.jsxs("div",{className:"ecr-admin-create__panel ecr-admin-create__panel--main",children:[a.jsx("p",{className:"ecr-admin-create__title",children:"Select video"}),c&&a.jsx(Or,{onReject:()=>d(null),onAccept:b,isLoading:!1,message:"Are you sure, You want to remove this file?"}),o.files.length>0?a.jsx(X0,{uploadedFiles:o.files,setUploadedFiles:p,setIsAttemptingDelete:d}):a.jsx(w0,{setUploadedFiles:p})]}),a.jsxs("div",{className:"ecr-admin-create__panel ecr-admin-create__panel--side",children:[a.jsx(Q0,{thumbnail:o.thumbnail,onThumbnailChange:g}),a.jsx(bn,{className:"ecr-admin-create__separator"}),a.jsx(G0,{links:o.links,onLinksChange:m})]})]})]})};function Hl(e){return V({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 Vl=({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 Zo,Wl;function tb(){return Wl||(Wl=1,Zo=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()}}),Zo}var Qo,ql;function rb(){if(ql)return Qo;ql=1;var e=tb(),t={"text/plain":"Text","text/html":"Url",default:"Text"},r="Copy to clipboard: #{key}, Enter";function n(i){var s=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return i.replace(/#{\s*key\s*}/g,s)}function o(i,s){var l,c,d,u,p,m,g=!1;s||(s={}),l=s.debug||!1;try{d=e(),u=document.createRange(),p=document.getSelection(),m=document.createElement("span"),m.textContent=i,m.ariaHidden="true",m.style.all="unset",m.style.position="fixed",m.style.top=0,m.style.clip="rect(0, 0, 0, 0)",m.style.whiteSpace="pre",m.style.webkitUserSelect="text",m.style.MozUserSelect="text",m.style.msUserSelect="text",m.style.userSelect="text",m.addEventListener("copy",function(f){if(f.stopPropagation(),s.format)if(f.preventDefault(),typeof f.clipboardData>"u"){l&&console.warn("unable to use e.clipboardData"),l&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var h=t[s.format]||t.default;window.clipboardData.setData(h,i)}else f.clipboardData.clearData(),f.clipboardData.setData(s.format,i);s.onCopy&&(f.preventDefault(),s.onCopy(f.clipboardData))}),document.body.appendChild(m),u.selectNodeContents(m),p.addRange(u);var b=document.execCommand("copy");if(!b)throw new Error("copy command was unsuccessful");g=!0}catch(f){l&&console.error("unable to copy using execCommand: ",f),l&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(s.format||"text",i),s.onCopy&&s.onCopy(window.clipboardData),g=!0}catch(h){l&&console.error("unable to copy using clipboardData: ",h),l&&console.error("falling back to prompt"),c=n("message"in s?s.message:r),window.prompt(c,i)}}finally{p&&(typeof p.removeRange=="function"?p.removeRange(u):p.removeAllRanges()),m&&document.body.removeChild(m),d()}return g}return Qo=o,Qo}var nb=rb();const Gl=Td(nb);function Kl({className:e,...t}){return a.jsx("div",{"data-slot":"table-container",className:"ecr-table__container",children:a.jsx("table",{"data-slot":"table",className:$("ecr-table",e),...t})})}function Yl({className:e,...t}){return a.jsx("thead",{"data-slot":"table-header",className:$("ecr-table__header",e),...t})}function Xl({className:e,...t}){return a.jsx("tbody",{"data-slot":"table-body",className:$("ecr-table__body",e),...t})}function kn({className:e,...t}){return a.jsx("tr",{"data-slot":"table-row",className:$("ecr-table__row",e),...t})}function Jl({className:e,...t}){return a.jsx("th",{"data-slot":"table-head",className:$("ecr-table__head",e),...t})}function Me({className:e,...t}){return a.jsx("td",{"data-slot":"table-cell",className:$("ecr-table__cell",e),...t})}function Zl({className:e,...t}){return a.jsx("caption",{"data-slot":"table-caption",className:$("ecr-table__caption",e),...t})}const ob=[{label:"No.",width:80,align:"center"},{label:"Group Name",width:250,align:"start"},{label:"Short Code",align:"start"},{label:"Action",width:150,align:"center"}],ab=({tableData:e,setIsAttemptingDelete:t})=>{const[r,n]=_.useState(null),o=_.useRef(null),i=(s,l)=>{Gl(s),n(l),o.current=setTimeout(()=>{n(null)},700)};return _.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]),a.jsxs(Kl,{className:"ecr-admin-groups__table",children:[!e.length&&a.jsx(Zl,{className:"ecr-admin-groups__caption",children:a.jsxs("div",{className:"ecr-admin-groups__empty",children:[a.jsx(lt,{className:"ecr-admin-groups__empty-icon"}),"You did not create any reel group yet!"]})}),e.length?a.jsxs(a.Fragment,{children:[a.jsx(Yl,{children:a.jsx(kn,{children:ob.map((s,l)=>a.jsx(Jl,{className:"ecr-admin-groups__head",style:{width:s?.width||"auto",textAlign:s?.align},children:s.label},l))})}),a.jsx(Xl,{children:e.map((s,l)=>a.jsxs(kn,{className:$("ecr-admin-groups__row",l%2===0&&"ecr-admin-groups__row--alt"),children:[a.jsx(Me,{className:"ecr-admin-groups__cell ecr-admin-groups__cell--center ecr-admin-groups__cell--strong",children:l+1}),a.jsx(Me,{children:a.jsx("div",{className:"ecr-admin-groups__name",children:s.group_name})}),a.jsx(Me,{children:a.jsxs("div",{className:"ecr-admin-groups__shortcode",children:[a.jsx("span",{className:"ecr-admin-groups__shortcode-text",children:`[reelswp-group id='${s.id}']`}),a.jsxs("div",{className:"ecr-admin-groups__copy",children:[a.jsx("button",{onClick:()=>i(`[reelswp-group id='${s.id}']`,l),className:"ecr-admin-groups__copy-button",title:"Copy",children:a.jsx(lp,{className:"ecr-admin-groups__copy-icon"})}),a.jsx("span",{className:$("ecr-admin-groups__copy-tooltip",r===l&&"ecr-admin-groups__copy-tooltip--visible"),children:"Copied!"})]})]})}),a.jsx(Me,{children:a.jsxs("div",{className:"ecr-admin-groups__actions",children:[a.jsx(ne,{title:"Statistics",variant:"link",size:"icon-sm",asChild:!0,className:"ecr-admin-groups__action-button",children:a.jsx(vt,{to:`?view=${X.stat}&group=${s.id}&name=${s.group_name}`,children:a.jsx(bi,{className:"ecr-admin-groups__icon ecr-admin-groups__icon--neutral"})})}),a.jsx(ne,{title:"Update Stories",variant:"link",size:"icon-sm",asChild:!0,className:"ecr-admin-groups__action-button",children:a.jsx(vt,{to:`?view=${X.mg}&gid=${s.id}`,children:a.jsx(Pr,{className:"ecr-admin-groups__icon ecr-admin-groups__icon--neutral"})})}),a.jsx(ne,{title:"Delete Group",onClick:()=>t(s.id),variant:"link",size:"icon-sm",className:"ecr-admin-groups__action-button",children:a.jsx(fp,{className:"ecr-admin-groups__icon ecr-admin-groups__icon--danger"})})]})})]},s.id??l))})]}):null]})},Ql=()=>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))})]}),ib=()=>{const[e,t]=_.useState([]),[r,n]=_.useState(""),[o,i]=_.useState(!1),[s,l]=_.useState(!1),[c,d]=_.useState(!1),[u,p]=_.useState(""),[m,g]=_.useState(1),[b]=_.useState(20),[f,h]=_.useState(0),[v,y]=_.useState(1),w=fo(u,500),j=_.useCallback(async E=>{const T=new AbortController,A=E===1;try{A?i(!0):l(!0),n("");const R=await he.get("groups",{params:{page:E,per_page:b,...w&&{q:w}},signal:T.signal}),L=Number(R.headers?.["x-wp-total"]??0),B=Number(R.headers?.["x-wp-totalpages"]??1),M=Math.max(1,B||1);t(O=>{if(A)return R.data;const P=new Set(O.map(I=>I.id)),z=R.data.filter(I=>!P.has(I.id));return[...O,...z]}),h(L),y(M),E>M&&g(M)}catch(R){if(T.signal.aborted)return;R instanceof Error?n(R.message):n("Something went wrong. Try again later!")}finally{T.signal.aborted||(A?i(!1):l(!1))}},[b,w]),C=_.useCallback(()=>{g(E=>o||s||E>=v?E:E+1)},[o,s,v]),N=_.useCallback(async()=>{if(m!==1){g(1);return}await j(1)},[m,j]),S=_.useCallback(async E=>{try{d(!0),await he.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 _.useEffect(()=>{j(m)},[m,j,w]),{groups:e,groupError:r,isLoading:o,isLoadingMore:s,isDeleting:c,searchTerm:u,setSearchTerm:p,perPage:b,total:f,totalPages:v,hasMore:m<=v,loadMore:C,refreshGroups:N,deleteGroup:S}},ec={docs:"https://reelswp.com/docs/",rateUs:"https://wordpress.org/support/plugin/ecomm-reels/reviews/#new-post"},sb=()=>{const[e,t]=_.useState(null),{groups:r,groupError:n,isLoading:o,isLoadingMore:i,isDeleting:s,deleteGroup:l,hasMore:c,loadMore:d,searchTerm:u,setSearchTerm:p}=ib(),m=_.useRef(null),g=async()=>{e&&(await l(e),t(null))};return _.useEffect(()=>{if(!m.current||!c)return;const b=new IntersectionObserver(f=>{const[h]=f;h.isIntersecting&&d()},{root:null,rootMargin:"200px",threshold:0});return b.observe(m.current),()=>b.disconnect()},[c,d]),a.jsxs(a.Fragment,{children:[a.jsx(kt,{left:[a.jsx(St,{name:"All Widgets",Icon:gp},"page")],center:[a.jsx(Ir,{},"reel-wp")],right:[a.jsxs("a",{href:ec.rateUs,className:"ecr-admin-docs-link",target:"_blank",children:[a.jsx(Hl,{size:14}),a.jsx("span",{children:"Rate Us"})]},"rate-us"),a.jsxs("a",{href:ec.docs,className:"ecr-admin-docs-link",target:"_blank",children:[a.jsx(Up,{size:14}),a.jsx("span",{children:"Documentation"})]},"view-documentation"),a.jsx(Rr,{to:`?view=${X.cr}`,text:"Add Reel",Icon:yt},"add-reel-reel-group")]}),a.jsxs("div",{className:"ecr-admin-card ecr-admin-groups",children:[e&&a.jsx(Or,{onAccept:g,onReject:()=>t(null),isLoading:s}),a.jsxs("div",{className:"ecr-admin-groups__header",children:[a.jsx("h2",{className:"ecr-admin-groups__title",children:"Reel Widgets"}),a.jsxs("div",{className:"ecr-admin-groups_action_wrapper",children:[a.jsxs("div",{className:"ecr-admin-groups-header__search",children:[a.jsx("input",{type:"text",placeholder:"Search widgets...",value:u,onChange:b=>p(b.target.value),className:"ecr-admin-groups-search-input"}),a.jsxs("div",{className:"ecr-admin-groups-header__icon-wrapper",children:[u&&a.jsx(ne,{onClick:()=>p(""),variant:"link",size:"icon-sm",children:a.jsx(qn,{size:16,className:"ecr-admin-groups-header__clear-icon"})}),a.jsx(ii,{size:16,className:"ecr-admin-groups-header__search-icon"})]})]}),a.jsx(Rr,{to:`?view=${X.mg}`,text:"Create Widget",Icon:yt,className:"ecr-admin-groups__create-button",textColor:"#2563eb"})]})]}),o?a.jsx(Ql,{}):n?a.jsx(Vl,{}):a.jsxs(a.Fragment,{children:[a.jsx(ab,{tableData:r,setIsAttemptingDelete:t}),c&&a.jsx("div",{ref:m,className:"ecr-admin-groups__load-more","aria-live":"polite",children:i?a.jsx(Wp,{className:"ecr-admin-groups__load-more__icon"}):null})]})]})]})},lb=()=>{const[e,t]=_.useState(!1),[r,n]=_.useState({rateLimit:2,timeLimit:1}),[o,i]=_.useState(!1),[s,l]=_.useState(!1),[c,d]=_.useState(!1),u=_.useCallback((m,g)=>{t(!0),n(b=>({...b,[m]:g}))},[]),p=_.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),d(!1),await he.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!"),d(!0)}finally{l(!1)}},[r.rateLimit,r.timeLimit]);return _.useEffect(()=>{const m=new AbortController;return(async()=>{try{i(!0),d(!1);const b=await he.get("settings",{signal:m.signal});n({rateLimit:b.data.rate_limit,timeLimit:b.data.time_limit}),t(!1)}catch(b){if(m.signal.aborted)return;b instanceof Error?G.error(b.message):G.error("Something went wrong. Try again later!"),d(!0)}finally{m.signal.aborted||i(!1)}})(),()=>m.abort()},[]),{limit:r,isEdited:e,isLoading:o,isSaving:s,isError:c,handleOnChange:u,handleSave:p}},cb=()=>{const{limit:e,isEdited:t,isLoading:r,isSaving:n,isError:o,handleOnChange:i,handleSave:s}=lb();return a.jsxs(a.Fragment,{children:[r&&a.jsx(Lr,{}),a.jsx(kt,{left:[a.jsx(St,{name:"Settings",Icon:Pp},"Settings"),a.jsx(tr,{},"back-settings")],center:[a.jsx(Ir,{},"Settings-widget-name")],right:[a.jsx(ho,{onSave:s,isSaving:n,disabled:!t},"save")]}),a.jsx(rr,{breads:[{label:"Dashboard",href:`?view=${X.ag}`},{label:"Settings"}]}),a.jsxs("div",{className:"ecr-admin-card ecr-admin-card--settings",children:[a.jsx("div",{className:"ecr-admin-card__header",children:a.jsx("h2",{className:"ecr-admin-card__title",children:"ReelsWP Settings"})}),o&&a.jsx("div",{className:"ecr-admin-form__row",children:a.jsx("span",{children:"Unable to load settings. Please try again."})}),a.jsxs("form",{action:"",className:"ecr-admin-form",children:[a.jsxs("div",{className:"ecr-admin-form__row",children:[a.jsx("label",{htmlFor:"ecommreels_rate_limit",className:"ecr-admin-form__label",children:"Rate Limit:"}),a.jsx("input",{type:"number",id:"ecommreels_rate_limit",name:"ecommreels_rate_limit",value:e.rateLimit,onChange:l=>i("rateLimit",l.target.value),className:"ecr-admin-form__input",min:"1"})]}),a.jsxs("div",{className:"ecr-admin-form__row",children:[a.jsx("label",{htmlFor:"ecommreels_time_limit",className:"ecr-admin-form__label",children:"Time Limit (minutes):"}),a.jsx("input",{type:"number",id:"ecommreels_time_limit",name:"ecommreels_time_limit",value:e.timeLimit,onChange:l=>i("timeLimit",l.target.value),className:"ecr-admin-form__input",min:"1"})]})]})]})]})},db=[{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"}],ub=({tableData:e})=>a.jsxs(Kl,{className:"ecr-admin-stats__table",children:[!e.length&&a.jsx(Zl,{className:"ecr-admin-stats__caption",children:a.jsxs("div",{className:"ecr-admin-stats__empty",children:[a.jsx(lt,{className:"ecr-admin-stats__empty-icon"}),"You did not create any reel group yet!"]})}),a.jsx(Yl,{children:a.jsx(kn,{children:db.map((t,r)=>a.jsx(Jl,{className:"ecr-admin-stats__head",style:{...t.width&&{width:`${t.width}px`},textAlign:t.align},children:t.label},r))})}),!!e.length&&a.jsx(Xl,{children:e.map((t,r)=>a.jsxs(kn,{className:$("ecr-admin-stats__row",r%2===0&&"ecr-admin-stats__row--alt"),children:[a.jsx(Me,{className:"ecr-admin-stats__cell ecr-admin-stats__cell--center",children:r+1}),a.jsx(Me,{className:"ecr-admin-stats__cell",children:t.storyTitle}),a.jsx(Me,{className:"ecr-admin-stats__cell",children:t.campaignName}),a.jsx(Me,{className:"ecr-admin-stats__cell",children:t.buttonText}),a.jsx(Me,{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(Me,{className:"ecr-admin-stats__cell ecr-admin-stats__cell--center",children:t.clickCount})]},t.id))})]}),pb=()=>{const[e]=Zt(),t=e.get("group"),r=e.get("name"),[n,o]=_.useState([]),[i,s]=_.useState([]),[l,c]=_.useState(!1),[d,u]=_.useState(!1);_.useEffect(()=>{t&&(async()=>{try{c(!0);const g=await he.get(`/group/${t}/stats`);o(g.data.stories),s(g.data.buttons)}catch(g){g instanceof Error?G.error(g.message):G.error("Something went wrong. Try again later!"),u(!0)}finally{c(!1)}})()},[t]);const p=n.length>0?n.reduce((m,g)=>m+=g.view_count??0,0):0;return a.jsxs(a.Fragment,{children:[a.jsx(kt,{left:[a.jsx(St,{name:"Statistics",Icon:bi},"Statistics"),a.jsx(tr,{},"Statistics-back")],center:[a.jsx(Ir,{},"Statistics-widget-name")]}),a.jsx(rr,{breads:[{label:"Dashboard",href:`?view=${X.ag}`},{label:"Statistics"}]}),a.jsxs("div",{className:"ecr-admin-card ecr-admin-stats",children:[a.jsxs("div",{className:"ecr-admin-stats__header",children:[a.jsxs("h2",{className:"ecr-admin-stats__title",children:["Group: ",r]}),l?a.jsx("div",{className:"ecr-admin-stats__summary-skeleton"}):a.jsxs("div",{className:"ecr-admin-stats__summary",children:[a.jsx("span",{children:"Total View:"})," ",a.jsx("span",{children:p})]})]}),a.jsx("div",{className:"ecr-admin-stats__body",children:l?a.jsx(Ql,{}):d?a.jsx(Vl,{}):i.length===0?a.jsxs("div",{className:"ecr-admin-stats__empty",children:[a.jsx(lt,{className:"ecr-admin-stats__empty-icon"}),a.jsx("span",{children:"No Stats available for this group"})]}):a.jsx(ub,{tableData:i})})]})]})};function mb(e){return V({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 fb(e){return V({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 hb=({isExpanded:e,setIsExpanded:t})=>a.jsx("button",{onClick:()=>t(r=>!r),className:$("ecr-admin-side-toggle",e?"ecr-admin-side-toggle--active":""),title:"Side Panel",children:a.jsx(mb,{size:24})}),gb=({...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"})]})}),ea=_.forwardRef(({className:e,type:t,...r},n)=>a.jsx(W.input,{ref:n,type:t,"data-slot":"input",className:$("ecr-input",e),...r}));ea.displayName="Input";const ta=({label:e,min:t,max:r,value:n,onChange:o,name:i,id:s,wrapperStyles:l,hideSlider:c})=>{const[d,u]=_.useState(n),p=_.useRef(null);_.useEffect(()=>{u(n)},[n]);const m=b=>{const f=Math.min(r,Math.max(t,Number(b)));o(f)},g=b=>{const f=Number(b);u(f),p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{m(f>r?r:f<t?t:f)},1e3)};return a.jsxs("div",{style:l,className:"ecr-admin-range",children:[a.jsxs("label",{htmlFor:s,className:"ecr-admin-range__label",children:[e,":"]}),a.jsxs("div",{className:"ecr-admin-range__row",children:[!c&&a.jsx("input",{type:"range",id:s,name:i,min:t,max:r,value:n,onChange:b=>{const f=Number(b.target.value);u(f),m(f)},className:"ecr-admin-range__slider"}),a.jsxs("div",{className:"ecr-admin-range__value",children:[a.jsx(ea,{type:"number",min:t,max:r,value:d,onChange:b=>g(b.target.value)}),a.jsx("span",{className:"ecr-admin-range__unit",children:"px"})]})]})]})};function D(){return D=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},D.apply(null,arguments)}function Be(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var Dt=255,et=100,pr=e=>{var{r:t,g:r,b:n,a:o}=e,i=Math.max(t,r,n),s=i-Math.min(t,r,n),l=s?i===t?(r-n)/s:i===r?2+(n-t)/s:4+(t-r)/s:0;return{h:60*(l<0?l+6:l),s:i?s/i*et:0,v:i/Dt*et,a:o}},tc=e=>{var{h:t,s:r,l:n,a:o}=rc(e);return"hsla("+t+", "+r+"%, "+n+"%, "+o+")"},rc=e=>{var{h:t,s:r,v:n,a:o}=e,i=(200-r)*n/et;return{h:t,s:i>0&&i<200?r*n/et/(i<=et?i:200-i)*et:0,l:i/2,a:o}},nc=e=>{var{r:t,g:r,b:n}=e,o=t<<16|r<<8|n;return"#"+(i=>new Array(7-i.length).join("0")+i)(o.toString(16))},xb=e=>{var{r:t,g:r,b:n,a:o}=e,i=typeof o=="number"&&(o*255|256).toString(16).slice(1);return""+nc({r:t,g:r,b:n})+(i||"")},mr=e=>pr(bb(e)),bb=e=>{var t=e.replace("#","");/^#?/.test(e)&&t.length===3&&(e="#"+t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2));var r=new RegExp("[A-Za-z0-9]{2}","g"),[n,o,i=0,s]=e.match(r).map(l=>parseInt(l,16));return{r:n,g:o,b:i,a:(s??255)/Dt}},Sn=e=>{var{h:t,s:r,v:n,a:o}=e,i=t/60,s=r/et,l=n/et,c=Math.floor(i)%6,d=i-Math.floor(i),u=Dt*l*(1-s),p=Dt*l*(1-s*d),m=Dt*l*(1-s*(1-d));l*=Dt;var g={};switch(c){case 0:g.r=l,g.g=m,g.b=u;break;case 1:g.r=p,g.g=l,g.b=u;break;case 2:g.r=u,g.g=l,g.b=m;break;case 3:g.r=u,g.g=p,g.b=l;break;case 4:g.r=m,g.g=u,g.b=l;break;case 5:g.r=l,g.g=u,g.b=p;break}return g.r=Math.round(g.r),g.g=Math.round(g.g),g.b=Math.round(g.b),D({},g,{a:o})},_b=e=>{var{r:t,g:r,b:n,a:o}=Sn(e);return"rgba("+t+", "+r+", "+n+", "+o+")"},vb=e=>{var{r:t,g:r,b:n}=e;return{r:t,g:r,b:n}},yb=e=>{var{h:t,s:r,l:n}=e;return{h:t,s:r,l:n}},ra=e=>nc(Sn(e)),wb=e=>{var{h:t,s:r,v:n}=e;return{h:t,s:r,v:n}},jb=e=>{var{r:t,g:r,b:n}=e,o=function(u){return u<=.04045?u/12.92:Math.pow((u+.055)/1.055,2.4)},i=o(t/255),s=o(r/255),l=o(n/255),c={};return c.x=i*.4124+s*.3576+l*.1805,c.y=i*.2126+s*.7152+l*.0722,c.bri=i*.0193+s*.1192+l*.9505,c},$t=e=>{var t,r,n,o,i,s,l,c,d;return typeof e=="string"&&na(e)?(s=mr(e),c=e):typeof e!="string"&&(s=e),s&&(n=wb(s),i=rc(s),o=Sn(s),d=xb(o),c=ra(s),r=yb(i),t=vb(o),l=jb(t)),{rgb:t,hsl:r,hsv:n,rgba:o,hsla:i,hsva:s,hex:c,hexa:d,xy:l}},na=e=>/^#?([A-Fa-f0-9]{3,4}){1,2}$/.test(e);function oc(e){var t=_.useRef(e);return _.useEffect(()=>{t.current=e}),_.useCallback((r,n)=>t.current&&t.current(r,n),[])}var fr=e=>"touches"in e,ac=e=>{!fr(e)&&e.preventDefault&&e.preventDefault()},ic=function(t,r,n){return r===void 0&&(r=0),n===void 0&&(n=1),t>n?n:t<r?r:t},sc=(e,t)=>{var r=e.getBoundingClientRect(),n=fr(t)?t.touches[0]:t;return{left:ic((n.pageX-(r.left+window.pageXOffset))/r.width),top:ic((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)}},kb=["prefixCls","className","onMove","onDown"],oa=_.forwardRef((e,t)=>{var{prefixCls:r="w-color-interactive",className:n,onMove:o,onDown:i}=e,s=Be(e,kb),l=_.useRef(null),c=_.useRef(!1),[d,u]=_.useState(!1),p=oc(o),m=oc(i),g=y=>c.current&&!fr(y)?!1:(c.current=fr(y),!0),b=_.useCallback(y=>{if(ac(y),!!l.current){var w=fr(y)?y.touches.length>0:y.buttons>0;if(!w){u(!1);return}p?.(sc(l.current,y),y)}},[p]),f=_.useCallback(()=>u(!1),[]),h=_.useCallback(y=>{y?(window.addEventListener(c.current?"touchmove":"mousemove",b),window.addEventListener(c.current?"touchend":"mouseup",f)):(window.removeEventListener("mousemove",b),window.removeEventListener("mouseup",f),window.removeEventListener("touchmove",b),window.removeEventListener("touchend",f))},[b,f]);_.useEffect(()=>(h(d),()=>{h(!1)}),[d,b,f,h]);var v=_.useCallback(y=>{var w=document.activeElement;w?.blur(),ac(y.nativeEvent),g(y.nativeEvent)&&l.current&&(m?.(sc(l.current,y.nativeEvent),y.nativeEvent),u(!0))},[m]);return a.jsx("div",D({},s,{className:[r,n||""].filter(Boolean).join(" "),style:D({},s.style,{touchAction:"none"}),ref:l,tabIndex:0,onMouseDown:v,onTouchStart:v}))});oa.displayName="Interactive";var Sb=e=>{var{className:t,color:r,left:n,top:o,prefixCls:i}=e,s={position:"absolute",top:o,left:n},l={"--saturation-pointer-box-shadow":"rgb(255 255 255) 0px 0px 0px 1.5px, rgb(0 0 0 / 30%) 0px 0px 1px 1px inset, rgb(0 0 0 / 40%) 0px 0px 1px 2px",width:6,height:6,transform:"translate(-3px, -3px)",boxShadow:"var(--saturation-pointer-box-shadow)",borderRadius:"50%",backgroundColor:r};return _.useMemo(()=>a.jsx("div",{className:i+"-pointer "+(t||""),style:s,children:a.jsx("div",{className:i+"-fill",style:l})}),[o,n,r,t,i])},Cb=["prefixCls","radius","pointer","className","hue","style","hsva","onChange"],lc=_.forwardRef((e,t)=>{var r,{prefixCls:n="w-color-saturation",radius:o=0,pointer:i,className:s,hue:l=0,style:c,hsva:d,onChange:u}=e,p=Be(e,Cb),m=D({width:200,height:200,borderRadius:o},c,{position:"relative"}),g=(v,y)=>{u&&d&&u({h:d.h,s:v.left*100,v:(1-v.top)*100,a:d.a})},b=_.useCallback(v=>{if(!(!d||!u)){var y=1,w=d.s,j=d.v,C=!1;switch(v.key){case"ArrowLeft":w=Math.max(0,d.s-y),C=!0,v.preventDefault();break;case"ArrowRight":w=Math.min(100,d.s+y),C=!0,v.preventDefault();break;case"ArrowUp":j=Math.min(100,d.v+y),C=!0,v.preventDefault();break;case"ArrowDown":j=Math.max(0,d.v-y),C=!0,v.preventDefault();break;default:return}C&&u({h:d.h,s:w,v:j,a:d.a})}},[d,u]),f=_.useMemo(()=>{if(!d)return null;var v={top:100-d.v+"%",left:d.s+"%",color:tc(d)};return i&&typeof i=="function"?i(D({prefixCls:n},v)):a.jsx(Sb,D({prefixCls:n},v))},[d,i,n]),h=_.useCallback(v=>{v.target.focus()},[]);return a.jsx(oa,D({className:[n,s||""].filter(Boolean).join(" ")},p,{style:D({position:"absolute",inset:0,cursor:"crosshair",backgroundImage:"linear-gradient(0deg, #000, transparent), linear-gradient(90deg, #fff, hsl("+((r=d?.h)!=null?r:l)+", 100%, 50%))"},m,{outline:"none"}),ref:t,onMove:g,onDown:g,onKeyDown:b,onClick:h,children:f}))});lc.displayName="Saturation";var Nb=["className","prefixCls","left","top","style","fillProps"],Eb=e=>{var{className:t,prefixCls:r,left:n,top:o,style:i,fillProps:s}=e,l=Be(e,Nb),c=D({},i,{position:"absolute",left:n,top:o}),d=D({width:18,height:18,boxShadow:"var(--alpha-pointer-box-shadow)",borderRadius:"50%",backgroundColor:"var(--alpha-pointer-background-color)"},s?.style,{transform:n?"translate(-9px, -1px)":"translate(-1px, -9px)"});return a.jsx("div",D({className:r+"-pointer "+(t||""),style:c},l,{children:a.jsx("div",D({className:r+"-fill"},s,{style:d}))}))},Tb=["prefixCls","className","hsva","background","bgProps","innerProps","pointerProps","radius","width","height","direction","style","onChange","pointer"],Ab="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg==",Cn=_.forwardRef((e,t)=>{var{prefixCls:r="w-color-alpha",className:n,hsva:o,background:i,bgProps:s={},innerProps:l={},pointerProps:c={},radius:d=0,width:u,height:p=16,direction:m="horizontal",style:g,onChange:b,pointer:f}=e,h=Be(e,Tb),v=T=>{b&&b(D({},o,{a:m==="horizontal"?T.left:T.top}),T)},y=tc(Object.assign({},o,{a:1})),w="linear-gradient(to "+(m==="horizontal"?"right":"bottom")+", rgba(244, 67, 54, 0) 0%, "+y+" 100%)",j={};m==="horizontal"?j.left=o.a*100+"%":j.top=o.a*100+"%";var C=D({"--alpha-background-color":"#fff","--alpha-pointer-background-color":"rgb(248, 248, 248)","--alpha-pointer-box-shadow":"rgb(0 0 0 / 37%) 0px 1px 4px 0px",borderRadius:d,background:"url("+Ab+") left center",backgroundColor:"var(--alpha-background-color)"},{width:u,height:p},g,{position:"relative"}),N=_.useCallback(T=>{var A=.01,R=o.a,L=R;switch(T.key){case"ArrowLeft":m==="horizontal"&&(L=Math.max(0,R-A),T.preventDefault());break;case"ArrowRight":m==="horizontal"&&(L=Math.min(1,R+A),T.preventDefault());break;case"ArrowUp":m==="vertical"&&(L=Math.max(0,R-A),T.preventDefault());break;case"ArrowDown":m==="vertical"&&(L=Math.min(1,R+A),T.preventDefault());break;default:return}if(L!==R){var B={left:m==="horizontal"?L:o.a,top:m==="vertical"?L:o.a,width:0,height:0,x:0,y:0};b&&b(D({},o,{a:L}),B)}},[o,m,b]),S=_.useCallback(T=>{T.target.focus()},[]),E=f&&typeof f=="function"?f(D({prefixCls:r},c,j)):a.jsx(Eb,D({},c,{prefixCls:r},j));return a.jsxs("div",D({},h,{className:[r,r+"-"+m,n||""].filter(Boolean).join(" "),style:C,ref:t,children:[a.jsx("div",D({},s,{style:D({inset:0,position:"absolute",background:i||w,borderRadius:d},s.style)})),a.jsx(oa,D({},l,{style:D({},l.style,{inset:0,zIndex:1,position:"absolute",outline:"none"}),onMove:v,onDown:v,onClick:S,onKeyDown:N,children:E}))]}))});Cn.displayName="Alpha";var Pb=["prefixCls","placement","label","value","className","style","labelStyle","inputStyle","onChange","onBlur","renderInput"],Ob=e=>/^#?([A-Fa-f0-9]{3,4}){1,2}$/.test(e),Rb=e=>Number(String(e).replace(/%/g,"")),Ft=_.forwardRef((e,t)=>{var{prefixCls:r="w-color-editable-input",placement:n="bottom",label:o,value:i,className:s,style:l,labelStyle:c,inputStyle:d,onChange:u,onBlur:p,renderInput:m}=e,g=Be(e,Pb),[b,f]=_.useState(i),h=_.useRef(!1);_.useEffect(()=>{e.value!==b&&(h.current||f(e.value))},[e.value]);function v(S,E){var T=(E||S.target.value).trim().replace(/^#/,"");Ob(T)&&u&&u(S,T);var A=Rb(T);isNaN(A)||u&&u(S,A),f(T)}function y(S){h.current=!1,f(e.value),p&&p(S)}var w={};n==="bottom"&&(w.flexDirection="column"),n==="top"&&(w.flexDirection="column-reverse"),n==="left"&&(w.flexDirection="row-reverse");var j=D({"--editable-input-label-color":"rgb(153, 153, 153)","--editable-input-box-shadow":"rgb(204 204 204) 0px 0px 0px 1px inset","--editable-input-color":"#666",position:"relative",alignItems:"center",display:"flex",fontSize:11},w,l),C=D({width:"100%",paddingTop:2,paddingBottom:2,paddingLeft:3,paddingRight:3,fontSize:11,background:"transparent",boxSizing:"border-box",border:"none",color:"var(--editable-input-color)",boxShadow:"var(--editable-input-box-shadow)"},d),N=D({value:b,onChange:v,onBlur:y,autoComplete:"off",onFocus:()=>h.current=!0},g,{style:C,onFocusCapture:S=>{var E=S.target;E.setSelectionRange(E.value.length,E.value.length)}});return a.jsxs("div",{className:[r,s||""].filter(Boolean).join(" "),style:j,children:[m?m(N,t):a.jsx("input",D({ref:t},N)),o&&a.jsx("span",{style:D({color:"var(--editable-input-label-color)",textTransform:"capitalize"},c),children:o})]})});Ft.displayName="EditableInput";var Lb=["prefixCls","hsva","placement","rProps","gProps","bProps","aProps","className","style","onChange"],cc=_.forwardRef((e,t)=>{var{prefixCls:r="w-color-editable-input-rgba",hsva:n,placement:o="bottom",rProps:i={},gProps:s={},bProps:l={},aProps:c={},className:d,style:u,onChange:p}=e,m=Be(e,Lb),g=n?Sn(n):{};function b(y){var w=Number(y.target.value);w&&w>255&&(y.target.value="255"),w&&w<0&&(y.target.value="0")}var f=y=>{var w=Number(y.target.value);w&&w>100&&(y.target.value="100"),w&&w<0&&(y.target.value="0")},h=(y,w,j)=>{typeof y=="number"&&(w==="a"&&(y<0&&(y=0),y>100&&(y=100),p&&p($t(pr(D({},g,{a:y/100}))))),y>255&&(y=255,j.target.value="255"),y<0&&(y=0,j.target.value="0"),w==="r"&&p&&p($t(pr(D({},g,{r:y})))),w==="g"&&p&&p($t(pr(D({},g,{g:y})))),w==="b"&&p&&p($t(pr(D({},g,{b:y})))))},v=g.a?Math.round(g.a*100)/100:0;return a.jsxs("div",D({ref:t,className:[r,d||""].filter(Boolean).join(" ")},m,{style:D({fontSize:11,display:"flex"},u),children:[a.jsx(Ft,D({label:"R",value:g.r||0,onBlur:b,placement:o,onChange:(y,w)=>h(w,"r",y)},i,{style:D({},i.style)})),a.jsx(Ft,D({label:"G",value:g.g||0,onBlur:b,placement:o,onChange:(y,w)=>h(w,"g",y)},s,{style:D({marginLeft:5},i.style)})),a.jsx(Ft,D({label:"B",value:g.b||0,onBlur:b,placement:o,onChange:(y,w)=>h(w,"b",y)},l,{style:D({marginLeft:5},l.style)})),c&&a.jsx(Ft,D({label:"A",value:parseInt(String(v*100),10),onBlur:f,placement:o,onChange:(y,w)=>h(w,"a",y)},c,{style:D({marginLeft:5},c.style)}))]}))});cc.displayName="EditableInputRGBA";var Ib=["prefixCls","className","hue","onChange","direction"],dc=_.forwardRef((e,t)=>{var{prefixCls:r="w-color-hue",className:n,hue:o=0,onChange:i,direction:s="horizontal"}=e,l=Be(e,Ib);return a.jsx(Cn,D({ref:t,className:r+" "+(n||"")},l,{direction:s,background:"linear-gradient(to "+(s==="horizontal"?"right":"bottom")+", rgb(255, 0, 0) 0%, rgb(255, 255, 0) 17%, rgb(0, 255, 0) 33%, rgb(0, 255, 255) 50%, rgb(0, 0, 255) 67%, rgb(255, 0, 255) 83%, rgb(255, 0, 0) 100%)",hsva:{h:o,s:100,v:100,a:o/360},onChange:(c,d)=>{i&&i({h:s==="horizontal"?360*d.left:360*d.top})}}))});dc.displayName="Hue";var Mb=["prefixCls","className","color","colors","style","rectProps","onChange","addonAfter","addonBefore","rectRender"],uc=_.forwardRef((e,t)=>{var{prefixCls:r="w-color-swatch",className:n,color:o,colors:i=[],style:s,rectProps:l={},onChange:c,addonAfter:d,addonBefore:u,rectRender:p}=e,m=Be(e,Mb),g=D({"--swatch-background-color":"rgb(144, 19, 254)",background:"var(--swatch-background-color)",height:15,width:15,marginRight:5,marginBottom:5,cursor:"pointer",position:"relative",outline:"none",borderRadius:2},l.style),b=(f,h)=>{c&&c(mr(f),$t(mr(f)),h)};return a.jsxs("div",D({ref:t},m,{className:[r,n||""].filter(Boolean).join(" "),style:D({display:"flex",flexWrap:"wrap",position:"relative"},s),children:[u&&_.isValidElement(u)&&u,i&&Array.isArray(i)&&i.map((f,h)=>{var v="",y="";typeof f=="string"&&(v=f,y=f),typeof f=="object"&&f.color&&(v=f.title||f.color,y=f.color);var w=o&&o.toLocaleLowerCase()===y.toLocaleLowerCase(),j=p&&p({title:v,color:y,checked:!!w,style:D({},g,{background:y}),onClick:N=>b(y,N)});if(j)return a.jsx(_.Fragment,{children:j},h);var C=l.children&&_.isValidElement(l.children)?_.cloneElement(l.children,{color:y,checked:w}):null;return a.jsx("div",D({tabIndex:0,title:v,onClick:N=>b(y,N)},l,{children:C,style:D({},g,{background:y})}),h)}),d&&_.isValidElement(d)&&d]}))});uc.displayName="Swatch";var zb=["prefixCls","className","onChange","width","presetColors","color","editableDisable","disableAlpha","style"],Db=["#D0021B","#F5A623","#f8e61b","#8B572A","#7ED321","#417505","#BD10E0","#9013FE","#4A90E2","#50E3C2","#B8E986","#000000","#4A4A4A","#9B9B9B","#FFFFFF"],pc=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"}}),mc=_.forwardRef((e,t)=>{var{prefixCls:r="w-color-sketch",className:n,onChange:o,width:i=218,presetColors:s=Db,color:l,editableDisable:c=!0,disableAlpha:d=!1,style:u}=e,p=Be(e,zb),[m,g]=_.useState({h:209,s:36,v:90,a:1});_.useEffect(()=>{typeof l=="string"&&na(l)&&g(mr(l)),typeof l=="object"&&g(l)},[l]);var b=N=>{g(N),o&&o($t(N))},f=(N,S)=>{typeof N=="string"&&na(N)&&/(3|6)/.test(String(N.length))&&b(mr(N))},h=N=>b(D({},m,{a:N.a})),v=N=>b(D({},m,N,{a:m.a})),y=D({"--sketch-background":"rgb(255, 255, 255)","--sketch-box-shadow":"rgb(0 0 0 / 15%) 0px 0px 0px 1px, rgb(0 0 0 / 15%) 0px 8px 16px","--sketch-swatch-box-shadow":"rgb(0 0 0 / 15%) 0px 0px 0px 1px inset","--sketch-alpha-box-shadow":"rgb(0 0 0 / 15%) 0px 0px 0px 1px inset, rgb(0 0 0 / 25%) 0px 0px 4px inset","--sketch-swatch-border-top":"1px solid rgb(238, 238, 238)",background:"var(--sketch-background)",borderRadius:4,boxShadow:"var(--sketch-box-shadow)",width:i},u),w={borderRadius:2,background:_b(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",D({},p,{className:r+" "+(n||""),ref:t,style:y,children:[a.jsxs("div",{style:{padding:"10px 10px 8px"},children:[a.jsx(lc,{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(dc,{width:"auto",height:10,hue:m.h,pointer:pc,innerProps:{style:{marginLeft:1,marginRight:5}},onChange:N=>b(D({},m,N))}),!d&&a.jsx(Cn,{width:"auto",height:10,hsva:m,pointer:pc,style:{marginTop:4},innerProps:{style:{marginLeft:1,marginRight:5}},onChange:h})]}),!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(_.Fragment,{})})]})]}),c&&a.jsxs("div",{style:{display:"flex",margin:"0 10px 3px 10px"},children:[a.jsx(Ft,{label:"Hex",value:ra(m).replace(/^#/,"").toLocaleUpperCase(),onChange:(N,S)=>f(S),style:{minWidth:58}}),a.jsx(cc,{hsva:m,style:{marginLeft:6},aProps:d?!1:{},onChange:N=>b(N.hsva)})]}),s&&s.length>0&&a.jsx(uc,{style:j,colors:s,color:ra(m),onChange:N=>b(N),rectProps:{style:C}})]}))});mc.displayName="Sketch";const fc=({selectedColor:e,handleColor:t,text:r,wrapperStyles:n})=>a.jsxs("div",{style:n,className:"ecr-admin-control",children:[a.jsxs("p",{className:"ecr-admin-control__label",children:[r,":"]}),a.jsxs("div",{className:"ecr-admin-control__row ecr-admin-control__row--color",children:[a.jsxs(Je,{children:[a.jsx(Ze,{style:{padding:0,backgroundColor:"transparent"},children:a.jsx("div",{style:{backgroundColor:e},className:"ecr-admin-control__swatch"})}),a.jsx(Qe,{className:"ecr-admin-popover ecr-admin-color-selector-popover",children:a.jsx(mc,{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:fm},{value:"center",title:"Align Center",Icon:hm},{value:"right",title:"Align Right",Icon:gm},{value:"hidden",title:"Hidden",Icon:xm}],Fb=({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(ne,{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))})]}),Bb=({styles:e,setStyles:t,setIsEdited:r})=>{const n=o=>{t(i=>{const s=o(i);return r(!0),s})};return a.jsxs("div",{className:"ecr-admin-group-title-customization__content",children:[a.jsx(Fb,{alignment:e.widgetTitle?.alignment??"hidden",handleWidgetTitleAlignment:o=>n(i=>({...i,widgetTitle:{...i.widgetTitle,alignment:o}}))}),a.jsx(fc,{selectedColor:e.widgetTitle?.color??"#000000",handleColor:o=>n(i=>({...i,widgetTitle:{...i.widgetTitle,color:o}})),text:"Title Color",wrapperStyles:{flexDirection:"row",justifyContent:"space-between",alignItems:"center"}}),a.jsx(ta,{label:"Font size",min:10,max:200,value:e?.widgetTitle?.fontSize??24,onChange:o=>n(i=>({...i,widgetTitle:{...i.widgetTitle,fontSize:o}})),name:"font_size",id:"font-size",hideSlider:!0,wrapperStyles:{flexDirection:"row",justifyContent:"space-between",alignItems:"center"}})]})},Ub=(e=700)=>{const[t,r]=_.useState(!1),n=_.useRef(null),o=_.useCallback(i=>{Gl(i),r(!0),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{r(!1)},e)},[e]);return _.useEffect(()=>()=>{n.current&&clearTimeout(n.current)},[]),[t,o]},Hb=({gid:e})=>{const[t,r]=Ub(),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(Bp,{color:"#ffffff",size:12})}),a.jsx("span",{className:$("ecr-admin-shortcode__tooltip",t?"ecr-admin-shortcode__tooltip--visible":"ecr-admin-shortcode__tooltip--hidden"),children:"Copied!"})]})]})},hc=_.createContext({requestLeave:e=>e()}),Vb=({value:e,children:t})=>a.jsx(hc.Provider,{value:e,children:t}),gc=()=>_.useContext(hc),Wb=({link:e,usedFor:t})=>a.jsx("div",{className:"ecr-product-card-one",style:{width:"100%"},children:a.jsx(qb,{link:e,usedFor:t})}),qb=({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||wn,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||wn,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(Hl,{className:"ecr-product-card-one__star"}),Number(e.rating).toString()]}):null,a.jsx("div",{className:"ecr-product-card-one__price",dangerouslySetInnerHTML:{__html:e.price}})]})]})]})}),Gb=({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})})},Nn=({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(Gb,{link:e,usedFor:t},e.btn_uuid)}),Bt=({title:e,styles:t})=>a.jsx("p",{className:"ecr-reel_title",style:t,children:e}),xc=({reel:e,styles:t,gid:r,togglingId:n,onRemove:o})=>{const i=Ne(),{requestLeave:s}=gc(),l=n===e.story_uuid,c=`?view=${X.cr}&from=${X.mg}&sid=${e.id}${r?`&gid=${r}`:""}`,d=t.appearance??"overlay",u={border:`${t?.border?.border_width}px solid ${t?.border?.border_color}`,borderRadius:t?.shape==="rectangle"?`${t?.border?.border_radius}px`:"50%",aspectRatio:t?.shape==="rectangle"?"9/16":"1/1"},p=t.border.border_radius,m=p>50?p+16:p>20?p:0,g=e.links&&e.links.length>0?e.links[0]:null,b=d==="none",f=d==="title",h=t.shape==="rectangle",v=!b&&!f&&g;return a.jsxs("div",{className:$("ecr-admin-reelitem",t?.hoverEffect),children:[a.jsxs("div",{style:u,className:"ecr-admin-reelitem__frame",children:[a.jsx(to,{story:e,styles:t}),!b&&!f&&h?v?a.jsx(Nn,{link:g,usedFor:"admin",usedIn:"thumb",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"4px",width:"calc(100% - 8px)",borderRadius:"6px"}}):a.jsx(Bt,{title:e.title,styles:{width:`calc(95% - ${m}px)`}}):null,a.jsxs("div",{className:"ecr-admin-reelitem__actions",children:[a.jsx(ne,{title:"Edit Story",size:"icon-sm",asChild:!0,className:"ecr-admin-reelitem__button",disabled:l,children:a.jsx(vt,{to:c,className:$("ecr-admin-reelitem__link",l?"ecr-admin-reelitem__link--disabled":"ecr-admin-reelitem__link--active"),onClick:y=>{y.preventDefault(),s(()=>i(c))},children:a.jsx(Pr,{className:"ecr-admin-reelitem__icon"})})}),a.jsx(ne,{onClick:()=>o(e,"remove"),className:"ecr-admin-reelitem__button ecr-admin-reelitem__button--danger",size:"icon-sm",title:"Remove Story",disabled:l,children:l?a.jsx(it,{className:"ecr-admin-reelitem__spinner",size:18}):a.jsx(Gn,{size:18})})]})]}),f?a.jsx("p",{className:"ecr-admin-reel__title",children:e.title}):null]})},bc=(e,t)=>{const r=_.useRef(null),n=_.useRef(null),o=_.useRef(null),[i,s]=_.useState(!1),[l,c]=_.useState(!1),[d,u]=_.useState(!1),[p,m]=_.useState(300),g=()=>{const f=r.current;if(!f)return;const h=f.scrollLeft,v=f.scrollWidth,y=f.clientWidth;c(h>0),u(h+y<v-1)};_.useEffect(()=>{const f=r.current,h=n.current;f&&h&&(s(h.scrollWidth>f.clientWidth),m(f.clientWidth-100),g())},[e,t]);const b=f=>{const h=r.current;h&&(h.scrollBy({left:f,behavior:"smooth"}),o.current&&clearTimeout(o.current),o.current=setTimeout(g,300))};return _.useEffect(()=>{const f=r.current;if(!f)return;let h=!1,v,y;const w=A=>{h=!0,v=A.pageX-f.offsetLeft,y=f.scrollLeft,f.style.cursor="grabbing"},j=()=>{h=!1,f.style.cursor="default"},C=()=>{h=!1,f.style.cursor="default"},N=A=>{if(!h)return;A.preventDefault();const L=(A.pageX-f.offsetLeft-v)*1.5;f.scrollLeft=y-L,g()},S=A=>{h=!0,v=A.touches[0].pageX-f.offsetLeft,y=f.scrollLeft},E=()=>{h=!1},T=A=>{if(!h)return;const L=(A.touches[0].pageX-f.offsetLeft-v)*1.5;f.scrollLeft=y-L,g()};return f.addEventListener("mousedown",w),f.addEventListener("mouseleave",j),f.addEventListener("mouseup",C),f.addEventListener("mousemove",N),f.addEventListener("touchstart",S,{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",S),f.removeEventListener("touchend",E),f.removeEventListener("touchmove",T)}},[t]),_.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]),{thumbsContainerRef:r,thumbsWrapperRef:n,isOverflowing:i,canScrollLeft:l,canScrollRight:d,scrollBy:b,scrollStep:p}},_c=({reels:e,styles:t,gid:r,togglingId:n,handleRemoveReel:o})=>{const{thumbsContainerRef:i,thumbsWrapperRef:s,isOverflowing:l,canScrollLeft:c,canScrollRight:d,scrollBy:u,scrollStep:p}=bc([e],!0);return a.jsxs("div",{className:"ecr-admin-editor-carousel",children:[a.jsx("div",{ref:i,className:"ecr-admin-editor-carousel__viewport",children:a.jsx("div",{ref:s,style:{...!e.length&&{margin:"auto"}},className:$("ecr-admin-editor-carousel__track",t.hoverEffect==="zoom-in"&&"ecr-admin-editor-carousel__track--padded"),children:e.length>0?e.map(m=>a.jsx(xc,{reel:m,styles:t,gid:r,togglingId:n,onRemove:o},m.id)):a.jsx("div",{className:"ecr-admin-editor-carousel__empty",children:a.jsxs("p",{className:"ecr-admin-editor-carousel__empty-text",children:[a.jsx(lt,{className:"ecr-admin-editor-carousel__empty-icon"}),a.jsx("span",{children:"No reels have been added to this widget yet. Select some from the list on the left to get started."})]})})})}),l&&c&&a.jsx("button",{onClick:()=>u(-p),className:"ecr-admin-editor-carousel__nav ecr-admin-editor-carousel__nav--left",children:a.jsx(Vn,{size:20})}),l&&d&&a.jsx("button",{onClick:()=>u(p),className:"ecr-admin-editor-carousel__nav ecr-admin-editor-carousel__nav--right",children:a.jsx(Wn,{size:20})})]})},Kb=({reels:e,styles:t,gid:r,togglingId:n,handleRemoveReel:o})=>a.jsx("div",{className:$("ecr-admin-editor-grid",t?.hoverEffect==="zoom-in"&&"ecr-admin-editor-grid--padded"),children:e.length>0?e.map(i=>a.jsx(xc,{reel:i,styles:t,gid:r,togglingId:n,onRemove:o},i.id)):a.jsx("div",{className:"ecr-admin-editor-grid__empty",children:a.jsxs("p",{className:"ecr-admin-editor-grid__empty-text",children:[a.jsx(lt,{className:"ecr-admin-editor-grid__empty-icon"}),a.jsx("span",{children:"No reels have been added to this widget yet. Select some from the list on the left to get started."})]})})}),Yb=({reel:e,styles:t})=>{const r=Ar("(min-width: 1024px)"),n=e?.files?.[0],o=!!n?.mime_type?.startsWith("image"),[i,s]=_.useState(!1),[l,c]=_.useState(!0),[d,u]=_.useState(!1),p=_.useRef(null);_.useEffect(()=>{p.current&&(p.current.muted=l)},[l]),_.useEffect(()=>{p.current&&(i?p.current.pause():p.current.play().catch(()=>{}))},[i]);const m=()=>{p.current&&s(h=>!h)},g=()=>{p.current&&c(h=>!h)},b=t?.playerAppearance??"overlay",f=e.links&&e.links.length>0?e.links[0]:null;return a.jsxs("div",{className:"ecr-preview-player",children:[a.jsxs("div",{className:"ecr-preview-player__stage",children:[a.jsx(wt,{className:"ecr-player__nav--left ecr-preview-player__nav--disabled",type:"button",disabled:!0,"aria-disabled":"true",children:a.jsx(pi,{size:24})}),a.jsx(wt,{className:"ecr-player__nav--right ecr-preview-player__nav--disabled",type:"button",disabled:!0,"aria-disabled":"true",children:a.jsx(mi,{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,{size:r?20:24,className:"ecr-player__close-icon"})}),n?a.jsx("div",{className:"ecr-player__media-frame",children:o?a.jsx("img",{src:n.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:p,className:"ecr-preview-player__media-item",src:n.url,poster:e?.thumbnail,autoPlay:!0,muted:l,loop:!0,playsInline:!0,onClick:m,onLoadedMetadata:h=>{const v=h.currentTarget,y=v.videoWidth,w=v.videoHeight;u(()=>w>y)}}),a.jsxs("div",{className:"ecr-player__controls",children:[i?a.jsx(Jn,{size:r?20:24,className:"ecr-player__control-icon",onClick:m}):a.jsx(Xn,{size:r?20:24,className:"ecr-player__control-icon",onClick:m}),l?a.jsx(Qn,{size:r?20:24,className:"ecr-player__control-icon",onClick:g}):a.jsx(Zn,{size:r?20:24,className:"ecr-player__control-icon",onClick:g})]})]})}):a.jsx("div",{className:"ecr-preview-player__empty",children:"No preview available"})]}),b==="overlay"?f?a.jsx(Nn,{link:f,usedFor:"admin",usedIn:"thumb",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"8px",width:"95%",borderRadius:"6px"}}):a.jsx(Bt,{title:e.title}):null,b==="title"?a.jsx(Bt,{title:e.title}):null]}),a.jsxs("p",{className:"ecr-preview-message",children:["This is simply a ",a.jsx("strong",{children:"visual"})," representation intended to show how the preview will appear to end users."]})]})},Xb={carousel:_c,grid:Kb},Jb=({gid:e,reels:t,styles:r,handleRemoveReel:n,togglingId:o,currentTab:i})=>{const s=r.template??"carousel",l=Xb[s]||_c;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(Hb,{gid:e})]}),a.jsx("div",{className:"scrollbarThin ecr-admin-existing__body",children:i==="thumbnail"?a.jsx("div",{style:{"--thumbnail-size":`${r?.size}px`,"--thumbnail-size-tab":`${r?.sizeOnTab??r?.size}px`,"--thumbnail-size-mobile":`${r?.sizeOnMobile??r?.size}px`,"--thumbnail-gap":`${r?.gap}px`,"--thumbnail-gap-tab":`${r?.gapOnTab??r?.gap}px`,"--thumbnail-gap-mobile":`${r?.gapOnMobile??r?.gap}px`,"--thumbnail-border-radius":`${r?.border?.border_radius}px`},children:a.jsx(l,{reels:t,styles:r,gid:e,togglingId:o,handleRemoveReel:n})}):t.length>0?a.jsx(Yb,{reel:t[0],styles:r}):a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,alignItems:"center"},children:[a.jsx(lt,{style:{width:"40px",height:"40px",color:"#f59e0b"}}),"No reels available for preview."]})})]})},vc=()=>a.jsx("div",{className:"ecr-admin-reellist__loader",children:a.jsx("div",{className:"ecr-admin-reellist__spinner"})}),Zb=({gid:e,allReels:t,handleSelectReel:r,searchTerm:n,setSearchTerm:o,isSearching:i,togglingId:s,lastStoryElementRef:l})=>{const c=Ne(),{requestLeave:d}=gc(),u=`?view=${X.cr}&from=${X.mg}${e?`&gid=${e}`:""}`,p=t.filter(m=>!m?.files[0]?.mime_type.startsWith("image"));return a.jsxs("div",{className:"ecr-admin-reellist",children:[a.jsxs("div",{className:"ecr-admin-reellist__header",children:[a.jsx("p",{className:"ecr-admin-reellist__title",children:"All reels"}),a.jsx("small",{className:"ecr-admin-reellist__subtitle",children:"Choose reels to attach in this widget"})]}),a.jsxs("div",{className:"ecr-admin-reellist__body",children:[a.jsx(Rr,{to:u,text:"Add Reel",Icon:yt,className:"ecr-admin-reellist__add-button",textColor:"#2563eb",onNavigate:m=>d(()=>c(m))}),a.jsx("div",{className:"ecr-admin-reellist__search",children:a.jsx("input",{type:"text",placeholder:"Search reels...",value:n,onChange:m=>o(m.target.value),className:"ecr-admin-reellist__search-input"})}),a.jsx("div",{className:"scrollbarThin ecr-admin-reellist__grid",children:i&&t.length===0?a.jsx(vc,{}):a.jsxs("div",{className:"ecr-admin-reellist__items",children:[p.length===0?a.jsx("p",{className:"ecr-admin-reellist__empty",children:"No reels are available to add."}):p.map((m,g)=>a.jsx("div",{ref:p.length===g+1?l:null,className:"ecr-admin-reellist__item",children:a.jsxs("button",{title:"Click to add this reel",onClick:()=>r(m,"add"),disabled:s==m.story_uuid,className:"ecr-admin-reellist__card",children:[a.jsx("div",{className:"ecr-admin-reellist__media",children:a.jsx("video",{className:"ecr-admin-reellist__thumb",src:m?.files[0]?.url,poster:m?.thumbnail})}),a.jsx("span",{className:"ecr-admin-reellist__label",children:m.title||`Reel #${m.id}`}),s==m.story_uuid?a.jsx("div",{className:"ecr-admin-reellist__overlay",children:a.jsx(it,{className:"ecr-admin-reellist__overlay-icon"})}):null]})},m.id)),i&&t.length>0&&a.jsx(vc,{})]})})]})]})};function yc(e){const t=e+"CollectionProvider",[r,n]=Ve(t),[o,i]=r(t,{collectionRef:{current:null},itemMap:new Map}),s=f=>{const{scope:h,children:v}=f,y=_.useRef(null),w=_.useRef(new Map).current;return a.jsx(o,{scope:h,itemMap:w,collectionRef:y,children:v})};s.displayName=t;const l=e+"CollectionSlot",c=st(l),d=_.forwardRef((f,h)=>{const{scope:v,children:y}=f,w=i(l,v),j=J(h,w.collectionRef);return a.jsx(c,{ref:j,children:y})});d.displayName=l;const u=e+"CollectionItemSlot",p="data-radix-collection-item",m=st(u),g=_.forwardRef((f,h)=>{const{scope:v,children:y,...w}=f,j=_.useRef(null),C=J(h,j),N=i(u,v);return _.useEffect(()=>(N.itemMap.set(j,{ref:j,...w}),()=>void N.itemMap.delete(j))),a.jsx(m,{[p]:"",ref:C,children:y})});g.displayName=u;function b(f){const h=i(e+"CollectionConsumer",f);return _.useCallback(()=>{const y=h.collectionRef.current;if(!y)return[];const w=Array.from(y.querySelectorAll(`[${p}]`));return Array.from(h.itemMap.values()).sort((N,S)=>w.indexOf(N.ref.current)-w.indexOf(S.ref.current))},[h.collectionRef,h.itemMap])}return[{Provider:s,Slot:d,ItemSlot:g},b,n]}var Qb=x.createContext(void 0);function aa(e){const t=x.useContext(Qb);return e||t||"ltr"}var ia="rovingFocusGroup.onEntryFocus",e_={bubbles:!1,cancelable:!0},hr="RovingFocusGroup",[sa,wc,t_]=yc(hr),[r_,jc]=Ve(hr,[t_]),[n_,o_]=r_(hr),kc=x.forwardRef((e,t)=>a.jsx(sa.Provider,{scope:e.__scopeRovingFocusGroup,children:a.jsx(sa.Slot,{scope:e.__scopeRovingFocusGroup,children:a.jsx(a_,{...e,ref:t})})}));kc.displayName=hr;var a_=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:u=!1,...p}=e,m=x.useRef(null),g=J(t,m),b=aa(i),[f,h]=mt({prop:s,defaultProp:l??null,onChange:c,caller:hr}),[v,y]=x.useState(!1),w=We(d),j=wc(r),C=x.useRef(!1),[N,S]=x.useState(0);return x.useEffect(()=>{const E=m.current;if(E)return E.addEventListener(ia,w),()=>E.removeEventListener(ia,w)},[w]),a.jsx(n_,{scope:r,orientation:n,dir:b,loop:o,currentTabStopId:f,onItemFocus:x.useCallback(E=>h(E),[h]),onItemShiftTab:x.useCallback(()=>y(!0),[]),onFocusableItemAdd:x.useCallback(()=>S(E=>E+1),[]),onFocusableItemRemove:x.useCallback(()=>S(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:H(e.onMouseDown,()=>{C.current=!0}),onFocus:H(e.onFocus,E=>{const T=!C.current;if(E.target===E.currentTarget&&T&&!v){const A=new CustomEvent(ia,e_);if(E.currentTarget.dispatchEvent(A),!A.defaultPrevented){const R=j().filter(P=>P.focusable),L=R.find(P=>P.active),B=R.find(P=>P.id===f),O=[L,B,...R].filter(Boolean).map(P=>P.ref.current);Nc(O,u)}}C.current=!1}),onBlur:H(e.onBlur,()=>y(!1))})})}),Sc="RovingFocusGroupItem",Cc=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:o=!1,tabStopId:i,children:s,...l}=e,c=Ae(),d=i||c,u=o_(Sc,r),p=u.currentTabStopId===d,m=wc(r),{onFocusableItemAdd:g,onFocusableItemRemove:b,currentTabStopId:f}=u;return x.useEffect(()=>{if(n)return g(),()=>b()},[n,g,b]),a.jsx(sa.ItemSlot,{scope:r,id:d,focusable:n,active:o,children:a.jsx(W.span,{tabIndex:p?0:-1,"data-orientation":u.orientation,...l,ref:t,onMouseDown:H(e.onMouseDown,h=>{n?u.onItemFocus(d):h.preventDefault()}),onFocus:H(e.onFocus,()=>u.onItemFocus(d)),onKeyDown:H(e.onKeyDown,h=>{if(h.key==="Tab"&&h.shiftKey){u.onItemShiftTab();return}if(h.target!==h.currentTarget)return;const v=l_(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?c_(w,j+1):w.slice(j+1)}setTimeout(()=>Nc(w))}}),children:typeof s=="function"?s({isCurrentTabStop:p,hasTabStop:f!=null}):s})})});Cc.displayName=Sc;var i_={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function s_(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function l_(e,t,r){const n=s_(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return i_[n]}function Nc(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function c_(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var d_=kc,u_=Cc,En="Tabs",[p_]=Ve(En,[jc]),Ec=jc(),[m_,la]=p_(En),Tc=x.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,onValueChange:o,defaultValue:i,orientation:s="horizontal",dir:l,activationMode:c="automatic",...d}=e,u=aa(l),[p,m]=mt({prop:n,onChange:o,defaultProp:i??"",caller:En});return a.jsx(m_,{scope:r,baseId:Ae(),value:p,onValueChange:m,orientation:s,dir:u,activationMode:c,children:a.jsx(W.div,{dir:u,"data-orientation":s,...d,ref:t})})});Tc.displayName=En;var Ac="TabsList",Pc=x.forwardRef((e,t)=>{const{__scopeTabs:r,loop:n=!0,...o}=e,i=la(Ac,r),s=Ec(r);return a.jsx(d_,{asChild:!0,...s,orientation:i.orientation,dir:i.dir,loop:n,children:a.jsx(W.div,{role:"tablist","aria-orientation":i.orientation,...o,ref:t})})});Pc.displayName=Ac;var Oc="TabsTrigger",Rc=x.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,disabled:o=!1,...i}=e,s=la(Oc,r),l=Ec(r),c=Mc(s.baseId,n),d=zc(s.baseId,n),u=n===s.value;return a.jsx(u_,{asChild:!0,...l,focusable:!o,active:u,children:a.jsx(W.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":d,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:c,...i,ref:t,onMouseDown:H(e.onMouseDown,p=>{!o&&p.button===0&&p.ctrlKey===!1?s.onValueChange(n):p.preventDefault()}),onKeyDown:H(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&s.onValueChange(n)}),onFocus:H(e.onFocus,()=>{const p=s.activationMode!=="manual";!u&&!o&&p&&s.onValueChange(n)})})})});Rc.displayName=Oc;var Lc="TabsContent",Ic=x.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,forceMount:o,children:i,...s}=e,l=la(Lc,r),c=Mc(l.baseId,n),d=zc(l.baseId,n),u=n===l.value,p=x.useRef(u);return x.useEffect(()=>{const m=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(m)},[]),a.jsx(Ye,{present:o||u,children:({present:m})=>a.jsx(W.div,{"data-state":u?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!m,id:d,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:m&&i})})});Ic.displayName=Lc;function Mc(e,t){return`${e}-trigger-${t}`}function zc(e,t){return`${e}-content-${t}`}var f_=Tc,h_=Pc,g_=Rc,x_=Ic;function b_({className:e,...t}){return a.jsx(f_,{"data-slot":"tabs",className:$("ecr-tabs",e),...t})}function __({className:e,...t}){return a.jsx(h_,{"data-slot":"tabs-list",className:$("ecr-tabs__list",e),...t})}function Dc({className:e,...t}){return a.jsx(g_,{"data-slot":"tabs-trigger",className:$("ecr-tabs__trigger",e),...t})}function $c({className:e,...t}){return a.jsx(x_,{"data-slot":"tabs-content",className:$("ecr-tabs__content",e),...t})}const Ut=({label:e,text:t})=>a.jsxs(Je,{children:[a.jsx(Ze,{style:{textAlign:"left",padding:0,backgroundColor:"transparent"},children:a.jsxs("label",{className:"ecr-admin-switch",children:[a.jsxs("span",{className:"ecr-admin-switch__label",children:[e,": ",a.jsx(at,{size:20})]}),a.jsx(fb,{className:"ecr-admin-switch__icon",size:24})]})}),a.jsx(Qe,{className:"ecr-admin-popover",children:a.jsx(ft,{name:e,text:t})})]});function Fc(e,[t,r]){return Math.min(r,Math.max(t,e))}function v_(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 Bc=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"}),y_="VisuallyHidden",w_=x.forwardRef((e,t)=>a.jsx(W.span,{...e,ref:t,style:{...Bc,...e.style}}));w_.displayName=y_;var j_=[" ","Enter","ArrowUp","ArrowDown"],k_=[" ","Enter"],gt="Select",[Tn,An,S_]=yc(gt),[Ht]=Ve(gt,[S_,on]),Pn=on(),[C_,tt]=Ht(gt),[N_,E_]=Ht(gt),Uc=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:o,onOpenChange:i,value:s,defaultValue:l,onValueChange:c,dir:d,name:u,autoComplete:p,disabled:m,required:g,form:b}=e,f=Pn(t),[h,v]=x.useState(null),[y,w]=x.useState(null),[j,C]=x.useState(!1),N=aa(d),[S,E]=mt({prop:n,defaultProp:o??!1,onChange:i,caller:gt}),[T,A]=mt({prop:s,defaultProp:l,onChange:c,caller:gt}),R=x.useRef(null),L=h?b||!!h.closest("form"):!0,[B,M]=x.useState(new Set),O=Array.from(B).map(P=>P.props.value).join(";");return a.jsx(Ys,{...f,children:a.jsxs(C_,{required:g,scope:t,trigger:h,onTriggerChange:v,valueNode:y,onValueNodeChange:w,valueNodeHasChildren:j,onValueNodeHasChildrenChange:C,contentId:Ae(),value:T,onValueChange:A,open:S,onOpenChange:E,dir:N,triggerPointerDownPosRef:R,disabled:m,children:[a.jsx(Tn.Provider,{scope:t,children:a.jsx(N_,{scope:e.__scopeSelect,onNativeOptionAdd:x.useCallback(P=>{M(z=>new Set(z).add(P))},[]),onNativeOptionRemove:x.useCallback(P=>{M(z=>{const I=new Set(z);return I.delete(P),I})},[]),children:r})}),L?a.jsxs(dd,{"aria-hidden":!0,required:g,tabIndex:-1,name:u,autoComplete:p,value:T,onChange:P=>A(P.target.value),disabled:m,form:b,children:[T===void 0?a.jsx("option",{value:""}):null,Array.from(B)]},O):null]})})};Uc.displayName=gt;var Hc="SelectTrigger",Vc=x.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...o}=e,i=Pn(r),s=tt(Hc,r),l=s.disabled||n,c=J(t,s.onTriggerChange),d=An(r),u=x.useRef("touch"),[p,m,g]=pd(f=>{const h=d().filter(w=>!w.disabled),v=h.find(w=>w.value===s.value),y=md(h,f,v);y!==void 0&&s.onValueChange(y.value)}),b=f=>{l||(s.onOpenChange(!0),g()),f&&(s.triggerPointerDownPosRef.current={x:Math.round(f.pageX),y:Math.round(f.pageY)})};return a.jsx(Lo,{asChild:!0,...i,children:a.jsx(W.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":ud(s.value)?"":void 0,...o,ref:c,onClick:H(o.onClick,f=>{f.currentTarget.focus(),u.current!=="mouse"&&b(f)}),onPointerDown:H(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:H(o.onKeyDown,f=>{const h=p.current!=="";!(f.ctrlKey||f.altKey||f.metaKey)&&f.key.length===1&&m(f.key),!(h&&f.key===" ")&&j_.includes(f.key)&&(b(),f.preventDefault())})})})});Vc.displayName=Hc;var Wc="SelectValue",qc=x.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,children:i,placeholder:s="",...l}=e,c=tt(Wc,r),{onValueNodeHasChildrenChange:d}=c,u=i!==void 0,p=J(t,c.onValueNodeChange);return le(()=>{d(u)},[d,u]),a.jsx(W.span,{...l,ref:p,style:{pointerEvents:"none"},children:ud(c.value)?a.jsx(a.Fragment,{children:s}):i})});qc.displayName=Wc;var T_="SelectIcon",Gc=x.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...o}=e;return a.jsx(W.span,{"aria-hidden":!0,...o,ref:t,children:n||"▼"})});Gc.displayName=T_;var A_="SelectPortal",Kc=e=>a.jsx(an,{asChild:!0,...e});Kc.displayName=A_;var xt="SelectContent",Yc=x.forwardRef((e,t)=>{const r=tt(xt,e.__scopeSelect),[n,o]=x.useState();if(le(()=>{o(new DocumentFragment)},[]),!r.open){const i=n;return i?xr.createPortal(a.jsx(Xc,{scope:e.__scopeSelect,children:a.jsx(Tn.Slot,{scope:e.__scopeSelect,children:a.jsx("div",{children:e.children})})}),i):null}return a.jsx(Jc,{...e,ref:t})});Yc.displayName=xt;var Ce=10,[Xc,rt]=Ht(xt),P_="SelectContentImpl",O_=st("SelectContent.RemoveScroll"),Jc=x.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:s,side:l,sideOffset:c,align:d,alignOffset:u,arrowPadding:p,collisionBoundary:m,collisionPadding:g,sticky:b,hideWhenDetached:f,avoidCollisions:h,...v}=e,y=tt(xt,r),[w,j]=x.useState(null),[C,N]=x.useState(null),S=J(t,F=>j(F)),[E,T]=x.useState(null),[A,R]=x.useState(null),L=An(r),[B,M]=x.useState(!1),O=x.useRef(!1);x.useEffect(()=>{if(w)return Mo(w)},[w]),bo();const P=x.useCallback(F=>{const[Y,...se]=L().map(ae=>ae.ref.current),[Z]=se.slice(-1),ee=document.activeElement;for(const ae of F)if(ae===ee||(ae?.scrollIntoView({block:"nearest"}),ae===Y&&C&&(C.scrollTop=0),ae===Z&&C&&(C.scrollTop=C.scrollHeight),ae?.focus(),document.activeElement!==ee))return},[L,C]),z=x.useCallback(()=>P([E,w]),[P,E,w]);x.useEffect(()=>{B&&z()},[B,z]);const{onOpenChange:I,triggerPointerDownPosRef:q}=y;x.useEffect(()=>{if(w){let F={x:0,y:0};const Y=Z=>{F={x:Math.abs(Math.round(Z.pageX)-(q.current?.x??0)),y:Math.abs(Math.round(Z.pageY)-(q.current?.y??0))}},se=Z=>{F.x<=10&&F.y<=10?Z.preventDefault():w.contains(Z.target)||I(!1),document.removeEventListener("pointermove",Y),q.current=null};return q.current!==null&&(document.addEventListener("pointermove",Y),document.addEventListener("pointerup",se,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Y),document.removeEventListener("pointerup",se,{capture:!0})}}},[w,I,q]),x.useEffect(()=>{const F=()=>I(!1);return window.addEventListener("blur",F),window.addEventListener("resize",F),()=>{window.removeEventListener("blur",F),window.removeEventListener("resize",F)}},[I]);const[te,oe]=pd(F=>{const Y=L().filter(ee=>!ee.disabled),se=Y.find(ee=>ee.ref.current===document.activeElement),Z=md(Y,F,se);Z&&setTimeout(()=>Z.ref.current.focus())}),ge=x.useCallback((F,Y,se)=>{const Z=!O.current&&!se;(y.value!==void 0&&y.value===Y||Z)&&(T(F),Z&&(O.current=!0))},[y.value]),_e=x.useCallback(()=>w?.focus(),[w]),pe=x.useCallback((F,Y,se)=>{const Z=!O.current&&!se;(y.value!==void 0&&y.value===Y||Z)&&R(F)},[y.value]),K=n==="popper"?ca:Zc,de=K===ca?{side:l,sideOffset:c,align:d,alignOffset:u,arrowPadding:p,collisionBoundary:m,collisionPadding:g,sticky:b,hideWhenDetached:f,avoidCollisions:h}:{};return a.jsx(Xc,{scope:r,content:w,viewport:C,onViewportChange:N,itemRefCallback:ge,selectedItem:E,onItemLeave:_e,itemTextRefCallback:pe,focusSelectedItem:z,selectedItemText:A,position:n,isPositioned:B,searchRef:te,children:a.jsx(hn,{as:O_,allowPinchZoom:!0,children:a.jsx(Gr,{asChild:!0,trapped:y.open,onMountAutoFocus:F=>{F.preventDefault()},onUnmountAutoFocus:H(o,F=>{y.trigger?.focus({preventScroll:!0}),F.preventDefault()}),children:a.jsx(qr,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:F=>F.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:a.jsx(K,{role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed",dir:y.dir,onContextMenu:F=>F.preventDefault(),...v,...de,onPlaced:()=>M(!0),ref:S,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:H(v.onKeyDown,F=>{const Y=F.ctrlKey||F.altKey||F.metaKey;if(F.key==="Tab"&&F.preventDefault(),!Y&&F.key.length===1&&oe(F.key),["ArrowUp","ArrowDown","Home","End"].includes(F.key)){let Z=L().filter(ee=>!ee.disabled).map(ee=>ee.ref.current);if(["ArrowUp","End"].includes(F.key)&&(Z=Z.slice().reverse()),["ArrowUp","ArrowDown"].includes(F.key)){const ee=F.target,ae=Z.indexOf(ee);Z=Z.slice(ae+1)}setTimeout(()=>P(Z)),F.preventDefault()}})})})})})})});Jc.displayName=P_;var R_="SelectItemAlignedPosition",Zc=x.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...o}=e,i=tt(xt,r),s=rt(xt,r),[l,c]=x.useState(null),[d,u]=x.useState(null),p=J(t,S=>u(S)),m=An(r),g=x.useRef(!1),b=x.useRef(!0),{viewport:f,selectedItem:h,selectedItemText:v,focusSelectedItem:y}=s,w=x.useCallback(()=>{if(i.trigger&&i.valueNode&&l&&d&&f&&h&&v){const S=i.trigger.getBoundingClientRect(),E=d.getBoundingClientRect(),T=i.valueNode.getBoundingClientRect(),A=v.getBoundingClientRect();if(i.dir!=="rtl"){const ee=A.left-E.left,ae=T.left-ee,ve=S.left-ae,bt=S.width+ve,_a=Math.max(bt,E.width),va=window.innerWidth-Ce,ya=Fc(ae,[Ce,Math.max(Ce,va-_a)]);l.style.minWidth=bt+"px",l.style.left=ya+"px"}else{const ee=E.right-A.right,ae=window.innerWidth-T.right-ee,ve=window.innerWidth-S.right-ae,bt=S.width+ve,_a=Math.max(bt,E.width),va=window.innerWidth-Ce,ya=Fc(ae,[Ce,Math.max(Ce,va-_a)]);l.style.minWidth=bt+"px",l.style.right=ya+"px"}const R=m(),L=window.innerHeight-Ce*2,B=f.scrollHeight,M=window.getComputedStyle(d),O=parseInt(M.borderTopWidth,10),P=parseInt(M.paddingTop,10),z=parseInt(M.borderBottomWidth,10),I=parseInt(M.paddingBottom,10),q=O+P+B+I+z,te=Math.min(h.offsetHeight*5,q),oe=window.getComputedStyle(f),ge=parseInt(oe.paddingTop,10),_e=parseInt(oe.paddingBottom,10),pe=S.top+S.height/2-Ce,K=L-pe,de=h.offsetHeight/2,F=h.offsetTop+de,Y=O+P+F,se=q-Y;if(Y<=pe){const ee=R.length>0&&h===R[R.length-1].ref.current;l.style.bottom="0px";const ae=d.clientHeight-f.offsetTop-f.offsetHeight,ve=Math.max(K,de+(ee?_e:0)+ae+z),bt=Y+ve;l.style.height=bt+"px"}else{const ee=R.length>0&&h===R[0].ref.current;l.style.top="0px";const ve=Math.max(pe,O+f.offsetTop+(ee?ge:0)+de)+se;l.style.height=ve+"px",f.scrollTop=Y-pe+f.offsetTop}l.style.margin=`${Ce}px 0`,l.style.minHeight=te+"px",l.style.maxHeight=L+"px",n?.(),requestAnimationFrame(()=>g.current=!0)}},[m,i.trigger,i.valueNode,l,d,f,h,v,i.dir,n]);le(()=>w(),[w]);const[j,C]=x.useState();le(()=>{d&&C(window.getComputedStyle(d).zIndex)},[d]);const N=x.useCallback(S=>{S&&b.current===!0&&(w(),y?.(),b.current=!1)},[w,y]);return a.jsx(I_,{scope:r,contentWrapper:l,shouldExpandOnScrollRef:g,onScrollButtonChange:N,children:a.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:j},children:a.jsx(W.div,{...o,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});Zc.displayName=R_;var L_="SelectPopperPosition",ca=x.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:o=Ce,...i}=e,s=Pn(r);return a.jsx(Xs,{...s,...i,ref:t,align:n,collisionPadding:o,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});ca.displayName=L_;var[I_,da]=Ht(xt,{}),ua="SelectViewport",Qc=x.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...o}=e,i=rt(ua,r),s=da(ua,r),l=J(t,i.onViewportChange),c=x.useRef(0);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),a.jsx(Tn.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:H(o.onScroll,d=>{const u=d.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:m}=s;if(m?.current&&p){const g=Math.abs(c.current-u.scrollTop);if(g>0){const b=window.innerHeight-Ce*2,f=parseFloat(p.style.minHeight),h=parseFloat(p.style.height),v=Math.max(f,h);if(v<b){const y=v+g,w=Math.min(b,y),j=y-w;p.style.height=w+"px",p.style.bottom==="0px"&&(u.scrollTop=j>0?j:0,p.style.justifyContent="flex-end")}}}c.current=u.scrollTop})})})]})});Qc.displayName=ua;var ed="SelectGroup",[M_,z_]=Ht(ed),D_=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=Ae();return a.jsx(M_,{scope:r,id:o,children:a.jsx(W.div,{role:"group","aria-labelledby":o,...n,ref:t})})});D_.displayName=ed;var td="SelectLabel",$_=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=z_(td,r);return a.jsx(W.div,{id:o.id,...n,ref:t})});$_.displayName=td;var On="SelectItem",[F_,rd]=Ht(On),nd=x.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:o=!1,textValue:i,...s}=e,l=tt(On,r),c=rt(On,r),d=l.value===n,[u,p]=x.useState(i??""),[m,g]=x.useState(!1),b=J(t,y=>c.itemRefCallback?.(y,n,o)),f=Ae(),h=x.useRef("touch"),v=()=>{o||(l.onValueChange(n),l.onOpenChange(!1))};if(n==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return a.jsx(F_,{scope:r,value:n,disabled:o,textId:f,isSelected:d,onItemTextChange:x.useCallback(y=>{p(w=>w||(y?.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,...s,ref:b,onFocus:H(s.onFocus,()=>g(!0)),onBlur:H(s.onBlur,()=>g(!1)),onClick:H(s.onClick,()=>{h.current!=="mouse"&&v()}),onPointerUp:H(s.onPointerUp,()=>{h.current==="mouse"&&v()}),onPointerDown:H(s.onPointerDown,y=>{h.current=y.pointerType}),onPointerMove:H(s.onPointerMove,y=>{h.current=y.pointerType,o?c.onItemLeave?.():h.current==="mouse"&&y.currentTarget.focus({preventScroll:!0})}),onPointerLeave:H(s.onPointerLeave,y=>{y.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:H(s.onKeyDown,y=>{c.searchRef?.current!==""&&y.key===" "||(k_.includes(y.key)&&v(),y.key===" "&&y.preventDefault())})})})})});nd.displayName=On;var gr="SelectItemText",od=x.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,...i}=e,s=tt(gr,r),l=rt(gr,r),c=rd(gr,r),d=E_(gr,r),[u,p]=x.useState(null),m=J(t,v=>p(v),c.onItemTextChange,v=>l.itemTextRefCallback?.(v,c.value,c.disabled)),g=u?.textContent,b=x.useMemo(()=>a.jsx("option",{value:c.value,disabled:c.disabled,children:g},c.value),[c.disabled,c.value,g]),{onNativeOptionAdd:f,onNativeOptionRemove:h}=d;return le(()=>(f(b),()=>h(b)),[f,h,b]),a.jsxs(a.Fragment,{children:[a.jsx(W.span,{id:c.textId,...i,ref:m}),c.isSelected&&s.valueNode&&!s.valueNodeHasChildren?xr.createPortal(i.children,s.valueNode):null]})});od.displayName=gr;var ad="SelectItemIndicator",id=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return rd(ad,r).isSelected?a.jsx(W.span,{"aria-hidden":!0,...n,ref:t}):null});id.displayName=ad;var pa="SelectScrollUpButton",sd=x.forwardRef((e,t)=>{const r=rt(pa,e.__scopeSelect),n=da(pa,e.__scopeSelect),[o,i]=x.useState(!1),s=J(t,n.onScrollButtonChange);return le(()=>{if(r.viewport&&r.isPositioned){let l=function(){const d=c.scrollTop>0;i(d)};const c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),o?a.jsx(cd,{...e,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});sd.displayName=pa;var ma="SelectScrollDownButton",ld=x.forwardRef((e,t)=>{const r=rt(ma,e.__scopeSelect),n=da(ma,e.__scopeSelect),[o,i]=x.useState(!1),s=J(t,n.onScrollButtonChange);return le(()=>{if(r.viewport&&r.isPositioned){let l=function(){const d=c.scrollHeight-c.clientHeight,u=Math.ceil(c.scrollTop)<d;i(u)};const c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),o?a.jsx(cd,{...e,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});ld.displayName=ma;var cd=x.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...o}=e,i=rt("SelectScrollButton",r),s=x.useRef(null),l=An(r),c=x.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return x.useEffect(()=>()=>c(),[c]),le(()=>{l().find(u=>u.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),a.jsx(W.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:H(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(n,50))}),onPointerMove:H(o.onPointerMove,()=>{i.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(n,50))}),onPointerLeave:H(o.onPointerLeave,()=>{c()})})}),B_="SelectSeparator",U_=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return a.jsx(W.div,{"aria-hidden":!0,...n,ref:t})});U_.displayName=B_;var fa="SelectArrow",H_=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=Pn(r),i=tt(fa,r),s=rt(fa,r);return i.open&&s.position==="popper"?a.jsx(Js,{...o,...n,ref:t}):null});H_.displayName=fa;var V_="SelectBubbleInput",dd=x.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const o=x.useRef(null),i=J(n,o),s=v_(t);return x.useEffect(()=>{const l=o.current;if(!l)return;const c=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(c,"value").set;if(s!==t&&u){const p=new Event("change",{bubbles:!0});u.call(l,t),l.dispatchEvent(p)}},[s,t]),a.jsx(W.select,{...r,style:{...Bc,...r.style},ref:i,defaultValue:t})});dd.displayName=V_;function ud(e){return e===""||e===void 0}function pd(e){const t=We(e),r=x.useRef(""),n=x.useRef(0),o=x.useCallback(s=>{const l=r.current+s;t(l),(function c(d){r.current=d,window.clearTimeout(n.current),d!==""&&(n.current=window.setTimeout(()=>c(""),1e3))})(l)},[t]),i=x.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return x.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,o,i]}function md(e,t,r){const o=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,i=r?e.indexOf(r):-1;let s=W_(e,Math.max(i,0));o.length===1&&(s=s.filter(d=>d!==r));const c=s.find(d=>d.textValue.toLowerCase().startsWith(o.toLowerCase()));return c!==r?c:void 0}function W_(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var q_=Uc,G_=Vc,K_=qc,Y_=Gc,X_=Kc,J_=Yc,Z_=Qc,Q_=nd,ev=od,tv=id,rv=sd,nv=ld;function Vt({...e}){return a.jsx(q_,{"data-slot":"select",...e})}function Wt({...e}){return a.jsx(K_,{"data-slot":"select-value",...e})}function qt({className:e,size:t="default",children:r,...n}){return a.jsxs(G_,{"data-slot":"select-trigger","data-size":t,className:$("ecr-select__trigger",e),...n,children:[r,a.jsx(Y_,{asChild:!0,children:a.jsx(Yn,{className:"ecr-select__icon"})})]})}function Gt({className:e,children:t,position:r="popper",align:n="center",...o}){const i=typeof document<"u"?document.getElementById("ecommreels-admin-app")??document.body:void 0;return a.jsx(X_,{container:i,children:a.jsxs(J_,{"data-slot":"select-content",className:$("ecr-select__content",e),position:r,align:n,...o,children:[a.jsx(ov,{}),a.jsx(Z_,{className:$("ecr-select__viewport"),children:t}),a.jsx(av,{})]})})}function Kt({className:e,children:t,...r}){return a.jsxs(Q_,{"data-slot":"select-item",className:$("ecr-select__item",e),...r,children:[a.jsx("span",{className:"ecr-select__check",children:a.jsx(tv,{children:a.jsx($p,{className:"ecr-select__check-icon"})})}),a.jsx(ev,{children:t})]})}function ov({className:e,...t}){return a.jsx(rv,{"data-slot":"select-scroll-up-button",className:$("ecr-select__scroll-button",e),...t,children:a.jsx(Fp,{className:"ecr-select__icon"})})}function av({className:e,...t}){return a.jsx(nv,{"data-slot":"select-scroll-down-button",className:$("ecr-select__scroll-button",e),...t,children:a.jsx(Yn,{className:"ecr-select__icon"})})}const iv=({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(Vt,{value:e,onValueChange:t,children:[a.jsx(qt,{className:"ecr-admin-control__trigger",children:a.jsx(Wt,{placeholder:"Layout"})}),a.jsx(Gt,{children:Qu.map(r=>a.jsx(Kt,{value:r.value,className:"ecr-admin-control__option",children:r.label},r.value))})]})]}),sv={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 lv(){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(Vt,{defaultValue:ti[0].value,children:[a.jsx(qt,{className:"ecr-admin-control__trigger",children:a.jsx(Wt,{placeholder:"Layout"})}),a.jsxs(Gt,{children:[ti.map(e=>a.jsx(Kt,{value:e.value,className:"ecr-admin-control__option",children:e.label},e.value)),Xu.map(e=>a.jsx("div",{children:a.jsxs(Je,{modal:!0,children:[a.jsxs(Ze,{className:"ecr-admin-control__lock-trigger",children:[a.jsx("span",{className:"ecr-admin-control__option",children:e.label}),a.jsx(at,{size:18})]}),a.jsx(Qe,{className:"ecr-admin-control__popover",children:a.jsx(ft,{name:e.label,text:sv[e.value]})})]})},e.value))]})]})]})}const cv=({styles:e,updateStyles:t})=>a.jsxs("div",{className:"ecr-admin-thumb-controls",children:[a.jsx(Ut,{label:"Disable Preview",text:a.jsx(a.Fragment,{children:"Turn off previews for a cleaner look and a more focused browsing experience!"})}),a.jsx(lv,{}),a.jsx(iv,{appearance:e?.playerAppearance??"overlay",handleLinkLayout:r=>t(n=>({...n,playerAppearance:r}))})]});var Rn="Collapsible",[dv]=Ve(Rn),[uv,ha]=dv(Rn),fd=x.forwardRef((e,t)=>{const{__scopeCollapsible:r,open:n,defaultOpen:o,disabled:i,onOpenChange:s,...l}=e,[c,d]=mt({prop:n,defaultProp:o??!1,onChange:s,caller:Rn});return a.jsx(uv,{scope:r,disabled:i,contentId:Ae(),open:c,onOpenToggle:x.useCallback(()=>d(u=>!u),[d]),children:a.jsx(W.div,{"data-state":xa(c),"data-disabled":i?"":void 0,...l,ref:t})})});fd.displayName=Rn;var hd="CollapsibleTrigger",gd=x.forwardRef((e,t)=>{const{__scopeCollapsible:r,...n}=e,o=ha(hd,r);return a.jsx(W.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":xa(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...n,ref:t,onClick:H(e.onClick,o.onOpenToggle)})});gd.displayName=hd;var ga="CollapsibleContent",xd=x.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=ha(ga,e.__scopeCollapsible);return a.jsx(Ye,{present:r||o.open,children:({present:i})=>a.jsx(pv,{...n,ref:t,present:i})})});xd.displayName=ga;var pv=x.forwardRef((e,t)=>{const{__scopeCollapsible:r,present:n,children:o,...i}=e,s=ha(ga,r),[l,c]=x.useState(n),d=x.useRef(null),u=J(t,d),p=x.useRef(0),m=p.current,g=x.useRef(0),b=g.current,f=s.open||l,h=x.useRef(f),v=x.useRef(void 0);return x.useEffect(()=>{const y=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(y)},[]),le(()=>{const y=d.current;if(y){v.current=v.current||{transitionDuration:y.style.transitionDuration,animationName:y.style.animationName},y.style.transitionDuration="0s",y.style.animationName="none";const w=y.getBoundingClientRect();p.current=w.height,g.current=w.width,h.current||(y.style.transitionDuration=v.current.transitionDuration,y.style.animationName=v.current.animationName),c(n)}},[s.open,n]),a.jsx(W.div,{"data-state":xa(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!f,...i,ref:u,style:{"--radix-collapsible-content-height":m?`${m}px`:void 0,"--radix-collapsible-content-width":b?`${b}px`:void 0,...e.style},children:f&&o})});function xa(e){return e?"open":"closed"}var mv=fd,fv=gd,hv=xd;function bd({className:e,...t}){return a.jsx(mv,{"data-slot":"collapsible",className:$("ecr-collapsible",e),...t})}function _d({className:e,children:t,...r}){return a.jsxs(fv,{"data-slot":"collapsible-trigger",className:$("ecr-collapsible__trigger",e),...r,children:[a.jsx("span",{className:"ecr-collapsible__trigger-label",children:t}),a.jsx(Yn,{className:"ecr-collapsible__trigger-icon"})]})}function vd({className:e,...t}){return a.jsx(hv,{"data-slot":"collapsible-content",className:$("ecr-collapsible__content",e),...t})}const gv={modern:a.jsx(a.Fragment,{children:"Give your reel’s product card a sleek, modern appearance that feels fresh, clean, and visually engaging."}),classic:a.jsx(a.Fragment,{children:"Give your reel’s product card a timeless, classic appearance that feels familiar, simple, and easy to recognize."})},xv=({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(Vt,{value:e,onValueChange:t,children:[a.jsx(qt,{className:"ecr-admin-control__trigger",children:a.jsx(Wt,{placeholder:"Layout"})}),a.jsxs(Gt,{children:[Ju.map(r=>a.jsx(Kt,{value:r.value,className:"ecr-admin-control__option",children:r.label},r.value)),Zu.map(r=>a.jsx("div",{children:a.jsxs(Je,{modal:!0,children:[a.jsxs(Ze,{className:"ecr-admin-control__lock-trigger",children:[a.jsx("span",{className:"ecr-admin-control__option",children:r.label}),a.jsx(at,{size:18})]}),a.jsx(Qe,{className:"ecr-admin-control__popover",children:a.jsx(ft,{name:r.label,text:gv[r.value]})})]})},r.value))]})]})]}),bv=[{Icon:qp,label:"Desktop",value:"desktop"},{Icon:Jp,label:"Tab",value:"tab"},{Icon:Kp,label:"Mobile",value:"mobile"}],yd=({label:e,min:t,max:r,value:n,onChange:o,name:i,id:s,wrapperStyles:l,hideSlider:c,device:d,setDevice:u})=>{const[p,m]=_.useState(n),g=_.useRef(null);_.useEffect(()=>{m(n)},[n]);const b=h=>{const v=Math.min(r,Math.max(t,Number(h)));o(v)},f=h=>{const v=Number(h);m(v),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{b(v>r?r:v<t?t:v)},1e3)};return a.jsxs("div",{style:l,className:"ecr-admin-range",children:[a.jsxs("label",{htmlFor:s,className:"ecr-admin-range__label",children:[e,":",a.jsxs(Vt,{value:d,onValueChange:h=>u(h),children:[a.jsx(qt,{style:{padding:"4px 4px 0px",height:"24px",gap:"4px"},children:a.jsx(Wt,{})}),a.jsx(Gt,{style:{minWidth:"60px"},children:bv.map(h=>a.jsx(Kt,{value:h.value,title:h.label,children:a.jsx(h.Icon,{size:16})},h.value))})]})]}),a.jsxs("div",{className:"ecr-admin-range__row",children:[!c&&a.jsx("input",{type:"range",id:s,name:i,min:t,max:r,value:n,onChange:h=>{const v=Number(h.target.value);m(v),b(v)},className:"ecr-admin-range__slider"}),a.jsxs("div",{className:"ecr-admin-range__value",children:[a.jsx(ea,{type:"number",min:t,max:r,value:p,onChange:h=>f(h.target.value)}),a.jsx("span",{className:"ecr-admin-range__unit",children:"px"})]})]})]})},_v=({styles:e,updateStyles:t})=>{const[r,n]=_.useState("desktop"),i={mobile:e?.gapOnMobile,tab:e?.gapOnTab,desktop:e?.gap}[r]??e?.gap,s=l=>{switch(r){case"mobile":t(c=>({...c,gapOnMobile:l}));break;case"tab":t(c=>({...c,gapOnTab:l}));break;default:t(c=>({...c,gap:l}));break}};return a.jsx(yd,{label:"Gap",min:0,max:80,value:i,onChange:s,name:"column_gap",id:"column-gap",device:r,setDevice:n})},vv=({styles:e,updateStyles:t})=>{const[r,n]=_.useState("desktop"),i={mobile:e?.sizeOnMobile,tab:e?.sizeOnTab,desktop:e?.size}[r]??e?.size,s=l=>{switch(r){case"mobile":t(c=>({...c,sizeOnMobile:l}));break;case"tab":t(c=>({...c,sizeOnTab:l}));break;default:t(c=>({...c,size:l}));break}};return a.jsx(yd,{label:"Size",min:150,max:400,value:i,onChange:s,name:"size",id:"size",device:r,setDevice:n})},yv=[{value:"rectangle",label:"Rectangle"},{value:"circle",label:"Circle"}],wv=({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:yv.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(vm,{color:"#2563eb",size:16}):a.jsx(ym,{color:"#8c95a9",size:16}),n.label]})]},n.value))})]})},jv=Object.values(ei),kv={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!"})},Sv=({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(Vt,{value:e,onValueChange:t,children:[a.jsx(qt,{className:"ecr-admin-control__trigger",children:a.jsx(Wt,{placeholder:"Layout"})}),a.jsxs(Gt,{children:[jv.map(r=>a.jsx(Kt,{value:r,className:"ecr-admin-control__option",children:r},r)),Ku.map(r=>a.jsx("div",{children:a.jsxs(Je,{modal:!0,children:[a.jsxs(Ze,{className:"ecr-admin-control__lock-trigger",children:[a.jsx("span",{className:"ecr-admin-control__option",children:r}),a.jsx(at,{size:18})]}),a.jsx(Qe,{className:"ecr-admin-control__popover",children:a.jsx(ft,{name:r,text:kv[r]})})]})},r))]})]})]}),Cv=({isLayoutOpen:e,handleSectionOpen:t,styles:r,updateStyles:n})=>a.jsxs(bd,{open:e,className:"ecr-admin-thumb-controls__section",children:[a.jsxs(_d,{className:"ecr-admin-thumb-controls__section-trigger",type:"button",onClick:()=>t("layout"),children:[a.jsx(Hp,{size:16})," ",a.jsx("span",{children:"Layout"})]}),a.jsxs(vd,{className:"ecr-admin-thumb-controls__section-content",children:[a.jsx(wv,{selectedShape:r?.shape,handleShape:o=>n(i=>({...i,shape:o}))}),a.jsx(Sv,{selectedLayout:r?.template??"carousel",handleLayout:o=>n(i=>({...i,template:o}))}),a.jsx(xv,{linkLayout:r?.appearance??"overlay",handleLinkLayout:o=>n(i=>({...i,appearance:o}))}),a.jsx(vv,{styles:r,updateStyles:n}),a.jsx(_v,{styles:r,updateStyles:n}),a.jsx(Ut,{label:"Show Ratings",text:a.jsx(a.Fragment,{children:"Hide Ratings to remove distractions and provide a cleaner, more focused visual experience!"})}),a.jsx(Ut,{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(Ut,{label:"Autoplay",text:a.jsx(a.Fragment,{children:"Enable autoplay for videos on your product and pages, capturing users' attention instantly!"})}),a.jsx(Ut,{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(Ut,{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!"})})]})]}),Nv=({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(Vt,{value:e,onValueChange:t,children:[a.jsx(qt,{className:"ecr-admin-control__trigger",children:a.jsx(Wt,{placeholder:"Layout"})}),a.jsx(Gt,{children:Yu.map(r=>a.jsx(Kt,{value:r.value,className:"ecr-admin-control__option",children:r.label},r.value))})]})]}),Ev=({isStyleOpen:e,handleSectionOpen:t,styles:r,updateStyles:n})=>a.jsxs(bd,{open:e,className:"ecr-admin-thumb-controls__section",children:[a.jsxs(_d,{className:"ecr-admin-thumb-controls__section-trigger",type:"button",onClick:()=>t("style"),children:[a.jsx(Gp,{size:16}),a.jsx("span",{children:"Styles"})]}),a.jsxs(vd,{className:"ecr-admin-thumb-controls__section-content",children:[a.jsx(ta,{label:"Border Width",min:0,max:12,value:r?.border?.border_width??0,onChange:o=>n(i=>({...i,border:{...i.border,border_width:o}})),name:"border_width",id:"border-width"}),a.jsx(fc,{selectedColor:r?.border?.border_color,handleColor:o=>n(i=>({...i,border:{...i.border,border_color:o}})),text:"Border Color"}),r?.shape==="rectangle"&&a.jsx(ta,{label:"Border Radius",min:0,max:99,value:r?.border?.border_radius??0,onChange:o=>n(i=>({...i,border:{...i.border,border_radius:o}})),name:"border_radius",id:"border-radius"}),a.jsx(Nv,{hoverEffect:r?.hoverEffect||"none",handleHoverEffect:o=>n(i=>({...i,hoverEffect:o}))})]})]}),Tv=({styles:e,updateStyles:t})=>{const[r,n]=_.useState("layout"),o=r==="layout",i=r==="style",s=l=>{n(r!==l?l:null)};return a.jsxs("div",{className:"ecr-admin-thumb-controls",children:[a.jsx(Cv,{handleSectionOpen:s,isLayoutOpen:o,styles:e,updateStyles:t}),a.jsx(Ev,{isStyleOpen:i,handleSectionOpen:s,styles:e,updateStyles:t})]})},Av=({styles:e,setStyles:t,isExpanded:r,setIsExpanded:n,setIsEdited:o,tabs:i,currentTab:s,setCurrentTab:l})=>{const c=u=>{t(p=>{const m=u(p);return o(!0),m})},d=u=>{(u===i.thumbnail||u===i.preview)&&l(u)};return a.jsxs("div",{className:$("ecr-admin-sidepanel",r?"ecr-admin-sidepanel--expanded":"ecr-admin-sidepanel--collapsed"),children:[r&&a.jsx("div",{className:"ecr-admin-mobile-overlay",onClick:()=>n(!1)}),a.jsxs("div",{className:"ecr-admin-sidepanel-content",children:[a.jsxs("div",{className:"ecr-admin-sidepanel__header",children:[a.jsx("p",{className:"ecr-admin-sidepanel__title",children:"Customization"}),a.jsx("small",{className:"ecr-admin-sidepanel__subtitle",children:"Customize your widget however you like"})]}),a.jsx("div",{className:"ecr-admin-sidepanel__body",children:a.jsxs(b_,{value:s,onValueChange:d,className:"ecr-admin-sidepanel__tabs",children:[a.jsxs(__,{className:"ecr-admin-sidepanel__tabs-list",children:[a.jsx(Dc,{value:i.thumbnail,children:"Thumbnail"}),a.jsx(Dc,{value:i.preview,children:"Preview"})]}),a.jsx($c,{value:i.thumbnail,children:a.jsx(Tv,{styles:e,updateStyles:c})}),a.jsx($c,{value:i.preview,children:a.jsx(cv,{styles:e,updateStyles:c})})]})})]})]})},Pv=e=>{const t=Ne(),[r,n]=_.useState(""),[o,i]=_.useState([]),[s,l]=_.useState(ot),[c,d]=_.useState(!0),[u,p]=_.useState(!1),[m,g]=_.useState(!1);_.useEffect(()=>{(async()=>{if(!e){d(!1);return}d(!0);try{const y=(await he.get(`stories/${e}`)).data;n(y.group_name),i(y.stories),l(y.styles??ot)}catch(v){v instanceof Error?G.error(v.message):G.error("Something went wrong. Try again later!")}finally{d(!1)}})()},[e]);const b=async h=>{const v=o.map(j=>j.id),y={group_name:r,styles:s,story_ids:v};e&&(y.group_id=e);const w=await he.post("stories/manage-group-stories",y);if(!e){const j=w.data.group_id;t(`?view=${X.mg}&gid=${j}`,{replace:!0})}return{...w.data,isNewGroup:!e}};return{groupTitle:r,setGroupTitle:n,thisGroupReels:o,setThisGroupReels:i,styles:s,setStyles:l,isLoading:c,isSaving:u,isEdited:m,setIsEdited:g,handleSave:async()=>{try{p(!0);const h=await b();return g(!1),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)}}}},Ov=e=>{const[t,r]=_.useState(!1),n=_.useRef(null),o=_.useRef(null),i=_.useRef(!1),s=_.useRef(typeof window<"u"?window.location.hash:"");return _.useEffect(()=>{e||(n.current=null,o.current=null,r(!1))},[e]),_.useEffect(()=>{if(!e)return;const p=m=>{m.preventDefault(),m.returnValue=""};return window.addEventListener("beforeunload",p),()=>window.removeEventListener("beforeunload",p)},[e]),_.useEffect(()=>{const p=()=>{const m=window.location.hash;if(!e){s.current=m;return}if(i.current){i.current=!1,s.current=m;return}m!==s.current&&(o.current=m,window.location.hash=s.current,r(!0))};return window.addEventListener("hashchange",p),()=>window.removeEventListener("hashchange",p)},[e]),{showLeaveModal:t,requestLeave:p=>{if(!e){p();return}n.current=p,r(!0)},confirmLeave:()=>{if(r(!1),n.current){const p=n.current;n.current=null,i.current=!0,p();return}if(o.current){const p=o.current;o.current=null,i.current=!0,window.location.hash=p}},cancelLeave:()=>{n.current=null,o.current=null,r(!1)},allowNextNavigation:p=>{i.current=!0,p()}}},wd={thumbnail:"thumbnail",preview:"preview"},Rv=()=>{const e=Ne(),[t]=Zt(),r=t.get("gid"),n=Ar("(min-width: 1024px)"),{groupTitle:o,setGroupTitle:i,thisGroupReels:s,setThisGroupReels:l,styles:c,setStyles:d,isLoading:u,isSaving:p,isEdited:m,setIsEdited:g,handleSave:b}=Pv(r),{allReels:f,searchTerm:h,setSearchTerm:v,isSearching:y,lastStoryElementRef:w,refreshReels:j}=as(r),[C,N]=_.useState(""),[S,E]=_.useState(n),[T,A]=_.useState(wd.thumbnail),[R,L]=_.useState([]),B=_.useMemo(()=>new Set(s.map(K=>K.story_uuid)),[s]),M=_.useMemo(()=>h.trim().toLowerCase(),[h]),O=_.useMemo(()=>M?R.filter(K=>K.title.toLowerCase().includes(M)):R,[R,M]),P=_.useMemo(()=>{const K=new Map;for(const de of O)K.set(de.story_uuid,de);for(const de of f)K.has(de.story_uuid)||K.set(de.story_uuid,de);return Array.from(K.values())},[O,f]),z=_.useMemo(()=>P.filter(K=>!B.has(K.story_uuid)),[P,B]);_.useEffect(()=>{E(n)},[n]),_.useEffect(()=>{L([])},[r]);const{showLeaveModal:I,requestLeave:q,confirmLeave:te,cancelLeave:oe,allowNextNavigation:ge}=Ov(m),_e=async(K,de)=>{try{N(K.story_uuid);const F=de==="add"?[K,...s]:s.filter(Y=>Y.story_uuid!==K.story_uuid);l(F),L(de==="add"?Y=>Y.filter(se=>se.story_uuid!==K.story_uuid):Y=>Y.some(se=>se.story_uuid===K.story_uuid)?Y:[K,...Y]),g(!0)}catch(F){F instanceof Error?G.error(F.message):G.error("Something went wrong. Please try again later!")}finally{N("")}},pe=async()=>{const K=await b();K&&(L([]),j()),K?.isNewGroup&&ge(()=>{e(`?view=${X.mg}&gid=${K.group_id}`,{replace:!0})})};return u?a.jsx(Lr,{}):a.jsxs(Vb,{value:{requestLeave:q},children:[a.jsx(kt,{left:[a.jsx(St,{name:"Manage Widget",Icon:Pr},"page"),a.jsx(tr,{cb:()=>q(()=>e(`?view=${X.ag}`))},"back")],center:[a.jsxs("div",{className:"ecr-admin-group-title__wrapper",children:[a.jsx(is,{placeholder:"Enter group title",title:o,setTitle:i,setIsEdited:g,style:{paddingInline:"32px"}}),o&&a.jsxs(Go,{children:[a.jsx(Ko,{className:"ecr-admin-group-title-customization__trigger",children:a.jsx(gb,{})}),a.jsxs(Yo,{className:"ecr-admin-group-title-customization-dialog",children:[a.jsx(Xo,{children:a.jsx(Jo,{children:"Customize title appearance"})}),a.jsx(Bb,{styles:c,setStyles:d,setIsEdited:g}),a.jsx("div",{style:{display:"flex",justifyContent:"end",marginTop:40},children:a.jsx(B0,{asChild:!0,children:a.jsx(ne,{style:{paddingInline:40},variant:"outline",children:"Ok"})})})]})]})]},"title")],right:[a.jsx(hb,{isExpanded:S,setIsExpanded:E},"toggle"),a.jsx(ho,{onSave:pe,isSaving:p,disabled:!m},"save")],rightClass:"ecr-admin-nav-btn-reverse"}),a.jsx(rr,{breads:[{label:"Dashboard",href:`?view=${X.ag}`},{label:"Manage Widget"}],onNavigate:K=>q(()=>e(K))}),a.jsxs("div",{className:"ecr-admin-group-edit",children:[a.jsx(Zb,{allReels:z,gid:r,handleSelectReel:_e,searchTerm:h,setSearchTerm:v,isSearching:y,togglingId:C,lastStoryElementRef:w}),a.jsx(Jb,{gid:r,reels:s,styles:c,handleRemoveReel:_e,togglingId:C,currentTab:T}),S&&a.jsx(Av,{isExpanded:S,setIsExpanded:E,setIsEdited:g,styles:c,setStyles:d,tabs:wd,setCurrentTab:A,currentTab:T})]}),I&&a.jsx(Or,{onReject:oe,onAccept:te,isLoading:!1,message:"You have unsaved changes. Leave this page without saving?"})]})};function Lv(){const[e]=Zt(),t=e.get("view")||X.ag;let r;switch(t){case X.settings:r=a.jsx(cb,{});break;case X.ar:r=a.jsx(Qf,{});break;case X.stat:r=a.jsx(pb,{});break;case X.cr:r=a.jsx(eb,{});break;case X.mg:r=a.jsx(Rv,{});break;default:r=a.jsx(sb,{})}return a.jsxs("div",{children:[r,a.jsx(Gu,{position:"top-right",toastOptions:{style:{padding:"16px",marginTop:"24px",fontSize:"16px"}}})]})}const jd=async(e,t,r,n={})=>{try{if(await he.post(`group/${e}/story/${t}/view`),n.isActive&&!n.isActive())return;r(o=>({...o,[t]:Number(o[t]||0)+1}))}catch{}},kd=e=>!!e?.files?.[0]?.mime_type?.startsWith("video"),Iv=()=>{const e=_.useContext(ba);if(!e)throw new Error("useVideoPlayer must be used inside PublicStoryContext");const{styles:t,stories:r,groupId:n,isPlaying:o,setIsPlaying:i,setStoryViews:s}=e,[l,c]=_.useState(r.length-1),[d,u]=_.useState(null),[p,m]=_.useState(!0),[g,b]=_.useState(0),[f,h]=_.useState(!1),[v,y]=_.useState(!1),[w,j]=_.useState({index:0,story_uuid:r[0]?.story_uuid??""}),C=d?.links&&d.links.length>0?d.links[0]:null,N=t?.playerAppearance??"overlay",S=_.useRef({bodyOverflow:"",bodyPosition:"",bodyTop:"",bodyWidth:"",bodyScrollBehavior:"",htmlOverflow:"",htmlScrollBehavior:"",scrollY:0}),E=_.useCallback((O,P=1)=>{if(r.length===0)return null;let z=O;for(let I=0;I<r.length;I+=1){const q=r[z];if(kd(q))return{story:q,index:z};z=(z+P+r.length)%r.length}return null},[r]),T=_.useCallback(()=>{c(r.length-1);const O=r.findIndex(I=>String(I.story_uuid)===o),P=O>=0?r[O]:null,z=kd(P)?{story:P,index:O}:E(Math.max(O,0),1);if(!z?.story){u(null),m(!1);return}u(z.story),O!==z.index&&z.story.story_uuid!==o&&i(z.story.story_uuid),j({index:0,story_uuid:z.story.story_uuid}),m(!1)},[E,o,i,r]);_.useEffect(()=>{T()},[T]),_.useEffect(()=>{const{body:O,documentElement:P}=document;return S.current={bodyOverflow:O.style.overflow,bodyPosition:O.style.position,bodyTop:O.style.top,bodyWidth:O.style.width,bodyScrollBehavior:O.style.scrollBehavior,htmlOverflow:P.style.overflow,htmlScrollBehavior:P.style.scrollBehavior,scrollY:window.scrollY},P.style.overflow="hidden",O.style.overflow="hidden",O.style.position="fixed",O.style.top=`-${S.current.scrollY}px`,O.style.width="100%",()=>{const z=S.current;P.style.overflow=z.htmlOverflow,O.style.overflow=z.bodyOverflow,O.style.position=z.bodyPosition,O.style.top=z.bodyTop,O.style.width=z.bodyWidth,P.style.scrollBehavior="auto",O.style.scrollBehavior="auto",window.scrollTo({top:z.scrollY,left:0,behavior:"auto"}),P.style.scrollBehavior=z.htmlScrollBehavior,O.style.scrollBehavior=z.bodyScrollBehavior}},[]);const A=_.useCallback(()=>{i(null)},[i]),R=_.useCallback((O=1)=>{m(!0);const P=r.findIndex(oe=>String(oe.story_uuid)===String(o)),z=O>0?1:-1,I=O>0?l>P?P+1:0:P>0?P-1:l,q=E(I,z);if(!q?.story){m(!1);return}const te=q.story;if(te.story_uuid===o){m(!1),A();return}j({index:0,story_uuid:te.story_uuid}),n&&jd(n,te.id,s),i(te.story_uuid),m(!1)},[A,E,n,o,l,i,s,r]),L=_.useCallback(()=>{const O=d?.files??[];if(w.index>0){j(P=>({index:P.index-1,story_uuid:O[P.index-1].story_uuid??""}));return}R(-1)},[w.index,R,d?.files]),B=_.useCallback(()=>{const O=d?.files??[];if(w.index+1<O.length){j(P=>({index:P.index+1,story_uuid:O[P.index+1].story_uuid??""}));return}R(1)},[w.index,R,d?.files]),M=_.useCallback(O=>{O.target===O.currentTarget&&A()},[A]);return{closePlayer:A,currentFileIndex:w,duration:g,handleBackdropClick:M,handleNextFile:B,handlePrevFile:L,isLoadingNext:p,isMuted:v,isPaused:f,playingStory:d,setDuration:b,setIsPaused:h,setIsMuted:y,setIsPlaying:i,firstLink:C,playerAppearance:N}},Mv=()=>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"})]})})}),zv=()=>{const e=Ar("(min-width: 1024px)"),{closePlayer:t,currentFileIndex:r,duration:n,handleBackdropClick:o,handleNextFile:i,handlePrevFile:s,isLoadingNext:l,isMuted:c,isPaused:d,playerAppearance:u,playingStory:p,firstLink:m,setDuration:g,setIsMuted:b,setIsPaused:f,setIsPlaying:h}=Iv();return a.jsx("div",{onClick:o,className:"ecommreels-story-modal ecr-player",children:p&&a.jsxs("div",{className:"ecr-player__stage",children:[a.jsx(wt,{onClick:s,className:"ecr-player__nav--left",children:a.jsx(pi,{size:24})}),a.jsx(wt,{onClick:i,className:"ecr-player__nav--right",children:a.jsx(mi,{size:24})}),a.jsxs("div",{id:"player",className:"ecr-player__frame",children:[p&&a.jsx(ci,{playingStory:p,duration:n,currentFileIndex:r,isPaused:d},`${p.story_uuid}-${r.index}`),a.jsx("div",{onClick:t,className:"ecr-player__close",children:a.jsx(er,{size:e?20:24,className:"ecr-player__close-icon"})}),l?a.jsx(Mv,{}):p?.files.length>0&&a.jsx(xi,{currentFileIndex:r,files:p?.files,setDuration:g,setIsPlaying:h,isPaused:d,setIsPaused:f,isMuted:c,setIsMuted:b,handlePrevFile:s,handleNextFile:i,storyId:p.id,storyTitle:p?.title}),u==="overlay"?m?a.jsx(Nn,{link:m,usedFor:"user",usedIn:"player",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"8px",width:"95%",borderRadius:"6px"}}):a.jsx(Bt,{title:p.title}):null,u==="title"?a.jsx(Bt,{title:p.title}):null]})]})})},Sd=({story:e,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o})=>{const i=t.appearance??"overlay",s=e.links&&e.links.length>0?e.links[0]:null,l=i==="none",c=i==="title",d=t.shape==="rectangle",u=!l&&!c&&s,p=t.border.border_radius,m=p>50?p+16:p>20?p:0;return a.jsxs("div",{className:`ecr-thumb ${t.hoverEffect??""}`,children:[a.jsxs("div",{onClick:()=>r({sid:e.id,story_uuid:e.story_uuid}),className:"ecr-thumb__frame",style:{border:`${t?.border?.border_width}px solid ${t?.border?.border_color}`,borderRadius:t.shape==="rectangle"?`${t?.border?.border_radius}px`:"50%",aspectRatio:t.shape==="rectangle"?"9/16":"1/1"},children:[a.jsx(to,{story:e,styles:t,storyViews:n,setStoryViews:o}),!l&&!c&&d?u?a.jsx(Nn,{link:s,usedFor:"user",usedIn:"thumb",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"4px",width:"calc(100% - 8px)",borderRadius:"6px"}}):a.jsx(Bt,{title:e.title,styles:{width:`calc(95% - ${m}px)`}}):null]}),c?a.jsx("p",{className:"ecr-reel__title",children:e.title}):null]})},Dv=({stories:e,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o})=>{const{thumbsContainerRef:i,thumbsWrapperRef:s,isOverflowing:l,canScrollLeft:c,canScrollRight:d,scrollBy:u,scrollStep:p}=bc([e],!0);return a.jsxs("div",{className:"ecr-front-carousel",children:[a.jsx("div",{ref:i,className:"ecr-front-carousel__viewport",children:a.jsx("div",{ref:s,className:t.hoverEffect==="zoom-in"?"ecr-front-carousel__track ecr-front-carousel__track--zoom":"ecr-front-carousel__track",children:e?.map(m=>m?.files[0]?.mime_type.startsWith("video")?a.jsx(Sd,{story:m,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o},m.story_uuid):null)})}),l&&c&&a.jsx("button",{onClick:()=>u(-p),className:"ecr-front-carousel__nav ecr-front-carousel__nav--left",children:a.jsx(Vn,{size:20,style:{width:"20px",height:"20px"}})}),l&&d&&a.jsx("button",{onClick:()=>u(p),className:"ecr-front-carousel__nav ecr-front-carousel__nav--right",children:a.jsx(Wn,{size:20,style:{width:"20px",height:"20px"}})})]})},Cd=({stories:e,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o})=>a.jsx("div",{className:"ecr-front-grid",children:a.jsx("div",{style:{padding:t.hoverEffect==="zoom-in"?16:0},className:"ecr-front-grid__list",children:e?.map(i=>i?.files[0]?.mime_type.startsWith("video")?a.jsx(Sd,{story:i,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o},i.story_uuid):null)})}),$v={carousel:Dv,grid:Cd},Fv=()=>{const e=_.useContext(ba),{groupTitle:t,styles:r,stories:n,groupId:o,setIsPlaying:i,storyViews:s,setStoryViews:l}=e,c=_.useRef(!0);_.useEffect(()=>(c.current=!0,()=>{c.current=!1}),[]);const d=r.template??"carousel",u=$v[d]||Cd,p=({sid:m,story_uuid:g})=>{i(g),o&&jd(o,m,l,{isActive:()=>c.current})};return a.jsxs("div",{style:{"--thumbnail-size":r.template==="grid"?"auto":`${r?.size}px`,"--thumbnail-size-grid":`${r?.size}px`,"--thumbnail-size-tab":r.template==="grid"?"auto":`${r?.sizeOnTab??r?.size}px`,"--thumbnail-size-grid-tab":`${r?.sizeOnTab??r?.size}px`,"--thumbnail-size-mobile":r.template==="grid"?"auto":`${r?.sizeOnMobile??r?.size}px`,"--thumbnail-size-grid-mobile":`${r?.sizeOnMobile??r?.size}px`,"--thumbnail-gap":`${r?.gap}px`,"--thumbnail-gap-tab":`${r?.gapOnTab??r?.gap}px`,"--thumbnail-gap-mobile":`${r?.gapOnMobile??r?.gap}px`,"--thumbnail-border-radius":`${r?.border?.border_radius}px`},children:[r?.widgetTitle&&r?.widgetTitle?.alignment!=="hidden"&&t?a.jsx("h2",{style:{textAlign:r.widgetTitle?.alignment,fontSize:r.widgetTitle?.fontSize,color:r.widgetTitle?.color,marginBottom:24},children:t}):null,a.jsx(u,{stories:n,styles:r,handlePlaying:p,storyViews:s,setStoryViews:l})]})},Bv=e=>{const[t,r]=_.useState(""),[n,o]=_.useState([]),[i,s]=_.useState(ot),[l,c]=_.useState(!1),[d,u]=_.useState(null),p=_.useCallback(async()=>{const m=e?.trim();if(!m){o([]),s(ot),c(!1),u(null);return}const g=new AbortController;c(!0),u(null);try{const b=await he.get(`stories/${m}`,{signal:g.signal});if(g.signal.aborted)return;r(b.data.group_name),o(b.data.stories),s(b.data.styles||ot)}catch(b){if(g.signal.aborted)return;u(b)}finally{c(!1)}return()=>{g.abort()}},[e]);return _.useEffect(()=>{p()},[e]),{groupTitle:t,stories:n,styles:i,isLoading:l,error:d}},ba=_.createContext(void 0),Nd=({groupId:e})=>{const[t,r]=_.useState(null),[n,o]=_.useState({}),{groupTitle:i,stories:s,styles:l}=Bv(e);return a.jsxs(ba.Provider,{value:{groupTitle:i,groupId:e,stories:s,styles:l,isPlaying:t,setIsPlaying:r,storyViews:n,setStoryViews:o},children:[t&&a.jsx(zv,{}),a.jsx(Fv,{})]})};wa(()=>{const e=document.getElementById("ecommreels-admin-app");e&&Ln.createRoot(e).render(a.jsx(ru,{children:a.jsx(Lv,{})}))}),wa(()=>{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(Nd,{groupId:o}))}),t.forEach(r=>{const n=r,o=n.dataset.id;if(!o)return;Ln.createRoot(n).render(a.jsx(Nd,{groupId:o}))})})})(React,wp.domReady,wp.element,ReactDOM); -
ecomm-reels/trunk/ecomm-reels.php
r3469230 r3470148 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.1. 75 * Version: 4.1.8 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.1. 7');22 define('WP_REELS_VER', '4.1.8'); 23 23 24 24 // 1) Composer autoloader (optional, guarded) -
ecomm-reels/trunk/readme.txt
r3469230 r3470148 5 5 Tested up to: 6.9 6 6 Requires PHP: 7.4 7 Stable tag: 4.1. 77 Stable tag: 4.1.8 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 103 103 == Changelog == 104 104 105 = 4.1.8 - 2026-02-26 = 106 - New: Added a Rate Us link in the admin header. 107 105 108 = 4.1.7 - 2026-02-25 = 106 109 - Tweak: Updated Product Card border opacity and reduced the rating icon size for a cleaner look.
Note: See TracChangeset
for help on using the changeset viewer.