import{B as Bi,R as Ri}from'./chunk-D_tgoEtO.js';import{d}from'./chunk-BMYInCYm.js';import{U as Ut$2}from'./chunk-CqVm7Ykw.js';import{B}from'./chunk-C7leSDo_.js';import{w as w$1,q,H,Y,G,r as re}from'./chunk-DrcGS1J7.js';import{K as Kt,M as Me,j as jt,r as rl$1,l as ll$1,P as Pa$2,U as Un$1,Q as Qn$1,t as tl$2,W as Wo$1,b as la$1,c as Qe}from'./chunk-BPJv6CAC.js';import{a as ce,b as ae$1,d as be$1,c as c$1}from'./chunk-tWBGFiFY.js';import{Q}from'./chunk-DBbpaYVV.js';import{$ as $d,V as Vi}from'./chunk-Nvvh024_.js';import'./chunk-BpOe3-4z.js';import{m as me}from'./chunk-CmeTG4Q4.js';import{h}from'./chunk-CJ5LAhIS.js';import{z as z$1}from'./chunk-EQPLZvn8.js';import'./chunk-BcSizZT_.js';import{Z}from'./chunk-DmY7bGyL.js';import{n}from'./chunk-Dr5V-mYF.js';import{o as or$1}from'./chunk-CvNrOII8.js';import{B as Bc,s as si,u as ue,Q as Qh,L as Lh}from'./chunk-C-6BSoOj.js';import{J as Je$1}from'./chunk-Ddq7J0Wf.js';import'./chunk-BlVv8LBg.js';import{_}from'./chunk-Bi4BrHud.js';import{p as p$1}from'./chunk-DA9ZLNDO.js';import'./chunk-wXlrCZCl.js';import{p}from'./chunk-DE3BvSt0.js';import{H as Ht$1,D as Dt,N as Nt$1,U as Un}from'./chunk-BrVO-2dI.js';import{d as d$1}from'./chunk-DHVyyAtU.js';import{t}from'./chunk-BVeX-r_x.js';import'./chunk-nfSA6zwi.js';import{c}from'./chunk-G-N-DNp6.js';import{i as i$2}from'./chunk-CvgYfehy.js';import'./chunk-I7o41Fka.js';import{r}from'./chunk-DZVj2nmI.js';import{av as E,ao as D,d7 as ck,b as Pa$1,g,aQ as Ze,aM as N1,aN as $,a as rc$1,a7 as yg,aO as Vr$1,aA as cg,aC as x,$ as $t,bN as Fk,bv as i$1,x as xpe,am as Xt,bS as tm,br as lt,dC as rHe,aE as L,aF as CAe,be as M,dD as QDe,dy as K,by as X,bA as _je,dE as T,dF as z,dG as ze,dH as De,D as w,b2 as mt,bF as Uu,dI as Cs$1,b1 as hg,dJ as uIe,cw as Rc,dK as aIe,a9 as Oe,a_ as Pk,bD as Cje,P as Pc,dL as H$1,aP as Ut$1,aR as fe,dM as XP,r as rr$1,dN as F5,dO as ETe,aY as S,dP as ri,bL as J,bM as wo,al as H$2,K as qp,dQ as Npe,ar as wpe,bo as tc$1,j,N as tl$1,dR as A,_ as _pe,dS as rDe,dT as ie,dU as tt,dV as ms$1,dW as W,dX as Y1,bs as M$1,dl as Ie,dY as le,dZ as be,d_ as Ce,cT as Ln,cU as mn,d$ as ot,aL as Ye,e0 as V1,e1 as Et,cK as A$1,at as Mn,e2 as Ur$1,e3 as It,cN as kt,e4 as Gc,e5 as Gu,e6 as ae$2,e7 as Dn,bK as sn$1,e8 as N,e9 as Wd,ea as nt,eb as an$1,ec as i3,ah as u$,bP as D$1,bQ as af,bl as ta$1,ed as E_e,ee as wr$1,aX as le$1,bf as Pl$1,ef as ni,eg as Fe,eh as L$1,ei as q$1,ej as $$1,ek as R,el as j1,f as Pp,J as Jn,q as qn,l as ln$1,M as Me$1,s as sp,v as vV,d as lb,ae as N2,af as R2,W as WB,ag as M2,ci as db,k as w2,a6 as XV,cj as fb,c6 as j0,dt as ux,o as x2,ak as xx,ck as q0,cc as FS,cp as hn,F as F2,e as Fp,a3 as H0,T as Tr$1,cx as fe$1,Z as Zh,cd as N3,em as fx,ca as M$2,c as IV,C as it,O as Ox,m as zH,w as w0,u as Mx,y as qH,p as px,bV as Ez,cy as Eb,a0 as $n,Q as Qn,a1 as Vn,a2 as yn,cf as C0,ai as bV,dz as ed,R as cl$1,U as x3,I as I$,V as Zn,X as Je,a5 as fn,bW as v,as as Yl$1,a4 as d$,ct as o$,c4 as U,en as M1,ad as ti,L as e3,b_ as Ex,cs as Lp,cE as HV,cg as ef,ch as tf,h as sx,i as ax,S as SV,n as cx,E as EV,G as GI,z as zI,bY as pb,cq as E$,bZ as kp,cz as S$,cr as T$,aj as CV,cG as $0,t as t$,au as iw,ce as l$,cF as aw}from'./main-DEZ5cZzu.js';import{L as L$2}from'./chunk-CifDxe6s.js';import{H as H$3}from'./chunk-DxMtlMW3.js';var Fo=H$2((Bc,qr)=>{qr.exports=`<svg width="278" height="202" viewBox="0 0 278 202" fill="none" xmlns="http://www.w3.org/2000/svg">
  <path d="M154.004 185.78C207.06 179.326 249.514 169.528 248.829 163.895C248.144 158.262 204.579 158.927 151.523 165.381C98.4671 171.835 56.0125 181.633 56.6977 187.266C57.3829 192.899 100.948 192.233 154.004 185.78Z" fill="url(#paint0_radial_2530_45010)" fill-opacity="0.1" />
  <rect x="50.5752" y="22.3535" width="167" height="167" rx="24" transform="rotate(-7.69207 50.5752 22.3535)" fill="var(--bg)" />
  <path d="M106.941 75.79L175.903 66.4757C179.902 65.9355 184.024 69.0292 184.689 73.9578L190.119 114.161C190.785 119.09 187.632 123.166 183.632 123.706L114.671 133.02C110.671 133.561 106.55 130.467 105.884 125.538L100.454 85.335C99.7885 80.4063 102.941 76.3302 106.941 75.79Z" stroke="var(--bg-secondary-450)" stroke-width="6" />
  <path d="M115.966 52.623L137.514 70.5249" stroke="var(--bg-secondary-450)" stroke-width="6" stroke-linecap="round" stroke-linejoin="round" />
  <path d="M161.057 46.5332L145.03 69.5102" stroke="var(--bg-secondary-450)" stroke-width="6" stroke-linecap="round" stroke-linejoin="round" />
  <g clip-path="url(#clip0_2530_45010)">
    <rect y="8.43359" width="74" height="74" rx="37" fill="var(--bg-secondary-450)" />
    <path d="M36.9997 51.8372C44.8237 51.8372 51.1663 45.4946 51.1663 37.6706C51.1663 29.8465 44.8237 23.5039 36.9997 23.5039C29.1756 23.5039 22.833 29.8465 22.833 37.6706C22.833 45.4946 29.1756 51.8372 36.9997 51.8372Z" stroke="var(--secondary-icon-color)" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" />
    <path d="M59.6663 74.5046C59.6663 68.493 57.2783 62.7276 53.0274 58.4768C48.7766 54.226 43.0112 51.8379 36.9997 51.8379C30.9881 51.8379 25.2227 54.226 20.9719 58.4768C16.7211 62.7276 14.333 68.493 14.333 74.5046" stroke="var(--secondary-icon-color)" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" />
  </g>
  <g clip-path="url(#clip1_2530_45010)">
    <rect x="96" y="157.424" width="44" height="44" rx="22" fill="var(--secondary-icon-color)" />
    <path d="M118 184.837C123.062 184.837 127.166 180.733 127.166 175.671C127.166 170.608 123.062 166.504 118 166.504C112.937 166.504 108.833 170.608 108.833 175.671C108.833 180.733 112.937 184.837 118 184.837Z" stroke="var(--bg-secondary-350)" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" />
    <path d="M132.666 199.505C132.666 195.615 131.121 191.884 128.371 189.134C125.62 186.383 121.89 184.838 118 184.838C114.11 184.838 110.379 186.383 107.629 189.134C104.878 191.884 103.333 195.615 103.333 199.505" stroke="var(--bg-secondary-350)" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" />
  </g>
  <g clip-path="url(#clip2_2530_45010)">
    <rect x="218" y="77.4258" width="60" height="60" rx="30" fill="var(--fg-300)" />
    <path d="M248 115.504C254.904 115.504 260.5 109.907 260.5 103.004C260.5 96.1003 254.904 90.5039 248 90.5039C241.096 90.5039 235.5 96.1003 235.5 103.004C235.5 109.907 241.096 115.504 248 115.504Z" stroke="var(--bg-secondary-500)" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" />
    <path d="M268 135.504C268 130.2 265.893 125.112 262.142 121.362C258.391 117.611 253.304 115.504 248 115.504C242.696 115.504 237.609 117.611 233.858 121.362C230.107 125.112 228 130.2 228 135.504" stroke="var(--bg-secondary-500)" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" />
  </g>
  <circle cx="219" cy="135.43" r="16" fill="var(--bg-secondary-500)" />
  <g clip-path="url(#clip3_2530_45010)">
    <path d="M222.334 138.763L219 135.43L215.667 138.763" stroke="var(--fg-200)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
    <path d="M219 135.43V142.93" stroke="var(--fg-200)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
    <path d="M225.992 140.755C226.805 140.311 227.447 139.61 227.817 138.762C228.187 137.913 228.264 136.966 228.035 136.069C227.807 135.171 227.286 134.376 226.556 133.807C225.825 133.239 224.926 132.93 224 132.93H222.95C222.698 131.954 222.228 131.048 221.575 130.28C220.922 129.513 220.104 128.903 219.182 128.497C218.26 128.091 217.257 127.899 216.25 127.936C215.243 127.973 214.258 128.238 213.368 128.711C212.478 129.184 211.707 129.852 211.112 130.666C210.518 131.48 210.116 132.418 209.936 133.409C209.756 134.401 209.804 135.42 210.075 136.391C210.345 137.361 210.833 138.258 211.5 139.013" stroke="var(--fg-200)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
    <path d="M222.334 138.763L219 135.43L215.667 138.763" stroke="var(--fg-200)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
  </g>
  <circle cx="61" cy="76.4336" r="16" fill="var(--secondary-icon-color)" />
  <path d="M60.8525 73.166C62.5743 73.1661 63.9697 74.5614 63.9697 76.2832C63.9696 78.0049 62.5742 79.4003 60.8525 79.4004C59.1307 79.4004 57.7355 78.005 57.7354 76.2832C57.7354 74.5613 59.1307 73.166 60.8525 73.166ZM60.8525 73.9736C59.5774 73.9736 58.543 75.0081 58.543 76.2832C58.5431 77.5586 59.5778 78.5908 60.8525 78.5908C62.1275 78.5907 63.1601 77.5582 63.1602 76.2832C63.1602 75.0085 62.128 73.9737 60.8525 73.9736Z" fill="black" stroke="var(--bg)" />
  <path d="M60.8516 66.7402C60.076 66.7405 59.4473 67.3692 59.4473 68.1445V68.2988C59.4472 69.0559 58.994 69.7395 58.2969 70.0352L58.2891 70.0391L58.2803 70.043C58.2589 70.0529 58.2373 70.0585 58.2139 70.0605L58.1484 70.0664L58.0869 70.0879C57.4516 70.3169 56.7454 70.1822 56.2402 69.7451L56.1416 69.6543C55.888 69.3698 55.5309 69.2009 55.1514 69.1846L55.1494 69.1836C54.7556 69.1682 54.3723 69.3204 54.0947 69.6016C53.5506 70.1489 53.5508 71.0335 54.0938 71.5811L54.1035 71.5898C54.6841 72.1443 54.8562 73.004 54.5342 73.7412L54.5293 73.751L54.5254 73.7607C54.2489 74.4732 53.5683 74.9483 52.8037 74.9609H52.7129C51.9379 74.961 51.3088 75.5893 51.3086 76.3643C51.3086 77.14 51.9374 77.7695 52.7129 77.7695H52.8633C53.5773 77.7747 54.224 78.1797 54.5449 78.8096L54.6045 78.9385C54.8987 79.6412 54.7469 80.451 54.2188 80.998C53.9309 81.2694 53.7631 81.6432 53.75 82.0361V82.0605C53.7562 82.4282 53.9053 82.7795 54.1689 83.0391V83.04C54.7164 83.5857 55.6017 83.5846 56.1494 83.04L56.1504 83.0391C56.5239 82.6655 57.0279 82.4521 57.5557 82.4443C57.8088 82.443 58.0594 82.4979 58.29 82.6055L58.3057 82.6133L58.3232 82.6201C59.0318 82.8902 59.5054 83.5638 59.5205 84.3223H59.5195V84.4229C59.5196 85.1978 60.1488 85.8261 60.9238 85.8262C61.7003 85.8262 62.328 85.1975 62.3281 84.4229V84.2715C62.3321 83.5135 62.7851 82.8298 63.4814 82.5303L63.4873 82.5273C64.1921 82.2136 65.0171 82.3665 65.5615 82.9121C65.8323 83.201 66.2085 83.3729 66.6064 83.3848H66.6221C67.1904 83.3832 67.7022 83.0388 67.917 82.5137C68.1326 81.9878 68.0099 81.3832 67.6055 80.9834L67.6016 80.9795L67.498 80.8711C67.0047 80.3141 66.8724 79.5161 67.1709 78.8242L67.1699 78.8232C67.4717 78.1329 68.1553 77.6875 68.9092 77.6875V77.6865C69.288 77.7086 69.6591 77.5787 69.9395 77.3223C70.2321 77.0544 70.3961 76.6752 70.3945 76.2812C70.3932 75.5066 69.7658 74.879 68.9912 74.8789H68.8369C68.0825 74.8789 67.401 74.4287 67.1035 73.7363C67.0885 73.6974 67.0766 73.6568 67.0703 73.6143L67.0635 73.5654L67.0459 73.5186L67.0059 73.3906C66.8248 72.7469 67.0034 72.0505 67.4814 71.5732L67.4805 71.5723C67.7617 71.319 67.9302 70.9648 67.9453 70.5869L67.9443 70.5859C67.9607 70.1941 67.8132 69.8157 67.5381 69.5391H67.5391C67.2769 69.2723 66.9179 69.1197 66.542 69.1182L66.5342 69.1191C66.162 69.1238 65.8093 69.2761 65.5508 69.5391H65.5498L65.5459 69.5439C64.9903 70.1249 64.1316 70.2966 63.3945 69.9746C62.7003 69.6714 62.2527 68.985 62.2559 68.2275L62.2549 68.2266C62.2743 67.8976 62.1798 67.5722 61.9844 67.3086L61.8896 67.1953C61.6222 66.9036 61.2446 66.7391 60.8516 66.7402ZM58.7109 84.417C58.7057 83.9671 58.4415 83.5634 58.0352 83.376L58.0342 83.375L57.8779 83.3164C57.5087 83.2082 57.1039 83.2896 56.8037 83.542L56.7832 83.5596L56.7637 83.5801C56.3516 84.0133 55.7828 84.2602 55.1846 84.2676C54.5877 84.2738 54.0124 84.0404 53.5908 83.6172H53.5918C52.7345 82.7542 52.7345 81.3601 53.5918 80.4971L53.5898 80.4951C53.9284 80.182 54.0411 79.6959 53.875 79.2676L53.8711 79.2578L53.8662 79.2471C53.6929 78.8535 53.3081 78.5962 52.8779 78.5869H52.7129C51.4911 78.5869 50.5002 77.5965 50.5 76.374C50.5 75.1522 51.4911 74.1602 52.7129 74.1602V74.1592C53.1638 74.1725 53.5723 73.9103 53.7529 73.5L53.7539 73.501C53.7563 73.4963 53.7574 73.491 53.7598 73.4863C53.765 73.4741 53.7726 73.4627 53.7773 73.4502L53.7754 73.4492C53.9589 73.0462 53.8902 72.5704 53.5889 72.2393L53.5791 72.2275L53.5684 72.2178L53.4141 72.0518C52.6936 71.1913 52.7275 69.9074 53.5283 69.0859C54.3816 68.2099 55.784 68.1919 56.6592 69.0459L56.6602 69.0439C56.97 69.3745 57.4485 69.4896 57.876 69.3271L57.877 69.3281L58.0488 69.2646L58.1025 69.2451L58.1504 69.2139C58.4234 69.0356 58.5983 68.7453 58.6328 68.4268L58.6387 68.2891V68.1445C58.6387 66.9227 59.6291 65.9319 60.8516 65.9316C62.0734 65.9316 63.0654 66.9227 63.0654 68.1445H63.0664C63.045 68.5949 63.2941 69.0146 63.7002 69.21L63.707 69.2139L63.7129 69.2158C64.1165 69.3958 64.5912 69.3205 64.918 69.0176L64.9414 68.9941C65.3569 68.5542 65.9345 68.3038 66.54 68.3008C67.1231 68.3018 67.6825 68.5325 68.0957 68.9424C68.5121 69.3574 68.7461 69.9218 68.7461 70.5098C68.7461 71.0978 68.5115 71.661 68.0947 72.0762L68.0957 72.0771C67.7964 72.3522 67.6737 72.7654 67.7686 73.1533L67.8242 73.3232C67.8341 73.3479 67.8434 73.377 67.8506 73.4111L67.8721 73.5127L67.9316 73.5967C68.1338 73.8834 68.461 74.056 68.8115 74.0615H68.9912C70.213 74.0616 71.204 75.0519 71.2041 76.2744C71.2041 77.4962 70.213 78.4872 68.9912 78.4873V78.4893C68.5448 78.4707 68.1249 78.7142 67.9268 79.1211L67.9209 79.1318C67.7332 79.5426 67.8211 80.0251 68.1396 80.3438L68.1436 80.3486C69.0198 81.2046 69.0366 82.6089 68.1807 83.4854H68.1797C67.3248 84.3612 65.9205 84.3776 65.0439 83.5215H65.043C64.748 83.1971 64.2884 83.0775 63.873 83.2227C63.4366 83.3738 63.1422 83.7836 63.1367 84.2451V84.4229C63.1366 85.6446 62.1456 86.6357 60.9238 86.6357C59.7021 86.6356 58.7111 85.6446 58.7109 84.4229V84.417Z" fill="black" stroke="var(--bg)" />
  <path d="M45 97C55.5 115 81.5 115.5 88 109.5C94.5 103.5 70 92.5 68 119C66.4 140.2 80.6667 156.5 88 162" stroke="var(--bg-secondary-500)" stroke-linecap="round" stroke-dasharray="4 4" />
  <path d="M251 146.5C253.5 162 253 202 209 184.5C165 167 167 162 148 165" stroke="var(--bg-secondary-500)" stroke-linecap="round" stroke-dasharray="4 4" />
  <path d="M239.5 70.5002C223.5 57 193 63.5011 172.5 82.0005" stroke="var(--bg-secondary-500)" stroke-linecap="round" stroke-dasharray="4 4" />
  <path d="M170.286 79C170.286 80.3609 167.185 83.4258 166.259 85.8156C166.03 86.4039 166.577 86.8845 167.196 86.7608L176 85" stroke="var(--bg-secondary-500)" stroke-linecap="round" />
  <defs>
    <radialGradient id="paint0_radial_2530_45010" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(152.764 175.58) rotate(-6.93547) scale(96.7739 10.2746)">
      <stop />
      <stop offset="1" stop-opacity="0" />
    </radialGradient>
    <clipPath id="clip0_2530_45010">
      <rect y="8.43359" width="74" height="74" rx="37" fill="var(--bg)" />
    </clipPath>
    <clipPath id="clip1_2530_45010">
      <rect x="96" y="157.424" width="44" height="44" rx="22" fill="var(--bg)" />
    </clipPath>
    <clipPath id="clip2_2530_45010">
      <rect x="218" y="77.4258" width="60" height="60" rx="30" fill="var(--bg)" />
    </clipPath>
    <clipPath id="clip3_2530_45010">
      <rect width="20" height="20" fill="var(--bg)" transform="translate(209 125.43)" />
    </clipPath>
  </defs>
</svg>
`;});var Yo=(()=>{class i{static ɵfac=function(t){return new(t||i)();};static ɵcmp=Pa$1({type:i,selectors:[["ng-component"]],decls:1,vars:0,consts:[["mode","user","key","UserVideoCommentList"]],template:function(t,n){t&1&&Pp(0,"my-video-comment-list-admin-owner",0);},dependencies:[Pa$2],encapsulation:2,changeDetection:1});}return i;})();function jr(i,o){if(i&1){let e=F2();sp(0,"div",2)(1,"my-peertube-checkbox",3),Ox("ngModelChange",function(n){let r=GI(e).$implicit;return t$(r.review,n)||(r.review=n),zI(n);}),Fp("ngModelChange",function(){GI(e);let n=SV();return zI(n.updatePolicies());}),lb(),zH(),lb();}if(i&2){let e=o.$implicit,t=o.$index,n=SV();WB(),H0("inputName","tag-"+t),Mx("ngModel",e.review),H0("labelInnerHTML",n.getLabelText(e)),qH();}}var Vo=(()=>{class i{authService=g(Ze);autoTagsService=g(Kt);notifier=g(rc$1);html=g(yg);route=g(Vr$1);tags=[];ngOnInit(){this.tags=this.route.snapshot.data.tags;}getLabelText(e){let t=e.name==="external-link"?"That contain <strong>an external link</strong>":"That contain any word from your <strong>"+e.name+"</strong> watched word list";return this.html.toSimpleSafeHtml(t);}updatePolicies(){let e=this.authService.getUser().account.name;this.autoTagsService.updateCommentPolicies({accountName:e,review:this.tags.filter(t=>t.review).map(t=>t.name)}).subscribe({next:()=>{this.notifier.success("\u8BC4\u8BBA\u653F\u7B56\u5DF2\u66F4\u65B0");},error:t=>this.notifier.handleError(t)});}static ɵfac=function(t){return new(t||i)();};static ɵcmp=Pa$1({type:i,selectors:[["ng-component"]],decls:4,vars:0,consts:()=>{let e;return e="\u81EA\u52A8\u5C4F\u853D\u8BC4\u8BBA\uFF1A",[e,[1,"d-block","mb-3"],[1,"form-group","ms-3"],[3,"ngModelChange","inputName","ngModel","labelInnerHTML"]];},template:function(t,n){t&1&&(sp(0,"strong",1),vV(1,0),lb(),N2(2,jr,2,3,"div",2,R2)),t&2&&(WB(2),M2(n.tags));},dependencies:[Jn,qn,ln$1,Me$1],encapsulation:2,changeDetection:1});}return i;})();var $o=()=>{let i=g(Ze),o=g(Kt),e=i.getUser().account.name;return N1([o.listAvailable({accountName:e}),o.getCommentPolicies({accountName:e})]).pipe($(([t,n])=>t.available.map(r=>({name:r.name,type:r.type,review:n.review.includes(r.name)}))));};function Qr(i,o){if(i&1&&(db(0,"div",1),j0(1,"div",4),fb()),i&2){let e=SV();WB(),q0("innerHTML",e.svg,iw);}}var ko=(()=>{class i{activeModal=g(ri);title;html;svg;static ɵfac=function(t){return new(t||i)();};static ɵcmp=Pa$1({type:i,selectors:[["my-new-feature-info-modal"]],decls:6,vars:3,consts:()=>{let e;return e="\u77E5\u9053\u4E86",[[1,"modal-body"],[1,"svg-relative-container"],[1,"content",3,"innerHtml"],["type","button","role","button","value",e,1,"peertube-button","primary-button",3,"click","key.enter"],["aria-hidden","true",1,"svg-container",3,"innerHTML"]];},template:function(t,n){t&1&&(db(0,"div",0),w2(1,Qr,2,1,"div",1),db(2,"h2"),XV(3),fb(),j0(4,"div",2),db(5,"input",3),ux("click",function(){return n.activeModal.close();})("key.enter",function(){return n.activeModal.close();}),fb()()),t&2&&(WB(),x2(n.svg?1:-1),WB(2),xx(n.title),WB(),q0("innerHTML",n.html,iw));},dependencies:[Jn],styles:["h2[_ngcontent-%COMP%]{color:var(--fg-350);font-weight:700;margin-bottom:calc(1.325rem + .9vw)}@media(min-width:1200px){h2[_ngcontent-%COMP%]{margin-bottom:2rem}}h2[_ngcontent-%COMP%]{font-size:calc(1.3625rem + 1.35vw)}@media(min-width:1200px){h2[_ngcontent-%COMP%]{font-size:2.375rem}}.modal-body[_ngcontent-%COMP%]{text-align:center}.content[_ngcontent-%COMP%]{color:var(--fg-200);margin-bottom:calc(1.375rem + 1.5vw)}@media(min-width:1200px){.content[_ngcontent-%COMP%]{margin-bottom:2.5rem}}.svg-relative-container[_ngcontent-%COMP%]{position:relative}.svg-container[_ngcontent-%COMP%]{margin:0 auto;position:absolute;top:-3.5rem;right:0;left:0}.svg-relative-container[_ngcontent-%COMP%] + h2[_ngcontent-%COMP%]{margin-top:10rem}"],changeDetection:1});}return i;})();var Zr=Fo(),bi=(()=>{class i{auth=g(Ze);modalService=g(rr$1);serverService=g($t);userService=g(Pc);notifier=g(rc$1);domSanitizer=g(F5);showChannelCollaboration(){this.auth.userInformationLoaded.pipe(ze()).subscribe(()=>{if(this.serverService.getHTMLConfig().client.newFeaturesInfo!==true||this.auth.getUser().newFeaturesInfoRead&ETe.CHANNEL_COLLABORATION||this.modalService.hasOpenModals())return;let n=this.serverService.getHTMLConfig().instance.name,r=this.modalService.open(ko,{size:"lg",centered:true}),s=r.componentInstance;s.title="\u9891\u9053\u534F\u4F5C\u529F\u80FD\u5373\u5C06\u767B\u9646 "+n+"\u3002",s.html="\u4F60\u73B0\u5728\u53EF\u4EE5<strong>\u9080\u8BF7\u5176\u4ED6\u7528\u6237</strong>\u6765\u534F\u4F5C\u7BA1\u7406\u4F60\u7684\u9891\u9053\u4E86\u3002",s.svg=this.domSanitizer.bypassSecurityTrustHtml(Zr),r.result.finally(()=>{this.userService.markNewFeatureInfoAsRead(ETe.CHANNEL_COLLABORATION).subscribe({next:()=>this.auth.refreshUserInformation(),error:d=>this.notifier.handleError(d)});});});}static ɵfac=function(t){return new(t||i)();};static ɵprov=S({token:i,factory:i.ɵfac,providedIn:"root"});}return i;})();var Bo=(()=>{class i{serverService=g($t);newFeatureInfoService=g(bi);menuEntries=[];serverConfig;ngOnInit(){this.serverConfig=this.serverService.getHTMLConfig(),this.buildMenu(),this.newFeatureInfoService.showChannelCollaboration();}buildMenu(){this.menuEntries=[{label:"\u7BA1\u7406\u6211\u7684\u9891\u9053",routerLink:"/my-library/video-channels"},{label:"\u5173\u6CE8\u8005",routerLink:"/my-library/followers"},{label:"\u540C\u6B65",routerLink:"/my-library/video-channel-syncs",isDisplayed:()=>this.isChannelSyncEnabled()}];}isChannelSyncEnabled(){let e=this.serverConfig.import;return this.serverConfig.import.videoChannelSynchronization.enabled&&(e.videos.http.enabled||e.videos.torrent.enabled);}static ɵfac=function(t){return new(t||i)();};static ɵcmp=Pa$1({type:i,selectors:[["ng-component"]],decls:8,vars:1,consts:()=>{let e;e="\u6211\u7684\u9891\u9053";let t;return t="\u8DF3\u8FC7\u5B50\u83DC\u5355",[["myChannelSpaceContent",""],t,[1,"root"],[1,"margin-content"],["href","#my-channel-space-content",1,"visually-hidden-focusable","skip-to-content-sub-menu",3,"click"],["h1Icon","channel","h1",e,3,"menuEntries"],["tabindex","-1","id","my-channel-space-content",1,"margin-content","pb-5","outline-0"]];},template:function(t,n){if(t&1){let r=F2();sp(0,"div",2)(1,"div",3)(2,"a",4),Fp("click",function(d){GI(r);let u=CV(6);return d.preventDefault(),zI(u.focus());}),vV(3,1),lb(),Pp(4,"my-horizontal-menu",5),lb(),sp(5,"div",6,0),Pp(7,"router-outlet"),lb()();}t&2&&(WB(4),H0("menuEntries",n.menuEntries));},dependencies:[FS,hn],encapsulation:2,changeDetection:1});}return i;})();function Kr(i,o){if(i&1&&(sp(0,"span",4),XV(1),lb()),i&2){let e=SV();WB(),Eb(" ",e.getTotalTitle());}}function Jr(i,o){i&1&&(sp(0,"div",8),vV(1,0),lb());}function ea(i,o){i&1&&(pb(0),vV(1,1),kp());}function ta(i,o){if(i&1&&(pb(0),vV(1,2),kp()),i&2){let e=SV().$implicit;WB(),cx(e.following.name),EV(1);}}function ia(i,o){if(i&1&&(sp(0,"div",10),Pp(1,"my-actor-avatar",11),sp(2,"div",12)(3,"a",13)(4,"div",14),XV(5),lb(),Pp(6,"my-global-icon",15),lb(),sp(7,"div",16),w2(8,ea,2,0,"ng-container")(9,ta,2,1,"ng-container"),lb()()()),i&2){let e=o.$implicit,t=SV();WB(),H0("actor",e.follower)("href",e.follower.url),WB(2),H0("href",e.follower.url,aw),WB(2),xx(e.follower.name+"@"+e.follower.host),WB(3),x2(t.isFollowingAccount(e)?8:9);}}var zo=(()=>{class i{route=g(Vr$1);auth=g(Ze);userSubscriptionService=g(B);notifier=g(rc$1);follows=[];pagination={currentPage:1,itemsPerPage:10,totalItems:null};onDataSubject=new X();search;channelFilter;inputFilters;ngOnInit(){this.inputFilters=[{type:"select",key:"channel",title:"\u9891\u9053",items:this.auth.getUser().videoChannels.map(e=>({id:e.name,label:e.displayName}))}],this.search=this.route.snapshot.queryParamMap.get("search")||"",this.channelFilter=this.route.snapshot.queryParamMap.get("channel")||"",this.loadFollowers();}onNearOfBottom(){this.pagination.totalItems<=this.pagination.currentPage*this.pagination.itemsPerPage||(this.pagination.currentPage+=1,this.loadFollowers());}onSearch(e){this.search=e,_je(this.pagination),this.loadFollowers({reset:true});}onFilter(e){this.channelFilter=e.channel,_je(this.pagination),this.loadFollowers({reset:true});}isFollowingAccount(e){return e.following.name===this.getUsername();}getTotalTitle(){return CAe(""+this.pagination.totalItems+" {total, plural, =1 {\u4F4D\u8BA2\u9605\u8005} other {\u4F4D\u8BA2\u9605\u8005}}",{total:this.pagination.totalItems});}loadFollowers(e={}){let{reset:t=false}=e;this.userSubscriptionService.listFollowers({pagination:this.pagination,nameWithHost:this.getUsername(),search:this.search,channel:this.channelFilter}).subscribe({next:n=>{this.follows=t?n.data:this.follows.concat(n.data),this.pagination.totalItems=n.total,this.onDataSubject.next(n.data);},error:n=>this.notifier.handleError(n)});}getUsername(){return this.auth.getUser().username;}static ɵfac=function(t){return new(t||i)();};static ɵcmp=Pa$1({type:i,selectors:[["ng-component"]],decls:9,vars:4,consts:()=>{let e;e="\u672A\u627E\u5230\u5173\u6CE8\u8005\u3002";let t;t="\u5173\u6CE8\u8005\u9875\u9762";let n;n="\u6B63\u5173\u6CE8\u4F60\u7684\u6240\u6709\u9891\u9053";let r;return r="\u6B63\u5173\u6CE8\u4F60\u7684\u9891\u9053 "+"\uFFFD0\uFFFD"+"",[e,n,r,[1,"followers-header","d-flex","justify-content-between","align-items-end","gap-2","flex-wrap"],[1,"total-items"],[1,"d-flex","gap-2","flex-wrap","ms-auto"],[3,"search"],[1,"d-block","ms-auto",3,"filtersChange","filters"],[1,"no-results"],["myInfiniteScroller","",1,"actors",3,"nearOfBottom","dataObservable"],[1,"actor"],["actorType","account","size","40",3,"actor","href"],[1,"actor-info"],["rel","noopener noreferrer","target","_blank","title",t,1,"actor-names",3,"href"],[1,"actor-display-name"],["iconName","external-link"],[1,"small","muted"]];},template:function(t,n){t&1&&(sp(0,"div",3),w2(1,Kr,2,1,"span",4),sp(2,"div",5)(3,"my-search-input",6),Fp("search",function(s){return n.onSearch(s);}),lb(),sp(4,"my-advanced-input-filter",7),Fp("filtersChange",function(s){return n.onFilter(s);}),lb()()(),w2(5,Jr,2,0,"div",8),sp(6,"div",9),Fp("nearOfBottom",function(){return n.onNearOfBottom();}),N2(7,ia,10,5,"div",10,R2),lb()),t&2&&(WB(),x2(n.pagination.totalItems?1:-1),WB(3),H0("filters",n.inputFilters),WB(),x2(n.pagination.totalItems===0?5:-1),WB(),H0("dataObservable",n.onDataSubject.asObservable()),WB(),M2(n.follows));},dependencies:[Tr$1,si,L$2,fe$1,ue],styles:[".followers-header[_ngcontent-%COMP%]{margin-bottom:30px;display:flex}input[type=text][_ngcontent-%COMP%]{font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:300px;max-width:300px;color:var(--input-fg);background-color:var(--input-bg);border:var(--input-border-width) solid var(--input-border-color);border-radius:var(--input-border-radius);line-height:24px}input[type=text][_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder-color);font-size:var(--input-placeholder-font-size)}input[type=text][readonly][_ngcontent-%COMP%]{color:var(--fg-300)}input[type=text][_ngcontent-%COMP%]:focus, input[type=text][_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}input[type=text][disabled][_ngcontent-%COMP%]{color:var(--fg-300);opacity:.8}@media screen and (max-width:340px){input[type=text][_ngcontent-%COMP%]{width:100%}}.actor[_ngcontent-%COMP%]{display:flex;min-height:auto;padding-bottom:1.25rem;margin-bottom:1.25rem;border-bottom:1px solid var(--input-border-color)}@media screen and (max-width:800px){.actor[_ngcontent-%COMP%]{flex-direction:column;height:auto;align-items:center}}.actor[_ngcontent-%COMP%] > my-actor-avatar[_ngcontent-%COMP%]{margin-inline-end:.625rem}.actor[_ngcontent-%COMP%]   .actor-info[_ngcontent-%COMP%]{flex-grow:1}.actor[_ngcontent-%COMP%]   .actor-names[_ngcontent-%COMP%]{width:fit-content;display:flex;align-items:baseline;color:var(--fg)}.actor[_ngcontent-%COMP%]   .actor-names[_ngcontent-%COMP%], .actor[_ngcontent-%COMP%]   .actor-names[_ngcontent-%COMP%]:hover, .actor[_ngcontent-%COMP%]   .actor-names[_ngcontent-%COMP%]:focus, .actor[_ngcontent-%COMP%]   .actor-names[_ngcontent-%COMP%]:active{text-decoration:none}.actor[_ngcontent-%COMP%]   .actor-names[_ngcontent-%COMP%]:focus:not(:focus-visible){outline:none}.actor[_ngcontent-%COMP%]   .actor-display-name[_ngcontent-%COMP%]{font-weight:600;font-size:18px}.actor[_ngcontent-%COMP%]   .actor-name[_ngcontent-%COMP%]{font-size:14px;color:var(--fg-300);margin-inline-start:.3125rem}.actor[_ngcontent-%COMP%]   .actor-owner[_ngcontent-%COMP%]{color:var(--fg);display:flex;align-items:center}.actor[_ngcontent-%COMP%]   .actor-owner[_ngcontent-%COMP%], .actor[_ngcontent-%COMP%]   .actor-owner[_ngcontent-%COMP%]:hover, .actor[_ngcontent-%COMP%]   .actor-owner[_ngcontent-%COMP%]:focus, .actor[_ngcontent-%COMP%]   .actor-owner[_ngcontent-%COMP%]:active{text-decoration:none}.actor[_ngcontent-%COMP%]   .actor-owner[_ngcontent-%COMP%]:focus:not(:focus-visible){outline:none}.actor[_ngcontent-%COMP%]   .actor-owner[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]:hover{opacity:.8}.actor[_ngcontent-%COMP%]   .actor-owner[_ngcontent-%COMP%]   my-actor-avatar[_ngcontent-%COMP%]{margin-inline-start:.3125rem}@media screen and (max-width:800px){.actor[_ngcontent-%COMP%]   .actor-info[_ngcontent-%COMP%]{padding-bottom:10px;text-align:center}.actor[_ngcontent-%COMP%]   .actor-info[_ngcontent-%COMP%]   .actor-names[_ngcontent-%COMP%]{flex-direction:column;align-items:center!important;margin:auto}}"],changeDetection:1});}return i;})();var Ho=i=>["/c",i],na=i=>["/a",i],oa=i=>[i];function ra(i,o){if(i&1&&(sp(0,"span",4),XV(1),lb()),i&2){let e=SV();WB(),Eb(" ",e.getTotalTitle());}}function aa(i,o){i&1&&(sp(0,"div",6),vV(1,0),lb());}function sa(i,o){if(i&1&&(sp(0,"div",8),Pp(1,"my-actor-avatar",9),sp(2,"div",10)(3,"a",11)(4,"div",12),XV(5),lb(),sp(6,"div",13),XV(7),lb()(),sp(8,"div",14),vV(9,1),lb(),sp(10,"a",15)(11,"span"),vV(12,2),lb(),Pp(13,"my-actor-avatar",16),lb()(),Pp(14,"my-subscribe-button",17),lb()),i&2){let e=o.$implicit;WB(),H0("actor",e)("internalHref",d$(10,Ho,e.nameWithHost)),WB(2),H0("routerLink",d$(12,Ho,e.nameWithHost)),WB(2),xx(e.displayName),WB(2),xx(e.nameWithHost),WB(2),cx(e.followersCount),EV(9),WB(),H0("routerLink",d$(14,na,e.ownerBy)),WB(2),cx(e.ownerBy),EV(12),WB(),H0("actor",e.ownerAccount),WB(),H0("videoChannels",d$(16,oa,e));}}var Uo=(()=>{class i{userSubscriptionService=g(B);notifier=g(rc$1);videoChannels=[];pagination={currentPage:1,itemsPerPage:10,totalItems:null};onDataSubject=new X();search;onNearOfBottom(){this.pagination.totalItems<=this.pagination.currentPage*this.pagination.itemsPerPage||(this.pagination.currentPage+=1,this.loadSubscriptions());}onSearch(e){this.search=e,_je(this.pagination),this.loadSubscriptions(false);}getTotalTitle(){return CAe(""+this.pagination.totalItems+" {total, plural, =1 {\u4E2A\u8BA2\u9605} other {\u4E2A\u8BA2\u9605}}",{total:this.pagination.totalItems});}loadSubscriptions(e=true){this.userSubscriptionService.listSubscriptions({pagination:this.pagination,search:this.search}).subscribe({next:t=>{this.videoChannels=e?this.videoChannels.concat(t.data):t.data,this.pagination.totalItems=t.total,this.onDataSubject.next(t.data);},error:t=>this.notifier.handleError(t)});}static ɵfac=function(t){return new(t||i)();};static ɵcmp=Pa$1({type:i,selectors:[["ng-component"]],decls:7,vars:3,consts:()=>{let e;e="\u4F60\u8FD8\u672A\u8FDB\u884C\u4EFB\u4F55\u8BA2\u9605\u3002";let t;t="\u9891\u9053\u9875\u9762";let n;n="\u6240\u6709\u8005\u8D26\u6237\u9875\u9762";let r;r=""+"\uFFFD0\uFFFD"+" \u4F4D\u8BA2\u9605\u8005\n        ";let s;return s="\u7531 "+"\uFFFD0\uFFFD"+" \u521B\u5EFA",[e,r,s,[1,"mb-4","d-flex","justify-content-between","align-items-end","gap-2","flex-wrap"],[1,"total-items"],["emitOnInit","true",1,"d-block","ms-auto",3,"search"],[1,"no-results"],["myInfiniteScroller","",1,"actors",3,"nearOfBottom","dataObservable"],[1,"actor"],["actorType","channel","size","80",3,"actor","internalHref"],[1,"actor-info"],["title",t,1,"actor-names",3,"routerLink"],[1,"actor-display-name"],[1,"actor-name"],[1,"actor-followers"],["title",n,1,"actor-owner",3,"routerLink"],["actorType","account","size","18",3,"actor"],[3,"videoChannels"]];},template:function(t,n){t&1&&(sp(0,"div",3),w2(1,ra,2,1,"span",4),sp(2,"my-search-input",5),Fp("search",function(s){return n.onSearch(s);}),lb()(),w2(3,aa,2,0,"div",6),sp(4,"div",7),Fp("nearOfBottom",function(){return n.onNearOfBottom();}),N2(5,sa,15,18,"div",8,R2),lb()),t&2&&(WB(),x2(n.pagination.totalItems?1:-1),WB(2),x2(n.pagination.totalItems===0?3:-1),WB(),H0("dataObservable",n.onDataSubject.asObservable()),WB(),M2(n.videoChannels));},dependencies:[ue,L$2,fe$1,Zh,Ut$2],styles:["input[type=text][_ngcontent-%COMP%]{font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:300px;max-width:300px;color:var(--input-fg);background-color:var(--input-bg);border:var(--input-border-width) solid var(--input-border-color);border-radius:var(--input-border-radius);line-height:24px}input[type=text][_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder-color);font-size:var(--input-placeholder-font-size)}input[type=text][readonly][_ngcontent-%COMP%]{color:var(--fg-300)}input[type=text][_ngcontent-%COMP%]:focus, input[type=text][_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}input[type=text][disabled][_ngcontent-%COMP%]{color:var(--fg-300);opacity:.8}@media screen and (max-width:340px){input[type=text][_ngcontent-%COMP%]{width:100%}}.actor[_ngcontent-%COMP%]{display:flex;min-height:130px;padding-bottom:1.25rem;margin-bottom:1.25rem;border-bottom:1px solid var(--input-border-color)}@media screen and (max-width:800px){.actor[_ngcontent-%COMP%]{flex-direction:column;height:auto;align-items:center}}.actor[_ngcontent-%COMP%] > my-actor-avatar[_ngcontent-%COMP%]{margin-inline-end:.625rem}.actor[_ngcontent-%COMP%]   .actor-info[_ngcontent-%COMP%]{flex-grow:1}.actor[_ngcontent-%COMP%]   .actor-names[_ngcontent-%COMP%]{width:fit-content;display:flex;align-items:baseline;color:var(--fg)}.actor[_ngcontent-%COMP%]   .actor-names[_ngcontent-%COMP%], .actor[_ngcontent-%COMP%]   .actor-names[_ngcontent-%COMP%]:hover, .actor[_ngcontent-%COMP%]   .actor-names[_ngcontent-%COMP%]:focus, .actor[_ngcontent-%COMP%]   .actor-names[_ngcontent-%COMP%]:active{text-decoration:none}.actor[_ngcontent-%COMP%]   .actor-names[_ngcontent-%COMP%]:focus:not(:focus-visible){outline:none}.actor[_ngcontent-%COMP%]   .actor-display-name[_ngcontent-%COMP%]{font-weight:600;font-size:18px}.actor[_ngcontent-%COMP%]   .actor-name[_ngcontent-%COMP%]{font-size:14px;color:var(--fg-300);margin-inline-start:.3125rem}.actor[_ngcontent-%COMP%]   .actor-owner[_ngcontent-%COMP%]{color:var(--fg);display:flex;align-items:center}.actor[_ngcontent-%COMP%]   .actor-owner[_ngcontent-%COMP%], .actor[_ngcontent-%COMP%]   .actor-owner[_ngcontent-%COMP%]:hover, .actor[_ngcontent-%COMP%]   .actor-owner[_ngcontent-%COMP%]:focus, .actor[_ngcontent-%COMP%]   .actor-owner[_ngcontent-%COMP%]:active{text-decoration:none}.actor[_ngcontent-%COMP%]   .actor-owner[_ngcontent-%COMP%]:focus:not(:focus-visible){outline:none}.actor[_ngcontent-%COMP%]   .actor-owner[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]:hover{opacity:.8}.actor[_ngcontent-%COMP%]   .actor-owner[_ngcontent-%COMP%]   my-actor-avatar[_ngcontent-%COMP%]{margin-inline-start:.3125rem}@media screen and (max-width:800px){.actor[_ngcontent-%COMP%]   .actor-info[_ngcontent-%COMP%]{padding-bottom:10px;text-align:center}.actor[_ngcontent-%COMP%]   .actor-info[_ngcontent-%COMP%]   .actor-names[_ngcontent-%COMP%]{flex-direction:column;align-items:center!important;margin:auto}}"],changeDetection:1});}return i;})();var la=i=>({$implicit:i});function ca(i,o){if(i&1&&(sp(0,"div",2),vV(1,0),lb()),i&2){let e=SV();WB(),cx(e.noResultMessage()),EV(1);}}function da(i,o){if(i&1){let e=F2();sp(0,"div",6)(1,"my-peertube-checkbox",8),Ox("ngModelChange",function(n){GI(e);let r=SV().$implicit,s=SV();return t$(s.selection()[r.id],n)||(s.selection()[r.id]=n),zI(n);}),lb(),zH(),lb();}if(i&2){let e=SV().$implicit,t=SV();WB(),H0("inputName","video-check-"+e.id),Mx("ngModel",t.selection()[e.id]),qH();}}function _a(i,o){i&1&&$0(0);}function pa(i,o){if(i&1&&w0(0,_a,1,0,"ng-container",9),i&2){let e=SV().$implicit,t=SV();H0("ngTemplateOutlet",t.rowButtonsTemplate)("ngTemplateOutletContext",d$(2,la,e));}}function ma(i,o){if(i&1&&(sp(0,"div",4),w2(1,da,2,2,"div",6),Pp(2,"my-video-miniature",7),w2(3,pa,1,4,"ng-container"),lb()),i&2){let e=o.$implicit,t=SV();WB(),x2(t.enableSelection()?1:-1),WB(),H0("video",e)("displayAsRow",true)("displayOptions",t.miniatureDisplayOptions())("displayVideoActions",false)("user",t.user()),WB(),x2(t.isInSelectionMode()===false?3:-1);}}function ua(i,o){i&1&&$0(0);}function ha(i,o){if(i&1){let e=F2();sp(0,"div",5)(1,"button",10),Fp("click",function(){GI(e);let n=SV();return zI(n.abortSelectionMode());}),vV(2,1),lb(),w0(3,ua,1,0,"ng-container",11),lb();}if(i&2){let e=SV();WB(3),H0("ngTemplateOutlet",e.globalButtonsTemplate);}}var Go=(()=>{class i{notifier=g(rc$1);user=qp(void 0);pagination=qp(void 0);titlePage=qp(void 0);miniatureDisplayOptions=qp(void 0);noResultMessage=qp("\u6CA1\u6709\u7ED3\u679C\u3002");enableSelection=qp(true);disabled=qp(false);getVideosObservableFunction=qp(void 0);templates=Npe();selection=wpe({});videos=wpe([]);rowButtonsTemplate;globalButtonsTemplate;sort="-publishedAt";onDataSubject=new X();hasDoneFirstQuery=false;lastQueryLength;ngAfterContentInit(){{let e=this.templates().find(t=>t.name()==="rowButtons");e&&(this.rowButtonsTemplate=e.template);}{let e=this.templates().find(t=>t.name()==="globalButtons");e&&(this.globalButtonsTemplate=e.template);}}getVideosObservable(e){return this.getVideosObservableFunction()(e,this.sort);}abortSelectionMode(){this.selection.update(()=>({}));}isInSelectionMode(){return tc$1(this.selection()).some(e=>this.selection()[e]===true);}videoById(e,t){return t.id;}onNearOfBottom(){this.disabled()||this.lastQueryLength!==void 0&&this.lastQueryLength<this.pagination().itemsPerPage||(this.pagination().currentPage+=1,this.loadMoreVideos());}loadMoreVideos(e=false){e&&(this.hasDoneFirstQuery=false),this.getVideosObservable(this.pagination().currentPage).subscribe({next:({data:t})=>{this.hasDoneFirstQuery=true,this.lastQueryLength=t.length,e&&this.videos.set([]),this.videos.update(n=>n.concat(t)),this.onDataSubject.next(t);},error:t=>{let n="\u65E0\u6CD5\u52A0\u8F7D\u66F4\u591A\u89C6\u9891\u3002\u8BF7\u7A0D\u540E\u518D\u8BD5\u3002";j.error(n,t),this.notifier.error(n);}});}reloadVideos(){_je(this.pagination()),this.loadMoreVideos(true);}static ɵfac=function(t){return new(t||i)();};static ɵcmp=Pa$1({type:i,selectors:[["my-videos-selection"]],contentQueries:function(t,n,r){t&1&&fx(r,n.templates,M$2,4),t&2&&IV();},inputs:{user:[1,"user"],pagination:[1,"pagination"],titlePage:[1,"titlePage"],miniatureDisplayOptions:[1,"miniatureDisplayOptions"],noResultMessage:[1,"noResultMessage"],enableSelection:[1,"enableSelection"],disabled:[1,"disabled"],getVideosObservableFunction:[1,"getVideosObservableFunction"],selection:[1,"selection"],videos:[1,"videos"]},outputs:{selection:"selectionChange",videos:"videosChange"},decls:5,vars:3,consts:()=>{let e;e="\n          "+"\uFFFD0\uFFFD"+"\n        ";let t;return t="\u53D6\u6D88",[e,t,[1,"no-results"],["myInfiniteScroller","",1,"videos",3,"nearOfBottom","dataObservable"],[1,"video"],[1,"action-selection-mode"],[1,"checkbox-container"],[3,"video","displayAsRow","displayOptions","displayVideoActions","user"],[3,"ngModelChange","inputName","ngModel"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"cancel-selection","peertube-button","secondary-button","me-2",3,"click"],[4,"ngTemplateOutlet"]];},template:function(t,n){t&1&&(w2(0,ca,2,1,"div",2),sp(1,"div",3),Fp("nearOfBottom",function(){return n.onNearOfBottom();}),N2(2,ma,4,7,"div",4,n.videoById,true),lb(),w2(4,ha,4,1,"div",5)),t&2&&(x2(n.hasDoneFirstQuery&&n.videos().length===0?0:-1),WB(),H0("dataObservable",n.onDataSubject.asObservable()),WB(),M2(n.videos()),WB(2),x2(n.isInSelectionMode()===true?4:-1));},dependencies:[L$2,Me$1,Jn,qn,ln$1,$d,N3],styles:[".action-selection-mode[_ngcontent-%COMP%]{position:fixed;bottom:1rem}@supports (inset-inline-end: var(--x-margin-content)){.action-selection-mode[_ngcontent-%COMP%]{inset-inline-end:var(--x-margin-content)}}@supports not (inset-inline-end: var(--x-margin-content)){.action-selection-mode[_ngcontent-%COMP%]{right:var(--x-margin-content)}}.action-selection-mode[_ngcontent-%COMP%]   .action-button[_ngcontent-%COMP%]{display:block;margin-inline-start:calc(1.46875rem + 2.625vw)}@media(min-width:1200px){.action-selection-mode[_ngcontent-%COMP%]   .action-button[_ngcontent-%COMP%]{margin-inline-start:3.4375rem}}.video[_ngcontent-%COMP%]{display:flex;min-height:130px;padding-bottom:1.25rem;margin-bottom:1.25rem;border-bottom:1px solid var(--input-border-color)}@media screen and (max-width:800px){.video[_ngcontent-%COMP%]{min-height:initial;padding-bottom:.5rem;margin-bottom:.5rem}}.video[_ngcontent-%COMP%]:first-child{margin-top:47px}.video[_ngcontent-%COMP%]   .checkbox-container[_ngcontent-%COMP%]{display:flex;align-items:center;margin-inline-end:1.25rem;margin-inline-start:.75rem}.video[_ngcontent-%COMP%]   my-video-miniature[_ngcontent-%COMP%]{flex-grow:1;max-width:100%}@media screen and (max-width:800px){.video[_ngcontent-%COMP%]{flex-wrap:wrap}.checkbox-container[_ngcontent-%COMP%], .action-selection-mode[_ngcontent-%COMP%]{display:none!important}}"],changeDetection:1});}return i;})();var ga=["videosSelection"];function fa(i,o){if(i&1){let e=F2();sp(0,"div",12)(1,"my-delete-button",13),Fp("click",function(){let n=GI(e).$implicit,r=SV();return zI(r.deleteHistoryElement(n));}),lb()();}}var Xo=(()=>{class i{authService=g(Ze);userService=g(Pc);notifier=g(rc$1);confirmService=g(cg);userHistoryService=g(H$1);destroyRef=g(Ut$1);videosSelection=xpe("videosSelection");titlePage;pagination={currentPage:1,itemsPerPage:5,totalItems:null};videosHistoryEnabled;miniatureDisplayOptions={date:true,views:true,by:true,privacyLabel:false};getVideosObservableFunction=this.getVideosObservable.bind(this);user;videos=[];search;disabled=false;constructor(){this.titlePage="\u6211\u7684\u89C2\u770B\u5386\u53F2";}ngOnInit(){this.user=this.authService.getUser(),this.authService.userInformationLoaded.pipe(fe(this.destroyRef)).subscribe(()=>this.videosHistoryEnabled=this.user.videosHistoryEnabled);}disableForReuse(){this.disabled=true;}enabledForReuse(){this.disabled=false;}reloadData(){this.videosSelection().reloadVideos();}onSearch(e){this.search=e,this.reloadData();}getVideosObservable(e){let t=XP(this.pagination,{currentPage:e});return this.userHistoryService.list(t,this.search).pipe(lt(n=>this.pagination.totalItems=n.total));}generateSyndicationList(){throw new Error("Method not implemented.");}onVideosHistoryChange(){this.userService.updateMyProfile({videosHistoryEnabled:this.videosHistoryEnabled}).subscribe({next:()=>{let e=this.videosHistoryEnabled===true?"\u5DF2\u542F\u7528\u89C6\u9891\u5386\u53F2":"\u5DF2\u7981\u7528\u89C6\u9891\u5386\u53F2";this.notifier.success(e),this.authService.refreshUserInformation();},error:e=>this.notifier.handleError(e)});}deleteHistoryElement(e){this.userHistoryService.deleteElement(e).subscribe({next:()=>{this.videos=this.videos.filter(t=>t.id!==e.id),Cje(this.pagination);},error:t=>this.notifier.handleError(t)});}clearAllHistory(){return L(this,null,function*(){let e="\u5220\u9664\u89C6\u9891\u5386\u53F2",t="\u4F60\u786E\u5B9A\u8981\u5220\u9664\u4F60\u7684\u6240\u6709\u89C6\u9891\u5386\u53F2\u5417\uFF1F";(yield this.confirmService.confirm(t,e))===true&&this.userHistoryService.clearAll().subscribe({next:()=>{this.notifier.success("\u5DF2\u5220\u9664\u89C6\u9891\u5386\u53F2"),this.reloadData();},error:r=>this.notifier.handleError(r)});});}getNoResultMessage(){return this.search?"\u672A\u627E\u5230\u5173\u4E8E\u201C"+this.search+"\u201D\u7684\u89C6\u9891\u3002":"\u4F60\u7684\u89C2\u770B\u8BB0\u5F55\u91CC\u8FD8\u6CA1\u6709\u4EFB\u4F55\u89C6\u9891\u3002";}static ɵfac=function(t){return new(t||i)();};static ɵcmp=Pa$1({type:i,selectors:[["ng-component"]],viewQuery:function(t,n){t&1&&px(n.videosSelection,ga,5),t&2&&IV();},decls:12,vars:10,consts:()=>{let e;e="\u8DDF\u8E2A\u89C2\u770B\u5386\u53F2";let t;t="\u6E05\u9664\u6240\u6709\u5386\u53F2\u8BB0\u5F55";let n;return n="\u4ECE\u5386\u53F2\u8BB0\u5F55\u5220\u9664",[["videosSelection",""],e,t,[1,"top-buttons"],[1,"search-wrapper"],["emitOnInit","true",3,"search"],[1,"history-switch"],["inputName","track-watch-history",3,"ngModelChange","ngModel"],["for","track-watch-history"],["icon","delete",3,"click"],[3,"videosChange","pagination","videos","miniatureDisplayOptions","titlePage","getVideosObservableFunction","user","noResultMessage","enableSelection","disabled"],["ptTemplate","rowButtons"],[1,"action-button"],["label",n,3,"click"]];},template:function(t,n){if(t&1){let r=F2();sp(0,"div",3)(1,"div",4)(2,"my-search-input",5),Fp("search",function(d){return n.onSearch(d);}),lb()(),sp(3,"div",6)(4,"my-input-switch",7),Ox("ngModelChange",function(d){return GI(r),t$(n.videosHistoryEnabled,d)||(n.videosHistoryEnabled=d),zI(d);}),Fp("ngModelChange",function(){return n.onVideosHistoryChange();}),lb(),zH(),sp(5,"label",8),vV(6,1),lb()(),sp(7,"my-button",9),Fp("click",function(){return n.clearAllHistory();}),vV(8,2),lb()(),sp(9,"my-videos-selection",10,0),Ox("videosChange",function(d){return GI(r),t$(n.videos,d)||(n.videos=d),zI(d);}),w0(11,fa,2,0,"ng-template",11),lb();}t&2&&(WB(4),Mx("ngModel",n.videosHistoryEnabled),qH(),WB(5),H0("pagination",n.pagination),Mx("videos",n.videos),H0("miniatureDisplayOptions",n.miniatureDisplayOptions)("titlePage",n.titlePage)("getVideosObservableFunction",n.getVideosObservableFunction)("user",n.user)("noResultMessage",n.getNoResultMessage())("enableSelection",false)("disabled",n.disabled));},dependencies:[it,ue,or$1,Jn,qn,ln$1,Go,M$2,h],styles:[".no-history[_ngcontent-%COMP%]{display:flex;justify-content:center;margin-top:50px;font-weight:600}.top-buttons[_ngcontent-%COMP%]{margin-bottom:30px;display:grid;grid-template-columns:250px 1fr auto auto;align-items:center}.top-buttons[_ngcontent-%COMP%]   .search-wrapper[_ngcontent-%COMP%]{grid-column:1}.top-buttons[_ngcontent-%COMP%]   .search-wrapper[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]{font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:250px;max-width:250px;color:var(--input-fg);background-color:var(--input-bg);border:var(--input-border-width) solid var(--input-border-color);border-radius:var(--input-border-radius);line-height:24px}.top-buttons[_ngcontent-%COMP%]   .search-wrapper[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder-color);font-size:var(--input-placeholder-font-size)}.top-buttons[_ngcontent-%COMP%]   .search-wrapper[_ngcontent-%COMP%]   input[readonly][_ngcontent-%COMP%]{color:var(--fg-300)}.top-buttons[_ngcontent-%COMP%]   .search-wrapper[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]:focus, .top-buttons[_ngcontent-%COMP%]   .search-wrapper[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}.top-buttons[_ngcontent-%COMP%]   .search-wrapper[_ngcontent-%COMP%]   input[disabled][_ngcontent-%COMP%]{color:var(--fg-300);opacity:.8}@media screen and (max-width:290px){.top-buttons[_ngcontent-%COMP%]   .search-wrapper[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]{width:100%}}.top-buttons[_ngcontent-%COMP%]   .history-switch[_ngcontent-%COMP%]{grid-column:3;display:flex;align-items:center;margin-inline-start:auto;margin-inline-end:.9375rem}.top-buttons[_ngcontent-%COMP%]   .history-switch[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]{margin:0 0 0 5px;color:var(--fg-400);font-weight:600}.top-buttons[_ngcontent-%COMP%]   .delete-history[_ngcontent-%COMP%]{grid-column:4}.video[_ngcontent-%COMP%]{display:flex;min-height:130px;padding-bottom:1.25rem;margin-bottom:1.25rem;border-bottom:1px solid var(--input-border-color)}@media screen and (max-width:800px){.video[_ngcontent-%COMP%]{min-height:initial;padding-bottom:.5rem;margin-bottom:.5rem}}.action-button[_ngcontent-%COMP%]{display:flex;align-self:flex-end}@media screen and (max-width:800px){.top-buttons[_ngcontent-%COMP%]{grid-template-columns:auto 1fr auto;row-gap:20px}.top-buttons[_ngcontent-%COMP%]   .history-switch[_ngcontent-%COMP%]{grid-row:1;grid-column:1;margin:0}.top-buttons[_ngcontent-%COMP%]   .delete-history[_ngcontent-%COMP%]{grid-row:1;grid-column:3}.top-buttons[_ngcontent-%COMP%]   .search-wrapper[_ngcontent-%COMP%]{grid-column:1/4}}"],changeDetection:1});}return i;})();var Wo=(()=>{class i{menuEntries=[];ngOnInit(){this.buildMenu();}buildMenu(){this.menuEntries=[{label:"\u64AD\u653E\u5217\u8868",routerLink:"/my-library/video-playlists"},{label:"\u8BA2\u9605",routerLink:"/my-library/subscriptions"},{label:"\u5386\u53F2",routerLink:"/my-library/history/videos"}];}static ɵfac=function(t){return new(t||i)();};static ɵcmp=Pa$1({type:i,selectors:[["ng-component"]],decls:8,vars:1,consts:()=>{let e;e="\u6211\u7684\u5A92\u4F53\u5E93";let t;return t="\u8DF3\u8FC7\u5B50\u83DC\u5355",[["myLibraryContent",""],t,[1,"root"],[1,"margin-content"],["href","#my-library-content-content",1,"visually-hidden-focusable","skip-to-content-sub-menu",3,"click"],["h1",e,3,"menuEntries"],["tabindex","-1","id","my-library-content",1,"margin-content","pb-5","outline-0"]];},template:function(t,n){if(t&1){let r=F2();sp(0,"div",2)(1,"div",3)(2,"a",4),Fp("click",function(d){GI(r);let u=CV(6);return d.preventDefault(),zI(u.focus());}),vV(3,1),lb(),Pp(4,"my-horizontal-menu",5),lb(),sp(5,"div",6,0),Pp(7,"router-outlet"),lb()();}t&2&&(WB(4),H0("menuEntries",n.menuEntries));},dependencies:[FS,hn],encapsulation:2,changeDetection:1});}return i;})();function Ca(i,o){if(i&1&&Pp(0,"my-actor-avatar",2),i&2){let e=SV();H0("actor",e.actor())("actorType",e.actorType());}}function Sa(i,o){i&1&&Pp(0,"my-global-icon",5);}function ya(i,o){if(i&1&&(sp(0,"span",6),XV(1),lb()),i&2){let e=SV();WB(),xx(e.actor().name);}}function va(i,o){i&1&&Pp(0,"my-collaborator-state",7);}function Ea(i,o){i&1&&Pp(0,"my-collaborator-state",8);}var bt=(()=>{class i{authService=g(Ze);actor=qp.required();actorType=qp.required();displayAvatar=qp(true,{transform:tl$1});displayUsername=qp(true,{transform:tl$1});target=qp("");routerLink;linkTitle;ngOnInit(){this.actorType()==="channel"?(this.routerLink=["/c",this.actor().name],this.linkTitle="\u8F6C\u5230 "+this.actor().displayName+" \u7684\u9891\u9053\u9875\u9762"):(this.routerLink=["/a",this.actor().name],this.linkTitle="\u8F6C\u5230 "+this.actor().displayName+" \u7684\u8D26\u53F7\u9875\u9762");}isEditorOfChannel(){if(this.actorType()!=="channel")return false;let e=this.authService.getUser();return e.isCollaboratingToChannels()&&e.isEditorOfChannel(this.actor());}isOwnerOfChannel(){if(this.actorType()!=="channel")return false;let e=this.authService.getUser();return e.isCollaboratingToChannels()&&e.isOwnerOfChannel(this.actor());}static ɵfac=function(t){return new(t||i)();};static ɵcmp=Pa$1({type:i,selectors:[["my-actor-cell"]],inputs:{actor:[1,"actor"],actorType:[1,"actorType"],displayAvatar:[1,"displayAvatar"],displayUsername:[1,"displayUsername"],target:[1,"target"]},decls:10,vars:8,consts:[[3,"routerLink","title","target"],[1,"chip","two-lines"],["size","32",3,"actor","actorType"],[1,"information"],[1,"fw-semibold"],["iconName","external-link"],[1,"muted"],["type","accepted","small","true",1,"ms-2"],["type","owner","small","true",1,"ms-2"]],template:function(t,n){t&1&&(sp(0,"a",0)(1,"div",1),w2(2,Ca,1,2,"my-actor-avatar",2),sp(3,"div",3)(4,"span",4),XV(5),w2(6,Sa,1,0,"my-global-icon",5),lb(),w2(7,ya,2,1,"span",6),lb(),w2(8,va,1,0,"my-collaborator-state",7)(9,Ea,1,0,"my-collaborator-state",8),lb()()),t&2&&(H0("routerLink",n.routerLink)("title",n.linkTitle)("target",n.target()),WB(2),x2(n.displayAvatar()?2:-1),WB(3),Eb(" ",n.actor().displayName," "),WB(),x2(n.target()==="_blank"?6:-1),WB(),x2(n.displayUsername()?7:-1),WB(),x2(n.isEditorOfChannel()?8:n.isOwnerOfChannel()?9:-1));},dependencies:[Ez,Zh,H$3,fe$1,Tr$1],styles:["a[_ngcontent-%COMP%]:hover{opacity:1}a[_ngcontent-%COMP%]:hover   .information[_ngcontent-%COMP%]{opacity:.8}"],changeDetection:1});}return i;})();var Ma=["modal"];function Pa(i,o){if(i&1&&(sp(0,"div",10),XV(1),lb()),i&2){let e=SV(2);WB(),xx(e.formErrors.channel);}}function Ia(i,o){if(i&1){let e=F2();sp(0,"div",2)(1,"h1",3),XV(2),lb(),sp(3,"button",4),Fp("click",function(){let n=GI(e).dismiss;return zI(n());}),Pp(4,"my-global-icon",5),lb()(),sp(5,"div",6)(6,"div",7)(7,"label",8),vV(8,1),lb(),Pp(9,"my-select-channel-user",9),zH(),w2(10,Pa,2,1,"div",10),lb()(),sp(11,"div",11)(12,"div",12)(13,"input",13),Fp("click",function(){let n=GI(e).dismiss;return zI(n());})("key.enter",function(){let n=GI(e).dismiss;return zI(n());}),lb(),sp(14,"input",14),Fp("click",function(){let n=GI(e).close;return zI(n());}),lb()()();}if(i&2){let e=SV();WB(2),xx(e.getModalTitle()),WB(3),H0("formGroup",e.form),WB(3),cx(e.ownershipChanges.length),EV(8),WB(),H0("items",e.videoChannels),qH(),WB(),x2(e.formErrors.channel?10:-1);}}var jo=(()=>{class i extends r{formReactiveService=g(w);changeOwnershipService=g(A);notifier=g(rc$1);authService=g(Ze);modalService=g(rr$1);accepted=_pe();modal=xpe("modal");ownershipChanges=[];videoChannels;error=null;ngOnInit(){this.videoChannels=[],ae$1({authService:this.authService,includeCollaborations:false}).subscribe(e=>this.videoChannels=e),this.buildForm({channel:c});}show(e){this.form.patchValue({channel:this.videoChannels[0].id}),this.ownershipChanges=e,this.modalService.open(this.modal(),{centered:true}).result.then(()=>this.acceptOwnership()).catch(()=>{this.ownershipChanges=[];});}acceptOwnership(){let e=this.form.value.channel;this.changeOwnershipService.acceptVideo(this.ownershipChanges.map(t=>t.id),{channelId:e}).subscribe({next:()=>{let t=this.ownershipChanges.length,n=CAe("{count, plural, =1 {Video {videoName} accepted} other {{count} videos accepted}}",{count:t,videoName:this.ownershipChanges[0].video.name});this.notifier.success(n),this.accepted&&this.accepted.emit();},error:t=>this.notifier.handleError(t)});}getModalTitle(){let e=this.ownershipChanges.length;return CAe("{count, plural, =1 {Accept video} other {Accept {count} videos}}",{count:e});}static ɵfac=(()=>{let e;return function(n){return(e||(e=Uu(i)))(n||i);};})();static ɵcmp=Pa$1({type:i,selectors:[["my-accept-change-video-ownership"]],viewQuery:function(t,n){t&1&&px(n.modal,Ma,5),t&2&&IV();},outputs:{accepted:"accepted"},features:[C0],decls:2,vars:0,consts:()=>{let e;e="\u5173\u95ED\u6B64\u6A21\u5F0F";let t;t="\u53D6\u6D88";let n;n="\u63A5\u53D7";let r;return r="{VAR_PLURAL, plural, =1 {Select a channel to receive the video} other {Select a channel to receive the videos}}",r=bV(r,{VAR_PLURAL:"\uFFFD0\uFFFD"}),[["modal",""],r,[1,"modal-header"],[1,"modal-title"],["title",e,1,"border-0","p-0",3,"click"],["iconName","cross"],[1,"modal-body",3,"formGroup"],[1,"form-group"],["for","channel"],["inputId","channel","formControlName","channel",1,"d-block",3,"items"],["role","alert",1,"form-error"],[1,"modal-footer","inputs"],[1,"inputs"],["type","button","role","button","value",t,1,"peertube-button","secondary-button",3,"click","key.enter"],["type","submit","value",n,1,"peertube-button","primary-button",3,"click"]];},template:function(t,n){t&1&&w0(0,Ia,15,5,"ng-template",null,0,I$);},dependencies:[Tr$1,Jn,qn,$n,Qn,Vn,yn,be$1],styles:[".peertube-select-container[_ngcontent-%COMP%]{width:350px}@media screen and (max-width:380px){.peertube-select-container[_ngcontent-%COMP%]{width:100%}}"],changeDetection:1});}return i;})();var Ta=["acceptChangeVideoOwnershipComponent"],Oa=["table"];function Ra(i,o){if(i&1&&(pb(0),vV(1,6),E$(2,"myNumberFormatter"),kp()),i&2){let e=o.$implicit;WB(2),cx(e)(S$(2,2,e)),EV(1);}}function ba(i,o){i&1&&(sp(0,"span",11),XV(1,"TO YOU"),lb());}function Aa(i,o){if(i&1&&Pp(0,"my-actor-cell",12),i&2){let e=SV().$implicit;H0("actor",e.nextOwnerAccount)("displayAvatar",true)("displayUsername",true);}}function Na(i,o){if(i&1&&(sp(0,"td"),Pp(1,"my-video-cell",10),lb(),sp(2,"td"),w2(3,ba,2,0,"span",11)(4,Aa,1,3,"my-actor-cell",12),lb(),sp(5,"td"),XV(6),E$(7,"ptDate"),lb(),sp(8,"td")(9,"span",13),XV(10),lb()()),i&2){let e=o.$implicit,t=SV();WB(),H0("video",e.video),WB(2),x2(t.isReceiver(e)?3:4),WB(3),xx(T$(7,5,e.createdAt,"short")),WB(3),H0("ngClass",t.getStateClass(e.state.id)),WB(),xx(e.state.label);}}function La(i,o){if(i&1&&Pp(0,"my-action-dropdown",14),i&2){let e=o.$implicit,t=SV();H0("actions",t.actions)("entry",e);}}function Da(i,o){i&1&&(pb(0),vV(1,7),kp());}var Qo=(()=>{class i{notifier=g(rc$1);changeOwnershipService=g(A);authService=g(Ze);acceptChangeVideoOwnershipComponent=xpe("acceptChangeVideoOwnershipComponent");table=xpe("table");actions=[];bulkActions=[];columns=[{id:"video",label:"\u89C6\u9891",sortable:false},{id:"targetAccount",label:"Target account",sortable:false},{id:"createdAt",label:"\u521B\u5EFA\u65F6\u95F4",sortable:true},{id:"status",label:"\u72B6\u6001",sortable:false}];dataLoader;constructor(){this.dataLoader=this._dataLoader.bind(this);let{simpleActions:e,bulkActions:t}=Bc([[{label:()=>"Manage video",linkBuilder:n=>[K.buildManageUrl(n.video)],isDisplayed:n=>this.isReceiver(n)&&n.state.id===rDe.ACCEPTED||this.isInitiator(n)&&n.state.id!==rDe.ACCEPTED,enableBulk:false}],[{label:()=>"Accept...",handler:n=>this.openAcceptModal(n),isDisplayed:n=>this.canAcceptOrReject(n),enableBulk:true},{label:()=>"\u62D2\u7EDD",handler:n=>this.reject(n),isDisplayed:n=>this.canAcceptOrReject(n),enableBulk:true}]]);this.actions=e,this.bulkActions=t;}canAcceptOrReject(e){return this.isReceiver(e)&&e.state.id===rDe.PENDING;}isReceiver(e){return e.nextOwnerAccount.id===this.authService.getUser().account.id;}isInitiator(e){return e.initiatorAccount.id===this.authService.getUser().account.id;}getStateClass(e){switch(e){case rDe.ACCEPTED:return"badge-green";case rDe.REJECTED:return"badge-red";default:return"badge-yellow";}}openAcceptModal(e){this.acceptChangeVideoOwnershipComponent().show(e);}accepted(){this.table().loadData();}reject(e){this.changeOwnershipService.rejectVideo(e.map(t=>t.id)).subscribe({next:()=>this.table().loadData(),error:t=>this.notifier.handleError(t)});}_dataLoader(e){return this.changeOwnershipService.listOfVideos(e.pagination,e.sort).pipe($(t=>({data:t.data.map(n=>E(D({},n),{initiatorAccount:new ed(n.initiatorAccount),nextOwnerAccount:new ed(n.nextOwnerAccount)})),total:t.total})));}static ɵfac=function(t){return new(t||i)();};static ɵcmp=Pa$1({type:i,selectors:[["my-video-ownership-changes"]],viewQuery:function(t,n){t&1&&px(n.acceptChangeVideoOwnershipComponent,Ta,5)(n.table,Oa,5),t&2&&IV(2);},decls:12,vars:3,consts:()=>{let e;e="\u6BCF\u4E00\u9875\u9879\u76EE";let t;t="{VAR_PLURAL, plural, =0 {No video ownership change} =1 {1 video ownership change} other {{INTERPOLATION} video ownership changes}}",t=bV(t,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let n;n="\u64CD\u4F5C";let r;return r="\u672A\u627E\u5230\u6240\u6709\u6743\u66F4\u6539\u8BF7\u6C42\u3002",[["table",""],["totalTitle",""],["tableCells",""],["actionCell",""],["noResults",""],["acceptChangeVideoOwnershipComponent",""],t,r,["key","MyOwnershipChangesComponent","paginatorText",e,"columnConfig","false",3,"defaultColumns","dataLoader","bulkActions"],[3,"accepted"],["size","small",3,"video"],[1,"pt-badge","badge-primary"],["actorType","account","target","_blank",3,"actor","displayAvatar","displayUsername"],[1,"pt-badge",3,"ngClass"],["placement","bottom-right top-right left auto","container","body","label",n,3,"actions","entry"]];},template:function(t,n){t&1&&(sp(0,"my-table",8,0),w0(2,Ra,3,4,"ng-template",null,1,I$)(4,Na,11,8,"ng-template",null,2,I$)(6,La,1,2,"ng-template",null,3,I$)(8,Da,2,0,"ng-template",null,4,I$),lb(),sp(10,"my-accept-change-video-ownership",9,5),Fp("accepted",function(){return n.accepted();}),lb()),t&2&&H0("defaultColumns",n.columns)("dataLoader",n.dataLoader)("bulkActions",n.bulkActions);},dependencies:[cl$1,x3,jo,Qh,Lh,Un,bt,p$1,d$1],encapsulation:2,changeDetection:1});}return i;})();var qo=(()=>{class i{static ɵfac=function(t){return new(t||i)();};static ɵcmp=Pa$1({type:i,selectors:[["ng-component"]],decls:1,vars:0,template:function(t,n){t&1&&Pp(0,"my-video-ownership-changes");},dependencies:[Qo],encapsulation:2,changeDetection:1});}return i;})();var wa=["table"];function xa(i,o){i&1&&(sp(0,"div")(1,"p",12),vV(2,6),lb()());}function Ya(i,o){if(i&1&&(pb(0),vV(1,7),E$(2,"myNumberFormatter"),kp()),i&2){let e=o.$implicit;WB(2),cx(e)(S$(2,2,e)),EV(1);}}function Va(i,o){if(i&1&&(sp(0,"a",13),Pp(1,"my-global-icon",14),pb(2),vV(3,8),kp(),lb()),i&2){let e=SV();H0("routerLink",o$(e.getSyncCreateLink()));}}function $a(i,o){if(i&1&&(XV(0),E$(1,"ptDate")),i&2){let e=SV().$implicit;Eb(" ",T$(1,1,e.lastSyncAt,"short")," ");}}function ka(i,o){i&1&&(pb(0),vV(1,9),kp());}function Fa(i,o){if(i&1&&(sp(0,"td")(1,"a",15),XV(2),lb()(),sp(3,"td"),Pp(4,"my-actor-cell",16),lb(),sp(5,"td")(6,"span",17),XV(7),lb()(),sp(8,"td"),XV(9),E$(10,"ptDate"),lb(),sp(11,"td"),w2(12,$a,2,4)(13,ka,2,0,"ng-container"),lb()),i&2){let e=o.$implicit,t=SV();WB(),H0("href",e.externalChannelUrl,aw),WB(),xx(e.externalChannelUrl),WB(2),H0("actor",e.channel),WB(2),H0("ngClass",t.getSyncStateClass(e.state.id)),WB(),Eb(" ",e.state.label," "),WB(2),xx(T$(10,7,e.createdAt,"short")),WB(3),x2(e.lastSyncAt?12:13);}}function Ba(i,o){if(i&1&&Pp(0,"my-action-dropdown",18),i&2){let e=o.$implicit,t=SV();H0("actions",t.videoChannelSyncActions)("entry",e);}}function za(i,o){i&1&&(pb(0),vV(1,10),kp());}var Zo=(()=>{class i{videoChannelsSyncService=g(T);serverService=g($t);notifier=g(rc$1);authService=g(Ze);videoChannelService=g(z);table=xpe("table");videoChannelSyncActions=[];serverConfig;columns=[{id:"externalChannelUrl",label:"\u5916\u90E8\u9891\u9053",sortable:true},{id:"videoChannel",label:"\u9891\u9053",sortable:true},{id:"state",label:"\u72B6\u6001",sortable:true},{id:"createdAt",label:"\u521B\u5EFA\u65F6\u95F4",sortable:true},{id:"lastSyncAt",label:"\u4E0A\u6B21\u540C\u6B65\u65F6\u95F4",sortable:true}];dataLoader;get user(){return this.authService.getUser();}constructor(){this.dataLoader=this._dataLoader.bind(this);}ngOnInit(){this.serverConfig=this.serverService.getHTMLConfig(),this.videoChannelSyncActions=[[{label:"\u5217\u51FA\u5BFC\u5165",linkBuilder:()=>["/my-library/video-imports"],queryParamsBuilder:e=>({videoChannelSyncId:e.id}),iconName:"cloud-download"}],[{label:"\u5220\u9664",iconName:"delete",handler:e=>this.deleteSync(e)},{label:"\u5B8C\u6574\u540C\u6B65\u9891\u9053",description:"\u8FD9\u4F1A\u63D0\u53D6\u672C\u5730\u9891\u9053\u4E0A\u7F3A\u5931\u7684\u4EFB\u4F55\u89C6\u9891",iconName:"refresh",handler:e=>this.fullySynchronize(e)}]];}_dataLoader(e){return this.authService.userInformationLoaded.pipe(ze(),De(()=>this.videoChannelsSyncService.listByAccount({sort:e.sort,pagination:e.pagination,includeCollaborations:true,account:this.authService.getUser().account})));}syncEnabled(){return this.serverConfig.import.videoChannelSynchronization.enabled;}deleteSync(e){this.videoChannelsSyncService.delete(e.id).subscribe({next:()=>{this.notifier.success("\u5DF2\u6210\u529F\u79FB\u9664 "+e.channel.displayName+" \u7684\u540C\u6B65\u3002"),this.table().loadData();},error:t=>this.notifier.handleError(t)});}fullySynchronize(e){this.videoChannelService.importVideos(e.channel.name,e.externalChannelUrl,e.id).subscribe({next:()=>{this.notifier.success(""+e.channel.displayName+" \u7684\u5B8C\u6574\u540C\u6B65\u5DF2\u8BF7\u6C42\u6210\u529F\u3002");},error:t=>this.notifier.handleError(t)});}getSyncCreateLink(){return"/my-library/video-channel-syncs/create";}getSyncStateClass(e){return jt(e);}getChannelUrl(e){return"/c/"+e;}static ɵfac=function(t){return new(t||i)();};static ɵcmp=Pa$1({type:i,selectors:[["ng-component"]],viewQuery:function(t,n){t&1&&px(n.table,wa,5),t&2&&IV();},decls:13,vars:3,consts:()=>{let e;e="\u6BCF\u4E00\u9875\u540C\u6B65";let t;t="\u26A0\uFE0F \u5B9E\u4F8B\u4E0D\u5141\u8BB8\u9891\u9053\u540C\u6B65";let n;n="{VAR_PLURAL, plural, =0 {\u65E0\u540C\u6B65} =1 {1\u4E2A\u540C\u6B65} other {{INTERPOLATION} \u4E2A\u540C\u6B65}}",n=bV(n,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let r;r="\u6DFB\u52A0\u540C\u6B65";let s;s="Never";let d;return d="\u60A8\u6CA1\u6709\u914D\u7F6E\u9891\u9053\u540C\u6B65\u3002",[["table",""],["totalTitle",""],["captionRight",""],["tableCells",""],["actionCell",""],["noResults",""],t,n,r,s,d,["key","MyVideoChannelsSyncComponent","paginatorText",e,"columnConfig","false",3,"defaultColumns","dataLoader"],[1,"muted"],[1,"peertube-create-button",3,"routerLink"],["iconName","add","aria-hidden","true"],["target","_blank","rel","noopener noreferrer",3,"href"],["actorType","channel",3,"actor"],[3,"ngClass"],["container","body",3,"actions","entry"]];},template:function(t,n){t&1&&(w2(0,xa,3,0,"div"),sp(1,"my-table",11,0),w0(3,Ya,3,4,"ng-template",null,1,I$)(5,Va,4,2,"ng-template",null,2,I$)(7,Fa,14,10,"ng-template",null,3,I$)(9,Ba,1,2,"ng-template",null,4,I$)(11,za,2,0,"ng-template",null,5,I$),lb()),t&2&&(x2(n.syncEnabled()?-1:0),WB(),H0("defaultColumns",n.columns)("dataLoader",n.dataLoader));},dependencies:[cl$1,x3,Tr$1,Zh,Un,Lh,bt,p$1,d$1],encapsulation:2,changeDetection:1});}return i;})();var Ha=i=>({"input-error":i});function Ua(i,o){if(i&1&&(sp(0,"my-alert",7),XV(1),lb()),i&2){let e=SV();WB(),xx(e.error);}}function Ga(i,o){if(i&1&&(sp(0,"div",16),XV(1),lb()),i&2){let e=SV();WB(),xx(e.formErrors.externalChannelUrl);}}function Xa(i,o){if(i&1&&(sp(0,"div",16),XV(1),lb()),i&2){let e=SV();WB(),xx(e.formErrors.videoChannel);}}var Ko=(()=>{class i extends r{formReactiveService=g(w);authService=g(Ze);router=g(mt);notifier=g(rc$1);videoChannelSyncService=g(T);videoChannelService=g(z);serverService=g($t);videoService=g(x);error;channels=[];existingVideosStrategy;videoPrivacies=[];ngOnInit(){this.buildForm({externalChannelUrl:i$2,videoChannel:t,existingVideoStrategy:t,videoPrivacy:ce}),ae$1({authService:this.authService,includeCollaborations:true}).subscribe(e=>this.channels=e),this.serverService.getVideoPrivacies().subscribe(e=>{let t=e.filter(n=>n.id!==Xt.PASSWORD_PROTECTED);this.videoPrivacies=this.videoService.explainedPrivacyLabels(t).videoPrivacies;});}getFormButtonTitle(){return"\u521B\u5EFA";}formValidated(){this.error=void 0;let e=this.form.value,t={externalChannelUrl:e.externalChannelUrl,videoChannelId:e.videoChannel,videoPrivacy:e.videoPrivacy},n=e.existingVideoStrategy==="import";this.videoChannelSyncService.create(t).pipe(De(({videoChannelSync:r})=>n?this.videoChannelService.importVideos(r.channel.name,r.externalChannelUrl,r.id):Promise.resolve(null))).subscribe({next:()=>{this.notifier.success("\u5DF2\u6210\u529F\u5EFA\u7ACB\u540C\u6B65\u3002"),this.router.navigate(["/my-library","video-channel-syncs"]);},error:r=>{this.error=r.message;}});}static ɵfac=(()=>{let e;return function(n){return(e||(e=Uu(i)))(n||i);};})();static ɵcmp=Pa$1({type:i,selectors:[["my-video-channel-sync-edit"]],features:[C0],decls:34,vars:12,consts:()=>{let e;e="\u793A\u4F8B\uFF1Ahttps://youtube.com/channel/UC_fancy_channel";let t;t="\u65B0\u589E\u540C\u6B65";let n;n="\u8FDC\u7A0B\u9891\u9053 URL";let r;r="\u89C6\u9891\u9891\u9053";let s;s="\u8FDC\u7A0B\u9891\u9053\u5DF2\u6709\u89C6\u9891\u7684\u9009\u9879\uFF1A";let d;d="\u5168\u90E8\u5BFC\u5165\u5E76\u76D1\u89C6\u65B0\u7684\u53D1\u5E03";let u;u="\u4EC5\u76D1\u89C6\u65B0\u7684\u53D1\u5E03";let S;return S="Privacy of imported videos",[t,n,r,s,d,u,S,["type","danger"],[1,"pt-two-cols"],[1,"title-col"],[1,"content-col"],[3,"ngSubmit","formGroup"],[1,"form-group"],["for","externalChannelUrl"],[1,"input-group"],["type","text","id","externalChannelUrl","placeholder",e,"formControlName","externalChannelUrl",1,"form-control",3,"ngClass"],["role","alert",1,"form-error"],["for","videoChannel"],["inputId","videoChannel","formControlName","videoChannel",3,"items"],["role","radiogroup",1,"form-group"],["for","existingVideoStrategy"],[1,"peertube-radio-container"],["type","radio","name","existingVideoStrategy","id","import","value","import","formControlName","existingVideoStrategy"],["for","import"],["type","radio","name","existingVideoStrategy","id","doNothing","value","nothing","formControlName","existingVideoStrategy"],["for","doNothing"],["for","videoPrivacy"],["inputId","videoPrivacy","formControlName","videoPrivacy",3,"items"],["type","submit",1,"peertube-button","primary-button",3,"value","disabled"]];},template:function(t,n){t&1&&(w2(0,Ua,2,1,"my-alert",7),sp(1,"div",8)(2,"div",9)(3,"h2"),vV(4,0),lb()(),sp(5,"div",10)(6,"form",11),Fp("ngSubmit",function(){return n.formValidated();}),sp(7,"div",12)(8,"label",13),vV(9,1),lb(),sp(10,"div",14),Pp(11,"input",15),zH(),lb(),w2(12,Ga,2,1,"div",16),lb(),sp(13,"div",12)(14,"label",17),vV(15,2),lb(),Pp(16,"my-select-channel-user",18),zH(),w2(17,Xa,2,1,"div",16),lb(),sp(18,"div",19)(19,"label",20),vV(20,3),lb(),sp(21,"div",21),Pp(22,"input",22),zH(),sp(23,"label",23),vV(24,4),lb()(),sp(25,"div",21),Pp(26,"input",24),zH(),sp(27,"label",25),vV(28,5),lb()()(),sp(29,"div",12)(30,"label",26),vV(31,6),lb(),Pp(32,"my-select-options",27),zH(),lb(),Pp(33,"input",28),lb()()()),t&2&&(x2(n.error?0:-1),WB(6),H0("formGroup",n.form),WB(5),H0("ngClass",d$(10,Ha,n.formErrors.externalChannelUrl)),qH(),WB(),x2(n.formErrors.externalChannelUrl?12:-1),WB(4),H0("items",n.channels),qH(),WB(),x2(n.formErrors.videoChannel?17:-1),WB(5),qH(),WB(4),qH(),WB(6),H0("items",n.videoPrivacies),qH(),WB(),H0("value",o$(n.getFormButtonTitle()))("disabled",!n.form.valid));},dependencies:[Jn,Zn,Je,fn,qn,$n,Qn,Vn,yn,x3,be$1,v,Yl$1],styles:["input[type=text][_ngcontent-%COMP%]{font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:480px;max-width:480px;color:var(--input-fg);background-color:var(--input-bg);border:var(--input-border-width) solid var(--input-border-color);border-radius:var(--input-border-radius);line-height:24px}input[type=text][_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder-color);font-size:var(--input-placeholder-font-size)}input[type=text][readonly][_ngcontent-%COMP%]{color:var(--fg-300)}input[type=text][_ngcontent-%COMP%]:focus, input[type=text][_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}input[type=text][disabled][_ngcontent-%COMP%]{color:var(--fg-300);opacity:.8}@media screen and (max-width:520px){input[type=text][_ngcontent-%COMP%]{width:100%}}my-select-channel-user[_ngcontent-%COMP%], my-select-options[_ngcontent-%COMP%]{display:block;max-width:480px}"],changeDetection:1});}return i;})();var Wa=["table"];function ja(i,o){if(i&1&&(pb(0),vV(1,6),E$(2,"myNumberFormatter"),kp()),i&2){let e=o.$implicit;WB(2),cx(e)(S$(2,2,e)),EV(1);}}function Qa(i,o){if(i&1&&(sp(0,"a",11),XV(1),lb()),i&2){let e=SV().$implicit;H0("href",e.targetUrl,aw)("title",e.targetUrl),WB(),xx(e.targetUrl);}}function qa(i,o){if(i&1&&(sp(0,"span",12),XV(1),lb()),i&2){let e=SV().$implicit;H0("title",e.torrentName||e.magnetUri),WB(),xx(e.torrentName||e.magnetUri);}}function Za(i,o){if(i&1&&Pp(0,"my-actor-cell",13),i&2){let e=SV().$implicit;H0("actor",e.video.channel);}}function Ka(i,o){if(i&1&&XV(0),i&2){let e=SV().$implicit;Eb(" ",e.video?.name," ");}}function Ja(i,o){if(i&1&&(sp(0,"a",15),XV(1),lb()),i&2){let e=SV(2).$implicit,t=SV();H0("href",t.getVideoUrl(e.video),aw),WB(),xx(e.video?.name);}}function es(i,o){i&1&&(pb(0),vV(1,7),kp());}function ts(i,o){if(i&1&&w2(0,Ja,2,2,"a",15)(1,es,2,0,"ng-container"),i&2){let e=SV().$implicit;x2(e.video?0:1);}}function is(i,o){if(i&1&&(sp(0,"td",10),w2(1,Qa,2,3,"a",11)(2,qa,2,2,"span",12),lb(),sp(3,"td"),w2(4,Za,1,1,"my-actor-cell",13),lb(),sp(5,"td"),w2(6,Ka,1,1)(7,ts,2,1),lb(),sp(8,"td")(9,"span",14),XV(10),lb()(),sp(11,"td"),XV(12),E$(13,"ptDate"),lb()),i&2){let e=o.$implicit,t=SV();WB(),x2(e.targetUrl?1:2),WB(3),x2(e.video?.channel?4:-1),WB(2),x2(t.isVideoImportPending(e)?6:t.isVideoImportSuccess(e)?7:-1),WB(3),H0("ngClass",t.getVideoImportStateClass(e.state.id)),WB(),Eb(" ",e.state.label," "),WB(2),xx(T$(13,6,e.createdAt,"short"));}}function ns(i,o){if(i&1&&Pp(0,"my-action-dropdown",16),i&2){let e=o.$implicit,t=SV();H0("actions",t.videoImportActions)("entry",e);}}function os(i,o){if(i&1&&(sp(0,"pre"),XV(1),lb()),i&2){let e=o.$implicit;WB(),xx(e.error);}}function rs(i,o){i&1&&(pb(0),vV(1,8),kp());}var Jo=(()=>{class i{notifier=g(rc$1);videoImportService=g(M);table=xpe("table");inputFilters=[{key:"targetUrl",type:"text",title:"Target URL",placeholder:"https://example.com/.../video.mp4"},{key:"id",type:"text",title:"Import ID",constraint:"numeric"},{key:"videoId",type:"text",title:"Video ID",constraint:"numeric"},{key:"videoChannelSyncId",type:"text",title:"Channel sync ID",constraint:"numeric"}];videoImportActions=[];columns=[{id:"target",label:"\u76EE\u6807",sortable:false},{id:"channel",label:"\u9891\u9053",sortable:false},{id:"video",label:"\u89C6\u9891",sortable:false},{id:"state",label:"\u72B6\u6001",sortable:false},{id:"createdAt",label:"\u521B\u5EFA\u65F6\u95F4",sortable:true}];dataLoader;hasExpandedRow;constructor(){this.dataLoader=this._dataLoader.bind(this),this.hasExpandedRow=this._hasExpandedRow.bind(this);}ngOnInit(){this.videoImportActions=[{label:"\u53D6\u6D88\u5BFC\u5165",iconName:"no",handler:e=>this.cancelImport(e),isDisplayed:e=>this.isVideoImportPending(e)},{label:"\u91CD\u8BD5\u5BFC\u5165",iconName:"refresh",handler:e=>this.retryImport(e),isDisplayed:e=>this.isVideoImportFailed(e)},{label:"\u5220\u9664\u5BFC\u5165\u4EFB\u52A1",description:"\u5173\u8054\u7684\u89C6\u9891\u672A\u88AB\u5220\u9664",iconName:"delete",handler:e=>this.deleteImport(e),isDisplayed:e=>this.isVideoImportFailed(e)||this.isVideoImportCancelled(e)||!e.video},{label:"\u7F16\u8F91\u89C6\u9891",iconName:"edit",linkBuilder:e=>[this.getEditVideoUrl(e.video)],isDisplayed:e=>this.isVideoImportSuccess(e)&&!!e.video}];}getVideoImportStateClass(e){switch(e){case QDe.FAILED:return"badge-red";case QDe.REJECTED:return"badge-banned";case QDe.PENDING:return"badge-yellow";case QDe.PROCESSING:return"badge-blue";default:return"badge-green";}}isVideoImportSuccess(e){return e.state.id===QDe.SUCCESS;}isVideoImportPending(e){return e.state.id===QDe.PENDING;}isVideoImportFailed(e){return e.state.id===QDe.FAILED;}isVideoImportCancelled(e){return e.state.id===QDe.CANCELLED;}getVideoUrl(e){return K.buildWatchUrl(e);}getEditVideoUrl(e){return K.buildManageUrl(e);}deleteImport(e){this.videoImportService.deleteVideoImport(e).subscribe({next:()=>this.table().loadData(),error:t=>this.notifier.handleError(t)});}cancelImport(e){this.videoImportService.cancelVideoImport(e).subscribe({next:()=>this.table().loadData(),error:t=>this.notifier.handleError(t)});}retryImport(e){this.videoImportService.retryVideoImport(e).subscribe({next:()=>this.table().loadData(),error:t=>this.notifier.handleError(t)});}_dataLoader(e){return this.videoImportService.listMyVideoImports(E(D({},e),{includeCollaborations:true}));}_hasExpandedRow(e){return!!e.error;}static ɵfac=function(t){return new(t||i)();};static ɵcmp=Pa$1({type:i,selectors:[["ng-component"]],viewQuery:function(t,n){t&1&&px(n.table,Wa,5),t&2&&IV();},decls:12,vars:4,consts:()=>{let e;e="\u6BCF\u4E00\u9875\u5BFC\u5165";let t;t="{VAR_PLURAL, plural, =0 {\u65E0\u5BFC\u5165} =1 {1 \u4E2A\u5BFC\u5165} other {{INTERPOLATION} \u4E2A\u5BFC\u5165}}",t=bV(t,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let n;n="\u6B64\u89C6\u9891\u5DF2\u88AB\u5220\u9664";let r;r="\u64CD\u4F5C";let s;return s="\u6CA1\u627E\u5230\u89C6\u9891\u5BFC\u5165\u3002",[["table",""],["totalTitle",""],["tableCells",""],["actionCell",""],["expandedRow",""],["noResults",""],t,n,s,["key","MyVideoImportsComponent","paginatorText",e,"columnConfig","false","searchInput","true","refreshButton","true",3,"defaultColumns","dataLoader","inputFilters","hasExpandedRow"],[1,"max-width-300px","ellipsis"],["target","_blank","rel","noopener noreferrer",3,"href","title"],[3,"title"],["actorType","channel",3,"actor"],[1,"pt-badge",3,"ngClass"],["target","_blank","rel","noopener noreferrer",3,"href"],["label",r,"container","body",3,"actions","entry"]];},template:function(t,n){t&1&&(sp(0,"my-table",9,0),w0(2,ja,3,4,"ng-template",null,1,I$)(4,is,14,9,"ng-template",null,2,I$)(6,ns,1,2,"ng-template",null,3,I$)(8,os,2,1,"ng-template",null,4,I$)(10,rs,2,0,"ng-template",null,5,I$),lb()),t&2&&H0("defaultColumns",n.columns)("dataLoader",n.dataLoader)("inputFilters",n.inputFilters)("hasExpandedRow",n.hasExpandedRow);},dependencies:[cl$1,x3,Lh,bt,Un,p$1,d$1],styles:["pre[_ngcontent-%COMP%]{font-size:11px}.video-import-error[_ngcontent-%COMP%]{color:var(--red)}"],changeDetection:1});}return i;})();var Nt=class extends r{videoPlaylistToUpdate;channels=[];videoPlaylistPrivacies=[];};var as=i=>({"input-error":i}),ss=i=>["/my-library/video-playlists/update",i];function ls(i,o){if(i&1&&(sp(0,"my-alert",14),XV(1),lb()),i&2){let e=SV();WB(),xx(e.error);}}function cs(i,o){i&1&&(sp(0,"li",21),vV(1,6),lb());}function ds(i,o){if(i&1&&(sp(0,"a",41),XV(1),lb()),i&2){let e=SV(2);H0("routerLink",d$(2,ss,e.videoPlaylistToUpdate?.shortUUID)),WB(),Eb(" ",e.videoPlaylistToUpdate?.displayName," ");}}function _s(i,o){if(i&1&&(sp(0,"li",21),vV(1,7),lb(),sp(2,"li",40),w2(3,ds,2,4,"a",41),lb()),i&2){let e=SV();WB(3),x2(e.videoPlaylistToUpdate?3:-1);}}function ps(i,o){i&1&&(sp(0,"h2",22),vV(1,8),lb());}function ms(i,o){i&1&&(sp(0,"h2",22),vV(1,9),lb());}function us(i,o){if(i&1&&(sp(0,"div",30),XV(1),lb()),i&2){let e=SV();WB(),Eb(" ",e.formErrors.displayName," ");}}function hs(i,o){if(i&1&&(sp(0,"div",30),XV(1),lb()),i&2){let e=SV();WB(),xx(e.formErrors.privacy);}}function gs(i,o){if(i&1&&(sp(0,"div",37)(1,"div"),vV(2,10),lb(),sp(3,"div"),vV(4,11),lb()()),i&2){let e=SV();WB(2),cx(e.getOwnerAccountDisplayName()),EV(2);}}function fs(i,o){if(i&1&&(sp(0,"div",30),XV(1),lb()),i&2){let e=SV();WB(),xx(e.formErrors.videoChannelId);}}function Cs(i,o){i&1&&(sp(0,"div",25)(1,"my-peertube-checkbox",42),pb(2,43),sp(3,"span"),vV(4,12),lb(),Pp(5,"br"),sp(6,"span"),vV(7,13),lb(),kp(),lb(),zH(),lb()),i&2&&(WB(),qH());}var er=(()=>{class i extends Nt{formReactiveService=g(w);authService=g(Ze);notifier=g(rc$1);router=g(mt);videoPlaylistService=g(Z);serverService=g($t);error;ngOnInit(){this.buildForm({displayName:Y,privacy:H,description:q,videoChannelId:w$1,insertAtFirstPosition:null,thumbnailfile:null}),this.form.get("privacy").valueChanges.subscribe(e=>{G(this.form.get("videoChannelId"),e);}),ae$1({authService:this.authService,includeCollaborations:true}).subscribe(e=>this.channels=e),this.serverService.getVideoPlaylistPrivacies().subscribe(e=>{this.videoPlaylistPrivacies=e,this.form.patchValue({privacy:aIe.PRIVATE});});}formValidated(){this.error=void 0;let e=this.form.value,t={displayName:e.displayName,privacy:e.privacy,description:e.description||null,videoChannelId:e.videoChannelId||null,thumbnailfile:e.thumbnailfile||null};this.videoPlaylistService.createVideoPlaylist(t).pipe(Oe(({videoPlaylist:{id:n}})=>{if(e.insertAtFirstPosition!==true||!e.videoChannelId)return M$1(true);let r=this.channels.find(s=>s.id===e.videoChannelId)?.name;return this.videoPlaylistService.getVideoPlaylist(n).pipe(Oe(s=>this.videoPlaylistService.reorderPlaylistsOfChannel(r,s.videoChannelPosition,0)));})).subscribe({next:()=>{this.notifier.success("\u64AD\u653E\u5217\u8868 "+t.displayName+" \u5DF2\u521B\u5EFA\u3002"),this.router.navigate(["/my-library","video-playlists"]);},error:n=>{this.error=n.message;}});}isCreation(){return true;}isEditor(){return false;}getOwnerAccountDisplayName(){return this.authService.getUser().account.displayName;}getFormButtonTitle(){return"\u521B\u5EFA";}static ɵfac=(()=>{let e;return function(n){return(e||(e=Uu(i)))(n||i);};})();static ɵcmp=Pa$1({type:i,selectors:[["ng-component"]],features:[C0],decls:41,vars:18,consts:()=>{let e;e="\u7F16\u8F91";let t;t="\u6211\u7684\u64AD\u653E\u5217\u8868";let n;n="\u64AD\u653E\u5217\u8868\u7F29\u7565\u56FE";let r;r="\u663E\u793A\u540D\u79F0";let s;s="\u8BF4\u660E";let d;d="\u9690\u79C1";let u;u="\u9891\u9053";let S;S="\u521B\u5EFA";let v;v="\u7F16\u8F91";let R;R="\u65B0\u5EFA\u64AD\u653E\u5217\u8868";let re;re="\u66F4\u65B0\u64AD\u653E\u5217\u8868";let Le;Le="\u4EC5\u5217\u51FA "+"\uFFFD0\uFFFD"+" \u62E5\u6709\u7684\u9891\u9053\u3002 ";let nt;nt="\u4E0D\u652F\u6301\u66F4\u6539\u64AD\u653E\u5217\u8868\u7684\u6240\u6709\u8005\u3002";let ot;ot="\u5C06\u5176\u63D2\u5165\u5230\u9891\u9053\u64AD\u653E\u5217\u8868\u5217\u8868\u7684\u9996\u4F4D";let q;q="\u60A8\u53EF\u4EE5\u624B\u52A8\u5BF9\u9891\u9053\u4E2D\u7684\u64AD\u653E\u5217\u8868\u8FDB\u884C\u6392\u5E8F\u3002";let rt;return rt="\u9ED8\u8BA4\u60C5\u51B5\u4E0B\uFF0C\u65B0\u6DFB\u52A0\u7684\u64AD\u653E\u5217\u8868\u4F1A\u6DFB\u52A0\u5230\u5217\u8868\u672B\u5C3E\u3002",[t,n,r,s,d,u,S,v,R,re,Le,nt,q,rt,["type","danger"],[1,"pt-two-cols"],[1,"title-col"],["aria-label","breadcrumb"],[1,"pt-breadcrumb"],[1,"breadcrumb-item"],["routerLink","/my-library/video-playlists"],[1,"breadcrumb-item","active"],[1,"visually-hidden"],[1,"content-col"],[3,"ngSubmit","formGroup"],[1,"form-group"],["for","thumbnailfile"],["inputLabel",e,"inputName","thumbnailfile","formControlName","thumbnailfile"],["for","displayName"],["type","text","id","displayName","formControlName","displayName",1,"form-control",3,"ngClass"],["role","alert",1,"form-error"],["for","description"],["helpType","markdownText"],["inputId","description","formControlName","description",3,"formError"],["for","privacy"],["inputId","privacy","formControlName","privacy",3,"items"],["for","videoChannelId"],[1,"form-group-description"],["inputId","videoChannelId","formControlName","videoChannelId",3,"items"],["type","submit",1,"peertube-button","primary-button",3,"value","disabled"],["aria-current","page",1,"breadcrumb-item","active"],[3,"routerLink"],["inputName","insertAtFirstPosition","formControlName","insertAtFirstPosition","labelText",ot],["ngProjectAs","description",5,["description"]]];},template:function(t,n){t&1&&(w2(0,ls,2,1,"my-alert",14),sp(1,"div",15)(2,"div",16)(3,"nav",17)(4,"ol",18)(5,"li",19)(6,"a",20),vV(7,0),lb()(),w2(8,cs,2,0,"li",21)(9,_s,4,1),lb()(),w2(10,ps,2,0,"h2",22)(11,ms,2,0,"h2",22),lb(),sp(12,"div",23)(13,"form",24),Fp("ngSubmit",function(){return n.formValidated();}),sp(14,"div",25)(15,"label",26),vV(16,1),lb(),Pp(17,"my-image-input",27),zH(),lb(),sp(18,"div",25)(19,"label",28),vV(20,2),lb(),Pp(21,"input",29),zH(),w2(22,us,2,1,"div",30),lb(),sp(23,"div",25)(24,"label",31),vV(25,3),lb(),Pp(26,"my-help",32)(27,"my-markdown-textarea",33),zH(),lb(),sp(28,"div",25)(29,"label",34),vV(30,4),lb(),Pp(31,"my-select-options",35),zH(),w2(32,hs,2,1,"div",30),lb(),sp(33,"div",25)(34,"label",36),vV(35,5),lb(),w2(36,gs,5,1,"div",37),Pp(37,"my-select-channel-user",38),zH(),w2(38,fs,2,1,"div",30),lb(),w2(39,Cs,8,0,"div",25),Pp(40,"input",39),lb()()()),t&2&&(x2(n.error?0:-1),WB(8),x2(n.isCreation()?8:9),WB(2),x2(n.isCreation()?10:11),WB(3),H0("formGroup",n.form),WB(4),qH(),WB(4),H0("ngClass",d$(16,as,n.formErrors.displayName)),qH(),WB(),x2(n.formErrors.displayName?22:-1),WB(5),H0("formError",n.formErrors.description),qH(),WB(4),H0("items",n.videoPlaylistPrivacies),qH(),WB(),x2(n.formErrors.privacy?32:-1),WB(4),x2(n.isEditor()?36:-1),WB(),H0("items",n.channels),qH(),WB(),x2(n.formErrors.videoChannelId?38:-1),WB(),x2(n.isCreation()&&n.form.value.videoChannelId?39:-1),WB(),H0("value",o$(n.getFormButtonTitle()))("disabled",!n.form.valid));},dependencies:[cl$1,x3,Zh,Jn,Zn,Je,qn,$n,Qn,Vn,yn,me,U,Je$1,Yl$1,be$1,v,Me$1],styles:["input[type=text][_ngcontent-%COMP%]{font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:340px;max-width:340px;color:var(--input-fg);background-color:var(--input-bg);border:var(--input-border-width) solid var(--input-border-color);border-radius:var(--input-border-radius);line-height:24px}input[type=text][_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder-color);font-size:var(--input-placeholder-font-size)}input[type=text][readonly][_ngcontent-%COMP%]{color:var(--fg-300)}input[type=text][_ngcontent-%COMP%]:focus, input[type=text][_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}input[type=text][disabled][_ngcontent-%COMP%]{color:var(--fg-300);opacity:.8}@media screen and (max-width:380px){input[type=text][_ngcontent-%COMP%]{width:100%}}.peertube-select-container[_ngcontent-%COMP%]{width:340px}@media screen and (max-width:370px){.peertube-select-container[_ngcontent-%COMP%]{width:100%}}my-select-channel-user[_ngcontent-%COMP%], my-select-options[_ngcontent-%COMP%]{display:block;max-width:340px}.content-col[_ngcontent-%COMP%]{max-width:500px}my-image-input[_ngcontent-%COMP%]{width:223px;height:122px}"],changeDetection:1});}return i;})();var ys=20,tr=(()=>{class i{_ngZone=g(ie);_platform=g(tt);_renderer=g(ms$1).createRenderer(null,null);_cleanupGlobalListener;_scrolled=new X();_scrolledCount=0;scrollContainers=new Map();register(e){this.scrollContainers.has(e)||this.scrollContainers.set(e,e.elementScrolled().subscribe(()=>this._scrolled.next(e)));}deregister(e){let t=this.scrollContainers.get(e);t&&(t.unsubscribe(),this.scrollContainers.delete(e));}scrolled(e=ys){return this._platform.isBrowser?new W(t=>{this._cleanupGlobalListener||(this._cleanupGlobalListener=this._ngZone.runOutsideAngular(()=>this._renderer.listen("document","scroll",()=>this._scrolled.next())));let n=e>0?this._scrolled.pipe(Y1(e)).subscribe(t):this._scrolled.subscribe(t);return this._scrolledCount++,()=>{n.unsubscribe(),this._scrolledCount--,this._scrolledCount||(this._cleanupGlobalListener?.(),this._cleanupGlobalListener=void 0);};}):M$1();}ngOnDestroy(){this._cleanupGlobalListener?.(),this._cleanupGlobalListener=void 0,this.scrollContainers.forEach((e,t)=>this.deregister(t)),this._scrolled.complete();}ancestorScrolled(e,t){let n=this.getAncestorScrollContainers(e);return this.scrolled(t).pipe(Ie(r=>!r||n.indexOf(r)>-1));}getAncestorScrollContainers(e){let t=[];return this.scrollContainers.forEach((n,r)=>{this._targetContainsElement(r,e)&&t.push(r);}),t;}_targetContainsElement(e,t){let n=le(t),r=e.getElementRef().nativeElement;do if(n==r)return true;while(n=n.parentElement);return false;}static ɵfac=function(t){return new(t||i)();};static ɵprov=be({token:i,factory:i.ɵfac});}return i;})();var vs=20,Ji=(()=>{class i{_platform=g(tt);_listeners;_viewportSize=null;_change=new X();_document=g(Ce);constructor(){let e=g(ie),t=g(ms$1).createRenderer(null,null);e.runOutsideAngular(()=>{if(this._platform.isBrowser){let n=r=>this._change.next(r);this._listeners=[t.listen("window","resize",n),t.listen("window","orientationchange",n)];}this.change().subscribe(()=>this._viewportSize=null);});}ngOnDestroy(){this._listeners?.forEach(e=>e()),this._change.complete();}getViewportSize(){this._viewportSize||this._updateViewportSize();let e={width:this._viewportSize.width,height:this._viewportSize.height};return this._platform.isBrowser||(this._viewportSize=null),e;}getViewportRect(){let e=this.getViewportScrollPosition(),{width:t,height:n}=this.getViewportSize();return{top:e.top,left:e.left,bottom:e.top+n,right:e.left+t,height:n,width:t};}getViewportScrollPosition(){if(!this._platform.isBrowser)return{top:0,left:0};let e=this._document,t=this._getWindow(),n=e.documentElement,r=n.getBoundingClientRect(),s=-r.top||e.body?.scrollTop||t.scrollY||n.scrollTop||0,d=-r.left||e.body?.scrollLeft||t.scrollX||n.scrollLeft||0;return{top:s,left:d};}change(e=vs){return e>0?this._change.pipe(Y1(e)):this._change;}_getWindow(){return this._document.defaultView||window;}_updateViewportSize(){let e=this._getWindow();this._viewportSize=this._platform.isBrowser?{width:e.innerWidth,height:e.innerHeight}:{width:0,height:0};}static ɵfac=function(t){return new(t||i)();};static ɵprov=be({token:i,factory:i.ɵfac});}return i;})();var ir=(()=>{class i{static ɵfac=function(t){return new(t||i)();};static ɵmod=Ln({type:i});static ɵinj=mn({});}return i;})();function nn(i){let o=i.cloneNode(true),e=o.querySelectorAll("[id]"),t=i.nodeName.toLowerCase();o.removeAttribute("id");for(let n=0;n<e.length;n++)e[n].removeAttribute("id");return t==="canvas"?rr(i,o):(t==="input"||t==="select"||t==="textarea")&&or(i,o),nr("canvas",i,o,rr),nr("input, textarea, select",i,o,or),o;}function nr(i,o,e,t){let n=o.querySelectorAll(i);if(n.length){let r=e.querySelectorAll(i);for(let s=0;s<n.length;s++)t(n[s],r[s]);}}var Es=0;function or(i,o){o.type!=="file"&&(o.value=i.value),o.type==="radio"&&o.name&&(o.name=`mat-clone-${o.name}-${Es++}`);}function rr(i,o){let e=o.getContext("2d");if(e)try{e.drawImage(i,0,0);}catch(t){}}function cn(i){let o=i.getBoundingClientRect();return{top:o.top,right:o.right,bottom:o.bottom,left:o.left,width:o.width,height:o.height,x:o.x,y:o.y};}function on(i,o,e){let{top:t,bottom:n,left:r,right:s}=i;return e>=t&&e<=n&&o>=r&&o<=s;}function Ms(i,o){let e=o.left<i.left,t=o.left+o.width>i.right,n=o.top<i.top,r=o.top+o.height>i.bottom;return e||t||n||r;}function Ut(i,o,e){i.top+=o,i.bottom=i.top+i.height,i.left+=e,i.right=i.left+i.width;}function ar(i,o,e,t){let{top:n,right:r,bottom:s,left:d,width:u,height:S}=i,v=u*o,R=S*o;return t>n-R&&t<s+R&&e>d-v&&e<r+v;}var Ai=class{_document;positions=new Map();constructor(o){this._document=o;}clear(){this.positions.clear();}cache(o){this.clear(),this.positions.set(this._document,{scrollPosition:this.getViewportScrollPosition()}),o.forEach(e=>{this.positions.set(e,{scrollPosition:{top:e.scrollTop,left:e.scrollLeft},clientRect:cn(e)});});}handleScroll(o){let e=L$1(o),t=this.positions.get(e);if(!t)return null;let n=t.scrollPosition,r,s;if(e===this._document){let S=this.getViewportScrollPosition();r=S.top,s=S.left;}else r=e.scrollTop,s=e.scrollLeft;let d=n.top-r,u=n.left-s;return this.positions.forEach((S,v)=>{S.clientRect&&e!==v&&e.contains(v)&&Ut(S.clientRect,d,u);}),n.top=r,n.left=s,{top:d,left:u};}getViewportScrollPosition(){return{top:window.scrollY,left:window.scrollX};}};function Sr(i,o){let e=i.rootNodes;if(e.length===1&&e[0].nodeType===o.ELEMENT_NODE)return e[0];let t=o.createElement("div");return e.forEach(n=>t.appendChild(n)),t;}function dn(i,o,e){for(let t in o)if(o.hasOwnProperty(t)){let n=o[t];n?i.setProperty(t,n,e?.has(t)?"important":""):i.removeProperty(t);}return i;}function Lt(i,o){let e=o?"":"none";dn(i.style,{"touch-action":o?"":"none","-webkit-user-drag":o?"":"none","-webkit-tap-highlight-color":o?"":"transparent","user-select":e,"-ms-user-select":e,"-webkit-user-select":e,"-moz-user-select":e});}function sr(i,o,e){dn(i.style,{position:o?"":"fixed",top:o?"":"0",opacity:o?"":"0",left:o?"":"-999em"},e);}function Ni(i,o){return o&&o!="none"?i+" "+o:i;}function lr(i,o){i.style.width=`${o.width}px`,i.style.height=`${o.height}px`,i.style.transform=Gt(o.left,o.top);}function Gt(i,o){return`translate3d(${Math.round(i)}px, ${Math.round(o)}px, 0)`;}var zt={capture:true},en={passive:false,capture:true},Ps=(()=>{class i{static ɵfac=function(t){return new(t||i)();};static ɵcmp=Pa$1({type:i,selectors:[["ng-component"]],hostAttrs:["cdk-drag-resets-container",""],decls:0,vars:0,template:function(t,n){},styles:[`@layer cdk-resets {
  .cdk-drag-preview {
    background: none;
    border: none;
    padding: 0;
    color: inherit;
    inset: auto;
  }
}
.cdk-drag-placeholder *,
.cdk-drag-preview * {
  pointer-events: none !important;
}
`],encapsulation:2});}return i;})(),_n=(()=>{class i{_ngZone=g(ie);_document=g(Ce);_styleLoader=g(ot);_renderer=g(ms$1).createRenderer(null,null);_cleanupDocumentTouchmove;_scroll=new X();_dropInstances=new Set();_dragInstances=new Set();_activeDragInstances=Ye([]);_globalListeners;_draggingPredicate=e=>e.isDragging();_domNodesToDirectives=null;pointerMove=new X();pointerUp=new X();registerDropContainer(e){this._dropInstances.has(e)||this._dropInstances.add(e);}registerDragItem(e){this._dragInstances.add(e),this._dragInstances.size===1&&this._ngZone.runOutsideAngular(()=>{this._cleanupDocumentTouchmove?.(),this._cleanupDocumentTouchmove=this._renderer.listen(this._document,"touchmove",this._persistentTouchmoveListener,en);});}removeDropContainer(e){this._dropInstances.delete(e);}removeDragItem(e){this._dragInstances.delete(e),this.stopDragging(e),this._dragInstances.size===0&&this._cleanupDocumentTouchmove?.();}startDragging(e,t){if(!(this._activeDragInstances().indexOf(e)>-1)&&(this._styleLoader.load(Ps),this._activeDragInstances.update(n=>[...n,e]),this._activeDragInstances().length===1)){let n=t.type.startsWith("touch"),r=d=>this.pointerUp.next(d),s=[["scroll",d=>this._scroll.next(d),zt],["selectstart",this._preventDefaultWhileDragging,en]];n?s.push(["touchend",r,zt],["touchcancel",r,zt]):s.push(["mouseup",r,zt]),n||s.push(["mousemove",d=>this.pointerMove.next(d),en]),this._ngZone.runOutsideAngular(()=>{this._globalListeners=s.map(([d,u,S])=>this._renderer.listen(this._document,d,u,S));});}}stopDragging(e){this._activeDragInstances.update(t=>{let n=t.indexOf(e);return n>-1?(t.splice(n,1),[...t]):t;}),this._activeDragInstances().length===0&&this._clearGlobalListeners();}isDragging(e){return this._activeDragInstances().indexOf(e)>-1;}scrolled(e){let t=[this._scroll];return e&&e!==this._document&&t.push(new W(n=>this._ngZone.runOutsideAngular(()=>{let r=this._renderer.listen(e,"scroll",s=>{this._activeDragInstances().length&&n.next(s);},zt);return()=>{r();};}))),V1(...t);}registerDirectiveNode(e,t){this._domNodesToDirectives??=new WeakMap(),this._domNodesToDirectives.set(e,t);}removeDirectiveNode(e){this._domNodesToDirectives?.delete(e);}getDragDirectiveForNode(e){return this._domNodesToDirectives?.get(e)||null;}ngOnDestroy(){this._dragInstances.forEach(e=>this.removeDragItem(e)),this._dropInstances.forEach(e=>this.removeDropContainer(e)),this._domNodesToDirectives=null,this._clearGlobalListeners(),this.pointerMove.complete(),this.pointerUp.complete();}_preventDefaultWhileDragging=e=>{this._activeDragInstances().length>0&&e.preventDefault();};_persistentTouchmoveListener=e=>{this._activeDragInstances().length>0&&(this._activeDragInstances().some(this._draggingPredicate)&&e.preventDefault(),this.pointerMove.next(e));};_clearGlobalListeners(){this._globalListeners?.forEach(e=>e()),this._globalListeners=void 0;}static ɵfac=function(t){return new(t||i)();};static ɵprov=be({token:i,factory:i.ɵfac});}return i;})();function cr(i){let o=i.toLowerCase().indexOf("ms")>-1?1:1e3;return parseFloat(i)*o;}function Is(i){let o=getComputedStyle(i),e=tn(o,"transition-property"),t=e.find(d=>d==="transform"||d==="all");if(!t)return 0;let n=e.indexOf(t),r=tn(o,"transition-duration"),s=tn(o,"transition-delay");return cr(r[n])+cr(s[n]);}function tn(i,o){return i.getPropertyValue(o).split(",").map(t=>t.trim());}var Ts=new Set(["position"]),rn=class{_document;_rootElement;_direction;_initialDomRect;_previewTemplate;_previewClass;_pickupPositionOnPage;_initialTransform;_zIndex;_renderer;_previewEmbeddedView=null;_preview;get element(){return this._preview;}constructor(o,e,t,n,r,s,d,u,S,v){this._document=o,this._rootElement=e,this._direction=t,this._initialDomRect=n,this._previewTemplate=r,this._previewClass=s,this._pickupPositionOnPage=d,this._initialTransform=u,this._zIndex=S,this._renderer=v;}attach(o){this._preview=this._createPreview(),o.appendChild(this._preview),dr(this._preview)&&this._preview.showPopover();}destroy(){this._preview.remove(),this._previewEmbeddedView?.destroy(),this._preview=this._previewEmbeddedView=null;}setTransform(o){this._preview.style.transform=o;}getBoundingClientRect(){return this._preview.getBoundingClientRect();}addClass(o){this._preview.classList.add(o);}getTransitionDuration(){return Is(this._preview);}addEventListener(o,e){return this._renderer.listen(this._preview,o,e);}_createPreview(){let o=this._previewTemplate,e=this._previewClass,t=o?o.template:null,n;if(t&&o){let r=o.matchSize?this._initialDomRect:null,s=o.viewContainer.createEmbeddedView(t,o.context);s.detectChanges(),n=Sr(s,this._document),this._previewEmbeddedView=s,o.matchSize?lr(n,r):n.style.transform=Gt(this._pickupPositionOnPage.x,this._pickupPositionOnPage.y);}else n=nn(this._rootElement),lr(n,this._initialDomRect),this._initialTransform&&(n.style.transform=this._initialTransform);return dn(n.style,{"pointer-events":"none",margin:dr(n)?"0 auto 0 0":"0",position:"fixed",top:"0",left:"0","z-index":this._zIndex+""},Ts),Lt(n,false),n.classList.add("cdk-drag-preview"),n.setAttribute("popover","manual"),n.setAttribute("dir",this._direction),e&&(Array.isArray(e)?e.forEach(r=>n.classList.add(r)):n.classList.add(e)),n;}};function dr(i){return"showPopover"in i;}var Os={passive:true},_r={passive:false},Rs={passive:false,capture:true},bs=800,pr="cdk-drag-placeholder",mr=new Set(["position"]);function yr(i,o,e={dragStartThreshold:5,pointerDirectionChangeThreshold:5}){let t=i.get(ni,null,{optional:true})||i.get(ms$1).createRenderer(null,null);return new an(o,e,i.get(Ce),i.get(ie),i.get(Ji),i.get(_n),t);}var an=class{_config;_document;_ngZone;_viewportRuler;_dragDropRegistry;_renderer;_rootElementCleanups;_cleanupShadowRootSelectStart;_preview=null;_previewContainer;_placeholderRef=null;_placeholder;_pickupPositionInElement;_pickupPositionOnPage;_marker;_anchor=null;_passiveTransform={x:0,y:0};_activeTransform={x:0,y:0};_initialTransform;_hasStartedDragging=Ye(false);_hasMoved=false;_initialContainer;_initialIndex;_parentPositions;_moveEvents=new X();_pointerDirectionDelta;_pointerPositionAtLastDirectionChange;_lastKnownPointerPosition;_rootElement;_ownerSVGElement=null;_rootElementTapHighlight;_pointerMoveSubscription=Fe.EMPTY;_pointerUpSubscription=Fe.EMPTY;_scrollSubscription=Fe.EMPTY;_resizeSubscription=Fe.EMPTY;_lastTouchEventTime;_dragStartTime;_boundaryElement=null;_nativeInteractionsEnabled=true;_initialDomRect;_previewRect;_boundaryRect;_previewTemplate;_placeholderTemplate;_handles=[];_disabledHandles=new Set();_dropContainer;_direction="ltr";_parentDragRef=null;_cachedShadowRoot;lockAxis=null;dragStartDelay=0;previewClass;scale=1;get disabled(){return this._disabled||!!(this._dropContainer&&this._dropContainer.disabled);}set disabled(o){o!==this._disabled&&(this._disabled=o,this._toggleNativeDragInteractions(),this._handles.forEach(e=>Lt(e,o)));}_disabled=false;beforeStarted=new X();started=new X();released=new X();ended=new X();entered=new X();exited=new X();dropped=new X();moved=this._moveEvents;data;constrainPosition;constructor(o,e,t,n,r,s,d){this._config=e,this._document=t,this._ngZone=n,this._viewportRuler=r,this._dragDropRegistry=s,this._renderer=d,this.withRootElement(o).withParent(e.parentDragRef||null),this._parentPositions=new Ai(t),s.registerDragItem(this);}getPlaceholderElement(){return this._placeholder;}getRootElement(){return this._rootElement;}getVisibleElement(){return this.isDragging()?this.getPlaceholderElement():this.getRootElement();}withHandles(o){this._handles=o.map(t=>le(t)),this._handles.forEach(t=>Lt(t,this.disabled)),this._toggleNativeDragInteractions();let e=new Set();return this._disabledHandles.forEach(t=>{this._handles.indexOf(t)>-1&&e.add(t);}),this._disabledHandles=e,this;}withPreviewTemplate(o){return this._previewTemplate=o,this;}withPlaceholderTemplate(o){return this._placeholderTemplate=o,this;}withRootElement(o){let e=le(o);if(e!==this._rootElement){this._removeRootElementListeners();let t=this._renderer;this._rootElementCleanups=this._ngZone.runOutsideAngular(()=>[t.listen(e,"mousedown",this._pointerDown,_r),t.listen(e,"touchstart",this._pointerDown,Os),t.listen(e,"dragstart",this._nativeDragStart,_r)]),this._initialTransform=void 0,this._rootElement=e;}return typeof SVGElement<"u"&&this._rootElement instanceof SVGElement&&(this._ownerSVGElement=this._rootElement.ownerSVGElement),this;}withBoundaryElement(o){return this._boundaryElement=o?le(o):null,this._resizeSubscription.unsubscribe(),o&&(this._resizeSubscription=this._viewportRuler.change(10).subscribe(()=>this._containInsideBoundaryOnResize())),this;}withParent(o){return this._parentDragRef=o,this;}dispose(){this._removeRootElementListeners(),this.isDragging()&&this._rootElement?.remove(),this._marker?.remove(),this._destroyPreview(),this._destroyPlaceholder(),this._dragDropRegistry.removeDragItem(this),this._removeListeners(),this.beforeStarted.complete(),this.started.complete(),this.released.complete(),this.ended.complete(),this.entered.complete(),this.exited.complete(),this.dropped.complete(),this._moveEvents.complete(),this._handles=[],this._disabledHandles.clear(),this._dropContainer=void 0,this._resizeSubscription.unsubscribe(),this._parentPositions.clear(),this._boundaryElement=this._rootElement=this._ownerSVGElement=this._placeholderTemplate=this._previewTemplate=this._marker=this._parentDragRef=null;}isDragging(){return this._hasStartedDragging()&&this._dragDropRegistry.isDragging(this);}reset(){this._rootElement.style.transform=this._initialTransform||"",this._activeTransform={x:0,y:0},this._passiveTransform={x:0,y:0};}resetToBoundary(){if(this._boundaryElement&&this._rootElement&&Ms(this._boundaryElement.getBoundingClientRect(),this._rootElement.getBoundingClientRect())){let o=this._boundaryElement.getBoundingClientRect(),e=this._rootElement.getBoundingClientRect(),t=0,n=0;e.left<o.left?t=o.left-e.left:e.right>o.right&&(t=o.right-e.right),e.top<o.top?n=o.top-e.top:e.bottom>o.bottom&&(n=o.bottom-e.bottom);let r=this._activeTransform.x,s=this._activeTransform.y,d=r+t,u=s+n;this._rootElement.style.transform=Gt(d,u),this._activeTransform={x:d,y:u},this._passiveTransform={x:d,y:u};}}disableHandle(o){!this._disabledHandles.has(o)&&this._handles.indexOf(o)>-1&&(this._disabledHandles.add(o),Lt(o,true));}enableHandle(o){this._disabledHandles.has(o)&&(this._disabledHandles.delete(o),Lt(o,this.disabled));}withDirection(o){return this._direction=o,this;}_withDropContainer(o){this._dropContainer=o;}getFreeDragPosition(){let o=this.isDragging()?this._activeTransform:this._passiveTransform;return{x:o.x,y:o.y};}setFreeDragPosition(o){return this._activeTransform={x:0,y:0},this._passiveTransform.x=o.x,this._passiveTransform.y=o.y,this._dropContainer||this._applyRootElementTransform(o.x,o.y),this;}withPreviewContainer(o){return this._previewContainer=o,this;}_sortFromLastPointerPosition(){let o=this._lastKnownPointerPosition;o&&this._dropContainer&&this._updateActiveDropContainer(this._getConstrainedPointerPosition(o),o);}_removeListeners(){this._pointerMoveSubscription.unsubscribe(),this._pointerUpSubscription.unsubscribe(),this._scrollSubscription.unsubscribe(),this._cleanupShadowRootSelectStart?.(),this._cleanupShadowRootSelectStart=void 0;}_destroyPreview(){this._preview?.destroy(),this._preview=null;}_destroyPlaceholder(){this._anchor?.remove(),this._placeholder?.remove(),this._placeholderRef?.destroy(),this._placeholder=this._anchor=this._placeholderRef=null;}_pointerDown=o=>{if(this.beforeStarted.next(),this._handles.length){let e=this._getTargetHandle(o);e&&!this._disabledHandles.has(e)&&!this.disabled&&this._initializeDragSequence(e,o);}else this.disabled||this._initializeDragSequence(this._rootElement,o);};_pointerMove=o=>{let e=this._getPointerPositionOnPage(o);if(!this._hasStartedDragging()){let n=Math.abs(e.x-this._pickupPositionOnPage.x),r=Math.abs(e.y-this._pickupPositionOnPage.y);if(n+r>=this._config.dragStartThreshold){let d=Date.now()>=this._dragStartTime+this._getDragStartDelay(o),u=this._dropContainer;if(!d){this._endDragSequence(o);return;}(!u||!u.isDragging()&&!u.isReceiving())&&(o.cancelable&&o.preventDefault(),this._hasStartedDragging.set(true),this._ngZone.run(()=>this._startDragSequence(o)));}return;}o.cancelable&&o.preventDefault();let t=this._getConstrainedPointerPosition(e);if(this._hasMoved=true,this._lastKnownPointerPosition=e,this._updatePointerDirectionDelta(t),this._dropContainer)this._updateActiveDropContainer(t,e);else{let n=this.constrainPosition?this._initialDomRect:this._pickupPositionOnPage,r=this._activeTransform;r.x=t.x-n.x+this._passiveTransform.x,r.y=t.y-n.y+this._passiveTransform.y,this._applyRootElementTransform(r.x,r.y);}this._moveEvents.observers.length&&this._ngZone.run(()=>{this._moveEvents.next({source:this,pointerPosition:t,event:o,distance:this._getDragDistance(t),delta:this._pointerDirectionDelta});});};_pointerUp=o=>{this._endDragSequence(o);};_endDragSequence(o){if(this._dragDropRegistry.isDragging(this)&&(this._removeListeners(),this._dragDropRegistry.stopDragging(this),this._toggleNativeDragInteractions(),this._handles&&(this._rootElement.style.webkitTapHighlightColor=this._rootElementTapHighlight),!!this._hasStartedDragging()))if(this.released.next({source:this,event:o}),this._dropContainer)this._dropContainer._stopScrolling(),this._animatePreviewToPlaceholder().then(()=>{this._cleanupDragArtifacts(o),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this);});else{this._passiveTransform.x=this._activeTransform.x;let e=this._getPointerPositionOnPage(o);this._passiveTransform.y=this._activeTransform.y,this._ngZone.run(()=>{this.ended.next({source:this,distance:this._getDragDistance(e),dropPoint:e,event:o});}),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this);}}_startDragSequence(o){Ht(o)&&(this._lastTouchEventTime=Date.now()),this._toggleNativeDragInteractions();let e=this._getShadowRoot(),t=this._dropContainer;if(e&&this._ngZone.runOutsideAngular(()=>{this._cleanupShadowRootSelectStart=this._renderer.listen(e,"selectstart",As,Rs);}),t){let n=this._rootElement,r=n.parentNode,s=this._placeholder=this._createPlaceholderElement(),d=this._marker=this._marker||this._document.createComment("");r.insertBefore(d,n),this._initialTransform=n.style.transform||"",this._preview=new rn(this._document,this._rootElement,this._direction,this._initialDomRect,this._previewTemplate||null,this.previewClass||null,this._pickupPositionOnPage,this._initialTransform,this._config.zIndex||1e3,this._renderer),this._preview.attach(this._getPreviewInsertionPoint(r,e)),sr(n,false,mr),this._document.body.appendChild(r.replaceChild(s,n)),this.started.next({source:this,event:o}),t.start(),this._initialContainer=t,this._initialIndex=t.getItemIndex(this);}else this.started.next({source:this,event:o}),this._initialContainer=this._initialIndex=void 0;this._parentPositions.cache(t?t.getScrollableParents():[]);}_initializeDragSequence(o,e){this._parentDragRef&&e.stopPropagation();let t=this.isDragging(),n=Ht(e),r=!n&&e.button!==0,s=this._rootElement,d=L$1(e),u=!n&&this._lastTouchEventTime&&this._lastTouchEventTime+bs>Date.now(),S=n?q$1(e):$$1(e);if(d&&d.draggable&&e.type==="mousedown"&&e.preventDefault(),t||r||u||S)return;if(this._handles.length){let re=s.style;this._rootElementTapHighlight=re.webkitTapHighlightColor||"",re.webkitTapHighlightColor="transparent";}this._hasMoved=false,this._hasStartedDragging.set(this._hasMoved),this._removeListeners(),this._initialDomRect=this._rootElement.getBoundingClientRect(),this._pointerMoveSubscription=this._dragDropRegistry.pointerMove.subscribe(this._pointerMove),this._pointerUpSubscription=this._dragDropRegistry.pointerUp.subscribe(this._pointerUp),this._scrollSubscription=this._dragDropRegistry.scrolled(this._getShadowRoot()).subscribe(re=>this._updateOnScroll(re)),this._boundaryElement&&(this._boundaryRect=cn(this._boundaryElement));let v=this._previewTemplate;this._pickupPositionInElement=v&&v.template&&!v.matchSize?{x:0,y:0}:this._getPointerPositionInElement(this._initialDomRect,o,e);let R=this._pickupPositionOnPage=this._lastKnownPointerPosition=this._getPointerPositionOnPage(e);this._pointerDirectionDelta={x:0,y:0},this._pointerPositionAtLastDirectionChange={x:R.x,y:R.y},this._dragStartTime=Date.now(),this._dragDropRegistry.startDragging(this,e);}_cleanupDragArtifacts(o){sr(this._rootElement,true,mr),this._marker.parentNode.replaceChild(this._rootElement,this._marker),this._destroyPreview(),this._destroyPlaceholder(),this._initialDomRect=this._boundaryRect=this._previewRect=this._initialTransform=void 0,this._ngZone.run(()=>{let e=this._dropContainer,t=e.getItemIndex(this),n=this._getPointerPositionOnPage(o),r=this._getDragDistance(n),s=e._isOverContainer(n.x,n.y);this.ended.next({source:this,distance:r,dropPoint:n,event:o}),this.dropped.next({item:this,currentIndex:t,previousIndex:this._initialIndex,container:e,previousContainer:this._initialContainer,isPointerOverContainer:s,distance:r,dropPoint:n,event:o}),e.drop(this,t,this._initialIndex,this._initialContainer,s,r,n,o),this._dropContainer=this._initialContainer;});}_updateActiveDropContainer({x:o,y:e},{x:t,y:n}){let r=this._initialContainer._getSiblingContainerFromPosition(this,o,e);!r&&this._dropContainer!==this._initialContainer&&this._initialContainer._isOverContainer(o,e)&&(r=this._initialContainer),r&&r!==this._dropContainer&&this._ngZone.run(()=>{let s=this._dropContainer.getItemIndex(this),d=this._dropContainer.getItemAtIndex(s+1)?.getVisibleElement()||null;this.exited.next({item:this,container:this._dropContainer}),this._dropContainer.exit(this),this._conditionallyInsertAnchor(r,this._dropContainer,d),this._dropContainer=r,this._dropContainer.enter(this,o,e,r===this._initialContainer&&r.sortingDisabled?this._initialIndex:void 0),this.entered.next({item:this,container:r,currentIndex:r.getItemIndex(this)});}),this.isDragging()&&(this._dropContainer._startScrollingIfNecessary(t,n),this._dropContainer._sortItem(this,o,e,this._pointerDirectionDelta),this.constrainPosition?this._applyPreviewTransform(o,e):this._applyPreviewTransform(o-this._pickupPositionInElement.x,e-this._pickupPositionInElement.y));}_animatePreviewToPlaceholder(){if(!this._hasMoved)return Promise.resolve();let o=this._placeholder.getBoundingClientRect();this._preview.addClass("cdk-drag-animating"),this._applyPreviewTransform(o.left,o.top);let e=this._preview.getTransitionDuration();return e===0?Promise.resolve():this._ngZone.runOutsideAngular(()=>new Promise(t=>{let n=d=>{(!d||this._preview&&L$1(d)===this._preview.element&&d.propertyName==="transform")&&(s(),t(),clearTimeout(r));},r=setTimeout(n,e*1.5),s=this._preview.addEventListener("transitionend",n);}));}_createPlaceholderElement(){let o=this._placeholderTemplate,e=o?o.template:null,t;return e?(this._placeholderRef=o.viewContainer.createEmbeddedView(e,o.context),this._placeholderRef.detectChanges(),t=Sr(this._placeholderRef,this._document)):t=nn(this._rootElement),t.style.pointerEvents="none",t.classList.add(pr),t;}_getPointerPositionInElement(o,e,t){let n=e===this._rootElement?null:e,r=n?n.getBoundingClientRect():o,s=Ht(t)?t.targetTouches[0]:t,d=this._getViewportScrollPosition(),u=s.pageX-r.left-d.left,S=s.pageY-r.top-d.top;return{x:r.left-o.left+u,y:r.top-o.top+S};}_getPointerPositionOnPage(o){let e=this._getViewportScrollPosition(),t=Ht(o)?o.touches[0]||o.changedTouches[0]||{pageX:0,pageY:0}:o,n=t.pageX-e.left,r=t.pageY-e.top;if(this._ownerSVGElement){let s=this._ownerSVGElement.getScreenCTM();if(s){let d=this._ownerSVGElement.createSVGPoint();return d.x=n,d.y=r,d.matrixTransform(s.inverse());}}return{x:n,y:r};}_getConstrainedPointerPosition(o){let e=this._dropContainer?this._dropContainer.lockAxis:null,{x:t,y:n}=this.constrainPosition?this.constrainPosition(o,this,this._initialDomRect,this._pickupPositionInElement):o;if(this.lockAxis==="x"||e==="x"?n=this._pickupPositionOnPage.y-(this.constrainPosition?this._pickupPositionInElement.y:0):(this.lockAxis==="y"||e==="y")&&(t=this._pickupPositionOnPage.x-(this.constrainPosition?this._pickupPositionInElement.x:0)),this._boundaryRect){let{x:r,y:s}=this.constrainPosition?{x:0,y:0}:this._pickupPositionInElement,d=this._boundaryRect,{width:u,height:S}=this._getPreviewRect(),v=d.top+s,R=d.bottom-(S-s),re=d.left+r,Le=d.right-(u-r);t=ur(t,re,Le),n=ur(n,v,R);}return{x:t,y:n};}_updatePointerDirectionDelta(o){let{x:e,y:t}=o,n=this._pointerDirectionDelta,r=this._pointerPositionAtLastDirectionChange,s=Math.abs(e-r.x),d=Math.abs(t-r.y);return s>this._config.pointerDirectionChangeThreshold&&(n.x=e>r.x?1:-1,r.x=e),d>this._config.pointerDirectionChangeThreshold&&(n.y=t>r.y?1:-1,r.y=t),n;}_toggleNativeDragInteractions(){if(!this._rootElement||!this._handles)return;let o=this._handles.length>0||!this.isDragging();o!==this._nativeInteractionsEnabled&&(this._nativeInteractionsEnabled=o,Lt(this._rootElement,o));}_removeRootElementListeners(){this._rootElementCleanups?.forEach(o=>o()),this._rootElementCleanups=void 0;}_applyRootElementTransform(o,e){let t=1/this.scale,n=Gt(o*t,e*t),r=this._rootElement.style;this._initialTransform==null&&(this._initialTransform=r.transform&&r.transform!="none"?r.transform:""),r.transform=Ni(n,this._initialTransform);}_applyPreviewTransform(o,e){let t=this._previewTemplate?.template?void 0:this._initialTransform,n=Gt(o,e);this._preview.setTransform(Ni(n,t));}_getDragDistance(o){let e=this._pickupPositionOnPage;return e?{x:o.x-e.x,y:o.y-e.y}:{x:0,y:0};}_cleanupCachedDimensions(){this._boundaryRect=this._previewRect=void 0,this._parentPositions.clear();}_containInsideBoundaryOnResize(){let{x:o,y:e}=this._passiveTransform;if(o===0&&e===0||this.isDragging()||!this._boundaryElement)return;let t=this._rootElement.getBoundingClientRect(),n=this._boundaryElement.getBoundingClientRect();if(n.width===0&&n.height===0||t.width===0&&t.height===0)return;let r=n.left-t.left,s=t.right-n.right,d=n.top-t.top,u=t.bottom-n.bottom;n.width>t.width?(r>0&&(o+=r),s>0&&(o-=s)):o=0,n.height>t.height?(d>0&&(e+=d),u>0&&(e-=u)):e=0,(o!==this._passiveTransform.x||e!==this._passiveTransform.y)&&this.setFreeDragPosition({y:e,x:o});}_getDragStartDelay(o){let e=this.dragStartDelay;return typeof e=="number"?e:Ht(o)?e.touch:e?e.mouse:0;}_updateOnScroll(o){let e=this._parentPositions.handleScroll(o);if(e){let t=L$1(o);this._boundaryRect&&t!==this._boundaryElement&&t.contains(this._boundaryElement)&&Ut(this._boundaryRect,e.top,e.left),this._pickupPositionOnPage.x+=e.left,this._pickupPositionOnPage.y+=e.top,this._dropContainer||(this._activeTransform.x-=e.left,this._activeTransform.y-=e.top,this._applyRootElementTransform(this._activeTransform.x,this._activeTransform.y));}}_getViewportScrollPosition(){return this._parentPositions.positions.get(this._document)?.scrollPosition||this._parentPositions.getViewportScrollPosition();}_getShadowRoot(){return this._cachedShadowRoot===void 0&&(this._cachedShadowRoot=R(this._rootElement)),this._cachedShadowRoot;}_getPreviewInsertionPoint(o,e){let t=this._previewContainer||"global";if(t==="parent")return o;if(t==="global"){let n=this._document;return e||n.fullscreenElement||n.webkitFullscreenElement||n.mozFullScreenElement||n.msFullscreenElement||n.body;}return le(t);}_getPreviewRect(){return(!this._previewRect||!this._previewRect.width&&!this._previewRect.height)&&(this._previewRect=this._preview?this._preview.getBoundingClientRect():this._initialDomRect),this._previewRect;}_nativeDragStart=o=>{if(this._handles.length){let e=this._getTargetHandle(o);e&&!this._disabledHandles.has(e)&&!this.disabled&&o.preventDefault();}else this.disabled||o.preventDefault();};_getTargetHandle(o){return this._handles.find(e=>o.target&&(o.target===e||e.contains(o.target)));}_conditionallyInsertAnchor(o,e,t){if(o===this._initialContainer)this._anchor?.remove(),this._anchor=null;else if(e===this._initialContainer&&e.hasAnchor){let n=this._anchor??=nn(this._placeholder);n.classList.remove(pr),n.classList.add("cdk-drag-anchor"),n.style.transform="",t?t.before(n):le(e.element).appendChild(n);}}};function ur(i,o,e){return Math.max(o,Math.min(e,i));}function Ht(i){return i.type[0]==="t";}function As(i){i.preventDefault();}function vr(i,o,e){let t=hr(o,i.length-1),n=hr(e,i.length-1);if(t===n)return;let r=i[t],s=n<t?-1:1;for(let d=t;d!==n;d+=s)i[d]=i[d+s];i[n]=r;}function hr(i,o){return Math.max(0,Math.min(o,i));}var Li=class{_dragDropRegistry;_element;_sortPredicate;_itemPositions=[];_activeDraggables;orientation="vertical";direction="ltr";constructor(o){this._dragDropRegistry=o;}_previousSwap={drag:null,delta:0,overlaps:false};start(o){this.withItems(o);}sort(o,e,t,n){let r=this._itemPositions,s=this._getItemIndexFromPointerPosition(o,e,t,n);if(s===-1&&r.length>0)return null;let d=this.orientation==="horizontal",u=r.findIndex(q=>q.drag===o),S=r[s],v=r[u].clientRect,R=S.clientRect,re=u>s?1:-1,Le=this._getItemOffsetPx(v,R,re),nt=this._getSiblingOffsetPx(u,r,re),ot=r.slice();return vr(r,u,s),r.forEach((q,rt)=>{if(ot[rt]===q)return;let N=q.drag===o,wi=N?Le:nt,mn=N?o.getPlaceholderElement():q.drag.getRootElement();q.offset+=wi;let un=Math.round(q.offset*(1/q.drag.scale));d?(mn.style.transform=Ni(`translate3d(${un}px, 0, 0)`,q.initialTransform),Ut(q.clientRect,0,wi)):(mn.style.transform=Ni(`translate3d(0, ${un}px, 0)`,q.initialTransform),Ut(q.clientRect,wi,0));}),this._previousSwap.overlaps=on(R,e,t),this._previousSwap.drag=S.drag,this._previousSwap.delta=d?n.x:n.y,{previousIndex:u,currentIndex:s};}enter(o,e,t,n){let r=this._activeDraggables,s=r.indexOf(o),d=o.getPlaceholderElement();s>-1&&r.splice(s,1);let u=n==null||n<0?this._getItemIndexFromPointerPosition(o,e,t):n,S=r[u];if(S===o&&(S=r[u+1]),!S&&(u==null||u===-1||u<r.length-1)&&this._shouldEnterAsFirstChild(e,t)&&(S=r[0]),S&&!this._dragDropRegistry.isDragging(S)){let v=S.getRootElement();v.parentElement.insertBefore(d,v),r.splice(u,0,o);}else this._element.appendChild(d),r.push(o);d.style.transform="",this._cacheItemPositions();}withItems(o){this._activeDraggables=o.slice(),this._cacheItemPositions();}withSortPredicate(o){this._sortPredicate=o;}reset(){this._activeDraggables?.forEach(o=>{let e=o.getRootElement();if(e){let t=this._itemPositions.find(n=>n.drag===o)?.initialTransform;e.style.transform=t||"";}}),this._itemPositions=[],this._activeDraggables=[],this._previousSwap.drag=null,this._previousSwap.delta=0,this._previousSwap.overlaps=false;}getActiveItemsSnapshot(){return this._activeDraggables;}getItemIndex(o){return this._getVisualItemPositions().findIndex(e=>e.drag===o);}getItemAtIndex(o){return this._getVisualItemPositions()[o]?.drag||null;}updateOnScroll(o,e){this._itemPositions.forEach(({clientRect:t})=>{Ut(t,o,e);}),this._itemPositions.forEach(({drag:t})=>{this._dragDropRegistry.isDragging(t)&&t._sortFromLastPointerPosition();});}withElementContainer(o){this._element=o;}_cacheItemPositions(){let o=this.orientation==="horizontal";this._itemPositions=this._activeDraggables.map(e=>{let t=e.getVisibleElement();return{drag:e,offset:0,initialTransform:t.style.transform||"",clientRect:cn(t)};}).sort((e,t)=>o?e.clientRect.left-t.clientRect.left:e.clientRect.top-t.clientRect.top);}_getVisualItemPositions(){return this.orientation==="horizontal"&&this.direction==="rtl"?this._itemPositions.slice().reverse():this._itemPositions;}_getItemOffsetPx(o,e,t){let n=this.orientation==="horizontal",r=n?e.left-o.left:e.top-o.top;return t===-1&&(r+=n?e.width-o.width:e.height-o.height),r;}_getSiblingOffsetPx(o,e,t){let n=this.orientation==="horizontal",r=e[o].clientRect,s=e[o+t*-1],d=r[n?"width":"height"]*t;if(s){let u=n?"left":"top",S=n?"right":"bottom";t===-1?d-=s.clientRect[u]-r[S]:d+=r[u]-s.clientRect[S];}return d;}_shouldEnterAsFirstChild(o,e){if(!this._activeDraggables.length)return false;let t=this._itemPositions,n=this.orientation==="horizontal";if(t[0].drag!==this._activeDraggables[0]){let s=t[t.length-1].clientRect;return n?o>=s.right:e>=s.bottom;}else{let s=t[0].clientRect;return n?o<=s.left:e<=s.top;}}_getItemIndexFromPointerPosition(o,e,t,n){let r=this.orientation==="horizontal",s=this._itemPositions.findIndex(({drag:d,clientRect:u})=>{if(d===o)return false;if(n){let S=r?n.x:n.y;if(d===this._previousSwap.drag&&this._previousSwap.overlaps&&S===this._previousSwap.delta)return false;}return r?e>=Math.floor(u.left)&&e<Math.floor(u.right):t>=Math.floor(u.top)&&t<Math.floor(u.bottom);});return s===-1||!this._sortPredicate(s,o)?-1:s;}},sn=class{_document;_dragDropRegistry;_element;_sortPredicate;_rootNode;_activeItems;_previousSwap={drag:null,deltaX:0,deltaY:0,overlaps:false};_relatedNodes=[];constructor(o,e){this._document=o,this._dragDropRegistry=e;}start(o){let e=this._element.childNodes;this._relatedNodes=[];for(let t=0;t<e.length;t++){let n=e[t];this._relatedNodes.push([n,n.nextSibling]);}this.withItems(o);}sort(o,e,t,n){let r=this._getItemIndexFromPointerPosition(o,e,t),s=this._previousSwap;if(r===-1||this._activeItems[r]===o)return null;let d=this._activeItems[r];if(s.drag===d&&s.overlaps&&s.deltaX===n.x&&s.deltaY===n.y)return null;let u=this.getItemIndex(o),S=o.getPlaceholderElement(),v=d.getRootElement();r>u?v.after(S):v.before(S),vr(this._activeItems,u,r);let R=this._getRootNode().elementFromPoint(e,t);return s.deltaX=n.x,s.deltaY=n.y,s.drag=d,s.overlaps=v===R||v.contains(R),{previousIndex:u,currentIndex:r};}enter(o,e,t,n){let r=this._activeItems.indexOf(o);r>-1&&this._activeItems.splice(r,1);let s=n==null||n<0?this._getItemIndexFromPointerPosition(o,e,t):n;s===-1&&(s=this._getClosestItemIndexToPointer(o,e,t));let d=this._activeItems[s];d&&!this._dragDropRegistry.isDragging(d)?(this._activeItems.splice(s,0,o),d.getRootElement().before(o.getPlaceholderElement())):(this._activeItems.push(o),this._element.appendChild(o.getPlaceholderElement()));}withItems(o){this._activeItems=o.slice();}withSortPredicate(o){this._sortPredicate=o;}reset(){let o=this._element,e=this._previousSwap;for(let t=this._relatedNodes.length-1;t>-1;t--){let[n,r]=this._relatedNodes[t];n.parentNode===o&&n.nextSibling!==r&&(r===null?o.appendChild(n):r.parentNode===o&&o.insertBefore(n,r));}this._relatedNodes=[],this._activeItems=[],e.drag=null,e.deltaX=e.deltaY=0,e.overlaps=false;}getActiveItemsSnapshot(){return this._activeItems;}getItemIndex(o){return this._activeItems.indexOf(o);}getItemAtIndex(o){return this._activeItems[o]||null;}updateOnScroll(){this._activeItems.forEach(o=>{this._dragDropRegistry.isDragging(o)&&o._sortFromLastPointerPosition();});}withElementContainer(o){o!==this._element&&(this._element=o,this._rootNode=void 0);}_getItemIndexFromPointerPosition(o,e,t){let n=this._getRootNode().elementFromPoint(Math.floor(e),Math.floor(t)),r=n?this._activeItems.findIndex(s=>{let d=s.getRootElement();return n===d||d.contains(n);}):-1;return r===-1||!this._sortPredicate(r,o)?-1:r;}_getRootNode(){return this._rootNode||(this._rootNode=R(this._element)||this._document),this._rootNode;}_getClosestItemIndexToPointer(o,e,t){if(this._activeItems.length===0)return-1;if(this._activeItems.length===1)return 0;let n=1/0,r=-1;for(let s=0;s<this._activeItems.length;s++){let d=this._activeItems[s];if(d!==o){let{x:u,y:S}=d.getRootElement().getBoundingClientRect(),v=Math.hypot(e-u,t-S);v<n&&(n=v,r=s);}}return r;}},gr=.05,Er=.05,ye=function(i){return i[i.NONE=0]="NONE",i[i.UP=1]="UP",i[i.DOWN=2]="DOWN",i;}(ye||{}),ae=function(i){return i[i.NONE=0]="NONE",i[i.LEFT=1]="LEFT",i[i.RIGHT=2]="RIGHT",i;}(ae||{});function Mr(i,o){return new ln(o,i.get(_n),i.get(Ce),i.get(ie),i.get(Ji));}var ln=class{_dragDropRegistry;_ngZone;_viewportRuler;element;disabled=false;sortingDisabled=false;lockAxis=null;autoScrollDisabled=false;autoScrollStep=2;hasAnchor=false;enterPredicate=()=>true;sortPredicate=()=>true;beforeStarted=new X();entered=new X();exited=new X();dropped=new X();sorted=new X();receivingStarted=new X();receivingStopped=new X();data;_container;_isDragging=false;_parentPositions;_sortStrategy;_domRect;_draggables=[];_siblings=[];_activeSiblings=new Set();_viewportScrollSubscription=Fe.EMPTY;_verticalScrollDirection=ye.NONE;_horizontalScrollDirection=ae.NONE;_scrollNode;_stopScrollTimers=new X();_cachedShadowRoot=null;_document;_scrollableElements=[];_initialScrollSnap;_direction="ltr";constructor(o,e,t,n,r){this._dragDropRegistry=e,this._ngZone=n,this._viewportRuler=r;let s=this.element=le(o);this._document=t,this.withOrientation("vertical").withElementContainer(s),e.registerDropContainer(this),this._parentPositions=new Ai(t);}dispose(){this._stopScrolling(),this._stopScrollTimers.complete(),this._viewportScrollSubscription.unsubscribe(),this.beforeStarted.complete(),this.entered.complete(),this.exited.complete(),this.dropped.complete(),this.sorted.complete(),this.receivingStarted.complete(),this.receivingStopped.complete(),this._activeSiblings.clear(),this._scrollNode=null,this._parentPositions.clear(),this._dragDropRegistry.removeDropContainer(this);}isDragging(){return this._isDragging;}start(){this._draggingStarted(),this._notifyReceivingSiblings();}enter(o,e,t,n){this._draggingStarted(),n==null&&this.sortingDisabled&&(n=this._draggables.indexOf(o)),this._sortStrategy.enter(o,e,t,n),this._cacheParentPositions(),this._notifyReceivingSiblings(),this.entered.next({item:o,container:this,currentIndex:this.getItemIndex(o)});}exit(o){this._reset(),this.exited.next({item:o,container:this});}drop(o,e,t,n,r,s,d,u){this._reset(),this.dropped.next({item:o,currentIndex:e,previousIndex:t,container:this,previousContainer:n,isPointerOverContainer:r,distance:s,dropPoint:d,event:u});}withItems(o){let e=this._draggables;return this._draggables=o,o.forEach(t=>t._withDropContainer(this)),this.isDragging()&&(e.filter(n=>n.isDragging()).every(n=>o.indexOf(n)===-1)?this._reset():this._sortStrategy.withItems(this._draggables)),this;}withDirection(o){return this._direction=o,this._sortStrategy instanceof Li&&(this._sortStrategy.direction=o),this;}connectedTo(o){return this._siblings=o.slice(),this;}withOrientation(o){if(o==="mixed")this._sortStrategy=new sn(this._document,this._dragDropRegistry);else{let e=new Li(this._dragDropRegistry);e.direction=this._direction,e.orientation=o,this._sortStrategy=e;}return this._sortStrategy.withElementContainer(this._container),this._sortStrategy.withSortPredicate((e,t)=>this.sortPredicate(e,t,this)),this;}withScrollableParents(o){let e=this._container;return this._scrollableElements=o.indexOf(e)===-1?[e,...o]:o.slice(),this;}withElementContainer(o){if(o===this._container)return this;le(this.element);let t=this._scrollableElements.indexOf(this._container),n=this._scrollableElements.indexOf(o);return t>-1&&this._scrollableElements.splice(t,1),n>-1&&this._scrollableElements.splice(n,1),this._sortStrategy&&this._sortStrategy.withElementContainer(o),this._cachedShadowRoot=null,this._scrollableElements.unshift(o),this._container=o,this;}getScrollableParents(){return this._scrollableElements;}getItemIndex(o){return this._isDragging?this._sortStrategy.getItemIndex(o):this._draggables.indexOf(o);}getItemAtIndex(o){return this._isDragging?this._sortStrategy.getItemAtIndex(o):this._draggables[o]||null;}isReceiving(){return this._activeSiblings.size>0;}_sortItem(o,e,t,n){if(this.sortingDisabled||!this._domRect||!ar(this._domRect,gr,e,t))return;let r=this._sortStrategy.sort(o,e,t,n);r&&this.sorted.next({previousIndex:r.previousIndex,currentIndex:r.currentIndex,container:this,item:o});}_startScrollingIfNecessary(o,e){if(this.autoScrollDisabled)return;let t,n=ye.NONE,r=ae.NONE;if(this._parentPositions.positions.forEach((s,d)=>{d===this._document||!s.clientRect||t||ar(s.clientRect,gr,o,e)&&([n,r]=Ns(d,s.clientRect,this._direction,o,e),(n||r)&&(t=d));}),!n&&!r){let{width:s,height:d}=this._viewportRuler.getViewportSize(),u={width:s,height:d,top:0,right:s,bottom:d,left:0};n=Pr(u,e),r=Ir(u,o),t=window;}t&&(n!==this._verticalScrollDirection||r!==this._horizontalScrollDirection||t!==this._scrollNode)&&(this._verticalScrollDirection=n,this._horizontalScrollDirection=r,this._scrollNode=t,(n||r)&&t?this._ngZone.runOutsideAngular(this._startScrollInterval):this._stopScrolling());}_stopScrolling(){this._stopScrollTimers.next();}_draggingStarted(){let o=this._container.style;this.beforeStarted.next(),this._isDragging=true,this._initialScrollSnap=o.msScrollSnapType||o.scrollSnapType||"",o.scrollSnapType=o.msScrollSnapType="none",this._sortStrategy.start(this._draggables),this._cacheParentPositions(),this._viewportScrollSubscription.unsubscribe(),this._listenToScrollEvents();}_cacheParentPositions(){this._parentPositions.cache(this._scrollableElements),this._domRect=this._parentPositions.positions.get(this._container).clientRect;}_reset(){this._isDragging=false;let o=this._container.style;o.scrollSnapType=o.msScrollSnapType=this._initialScrollSnap,this._siblings.forEach(e=>e._stopReceiving(this)),this._sortStrategy.reset(),this._stopScrolling(),this._viewportScrollSubscription.unsubscribe(),this._parentPositions.clear();}_startScrollInterval=()=>{this._stopScrolling(),j1(0,M1).pipe(Gc(this._stopScrollTimers)).subscribe(()=>{let o=this._scrollNode,e=this.autoScrollStep;this._verticalScrollDirection===ye.UP?o.scrollBy(0,-e):this._verticalScrollDirection===ye.DOWN&&o.scrollBy(0,e),this._horizontalScrollDirection===ae.LEFT?o.scrollBy(-e,0):this._horizontalScrollDirection===ae.RIGHT&&o.scrollBy(e,0);});};_isOverContainer(o,e){return this._domRect!=null&&on(this._domRect,o,e);}_getSiblingContainerFromPosition(o,e,t){return this._siblings.find(n=>n._canReceive(o,e,t));}_canReceive(o,e,t){if(!this._domRect||!on(this._domRect,e,t)||!this.enterPredicate(o,this))return false;let n=this._getShadowRoot().elementFromPoint(e,t);return n?n===this._container||this._container.contains(n):false;}_startReceiving(o,e){let t=this._activeSiblings;!t.has(o)&&e.every(n=>this.enterPredicate(n,this)||this._draggables.indexOf(n)>-1)&&(t.add(o),this._cacheParentPositions(),this._listenToScrollEvents(),this.receivingStarted.next({initiator:o,receiver:this,items:e}));}_stopReceiving(o){this._activeSiblings.delete(o),this._viewportScrollSubscription.unsubscribe(),this.receivingStopped.next({initiator:o,receiver:this});}_listenToScrollEvents(){this._viewportScrollSubscription=this._dragDropRegistry.scrolled(this._getShadowRoot()).subscribe(o=>{if(this.isDragging()){let e=this._parentPositions.handleScroll(o);e&&this._sortStrategy.updateOnScroll(e.top,e.left);}else this.isReceiving()&&this._cacheParentPositions();});}_getShadowRoot(){if(!this._cachedShadowRoot){let o=R(this._container);this._cachedShadowRoot=o||this._document;}return this._cachedShadowRoot;}_notifyReceivingSiblings(){let o=this._sortStrategy.getActiveItemsSnapshot().filter(e=>e.isDragging());this._siblings.forEach(e=>e._startReceiving(this,o));}};function Pr(i,o){let{top:e,bottom:t,height:n}=i,r=n*Er;return o>=e-r&&o<=e+r?ye.UP:o>=t-r&&o<=t+r?ye.DOWN:ye.NONE;}function Ir(i,o){let{left:e,right:t,width:n}=i,r=n*Er;return o>=e-r&&o<=e+r?ae.LEFT:o>=t-r&&o<=t+r?ae.RIGHT:ae.NONE;}function Ns(i,o,e,t,n){let r=Pr(o,n),s=Ir(o,t),d=ye.NONE,u=ae.NONE;if(r){let S=i.scrollTop;r===ye.UP?S>0&&(d=ye.UP):i.scrollHeight-S>i.clientHeight&&(d=ye.DOWN);}if(s){let S=i.scrollLeft;e==="rtl"?s===ae.RIGHT?S<0&&(u=ae.RIGHT):i.scrollWidth+S>i.clientWidth&&(u=ae.LEFT):s===ae.LEFT?S>0&&(u=ae.LEFT):i.scrollWidth-S>i.clientWidth&&(u=ae.RIGHT);}return[d,u];}var Ls=(()=>{class i{_injector=g(Et);createDrag(e,t){return yr(this._injector,e,t);}createDropList(e){return Mr(this._injector,e);}static ɵfac=function(t){return new(t||i)();};static ɵprov=be({token:i,factory:i.ɵfac});}return i;})(),fr=new A$1("CDK_DRAG_PARENT");var Ds=new A$1("CdkDragHandle");var Tr=new A$1("CDK_DRAG_CONFIG"),Or=new A$1("CdkDropList"),Rr=(()=>{class i{element=g(Mn);dropContainer=g(Or,{optional:true,skipSelf:true});_ngZone=g(ie);_viewContainerRef=g(Ur$1);_dir=g(z$1,{optional:true});_changeDetectorRef=g(Cs$1);_selfHandle=g(Ds,{optional:true,self:true});_parentDrag=g(fr,{optional:true,skipSelf:true});_dragDropRegistry=g(_n);_destroyed=new X();_handles=new It([]);_previewTemplate=null;_placeholderTemplate=null;_dragRef;data;lockAxis=null;rootElementSelector;boundaryElement;dragStartDelay;freeDragPosition;get disabled(){return this._disabled||!!(this.dropContainer&&this.dropContainer.disabled);}set disabled(e){this._disabled=e,this._dragRef.disabled=this._disabled;}_disabled=false;constrainPosition;previewClass;previewContainer;scale=1;started=new kt();released=new kt();ended=new kt();entered=new kt();exited=new kt();dropped=new kt();moved=new W(e=>{let t=this._dragRef.moved.pipe($(n=>({source:this,pointerPosition:n.pointerPosition,event:n.event,delta:n.delta,distance:n.distance}))).subscribe(e);return()=>{t.unsubscribe();};});_injector=g(Et);constructor(){let e=this.dropContainer,t=g(Tr,{optional:true});this._dragRef=yr(this._injector,this.element,{dragStartThreshold:t&&t.dragStartThreshold!=null?t.dragStartThreshold:5,pointerDirectionChangeThreshold:t&&t.pointerDirectionChangeThreshold!=null?t.pointerDirectionChangeThreshold:5,zIndex:t?.zIndex}),this._dragRef.data=this,this._dragDropRegistry.registerDirectiveNode(this.element.nativeElement,this),t&&this._assignDefaults(t),e&&(e.addItem(this),e._dropListRef.beforeStarted.pipe(Gc(this._destroyed)).subscribe(()=>{this._dragRef.scale=this.scale;})),this._syncInputs(this._dragRef),this._handleEvents(this._dragRef);}getPlaceholderElement(){return this._dragRef.getPlaceholderElement();}getRootElement(){return this._dragRef.getRootElement();}reset(){this._dragRef.reset();}resetToBoundary(){this._dragRef.resetToBoundary();}getFreeDragPosition(){return this._dragRef.getFreeDragPosition();}setFreeDragPosition(e){this._dragRef.setFreeDragPosition(e);}ngAfterViewInit(){Gu(()=>{this._updateRootElement(),this._setupHandlesListener(),this._dragRef.scale=this.scale,this.freeDragPosition&&this._dragRef.setFreeDragPosition(this.freeDragPosition);},{injector:this._injector});}ngOnChanges(e){let t=e.rootElementSelector,n=e.freeDragPosition;t&&!t.firstChange&&this._updateRootElement(),this._dragRef.scale=this.scale,n&&!n.firstChange&&this.freeDragPosition&&this._dragRef.setFreeDragPosition(this.freeDragPosition);}ngOnDestroy(){this.dropContainer&&this.dropContainer.removeItem(this),this._dragDropRegistry.removeDirectiveNode(this.element.nativeElement),this._ngZone.runOutsideAngular(()=>{this._handles.complete(),this._destroyed.next(),this._destroyed.complete(),this._dragRef.dispose();});}_addHandle(e){let t=this._handles.getValue();t.push(e),this._handles.next(t);}_removeHandle(e){let t=this._handles.getValue(),n=t.indexOf(e);n>-1&&(t.splice(n,1),this._handles.next(t));}_setPreviewTemplate(e){this._previewTemplate=e;}_resetPreviewTemplate(e){e===this._previewTemplate&&(this._previewTemplate=null);}_setPlaceholderTemplate(e){this._placeholderTemplate=e;}_resetPlaceholderTemplate(e){e===this._placeholderTemplate&&(this._placeholderTemplate=null);}_updateRootElement(){let e=this.element.nativeElement,t=e;this.rootElementSelector&&(t=e.closest!==void 0?e.closest(this.rootElementSelector):e.parentElement?.closest(this.rootElementSelector)),this._dragRef.withRootElement(t||e);}_getBoundaryElement(){let e=this.boundaryElement;return e?typeof e=="string"?this.element.nativeElement.closest(e):le(e):null;}_syncInputs(e){e.beforeStarted.subscribe(()=>{if(!e.isDragging()){let t=this._dir,n=this.dragStartDelay,r=this._placeholderTemplate?{template:this._placeholderTemplate.templateRef,context:this._placeholderTemplate.data,viewContainer:this._viewContainerRef}:null,s=this._previewTemplate?{template:this._previewTemplate.templateRef,context:this._previewTemplate.data,matchSize:this._previewTemplate.matchSize,viewContainer:this._viewContainerRef}:null;e.disabled=this.disabled,e.lockAxis=this.lockAxis,e.scale=this.scale,e.dragStartDelay=typeof n=="object"&&n?n:ae$2(n),e.constrainPosition=this.constrainPosition,e.previewClass=this.previewClass,e.withBoundaryElement(this._getBoundaryElement()).withPlaceholderTemplate(r).withPreviewTemplate(s).withPreviewContainer(this.previewContainer||"global"),t&&e.withDirection(t.value);}}),e.beforeStarted.pipe(Dn(1)).subscribe(()=>{if(this._parentDrag){e.withParent(this._parentDrag._dragRef);return;}let t=this.element.nativeElement.parentElement;for(;t;){let n=this._dragDropRegistry.getDragDirectiveForNode(t);if(n){e.withParent(n._dragRef);break;}t=t.parentElement;}});}_handleEvents(e){e.started.subscribe(t=>{this.started.emit({source:this,event:t.event}),this._changeDetectorRef.markForCheck();}),e.released.subscribe(t=>{this.released.emit({source:this,event:t.event});}),e.ended.subscribe(t=>{this.ended.emit({source:this,distance:t.distance,dropPoint:t.dropPoint,event:t.event}),this._changeDetectorRef.markForCheck();}),e.entered.subscribe(t=>{this.entered.emit({container:t.container.data,item:this,currentIndex:t.currentIndex});}),e.exited.subscribe(t=>{this.exited.emit({container:t.container.data,item:this});}),e.dropped.subscribe(t=>{this.dropped.emit({previousIndex:t.previousIndex,currentIndex:t.currentIndex,previousContainer:t.previousContainer.data,container:t.container.data,isPointerOverContainer:t.isPointerOverContainer,item:this,distance:t.distance,dropPoint:t.dropPoint,event:t.event});});}_assignDefaults(e){let{lockAxis:t,dragStartDelay:n,constrainPosition:r,previewClass:s,boundaryElement:d,draggingDisabled:u,rootElementSelector:S,previewContainer:v}=e;this.disabled=u??false,this.dragStartDelay=n||0,this.lockAxis=t||null,r&&(this.constrainPosition=r),s&&(this.previewClass=s),d&&(this.boundaryElement=d),S&&(this.rootElementSelector=S),v&&(this.previewContainer=v);}_setupHandlesListener(){this._handles.pipe(lt(e=>{let t=e.map(n=>n.element);this._selfHandle&&this.rootElementSelector&&t.push(this.element),this._dragRef.withHandles(t);}),Oe(e=>V1(...e.map(t=>t._stateChanges.pipe(Wd(t))))),Gc(this._destroyed)).subscribe(e=>{let t=this._dragRef,n=e.element.nativeElement;e.disabled?t.disableHandle(n):t.enableHandle(n);});}static ɵfac=function(t){return new(t||i)();};static ɵdir=sn$1({type:i,selectors:[["","cdkDrag",""]],hostAttrs:[1,"cdk-drag"],hostVars:4,hostBindings:function(t,n){t&2&&Ex("cdk-drag-disabled",n.disabled)("cdk-drag-dragging",n._dragRef.isDragging());},inputs:{data:[0,"cdkDragData","data"],lockAxis:[0,"cdkDragLockAxis","lockAxis"],rootElementSelector:[0,"cdkDragRootElement","rootElementSelector"],boundaryElement:[0,"cdkDragBoundary","boundaryElement"],dragStartDelay:[0,"cdkDragStartDelay","dragStartDelay"],freeDragPosition:[0,"cdkDragFreeDragPosition","freeDragPosition"],disabled:[2,"cdkDragDisabled","disabled",tl$1],constrainPosition:[0,"cdkDragConstrainPosition","constrainPosition"],previewClass:[0,"cdkDragPreviewClass","previewClass"],previewContainer:[0,"cdkDragPreviewContainer","previewContainer"],scale:[2,"cdkDragScale","scale",e3]},outputs:{started:"cdkDragStarted",released:"cdkDragReleased",ended:"cdkDragEnded",entered:"cdkDragEntered",exited:"cdkDragExited",dropped:"cdkDragDropped",moved:"cdkDragMoved"},exportAs:["cdkDrag"],features:[u$([{provide:fr,useExisting:i}]),ti]});}return i;})(),Cr=new A$1("CdkDropListGroup");var br=(()=>{class i{element=g(Mn);_changeDetectorRef=g(Cs$1);_scrollDispatcher=g(tr);_dir=g(z$1,{optional:true});_group=g(Cr,{optional:true,skipSelf:true});_latestSortedRefs;_destroyed=new X();_scrollableParentsResolved=false;static _dropLists=[];_dropListRef;connectedTo=[];data;orientation="vertical";id=g(N).getId("cdk-drop-list-");lockAxis=null;get disabled(){return this._disabled||!!this._group&&this._group.disabled;}set disabled(e){this._dropListRef.disabled=this._disabled=e;}_disabled=false;sortingDisabled=false;enterPredicate=()=>true;sortPredicate=()=>true;autoScrollDisabled=false;autoScrollStep;elementContainerSelector=null;hasAnchor=false;dropped=new kt();entered=new kt();exited=new kt();sorted=new kt();_unsortedItems=new Set();constructor(){let e=g(Tr,{optional:true}),t=g(Et);this._dropListRef=Mr(t,this.element),this._dropListRef.data=this,e&&this._assignDefaults(e),this._dropListRef.enterPredicate=(n,r)=>this.enterPredicate(n.data,r.data),this._dropListRef.sortPredicate=(n,r,s)=>this.sortPredicate(n,r.data,s.data),this._setupInputSyncSubscription(this._dropListRef),this._handleEvents(this._dropListRef),i._dropLists.push(this),this._group&&this._group._items.add(this);}addItem(e){this._unsortedItems.add(e),e._dragRef._withDropContainer(this._dropListRef),this._dropListRef.isDragging()&&this._syncItemsWithRef(this.getSortedItems().map(t=>t._dragRef));}removeItem(e){if(this._unsortedItems.delete(e),this._latestSortedRefs){let t=this._latestSortedRefs.indexOf(e._dragRef);t>-1&&(this._latestSortedRefs.splice(t,1),this._syncItemsWithRef(this._latestSortedRefs));}}getSortedItems(){return Array.from(this._unsortedItems).sort((e,t)=>e._dragRef.getVisibleElement().compareDocumentPosition(t._dragRef.getVisibleElement())&Node.DOCUMENT_POSITION_FOLLOWING?-1:1);}ngOnDestroy(){let e=i._dropLists.indexOf(this);e>-1&&i._dropLists.splice(e,1),this._group&&this._group._items.delete(this),this._latestSortedRefs=void 0,this._unsortedItems.clear(),this._dropListRef.dispose(),this._destroyed.next(),this._destroyed.complete();}_setupInputSyncSubscription(e){this._dir&&this._dir.change.pipe(Wd(this._dir.value),Gc(this._destroyed)).subscribe(t=>e.withDirection(t)),e.beforeStarted.subscribe(()=>{let t=nt(this.connectedTo).map(n=>{if(typeof n=="string"){let r=i._dropLists.find(s=>s.id===n);return r;}return n;});if(this._group&&this._group._items.forEach(n=>{t.indexOf(n)===-1&&t.push(n);}),!this._scrollableParentsResolved){let n=this._scrollDispatcher.getAncestorScrollContainers(this.element).map(r=>r.getElementRef().nativeElement);this._dropListRef.withScrollableParents(n),this._scrollableParentsResolved=true;}if(this.elementContainerSelector){let n=this.element.nativeElement.querySelector(this.elementContainerSelector);e.withElementContainer(n);}e.disabled=this.disabled,e.lockAxis=this.lockAxis,e.sortingDisabled=this.sortingDisabled,e.autoScrollDisabled=this.autoScrollDisabled,e.autoScrollStep=ae$2(this.autoScrollStep,2),e.hasAnchor=this.hasAnchor,e.connectedTo(t.filter(n=>n&&n!==this).map(n=>n._dropListRef)).withOrientation(this.orientation);});}_handleEvents(e){e.beforeStarted.subscribe(()=>{this._syncItemsWithRef(this.getSortedItems().map(t=>t._dragRef)),this._changeDetectorRef.markForCheck();}),e.entered.subscribe(t=>{this.entered.emit({container:this,item:t.item.data,currentIndex:t.currentIndex});}),e.exited.subscribe(t=>{this.exited.emit({container:this,item:t.item.data}),this._changeDetectorRef.markForCheck();}),e.sorted.subscribe(t=>{this.sorted.emit({previousIndex:t.previousIndex,currentIndex:t.currentIndex,container:this,item:t.item.data});}),e.dropped.subscribe(t=>{this.dropped.emit({previousIndex:t.previousIndex,currentIndex:t.currentIndex,previousContainer:t.previousContainer.data,container:t.container.data,item:t.item.data,isPointerOverContainer:t.isPointerOverContainer,distance:t.distance,dropPoint:t.dropPoint,event:t.event}),this._changeDetectorRef.markForCheck();}),V1(e.receivingStarted,e.receivingStopped).subscribe(()=>this._changeDetectorRef.markForCheck());}_assignDefaults(e){let{lockAxis:t,draggingDisabled:n,sortingDisabled:r,listAutoScrollDisabled:s,listOrientation:d}=e;this.disabled=n??false,this.sortingDisabled=r??false,this.autoScrollDisabled=s??false,this.orientation=d||"vertical",this.lockAxis=t||null;}_syncItemsWithRef(e){this._latestSortedRefs=e,this._dropListRef.withItems(e);}static ɵfac=function(t){return new(t||i)();};static ɵdir=sn$1({type:i,selectors:[["","cdkDropList",""],["cdk-drop-list"]],hostAttrs:[1,"cdk-drop-list"],hostVars:7,hostBindings:function(t,n){t&2&&(Lp("id",n.id),Ex("cdk-drop-list-disabled",n.disabled)("cdk-drop-list-dragging",n._dropListRef.isDragging())("cdk-drop-list-receiving",n._dropListRef.isReceiving()));},inputs:{connectedTo:[0,"cdkDropListConnectedTo","connectedTo"],data:[0,"cdkDropListData","data"],orientation:[0,"cdkDropListOrientation","orientation"],id:"id",lockAxis:[0,"cdkDropListLockAxis","lockAxis"],disabled:[2,"cdkDropListDisabled","disabled",tl$1],sortingDisabled:[2,"cdkDropListSortingDisabled","sortingDisabled",tl$1],enterPredicate:[0,"cdkDropListEnterPredicate","enterPredicate"],sortPredicate:[0,"cdkDropListSortPredicate","sortPredicate"],autoScrollDisabled:[2,"cdkDropListAutoScrollDisabled","autoScrollDisabled",tl$1],autoScrollStep:[0,"cdkDropListAutoScrollStep","autoScrollStep"],elementContainerSelector:[0,"cdkDropListElementContainer","elementContainerSelector"],hasAnchor:[2,"cdkDropListHasAnchor","hasAnchor",tl$1]},outputs:{dropped:"cdkDropListDropped",entered:"cdkDropListEntered",exited:"cdkDropListExited",sorted:"cdkDropListSorted"},exportAs:["cdkDropList"],features:[u$([{provide:Cr,useValue:void 0},{provide:Or,useExisting:i}])]});}return i;})();var Ar=(()=>{class i{static ɵfac=function(t){return new(t||i)();};static ɵmod=Ln({type:i});static ɵinj=mn({providers:[Ls],imports:[ir]});}return i;})();var ws=["videoShareModal"];function xs(i,o){if(i&1&&Pp(0,"my-video-playlist-miniature",7),i&2){let e=SV();H0("playlist",e.playlist);}}function Ys(i,o){if(i&1&&Pp(0,"my-action-dropdown",10),i&2){let e=SV();H0("entry",e.playlist)("actions",e.playlistActions);}}function Vs(i,o){i&1&&(sp(0,"div",12)(1,"div"),vV(2,2),lb(),sp(3,"div"),vV(4,3),lb(),sp(5,"div"),sx(6,4),Pp(7,"a",16),ax(),lb()());}function $s(i,o){if(i&1){let e=F2();sp(0,"div",14)(1,"my-video-playlist-element-miniature",17),Fp("elementRemoved",function(n){GI(e);let r=SV();return zI(r.onElementRemoved(n));}),lb()();}if(i&2){let e=o.$implicit,t=SV();H0("cdkDragStartDelay",t.getDragStartDelay()),WB(),H0("playlistElement",e)("playlist",t.playlist)("owned",true)("position",e.position);}}var Nr=(()=>{class i{hooks=g(Pk);notifier=g(rc$1);router=g(mt);confirmService=g(cg);route=g(Vr$1);screenService=g(hg);videoPlaylistService=g(Z);videoShareModal=xpe("videoShareModal");errored=false;playlistElements=[];playlist;playlistActions=[];pagination={currentPage:1,itemsPerPage:10,totalItems:null};onDataSubject=new X();videoPlaylistId;paramsSub;ngOnInit(){this.playlistActions=[[{label:"\u66F4\u65B0\u64AD\u653E\u5217\u8868",iconName:"edit",linkBuilder:e=>["/my-library","video-playlists","update",e.shortUUID]},{label:"\u5220\u9664\u64AD\u653E\u5217\u8868",iconName:"delete",handler:e=>this.deleteVideoPlaylist(e)}]],this.paramsSub=this.route.params.subscribe(e=>{this.videoPlaylistId=e.videoPlaylistId,this.loadElements(),this.loadPlaylistInfo();});}ngOnDestroy(){this.paramsSub&&this.paramsSub.unsubscribe();}drop(e){let t=e.previousIndex,n=e.currentIndex;if(t===n)return;let r=this.playlistElements[t].position,s=this.playlistElements[n].position;r>s&&s--;let d=this.playlistElements[t];this.playlistElements.splice(t,1),this.playlistElements.splice(n,0,d),this.videoPlaylistService.reorderVideosOfPlaylist(this.playlist.id,r,s).subscribe({next:()=>{this.reorderClientPositions();},error:u=>this.notifier.handleError(u)});}onElementRemoved(e){let t=this.findFirst();this.playlistElements=this.playlistElements.filter(n=>n.id!==e.id),Cje(this.pagination),this.reorderClientPositions(t);}onNearOfBottom(){this.pagination.totalItems<=this.pagination.currentPage*this.pagination.itemsPerPage||(this.pagination.currentPage+=1,this.loadElements());}trackByFn(e,t){return t.id;}isRegularPlaylist(e){return e?.type.id===uIe.REGULAR;}showShareModal(){this.videoShareModal().show();}deleteVideoPlaylist(e){return L(this,null,function*(){(yield this.confirmService.confirm("\u4F60\u786E\u5B9A\u8981\u5220\u9664 "+e.displayName+" \u5417\uFF1F ","\u5220\u9664"))!==false&&this.videoPlaylistService.removeVideoPlaylist(e).subscribe({next:()=>{this.router.navigate(["/my-library","video-playlists"]),this.notifier.success("\u64AD\u653E\u5217\u8868 "+e.displayName+" \u5DF2\u5220\u9664\u3002");},error:n=>this.notifier.handleError(n)});});}getDragStartDelay(){return this.screenService.isInTouchScreen()?500:null;}loadElements(){this.hooks.wrapObsFun(this.videoPlaylistService.getPlaylistVideos.bind(this.videoPlaylistService),{videoPlaylistId:this.videoPlaylistId,componentPagination:this.pagination},"my-library","filter:api.my-library.video-playlist-elements.list.params","filter:api.my-library.video-playlist-elements.list.result").subscribe({next:({total:e,data:t})=>{this.playlistElements=this.playlistElements.concat(t),this.pagination.totalItems=e,this.onDataSubject.next(t);},error:e=>{this.errored||(this.notifier.handleError(e),this.errored=true);}});}loadPlaylistInfo(){this.videoPlaylistService.getVideoPlaylist(this.videoPlaylistId).subscribe({next:e=>{this.playlist=e;},error:e=>{this.errored||(this.notifier.handleError(e),this.errored=true);}});}reorderClientPositions(e){if(this.playlistElements.length===0)return;let t=e||this.findFirst(),n=1;for(let s of this.playlistElements)s.position=n,n++;let r=this.findFirst();t&&r&&t.id!==r.id&&this.loadPlaylistInfo();}findFirst(){return this.playlistElements.find(e=>e.position===1);}static ɵfac=function(t){return new(t||i)();};static ɵcmp=Pa$1({type:i,selectors:[["ng-component"]],viewQuery:function(t,n){t&1&&px(n.videoShareModal,ws,5),t&2&&IV();},decls:14,vars:5,consts:()=>{let e;e="\u5206\u4EAB";let t;t="\u64AD\u653E\u5217\u8868\u4E2D\u6CA1\u6709\u89C6\u9891\u3002";let n;n="\u6D4F\u89C8 PeerTube \u4E0A\u7684\u89C6\u9891\uFF0C\u5E76\u5C06\u5B83\u4EEC\u6DFB\u52A0\u5230\u60A8\u7684\u64AD\u653E\u5217\u8868\u4E2D\u3002";let r;return r="\u8BE6\u89C1"+"\uFFFD#7\uFFFD"+"\u6587\u6863"+"\uFFFD/#7\uFFFD"+"\u4E86\u89E3\u66F4\u591A\u4FE1\u606F\u3002",[["videoShareModal",""],e,t,n,r,[1,"root"],[1,"playlist-info"],["toManage","false","displayChannel","true","displayDescription","true","displayPrivacy","true",3,"playlist"],[1,"playlist-buttons"],["icon","share",1,"me-3",3,"click"],["label","More",3,"entry","actions"],[1,"playlist-elements"],[1,"no-results"],["myInfiniteScroller","","cdkDropList","",1,"videos",3,"nearOfBottom","cdkDropListDropped","dataObservable"],["cdkDrag","",1,"video",3,"cdkDragStartDelay"],[3,"playlist"],["target","_blank","href","https://docs.joinpeertube.org/use/library#playlist"],[3,"elementRemoved","playlistElement","playlist","owned","position"]];},template:function(t,n){t&1&&(sp(0,"div",5)(1,"div",6),w2(2,xs,1,1,"my-video-playlist-miniature",7),sp(3,"div",8)(4,"my-button",9),Fp("click",function(){return n.showShareModal();}),vV(5,1),lb(),w2(6,Ys,1,2,"my-action-dropdown",10),lb()(),sp(7,"div",11),w2(8,Vs,8,0,"div",12),sp(9,"div",13),Fp("nearOfBottom",function(){return n.onNearOfBottom();})("cdkDropListDropped",function(s){return n.drop(s);}),N2(10,$s,2,5,"div",14,n.trackByFn,true),lb()()(),Pp(12,"my-video-share",15,0)),t&2&&(WB(2),x2(n.playlist?2:-1),WB(4),x2(n.isRegularPlaylist(n.playlist)?6:-1),WB(2),x2(n.pagination.totalItems===0?8:-1),WB(),H0("dataObservable",n.onDataSubject.asObservable()),WB(),M2(n.playlistElements),WB(2),H0("playlist",n.playlist));},dependencies:[it,Q,Un,L$2,br,Rr,Bi,Ri],styles:[".root[_ngcontent-%COMP%]{display:grid;grid-template-columns:auto 1fr}.playlist-info[_ngcontent-%COMP%]{grid-column:1;display:flex;flex-direction:column;margin-inline-end:1rem}.playlist-buttons[_ngcontent-%COMP%]{display:flex;margin:30px 0 10px}.cdk-drag-preview[_ngcontent-%COMP%]{box-sizing:border-box;border-radius:4px;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-placeholder[_ngcontent-%COMP%]{opacity:0}.cdk-drag-animating[_ngcontent-%COMP%]{transition:transform .25s cubic-bezier(0,0,.2,1)}.video[_ngcontent-%COMP%]:last-child{border:0}.videos.cdk-drop-list-dragging[_ngcontent-%COMP%]   .video[_ngcontent-%COMP%]:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}.playlist-elements[_ngcontent-%COMP%]{grid-column:2}my-video-playlist-miniature[_ngcontent-%COMP%]{width:280px}@media screen and (max-width:800px){my-video-playlist-miniature[_ngcontent-%COMP%]{width:201px}}@media screen and (max-width:500px){.root[_ngcontent-%COMP%]{display:block}.playlist-info[_ngcontent-%COMP%]{width:calc(100% + 2 * var(--x-margin-content));padding-top:20px;margin-bottom:10px}my-video-playlist-miniature[_ngcontent-%COMP%], .playlist-buttons[_ngcontent-%COMP%]{margin-inline-start:auto;margin-inline-end:auto}  my-video-playlist-element-miniature .video{padding:5px!important}  my-video-playlist-element-miniature .position{margin-inline-end:.3125rem!important}}"],changeDetection:1});}return i;})();var ks=i=>({"input-error":i}),Fs=i=>["/my-library/video-playlists/update",i];function Bs(i,o){if(i&1&&(sp(0,"my-alert",14),XV(1),lb()),i&2){let e=SV();WB(),xx(e.error);}}function zs(i,o){i&1&&(sp(0,"li",21),vV(1,6),lb());}function Hs(i,o){if(i&1&&(sp(0,"a",41),XV(1),lb()),i&2){let e=SV(2);H0("routerLink",d$(2,Fs,e.videoPlaylistToUpdate?.shortUUID)),WB(),Eb(" ",e.videoPlaylistToUpdate?.displayName," ");}}function Us(i,o){if(i&1&&(sp(0,"li",21),vV(1,7),lb(),sp(2,"li",40),w2(3,Hs,2,4,"a",41),lb()),i&2){let e=SV();WB(3),x2(e.videoPlaylistToUpdate?3:-1);}}function Gs(i,o){i&1&&(sp(0,"h2",22),vV(1,8),lb());}function Xs(i,o){i&1&&(sp(0,"h2",22),vV(1,9),lb());}function Ws(i,o){if(i&1&&(sp(0,"div",30),XV(1),lb()),i&2){let e=SV();WB(),Eb(" ",e.formErrors.displayName," ");}}function js(i,o){if(i&1&&(sp(0,"div",30),XV(1),lb()),i&2){let e=SV();WB(),xx(e.formErrors.privacy);}}function Qs(i,o){if(i&1&&(sp(0,"div",37)(1,"div"),vV(2,10),lb(),sp(3,"div"),vV(4,11),lb()()),i&2){let e=SV();WB(2),cx(e.getOwnerAccountDisplayName()),EV(2);}}function qs(i,o){if(i&1&&(sp(0,"div",30),XV(1),lb()),i&2){let e=SV();WB(),xx(e.formErrors.videoChannelId);}}function Zs(i,o){i&1&&(sp(0,"div",25)(1,"my-peertube-checkbox",42),pb(2,43),sp(3,"span"),vV(4,12),lb(),Pp(5,"br"),sp(6,"span"),vV(7,13),lb(),kp(),lb(),zH(),lb()),i&2&&(WB(),qH());}var Lr=(()=>{class i extends Nt{formReactiveService=g(w);authService=g(Ze);notifier=g(rc$1);router=g(mt);route=g(Vr$1);videoPlaylistService=g(Z);serverService=g($t);error;paramsSub;ngOnInit(){this.buildForm({displayName:Y,privacy:H,description:q,videoChannelId:w$1,thumbnailfile:null}),this.form.get("privacy").valueChanges.subscribe(e=>{G(this.form.get("videoChannelId"),e);}),this.paramsSub=this.authService.userInformationLoaded.pipe(ze(),Oe(()=>this.route.params),$(e=>e.videoPlaylistId),Oe(e=>N1([this.videoPlaylistService.getVideoPlaylist(e).pipe(Oe(t=>ae$1({authService:this.authService,includeCollaborations:true}).pipe($(n=>({videoPlaylist:t,channels:n}))))),this.serverService.getVideoPlaylistPrivacies()]))).subscribe({next:([{videoPlaylist:e,channels:t},n])=>{this.videoPlaylistToUpdate=e,this.videoPlaylistPrivacies=n,this.channels=t.filter(r=>r.ownerAccountId===this.videoPlaylistToUpdate.ownerAccount.id),this.hydrateFormFromPlaylist();},error:e=>{this.error=e.message;}});}ngOnDestroy(){this.paramsSub&&this.paramsSub.unsubscribe();}formValidated(){this.error=void 0;let e=this.form.value,t={displayName:e.displayName,privacy:e.privacy,description:e.description||null,videoChannelId:e.videoChannelId||null,thumbnailfile:e.thumbnailfile||void 0};this.videoPlaylistService.updateVideoPlaylist(this.videoPlaylistToUpdate,t).subscribe({next:()=>{this.notifier.success("\u64AD\u653E\u5217\u8868 "+t.displayName+" \u5DF2\u66F4\u65B0\u3002"),this.router.navigate(["/my-library","video-playlists"]);},error:n=>{this.error=n.message;}});}isCreation(){return false;}getFormButtonTitle(){return"\u7F16\u8F91";}isEditor(){return this.videoPlaylistToUpdate?this.videoPlaylistToUpdate?.ownerAccount.id!==this.authService.getUser().account.id:false;}getOwnerAccountDisplayName(){return this.videoPlaylistToUpdate?.ownerAccount.displayName;}hydrateFormFromPlaylist(){this.form.patchValue({displayName:this.videoPlaylistToUpdate.displayName,privacy:this.videoPlaylistToUpdate.privacy.id,description:this.videoPlaylistToUpdate.description,videoChannelId:this.videoPlaylistToUpdate.videoChannel?this.videoPlaylistToUpdate.videoChannel.id:null}),fetch(this.videoPlaylistToUpdate.getThumbnailUrl(223)).then(e=>e.blob()).then(e=>{this.form.patchValue({thumbnailfile:e});});}static ɵfac=(()=>{let e;return function(n){return(e||(e=Uu(i)))(n||i);};})();static ɵcmp=Pa$1({type:i,selectors:[["ng-component"]],features:[C0],decls:41,vars:18,consts:()=>{let e;e="\u7F16\u8F91";let t;t="\u6211\u7684\u64AD\u653E\u5217\u8868";let n;n="\u64AD\u653E\u5217\u8868\u7F29\u7565\u56FE";let r;r="\u663E\u793A\u540D\u79F0";let s;s="\u8BF4\u660E";let d;d="\u9690\u79C1";let u;u="\u9891\u9053";let S;S="\u521B\u5EFA";let v;v="\u7F16\u8F91";let R;R="\u65B0\u5EFA\u64AD\u653E\u5217\u8868";let re;re="\u66F4\u65B0\u64AD\u653E\u5217\u8868";let Le;Le="\u4EC5\u5217\u51FA "+"\uFFFD0\uFFFD"+" \u62E5\u6709\u7684\u9891\u9053\u3002 ";let nt;nt="\u4E0D\u652F\u6301\u66F4\u6539\u64AD\u653E\u5217\u8868\u7684\u6240\u6709\u8005\u3002";let ot;ot="\u5C06\u5176\u63D2\u5165\u5230\u9891\u9053\u64AD\u653E\u5217\u8868\u5217\u8868\u7684\u9996\u4F4D";let q;q="\u60A8\u53EF\u4EE5\u624B\u52A8\u5BF9\u9891\u9053\u4E2D\u7684\u64AD\u653E\u5217\u8868\u8FDB\u884C\u6392\u5E8F\u3002";let rt;return rt="\u9ED8\u8BA4\u60C5\u51B5\u4E0B\uFF0C\u65B0\u6DFB\u52A0\u7684\u64AD\u653E\u5217\u8868\u4F1A\u6DFB\u52A0\u5230\u5217\u8868\u672B\u5C3E\u3002",[t,n,r,s,d,u,S,v,R,re,Le,nt,q,rt,["type","danger"],[1,"pt-two-cols"],[1,"title-col"],["aria-label","breadcrumb"],[1,"pt-breadcrumb"],[1,"breadcrumb-item"],["routerLink","/my-library/video-playlists"],[1,"breadcrumb-item","active"],[1,"visually-hidden"],[1,"content-col"],[3,"ngSubmit","formGroup"],[1,"form-group"],["for","thumbnailfile"],["inputLabel",e,"inputName","thumbnailfile","formControlName","thumbnailfile"],["for","displayName"],["type","text","id","displayName","formControlName","displayName",1,"form-control",3,"ngClass"],["role","alert",1,"form-error"],["for","description"],["helpType","markdownText"],["inputId","description","formControlName","description",3,"formError"],["for","privacy"],["inputId","privacy","formControlName","privacy",3,"items"],["for","videoChannelId"],[1,"form-group-description"],["inputId","videoChannelId","formControlName","videoChannelId",3,"items"],["type","submit",1,"peertube-button","primary-button",3,"value","disabled"],["aria-current","page",1,"breadcrumb-item","active"],[3,"routerLink"],["inputName","insertAtFirstPosition","formControlName","insertAtFirstPosition","labelText",ot],["ngProjectAs","description",5,["description"]]];},template:function(t,n){t&1&&(w2(0,Bs,2,1,"my-alert",14),sp(1,"div",15)(2,"div",16)(3,"nav",17)(4,"ol",18)(5,"li",19)(6,"a",20),vV(7,0),lb()(),w2(8,zs,2,0,"li",21)(9,Us,4,1),lb()(),w2(10,Gs,2,0,"h2",22)(11,Xs,2,0,"h2",22),lb(),sp(12,"div",23)(13,"form",24),Fp("ngSubmit",function(){return n.formValidated();}),sp(14,"div",25)(15,"label",26),vV(16,1),lb(),Pp(17,"my-image-input",27),zH(),lb(),sp(18,"div",25)(19,"label",28),vV(20,2),lb(),Pp(21,"input",29),zH(),w2(22,Ws,2,1,"div",30),lb(),sp(23,"div",25)(24,"label",31),vV(25,3),lb(),Pp(26,"my-help",32)(27,"my-markdown-textarea",33),zH(),lb(),sp(28,"div",25)(29,"label",34),vV(30,4),lb(),Pp(31,"my-select-options",35),zH(),w2(32,js,2,1,"div",30),lb(),sp(33,"div",25)(34,"label",36),vV(35,5),lb(),w2(36,Qs,5,1,"div",37),Pp(37,"my-select-channel-user",38),zH(),w2(38,qs,2,1,"div",30),lb(),w2(39,Zs,8,0,"div",25),Pp(40,"input",39),lb()()()),t&2&&(x2(n.error?0:-1),WB(8),x2(n.isCreation()?8:9),WB(2),x2(n.isCreation()?10:11),WB(3),H0("formGroup",n.form),WB(4),qH(),WB(4),H0("ngClass",d$(16,ks,n.formErrors.displayName)),qH(),WB(),x2(n.formErrors.displayName?22:-1),WB(5),H0("formError",n.formErrors.description),qH(),WB(4),H0("items",n.videoPlaylistPrivacies),qH(),WB(),x2(n.formErrors.privacy?32:-1),WB(4),x2(n.isEditor()?36:-1),WB(),H0("items",n.channels),qH(),WB(),x2(n.formErrors.videoChannelId?38:-1),WB(),x2(n.isCreation()&&n.form.value.videoChannelId?39:-1),WB(),H0("value",o$(n.getFormButtonTitle()))("disabled",!n.form.valid));},dependencies:[cl$1,x3,Zh,Jn,Zn,Je,qn,$n,Qn,Vn,yn,me,U,Je$1,Yl$1,be$1,v,Me$1],styles:["input[type=text][_ngcontent-%COMP%]{font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:340px;max-width:340px;color:var(--input-fg);background-color:var(--input-bg);border:var(--input-border-width) solid var(--input-border-color);border-radius:var(--input-border-radius);line-height:24px}input[type=text][_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder-color);font-size:var(--input-placeholder-font-size)}input[type=text][readonly][_ngcontent-%COMP%]{color:var(--fg-300)}input[type=text][_ngcontent-%COMP%]:focus, input[type=text][_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}input[type=text][disabled][_ngcontent-%COMP%]{color:var(--fg-300);opacity:.8}@media screen and (max-width:380px){input[type=text][_ngcontent-%COMP%]{width:100%}}.peertube-select-container[_ngcontent-%COMP%]{width:340px}@media screen and (max-width:370px){.peertube-select-container[_ngcontent-%COMP%]{width:100%}}my-select-channel-user[_ngcontent-%COMP%], my-select-options[_ngcontent-%COMP%]{display:block;max-width:340px}.content-col[_ngcontent-%COMP%]{max-width:500px}my-image-input[_ngcontent-%COMP%]{width:223px;height:122px}"],changeDetection:1});}return i;})();var wr=J(wo());var Ks=i=>({active:i}),Js=i=>({"is-rtl":i}),el=i=>({"has-collaborator-state":i});function tl(i,o){i&1&&Pp(0,"my-collaborator-state",4);}function il(i,o){i&1&&Pp(0,"my-collaborator-state",5);}function nl(i,o){if(i&1&&w2(0,tl,1,0,"my-collaborator-state",4)(1,il,1,0,"my-collaborator-state",5),i&2){let e=SV();x2(e.user.isEditorOfChannel(e.channel())?0:1);}}var Di=(()=>{class i{authService=g(Ze);localeId=g(an$1);checked=wpe(false);channel=qp.required();inputName=qp(void 0);label=qp("\u5207\u6362\u8BE5\u9891\u9053");get user(){return this.authService.getUser();}isRTL(){return i3(this.localeId)==="rtl";}propagateChange=e=>{};writeValue(e){this.checked.set(e);}registerOnChange(e){this.propagateChange=e;}registerOnTouched(){}toggle(){this.checked.set(!this.checked()),this.propagateChange(this.checked());}static ɵfac=function(t){return new(t||i)();};static ɵcmp=Pa$1({type:i,selectors:[["my-channel-toggle"]],inputs:{checked:[1,"checked"],channel:[1,"channel"],inputName:[1,"inputName"],label:[1,"label"]},outputs:{checked:"checkedChange"},features:[u$([{provide:D$1,useExisting:af(()=>i),multi:true}])],decls:6,vars:15,consts:[[1,"root","button-unstyle",3,"click","title"],["actorType","channel","size","34",3,"actor"],[1,"info",3,"ngClass"],[1,"name"],["small","true","type","accepted"],["small","true","type","owner"]],template:function(t,n){t&1&&(sp(0,"button",0),Fp("click",function(){return n.toggle();}),Pp(1,"my-actor-avatar",1),sp(2,"div",2)(3,"div",3),XV(4),lb(),w2(5,nl,2,1),lb()()),t&2&&(HV(d$(9,Ks,n.checked())),H0("title",n.label()),WB(),HV(d$(11,Js,n.isRTL())),H0("actor",n.channel()),WB(),H0("ngClass",d$(13,el,n.user.isCollaboratingToChannels())),WB(2),xx(n.channel().displayName),WB(),x2(n.user.isCollaboratingToChannels()?5:-1));},dependencies:[cl$1,x3,fe$1,H$3],styles:[".root[_ngcontent-%COMP%]{position:relative;display:flex;align-items:center;text-align:start;line-height:1.2;padding-inline-start:17px}.root[_ngcontent-%COMP%]:hover{opacity:.9}.info[_ngcontent-%COMP%]{border-radius:4px;background-color:var(--bg-secondary-400);max-width:150px;padding-top:.75rem;padding-bottom:.75rem;padding-inline-start:25px;padding-inline-end:1rem}.info[_ngcontent-%COMP%]   .name[_ngcontent-%COMP%]{color:var(--fg-400);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:.875rem}.info.has-collaborator-state[_ngcontent-%COMP%]{padding-top:.5rem;padding-bottom:.5rem}my-actor-avatar[_ngcontent-%COMP%]{position:absolute;border:2px solid var(--bg-secondary-400);border-radius:5px}my-actor-avatar.is-rtl[_ngcontent-%COMP%]{right:0}my-actor-avatar[_ngcontent-%COMP%]:not(.is-rtl){left:0}.root.active[_ngcontent-%COMP%]   .info[_ngcontent-%COMP%]{background-color:var(--bg-secondary-450)}.root.active[_ngcontent-%COMP%]   .name[_ngcontent-%COMP%]{font-weight:700}.root.active[_ngcontent-%COMP%]   my-actor-avatar[_ngcontent-%COMP%]{border-color:var(--bg-secondary-450);background-color:var(--bg-secondary-450)}"],changeDetection:1});}return i;})();var ol=["table"],rl=i=>["/my-library/video-playlists",i],al=i=>["/c",i],sl=i=>["update",i],ll=(i,o)=>o.id;function cl(i,o){if(i&1){let e=F2();sp(0,"my-channel-toggle",18),Ox("ngModelChange",function(n){let r=GI(e).$implicit;return t$(r.selected,n)||(r.selected=n),zI(n);}),Fp("ngModelChange",function(){let n=GI(e).$implicit,r=SV();return zI(r.onChannelFilter(n));}),lb(),zH();}if(i&2){let e=o.$implicit;H0("channel",e),Mx("ngModel",e.selected),qH();}}function dl(i,o){if(i&1&&(pb(0),vV(1,9),E$(2,"myNumberFormatter"),kp()),i&2){let e=SV().$implicit,t=SV();WB(2),cx(e)(S$(2,3,e))(t.getFilteredChannel().displayName),EV(1);}}function _l(i,o){if(i&1&&(pb(0),vV(1,10),E$(2,"myNumberFormatter"),kp()),i&2){let e=SV().$implicit;WB(2),cx(e)(S$(2,2,e)),EV(1);}}function pl(i,o){if(i&1&&w2(0,dl,3,5,"ng-container")(1,_l,3,4,"ng-container"),i&2){let e=SV();x2(e.getFilteredChannel()?0:1);}}function ml(i,o){i&1&&(sp(0,"a",19),Pp(1,"my-global-icon",20),pb(2),vV(3,11),kp(),lb());}function ul(i,o){if(i&1&&(sp(0,"td",21),XV(1),lb()),i&2){let e=SV().$implicit;WB(),Eb(" ",e.videoChannelPosition," ");}}function hl(i,o){if(i&1&&(sp(0,"td"),Pp(1,"my-video-playlist-miniature",22),lb()),i&2){let e=SV().$implicit;WB(),H0("playlist",e);}}function gl(i,o){i&1&&Pp(0,"my-collaborator-state",26);}function fl(i,o){i&1&&Pp(0,"my-collaborator-state",27);}function Cl(i,o){if(i&1&&w2(0,gl,1,0,"my-collaborator-state",26)(1,fl,1,0,"my-collaborator-state",27),i&2){let e=SV(3).$implicit,t=SV();x2(t.user.isOwnerOfChannel(e.videoChannel)?0:t.user.isEditorOfChannel(e.videoChannel)?1:-1);}}function Sl(i,o){if(i&1&&(sp(0,"a",25)(1,"span"),XV(2),lb(),w2(3,Cl,2,1),lb()),i&2){let e=SV(2).$implicit,t=SV();H0("routerLink",d$(3,al,e.videoChannel.name)),WB(2),xx(e.videoChannel.displayName),WB(),x2(t.user.isCollaboratingToChannels()?3:-1);}}function yl(i,o){if(i&1&&(sp(0,"td")(1,"div",23)(2,"a",24),XV(3),lb(),w2(4,Sl,4,5,"a",25),lb()()),i&2){let e=SV().$implicit;WB(2),H0("routerLink",d$(3,rl,e.shortUUID)),WB(),Eb(" ",e.displayName," "),WB(),x2(e.videoChannel?4:-1);}}function vl(i,o){if(i&1&&(sp(0,"td"),Pp(1,"my-privacy-badge",28),lb()),i&2){let e=SV().$implicit;WB(),H0("playlist",e);}}function El(i,o){if(i&1&&(sp(0,"td"),XV(1),E$(2,"ptDate"),lb()),i&2){let e=SV().$implicit;WB(),Eb(" ",T$(2,1,e.updatedAt,"short")," ");}}function Ml(i,o){if(i&1&&(w2(0,ul,2,1,"td",21),w2(1,hl,2,1,"td"),w2(2,yl,5,5,"td"),w2(3,vl,2,1,"td"),w2(4,El,3,4,"td")),i&2){SV();let e=CV(9);x2(e.isColumnDisplayed("videoChannelPosition")?0:-1),WB(),x2(e.isColumnDisplayed("videos")?1:-1),WB(),x2(e.isColumnDisplayed("name")?2:-1),WB(),x2(e.isColumnDisplayed("privacy")?3:-1),WB(),x2(e.isColumnDisplayed("updatedAt")?4:-1);}}function Pl(i,o){if(i&1){let e=F2();Pp(0,"my-edit-button",29),sp(1,"my-delete-button",30),Fp("click",function(){GI(e);let n=SV().$implicit,r=SV();return zI(r.deleteVideoPlaylist(n));}),lb();}if(i&2){let e=SV().$implicit;H0("ptRouterLink",d$(1,sl,e.shortUUID));}}function Il(i,o){if(i&1&&w2(0,Pl,2,3),i&2){let e=o.$implicit,t=SV();x2(t.isRegularPlaylist(e)?0:-1);}}function Tl(i,o){if(i&1&&XV(0),i&2){let e=o.$implicit;Eb(" ",e.description," ");}}function Ol(i,o){if(i&1&&XV(0),i&2){let e=o.search,t=o.hasFilters,n=SV();Eb(" ",n.getNoResults(!!e||t)," ");}}var Dr=(0,wr.default)("peertube:my-video-playlists"),xr=(()=>{class i{notifier=g(rc$1);confirmService=g(cg);videoPlaylistService=g(Z);auth=g(Ze);headerService=g(Fk);cdr=g(Cs$1);screenService=g(hg);table=xpe("table");user;channels=[];onDataSubject=new X();columns=[];customUpdateUrl;customParseQueryParams;dataLoader;hasExpandedRow;playlistsAfterDrop=[];playlistsBeforeDrop=[];paginationStart=0;constructor(){this.customUpdateUrl=this._customUpdateUrl.bind(this),this.customParseQueryParams=this._customParseQueryParams.bind(this),this.dataLoader=this._dataLoader.bind(this),this.hasExpandedRow=this._hasExpandedRow.bind(this);}ngOnInit(){this.headerService.setSearchHidden(true),this.user=this.auth.getUser(),this.columns=[{id:"videoChannelPosition",label:"\u4F4D\u7F6E",selected:true,sortable:true,isDisplayed:()=>this.hasReorderableRows()},{id:"videos",label:"\u89C6\u9891",selected:true,sortable:false},{id:"name",label:"\u540D\u79F0",selected:true,sortable:true},{id:"privacy",label:"\u9690\u79C1",selected:true,sortable:false},{id:"updatedAt",label:"\u5DF2\u66F4\u65B0",selected:true,sortable:true}];}ngOnDestroy(){this.headerService.setSearchHidden(false);}_customParseQueryParams(e){this.user=this.auth.getUser(),this.channels=[...this.user.videoChannels,...this.user.videoChannelCollaborations].map(t=>E(D({},t),{selected:e.channelName===t.name})),this.cdr.detectChanges();}getNoResults(e){return e?"No playlists found matching your filters.":this.getFilteredChannel()?"\u5728\u6240\u9009\u9891\u9053\u4E2D\u672A\u627E\u5230\u64AD\u653E\u5217\u8868\u3002":"\u4F60\u5C1A\u672A\u53D1\u5E03\u4EFB\u4F55\u64AD\u653E\u5217\u8868\u3002";}_customUpdateUrl(){return{channelName:this.getFilteredChannel()?.name};}deleteVideoPlaylist(e){return L(this,null,function*(){(yield this.confirmService.confirm("\u4F60\u786E\u5B9A\u8981\u5220\u9664 "+e.displayName+" \u5417\uFF1F ","\u5220\u9664"))!==false&&this.videoPlaylistService.removeVideoPlaylist(e).subscribe({next:()=>{this.table().loadData(),this.notifier.success("\u64AD\u653E\u5217\u8868 "+e.displayName+" \u5DF2\u5220\u9664\u3002");},error:n=>this.notifier.handleError(n)});});}isRegularPlaylist(e){return e.type.id===uIe.REGULAR;}onRowReorder(e){let{dragIndex:t,dropIndex:n}=e,r=t-this.paginationStart,s=n-this.paginationStart,d=this.playlistsBeforeDrop[r],u=this.playlistsBeforeDrop[s];if(Dr("onRowReorder",{previousIndex:r,newIndex:s,dragPlaylist:d,dropAfterPlaylist:u}),r===s)return;let S=d.videoChannelPosition,v=u.videoChannelPosition;S>v&&v--,Dr("Will reorder",{oldPosition:S,insertAfter:v});for(let R=1;R<=this.playlistsAfterDrop.length;R++)this.playlistsAfterDrop[R-1].videoChannelPosition=R+this.paginationStart;this.videoPlaylistService.reorderPlaylistsOfChannel(this.getFilteredChannel().name,S,v).subscribe({next:()=>{this.table().loadData({skipLoader:!this.screenService.isInTouchScreen()}),this.notifier.success("\u91CD\u65B0\u6392\u5217\u4E86\u64AD\u653E\u5217\u8868\u987A\u5E8F");},error:R=>this.notifier.handleError(R)});}onChannelFilter(e){for(let t of this.channels)t.id!==e.id&&(t.selected=false);this.table().onFiltersChange();}hasReorderableRows(){return!!this.getFilteredChannel();}_dataLoader(e){let{pagination:t,sort:n,search:r}=e;this.paginationStart=t.start;let s=this.getFilteredChannel();return(s?this.videoPlaylistService.listChannelPlaylists({videoChannel:{nameWithHost:Rc.CREATE_BY_STRING(s.name,s.host)},includeCollaborations:true,restPagination:t,sort:n,search:r}):this.videoPlaylistService.listAccountPlaylists({account:this.user.account,includeCollaborations:true,restPagination:t,sort:n,search:r})).pipe(lt(({data:u})=>{this.playlistsAfterDrop=u,this.playlistsBeforeDrop=[...u];}));}_hasExpandedRow(e){return!!e.description;}getFilteredChannel(){return this.channels.find(e=>e.selected);}static ɵfac=function(t){return new(t||i)();};static ɵcmp=Pa$1({type:i,selectors:[["ng-component"]],viewQuery:function(t,n){t&1&&px(n.table,ol,5),t&2&&IV();},decls:22,vars:6,consts:()=>{let e;e="\u6BCF\u4E00\u9875\u64AD\u653E\u5217\u8868";let t;t="\u62D6\u653E\u6B64\u884C\u91CD\u65B0\u6392\u5217\u4F60\u9891\u9053\u4E2D\u64AD\u653E\u5217\u8868\u7684\u987A\u5E8F";let n;n="\u6309\u9891\u9053\u7B5B\u9009";let r;r="\u8FD9\u5141\u8BB8\u4F60\u91CD\u65B0\u6392\u5217\u5206\u914D\u7ED9\u5B83\u7684\u64AD\u653E\u5217\u8868\u7684\u987A\u5E8F";let s;s="{VAR_PLURAL, plural, =0 {\u65E0\u64AD\u653E\u5217\u8868} =1 {1 \u4E2A\u64AD\u653E\u5217\u8868} other {{INTERPOLATION} \u4E2A\u64AD\u653E\u5217\u8868}}",s=bV(s,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let d;d=""+s+" \uFF0C\u4F4D\u4E8E "+"\uFFFD2\uFFFD"+" \u9891\u9053";let u;u="{VAR_PLURAL, plural, =0 {\u65E0\u64AD\u653E\u5217\u8868} =1 {1 \u4E2A\u64AD\u653E\u5217\u8868} other {{INTERPOLATION} \u4E2A\u64AD\u653E\u5217\u8868}}",u=bV(u,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let S;return S="\u521B\u5EFA\u64AD\u653E\u5217\u8868",[["table",""],["totalTitle",""],["captionRight",""],["tableCells",""],["actionCell",""],["expandedRow",""],["noResults",""],n,r,d,u,S,[1,"form-group"],[1,"label"],[1,"form-group-description"],[1,"channel-filters"],[3,"channel","ngModel"],["key","MyVideoPlaylistsComponent","defaultSort","updatedAt","paginatorText",e,"defaultRowsPerPage","10","columnConfig","false","searchInput","true","dragHandleTitle",t,3,"rowReorder","defaultColumns","dataLoader","customParseQueryParams","customUpdateUrl","hasExpandedRow","reorderableRows"],[3,"ngModelChange","channel","ngModel"],["routerLink","create",1,"peertube-create-button"],["iconName","add","aria-hidden","true"],[2,"width","10px"],["thumbnailOnly","true","toManage","true",3,"playlist"],[1,"name-container"],[1,"name",3,"routerLink"],[1,"channel-sub-link-in-cell",3,"routerLink"],["type","owner","small","true",1,"ms-2"],["type","accepted","small","true",1,"ms-2"],[3,"playlist"],["label","",3,"ptRouterLink"],["label","",3,"click"]];},template:function(t,n){t&1&&(sp(0,"div",12)(1,"div",13),vV(2,7),lb(),sp(3,"div",14),vV(4,8),lb(),sp(5,"div",15),N2(6,cl,1,2,"my-channel-toggle",16,ll),lb()(),sp(8,"my-table",17,0),Fp("rowReorder",function(s){return n.onRowReorder(s);}),w0(10,pl,2,1,"ng-template",null,1,I$)(12,ml,4,0,"ng-template",null,2,I$)(14,Ml,5,5,"ng-template",null,3,I$)(16,Il,1,1,"ng-template",null,4,I$)(18,Tl,1,1,"ng-template",null,5,I$)(20,Ol,1,1,"ng-template",null,6,I$),lb()),t&2&&(WB(6),M2(n.channels),WB(2),H0("defaultColumns",n.columns)("dataLoader",n.dataLoader)("customParseQueryParams",n.customParseQueryParams)("customUpdateUrl",n.customUpdateUrl)("hasExpandedRow",n.hasExpandedRow)("reorderableRows",n.hasReorderableRows()));},dependencies:[Jn,qn,ln$1,Tr$1,Zh,Q,h,c$1,Di,Lh,Un$1,Ar,H$3,d$1,p$1],styles:[".channel-filters[_ngcontent-%COMP%]{display:flex;align-items:center;padding-bottom:1rem;border-bottom:1px solid var(--bg-secondary-400);margin-bottom:1rem;gap:1rem;overflow:hidden}.channel-filters[_ngcontent-%COMP%]:hover{overflow:auto}.name[_ngcontent-%COMP%]{color:var(--fg);line-height:1rem;font-weight:700;text-decoration:none}.name-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}my-video-playlist-miniature[_ngcontent-%COMP%]{display:block;width:130px}"],changeDetection:1});}return i;})();var Yr=(()=>{class i{serverService=g($t);newFeatureInfoService=g(bi);menuEntries=[];serverConfig;ngOnInit(){this.serverConfig=this.serverService.getHTMLConfig(),this.buildMenu(),this.newFeatureInfoService.showChannelCollaboration();}buildMenu(){this.menuEntries=[{label:"\u7BA1\u7406\u6211\u7684\u89C6\u9891",routerLink:"/my-library/videos"},{label:"\u8BC4\u8BBA",routerLink:"/my-library/comments-on-my-videos",children:[{label:"\u6211\u7684\u89C6\u9891\u8BC4\u8BBA",routerLink:"/my-library/comments-on-my-videos"},{label:"\u5DF2\u5173\u6CE8\u7684\u8BCD\u8BED",routerLink:"/my-library/watched-words/list"},{label:"Watched words subscriptions",routerLink:"/my-library/watched-words/subscriptions"},{label:"\u81EA\u52A8\u6807\u8BB0\u653F\u7B56",routerLink:"/my-library/auto-tag-policies"}]},{label:"\u66F4\u591A",routerLink:this.isVideoImportEnabled()?"/my-library/video-imports":"/my-library/ownership",children:[{label:"\u5BFC\u5165",routerLink:"/my-library/video-imports",isDisplayed:()=>this.isVideoImportEnabled()},{label:"\u89C6\u9891\u8F6C\u79FB",routerLink:"/my-library/ownership"}]}];}isVideoImportEnabled(){let e=this.serverConfig.import.videos;return e.http.enabled||e.torrent.enabled;}static ɵfac=function(t){return new(t||i)();};static ɵcmp=Pa$1({type:i,selectors:[["ng-component"]],decls:8,vars:1,consts:()=>{let e;e="\u6211\u7684\u89C6\u9891";let t;return t="\u8DF3\u8FC7\u5B50\u83DC\u5355",[["myVideoSpaceContent",""],t,[1,"root"],[1,"margin-content"],["href","#my-video-space-content",1,"visually-hidden-focusable","skip-to-content-sub-menu",3,"click"],["h1Icon","videos","h1",e,3,"menuEntries"],["tabindex","-1","id","my-video-space-content",1,"margin-content","pb-5","outline-0"]];},template:function(t,n){if(t&1){let r=F2();sp(0,"div",2)(1,"div",3)(2,"a",4),Fp("click",function(d){GI(r);let u=CV(6);return d.preventDefault(),zI(u.focus());}),vV(3,1),lb(),Pp(4,"my-horizontal-menu",5),lb(),sp(5,"div",6,0),Pp(7,"router-outlet"),lb()();}t&2&&(WB(4),H0("menuEntries",n.menuEntries));},dependencies:[FS,hn],encapsulation:2,changeDetection:1});}return i;})();var Vr=J(wo());var Rl=["modal"];function bl(i,o){i&1&&Pp(0,"my-collaborator-state",20);}function Al(i,o){i&1&&Pp(0,"my-collaborator-state",21);}function Nl(i,o){if(i&1&&w2(0,bl,1,0,"my-collaborator-state",20)(1,Al,1,0,"my-collaborator-state",21),i&2){let e=SV().$implicit,t=SV(2);x2(t.user.isOwnerOfChannel(e.videoChannel)?0:t.user.isEditorOfChannel(e.videoChannel)?1:-1);}}function Ll(i,o){if(i&1){let e=F2();sp(0,"div",12)(1,"my-peertube-checkbox",19),Ox("ngModelChange",function(n){let r=GI(e).$implicit,s=SV(2);return t$(s.playlistsEnabled[r.id],n)||(s.playlistsEnabled[r.id]=n),zI(n);}),lb(),zH(),w2(2,Nl,2,1),lb();}if(i&2){let e=o.$implicit,t=SV(2);WB(),H0("inputName",t.getPrimaryInputName(e)),Mx("ngModel",t.playlistsEnabled[e.id]),H0("labelText",e.displayName),qH(),WB(),x2(t.user.isCollaboratingToChannels()?2:-1);}}function Dl(i,o){if(i&1){let e=F2();sp(0,"my-playlist-create-block",22),Fp("playlistCreated",function(){GI(e);let n=SV(2);return zI(n.onPlaylistCreated());}),lb();}}function wl(i,o){if(i&1){let e=F2();sp(0,"div",4)(1,"h4",5),vV(2,1),lb(),sp(3,"button",6),Fp("click",function(){GI(e);let n=SV();return zI(n.hide());}),Pp(4,"my-global-icon",7),lb()(),sp(5,"div",8)(6,"div",9)(7,"input",10),Ox("ngModelChange",function(n){GI(e);let r=SV();return t$(r.videoPlaylistSearch,n)||(r.videoPlaylistSearch=n),zI(n);}),Fp("ngModelChange",function(){GI(e);let n=SV();return zI(n.onVideoPlaylistSearchChanged());}),lb(),zH(),lb(),sp(8,"div",11),N2(9,Ll,3,4,"div",12,R2),lb(),sp(11,"button",13),Fp("click",function(){GI(e);let n=SV();return zI(n.isNewPlaylistBlockOpened=true);}),Pp(12,"my-global-icon",14),sp(13,"span"),vV(14,2),lb()(),w2(15,Dl,1,0,"my-playlist-create-block",15),lb(),sp(16,"div",16)(17,"input",17),Fp("click",function(){GI(e);let n=SV();return zI(n.hide());})("key.enter",function(){GI(e);let n=SV();return zI(n.hide());}),lb(),sp(18,"my-button",18),Fp("click",function(){GI(e);let n=SV();return zI(n.save());}),vV(19,3),lb()();}if(i&2){let e=SV();WB(7),Mx("ngModel",e.videoPlaylistSearch),qH(),WB(2),M2(e.currentPlaylists),WB(2),H0("hidden",e.isNewPlaylistBlockOpened),WB(4),x2(e.isNewPlaylistBlockOpened?15:-1),WB(3),H0("loading",e.updatingPlaylists)("disabled",e.updatingPlaylists);}}var xl=(0,Vr.default)("peertube:playlists:BulkUpdateVideosInPlaylistModalComponent"),$r=(()=>{class i{authService=g(Ze);notifier=g(rc$1);videoPlaylistService=g(Z);modalService=g(rr$1);saved=_pe();videos;videoPlaylistSearch;videoPlaylistSearchChanged=new X();seenPlaylists={};currentPlaylists=[];elementsPerPlaylist={};playlistsEnabled={};initialPlaylistsEnabled={};isNewPlaylistBlockOpened=false;updatingPlaylists=false;modal=xpe("modal");openedModal;videosContainedInPlaylists;listenToAccountPlaylistsChangeSub;get user(){return this.authService.getUser();}get videoIds(){return this.videos.map(e=>e.id);}ngOnInit(){this.videoPlaylistService.listMyPlaylistWithCache(this.user,this.videoPlaylistSearch).subscribe(e=>this.currentPlaylists=e.data),this.listenToAccountPlaylistsChangeSub=this.videoPlaylistService.listenToMyAccountPlaylistsChange().subscribe(e=>{this.currentPlaylists=e.data,this.rebuildPlaylists();}),this.videoPlaylistSearchChanged.pipe(ta$1(500),Oe(()=>this.videoPlaylistService.listMyPlaylistWithCache(this.user,this.videoPlaylistSearch))).subscribe(({data:e})=>{this.currentPlaylists=e,this.rebuildPlaylists();});}ngOnDestroy(){this.listenToAccountPlaylistsChangeSub?.unsubscribe();}show(e){this.videos=e.videos,this.videosContainedInPlaylists=e.videosContainedInPlaylists,this.elementsPerPlaylist={},this.playlistsEnabled={},this.initialPlaylistsEnabled={},this.isNewPlaylistBlockOpened=false,this.rebuildPlaylists(),this.openedModal=this.modalService.open(this.modal(),{centered:true,keyboard:false});}hide(){this.openedModal.close();}rebuildPlaylists(){if(this.videosContainedInPlaylists){for(let e of this.currentPlaylists)this.elementsPerPlaylist[e.id]=[],this.seenPlaylists[e.id]=e;for(let[e,t]of Object.entries(this.videosContainedInPlaylists))for(let n of t)this.elementsPerPlaylist[n.playlistId]&&this.elementsPerPlaylist[n.playlistId].push({videoId:+e,playlistElementId:n.playlistElementId});for(let[e,t]of Object.entries(this.elementsPerPlaylist)){let n=+e;this.playlistsEnabled[n]===void 0&&(this.playlistsEnabled[n]=E_e(t.map(r=>r.videoId)).length===this.videoIds.length,this.initialPlaylistsEnabled[n]=this.playlistsEnabled[n]);}xl("Rebuilt playlists, enabled playlists:",this.playlistsEnabled);}}onVideoPlaylistSearchChanged(){this.videoPlaylistSearchChanged.next();}getPrimaryInputName(e){return"videos-update-playlist-"+e.id;}save(){let e=[];this.updatingPlaylists=true;for(let[t,n]of Object.entries(this.playlistsEnabled)){let r=+t,s=this.seenPlaylists[r],d=this.initialPlaylistsEnabled[r];n&&!d?e.push(this.addVideosInPlaylist(s)):!n&&d&&e.push(this.removeVideosFromPlaylist(s));}if(e.length===0){this.updatingPlaylists=false,this.notifier.info("No change to save"),this.hide();return;}wr$1(...e).subscribe({next:t=>{t.type==="success"?this.notifier.success(t.message):this.notifier.error(t.message);},error:t=>this.notifier.handleError(t),complete:()=>{this.updatingPlaylists=false,this.hide(),this.saved.emit(this.videos);}});}addVideosInPlaylist(e){let t=new Set(this.elementsPerPlaylist[e.id].map(r=>r.videoId)),n=this.videos.filter(r=>!t.has(r.id)).map(r=>({videoId:r.id}));return this.videoPlaylistService.addVideoInPlaylist(e.id,n).pipe($(r=>({type:"success",message:CAe("{count, plural, =1 {Video added to {playlistName}} other {{count} videos added to {playlistName}}}",{count:r.length,playlistName:e.displayName})})),le$1(r=>M$1({type:"error",message:r.message})));}removeVideosFromPlaylist(e){return this.videoPlaylistService.removeElementsFromPlaylist({playlistId:e.id,elements:this.elementsPerPlaylist[e.id].map(t=>({playlistElementId:t.playlistElementId,videoId:t.videoId}))}).pipe($(t=>({type:"success",message:CAe("{count, plural, =1 {Video removed from {playlistName}} other {{count} videos removed from {playlistName}}}",{count:t.length,playlistName:e.displayName})})),le$1(t=>M$1({type:"error",message:t.message})));}onPlaylistCreated(){this.isNewPlaylistBlockOpened=false,this.rebuildPlaylists();}static ɵfac=function(t){return new(t||i)();};static ɵcmp=Pa$1({type:i,selectors:[["my-bulk-update-videos-in-playlist-modal"]],viewQuery:function(t,n){t&1&&px(n.modal,Rl,5),t&2&&IV();},outputs:{saved:"saved"},decls:2,vars:0,consts:()=>{let e;e="\u5173\u95ED\u6B64\u6A21\u5F0F";let t;t="\u641C\u7D22\u64AD\u653E\u5217\u8868";let n;n="\u53D6\u6D88";let r;r="Update videos in playlists";let s;s="\u521B\u5EFA\u79C1\u4EAB\u64AD\u653E\u5217\u8868";let d;return d="\u4FDD\u5B58",[["modal",""],r,s,d,[1,"modal-header"],[1,"modal-title"],["title",e,1,"border-0","p-0",3,"click"],["iconName","cross"],[1,"modal-body"],[1,"mb-4"],["type","text","placeholder",t,3,"ngModelChange","ngModel"],[1,"playlists"],[1,"playlist","d-flex","gap-2","mb-2"],[1,"mt-4","peertube-button","secondary-button",3,"click","hidden"],["iconName","add","aria-hidden","true"],[1,"d-block","mt-3","pt-3"],[1,"modal-footer","inputs"],["type","button","role","button","value",n,1,"peertube-button","secondary-button",3,"click","key.enter"],["theme","primary",3,"click","loading","disabled"],[3,"ngModelChange","inputName","ngModel","labelText"],["type","owner","small","true",1,"ms-2"],["type","accepted","small","true",1,"ms-2"],[1,"d-block","mt-3","pt-3",3,"playlistCreated"]];},template:function(t,n){t&1&&w0(0,wl,20,5,"ng-template",null,0,I$);},dependencies:[Jn,Je,qn,ln$1,Me$1,Tr$1,H$3,it,re],styles:["my-peertube-checkbox[_ngcontent-%COMP%]{align-self:center;margin-inline-end:.625rem}.display-name[_ngcontent-%COMP%]{display:flex;align-items:flex-end;flex-grow:1;margin:0;font-weight:400;cursor:pointer;font-size:1rem}my-playlist-create-block[_ngcontent-%COMP%]{border-top:1px solid var(--bg-secondary-400)}input[type=text][_ngcontent-%COMP%]{font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:100%;max-width:100%;color:var(--input-fg);background-color:var(--input-bg);border:var(--input-border-width) solid var(--input-border-color);border-radius:var(--input-border-radius);line-height:24px}input[type=text][_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder-color);font-size:var(--input-placeholder-font-size)}input[type=text][readonly][_ngcontent-%COMP%]{color:var(--fg-300)}input[type=text][_ngcontent-%COMP%]:focus, input[type=text][_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}input[type=text][disabled][_ngcontent-%COMP%]{color:var(--fg-300);opacity:.8}@media screen and (max-width: calc(100% + 40px)){input[type=text][_ngcontent-%COMP%]{width:100%}}"],changeDetection:1});}return i;})();function Yl(i,o){if(i&1&&(sp(0,"span",0),XV(1),lb()),i&2){let e=SV();H0("ngClass",e.badgeClass),WB(),xx(e.label);}}var kr=(()=>{class i{video=qp.required();label;badgeClass;ngOnChanges(){this.buildBadgeAndLabel();}buildBadgeAndLabel(){let e=this.video();if(!e.state){this.label="";return;}let t=e.state.id;switch(this.badgeClass=rl$1(e.state.id),t){case Pl$1.PUBLISHED:if(e.privacy.id===Xt.PRIVATE){this.label="\u5728\u4F60\u7684\u5E93\u4E2D",this.badgeClass="badge-grey";return;}if(e.privacy.id===Xt.INTERNAL){this.label="\u5185\u90E8",this.badgeClass="badge-blue";return;}this.label=ll$1(e.state.id);return;case Pl$1.TO_TRANSCODE:this.label=this.video().waitTranscoding===true?"\u8F6C\u7801\u4E2D":"\u5F85\u8F6C\u7801";return;default:this.label=ll$1(e.state.id);}}static ɵfac=function(t){return new(t||i)();};static ɵcmp=Pa$1({type:i,selectors:[["my-video-state-badge"]],inputs:{video:[1,"video"]},features:[ti],decls:1,vars:1,consts:[[1,"pt-badge",3,"ngClass"]],template:function(t,n){t&1&&w2(0,Yl,2,2,"span",0),t&2&&x2(n.label?0:-1);},dependencies:[cl$1,x3],encapsulation:2,changeDetection:1});}return i;})();var Vl=["table"],$l=["bulkUpdateVideosInPlaylistModal"],kl=["bulkUpdateVideosModal"],Fl=i=>({tagsOneOf:i}),Bl=i=>({privacyOneOf:i}),zl=i=>["/videos/manage",i,"stats"],Hl=()=>[],Ul=i=>["/w/p/",i],Gl=i=>["/videos","manage",i],Xl=(i,o)=>o.id;function Wl(i,o){if(i&1){let e=F2();sp(0,"my-channel-toggle",18),Ox("ngModelChange",function(n){let r=GI(e).$implicit;return t$(r.selected,n)||(r.selected=n),zI(n);}),Fp("ngModelChange",function(){GI(e),SV();let n=CV(6);return zI(n.onFiltersChange());}),lb(),zH();}if(i&2){let e=o.$implicit;H0("channel",e),Mx("ngModel",e.selected),qH();}}function jl(i,o){if(i&1&&(pb(0),vV(1,8),E$(2,"myNumberFormatter"),kp()),i&2){let e=o.$implicit;WB(2),cx(e)(S$(2,2,e)),EV(1);}}function Ql(i,o){if(i&1&&(sp(0,"td"),Pp(1,"my-video-cell",19),lb()),i&2){let e=SV().$implicit;WB(),H0("video",e);}}function ql(i,o){if(i&1&&(sp(0,"td"),Pp(1,"my-video-cell",20),lb()),i&2){let e=SV().$implicit;WB(),H0("video",e);}}function Zl(i,o){if(i&1&&(sp(0,"a",22),XV(1),lb()),i&2){let e=o.$implicit;H0("queryParams",d$(2,Fl,e)),WB(),Eb(" ",e," ");}}function Kl(i,o){if(i&1&&(sp(0,"td")(1,"div",21),N2(2,Zl,2,4,"a",22,R2),lb()()),i&2){let e=SV().$implicit;WB(2),M2(e.tags);}}function Jl(i,o){if(i&1&&(sp(0,"span",26),vV(1,9),lb()),i&2){let e=SV(2).$implicit;H0("ngbTooltip",e.blacklistedReason);}}function ec(i,o){if(i&1&&(sp(0,"td")(1,"div",23)(2,"a",24),Pp(3,"my-privacy-badge",25),lb(),w2(4,Jl,2,1,"span",26),lb()()),i&2){let e=SV().$implicit,t=SV();WB(2),H0("queryParams",d$(4,Bl,e.privacy.id))("title",t.getPrivacyFilterTitle(e.privacy.label)),WB(),H0("video",e),WB(),x2(e.blacklisted?4:-1);}}function tc(i,o){if(i&1&&(sp(0,"td"),Pp(1,"my-video-nsfw-badge",27),lb()),i&2){let e=SV().$implicit;WB(),H0("video",e);}}function ic(i,o){if(i&1&&(Pp(0,"br"),pb(1),vV(2,11),E$(3,"myNumberFormatter"),kp()),i&2){let e=SV(2).$implicit;WB(3),cx(e.viewers)(S$(3,2,e.views)),EV(2);}}function nc(i,o){if(i&1&&(sp(0,"td")(1,"a",28),pb(2),vV(3,10),E$(4,"myNumberFormatter"),kp(),w2(5,ic,4,4),lb()()),i&2){let e=SV().$implicit;WB(),H0("routerLink",d$(6,zl,e.shortUUID)),WB(3),cx(e.views)(S$(4,4,e.views)),EV(3),WB(),x2(e.isLive?5:-1);}}function oc(i,o){if(i&1&&(sp(0,"td")(1,"span"),vV(2,12),E$(3,"myNumberFormatter"),lb()()),i&2){let e=SV().$implicit;WB(3),cx(e.comments)(S$(3,2,e.comments)),EV(2);}}function rc(i,o){if(i&1&&(sp(0,"td"),XV(1),E$(2,"ptDate"),lb()),i&2){let e=SV().$implicit;WB(),Eb(" ",T$(2,1,e.publishedAt,"short")," ");}}function ac(i,o){if(i&1&&(sp(0,"td"),Pp(1,"my-video-state-badge",27),lb()),i&2){let e=SV().$implicit;WB(),H0("video",e);}}function sc(i,o){if(i&1&&XV(0),i&2){let e=SV(2).$implicit;Eb(" ",e.category.label," ");}}function lc(i,o){if(i&1&&(sp(0,"td"),w2(1,sc,1,1),lb()),i&2){let e=SV().$implicit;WB(),x2(e.category?.id?1:-1);}}function cc(i,o){if(i&1&&XV(0),i&2){let e=SV(2).$implicit;Eb(" ",e.language.label," ");}}function dc(i,o){if(i&1&&(sp(0,"td"),w2(1,cc,1,1),lb()),i&2){let e=SV().$implicit;WB(),x2(e.language?.id?1:-1);}}function _c(i,o){if(i&1&&XV(0),i&2){let e=SV(2).$implicit;Eb(" ",e.licence.label," ");}}function pc(i,o){if(i&1&&(sp(0,"td"),w2(1,_c,1,1),lb()),i&2){let e=SV().$implicit;WB(),x2(e.licence?.id?1:-1);}}function mc(i,o){if(i&1&&(sp(0,"a",31),XV(1),lb()),i&2){let e=o.$implicit,t=SV(3);HV(t.getPlaylistBadge(e.playlistDisplayName)),H0("routerLink",d$(4,Ul,e.playlistShortUUID)),WB(),Eb(" ",e.playlistDisplayName," ");}}function uc(i,o){if(i&1&&(sp(0,"td")(1,"div",29),N2(2,mc,2,6,"a",30,R2),lb()()),i&2){let e=SV().$implicit,t=SV();WB(2),M2(t.videosContainedInPlaylists[e.id]||l$(0,Hl));}}function hc(i,o){if(i&1&&(w2(0,Ql,2,1,"td"),w2(1,ql,2,1,"td"),w2(2,Kl,4,0,"td"),w2(3,ec,5,6,"td"),w2(4,tc,2,1,"td"),w2(5,nc,6,8,"td"),w2(6,oc,4,4,"td"),w2(7,rc,3,4,"td"),w2(8,ac,2,1,"td"),w2(9,lc,2,1,"td"),w2(10,dc,2,1,"td"),w2(11,pc,2,1,"td"),w2(12,uc,4,1,"td")),i&2){SV();let e=CV(6);x2(e.isColumnDisplayed("duration")?0:-1),WB(),x2(e.isColumnDisplayed("name")?1:-1),WB(),x2(e.isColumnDisplayed("tags")?2:-1),WB(),x2(e.isColumnDisplayed("privacy")?3:-1),WB(),x2(e.isColumnDisplayed("sensitive")?4:-1),WB(),x2(e.isColumnDisplayed("insights")?5:-1),WB(),x2(e.isColumnDisplayed("comments")?6:-1),WB(),x2(e.isColumnDisplayed("published")?7:-1),WB(),x2(e.isColumnDisplayed("state")?8:-1),WB(),x2(e.isColumnDisplayed("category")?9:-1),WB(),x2(e.isColumnDisplayed("language")?10:-1),WB(),x2(e.isColumnDisplayed("licence")?11:-1),WB(),x2(e.isColumnDisplayed("playlists")?12:-1);}}function gc(i,o){if(i&1){let e=F2();Pp(0,"my-button",32),sp(1,"my-video-actions-dropdown",33),Fp("videoRemoved",function(){GI(e),SV();let n=CV(6);return zI(n.loadData());})("videoFilesRemoved",function(){GI(e),SV();let n=CV(6);return zI(n.loadData());})("transcodingCreated",function(){GI(e),SV();let n=CV(6);return zI(n.loadData());})("videoExistsInPlaylistChange",function(){let n=GI(e).$implicit,r=SV();return zI(r.fetchVideosContainedInPlaylists([n]));})("videoImportRetried",function(){GI(e),SV();let n=CV(6);return zI(n.loadData());}),lb();}if(i&2){let e=o.$implicit,t=SV();H0("ptRouterLink",d$(3,Gl,e.shortUUID)),WB(),H0("video",e)("displayOptions",t.videoActionsOptions);}}function fc(i,o){if(i&1&&XV(0),i&2){let e=o.search,t=o.hasFilters,n=SV();Eb(" ",n.getNoResults(!!e||t)," ");}}var Fr=(()=>{class i{confirmService=g(cg);auth=g(Ze);notifier=g(rc$1);videoService=g(x);playlistService=g(Z);server=g($t);headerService=g(Fk);badgeService=g(i$1);route=g(Vr$1);table=xpe("table");bulkUpdateVideosInPlaylistModal=xpe("bulkUpdateVideosInPlaylistModal");bulkUpdateVideosModal=xpe("bulkUpdateVideosModal");videosContainedInPlaylists={};bulkActions=[];videoActionsOptions={playlist:true,download:true,update:false,blacklist:false,delete:true,report:false,duplicate:false,muteByUser:false,muteByServer:false,liveInfo:true,removeFiles:false,transcoding:false,retryFailedImport:true};user;channels=[];inputFilters=[];columns=[];customUpdateUrl;customParseQueryParams;dataLoader;constructor(){this.customUpdateUrl=this._customUpdateUrl.bind(this),this.customParseQueryParams=this._customParseQueryParams.bind(this),this.dataLoader=this._dataLoader.bind(this);}get serverConfig(){return this.server.getHTMLConfig();}ngOnInit(){this.headerService.setSearchHidden(true),this.user=this.auth.getUser(),this.columns=[{id:"duration",label:"\u65F6\u957F",selected:true,sortable:true},{id:"name",label:"\u540D\u79F0",selected:true,sortable:true},{id:"tags",label:"\u6807\u7B7E",selected:true,sortable:false},{id:"privacy",label:"\u9690\u79C1",selected:true,sortable:false},{id:"sensitive",label:"\u654F\u611F\u5185\u5BB9",selected:true,sortable:false},{id:"insights",label:"\u6570\u636E\u6D1E\u5BDF",selected:true,sortable:true,sortKey:"views"},{id:"comments",label:"\u8BC4\u8BBA",selected:true,sortable:true},{id:"published",label:"\u5DF2\u53D1\u5E03",selected:true,sortable:true,sortKey:"publishedAt"},{id:"state",label:"\u72B6\u6001",selected:true,sortable:false},{id:"category",label:"\u7C7B\u522B",selected:false,sortable:false},{id:"language",label:"\u8BED\u8A00",selected:false,sortable:false},{id:"licence",label:"\u8BB8\u53EF",selected:false,sortable:false},{id:"playlists",label:"\u64AD\u653E\u5217\u8868",selected:true,sortable:false}],this.inputFilters=[{type:"options",key:"isLive",title:"\u89C6\u9891\u7C7B\u578B",options:[{value:"all",label:"All"},{value:true,label:"\u76F4\u64AD"},{value:false,label:"\u70B9\u64AD"}]},{type:"options",key:"privacyOneOf",title:"\u9690\u79C1",options:[{value:"all",label:"All"},{value:Xt.PUBLIC,label:"\u516C\u5F00\u89C6\u9891"},{value:Xt.INTERNAL,label:"\u5185\u90E8\u89C6\u9891"},{value:Xt.UNLISTED,label:"\u672A\u5217\u51FA\u7684\u89C6\u9891"},{value:Xt.PASSWORD_PROTECTED,label:"\u53D7\u5BC6\u7801\u4FDD\u62A4\u7684\u89C6\u9891"},{value:Xt.PRIVATE,label:"\u79C1\u6709\u89C6\u9891"}]},{type:"tags",key:"tagsOneOf",title:"\u5305\u542B\u4EE5\u4E0B\u81F3\u5C11\u4E00\u4E2A\u6807\u7B7E"}],this._customParseQueryParams(this.route.snapshot.queryParams),this.buildActions();}ngOnDestroy(){this.headerService.setSearchHidden(false);}_customParseQueryParams(e){let t=e.channelNameOneOf?new Set(tm(e.channelNameOneOf)):new Set();this.user=this.auth.getUser(),this.channels=[...this.user.videoChannels,...this.user.videoChannelCollaborations].map(n=>E(D({},n),{selected:t.has(n.name)}));}getNoResults(e){return e?"\u672A\u627E\u5230\u5339\u914D\u4F60\u7B5B\u9009\u5668\u7684\u89C6\u9891\u3002":this.channels.some(t=>t.selected)?"\u5728\u6240\u9009\u9891\u9053\u4E2D\u672A\u627E\u5230\u89C6\u9891\u3002":"\u4F60\u8FD8\u6CA1\u6709\u53D1\u5E03\u4EFB\u4F55\u89C6\u9891\u3002";}_customUpdateUrl(){return{channelNameOneOf:this.channels.filter(t=>t.selected).map(t=>t.name)};}_dataLoader(e){let{pagination:t,sort:n,search:r,isLive:s,privacyOneOf:d,tagsOneOf:u}=e,S=this.channels.filter(v=>v.selected).map(v=>v.name);return this.videoService.listMyVideos({restPagination:t,sort:n,search:r,includeCollaborations:true,channelNameOneOf:S.length!==0?S:void 0,isLive:s,privacyOneOf:d!==void 0?[d]:void 0,tagsOneOf:u}).pipe(lt(({data:v})=>this.fetchVideosContainedInPlaylists(v)));}fetchVideosContainedInPlaylists(e){this.playlistService.doVideosExistInPlaylist(e.map(t=>t.id)).subscribe(t=>{this.videosContainedInPlaylists=Object.keys(t).reduce((n,r)=>E(D({},n),{[r]:rHe(t[+r],s=>s.playlistId)}),this.videosContainedInPlaylists);});}getPlaylistBadge(e){return this.badgeService.getRandomBadge("playlist",e);}removeVideos(e){return L(this,null,function*(){let t=CAe("\u4F60\u786E\u5B9A\u8981\u5220\u9664 {count, plural, =1 {\u6B64\u89C6\u9891} other {\u8FD9 {count} \u4E2A\u89C6\u9891}}\u5417\uFF1F",{count:e.length});(yield this.confirmService.confirm(t,"\u5220\u9664"))!==false&&this.videoService.removeVideo(e.map(r=>r.id)).subscribe({next:()=>{this.notifier.success(CAe("\u5DF2\u5220\u9664 {count, plural, =1 {1 \u4E2A\u89C6\u9891} other {{count} \u4E2A\u89C6\u9891}}\u3002",{count:e.length})),this.table().loadData();},error:r=>this.notifier.handleError(r)});});}buildActions(){this.bulkActions=[[{label:"Add to playlist...",handler:e=>{this.bulkUpdateVideosInPlaylistModal().show({videos:e,videosContainedInPlaylists:this.videosContainedInPlaylists});},iconName:"playlist-add"},{label:"Update...",handler:e=>this.bulkUpdateVideosModal().show({videos:e}),iconName:"edit"}],[{label:"\u5220\u9664",handler:e=>this.removeVideos(e),iconName:"delete"}]];}getPrivacyFilterTitle(e){return"Filter by privacy: "+e+"";}static ɵfac=function(t){return new(t||i)();};static ɵcmp=Pa$1({type:i,selectors:[["my-videos"]],viewQuery:function(t,n){t&1&&px(n.table,Vl,5)(n.bulkUpdateVideosInPlaylistModal,$l,5)(n.bulkUpdateVideosModal,kl,5),t&2&&IV(3);},decls:19,vars:6,consts:()=>{let e;e="\u6BCF\u9875\u89C6\u9891";let t;t="\u6BCF\u4E2A\u9891\u9053\uFF1A";let n;n="{VAR_PLURAL, plural, =0 {\u65E0\u89C6\u9891} =1 {1 \u4E2A\u89C6\u9891} other {{INTERPOLATION} \u4E2A\u89C6\u9891}}",n=bV(n,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let r;r="\u5DF2\u5C4F\u853D";let s;s="\u5BFC\u822A\u5230\u89C6\u9891\u7EDF\u8BA1\u9875\u9762";let d;d="{VAR_PLURAL, plural, =0 {\u65E0\u4EBA\u89C2\u770B} =1 {1 \u6B21\u89C2\u770B} other {{INTERPOLATION} \u6B21\u89C2\u770B}}",d=bV(d,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let u;u="{VAR_PLURAL, plural, =0 {\u6CA1\u6709\u89C2\u4F17} =1 {1 \u4F4D\u89C2\u4F17} other {{INTERPOLATION} \u4F4D\u89C2\u4F17}}",u=bV(u,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let S;S="{VAR_PLURAL, plural, =0 {\u6CA1\u6709\u8BC4\u8BBA} =1 {1 \u5219\u8BC4\u8BBA} other {{INTERPOLATION} \u5219\u8BC4\u8BBA}}",S=bV(S,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let v;return v="\u7BA1\u7406",[["table",""],["totalTitle",""],["tableCells",""],["actionCell",""],["noResults",""],["bulkUpdateVideosInPlaylistModal",""],["bulkUpdateVideosModal",""],t,n,r,d,u,S,[1,"channel-filters"],[1,"channel-label"],[3,"channel","ngModel"],["key","MyVideosComponent","defaultSort","publishedAt","paginatorText",e,"defaultRowsPerPage","5","searchInput","true","canUseMatchSort","true",3,"defaultColumns","bulkActions","dataLoader","customParseQueryParams","customUpdateUrl","inputFilters"],[3,"saved"],[3,"ngModelChange","channel","ngModel"],["thumbnail","true","title","false",3,"video"],["thumbnail","false","title","true","displayEditorInfo","true",1,"video-cell-name",3,"video"],[1,"badges","tags"],["routerLink",".",1,"pt-badge","badge-secondary","pt-badge-keep-case",3,"queryParams"],[1,"pt-badges-container"],["routerLink",".",3,"queryParams","title"],["displayTooltip","false",3,"video"],[1,"pt-badge","badge-red",3,"ngbTooltip"],[3,"video"],["title",s,1,"pt",3,"routerLink"],[1,"badges","playlists"],[1,"pt-badge","pt-badge-keep-case",3,"class","routerLink"],[1,"pt-badge","pt-badge-keep-case",3,"routerLink"],["label",v,"theme","secondary","icon","film","responsiveLabel","true",1,"me-3",3,"ptRouterLink"],["placement","bottom auto","buttonIcon","more-horizontal","buttonStyled","true",3,"videoRemoved","videoFilesRemoved","transcodingCreated","videoExistsInPlaylistChange","videoImportRetried","video","displayOptions"]];},template:function(t,n){if(t&1){let r=F2();sp(0,"div",13)(1,"div",14),vV(2,7),lb(),N2(3,Wl,1,2,"my-channel-toggle",15,Xl),lb(),sp(5,"my-table",16,0),w0(7,jl,3,4,"ng-template",null,1,I$)(9,hc,13,13,"ng-template",null,2,I$)(11,gc,2,5,"ng-template",null,3,I$)(13,fc,1,1,"ng-template",null,4,I$),lb(),sp(15,"my-bulk-update-videos-in-playlist-modal",17,5),Fp("saved",function(d){return n.fetchVideosContainedInPlaylists(d);}),lb(),sp(17,"my-bulk-update-videos-modal",17,6),Fp("saved",function(){GI(r);let d=CV(6);return zI(d.loadData());}),lb();}t&2&&(WB(3),M2(n.channels),WB(2),H0("defaultColumns",n.columns)("bulkActions",n.bulkActions)("dataLoader",n.dataLoader)("customParseQueryParams",n.customParseQueryParams)("customUpdateUrl",n.customUpdateUrl)("inputFilters",n.inputFilters));},dependencies:[Jn,qn,ln$1,it,ef,tf,Vi,Qh,Zh,kr,Di,Qn$1,Lh,Un$1,$r,tl$2,d$1,p$1],styles:["my-select-checkbox[_ngcontent-%COMP%]{min-width:250px}.pt-badge[_ngcontent-%COMP%]{margin-inline-end:.3125rem}.badges[_ngcontent-%COMP%]   .pt-badge[_ngcontent-%COMP%]{max-width:200px;vertical-align:bottom;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.video-info[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{display:flex}.video-info[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]   my-global-icon[_ngcontent-%COMP%]{position:relative;top:-2px;display:inline-block;width:16px;height:16px;line-height:16px;margin-inline-start:.1875rem}td[_ngcontent-%COMP%]{padding-top:.75rem;padding-bottom:.75rem}.channel-label[_ngcontent-%COMP%]{color:var(--fg-200);font-weight:700;white-space:nowrap}.channel-filters[_ngcontent-%COMP%]{display:flex;align-items:center;padding-bottom:1rem;border-bottom:1px solid var(--bg-secondary-400);margin-bottom:1rem;gap:1rem;overflow:hidden}.channel-filters[_ngcontent-%COMP%]:hover{overflow:auto}@media screen and (min-width:800px){.video-cell-name[_ngcontent-%COMP%]{width:300px;display:block}}@media screen and (max-width:800px){my-video-cell[_ngcontent-%COMP%]{max-width:120px;display:block}}"],changeDetection:1});}return i;})();var Br=(()=>{class i{static ɵfac=function(t){return new(t||i)();};static ɵcmp=Pa$1({type:i,selectors:[["ng-component"]],decls:7,vars:0,consts:()=>{let e;e="\u5305\u542B\u4EFB\u4F55\u5173\u6CE8\u8BCD\u7684\u8BC4\u8BBA\u90FD\u4F1A\u81EA\u52A8\u6807\u6709\u5217\u8868\u540D\u79F0\u3002";let t;return t="\u8FD9\u4E9B\u81EA\u52A8\u6807\u7B7E\u53EF\u4EE5\u7528\u4E8E\u8FC7\u6EE4\u8BC4\u8BBA\u6216 "+"\uFFFD#5\uFFFD"+"\u81EA\u52A8\u963B\u6B62"+"\uFFFD/#5\uFFFD"+" \u4ED6\u4EEC\u3002",[e,t,[1,"callout","callout-primary","mb-4"],["routerLink","/my-account/auto-tag-policies"],["mode","user"]];},template:function(t,n){t&1&&(sp(0,"div",2)(1,"div"),vV(2,0),lb(),sp(3,"div"),sx(4,1),Pp(5,"a",3),ax(),lb()(),Pp(6,"my-watched-words-list-admin-owner",4));},dependencies:[Wo$1,Zh],encapsulation:2,changeDetection:1});}return i;})();var zr=(()=>{class i{static ɵfac=function(t){return new(t||i)();};static ɵcmp=Pa$1({type:i,selectors:[["ng-component"]],features:[u$([Qe])],decls:3,vars:0,consts:()=>{let e;return e=" Subscribe to remote watched words lists to automatically keep them synchronized.\n",[e,[1,"callout","callout-primary","mb-4"],["mode","user"]];},template:function(t,n){t&1&&(sp(0,"div",1),vV(1,0),lb(),Pp(2,"my-watched-words-subscriptions-admin-owner",2));},dependencies:[la$1],encapsulation:2,changeDetection:1});}return i;})();var pn={path:"",providers:[Ht$1,Dt,Nt$1,d,B,Kt,Me,p,_],resolve:{user:n},canActivateChild:[ck]},Gr=[{path:"videos/comments",redirectTo:"comments-on-my-videos",pathMatch:"full"},{path:"comments-on-my-videos",component:Yo,data:{meta:{title:"\u60A8\u7684\u89C6\u9891\u7684\u8BC4\u8BBA"}}},{path:"watched-words/list",component:Br,data:{meta:{title:"\u60A8\u5173\u6CE8\u7684\u8BCD\u8BED"}}},{path:"watched-words/subscriptions",component:zr,data:{meta:{title:"Your watched words subscriptions"}}},{path:"auto-tag-policies",component:Vo,resolve:{tags:$o},data:{meta:{title:"\u60A8\u7684\u81EA\u52A8\u6807\u7B7E\u653F\u7B56"}}},{path:"videos",component:Fr,data:{meta:{title:"\u6211\u7684\u89C6\u9891"}}},{path:"video-imports",component:Jo,data:{meta:{title:"\u6211\u7684\u89C6\u9891\u5BFC\u5165"}}},{path:"ownership",component:qo,data:{meta:{title:"\u89C6\u9891\u8F6C\u79FB"}}}],Xr=[{path:"",redirectTo:"video-channels",pathMatch:"full"},{path:"video-channels",loadChildren:()=>import('./chunk-B_NpDqJg.js')},{path:"followers",component:zo,data:{meta:{title:"\u6211\u7684\u5173\u6CE8\u8005"}}},{path:"video-channel-syncs",component:Zo,data:{meta:{title:"\u6211\u7684\u540C\u6B65"}}},{path:"video-channel-syncs/create",component:Ko,data:{meta:{title:"\u65B0\u5EFA\u540C\u6B65"}}}],Cc=[{path:"video-playlists",component:xr,data:{meta:{title:"\u6211\u7684\u64AD\u653E\u5217\u8868"}}},{path:"video-playlists/create",component:er,data:{meta:{title:"\u65B0\u5EFA\u64AD\u653E\u5217\u8868"}}},{path:"video-playlists/:videoPlaylistId",component:Nr,data:{meta:{title:"\u64AD\u653E\u5217\u8868\u5143\u7D20"}}},{path:"video-playlists/update/:videoPlaylistId",component:Lr,data:{meta:{title:"\u66F4\u65B0\u64AD\u653E\u5217\u8868"}}},{path:"subscriptions",component:Uo,data:{meta:{title:"\u6211\u7684\u8BA2\u9605"}}},{path:"history/videos",component:Xo,data:{meta:{title:"\u6211\u7684\u89C6\u9891\u5386\u53F2"},reuse:{enabled:true,key:"my-videos-history-list"}}}];function Hr(i){if(i.length===0)return false;let o=i[0].path;return Gr.some(e=>e.path===o||e.path.startsWith(`${o}/`));}function Ur(i){if(i.length===0)return false;let o=i[0].path;return Xr.some(e=>e.path===o||e.path.startsWith(`${o}/`));}var Y0=[E(D({},pn),{component:Yr,canMatch:[(i,o)=>Hr(o)],children:Gr}),E(D({},pn),{component:Bo,canMatch:[(i,o)=>Ur(o)],children:Xr}),E(D({},pn),{component:Wo,canMatch:[(i,o)=>!Hr(o)&&!Ur(o)],children:Cc})];/**i18n:c8855ca17fb20171aa9dd43d012e42547cb1f0cfd9c21d4dc05679bbbdf5ccb8*/export{Y0 as default};//# sourceMappingURL=chunk-Cz8DL3fA.js.map