import{E as $,m as I,o as D,p as B}from"./chunk-6B2INHH4.js";import{a as L}from"./chunk-JRT5Q4WM.js";import{Ab as M,Bb as _,Cc as R,Da as y,Ga as p,Hc as N,Lb as w,Ma as h,Mb as x,Nb as A,Ra as P,Xa as g,Yg as z,Zg as H,_g as G,aa as b,db as a,ga as u,ha as f,ic as S,mb as l,nb as c,ob as d,ra as C,rb as T,sa as E,sb as v,wb as m,yh as U}from"./chunk-IDYB4NXF.js";import{i as s}from"./chunk-AI7IVZV2.js";var k=["bannerfileInput"],V=["bannerPopover"];function F(e,i){if(e&1&&d(0,"img",11),e&2){let o=_();a("src",o.preview||o.bannerUrl(),y);}}function X(e,i){e&1&&T(0);}function j(e,i){if(e&1&&(l(0,"div",12),g(1,X,1,0,"ng-container",13),c()),e&2){let o=_(),n=A(7);a("ngbTooltip",o.bannerFormat),p(),a("ngTemplateOutlet",n);}}function Q(e,i){e&1&&T(0);}function q(e,i){if(e&1){let o=v();l(0,"div",14)(1,"button",15),d(2,"my-global-icon",16),l(3,"span"),m(4,2),c()(),l(5,"div",17)(6,"div",18),g(7,Q,1,0,"ng-container",13),c(),l(8,"button",19),M("click",function(){u(o);let t=_();return f(t.deleteBanner());}),d(9,"my-global-icon",20),l(10,"span"),m(11,3),c()()()();}if(e&2){let o=_(),n=A(7);p(6),a("ngbTooltip",o.bannerFormat),p(),a("ngTemplateOutlet",n);}}function W(e,i){if(e&1){let o=v();d(0,"my-global-icon",21),l(1,"label",22),m(2,4),c(),l(3,"input",23,1),M("change",function(){u(o);let t=_();return f(t.onBannerChange());}),c();}if(e&2){let o=_();p(3),a("accept",o.bannerExtensions);}}var re=(()=>{let i=class i{serverService=b(U);notifier=b(z);bannerfileInput=h("bannerfileInput");bannerPopover=h("bannerPopover");bannerUrl=E(void 0);previewImage=E(!1);bannerChange=C();bannerDelete=C();bannerFormat="";maxBannerSize=0;bannerExtensions="";preview;ngOnInit(){let n=this.serverService.getHTMLConfig();this.maxBannerSize=n.banner.file.size.max,this.bannerExtensions=n.banner.file.extensions.join(", "),this.bannerFormat="ratio 6/1, \xF6nerilen boyut: 1920x317, max boyut: "+H(this.maxBannerSize)+", uzant\u0131lar: "+this.bannerExtensions+"";}onBannerChange(){let n=this.bannerfileInput().nativeElement.files[0];if(n.size>this.maxBannerSize){this.notifier.error("Error","Bu resim \xE7ok b\xFCy\xFCk.");return;}let t=new FormData();t.append("bannerfile",n),this.bannerPopover()?.close(),this.bannerChange.emit(t),this.previewImage()&&G(n).then(r=>this.preview=r);}deleteBanner(){this.preview=void 0,this.bannerDelete.emit();}hasBanner(){return!!this.preview||!!this.bannerUrl();}};s(i,"\u0275fac",function(t){return new(t||i)();}),s(i,"\u0275cmp",P({type:i,selectors:[["my-actor-banner-edit"]],viewQuery:function(t,r){t&1&&(w(r.bannerfileInput,k,5),w(r.bannerPopover,V,5)),t&2&&x(2);},inputs:{bannerUrl:[1,"bannerUrl"],previewImage:[1,"previewImage"]},outputs:{bannerChange:"bannerChange",bannerDelete:"bannerDelete"},decls:8,vars:3,consts:()=>{let n;n="Banner\u0131n\u0131z\u0131 de\u011Fi\u015Ftirin";let t;t="Banner\u0131 kal\u0131dr";let r;return r="Yeni bir banner y\xFCkleyin",[["uploadNewBanner",""],["bannerfileInput",""],n,t,r,[1,"actor"],[1,"actor-img-edit-container"],[1,"banner-placeholder"],["alt","Banner",3,"src",4,"ngIf"],["class","actor-img-edit-button button-file primary-button button-focus-within","placement","right","container","body",3,"ngbTooltip",4,"ngIf"],["ngbDropdown","","placement","right",4,"ngIf"],["alt","Banner",3,"src"],["placement","right","container","body",1,"actor-img-edit-button","button-file","primary-button","button-focus-within",3,"ngbTooltip"],[4,"ngTemplateOutlet"],["ngbDropdown","","placement","right"],["type","button","ngbDropdownToggle","",1,"actor-img-edit-button","button-file","primary-button"],["iconName","edit"],["ngbDropdownMenu",""],[1,"dropdown-item","dropdown-file","button-focus-within",3,"ngbTooltip"],["type","button",1,"dropdown-item",3,"click"],["iconName","delete"],["iconName","upload"],["for","bannerfile"],["type","file","name","bannerfile","id","bannerfile",3,"change","accept"]];},template:function(t,r){t&1&&(l(0,"div",5)(1,"div",6)(2,"div",7),g(3,F,1,1,"img",8),c(),g(4,j,2,2,"div",9)(5,q,12,2,"div",10),c()(),g(6,W,5,1,"ng-template",null,0,S)),t&2&&(p(3),a("ngIf",r.hasBanner()),p(),a("ngIf",!r.hasBanner()),p(),a("ngIf",r.hasBanner()));},dependencies:[R,$,N,B,D,L,I],styles:[`.dropdown-file[_ngcontent-%COMP%]{position:relative;overflow:hidden;display:inline-block}.dropdown-file[_ngcontent-%COMP%]   input[type=file][_ngcontent-%COMP%]{position:absolute;top:0;right:0;width:100%;height:100%;font-size:100px;text-align:end;filter:alpha(opacity=0);opacity:0;outline:none;background:var(--bg);cursor:inherit;display:block}.actor-img-edit-button[_ngcontent-%COMP%]{width:31px;cursor:pointer;display:flex;justify-content:center;align-items:center}.actor-img-edit-button[_ngcontent-%COMP%]   my-global-icon[_ngcontent-%COMP%]{position:relative;top:-1px;right:0;display:inline-block;width:19px;height:19px;line-height:19px}.actor-img-edit-button[_ngcontent-%COMP%]:not(.icon-only)   my-global-icon[_ngcontent-%COMP%]{margin-inline-end:0}label[_ngcontent-%COMP%]{font-weight:400;font-size:inherit;color:inherit;margin:0}
/*# sourceMappingURL=actor-image-edit-2PH6CM5V.css.map */`,`.banner-placeholder[_ngcontent-%COMP%]{position:relative;height:0;width:100%;padding-top:16.6666666667%}.banner-placeholder[_ngcontent-%COMP%] > div[_ngcontent-%COMP%], .banner-placeholder[_ngcontent-%COMP%] > img[_ngcontent-%COMP%]{position:absolute;width:100%;height:100%;top:0}.banner-placeholder[_ngcontent-%COMP%]{background-color:var(--bg-secondary-500)}.actor-img-edit-container[_ngcontent-%COMP%]{position:relative;display:flex;justify-content:center;align-items:center}.dropdown[_ngcontent-%COMP%]{position:absolute}.dropdown[_ngcontent-%COMP%] > .actor-img-edit-button[_ngcontent-%COMP%]{position:relative}.actor-img-edit-button[_ngcontent-%COMP%]{width:auto;position:absolute}.actor-img-edit-button[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]{font-weight:600;margin-bottom:0}.button-focus-within[_ngcontent-%COMP%]:focus-within{box-shadow:0 0 0 .2rem var(--fg-100)}.dropdown-item[_ngcontent-%COMP%]{padding:var(--input-y-padding) 15px}.dropdown-item[_ngcontent-%COMP%]   my-global-icon[_ngcontent-%COMP%]{width:22px;opacity:.7;position:relative;top:-2px;margin-inline-end:.625rem}.dropdown-toggle[_ngcontent-%COMP%]:after{display:none}
/*# sourceMappingURL=actor-banner-edit.component-UTDG5WHN.css.map */`]}));let e=i;return e;})();export{re as a};/**i18n:1cf7c077143c4c267fdafbe5508f191afcef21bad6aba22a3a8dc180e1003753*///# sourceMappingURL=chunk-MIQH2EQG.js.map