1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1635],{8817:(e,l,a)=>{a.d(l,{bq:()=>u,eb:()=>m,gC:()=>x,l6:()=>c,yv:()=>o});var s=a(95155);a(12115);var t=a(47887),i=a(24033),n=a(5917),r=a(12108),d=a(61594);function c(e){let{...l}=e;return(0,s.jsx)(t.bL,{"data-slot":"select",...l})}function o(e){let{...l}=e;return(0,s.jsx)(t.WT,{"data-slot":"select-value",...l})}function u(e){let{className:l,size:a="default",children:n,...r}=e;return(0,s.jsxs)(t.l9,{"data-slot":"select-trigger","data-size":a,className:(0,d.cn)("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",l),...r,children:[n,(0,s.jsx)(t.In,{asChild:!0,children:(0,s.jsx)(i.A,{className:"size-4 opacity-50"})})]})}function x(e){let{className:l,children:a,position:i="popper",...n}=e;return(0,s.jsx)(t.ZL,{children:(0,s.jsxs)(t.UC,{"data-slot":"select-content",className:(0,d.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md","popper"===i&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",l),position:i,...n,children:[(0,s.jsx)(p,{}),(0,s.jsx)(t.LM,{className:(0,d.cn)("p-1","popper"===i&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:a}),(0,s.jsx)(f,{})]})})}function m(e){let{className:l,children:a,...i}=e;return(0,s.jsxs)(t.q7,{"data-slot":"select-item",className:(0,d.cn)("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",l),...i,children:[(0,s.jsx)("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:(0,s.jsx)(t.VF,{children:(0,s.jsx)(n.A,{className:"size-4"})})}),(0,s.jsx)(t.p4,{children:a})]})}function p(e){let{className:l,...a}=e;return(0,s.jsx)(t.PP,{"data-slot":"select-scroll-up-button",className:(0,d.cn)("flex cursor-default items-center justify-center py-1",l),...a,children:(0,s.jsx)(r.A,{className:"size-4"})})}function f(e){let{className:l,...a}=e;return(0,s.jsx)(t.wn,{"data-slot":"select-scroll-down-button",className:(0,d.cn)("flex cursor-default items-center justify-center py-1",l),...a,children:(0,s.jsx)(i.A,{className:"size-4"})})}},51635:(e,l,a)=>{a.d(l,{A:()=>W});var s=a(95155),t=a(861),i=a(59133),n=a(12115),r=a(53380),d=a(88793),c=a(18513),o=a(30926);let u=(0,o.createServerReference)("40486084ad9cef0394ab5dd0de7cb8f26add3f3505",o.callServer,void 0,o.findSourceMapURL,"getClipMetrics");var x=a(78505),m=a(56023),p=a(8817),f=a(15239),g=a(32938),h=a(61594);let v=e=>{let{thumbnail:l,duration:a}=e,{url:t,width:i,height:n}=l,r=i/n>g.d0;return(0,s.jsxs)("div",{className:"relative aspect-video w-full rounded-sm sm:rounded-lg overflow-hidden bg-card",children:[!r&&(0,s.jsx)(f.default,{src:t,fill:!0,sizes:"(max-width: 768px) 50vw, (max-width: 1200px) 33vw, 25vw",alt:"",className:"absolute inset-0 size-full origin-center blur-lg scale-125",unoptimized:!0}),(0,s.jsx)(f.default,{src:t,fill:!0,sizes:"(max-width: 768px) 50vw, (max-width: 1200px) 33vw, 25vw",alt:"",className:(0,h.cn)("absolute z-[2] inset-0 size-full origin-center",r?"object-cover":"object-contain"),unoptimized:!0}),(0,s.jsx)("div",{className:"vlip-duration absolute inset-0 z-10 transition-transform duration-[350ms] delay-150 ease size-full group-hover:translate-x-[-10%]",children:(0,s.jsxs)("span",{className:"vlip-thumb-duration-badge absolute bottom-0 right-0 md:right-auto md:left-0 bg-slate-950/70 text-white uppercase text-center tracking-[1px] m-1 py-[5px] px-1.5 text-[9px] md:text-[10px] leading-none font-bold",children:[Math.ceil(a)," ",(0,s.jsx)("b",{className:"text-[0.95em]",children:"SEC"})]})})]})};v.displayName="ClipThumbnail";let b=e=>{let{label:l,value:a}=e;return(0,s.jsxs)("div",{className:"flex flex-row gap-2 items-start",children:[(0,s.jsxs)(x.J,{className:"text-slate-500 text-xs min-w-12",children:[l,":"]}
1),(0,s.jsx)("span",{className:"text-slate-500 text-xs line-clamp-2",children:a})]})};b.displayName="ClipStat";let j=e=>{let{clip:l,metrics:a,includeTitle:t,includeFrom:i}=e,{id:n,metadata:r,media:d,status:c,duration:o}=l;return(0,s.jsxs)("div",{className:"flex flex-col gap-4 w-40",children:[(0,s.jsx)(v,{thumbnail:d.images.thumbnail,duration:o}),(0,s.jsxs)("div",{className:"flex flex-col gap-2 p-2",children:[i&&(0,s.jsx)(b,{label:"From",value:r.from}),t&&(0,s.jsx)(b,{label:"Title",value:r.title}),(0,s.jsx)(b,{label:"Clip ID",value:n}),(0,s.jsx)(b,{label:"Created",value:new Date(c.created).toLocaleDateString()})]})]})};j.displayName="ClipInfo";var y=a(57830),N=a(56676);let w=e=>{let{tags:l,onTagsUpdate:a}=e,t=(0,n.useRef)(null),i=(0,n.useRef)(!1),[r,d]=(0,n.useState)(""),[c,o]=(0,n.useState)(!1),u=async e=>{if(-1!==l.indexOf(e))return void o(!0);a([...l,e]),d(""),t.current.focus()},x=async e=>{if(i.current){i.current=!1;return}c&&o(!1),d(e)};return(0,s.jsxs)("div",{className:"relative flex flex-col w-full pr-1",children:[(0,s.jsx)(m.p,{ref:t,type:"text",value:r,onChange:e=>x(e.target.value),onKeyDown:e=>{[",","Enter"].includes(e.key)&&(","===e.key&&(i.current=!0),r.length<3||u((0,N.t8)(r)))},placeholder:"Enter tag",maxLength:100,className:(0,h.cn)({"text-red-500":c})}),(0,s.jsx)("div",{className:"flex flex-col flex-1 overflow-y-scroll h-[120px] max-h-[120px]",children:(0,s.jsx)("div",{className:"flex flex-row flex-wrap py-2.5 gap-1.5",children:l.length>0?l.map((e,t)=>(0,s.jsx)("div",{className:"relative flex items-center justify-center",children:(0,s.jsxs)("div",{className:"flex flex-row items-center justify-center py-1.5 pl-2 pr-1.5 bg-slate-500/80 outline-none rounded-[34px] text-white text-xs leading-none",children:[(0,s.jsx)("span",{children:"#".concat(e)}),(0,s.jsx)("button",{type:"button",onClick:()=>(e=>{let s=[...l];s.splice(e,1),a(s)})(t),className:"grid place-items-center ml-1 cursor-pointer bg-transparent border-none outline-none opacity-60 hover:opacity-100",children:(0,s.jsx)(y.m6K,{className:"text-white text-[12px]"})})]})},"tag-".concat(t))):null})})]})};w.displayName="TagsInput";var C=a(86422);let S=(0,o.createServerReference)("60f0c4733871aa289576895417c8a473ad93694d42",o.callServer,void 0,o.findSourceMapURL,"updateClip");var T=a(12293),k=a(99776);function z(){let e=(0,k.jE)();return{invalidateClipQueries:()=>{e.invalidateQueries({queryKey:["popular"]}),e.invalidateQueries({queryKey:["trending"]}),e.invalidateQueries({queryKey:["category"]}),e.invalidateQueries({queryKey:["search"]}),e.invalidateQueries({queryKey:["related"]}),e.invalidateQueries({queryKey:["collection"]}),e.invalidateQueries({queryKey:["saved"]})}}}let F=[{label:"Poor Quality",value:"quality"},{label:"Search Result Fail",value:"search"},{label:"Missing Thumbnail",value:"thumbnail_missing"},{label:"Thumbnail Quality",value:"thumbnail_quality"},{label:"Clipped Incorrectly",value:"clipped_incorrectly"},{label:"Other",value:"other"}],R=[{label:"G",value:"G"},{label:"PG",value:"PG"},{label:"PG-13",value:"PG-13"},{label:"R",value:"R"}],L=[{label:"No Language",value:"NA"},{label:"English",value:"EN"},{label:"Spanish",value:"ES"},{label:"French",value:"FR"},{label:"German",value:"DE"},{label:"Italian",value:"IT"},{label:"Portuguese",value:"PT"},{label:"Dutch",value:"NL"},{label:"Russian",value:"RU"},{label:"Chinese (Simplified)",value:"ZH-CN"},{label:"Chinese (Traditional)",value:"ZH-TW"},{label:"Japanese",value:"JA"},{label:"Korean",value:"KO"},{label:"Arabic",value:"AR"},{label:"Hindi",value:"HI"},{label:"Turkish",value:"TR"},{label:"Polish",value:"PL"},{label:"Swedish",value:"SV"},{label:"Norwegian",value:"NO"},{label:"Danish",value:"DA"},{label:"Finnish",value:"FI"},{label:"Greek",value:"EL"},{label:"Hebrew",value:"HE"},{label:"Czech",value:"CS"},{label:"Hungarian",value:"HU"},{label:"Romanian",value:"RO"},{label:"Bulgarian",value:"BG"},{label:"Croatian",value:"HR"},{label:"Slovak",value:"SK"},{label:"Slovenian",value:"SL"},{label:"Estonian",value:"ET"},{label:"Latvian",value:"LV"},{label:"Lithuanian",value:"LT"},{label:"Ukrainian",value:"UK"},{label:"Thai",value:"TH"},{label:"Vietnamese",value:"VI"},{label:"Indonesian",value:"ID"},{label:"Malay",value:"MS"},{label:"Tagalog",value:"TL"},{label:"Bengali",value:"BN"},{label:"Urdu",value:"UR"},{label:"Persian",value:"FA"},{label:"Swahili",value:"SW"},{label:"Afrikaans",value:"AF"}],A=e=>{let{clip:l,metrics:a,onDismiss:t}=e,{metadata:i}=l,{invalidateClipQueries:r}
1=z(),[c,o]=(0,n.useState)({title:i.title,from:i.from,tags:i.tags,rating:i.rating,language:i.language}),[u,f]=(0,n.useState)(!1),g=(e,l)=>{o({...c,[e]:l})},h=async()=>{try{f(!0);let e={...c};""===e.title&&(e.title=i.title),await S(l.id,e),r(),(0,T.GF)("Clip updated"),t()}catch(e){(0,T.Ni)(e.message),f(!1)}};return(0,s.jsxs)("div",{className:"flex flex-col gap-4 h-full",children:[(0,s.jsxs)("div",{className:"flex flex-row gap-6 w-full flex-1 overflow-y-auto",children:[(0,s.jsx)("div",{className:"hidden sm:flex flex-col gap-8",children:(0,s.jsx)(j,{clip:l,metrics:a})}),(0,s.jsxs)("div",{className:"flex flex-col gap-5 flex-1 pb-4",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-2 pr-1",children:[(0,s.jsxs)(x.J,{children:["From"," ",(0,s.jsx)("span",{className:"text-slate-400 text-xs pl-2",children:"(Optional)"})]}),(0,s.jsx)(m.p,{value:c.from,onChange:e=>g("from",e.target.value)})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-2 pr-1",children:[(0,s.jsx)(x.J,{children:"Title"}),(0,s.jsx)(m.p,{value:c.title,onChange:e=>g("title",e.target.value)})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsx)(x.J,{children:"Tags"}),(0,s.jsx)(w,{tags:c.tags,onTagsUpdate:e=>g("tags",e)})]}),(0,s.jsxs)("div",{className:"flex flex-row gap-4",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-y-2",children:[(0,s.jsx)(x.J,{htmlFor:"rating",children:"Rating"}),(0,s.jsxs)(p.l6,{id:"rating",defaultValue:c.rating||"PG",onValueChange:e=>g("rating",e),children:[(0,s.jsx)(p.bq,{className:"h-12 w-24",children:(0,s.jsx)(p.yv,{placeholder:"Select a rating"})}),(0,s.jsx)(p.gC,{children:R.map(e=>(0,s.jsx)(p.eb,{value:e.value,children:e.label},e.value))})]})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-y-2 w-full",children:[(0,s.jsx)(x.J,{htmlFor:"language",children:"Language"}),(0,s.jsxs)(p.l6,{id:"language",defaultValue:c.language||"EN",onValueChange:e=>g("language",e),children:[(0,s.jsx)(p.bq,{className:"h-12 w-[184px]",children:(0,s.jsx)(p.yv,{placeholder:"Select a language"})}),(0,s.jsx)(p.gC,{children:L.map(e=>(0,s.jsx)(p.eb,{value:e.value,children:e.label},e.value))})]})]})]})]})]}),(0,s.jsx)("div",{className:"flex flex-row justify-center sm:justify-end gap-4",children:(0,s.jsx)(d.$,{onClick:h,className:"w-full sm:w-auto min-w-24",disabled:u,children:u?(0,s.jsx)(C.A,{size:18,color:"white"}):"Save"})})]})};A.displayName="EditClip";var E=a(91563),I=a(78323);let M=(0,o.createServerReference)("6006b1114181ab696cae2649dc74ad14c8a7abdb22",o.callServer,void 0,o.findSourceMapURL,"flagClip"),_=e=>{let{clip:l,metrics:a,onDismiss:t}=e,i=(0,I.A)("(max-width: 768px)"),[r,c]=(0,n.useState)({reason:F[0].value,notes:""}
1),[o,u]=(0,n.useState)(!1),m=(e,l)=>{c({...r,[e]:l})},f=async()=>{try{u(!0),await M(l.id,r),(0,T.GF)("Clip flagged"),t()}catch(e){u(!1),(0,T.Ni)(e.message)}};return(0,s.jsxs)("div",{className:"flex flex-col gap-4 h-full",children:[(0,s.jsxs)("div",{className:"flex flex-row gap-6 w-full flex-1 overflow-y-auto",children:[(0,s.jsx)("div",{className:"hidden sm:flex flex-col gap-8",children:(0,s.jsx)(j,{clip:l,metrics:a,includeTitle:!0,includeFrom:!0})}),(0,s.jsxs)("div",{className:"flex flex-col gap-5 flex-1 pb-4",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-2 pr-1",children:[(0,s.jsx)(x.J,{children:"Reason"}),(0,s.jsxs)(p.l6,{id:"reason",defaultValue:r.reason,onValueChange:e=>m("reason",e),children:[(0,s.jsx)(p.bq,{className:"h-12 w-full sm:w-48",children:(0,s.jsx)(p.yv,{placeholder:"Select a reason"})}),(0,s.jsx)(p.gC,{children:F.map(e=>(0,s.jsx)(p.eb,{value:e.value,children:e.label},e.value))})]})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-2 pr-1",children:[(0,s.jsx)(x.J,{children:"Notes"}),(0,s.jsx)(E.T,{value:r.notes,onChange:e=>m("notes",e.target.value),placeholder:"Provide any additional information".concat("search"===r.reason?". (e.g. search query)":""),rows:i?4:7})]})]})]}),(0,s.jsx)("div",{className:"flex flex-row justify-center sm:justify-end gap-4",children:(0,s.jsx)(d.$,{onClick:f,className:"w-full sm:w-auto min-w-24",disabled:o,children:o?(0,s.jsx)(C.A,{size:18,color:"white"}):"Submit"})})]})};_.displayName="FlagClip";let D=(0,o.createServerReference)("40a1905481f7c479de04e9cd9da2597d7a125556dc",o.callServer,void 0,o.findSourceMapURL,"hideClip"),G=e=>{let{clip:l,onDismiss:a}=e,[t,i]=(0,n.useState)(!1),{invalidateClipQueries:r}=z(),c=async()=>{try{i(!0),await D(l.id),r(),(0,T.GF)("Clip hidden"),a()}catch(e){(0,T.Ni)(e.message),i(!1)}};return(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center gap-4 text-center sm:px-8 h-full",children:[(0,s.jsx)("h4",{className:"text-md font-semibold",children:"Are you sure you want to hide this clip?"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:'To unhide it, you will need to edit the "approved" property on the clip record in the database.'}),(0,s.jsx)("div",{className:"flex flex-col sm:flex-row justify-end gap-4 py-4",children:(0,s.jsx)(d.$,{onClick:c,className:"w-full sm:w-auto min-w-24",disabled:t,children:t?(0,s.jsx)(C.A,{size:18,color:"white"}):"Hide this clip"})})]})};G.displayName="HideClip";let H=e=>{let{id:l,label:a,Icon:t,trendingExcluded:i,onClick:n}=e;return(0,s.jsxs)("div",{onClick:()=>n(l),className:"\n flex sm:flex-col items-center justify-center gap-4\n w-full p-4 sm:p-8 rounded-2xl\n border-2 transition-colors cursor-pointer\n border-slate-200 hover:bg-slate-50 hover:border-slate-300\n dark:border-slate-700 dark:bg-slate-900 dark:hover:bg-slate-800 dark:hover:border-slate-700\n ",children:[(0,s.jsx)(t,{size:24,className:"text-slate-400"}),(0,s.jsx)("span",{className:"text-sm font-semibold text-slate-600 dark:text-slate-400",children:"trending"===l?(0,s.jsxs)(s.Fragment,{children:["Trending: ",(0,s.jsx)("strong",{children:i?"OFF":"ON"})]}):a})]})},U=[{id:"edit",label:"Edit Clip",Icon:r.H6t},{id:"flag",label:"Flag Clip",Icon:r.Mbf},{id:"hide",label:"Hide Clip",Icon:r.mI_},{id:"trending",Icon:r.Gt$}],q=e=>{let{clip:l,metrics:a,onBtnClick:t}=e;return(0,s.jsxs)("div",{className:"flex flex-col justify-between items-center flex-1 gap-y-6 w-full",children:[(0,s.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 sm:min-h-[320px] sm:px-8 pt-4 sm:pt-0 w-full",children:U.map(e=>{let{id:l,label:i,Icon:n}=e,r=null==a?void 0:a.excludeFromTrending;return(0,s.jsx)(H,{id:l,label:i,Icon:n,trendingExcluded:r,onClick:()=>t(l)},l)})}),(0,s.jsx)(d.$,{variant:"outline",onClick:()=>t("metrics"),className:"rounded-full",children:"View Clip Metrics"})]})};q.displayName="AdminMenu";var P=a(64662);let V=e=>{let{label:l,value:a,className:t}=e;return(0,s.jsxs)("div",{className:(0,h.cn)("flex flex-col-reverse sm:flex-col gap-1.5 sm:gap-1 bg-slate-100 px-2 py-4 sm:p-3 rounded-md text-center sm:text-left",t),children:[(0,s.jsx)("label",{className:"text-slate-400 text-xs font-semibold",children:l}),(0,s.jsx)("span",{className:"text-slate-500 text-2xl sm:text-lg font-bold line-clamp-2",children:"number"==typeof a?a.toLocaleStr
1ing():a})]})},K=e=>{var l,a,t,i,n,r,d;let{metrics:c}=e;return(0,s.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-x-4 gap-y-2 pb-3",children:[(0,s.jsx)(V,{label:"Trending Rank",value:c.trendingRank||"-"}),(0,s.jsx)(V,{label:"Trending Score",value:(null==(l=c.trendingScore)?void 0:l.toFixed(2))||0}),(0,s.jsx)("div",{className:"col-span-2 text-center",children:(0,s.jsx)("span",{className:"text-slate-300 text-xs font-semibold",children:"Last Updated: ".concat(c.lastTrendingUpdate?(0,P.GP)(c.lastTrendingUpdate,"M/dd/yyyy h:mm a"):"-")})})]}),(0,s.jsxs)("div",{className:"grid grid-cols-2 sm:grid-cols-1 sm:grid-rows-2 gap-5",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,s.jsx)("h3",{className:"text-slate-400 text-xs font-semibold text-center uppercase tracking-wider",children:"Daily"}),(0,s.jsxs)("div",{className:"grid grid-rows-3 sm:grid-rows-1 sm:grid-cols-3 gap-4",children:[(0,s.jsx)(V,{label:"Views",value:(null==(a=c.view)?void 0:a.daily)||"-"}),(0,s.jsx)(V,{label:"Downloads",value:(null==(t=c.download)?void 0:t.daily)||"-"}),(0,s.jsx)(V,{label:"Shares",value:(null==(i=c.share)?void 0:i.daily)||"-"})]})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,s.jsx)("h3",{className:"text-slate-400 text-xs font-semibold text-center uppercase tracking-wider",children:"Total"}),(0,s.jsxs)("div",{className:"grid grid-rows-3 sm:grid-rows-1 sm:grid-cols-3 gap-4",children:[(0,s.jsx)(V,{label:"Views",value:(null==(n=c.view)?void 0:n.total)||"-"}),(0,s.jsx)(V,{label:"Downloads",value:(null==(r=c.download)?void 0:r.total)||"-"}),(0,s.jsx)(V,{label:"Shares",value:(null==(d=c.share)?void 0:d.total)||"-"})]})]})]})]})},O=(0,o.createServerReference)("60a0ecc77681ea03f144fd7d2dba4146e69d89b72a",o.callServer,void 0,o.findSourceMapURL,"toggleTrending"),J={isExcluded:{title:"Trending: OFF",description:"<p>This clip is currently excluded from Trending.</p><p>Would you like to include it in Trending?</p>",btnLabel:"Allow in Trending"},isIncluded:{title:"Trending: ON",description:"<p>This clip is currently included in Trending.</p><p>Would you like to hide it from Trending?</p>",btnLabel:"Hide from Trending"}},Q=e=>{let{clip:l,isExcluded:a,onDismiss:t}=e,[i,r]=(0,n.useState)(!1),{invalidateClipQueries:c}=z(),o=async()=>{try{r(!0),await O(l.id,!a),c(),(0,T.GF)(a?"Clip allowed in Trending":"Clip hidden from Trending"),t()}catch(e){(0,T.Ni)(e.message),r(!1)}},{title:u,description:x,btnLabel:m}=J[a?"isExcluded":"isIncluded"];return(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center gap-4 text-center sm:px-8 h-full",children:[(0,s.jsx)("h4",{className:"text-md font-semibold",children:u}),(0,s.jsx)("div",{className:"text-sm text-muted-foreground flex flex-col gap-2",dangerouslySetInnerHTML:{__html:x}}),(0,s.jsx)("div",{className:"flex flex-col sm:flex-row justify-end gap-4 py-4",children:(0,s.jsx)(d.$,{onClick:o,className:"w-full sm:w-auto min-w-24",disabled:i,children:i?(0,s.jsx)(C.A,{size:18,color:"white"}):m})})]})};Q.displayName="ToggleTrending";let $=e=>{let{clip:l,onDismiss:a}=e,t=(0,n.useRef)(!0),{isAdmin:i}=(0,c.S)(),[o,x]=(0,n.useState)("main"),[m,p]=(0,n.useState)(null);return(0,n.useEffect)(()=>{let e=async()=>{p(await u(l.id))};t.current&&(t.current=!1,e())},[l]),(0,s.jsxs)("div",{className:"flex flex-col gap-7 size-full p-4 sm:p-0",children:[(0,s.jsxs)("div",{className:"grid grid-cols-[48px_1fr_48px] items-center",children:["main"===o?(0,s.jsx)("div",{className:"size-8"}):(0,s.jsx)("button",{onClick:()=>x("main"),className:"flex items-center justify-center bg-modal-button text-accent-foreground rounded-full size-8 pr-1 sm:opacity-70 hover:opacity-100",children:(0,s.jsx)(r.i84,{size:24})}),(0,s.jsx)("h2",{className:"text-2xl font-bold text-center",children:"main"===o?"Manage Clip":"edit"===o?"Edit Clip":"flag"===o?"Flag Clip":"hide"===o?"Hide Clip":"metrics"===o?"Clip Metrics":"Toggle Trending"})]}),i?(0,s.jsxs)(s.Fragment,{children:["main"===o&&(0,s.jsx)(q,{clip:l,metrics:m,onBtnClick:x}),"edit"===o&&(0,s.jsx)(A,{clip:l,metrics:m,onDismiss:a}),"flag"===o&&(0,s.jsx)(_,{clip:l,metrics:m,onDismiss:a}),"hide"===o&&(0,s.jsx)(G,{clip:l,onDismiss:a}),"trending"===o&&(0,s.jsx)(Q,{clip:l,isExcluded:null==m?void 0:m.excludeFromTrending,onDismiss:a}),"metrics"===o&&m&&(0,s.jsx)(K,{metrics:m})]}):(0,s.jsxs)("div",{className:"flex flex-col gap-6 size-full items-center justify-center text-center",children:[(0,s.jsx)("h3",{children:"This is an admin only feature."}),(0,s.jsx)(d.$,{onClick:a,children:"Close"})]})]})},B=e=>{let{clip:l,onDismiss:a}=e;return(0,s.jsx)(i.lG,{open:!0,onOpenChange:a,children:(0,s.jsxs)(i.Cf,{className:"p-4 sm:p-6",children:[(0,s.jsxs)(t.s6,{children:[(0,s.jsx)(i.L3,{children:"Manage Clip"}),(0,s.jsx)(i.rr,{children:"Admin Only: Manage this clip."})]}),(0,s.jsx)($,{clip:l,onDismiss:a})]})})};B.displayName="AdminDialog";let W=B},78505:(e,l,a)=>{a.d(l,{J:()=>c});
1var s=a(95155),t=a(12115),i=a(10489),n=a(83101),r=a(61594);let d=(0,n.F)("text-sm font-semibold leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),c=t.forwardRef((e,l)=>{let{className:a,...t}=e;return(0,s.jsx)(i.b,{ref:l,className:(0,r.cn)(d(),a),...t})});c.displayName=i.b.displayName}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.