This repository has been archived on 2026-02-28. You can view files and clone it, but cannot push or open issues or pull requests.
ServerSpacebarOld/assets/public/client/66d4008a7f74ee37111d.js
2025-12-08 18:44:58 +02:00

30 lines
28 KiB
JavaScript

"use strict";(this.webpackChunkdiscord_app=this.webpackChunkdiscord_app||[]).push([[61012],{761012:(e,n,t)=>{t.d(n,{S:()=>Ce,Z:()=>De});var r=t(785893),o=t(667294),c=t(294184),a=t.n(c),i=t(202351),l=t(513328),s=t(707961),u=t(656645),f=t(769321),d=t(597246),p=t(579581),O=t(159895),b=t(799066),g=t(473903),v=t(850841),y=t(492886),m=t(296872),h=t(359721),j=t(504001),E=t(971402),w=t(153686),P=t(19585),A=t(115617),_=t(550254),I=t(633878);function M(e,n,t){n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t;return e}function x(e,n){n=null!=n?n:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):function(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})));t.push.apply(t,r)}return t}(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))
}));return e}function k(e,n){if(null==e)return{};var t,r,o=function(e,n){if(null==e)return{};var t,r,o={},c=Object.keys(e);for(r=0;r<c.length;r++){t=c[r];n.indexOf(t)>=0||(o[t]=e[t])}return o}(e,n);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(r=0;r<c.length;r++){t=c[r];n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}}return o}function C(e){var n=e.width,t=void 0===n?24:n,o=e.height,c=void 0===o?24:o,a=e.color,i=void 0===a?"currentColor":a,l=e.className,s=e.foreground,u=k(e,["width","height","color","className","foreground"]);return(0,r.jsx)("svg",x(function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))));r.forEach((function(n){M(e,n,t[n])}))}return e}({},(0,I.Z)(u)),{className:l,width:t,height:c,
viewBox:"0 0 32 32",children:(0,r.jsx)("path",{className:s,
d:"M10.5 24c0-3.682 2.318-6 6-6s6 2.318 6 6h-12zM16.5 16a4 4 0 100-8 4 4 0 000 8zM29.166 15.334H28.5a.334.334 0 00-.334.333v.667c0 .183.15.333.334.333h.666c.184 0 .334-.15.334-.333v-.667a.334.334 0 00-.334-.333zM26.5 15h-1.333a.334.334 0 00-.334.333v1.334c0 .183.15.333.334.333H26.5c.183 0 .334-.15.334-.333v-1.334A.334.334 0 0026.5 15zM31.167 16.333a.333.333 0 100-.667.333.333 0 000 .667zM29.166 11.334H28.5a.334.334 0 00-.334.333v.667c0 .183.15.333.334.333h.666c.184 0 .334-.15.334-.333v-.667a.334.334 0 00-.334-.333zM26.5 11h-1.333a.334.334 0 00-.334.333v1.334c0 .183.15.333.334.333H26.5c.183 0 .334-.15.334-.333v-1.334A.334.334 0 0026.5 11zM31.167 12.333a.333.333 0 100-.667.333.333 0 000 .667zM29.166 7.334H28.5a.335.335 0 00-.334.333v.667c0 .183.15.333.334.333h.666c.184 0 .334-.15.334-.333v-.667a.335.335 0 00-.334-.333zM26.5 7h-1.333a.335.335 0 00-.334.333v1.334c0 .183.15.333.334.333H26.5c.183 0 .334-.15.334-.333V7.333A.335.335 0 0026.5 7zM31.167 8.333a.333.333 0 100-.667.333.333 0 000 .667zM29.166 23.334H28.5a.334.334 0 00-.334.333v.667c0 .183.15.333.334.333h.666c.184 0 .334-.15.334-.333v-.667a.334.334 0 00-.334-.333zM26.5 23h-1.333a.334.334 0 00-.334.333v1.334c0 .183.15.333.334.333H26.5c.183 0 .334-.15.334-.333v-1.334A.334.334 0 0026.5 23zM31.167 24.333a.333.333 0 100-.667.333.333 0 000 .667zM29.166 19.334H28.5a.334.334 0 00-.334.333v.667c0 .183.15.333.334.333h.666c.184 0 .334-.15.334-.333v-.667a.334.334 0 00-.334-.333zM26.5 19h-1.333a.334.334 0 00-.334.333v1.334c0 .183.15.333.334.333H26.5c.183 0 .334-.15.334-.333v-1.334A.334.334 0 0026.5 19zM31.167 20.333a.333.333 0 100-.667.333.333 0 000 .667zM4.5 15.334h-.667a.334.334 0 00-.333.333v.667c0 .183.15.333.333.333H4.5c.183 0 .333-.15.333-.333v-.667a.334.334 0 00-.333-.333zM7.833 15H6.5a.335.335 0 00-.333.333v1.334c0 .183.15.333.333.333h1.333c.184 0 .333-.15.333-.333v-1.334A.334.334 0 007.833 15zM1.833 16.333a.333.333 0 100-.667.333.333 0 000 .667zM4.5 11.334h-.667a.334.334 0 00-.333.333v.667c0 .183.15.333.333.333H4.5c.183 0 .333-.15.333-.333v-.667a.334.334 0 00-.333-.333zM7.833 11H6.5a.335.335 0 00-.333.333v1.334c0 .183.15.333.333.333h1.333c.184 0 .333-.15.333-.333v-1.334A.334.334 0 007.833 11zM1.833 12.333a.333.333 0 100-.667.333.333 0 000 .667zM4.5 7.334h-.667a.335.335 0 00-.333.333v.667c0 .183.15.333.333.333H4.5c.183 0 .333-.15.333-.333v-.667a.335.335 0 00-.333-.333zM7.833 7H6.5a.335.335 0 00-.333.333v1.334c0 .183.15.333.333.333h1.333c.184 0 .333-.15.333-.333V7.333A.335.335 0 007.833 7zM1.833 8.333a.333.333 0 100-.667.333.333 0 000 .667zM4.5 23.334h-.667a.334.334 0 00-.333.333v.667c0 .183.15.333.333.333H4.5c.183 0 .333-.15.333-.333v-.667a.334.334 0 00-.333-.333zM7.833 23H6.5a.335.335 0 00-.333.333v1.334c0 .183.15.333.333.333h1.333c.184 0 .333-.15.333-.333v-1.334A.334.334 0 007.833 23zM1.833 24.333a.333.333 0 100-.667.333.333 0 000 .667zM4.5 19.334h-.667a.334.334 0 00-.333.333v.667c0 .183.15.333.333.333H4.5c.183 0 .333-.15.333-.333v-.667a.334.334 0 00-.333-.333zM7.833 19H6.5a.335.335 0 00-.333.333v1.334c0 .183.15.333.333.333h1.333c.184 0 .333-.15.333-.333v-1.334A.334.334 0 007.833 19zM1.833 20.333a.333.333 0 100-.667.333.333 0 000 .667z",
fill:i})}))}var D=t(655402),N=t(95891),S=t(778613),R=t(701190),Z=t(531441),T=t(786170),B=t(652591),V=t(775173),U=t(102921),L=t(266348),z=t(232806),H=t(2590),G=t(630670),W=t(921431),K=t(203600),F=t(473708),q=t(665821),$=t.n(q);function X(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}function Y(e,n,t,r,o,c,a){try{var i=e[c](a),l=i.value}catch(e){t(e);return}i.done?n(l):Promise.resolve(l).then(r,o)}function J(e){return function(){var n=this,t=arguments;return new Promise((function(r,o){var c=e.apply(n,t);function a(e){Y(c,r,o,a,i,"next",e)}function i(e){Y(c,r,o,a,i,"throw",e)}a(void 0)}))}}function Q(e,n,t){n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t;return e}function ee(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){
return Object.getOwnPropertyDescriptor(t,e).enumerable}))));r.forEach((function(n){Q(e,n,t[n])}))}return e}function ne(e,n){n=null!=n?n:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):function(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})));t.push.apply(t,r)}return t}(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}));return e}function te(e,n){if(null==e)return{};var t,r,o=function(e,n){if(null==e)return{};var t,r,o={},c=Object.keys(e);for(r=0;r<c.length;r++){t=c[r];n.indexOf(t)>=0||(o[t]=e[t])}return o}(e,n);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(r=0;r<c.length;r++){t=c[r];n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}}return o}function re(e,n){return function(e){
if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,o,c=[],a=!0,i=!1;try{for(t=t.call(e);!(a=(r=t.next()).done);a=!0){c.push(r.value);if(n&&c.length===n)break}}catch(e){i=!0;o=e}finally{try{a||null==t.return||t.return()}finally{if(i)throw o}}return c}}(e,n)||function(e,n){if(!e)return;if("string"==typeof e)return X(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return X(e,n)}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var oe=function(e,n){var t,r,o,c,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return c={next:i(0),throw:i(1),return:i(2)},
"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function i(c){return function(i){return function(c){if(t)throw new TypeError("Generator is already executing.");for(;a;)try{if(t=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;(r=0,o)&&(c=[2&c[0],o.value]);switch(c[0]){case 0:case 1:o=c;break;case 4:a.label++;return{value:c[1],done:!1};case 5:a.label++;r=c[1];c=[0];continue;case 7:c=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1];o=c;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(c);break}o[2]&&a.ops.pop();a.trys.pop();continue}c=n.call(e,a)}catch(e){c=[6,e];r=0}finally{t=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,i])}}};function ce(e){
var n,t=e.icon,o=e.iconClassName,c=e.onClick,i=e.text,l=e.children,u=e.className,f=e.selected,d=void 0!==f&&f,p=e.disabled,O=void 0!==p&&p,b=e.onMouseLeave,g=e.onBlur;return(0,r.jsxs)(s.P3F,{className:a()(u,$().backgroundOption,(n={},Q(n,$().backgroundOptionSelected,d),Q(n,$().backgroundOptionDisabled,O),n)),onMouseLeave:b,onBlur:g,onClick:O?void 0:c,children:[d?(0,r.jsx)("div",{className:$().backgroundOptionRing}):null,(0,r.jsxs)("div",{className:$().backgroundOptionInner,children:[l,(0,r.jsxs)("div",{className:$().backgroundOptionContent,children:[(0,r.jsx)(t,{className:a()($().backgroundIconOptionIcon,o)}),(0,r.jsx)(s.xvT,{className:$().backgroundOptionText,color:"none",variant:"text-sm/normal",children:i})]})]})]})}function ae(e){var n=e.option,t=e.source,c=e.isAnimated,a=re(o.useState(!1),2),i=a[0],l=a[1];o.useEffect((function(){(new Image).src=t}),[t]);if(!c||null==n)return(0,r.jsx)("div",{className:$().backgroundImageOption,style:{backgroundImage:"url(".concat(t,")")}})
;var s=(0,V.rI)({userId:n.user_id,assetId:n.id,assetHash:n.asset,size:720,canAnimate:!1});return(0,r.jsx)("img",{onMouseMove:function(){return l(!0)},onMouseLeave:function(){return l(!1)},className:$().backgroundImageOption,src:i?t:s,alt:n.id})}function ie(e){var n=function(){if(null!=b&&h){A.Kw(b);B.default.track(H.rMx.PREMIUM_UPSELL_VIEWED,{type:K.cd.ANIMATED_VIDEO_BACKGROUND_NEW_PRESET,location:v.location,location_stack:y})}},o=e.option,c=e.source,l=e.selected,u=void 0!==l&&l,f=e.onSelectOption,d=e.isAnimatedImage,O=e.isVideo,b=e.hotspotLocation,g=te(e,["option","source","selected","onSelectOption","isAnimatedImage","isVideo","hotspotLocation"]),v=(0,p.O)(),y=(0,P.Z)(w.Z.VIDEO_BACKGROUND_IMAGE_OPTION).analyticsLocations,h=(0,i.e7)([_.Z],(function(){return null!=b&&_.Z.hasHotspot(b)})),j=O?(0,r.jsx)(T.Z,{className:$().backgroundImageOption,src:c,loop:!0,playOnHover:!0,muted:!0}):(0,r.jsx)(ae,{isAnimated:d,option:(0,m.rD)(o)?o:void 0,source:c});return(0,r.jsxs)(s.P3F,ne(ee({},g),{
className:a()($().backgroundOption,Q({},$().backgroundOptionSelected,u)),onClick:function(){return f(o)},onContextMenu:function(e){return(0,E.jW)(e,J((function(){var e,n;return oe(this,(function(c){switch(c.label){case 0:return[4,t.e(84264).then(t.bind(t,284264))];case 1:e=c.sent(),n=e.default;return[2,function(e){return(0,r.jsx)(n,ne(ee({},e),{backgroundOption:o,optionIsInUse:u}))}]}}))})))},children:[u?(0,r.jsx)("div",{className:$().backgroundOptionRing}):null,(0,r.jsx)("div",{onFocus:n,onMouseEnter:n,className:$().backgroundOptionInner,children:j}),O||d?(0,r.jsx)(R.Z,{className:$().playIcon}):null,h&&(0,r.jsx)(Z.IG,{text:F.Z.Messages.NEW,className:$().newTextBadge})]}))}function le(){return(0,r.jsxs)("div",{className:$().customBackgroundTooltip,children:[(0,r.jsx)(N.Z,{className:$().customBackgroundTooltipIcon}),(0,r.jsx)(s.xvT,{variant:"text-sm/normal",children:F.Z.Messages.CAMERA_PREVIEW_VIDEO_BACKGROUND_CUSTOM_TOOLTIP})]})}function se(e){
var n=e.onClick,t=e.tooltipText,o=e.disabled,c=void 0!==o&&o,a=function(){A.Kw(G.v.ANIMATED_VIDEO_BG_CUSTOM_TOOLTIP_NEW)},l=(0,i.e7)([_.Z],(function(){return _.Z.hasHotspot(G.v.ANIMATED_VIDEO_BG_CUSTOM_TOOLTIP_NEW)})),u=l?F.Z.Messages.CAMERA_PREVIEW_VIDEO_BACKGROUND_NEW_ANIMATED_TOOLTIP:t;return(0,r.jsxs)(s.DY3,{text:u,className:$().newBackgroundTooltipContainer,children:[(0,r.jsxs)(ce,{className:$().backgroundOptionBlurred,disabled:c,icon:D.Z,iconClassName:$().uploadIconOption,onClick:n,onMouseLeave:a,onBlur:a,text:(0,r.jsxs)("div",{className:$().backgroundCustomInlineUpsell,children:[(0,r.jsx)(N.Z,{className:$().backgroundCustomInlineUpsellIcon}),(0,r.jsx)("div",{className:$().overflowEllipsis,children:F.Z.Messages.CAMERA_PREVIEW_VIDEO_BACKGROUND_CUSTOM})]}),children:[(0,r.jsx)("div",{className:$().backgroundCustomInlineUpsellBackground}),(0,r.jsx)("div",{className:$().backgroundCustomInlineUpsellBackgroundDarkener})]}),l&&(0,r.jsx)(Z.IG,{text:F.Z.Messages.NEW,
className:$().newTextBadge})]})}function ue(e){var n=e.onClick,t=(0,p.O)(),c=(0,P.Z)(w.Z.VIDEO_BACKGROUND_CUSTOM_UPSELL).analyticsLocations;o.useEffect((function(){B.default.track(H.rMx.PREMIUM_UPSELL_VIEWED,{type:K.cd.VIDEO_BACKGROUNDS_INLINE,location:t.location,location_stack:c})}),[]);return(0,r.jsx)(se,{onClick:n,tooltipText:F.Z.Messages.CAMERA_PREVIEW_VIDEO_BACKGROUND_UPSELL_TOOLTIP})}function fe(e){var n=e.onAddBackgroundImage,o=e.disabled,c=(0,s.vRw)(),a=o?F.Z.Messages.CAMERA_PREVIEW_VIDEO_BACKGROUND_UPLOAD_TOOLTIP_MAX_REACHED.format({maxCustomBackgrounds:25}):F.Z.Messages.CAMERA_PREVIEW_VIDEO_BACKGROUND_UPLOAD_TOOLTIP_PREMIUM,i=[{name:F.Z.Messages.IMAGES,extensions:["jpg","jpeg","png","gif","mp4"]}];return(0,r.jsx)(se,{disabled:o,onClick:function(){(0,s.ZDy)(J((function(){var e,o;return oe(this,(function(c){switch(c.label){case 0:
return[4,Promise.all([t.e(40532),t.e(12916),t.e(97815),t.e(93132),t.e(28401),t.e(96075),t.e(96810),t.e(42212),t.e(97264),t.e(93538)]).then(t.bind(t,597264))];case 1:e=c.sent(),o=e.default;return[2,function(e){return(0,r.jsx)(o,ee({maxFileSizeBytes:z.SJ,onComplete:n,uploadType:W.pC.VIDEO_BACKGROUND,filters:i,modalTitle:F.Z.Messages.UPLOAD_BACKGROUND,imageSpecifications:F.Z.Messages.CAMERA_PREVIEW_VIDEO_BACKGROUND_UPLOAD_SUBTITLE,uploadOptionTitle:F.Z.Messages.SELECT_IMAGE_MODAL_UPLOAD_IMAGE_OR_VIDEO,showUpsellHeader:!0},e))}]}}))})),{contextKey:c})},tooltipText:a})}function de(e){var n=e.canUseCustomBackgrounds,t=e.customBackgroundOptions,c=e.selectedOption,a=e.onSelectOption,i=e.onUpsellClick,l=e.onAddBackgroundImage,u=e.smallerOptions,f=o.useMemo((function(){return t.sort((function(e,n){return null==e.last_used||null==n.last_used?U.Z.compare(n.id,e.id):new Date(n.last_used).getTime()-new Date(e.last_used).getTime()}))}),[t]),d=f.length>=25,p=(0,
P.Z)(w.Z.VIDEO_BACKGROUND_OPTIONS).AnalyticsLocationProvider,O=Object.values((0,L.Z)()).sort((function(e,n){return z.E1[e.id]-z.E1[n.id]}));return(0,r.jsx)(p,{children:(0,r.jsxs)("div",{className:u?$().backgroundOptionsSmall:$().backgroundOptionsLarge,children:[(0,r.jsx)(ce,{selected:null==c,icon:S.Z,iconClassName:$().noneOptionIcon,onClick:function(){return a(null)},text:F.Z.Messages.CAMERA_PREVIEW_VIDEO_BACKGROUND_NONE}),(0,r.jsx)(ce,{className:$().backgroundOptionBlurred,selected:c===z.f7,icon:C,iconClassName:$().blurOptionIcon,onClick:function(){return a(z.f7)},text:F.Z.Messages.CAMERA_PREVIEW_VIDEO_BACKGROUND_BLUR,children:(0,r.jsx)("div",{className:$().backgroundOptionBlurBackground})}),n?(0,r.jsx)(fe,{onAddBackgroundImage:l,disabled:d}):(0,r.jsx)(ue,{onClick:i}),f.map((function(e){return(0,r.jsx)(s.ua7,{text:(0,r.jsx)(le,{}),"aria-label":F.Z.Messages.CAMERA_PREVIEW_VIDEO_BACKGROUND_CUSTOM_TOOLTIP,children:function(n){var t=(0,V.rI)({userId:e.user_id,assetId:e.id,
assetHash:e.asset,size:720});return null==t?null:(0,o.createElement)(ie,ne(ee({},n),{key:e.id,option:e,source:t,selected:(0,m.rD)(c)&&c.id===e.id,onSelectOption:a,isVideo:(0,V.ay)(e.asset),isAnimatedImage:(0,V.xR)(e.asset)}))}},e.id)})),O.map((function(e){var n=!0===e.isVideo;return(0,r.jsx)(s.ua7,{text:e.name,"aria-label":e.name,children:function(t){return(0,o.createElement)(ie,ne(ee({},t),{key:e.id,option:e.id,source:e.source,selected:c===e.id,onSelectOption:a,isVideo:n,isAnimatedImage:!1,hotspotLocation:e.hotspotLocation}))}},e.id)}))]})})}var pe=t(964525),Oe=t(990154),be=t.n(Oe);function ge(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}function ve(e,n,t,r,o,c,a){try{var i=e[c](a),l=i.value}catch(e){t(e);return}i.done?n(l):Promise.resolve(l).then(r,o)}function ye(e){return function(){var n=this,t=arguments;return new Promise((function(r,o){var c=e.apply(n,t);function a(e){ve(c,r,o,a,i,"next",e)}function i(e){ve(c,r,o,a,i,"throw",e)}
a(void 0)}))}}function me(e,n,t){n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t;return e}function he(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))));r.forEach((function(n){me(e,n,t[n])}))}return e}function je(e,n){n=null!=n?n:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):function(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})));t.push.apply(t,r)}return t}(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}));return e}function Ee(e,n){return function(e){if(Array.isArray(e))return e
}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,o,c=[],a=!0,i=!1;try{for(t=t.call(e);!(a=(r=t.next()).done);a=!0){c.push(r.value);if(n&&c.length===n)break}}catch(e){i=!0;o=e}finally{try{a||null==t.return||t.return()}finally{if(i)throw o}}return c}}(e,n)||function(e,n){if(!e)return;if("string"==typeof e)return ge(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return ge(e,n)}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var we=function(e,n){var t,r,o,c,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return c={next:i(0),throw:i(1),return:i(2)},
"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function i(c){return function(i){return function(c){if(t)throw new TypeError("Generator is already executing.");for(;a;)try{if(t=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;(r=0,o)&&(c=[2&c[0],o.value]);switch(c[0]){case 0:case 1:o=c;break;case 4:a.label++;return{value:c[1],done:!1};case 5:a.label++;r=c[1];c=[0];continue;case 7:c=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1];o=c;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(c);break}o[2]&&a.ops.pop();a.trys.pop();continue}c=n.call(e,a)}catch(e){c=[6,e];r=0}finally{t=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,i])}}};function Pe(e){
var n=e.onLearnMore,c=e.selectedBackgroundOption,a=e.onSelectBackgroundOption,l=e.currentDeviceId,u=e.smallerBackgroundOptions,f=(0,i.e7)([g.default],(function(){return g.default.getCurrentUser()})),E=Ee(o.useState(null),2),w=E[0],P=E[1];(0,O.Z$)(b.Z);var A=(0,j.Z)(),_=v.ZP.canUseCustomBackgrounds(f),I=(0,i.cj)([y.Z],(function(){return _?y.Z.videoFilterAssets:{}})),M=o.useMemo((function(){return Object.values(I).filter((function(e){return e.type===z.xV.BACKGROUND}))}),[I]),x=(0,p.O)();o.useEffect((function(){A?(0,h.FU)(c,l,{track:!1}).catch((function(){return a(null)})):null!=c&&a(null)}),[l]);var k=function(e){a(e);(0,h.FU)(e,l,{location:x.location}).then((function(){return P(null)})).catch((function(){P(F.Z.Messages.VIDEO_BACKGROUND_ERROR_APPLY);(0,h.FU)(null,l,{location:x.location})}))};return A?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s.X6q,{className:be().spacingTop24,variant:"eyebrow",color:"header-secondary",children:F.Z.Messages.CAMERA_PREVIEW_VIDEO_BACKGROUND}),null!=w?(0,
r.jsx)(s.kzN,{className:be().videoBackgroundError,children:w}):null,(0,r.jsx)(de,{canUseCustomBackgrounds:_,customBackgroundOptions:M,selectedOption:c,onSelectOption:k,onUpsellClick:function(){(0,s.ZDy)(ye((function(){var e,o;return we(this,(function(c){switch(c.label){case 0:return[4,Promise.all([t.e(40532),t.e(12916),t.e(97815),t.e(93132),t.e(28401),t.e(96075),t.e(96810),t.e(42212),t.e(92797)]).then(t.bind(t,982871))];case 1:e=c.sent(),o=e.default;return[2,function(e){return(0,r.jsx)(o,je(he({},e),{onLearnMore:n,analyticsSource:je(he({},x.location),{object:H.qAy.BUTTON_CTA})}))}]}}))})))},onAddBackgroundImage:function(e,n){var t,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return new Promise((t=ye((function(t){var o,c;return we(this,(function(a){switch(a.label){case 0:a.trys.push([0,2,,3]);return[4,(0,d.Ff)(e,z.xV.BACKGROUND)];case 1:o=a.sent();k(o);(0,m.g5)(o,n.type===pe.m.MP4,r);P(null);return[3,3];case 2:c=a.sent();P(c.message);return[3,3];case 3:t();return[2]}}))})),
function(e){return t.apply(this,arguments)}))},smallerOptions:u})]}):null}var Ae=t(736097),_e=t(166851),Ie=t.n(_e);function Me(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}function xe(e,n,t){n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t;return e}function ke(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,o,c=[],a=!0,i=!1;try{for(t=t.call(e);!(a=(r=t.next()).done);a=!0){c.push(r.value);if(n&&c.length===n)break}}catch(e){i=!0;o=e}finally{try{a||null==t.return||t.return()}finally{if(i)throw o}}return c}}(e,n)||function(e,n){if(!e)return;if("string"==typeof e)return Me(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(t)
;if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Me(e,n)}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ce(){var e=ke(o.useState(!1),2),n=e[0],t=e[1],c=(0,i.e7)([Ae.Z],(function(){return Ae.Z.isMediaFilterSettingLoading()}));o.useEffect((function(){var e=new l.V7;if(c)e.start(150,(function(){t(!0)}));else{e.stop();t(!1)}return function(){return e.stop()}}),[c]);return n?(0,r.jsx)("div",{className:Ie().filterLoadingIndicator,children:(0,r.jsx)(s.$jN,{})}):null}function De(e){var n=e.hideDeviceSelector,t=void 0!==n&&n,c=e.hideDeviceHeader,l=void 0!==c&&c,p=e.onLearnMore,O=e.selectedBackgroundOption,b=e.onSelectBackgroundOption,g=e.renderCamera,v=e.hidePreviewToggle,y=void 0!==v&&v,m=e.showSmallBackgroundOptions,h=void 0!==m&&m,j=(0,i.e7)([Ae.Z],(function(){return Ae.Z.getVideoDeviceId()})),E=(0,
i.Wu)([Ae.Z],(function(){return Object.values(Ae.Z.getVideoDevices())})),w=f.qF.useSetting(),P=E.map((function(e){return{value:e.id,label:e.name}}));o.useEffect((function(){(0,d.XV)()}),[]);return(0,r.jsxs)(r.Fragment,{children:[g(j),Ae.Z.isEnabled()?null:(0,r.jsx)(s.xvT,{className:Ie().permissionWarning,color:"interactive-normal",variant:"text-sm/normal",children:F.Z.Messages.FORM_WARNING_VIDEO_PREVIEW.format({onEnableClick:u.Z.enable})}),y?null:(0,r.jsx)(s.j7V,{className:Ie().previewToggle,note:F.Z.Messages.CAMERA_PREVIEW_ALWAYS_PREVIEW_NOTE,onChange:function(e){f.qF.updateSetting(e);B.default.track(H.rMx.UPDATE_USER_SETTINGS_LOCAL,{always_preview_video:e})},value:w,hideBorder:!0,children:(0,r.jsx)("div",{className:Ie().cameraPreviewTitle,children:F.Z.Messages.CAMERA_PREVIEW_ALWAYS_PREVIEW})}),t?null:(0,r.jsxs)(r.Fragment,{children:[l?null:(0,r.jsx)(s.X6q,{className:Ie().spacingTop24,variant:"eyebrow",color:"header-secondary",children:F.Z.Messages.CAMERA_PREVIEW_CAMERA}),(0,
r.jsx)(s.q4e,{placeholder:F.Z.Messages.CHANGE_CAMERA,className:a()(Ie().selector,xe({},Ie().selectorNoHeader,l)),options:P,value:j,onChange:function(e){return u.Z.setVideoDevice(e)}})]}),(0,r.jsx)(Pe,{onLearnMore:p,selectedBackgroundOption:O,onSelectBackgroundOption:b,currentDeviceId:j,smallerBackgroundOptions:h})]})}},655402:(e,n,t)=>{t.d(n,{Z:()=>l});var r=t(785893),o=(t(667294),t(633878));function c(e,n,t){n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t;return e}function a(e,n){n=null!=n?n:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):function(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})));t.push.apply(t,r)}return t}(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}));return e}function i(e,n){
if(null==e)return{};var t,r,o=function(e,n){if(null==e)return{};var t,r,o={},c=Object.keys(e);for(r=0;r<c.length;r++){t=c[r];n.indexOf(t)>=0||(o[t]=e[t])}return o}(e,n);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(r=0;r<c.length;r++){t=c[r];n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}}return o}function l(e){var n=e.width,t=void 0===n?24:n,l=e.height,s=void 0===l?24:l,u=e.color,f=void 0===u?"currentColor":u,d=i(e,["width","height","color"]);return(0,r.jsxs)("svg",a(function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))));r.forEach((function(n){c(e,n,t[n])}))}return e}({},(0,o.Z)(d)),{width:t,height:s,viewBox:"0 0 24 24",fill:"none",children:[(0,r.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",
d:"M13.2899 2L6 2C3.79086 2 2 3.79086 2 6V18C2 20.2091 3.79086 22 6 22H18C20.2091 22 22 20.2091 22 18V10.7101C21.3663 10.8987 20.695 11 20 11C16.134 11 13 7.86599 13 4C13 3.30503 13.1013 2.63371 13.2899 2ZM8 6C9.1032 6 10 6.8952 10 8C10 9.1056 9.1032 10 8 10C6.8944 10 6 9.1056 6 8C6 6.8952 6.8944 6 8 6ZM6 18L9 14L11 16L15 11L18 18H6Z",fill:f}),(0,r.jsx)("path",{d:"M21 0V3H24V5H21V8H19V5H16V3H19V0H21Z",fill:f})]}))}},778613:(e,n,t)=>{t.d(n,{Z:()=>l});var r=t(785893),o=(t(667294),t(633878));function c(e,n,t){n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t;return e}function a(e,n){n=null!=n?n:{};Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):function(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})));t.push.apply(t,r)}return t}(Object(n)).forEach((function(t){
Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}));return e}function i(e,n){if(null==e)return{};var t,r,o=function(e,n){if(null==e)return{};var t,r,o={},c=Object.keys(e);for(r=0;r<c.length;r++){t=c[r];n.indexOf(t)>=0||(o[t]=e[t])}return o}(e,n);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(r=0;r<c.length;r++){t=c[r];n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}}return o}function l(e){var n=e.width,t=void 0===n?24:n,l=e.height,s=void 0===l?24:l,u=e.color,f=void 0===u?"currentColor":u,d=e.className,p=e.foreground,O=i(e,["width","height","color","className","foreground"]);return(0,r.jsxs)("svg",a(function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))));r.forEach((function(n){c(e,n,t[n])}))}
return e}({},(0,o.Z)(O)),{className:d,width:t,height:s,viewBox:"0 0 24 24",children:[(0,r.jsx)("path",{d:"M0 0h24v24H0z",fill:"none"}),(0,r.jsx)("path",{className:p,fill:f,d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8 0-1.85.63-3.55 1.69-4.9L16.9 18.31C15.55 19.37 13.85 20 12 20zm6.31-3.1L7.1 5.69C8.45 4.63 10.15 4 12 4c4.42 0 8 3.58 8 8 0 1.85-.63 3.55-1.69 4.9z"})]}))}}}]);
//# sourceMappingURL=66d4008a7f74ee37111d.js.map