1"use strict";(self.webpackChunktonomo=self.webpackChunktonomo||[]).push([[5861],{75861:(ue,V,c)=>{c.r(V),c.d(V,{PropertyFeaturePhotosModule:()=>wt});var x=c(44409),v=c(69808),b=c(93075),J=c(74202),I=c(51062),i=c(49343),z=c(87366),f=c(96410),L=c(70655),j=c(70127),K=c(8929),$=c(21086),H=c(36053),q=c(61715),T=c(24850),P=c(72986),E=c(87545),F=c(7625),ee=c(31307),te=c(5154),k=c(92198),U=c(27221),D=c(2994),N=c(658),oe=c(79629),Y=c(18013),ne=(c(92858),c(38279)),W=c(98798),p=c(50026),_=c(76230),d=c(61709),h=c(87168),w=c(24254),g=(()=>{return(r=g||(g={})).Favorite="favorite",r.Hidden="hidden",r.FileNameAscending="filename-ascending",r.FileNameDescending="filename-descending",g;var r})(),e=c(5e3);const C=(0,_.H)({selectId:r=>r.storeKey}),{selectAll:ae,selectIds:se}=C.getSelectors(),ce=C.getInitialState({imagesInRow:4,photoSelectionOn:!1,selectedPhotoKeys:new Set,currentGalleryId:null,galleries:[],propertyPhotoCollection:[]});let de=(()=>{class r extends p.m1{constructor(o){super(ce),this.propertyFilesRepository=o,this.photoCollectionDictionary$=this.select(t=>t.propertyPhotoCollection.reduce((n,l)=>(n[l.id]=l,n),{})),this.photos$=this.select(t=>ae(t)),this.galleries$=this.select(t=>t.galleries),this.photoSelectionOn$=this.select(t=>t.photoSelectionOn),this.imagesInRow$=this.select(t=>t.imagesInRow),this.currentGalleryId$=this.select(t=>t.currentGalleryId),this.currentGallery$=this.select(this.galleries$,this.currentGalleryId$,(t,n)=>t.find(l=>l.id===n)),this.defaultGallery$=this.select(this.galleries$,t=>t.slice().pop()),this.currentGalleryPhotos$=this.select(this.photos$,this.currentGalleryId$,(t,n)=>t.filter(l=>l.galleryId==n)),this.isDefaultGallerySelected$=this.select(t=>{const n=t.galleries[t.galleries.length-1];return(null==n?void 0:n.id)===t.currentGalleryId}),this.selectedPhotoKeys$=this.select(t=>t.selectedPhotoKeys),this.isAllSelectedPhotoHidden$=this.select(t=>[...t.selectedPhotoKeys].map(n=>t.entities[n]).every(n=>null==n?void 0:n.hidden)),this.galleriesWithPhotos$=this.select(this.galleries$,this.photos$,(t,n)=>t.map(l=>({dropboxId:l.dropboxId,name:l.name,description:l.description,photos:n.filter(s=>s.galleryId===l.id).map(s=>(0,L._T)(s,["galleryId"]))}))),this.galleryPreviewPhotoUrls$=this.select(this.photos$,this.photoCollectionDictionary$,(t,n)=>t.reduce((l,s)=>{var m;const u=s.galleryId;l[u]=l[u]||[];const y=s.storeKey.split("/").pop(),G=n[y];return G&&l[u].push((null===(m=G.thumbnail)||void 0===m?void 0:m.url)||G.downloadUrl),l},{})),this.defaultGalleryPhotos$=this.select(this.defaultGallery$,this.photos$,this.photoCollectionDictionary$,(t,n,l)=>n.filter(s=>(null==t?void 0:t.id)===s.galleryId).map(s=>{var m,u,y;const G=s.storeKey.split("/").pop(),S=l[G],Z=(null===(m=null==S?void 0:S.thumbnail)||void 0===m?void 0:m.url)||"",Q=(null===(u=null==S?void 0:S.webRes)||void 0===u?void 0:u.url)||"",ie=(null===(y=null==S?void 0:S.fullRes)||void 0===y?void 0:y.url)||"";return Z&&Q?Object.assign(Object.assign({},s),{thumbnail:Z,hiRes:Q,fullRes:ie}):null}).filter(Boolean)),this.resetState=this.updater(()=>ce),this.setPhotoCollection=this.updater((t,n)=>Object.assign(Object.assign({},t),{propertyPhotoCollection:n})),this.setAllGalleries=this.updater((t,n)=>Object.assign(Object.assign({},t),{galleries:n})),this.setAllPhotos=this.updater((t,n)=>C.setAll(n,t)),this.setImagesInRow=this.updater((t,n)=>Object.assign(Object.assign({},t),{imagesInRow:n})),this.togglePhotoSelectionMode=this.updater(t=>Object.assign(Object.assign({},t),{photoSelectionOn:!t.photoSelectionOn,selectedPhotoKeys:new Set})),this.changeGalleryOrder=this.updater((t,n)=>{const l=t.galleries.slice();return(0,x.bA)(l,n.fromIndex,n.toIndex),Object.assign(Object.assign({},t),{galleries:l})}),this.changePhotoOrder=this.updater((t,n)=>{let l=[];this.currentGalleryPhotos$.pipe((0,P.q)(1)).subscribe(m=>{l=m.map(u=>u.storeKey)});const s=se(t).filter(m=>!l.includes(m));return(0,x.bA)(l,n.fromIndex,n.toIndex),Object.assign(Object.assign({},t),{ids:s.concat(l)})}),this.sortGalleryPhotos=this.updater((t,n)=>{let l=[];this.currentGalleryPhotos$.pipe((0,P.q)(1)).subscribe(m=>{switch(n){case g.Favorite:m=[...m].sort((u,y)=>u.favorite===y.favorite?0:u.favorite?-1:1);break;case g.Hidden:m=[...m].sort((u,y)=>u.hidden===y.hidden?0:u.hidden?1:-1);break;case g.FileNameAscending:m=[...m].sort((u,y)=>u.name.localeCompare(y.name,void 0,{numeric:!0,sensitivity:"base"}));break;case g.FileNameDescending:m=[...m].sort((u,y)=>u.name.localeCompare(y.name,void 0,{numeric:!0,sensitivity:"base"})).reverse()}l=m.map(u=>u.storeKey)});const s=se(t).filter(m=>!l.includes(m));return Object.assign(Object.assign({},t),{ids:s.concat(l)})}),this.togglePhotoSelection=this.updater((t,n)=>{const l=new Set(t.selectedPhotoKeys);
1return t.selectedPhotoKeys.has(n)?l.delete(n):l.add(n),Object.assign(Object.assign({},t),{selectedPhotoKeys:l})}),this.selectAllPhotos=this.updater(t=>{const n=ae(t).filter(l=>l.galleryId==t.currentGalleryId).map(l=>l.storeKey);return Object.assign(Object.assign({},t),{selectedPhotoKeys:new Set(n)})}),this.deselectAllPhotos=this.updater(t=>Object.assign(Object.assign({},t),{selectedPhotoKeys:new Set})),this.selectCurrentGallery=this.updater((t,n)=>Object.assign(Object.assign({},t),{currentGalleryId:n,photoSelectionOn:!1,selectedPhotoKeys:new Set})),this.addOneGallery=this.updater((t,n)=>{const l=this.createId(),s=[...t.galleries],m=s.pop();return Object.assign(Object.assign({},t),{galleries:[...s,Object.assign(Object.assign({},n),{id:l}),m]})}),this.updateOneGallery=this.updater((t,n)=>{const l=t.galleries.map(s=>s.id!==n.id?s:Object.assign(Object.assign({},s),n));return Object.assign(Object.assign({},t),{galleries:l})}),this.removeOneGallery=this.updater((t,n)=>{const l=t.galleries.filter(m=>m.id!==n);return C.removeMany(m=>m.galleryId===n,Object.assign(Object.assign({},t),{galleries:l}))}),this.addManyPhotos=this.updater((t,n)=>(n=n.map(l=>{var s;return Object.assign(Object.assign({},l),{galleryId:null!==(s=t.currentGalleryId)&&void 0!==s?s:void 0})}),C.addMany(n,t))),this.assignPhotosToCurrentGallery=this.updater((t,n)=>{const l=n.map(s=>{var m;return{id:s,changes:{galleryId:null!==(m=t.currentGalleryId)&&void 0!==m?m:void 0}}});return C.updateMany(l,t)}),this.assignPhotosToDefaultGallery=this.updater((t,n)=>{const l=t.galleries.slice().pop(),s=n.map(m=>({id:m,changes:{galleryId:l.id}}));return C.updateMany(s,t)}),this.updateManyPhotos=this.updater((t,n)=>{const l=n.map(s=>({id:s.storeKey,changes:s}));return C.updateMany(l,t)}),this.showSelectedPhotos=this.updater(t=>{const n=[...t.selectedPhotoKeys].map(l=>({id:t.entities[l].storeKey,changes:{hidden:!1}}));return C.updateMany(n,t)}),this.hideSelectedPhotos=this.updater(t=>{const n=[...t.selectedPhotoKeys].map(l=>({id:t.entities[l].storeKey,changes:{hidden:!0,favorite:!1}}));return C.updateMany(n,t)}),this.removeManyPhotos=this.updater((t,n)=>{const l=new Set(t.selectedPhotoKeys);return n.forEach(s=>l.delete(s)),C.removeMany(n,Object.assign(Object.assign({},t),{selectedPhotoKeys:l}))}),this.setCoverPhotoForCurrentGallery=this.updater((t,n)=>{const l=t.ids.filter(s=>s!==n);return Object.assign(Object.assign({},t),{ids:[n,...l]})}),this.sortPhotos=this.updater((t,n)=>t),this.deletePhoto=this.effect(t=>t.pipe((0,d.zg)(n=>this.propertyFilesRepository.deleteOne(n).then(()=>n)),(0,p._b)(n=>this.removeManyPhotos([n]),n=>console.log(n)))),this.deleteSelectedPhotos=this.effect(t=>t.pipe((0,h.M)(this.selectedPhotoKeys$),(0,D.b)(([n,l])=>{[...l].forEach(s=>this.deletePhoto(s))}))),this.deleteCurrentGalleryPhotos=this.effect(t=>t.pipe((0,h.M)(this.currentGalleryPhotos$),(0,D.b)(([,n])=>{n.forEach(l=>this.deletePhoto(l.storeKey))}))),this.idGen=(0,w.eZr)()}createId(){return this.idGen.next().value}}return r.\u0275fac=function(o){return new(o||r)(e.\u0275\u0275inject(i.Dw))},r.\u0275prov=e.\u0275\u0275defineInjectable({token:r,factory:r.\u0275fac}),r})();var _e=c(97366),R=c(255),re=c(61432),M=c(66809),B=c(72751),ge=c(70949),ye=c(39348),fe=c(10255);function Pe(r,a){if(1&r){const o=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"ui-form-group",2)(1,"h4",3),e.\u0275\u0275text(2),e.\u0275\u0275pipe(3,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"ui-form-group",4)(5,"ui-form-row"),e.\u0275\u0275element(6,"ui-input",5),e.\u0275\u0275pipe(7,"translate"),e.\u0275\u0275element(8,"ui-input",6),e.\u0275\u0275pipe(9,"translate"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(10,"div",7)(11,"button",8),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(o),e.\u0275\u0275nextContext().onApply()}),e.\u0275\u0275text(12),e.\u0275\u0275pipe(13,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(14,"button",9),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(o),e.\u0275\u0275nextContext().onCancel()}),e.\u0275\u0275text(15),e.\u0275\u0275pipe(16,"translate"),e.\u0275\u0275elementEnd()()()}2&r&&(e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(e.\u0275\u0275pipeBind1(3,5,"PROPERTY_PHOTOS_NEW_MULTI_GALLERY")),e.\u0275\u0275advance(4),e.\u0275\u0275property("label",e.\u0275\u0275pipeBind1(7,7,"NAME")+"*"),e.\u0275\u0275advance(2),e.\u0275\u0275property("label",e.\u0275\u0275pipeBind1(9,9,"DESCRIPTION")),e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(13,11,"SAVE")," "),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(16,13,"CANCEL")," "))}let pe=(()=>
1{class r{constructor(o){this.fb=o,this.cancelEditing=new e.EventEmitter,this.updateGallery=new e.EventEmitter}ngOnInit(){this.galleryForm=this.fb.group({dropboxId:[this.gallery.dropboxId],name:[this.gallery.name,[w.$9f.required]],description:[this.gallery.description]})}onApply(){this.galleryForm.valid&&this.updateGallery.emit(this.galleryForm.getRawValue())}onCancel(){this.cancelEditing.emit()}}return r.\u0275fac=function(o){return new(o||r)(e.\u0275\u0275directiveInject(b.qu))},r.\u0275cmp=e.\u0275\u0275defineComponent({type:r,selectors:[["tn-photo-gallery-form"]],inputs:{gallery:"gallery"},outputs:{cancelEditing:"cancelEditing",updateGallery:"updateGallery"},decls:2,vars:2,consts:[[3,"formGroup"],["class","bg-white border-1 border-brand-50 px-12 pb-12",4,"ngIf"],[1,"bg-white","border-1","border-brand-50","px-12","pb-12"],[1,"mt-min","mb-12"],[1,"mb-12"],["formControlName","name","uiFormControl","",3,"label"],["formControlName","description","uiFormControl","",3,"label"],[1,"flex","gap-8"],["uiBtnSize","small","uiBtnTheme","main","type","submit",3,"click"],["uiBtnSize","small","uiBtnTheme","main","themeMode","tertiary",3,"click"]],template:function(o,t){1&o&&(e.\u0275\u0275elementStart(0,"form",0),e.\u0275\u0275template(1,Pe,17,15,"ui-form-group",1),e.\u0275\u0275elementEnd()),2&o&&(e.\u0275\u0275property("formGroup",t.galleryForm),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.galleryForm))},directives:[b._Y,b.JL,b.sg,v.NgIf,re.H,ge.L,ye.a,b.JJ,b.u,fe.o,M.s,B.V],pipes:[I.X$],styles:[""],changeDetection:0}),r})();var O=c(92181);function ve(r,a){1&r&&e.\u0275\u0275element(0,"i",18)}function xe(r,a){1&r&&e.\u0275\u0275element(0,"img",19),2&r&&e.\u0275\u0275property("src",a.$implicit,e.\u0275\u0275sanitizeUrl)}function Ce(r,a){if(1&r){const o=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"ui-form-group")(1,"div",10),e.\u0275\u0275template(2,ve,1,0,"i",11),e.\u0275\u0275elementStart(3,"h4"),e.\u0275\u0275text(4),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(5,"p",12),e.\u0275\u0275text(6),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(7,"div",13),e.\u0275\u0275template(8,xe,1,1,"img",14),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(9,"button",15,16),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(o),e.\u0275\u0275nextContext().onOpenGallery()}),e.\u0275\u0275element(11,"i",17),e.\u0275\u0275text(12),e.\u0275\u0275pipe(13,"translate"),e.\u0275\u0275elementEnd()()}if(2&r){const o=e.\u0275\u0275reference(10),t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",!t.cdkDragDisabled),e.\u0275\u0275advance(1),e.\u0275\u0275classProp("ml-12",t.cdkDragDisabled),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(t.gallery.name),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate1(" ",t.gallery.description," "),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngForOf",t._previewUrls),e.\u0275\u0275advance(1),e.\u0275\u0275property("disabled",t.disableAddPhotos),e.\u0275\u0275advance(2),e.\u0275\u0275property("size",o.iconSize),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(13,9,"PROPERTY_PHOTOS_EDIT_PHOTOS")," ")}}function Se(r,a){if(1&r){const o=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"tn-photo-gallery-form",20),e.\u0275\u0275listener("cancelEditing",function(){return e.\u0275\u0275restoreView(o),e.\u0275\u0275nextContext().onCancel()})("updateGallery",function(n){return e.\u0275\u0275restoreView(o),e.\u0275\u0275nextContext().onUpdate(n)}),e.\u0275\u0275elementEnd()}if(2&r){const o=e.\u0275\u0275nextContext();e.\u0275\u0275property("gallery",o.gallery)}}let be=(()=>{class r{constructor(){this.cdkDragDisabled=!0,this.disableAddPhotos=!1,this.updateGallery=new e.EventEmitter,this.openGallery=new e.EventEmitter,this.removeGallery=new e.EventEmitter,this.editMode=!1,this.hostClass=!0,this._previewUrls=[]}set previewUrls(o){this._previewUrls=(o||[]).slice(0,6)}onEdit(){this.editMode=!0}onUpdate(o){this.editMode=!1,this.updateGallery.emit(Object.assign(Object.assign({},this.gallery),o))}onCancel(){this.editMode=!1}onOpenGallery(){this.openGallery.emit(this.gallery)}onRemove(){this.removeGallery.next(this.gallery)}trackBy(o,t){return t.storeKey}}return r.\u0275fac=function(o){return new(o||r)},r.\u0275cmp=e.\u0275\u0275defineComponent({type:r,selectors:[["tn-photo-gallery-widget"]],hostVars:2,hostBindings:function(o,t){2&o&&e.\u0275\u0275classProp("app-v2",t.hostClass)},inputs:{gallery:"gallery",cdkDragDisabled:"cdkDragDisabled",disableAddPhotos:"disableAddPhotos",previewUrls:"previewUrls"}
1,outputs:{updateGallery:"updateGallery",openGallery:"openGallery",removeGallery:"removeGallery"},decls:15,vars:10,consts:[[4,"ngIf"],[3,"gallery","cancelEditing","updateGallery",4,"ngIf"],["uiBtnSize","small","iconOnly","","uiBtnTheme","main","themeMode","secondary",1,"absolute","top-8","right-12",3,"matMenuTriggerFor"],["actionsMenuButton","btnSize"],["uiIcon","more_vert",3,"size"],["xPosition","before",1,"app-v2"],["actionsMenu","matMenu"],["mat-menu-item","",3,"click"],["uiIcon","edit",1,"mr-min"],["uiIcon","delete",1,"mr-min"],[1,"flex","pt-8","pb-16","pr-8"],["uiIcon","drag_indicator","class","text-gray-30 px-8 mr-min cursor-move",4,"ngIf"],[1,"text-gray-50","ml-8"],[1,"mb-min","grid","gap-4","grid-cols-6"],["class","rounded object-cover h-full w-full",3,"src",4,"ngFor","ngForOf"],["uiBtnSize","small","uiBtnTheme","main","themeMode","text",1,"w-100",3,"disabled","click"],["editPhotos","btnSize"],["uiIcon","add",3,"size"],["uiIcon","drag_indicator",1,"text-gray-30","px-8","mr-min","cursor-move"],[1,"rounded","object-cover","h-full","w-full",3,"src"],[3,"gallery","cancelEditing","updateGallery"]],template:function(o,t){if(1&o&&(e.\u0275\u0275template(0,Ce,14,11,"ui-form-group",0),e.\u0275\u0275template(1,Se,1,1,"tn-photo-gallery-form",1),e.\u0275\u0275elementStart(2,"button",2,3),e.\u0275\u0275element(4,"i",4),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(5,"mat-menu",5,6)(7,"button",7),e.\u0275\u0275listener("click",function(){return t.onEdit()}),e.\u0275\u0275element(8,"i",8),e.\u0275\u0275text(9),e.\u0275\u0275pipe(10,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(11,"button",7),e.\u0275\u0275listener("click",function(){return t.onRemove()}),e.\u0275\u0275element(12,"i",9),e.\u0275\u0275text(13),e.\u0275\u0275pipe(14,"translate"),e.\u0275\u0275elementEnd()()),2&o){const n=e.\u0275\u0275reference(3),l=e.\u0275\u0275reference(6);e.\u0275\u0275property("ngIf",!t.editMode),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.editMode),e.\u0275\u0275advance(1),e.\u0275\u0275property("matMenuTriggerFor",l),e.\u0275\u0275advance(2),e.\u0275\u0275property("size",n.iconSize),e.\u0275\u0275advance(5),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(10,6,"EDIT")," "),e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(14,8,"DELETE")," ")}},directives:[v.NgIf,re.H,R.a,v.NgForOf,M.s,B.V,pe,O.p6,O.VK,O.OP],pipes:[I.X$],styles:["[_nghost-%COMP%]{position:relative;display:block}"],changeDetection:0}),r})();function Ie(r,a){if(1&r){const o=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"ui-form-group"),e.\u0275\u0275elementContainerStart(1),e.\u0275\u0275elementStart(2,"div",2)(3,"h4"),e.\u0275\u0275text(4),e.\u0275\u0275pipe(5,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(6,"p",3),e.\u0275\u0275text(7),e.\u0275\u0275pipe(8,"translate"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(9,"button",4,5),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(o),e.\u0275\u0275nextContext(2).onAdd()}),e.\u0275\u0275element(11,"i",6),e.\u0275\u0275text(12),e.\u0275\u0275pipe(13,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementEnd()}if(2&r){const o=e.\u0275\u0275reference(10);e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate(e.\u0275\u0275pipeBind1(5,4,"PROPERTY_PHOTOS_MULTI_GALLERY")),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate(e.\u0275\u0275pipeBind1(8,6,"PROPERTY_PHOTOS_GALLERIES_DESC")),e.\u0275\u0275advance(4),e.\u0275\u0275property("size",o.iconSize),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(13,8,"PROPERTY_PHOTOS_CREATE_GALLERY")," ")}}function we(r,a){if(1&r){const o=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275elementStart(1,"button",7,8),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(o),e.\u0275\u0275nextContext(2).onAdd()}),e.\u0275\u0275element(3,"i",6),e.\u0275\u0275text(4),e.\u0275\u0275pipe(5,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementContainerEnd()}if(2&r){const o=e.\u0275\u0275reference(2);e.\u0275\u0275advance(3),e.\u0275\u0275property("size",o.iconSize),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(5,2,"PROPERTY_PHOTOS_ADD_GALLERY")," ")}}function Oe(r,a){if(1&r&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275template(1,Ie,14,10,"ui-form-group",0),e.\u0275\u0275template(2,we,6,4,"ng-container",0),e.\u0275\u0275elementContainerEnd()),2&r){const o=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",o.showCaption),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!o.showCaption)}}function Te(r,a){if(1&r){const o=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"tn-photo-gallery-form",9),e.\u0275\u0275listener("cancelEditing",function(){return e.\u0275\u0275restoreView(o),e.\u0275\u0275nextContext().onCancel()})("updateGallery",function(n){return e.\u0275\u0275restoreView(o),e.\u0275\u0275nextContext().onCreate(n)}),e.\u0275\u0275elementEnd()}if(2&r){const o=e.\u0275\u0275nextContext();e.\u0275\u0275property("gallery",o.newGallery)}}let Ee=(()=>
1{class r{constructor(){this.showCaption=!0,this.addGallery=new e.EventEmitter,this.newGallery=null}onAdd(){this.newGallery={dropboxId:"",name:"",description:"",photos:[]}}onCreate(o){const t=this.newGallery;this.newGallery=null,this.addGallery.emit(Object.assign(Object.assign({},t),o))}onCancel(){this.newGallery=null}}return r.\u0275fac=function(o){return new(o||r)},r.\u0275cmp=e.\u0275\u0275defineComponent({type:r,selectors:[["tn-add-photo-gallery"]],inputs:{showCaption:"showCaption"},outputs:{addGallery:"addGallery"},decls:2,vars:2,consts:[[4,"ngIf"],[3,"gallery","cancelEditing","updateGallery",4,"ngIf"],[1,"flex","pt-8","pb-20","px-8"],[1,"text-gray-50","ml-8"],["uiBtnSize","small","uiBtnTheme","main","themeMode","text",1,"w-100",3,"click"],["createGallery","btnSize"],["uiIcon","add",3,"size"],["uiBtnSize","small","uiBtnTheme","main","themeMode","tertiary",1,"w-100",3,"click"],["addGallery","btnSize"],[3,"gallery","cancelEditing","updateGallery"]],template:function(o,t){1&o&&(e.\u0275\u0275template(0,Oe,3,2,"ng-container",0),e.\u0275\u0275template(1,Te,1,1,"tn-photo-gallery-form",1)),2&o&&(e.\u0275\u0275property("ngIf",!t.newGallery),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.newGallery))},directives:[v.NgIf,re.H,M.s,B.V,R.a,pe],pipes:[I.X$],styles:[""],changeDetection:0}),r})();var Fe=c(25190),De=c(68566),Ge=c(78029),ke=c(34467);function Re(r,a){if(1&r){const o=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",13),e.\u0275\u0275listener("click",function(){const l=e.\u0275\u0275restoreView(o).$implicit;return e.\u0275\u0275nextContext(2).onSort(l.type)}),e.\u0275\u0275element(1,"i",14),e.\u0275\u0275elementStart(2,"span"),e.\u0275\u0275text(3),e.\u0275\u0275pipe(4,"translate"),e.\u0275\u0275elementEnd()()}if(2&r){const o=a.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275property("uiIcon",o.icon),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(e.\u0275\u0275pipeBind1(4,2,o.titleKey))}}function Me(r,a){if(1&r&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275elementStart(1,"button",6,7),e.\u0275\u0275element(3,"i",8),e.\u0275\u0275text(4),e.\u0275\u0275pipe(5,"translate"),e.\u0275\u0275element(6,"i",9),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(7,"mat-menu",10,11),e.\u0275\u0275template(9,Re,5,4,"button",12),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementContainerEnd()),2&r){const o=e.\u0275\u0275reference(2),t=e.\u0275\u0275reference(8),n=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275property("matMenuTriggerFor",t),e.\u0275\u0275advance(2),e.\u0275\u0275property("size",o.iconSize),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(5,5,"PROPERTY_PHOTOS_SORTING")," "),e.\u0275\u0275advance(2),e.\u0275\u0275property("size",o.iconSize),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngForOf",n.sortOptions)}}function Be(r,a){if(1&r){const o=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275elementStart(1,"button",15,16),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(o),e.\u0275\u0275nextContext().selectAllPhotos()}),e.\u0275\u0275element(3,"i",17),e.\u0275\u0275text(4),e.\u0275\u0275pipe(5,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(6,"button",15,18),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(o),e.\u0275\u0275nextContext().deselectAllPhotos()}),e.\u0275\u0275element(8,"i",19),e.\u0275\u0275text(9),e.\u0275\u0275pipe(10,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(11,"button",15,20),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(o),e.\u0275\u0275nextContext().deleteAllPhotos()}),e.\u0275\u0275element(13,"i",21),e.\u0275\u0275text(14),e.\u0275\u0275pipe(15,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementContainerEnd()}if(2&r){const o=e.\u0275\u0275reference(2),t=e.\u0275\u0275reference(7),n=e.\u0275\u0275reference(12);e.\u0275\u0275advance(3),e.\u0275\u0275property("size",o.iconSize),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(5,6,"PROPERTY_PHOTOS_SELECT_ALL")," "),e.\u0275\u0275advance(4),e.\u0275\u0275property("size",t.iconSize),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(10,8,"PROPERTY_PHOTOS_DESELECT_ALL")," "),e.\u0275\u0275advance(4),e.\u0275\u0275property("size",n.iconSize),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(15,10,"PROPERTY_PHOTOS_DELETE_ALL")," ")}}function Ae(r,a){if(1&r&&(e.\u0275\u0275element(0,"ui-download-by-link",22),e.\u0275\u0275pipe(1,"translate")),2&r){const o=e.\u0275\u0275nextContext();e.\u0275\u0275property("text",e.\u0275\u0275pipeBind1(1,3,"PROPERTY_PHOTOS_DOWNLOAD"))("v2",!0)("url",o.galleryDownloadUrl)}}let Le=(()=>
1{class r{constructor(){this.photoSelectionOn=!1,this.imagesInRow=4,this.galleryDownloadUrl="",this.allowImagesDownload=!1,this.togglePhotoSelectionMode=new e.EventEmitter,this.changeImagesInRow=new e.EventEmitter,this.selectAll=new e.EventEmitter,this.deselectAll=new e.EventEmitter,this.deleteAll=new e.EventEmitter,this.sort=new e.EventEmitter,this.sortOptions=[{titleKey:"PROPERTY_PHOTOS_SORT_FAVORITES",icon:"star",type:g.Favorite},{titleKey:"PROPERTY_PHOTOS_SORT_HIDDEN",icon:"visibility_off",type:g.Hidden},{titleKey:"PROPERTY_PHOTOS_SORT_FILENAME_ASC",icon:"arrow_downward",type:g.FileNameAscending},{titleKey:"PROPERTY_PHOTOS_SORT_FILENAME_DESC",icon:"arrow_upward",type:g.FileNameDescending}]}onSort(o){this.sort.emit(o)}togglePhotoSelection(){this.togglePhotoSelectionMode.next()}selectAllPhotos(){this.selectAll.emit()}deselectAllPhotos(){this.deselectAll.emit()}deleteAllPhotos(){this.deleteAll.emit()}setImagesInRow(o){this.changeImagesInRow.emit(o)}}return r.\u0275fac=function(o){return new(o||r)},r.\u0275cmp=e.\u0275\u0275defineComponent({type:r,selectors:[["tn-photo-list-toolbar"]],inputs:{photoSelectionOn:"photoSelectionOn",imagesInRow:"imagesInRow",galleryDownloadUrl:"galleryDownloadUrl",allowImagesDownload:"allowImagesDownload"},outputs:{togglePhotoSelectionMode:"togglePhotoSelectionMode",changeImagesInRow:"changeImagesInRow",selectAll:"selectAll",deselectAll:"deselectAll",deleteAll:"deleteAll",sort:"sort"},decls:9,vars:13,consts:[[4,"ngIf"],["color","primary",1,"mr-auto",3,"max","min","step","thumbLabel","value","change"],["class","mr-8","hint","All changes should be saved before downloading",3,"text","v2","url",4,"ngIf"],["uiBtnSize","small","uiBtnTheme","main","themeMode","tertiary",3,"click"],["toggleSelection","btnSize"],[3,"uiIcon","size"],["uiBtnSize","small","uiBtnTheme","main","themeMode","tertiary","trailingIcon","",1,"mr-8",3,"matMenuTriggerFor"],["sorting","btnSize"],["uiIcon","filter_list",3,"size"],["uiIcon","unfold_more",3,"size"],[1,"app-v2"],["sortingMenu","matMenu"],["mat-menu-item","",3,"click",4,"ngFor","ngForOf"],["mat-menu-item","",3,"click"],[1,"mr-min",3,"uiIcon"],["uiBtnSize","small","uiBtnTheme","main","themeMode","tertiary",1,"mr-8",3,"click"],["selectAll","btnSize"],["uiIcon","select_all",3,"size"],["deselectAll","btnSize"],["uiIcon","deselect",3,"size"],["deleteAll","btnSize"],["uiIcon","delete",3,"size"],["hint","All changes should be saved before downloading",1,"mr-8",3,"text","v2","url"]],template:function(o,t){if(1&o&&(e.\u0275\u0275template(0,Me,10,7,"ng-container",0),e.\u0275\u0275template(1,Be,16,12,"ng-container",0),e.\u0275\u0275elementStart(2,"mat-slider",1),e.\u0275\u0275listener("change",function(l){let s;return t.setImagesInRow(null!==(s=l.value)&&void 0!==s?s:4)}),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(3,Ae,2,5,"ui-download-by-link",2),e.\u0275\u0275elementStart(4,"button",3,4),e.\u0275\u0275listener("click",function(){return t.togglePhotoSelection()}),e.\u0275\u0275element(6,"i",5),e.\u0275\u0275text(7),e.\u0275\u0275pipe(8,"translate"),e.\u0275\u0275elementEnd()),2&o){const n=e.\u0275\u0275reference(5);e.\u0275\u0275property("ngIf",!t.photoSelectionOn),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.photoSelectionOn),e.\u0275\u0275advance(1),e.\u0275\u0275property("max",12)("min",1)("step",1)("thumbLabel",!0)("value",t.imagesInRow),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.galleryDownloadUrl&&t.allowImagesDownload),e.\u0275\u0275advance(3),e.\u0275\u0275property("uiIcon",t.photoSelectionOn?"close":"highlight_mouse_cursor")("size",n.iconSize),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(8,11,t.photoSelectionOn?"CANCEL":"PROPERTY_PHOTOS_SELECT"),"\n")}},directives:[v.NgIf,M.s,B.V,O.p6,R.a,O.VK,v.NgForOf,O.OP,Ge.pH,ke.K],pipes:[I.X$],styles:["[_nghost-%COMP%]{display:flex;align-items:center}.mat-slider[_ngcontent-%COMP%]{width:192px}"],changeDetection:0}),r})();var $e=c(90508),Ve=c(81782);const ze=["descriptionInput"];function je(r,a){if(1&r&&(e.\u0275\u0275elementStart(0,"div",3),e.\u0275\u0275text(1),e.\u0275\u0275pipe(2,"translate"),e.\u0275\u0275elementEnd()),2&r){const o=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(2,1,o.isDefaultGallerySelected?"PROPERTY_PHOTOS_WEBSITE_COVER":"PROPERTY_PHOTOS_GALLERY_COVER")," ")}}function Ke(r,a){if(1&r){const o=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",23),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(o),e.\u0275\u0275nextContext().onFavoriteToggle()}),e.\u0275\u0275element(1,"i",24),e.\u0275\u0275elementEnd()}if(2&r){const o=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275property("ngClass",o.photoItem.favorite?"text-yellow-50":"text-gray-30")}}function He(r,a){if(1&r){const o=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",23),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(o),e.\u0275\u0275nextContext().onHiddenToggle()}),e.\u0275\u0275element(1,"i",25),e.\u0275\u0275elementEnd()}}function Ue(r,a){if(1&r){const o=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",26),e.\u0275\u0275listener("click",function(n){return e.\u0275\u0275restoreView(o),e.\u0275\u0275nextContext().onSelectionToggle(n)}),e.\u0275\u0275element(1,"i",27),e.\u0275\u0275elementEnd()}}function Ne(r,a){if(1&r&&(e.\u0275\u0275elementStart(0,"a",28),e.\u0275\u0275element(1,"i",29),e.\u0275\u0275elementEnd()),2&r){const o=e.\u0275\u0275nextContext();e.\u0275\u0275property("href",o.urls.webRes,e.\u0275\u0275sanitizeUrl)}}function Ye(r,a){if(1&r&&(e.\u0275\u0275elementStart(0,"a",30),e.\u0275\u0275element(1,"i",31),e.\u0275\u0275elementStart(2,"span"),e.\u0275\u0275text(3),e.\u0275\u0275pipe(4,"translate"),e.\u0275\u0275elementEnd()()),2&r){const o=e.\u0275\u0275nextContext();e.\u0275\u0275property("href",o.urls.webRes,e.\u0275\u0275sanitizeUrl),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate(e.\u0275\u0275pipeBind1(4,2,"PROPERTY_PHOTOS_DOWNLOAD"))}}function We(r,a){1&r&&(e.\u0275\u0275elementStart(0,"span",36),e.\u0275\u0275text(1),e.\u0275\u0275pipe(2,"translate"),e.\u0275\u0275elementEnd()),2&r&&(e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(2,1,"PROPERTY_PHOTOS_IMAGE_OPTIMISATION")," "))}function Xe(r,a){if(1&r&&(e.\u0275\u0275elementStart(0,"div",32)(1,"div",2)(2,"div",3),e.\u0275\u0275text(3),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(4,"div",33),e.\u0275\u0275element(5,"ui-spinner",34),e.\u0275\u0275template(6,We,3,3,"span",35),e.\u0275\u0275elementEnd()()),2&r){const o=e.\u0275\u0275nextContext();e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate(o.index+1),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngIf",o.optimisation)}}function Ze(r,a){if(1&r){const o=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",37),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(o),e.\u0275\u0275nextContext().onEdit()}),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()}if(2&r){const o=e.\u0275\u0275nextContext();e.\u0275\u0275property("title",o.photoName),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",o.photoName,"\n")}}function Qe(r,a){if(1&r){const o=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"textarea",38,39),e.\u0275\u0275listener("blur",function(){e.\u0275\u0275restoreView(o);const n=e.\u0275\u0275reference(1);return e.\u0275\u0275nextContext().onNameChange(n.value)}),e.\u0275\u0275pipe(2,"translate"),e.\u0275\u0275elementEnd()}if(2&r){const o=e.\u0275\u0275nextContext();e.\u0275\u0275property("value",o.photoItem.name)("placeholder",e.\u0275\u0275pipeBind1(2,2,"PROPERTY_OVERVIEW_NOT_SET"))}}let Je=(()=>
1{class r{constructor(o){this.ngZone=o,this.photoItem={},this.isDefaultGallerySelected=!0,this.allowImagesDownload=!1,this.urls={},this.photoSelectionOn=!1,this.selected=!1,this.update=new e.EventEmitter,this.toggleSelection=new e.EventEmitter,this.setAsCover=new e.EventEmitter,this.delete=new e.EventEmitter,this.editMode=!1,this.menuOpen=!1,this.imgLoaded=!1}get isHidden(){return this.photoItem.hidden}get isDummy(){return!this.photoItem.storeKey||!this.urls.thumbnail}get optimisation(){return!!this.photoItem.storeKey&&!this.urls.thumbnail}get photoName(){return this.isDummy?"Not set":this.photoItem.name||"Not set"}get isCover(){return 0===this.index}onSelectionToggle(o){null==o||o.stopPropagation(),this.photoSelectionOn&&this.toggleSelection.emit(this.photoItem.storeKey)}onEdit(){this.isDummy||this.photoSelectionOn||(this.editMode=!0,this.ngZone.runOutsideAngular(()=>{setTimeout(()=>{this.description.nativeElement.focus()})}))}onNameChange(o){this.editMode=!1,o=o.trim(),this.photoItem.name!==o&&this.emitUpdate({name:o})}onFavoriteToggle(){this.emitUpdate({favorite:!this.photoItem.favorite})}onHiddenToggle(){this.emitUpdate({hidden:!this.photoItem.hidden,favorite:!1})}onSetCover(){this.setAsCover.emit(this.photoItem.storeKey)}onDelete(){this.delete.emit(this.photoItem.storeKey)}emitUpdate(o){this.update.emit(Object.assign(Object.assign({},o),{storeKey:this.photoItem.storeKey}))}}return r.\u0275fac=function(o){return new(o||r)(e.\u0275\u0275directiveInject(e.NgZone))},r.\u0275cmp=e.\u0275\u0275defineComponent({type:r,selectors:[["tn-photo-list-item"]],viewQuery:function(o,t){if(1&o&&e.\u0275\u0275viewQuery(ze,5),2&o){let n;e.\u0275\u0275queryRefresh(n=e.\u0275\u0275loadQuery())&&(t.description=n.first)}},hostVars:12,hostBindings:function(o,t){1&o&&e.\u0275\u0275listener("click",function(){return t.onSelectionToggle()}),2&o&&e.\u0275\u0275classProp("selection-on",t.photoSelectionOn)("selected",t.selected)("edit-mode",t.editMode)("menu-open",t.menuOpen)("is-hidden",t.isHidden)("dummy",t.isDummy)},inputs:{photoItem:"photoItem",isDefaultGallerySelected:"isDefaultGallerySelected",allowImagesDownload:"allowImagesDownload",index:"index",urls:"urls",photoSelectionOn:"photoSelectionOn",selected:"selected"},outputs:{update:"update",toggleSelection:"toggleSelection",setAsCover:"setAsCover",delete:"delete"},decls:38,vars:29,consts:[[1,"image-preview","relative"],[1,"photo","rounded-0","w-full","h-full","object-cover",3,"src","error","load","contextmenu"],[1,"flex","absolute","inset-x-0","bottom-0","pl-12","tiny","text-gray-50"],[1,"info"],["class","info",4,"ngIf"],["class","state-icon top-12 left-12 cursor-pointer",3,"click",4,"ngIf"],["class","selected-icon absolute top-12 left-12",3,"click",4,"ngIf"],["class","state-icon download-icon bottom-0 right-12","target","_blank",3,"href",4,"ngIf"],["matRipple","",1,"state-icon","top-12","right-12","cursor-pointer",3,"matMenuTriggerFor","menuClosed","menuOpened"],["uiIcon","more_vert"],["xPosition","before",1,"app-v2"],["menu","matMenu"],["mat-menu-item","",3,"disabled","click"],["uiIcon","photo",1,"mr-min"],[1,"mr-min",3,"uiIcon"],["disabled","","mat-menu-item",""],["uiIcon","rotate_left",1,"mr-min"],["mat-menu-item","","target","_blank",3,"href",4,"ngIf"],["mat-menu-item","",3,"click"],["uiIcon","delete",1,"mr-min"],["class","dummy-placeholder relative",4,"ngIf"],["class","description body line-clamp-3 px-12 pt-8 bg-white cursor-text",3,"title","click",4,"ngIf"],["class","description body overflow-hidden py-8 px-12 mt-auto bg-white",3,"value","placeholder","blur",4,"ngIf"],[1,"state-icon","top-12","left-12","cursor-pointer",3,"click"],["uiIcon","star","uiIconVariant","filled",3,"ngClass"],["uiIcon","visibility_off"],[1,"selected-icon","absolute","top-12","left-12",3,"click"],["size","32","uiIcon","check_circle","uiIconVariant","filled",1,"rounded-full","bg-white","text-brand-50","w-28","h-28"],["target","_blank",1,"state-icon","download-icon","bottom-0","right-12",3,"href"],["uiIcon","download"],["mat-menu-item","","target","_blank",3,"href"],["uiIcon","download",1,"mr-min"],[1,"dummy-placeholder","relative"],[1,"absolute","
1inset-0","flex","flex-col","items-center","justify-center"],[1,"w-32","text-gray-30"],["class","mt-12 text-gray-50",4,"ngIf"],[1,"mt-12","text-gray-50"],[1,"description","body","line-clamp-3","px-12","pt-8","bg-white","cursor-text",3,"title","click"],[1,"description","body","overflow-hidden","py-8","px-12","mt-auto","bg-white",3,"value","placeholder","blur"],["descriptionInput",""]],template:function(o,t){if(1&o&&(e.\u0275\u0275elementStart(0,"div",0)(1,"img",1),e.\u0275\u0275listener("error",function(){return t.imgLoaded=!0})("load",function(){return t.imgLoaded=!0})("contextmenu",function(l){return l.preventDefault()}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(2,"div",2)(3,"div",3),e.\u0275\u0275text(4),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(5,je,3,3,"div",4),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(6,Ke,2,1,"div",5),e.\u0275\u0275template(7,He,2,0,"div",5),e.\u0275\u0275template(8,Ue,2,0,"div",6),e.\u0275\u0275template(9,Ne,2,1,"a",7),e.\u0275\u0275elementStart(10,"div",8),e.\u0275\u0275listener("menuClosed",function(){return t.menuOpen=!1})("menuOpened",function(){return t.menuOpen=!0}),e.\u0275\u0275element(11,"i",9),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(12,"mat-menu",10,11)(14,"button",12),e.\u0275\u0275listener("click",function(){return t.onSetCover()}),e.\u0275\u0275element(15,"i",13),e.\u0275\u0275elementStart(16,"span"),e.\u0275\u0275text(17),e.\u0275\u0275pipe(18,"translate"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(19,"button",12),e.\u0275\u0275listener("click",function(){return t.onHiddenToggle()}),e.\u0275\u0275element(20,"i",14),e.\u0275\u0275elementStart(21,"span"),e.\u0275\u0275text(22),e.\u0275\u0275pipe(23,"translate"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(24,"button",15),e.\u0275\u0275element(25,"i",16),e.\u0275\u0275elementStart(26,"span"),e.\u0275\u0275text(27),e.\u0275\u0275pipe(28,"translate"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275template(29,Ye,5,4,"a",17),e.\u0275\u0275elementStart(30,"button",18),e.\u0275\u0275listener("click",function(){return t.onDelete()}),e.\u0275\u0275element(31,"i",19),e.\u0275\u0275elementStart(32,"span"),e.\u0275\u0275text(33),e.\u0275\u0275pipe(34,"translate"),e.\u0275\u0275elementEnd()()()(),e.\u0275\u0275template(35,Xe,7,2,"div",20),e.\u0275\u0275template(36,Ze,2,2,"div",21),e.\u0275\u0275template(37,Qe,3,4,"textarea",22)),2&o){const n=e.\u0275\u0275reference(13);e.\u0275\u0275classProp("hidden",t.isDummy||!t.imgLoaded),e.\u0275\u0275advance(1),e.\u0275\u0275property("src",t.urls.thumbnail,e.\u0275\u0275sanitizeUrl),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate(t.index+1),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.isCover),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!t.photoItem.hidden),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.photoItem.hidden),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.selected),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.allowImagesDownload),e.\u0275\u0275advance(1),e.\u0275\u0275property("matMenuTriggerFor",n),e.\u0275\u0275advance(4),e.\u0275\u0275property("disabled",t.isCover||t.photoItem.hidden),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate(e.\u0275\u0275pipeBind1(18,21,t.isDefaultGallerySelected?"PROPERTY_PHOTOS_SET_AS_WEBSITE_COVER":"PROPERTY_PHOTOS_SET_AS_GALLERY_COVER")),e.\u0275\u0275advance(2),e.\u0275\u0275property("disabled",t.isCover),e.\u0275\u0275advance(1),e.\u0275\u0275property("uiIcon",t.photoItem.hidden?"visibility":"visibility_off"),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(e.\u0275\u0275pipeBind1(23,23,t.photoItem.hidden?"PROPERTY_PHOTOS_SHOW":"PROPERTY_PHOTOS_HIDE")),e.\u0275\u0275advance(5),e.\u0275\u0275textInterpolate(e.\u0275\u0275pipeBind1(28,25,"PROPERTY_PHOTOS_ROTATE")),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",t.allowImagesDownload),e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate(e.\u0275\u0275pipeBind1(34,27,t.isDefaultGallerySelected?"DELETE":"PROPERTY_PHOTOS_DELETE_FROM_GALLERY")),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",t.isDummy||!t.imgLoaded),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!t.editMode),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.editMode)}}
1,directives:[v.NgIf,R.a,v.NgClass,$e.wG,O.p6,O.VK,O.OP,Ve.O],pipes:[I.X$],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;border-radius:.5rem;border-width:2px;border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(250 250 250 / var(--tw-bg-opacity, 1));overflow:hidden;transition-property:color,background-color,border-color,fill,stroke,-webkit-text-decoration-color;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,-webkit-text-decoration-color;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.3s;transition-timing-function:cubic-bezier(0,0,.2,1)}[_nghost-%COMP%] .selected-icon img{width:28px}.selected[_nghost-%COMP%], .edit-mode[_nghost-%COMP%]{border-color:var(--brand-50, #228BE6)}[_nghost-%COMP%]:hover:not(.dummy) .state-icon[_ngcontent-%COMP%], .menu-open[_nghost-%COMP%] .state-icon[_ngcontent-%COMP%], .selected[_nghost-%COMP%] .state-icon[_ngcontent-%COMP%], .edit-mode[_nghost-%COMP%] .state-icon[_ngcontent-%COMP%]{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}[_nghost-%COMP%]:hover:not(.dummy) .download-icon[_ngcontent-%COMP%], .menu-open[_nghost-%COMP%] .download-icon[_ngcontent-%COMP%], .selected[_nghost-%COMP%] .download-icon[_ngcontent-%COMP%], .edit-mode[_nghost-%COMP%] .download-icon[_ngcontent-%COMP%]{opacity:1;transform:translateY(-12px)}[_nghost-%COMP%]:hover:not(.dummy){--tw-border-opacity: 1;border-color:rgb(226 226 226 / var(--tw-border-opacity, 1))}[_nghost-%COMP%]:hover:not(.dummy).selected, [_nghost-%COMP%]:hover:not(.dummy).edit-mode{border-color:var(--brand-50, #228BE6)}[_nghost-%COMP%]:hover:not(.dummy):not(.selection-on) .photo[_ngcontent-%COMP%]{cursor:move}.selected[_nghost-%COMP%] .state-icon[_ngcontent-%COMP%], .selection-on[_nghost-%COMP%] .state-icon[_ngcontent-%COMP%]{display:none}.is-hidden[_nghost-%COMP%] .photo[_ngcontent-%COMP%]{--tw-grayscale: grayscale(100%);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);transition-property:color,background-color,border-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-text-decoration-color;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-text-decoration-color;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.3s;transition-timing-function:cubic-bezier(0,0,.2,1)}.info[_ngcontent-%COMP%]{padding:0 6px;height:16px;margin-right:1px;background-color:#fff;border-top-left-radius:2px;border-top-right-radius:2px}.description[_ngcontent-%COMP%]{flex:1 1 auto;border-bottom-right-radius:.25rem;border-bottom-left-radius:.25rem;height:56px;max-height:56px}.state-icon[_ngcontent-%COMP%]{position:absolute;display:flex;height:2rem;width:2rem;align-content:center;justify-content:center;border-radius:9999px;transition-property:color,background-color,border-color,fill,stroke,-webkit-text-decoration-color;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,-webkit-text-decoration-color;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.3s;transition-timing-function:cubic-bezier(0,0,.2,1);--tw-text-opacity: 1;color:rgb(175 175 175 / var(--tw-text-opacity, 1))}.state-icon[_ngcontent-%COMP%]:hover{color:var(--brand-60, #1C7ED6)}.state-icon[_ngcontent-%COMP%]{background:rgba(0,0,0,.35);box-shadow:0 8px 32px #00000026}.download-icon[_ngcontent-%COMP%]{opacity:0;transition-property:color,background-color,border-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-text-decoration-color;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-text-decoration-color;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.5s;transition-timing-function:cubic-bezier(0,0,.2,1)}.dummy-placeholder[_ngcontent-%COMP%]{--tw-bg-opacity: 1;background-color:rgb(246 246 246 / var(--tw-bg-opacity, 1))}.image-preview[_ngcontent-%COMP%], .dummy-placeholder[_ngcontent-%COMP%]{height:calc(100% - 56px)}"],changeDetection:0}),r})();var qe=c(11066);const me=function(){return{x:0,y:0}};function et(r,a){if(1&r){const o=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"tn-photo-list-item",3),e.\u0275\u0275listener("cdkDragEnded",function(){return e.\u0275\u0275restoreView(o),e.\u0275\u0275nextContext().onDrop()})("cdkDragMoved",function(n){const s=e.\u0275\u0275restoreView(o).index;return e.\u0275\u0275nextContext().onMove(n,s)})("cdkDragStarted",function(){const l=e.\u0275\u0275restoreView(o).index;return e.\u0275\u0275nextContext().onDragStart(l)})("delete",function(n){return e.\u0275\u0275restoreView(o),e.\u0275\u0275nextContext().delete.emit(n)})("setAsCover",function(n){return e.\u0275\u0275restoreView(o),e.\u0275\u0275nextContext().setAsCover.emit(n)})("toggleSelection",function(n){return e.\u0275\u0275restoreView(o),e.\u0275\u0275nextContext().toggleSelection.emit(n)})("update",function(n){return e.\u0275\u0275restoreView(o),e.\u0275\u0275nextContext().updatePhotoItem.emit(n)}),e.\u0275\u0275elementEnd()}if(2&r){const o=a.$implicit,t=a.index,n=e.\u0275\u0275nextContext();let l;e.\u0275\u0275styleProp("height",n.rowHeight,"px")("width",n.colWidth,"px"),e.\u0275\u0275property("cdkDragBoundary",n.containerRef)("cdkDragFreeDragPosition",null!==(l=n.getItemPosition(t))&&void 0!==l?l:e.\u0275\u0275pureFunction0(14,me))("index",t)("isDefaultGallerySelected",n.isDefaultGallerySelected)("photoItem",o)("photoSelectionOn",n.photoSelectionOn)("selected",n.isSelected(o.storeKey))("urls",n.getPhotoUrls(o))("cdkDragDisabled",n.photoSelectionOn)("allowImagesDownload",n.allowImagesDownload)}}function tt(r,a){if(1&r&&e.\u0275\u0275element(0,"tn-photo-list-item",4),2&r){const o=a.index,t=e.\u0275\u0275nextContext();let n;e.\u0275\u0275styleProp("height",t.rowHeight,"px")("width",t.colWidth,"px"),e.\u0275\u0275property("cdkDragFreeDragPosition",null!==(n=t.getItemPosition(t.photoItemsLength+o))&&void 0!==n?n:e.\u0275\u0275pureFunction0(7,me))("index",t.photoItemsLength+o)("cdkDragDisabled",!0)}}let ot=(()=>{class r extends f.F8b{constructor(o,t){super(o,t),this.cdr=o,this.containerRef
1=t,this.photoSelectionOn=!1,this.isDefaultGallerySelected=!0,this.photosCollection={},this.allowImagesDownload=!1,this.updatePhotoItem=new e.EventEmitter,this.toggleSelection=new e.EventEmitter,this.setAsCover=new e.EventEmitter,this.delete=new e.EventEmitter,this.photoItemsList=[],this.uploadSnapshotsList=[],this.rowBottomSpacing=56}set photoItems(o){this.photoItemsList=o,this.photoItemsLength=o.length}set uploadSnapshots(o){this.uploadSnapshotsList=o,this.uploadItemsLength=o.length}isSelected(o){var t;return null===(t=this.selectedKeys)||void 0===t?void 0:t.has(o)}getPhotoUrls(o){var t,n;const l=o.storeKey.split("/").pop(),s=this.photosCollection[l];return{thumbnail:(null===(t=null==s?void 0:s.thumbnail)||void 0===t?void 0:t.url)||"",webRes:(null===(n=null==s?void 0:s.webRes)||void 0===n?void 0:n.url)||""}}trackBy(o,t){return t.storeKey||o}}return r.\u0275fac=function(o){return new(o||r)(e.\u0275\u0275directiveInject(e.ChangeDetectorRef),e.\u0275\u0275directiveInject(e.ElementRef))},r.\u0275cmp=e.\u0275\u0275defineComponent({type:r,selectors:[["tn-photo-list"]],inputs:{photoItems:"photoItems",uploadSnapshots:"uploadSnapshots",selectedKeys:"selectedKeys",photoSelectionOn:"photoSelectionOn",isDefaultGallerySelected:"isDefaultGallerySelected",photosCollection:"photosCollection",allowImagesDownload:"allowImagesDownload"},outputs:{updatePhotoItem:"updatePhotoItem",toggleSelection:"toggleSelection",setAsCover:"setAsCover",delete:"delete"},features:[e.\u0275\u0275InheritDefinitionFeature],decls:3,vars:4,consts:[["cdkDrag","","class","absolute top-0 left-0",3,"cdkDragBoundary","cdkDragFreeDragPosition","index","isDefaultGallerySelected","photoItem","photoSelectionOn","selected","height","width","urls","cdkDragDisabled","allowImagesDownload","cdkDragEnded","cdkDragMoved","cdkDragStarted","delete","setAsCover","toggleSelection","update",4,"ngFor","ngForOf","ngForTrackBy"],["cdkDrag","","class","absolute top-0 left-0",3,"cdkDragFreeDragPosition","index","height","width","cdkDragDisabled",4,"ngFor","ngForOf","ngForTrackBy"],[1,"absolute","inset-0","bg-red-50","invisible",3,"resized"],["cdkDrag","",1,"absolute","top-0","left-0",3,"cdkDragBoundary","cdkDragFreeDragPosition","index","isDefaultGallerySelected","photoItem","photoSelectionOn","selected","urls","cdkDragDisabled","allowImagesDownload","cdkDragEnded","cdkDragMoved","cdkDragStarted","delete","setAsCover","toggleSelection","update"],["cdkDrag","",1,"absolute","top-0","left-0",3,"cdkDragFreeDragPosition","index","cdkDragDisabled"]],template:function(o,t){1&o&&(e.\u0275\u0275template(0,et,1,15,"tn-photo-list-item",0),e.\u0275\u0275template(1,tt,1,8,"tn-photo-list-item",1),e.\u0275\u0275elementStart(2,"div",2),e.\u0275\u0275listener("resized",function(){return t.initGridConfig()}),e.\u0275\u0275elementEnd()),2&o&&(e.\u0275\u0275property("ngForOf",t.photoItemsList)("ngForTrackBy",t.trackBy),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngForOf",t.uploadSnapshotsList)("ngForTrackBy",t.trackBy))},directives:[v.NgForOf,Je,x.Zt,qe.a5],styles:["[_nghost-%COMP%]{position:relative;width:100%;border-radius:.5rem;--tw-bg-opacity: 1;background-color:rgb(250 250 250 / var(--tw-bg-opacity, 1))}tn-photo-list-item[_ngcontent-%COMP%]:not(.cdk-drag-dragging){will-change:transform;transition:transform .3s cubic-bezier(0,0,.2,1)}.cdk-drag-dragging[_ngcontent-%COMP%]{z-index:10;transition:box-shadow .2s cubic-bezier(0,0,.2,1);box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}"],changeDetection:0}),r})();var nt=c(20773),rt=c(9149),it=c(32408);const lt=function(r){return{count:r}};let at=(()=>{class r{constructor(){this.selectedKeys=new Set,this.isAllSelectedPhotoHidden=!1,this.turnOffSelection=new e.EventEmitter,this.hideSelected=new e.EventEmitter,this.showSelected=new e.EventEmitter,this.deleteSelected=new e.EventEmitter}toggleHidden(){this.isAllSelectedPhotoHidden?this.showSelected.emit():this.hideSelected.emit()}}return r.\u0275fac=function(o){return new(o||r)},r.\u0275cmp=e.\u0275\u0275defineComponent({type:r,selectors:[["tn-selected-photos-toolbar"]],inputs:{selectedKeys:"selectedKeys",isAllSelectedPhotoHidden:"isAllSelectedPhotoHidden"},outputs:{turnOffSelection:"turnOffSelection",hideSelected:"hideSelected",showSelected:"showSelected",deleteSelected:"deleteSelected"},decls:14,vars:17,consts:[["uiIcon","indeterminate_check_box",1,"curs
1or-pointer","text-gray-30","bg-white","rounded-lg",3,"click"],[1,"px-12","body"],["uiBtnSize","x-small","uiBtnTheme","setting",1,"mr-8",3,"disabled","click"],["toggleHiddenButton","btnSize"],[3,"uiIcon","size"],["deleteSelectedButton","btnSize"],["uiIcon","delete",3,"size"]],template:function(o,t){if(1&o&&(e.\u0275\u0275elementStart(0,"i",0),e.\u0275\u0275listener("click",function(){return t.turnOffSelection.emit()}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(1,"span",1),e.\u0275\u0275text(2),e.\u0275\u0275pipe(3,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"button",2,3),e.\u0275\u0275listener("click",function(){return t.toggleHidden()}),e.\u0275\u0275element(6,"i",4),e.\u0275\u0275text(7),e.\u0275\u0275pipe(8,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(9,"button",2,5),e.\u0275\u0275listener("click",function(){return t.deleteSelected.emit()}),e.\u0275\u0275element(11,"i",6),e.\u0275\u0275text(12),e.\u0275\u0275pipe(13,"translate"),e.\u0275\u0275elementEnd()),2&o){const n=e.\u0275\u0275reference(5),l=e.\u0275\u0275reference(10);e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(e.\u0275\u0275pipeBind2(3,8,"PROPERTY_PHOTOS_ITEMS_COUNT",e.\u0275\u0275pureFunction1(15,lt,t.selectedKeys.size))),e.\u0275\u0275advance(2),e.\u0275\u0275property("disabled",0===t.selectedKeys.size),e.\u0275\u0275advance(2),e.\u0275\u0275property("uiIcon",t.isAllSelectedPhotoHidden?"visibility":"visibility_off")("size",n.iconSize),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(8,11,t.isAllSelectedPhotoHidden?"PROPERTY_PHOTOS_SHOW":"PROPERTY_PHOTOS_HIDE"),"\n"),e.\u0275\u0275advance(2),e.\u0275\u0275property("disabled",0===t.selectedKeys.size),e.\u0275\u0275advance(2),e.\u0275\u0275property("size",l.iconSize),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(13,13,"DELETE"),"\n")}},directives:[R.a,M.s,B.V],pipes:[I.X$],styles:["[_nghost-%COMP%]{display:flex;align-items:center}"],changeDetection:0}),r})();function st(r,a){1&r&&(e.\u0275\u0275elementStart(0,"tn-property-section-header",3)(1,"h2"),e.\u0275\u0275text(2),e.\u0275\u0275pipe(3,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"p"),e.\u0275\u0275text(5),e.\u0275\u0275pipe(6,"translate"),e.\u0275\u0275elementEnd()()),2&r&&(e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(e.\u0275\u0275pipeBind1(3,2,"PROPERTY_PHOTOS_PAGE_TITLE")),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(6,4,"PROPERTY_PHOTOS_PAGE_DESC")," "))}function ct(r,a){if(1&r){const o=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"tn-property-section-header")(1,"div",4)(2,"h2"),e.\u0275\u0275text(3),e.\u0275\u0275pipe(4,"async"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(5,"i",5),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(o),e.\u0275\u0275nextContext().openDefaultGallery()}),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(6,"p"),e.\u0275\u0275text(7),e.\u0275\u0275pipe(8,"async"),e.\u0275\u0275elementEnd()()}if(2&r){const o=e.\u0275\u0275nextContext();let t,n;e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate(null==(t=e.\u0275\u0275pipeBind1(4,2,o.currentGallery$))?null:t.name),e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate(null==(n=e.\u0275\u0275pipeBind1(8,4,o.currentGallery$))?null:n.description)}}const X=function(){return[]};function dt(r,a){if(1&r){const o=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"tn-photo-gallery-widget",14),e.\u0275\u0275listener("openGallery",function(n){return e.\u0275\u0275restoreView(o),e.\u0275\u0275nextContext(4).openGallery(n)})("removeGallery",function(n){return e.\u0275\u0275restoreView(o),e.\u0275\u0275nextContext(4).removeGallery(n)})("updateGallery",function(n){return e.\u0275\u0275restoreView(o),e.\u0275\u0275nextContext(4).updateGallery(n)}),e.\u0275\u0275pipe(1,"async"),e.\u0275\u0275pipe(2,"async"),e.\u0275\u0275elementEnd()}if(2&r){const o=e.\u0275\u0275nextContext().$implicit,t=e.\u0275\u0275nextContext(2).ngIf,n=e.\u0275\u0275nextContext();let l,s;e.\u0275\u0275property("disableAddPhotos",null!==(l=e.\u0275\u0275pipeBind1(1,4,n.filesUploadInProgress$))&&void 0!==l&&l)("cdkDragDisabled",t.length<=2)("gallery",o)("previewUrls",null!=o.id?null!==(s=null==(s=e.\u0275\u0275pipeBind1(2,6,n.galleryPreviewPhotoUrls$))?null:s[o.id])&&void 0!==s?s:e.\u0275\u0275pureFunction0(8,X):e.\u0275\u0275pureFunction0(9,X))}}function pt(r,a){if(1&r&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275template(1,dt,3,10,"tn-photo-gallery-widget",13),e.\u0275\u0275elementContainerEnd()),2&r){const o=a.last;e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!o)}}function mt(r,a){if(1&r){const o=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",11),e.\u0275\u0275listener("cdkDropListDropped",function(n){return e.\u0275\u0275restoreView(o),e.\u0275\u0275nextContext(2).onGalleryMove(n)}),e.\u0275\u0275template(1,pt,2,1,"ng-container",12),e.\u0275\u0275elementEnd()}if(2&r){const o=e.\u0275\u0275nextContext().ngIf;e.\u0275\u0275advance(1),e.\u0275\u0275property("ngForOf",o)}}function ht(r,a){if(1&r){const o=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"tn-add-photo-gallery",15),e.\u0275\u0275listener("addGallery",function(n){return e.\u0275\u0275restoreView(o),e.\u0275\u0275nextContext(2).addGallery(n)}),e.\u0275\u0275elementEnd()}if(2&r){const o=e.\u0275\u0275nextContext().ngIf;e.\u0275\u0275property("showCaption",1===o.length)}}function ut(r,a){1&r&&(e.\u0275\u0275elementStart(0,"tn-property-section-header",16)(1,"h3"),e.\u0275\u0275text(2),e.\u0275\u0275pipe(3,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"p",17),e.\u0275\u0275text(5),e.\u0275\u0275pipe(6,"translate"),e.\u0275\u0275elementEnd()()),2&r&&(e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(e.\u0275\u0275pipeBind1(3,2,"PROPERTY_PHOTOS_OTHER_PHOTOS")),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate(e.\u0275\u0275pipeBind1(6,4,"PROPERTY_PHOTOS_GALLERIES_DESC")))}function _t(r,a){if(1&r){const o=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",21),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(o),e.\u0275\u0275nextContext(3).pullDeliveryImages()}),e.\u0275\u0275text(1),e.\u0275\u0275pipe(2,"translate"),e.\u0275\u0275elementEnd()}if(2&r){const o=e.\u0275\u0275nextContext(3);e.\u0275\u0275property("uiBtnLoading",o.deliverySyncInProgress),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(2,2,"PROPERTY_PHOTOS_PULL_FROM_DELIVERY")," ")}}function gt(r,a){if(1&r){const o=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",22),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(o),e.\u0275\u0275nextContext(3).openChoosePhotosDialog()}),e.\u0275\u0275text(1),e.\u0275\u0275pipe(2,"translate"),e.\u0275\u0275elementEnd()}2&r&&(e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(2,1,"PROPERTY_PHOTOS_CHOOSE_PHOTOS")," "))}const he=function(){return{}};function yt(r,a){if(1&r){const o=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"ui-file-upload-form",18),e.\u0275\u0275listener("uploadedFiles",function(n){return e.\u0275\u0275restoreView(o),e.\u0275\u0275nextContext(2).addNewPhotos(n)}),e.\u0275\u0275pipe(1,"async"),e.\u0275\u0275pipe(2,"translate"),e.\u0275\u0275pipe(3,"translate"),e.\u0275\u0275template(4,_t,3,4,"button",19),e.\u0275\u0275pipe(5,"async"),e.\u0275\u0275template(6,gt,3,3,"button",20),e.\u0275\u0275pipe(7,"async"),e.\u0275\u0275pipe(8,"async"),e.\u0275\u0275elementEnd()}if(2&r){const o=a.ngIf,t=e.\u0275\u0275nextContext(2);let n,l;e.\u0275\u0275propertyInterpolate1("collectionPath","library/properties/",o,"")("storagePath","properties/",o,""),e.\u0275\u0275property("allowedFileTypes",t.allowedFileTypes)("metadata",null!==(n=e.\u0275\u0275pipeBind1(1,8,t.imageDocumentsMetadata$))&&void 0!==n?n:e.\u0275\u0275pureFunction0(20,he))("buttonText",e.\u0275\u0275pipeBind1(2,10,"PROPERTY_PHOTOS_BROWSE"))("headerText",e.\u0275\u0275pipeBind1(3,12,"PROPERTY_PHOTOS_UPLOAD_HEADER")),e.\u0275\u0275advance(4),e.\u0275\u0275property("ngIf",t.hasDeliverableImages&&e.\u0275\u0275pipeBind1(5,14,t.isDefaultGallerySelected$)),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",!1===e.\u0275\u0275pipeBind1(7,16,t.isDefaultGallerySelected$)&&(null==(l=e.\u0275\u0275pipeBind1(8,18,t.defaultGalleryPhotos$))?null:l.length))}}function ft(r,a){if(1&r){const o=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"tn-photo-list-toolbar",24),e.\u0275\u0275listener("changeImagesInRow",function(n){return e.\u0275\u0275restoreView(o),e.\u0275\u0275nextContext(3).setImagesInRow(n)})("deleteAll",function(){return e.\u0275\u0275restoreView(o),e.\u0275\u0275nextContext(3).deleteCurrentGalleryPhotos()})("deselectAll",function(){return e.\u0275\u0275restoreView(o),e.\u0275\u0275nextContext(3).unselectAllPhotos()})("selectAll",function(){return e.\u0275\u0275restoreView(o),e.\u0275\u0275nextContext(3).selectAllPhotos()})("togglePhotoSelectionMode",function(){return e.\u0275\u0275restoreView(o),e.\u0275\u0275nextContext(3).togglePhotoSelectionMode()})("sort",function(n){return e.\u0275\u0275restoreView(o),e.\u0275\u0275nextContext(3).onSortImages(n)}),e.\u0275\u0275pipe(1,"async"),e.\u0275\u0275pipe(2,"async"),e.\u0275\u0275elementEnd()}if(2&r){const o=e.\u0275\u0275nextContext().ngIf,t=e.\u0275\u0275nextContext(2);let n,l;e.\u0275\u0275property("imagesInRow",null!==(n=e.\u0275\u0275pipeBind1(1,4,t.imagesInRow$))&&void 0!==n?n:4)("photoSelectionOn",null!==(l=e.\u0275\u0275pipeBind1(2,6,t.photoSelectionOn$))&&void 0!==l&&l)("galleryDownloadUrl",t.getGalleryDownloadUrl(o.name))("allowImagesDownload",t.allowImagesDownload)}}function Pt(r,a){if(1&r&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275template(1,ft,3,8,"tn-photo-list-toolbar",23),e.\u0275\u0275pipe(2,"async"),e.\u0275\u0275elementContainerEnd()),2&r){const o=e.\u0275\u0275nextContext(2);let t;e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",null==(t=e.\u0275\u0275pipeBind1(2,1,o.currentGalleryPhotos$))?null:t.length)}}function vt(r,a){if(1&r){const o=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"tn-photo-list",27),e.\u0275\u0275listener("delete",function(n){return e.\u0275\u0275restoreView(o),e.\u0275\u0275nextContext(3).deletePhoto(n)})("move",function(n){return e.\u0275\u0275restoreView(o),e.\u0275\u0275nextContext(3).onPhotoMove(n)})("setAsCover",function(n){return e.\u0275\u0275restoreView(o),e.\u0275\u0275nextContext(3).setCoverPhotoForCurrentGallery(n)})("toggleSelection",function(n){return e.\u0275\u0275restoreView(o),e.\u0275\u0275nextContext(3).togglePhotoSelection(n)})("updatePhotoItem",function(n){return e.\u0275\u0275restoreView(o),e.\u0275\u0275nextContext(3).updatePhotoItem(n)}),e.\u0275\u0275pipe(1,"async"),e.\u0275\u0275pipe(2,"async"),e.\u0275\u0275pipe(3,"async"),e.\u0275\u0275pipe(4,"async"),e.\u0275\u0275pipe(5,"async"),e.\u0275\u0275pipe(6,"async"),e.\u0275\u0275pipe(7,"async"),e.\u0275\u0275elementEnd()}if(2&r){const o=e.\u0275\u0275nextContext(3);let t,n,l,s,m,u,y;e.\u0275\u0275property("colsNumber",null!==(t=e.\u0275\u0275pipeBind1(1,8,o.imagesInRow$))&&void 0!==t?t:4)("isDefaultGallerySelected",null===(n=e.\u0275\u0275pipeBind1(2,10,o.isDefaultGallerySelected$))||void 0===n||n)("photoItems",null!==(l=e.\u0275\u0275pipeBind1(3,12,o.currentGalleryPhotos$))&&void 0!==l?l:e.\u0275\u0275pureFunction0(22,X))("photoSelectionOn",null!==(s=e.\u0275\u0275pipeBind1(4,14,o.photoSelectionOn$))&&void 0!==s&&s)("photosCollection",null!==(m=e.\u0275\u0275pipeBind1(5,16,o.photoCollectionDictionary$))&&void 0!==m?m:e.\u0275\u0275pureFunction0(23,he))("selectedKeys",null!==(u=e.\u0275\u0275pipeBind1(6,18,o.selectedPhotoKeys$))&&void 0!==u?u:o.emptySet)("uploadSnapsh
1ots",null!==(y=e.\u0275\u0275pipeBind1(7,20,o.uploadSnapshots$))&&void 0!==y?y:e.\u0275\u0275pureFunction0(24,X))("allowImagesDownload",o.allowImagesDownload)}}function xt(r,a){1&r&&(e.\u0275\u0275elementStart(0,"div",28),e.\u0275\u0275element(1,"mat-spinner"),e.\u0275\u0275elementStart(2,"h2"),e.\u0275\u0275text(3),e.\u0275\u0275pipe(4,"translate"),e.\u0275\u0275elementEnd()()),2&r&&(e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate(e.\u0275\u0275pipeBind1(4,1,"PROPERTY_PHOTOS_LOADING")))}function Ct(r,a){if(1&r&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275template(1,vt,8,25,"tn-photo-list",25),e.\u0275\u0275pipe(2,"async"),e.\u0275\u0275template(3,xt,5,3,"ng-template",null,26,e.\u0275\u0275templateRefExtractor),e.\u0275\u0275elementContainerEnd()),2&r){const o=e.\u0275\u0275reference(4),t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!1===e.\u0275\u0275pipeBind1(2,2,t.syncInProgress$))("ngIfElse",o)}}function St(r,a){if(1&r&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275template(1,mt,2,1,"div",6),e.\u0275\u0275pipe(2,"async"),e.\u0275\u0275template(3,ht,1,1,"tn-add-photo-gallery",7),e.\u0275\u0275pipe(4,"async"),e.\u0275\u0275template(5,ut,7,6,"tn-property-section-header",8),e.\u0275\u0275pipe(6,"async"),e.\u0275\u0275elementStart(7,"div",9),e.\u0275\u0275template(8,yt,9,21,"ui-file-upload-form",10),e.\u0275\u0275pipe(9,"async"),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(10,Pt,3,3,"ng-container",1),e.\u0275\u0275pipe(11,"async"),e.\u0275\u0275template(12,Ct,5,4,"ng-container",1),e.\u0275\u0275pipe(13,"async"),e.\u0275\u0275elementContainerEnd()),2&r){const o=a.ngIf,t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",e.\u0275\u0275pipeBind1(2,6,t.isDefaultGallerySelected$)),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",e.\u0275\u0275pipeBind1(4,8,t.isDefaultGallerySelected$)),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",o.length>1&&e.\u0275\u0275pipeBind1(6,10,t.isDefaultGallerySelected$)),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngIf",e.\u0275\u0275pipeBind1(9,12,t.propertyId$)),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",e.\u0275\u0275pipeBind1(11,14,t.currentGallery$)),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",e.\u0275\u0275pipeBind1(13,16,t.metaDataLoaded$))}}function bt(r,a){if(1&r){const o=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"ui-snack-bar")(1,"tn-selected-photos-toolbar",29),e.\u0275\u0275listener("deleteSelected",function(){return e.\u0275\u0275restoreView(o),e.\u0275\u0275nextContext().deleteSelectedPhotos()})("hideSelected",function(){return e.\u0275\u0275restoreView(o),e.\u0275\u0275nextContext().hideSelectedPhotos()})("showSelected",function(){return e.\u0275\u0275restoreView(o),e.\u0275\u0275nextContext().showSelectedPhotos()})("turnOffSelection",function(){return e.\u0275\u0275restoreView(o),e.\u0275\u0275nextContext().togglePhotoSelectionMode()}),e.\u0275\u0275pipe(2,"async"),e.\u0275\u0275pipe(3,"async"),e.\u0275\u0275elementEnd()()}if(2&r){const o=e.\u0275\u0275nextContext();let t,n;e.\u0275\u0275advance(1),e.\u0275\u0275property("isAllSelectedPhotoHidden",null!==(t=e.\u0275\u0275pipeBind1(2,2,o.isAllSelectedPhotoHidden$))&&void 0!==t&&t)("selectedKeys",null!==(n=e.\u0275\u0275pipeBind1(3,4,o.selectedPhotoKeys$))&&void 0!==n?n:o.emptySet)}}const It=[{path:"",pathMatch:"full",component:(()=>{class r{constructor(o,t,n,l,s,m,u,y,G,S,Z,Q,ie){this.confirmDialogService=o,this.fileUploadComponentStore=t,this.singlePropertyFacade=n,this.propertyFeaturePhotosFacade=l,this.propertyFilesRepository=s,this.propertiesStoreRepository=m,this.choosePhotoDialogService=u,this.ordersRepositoryDeprecated=y,this.orderDeliveryRepository=G,this.nativeDeliveryService=S,this.listingWebsitesService=Z,this.appConfigService=Q,this.orderMetadataRepositoryService=ie,this.propertyId$=this.singlePropertyFacade.propertyId$,this.galleries$=this.propertyFeaturePhotosFacade.galleries$,this.currentGalleryPhotos$=this.propertyFeaturePhotosFacade.currentGalleryPhotos$,this.photoSelectionOn$=this.propertyFeaturePhotosFacade.photoSelectionOn$,this.imagesInRow$=this.propertyFeaturePhotosFacade.imagesInRow$,this.selectedPhotoKeys$=this.propertyFeaturePhotosFacade.selectedPhotoKeys$,this.isAllSelectedPhotoHidden$=this.propertyFeaturePhotosFacade.isAllSelectedPhotoHidden$,this.uploadSnapsh
1ots$=this.fileUploadComponentStore.uploadSnapshots$,this.isDefaultGallerySelected$=this.propertyFeaturePhotosFacade.isDefaultGallerySelected$,this.currentGallery$=this.propertyFeaturePhotosFacade.currentGallery$,this.photoCollectionDictionary$=this.propertyFeaturePhotosFacade.photoCollectionDictionary$,this.galleryPreviewPhotoUrls$=this.propertyFeaturePhotosFacade.galleryPreviewPhotoUrls$,this.defaultGalleryPhotos$=this.propertyFeaturePhotosFacade.defaultGalleryPhotos$,this.allowedFileTypes=["jpeg","png","jpg"],this.emptySet=new Set,this.imageDocumentsMetadata$=this.propertyId$.pipe((0,T.U)(A=>({resizable:!0,tonomoExternalId:A}))),this.filesUploadInProgress$=this.fileUploadComponentStore.inProgress$,this.videoUpdates={},this.deliverySyncInProgress=!1,this.hasDeliverableImages=!1,this.allowImagesDownload=!1,this.orderId="",this.address="",this.destroyed=new K.xQ,this.isDestroyed=!1,this.syncInProgress$=this.singlePropertyFacade.property$.pipe((0,P.q)(1),(0,E.w)(A=>this.orderDeliveryRepository.watchDeliverySyncStatus(A.tonomoExternalId)),(0,T.U)(A=>"pending"===A||"in_progress"===A)),this.metaDataLoaded$=this.syncInProgress$.pipe((0,P.q)(1),(0,T.U)(()=>!0))}get isDefaultGallerySelected(){let o;return this.isDefaultGallerySelected$.pipe((0,P.q)(1)).subscribe(t=>o=t),o}ngOnInit(){this.singlePropertyFacade.property$.pipe((0,P.q)(1)).subscribe(o=>{var t,n;this.orderId=null!==(t=null==o?void 0:o.tonomoExternalId)&&void 0!==t?t:"",this.address=(null==o?void 0:o.propertyAddress.street)||(null==o?void 0:o.propertyAddress.formattedAddress)||"",this.mapAndSetGalleries(o),this.watchDeliverySyncStatus(null!==(n=null==o?void 0:o.tonomoExternalId)&&void 0!==n?n:""),this.initPhotoCollectionSubscription(o).pipe((0,P.q)(1)).subscribe(()=>this.initStateChangesSubscription()),this.ordersRepositoryDeprecated.fetchOrder(o.tonomoExternalId).subscribe(l=>{this.allowImagesDownload=!(null==l?void 0:l.lockFilesUntilPaid)||l.paymentStatus===W.bG.Paid||l.paymentStatus===W.bG.PromisedPayment,this.initHasDeliverableImages(l,o.tonomoExternalId)})})}ngOnDestroy(){this.isDestroyed=!0,this.destroyed.next(),this.destroyed.complete()}getGalleryDownloadUrl(o){return this.appConfigService.streamingServiceUrl+`/${this.appConfigService.projectId}/orders/${this.orderId}/download-images-in-order?galleryName=${o}&folderName=${this.address||o}`}mapAndSetGalleries(o){const t=[],n=o.galleries.map(l=>{const s=this.propertyFeaturePhotosFacade.createId();return l.photos.forEach(m=>{t.push(Object.assign(Object.assign({},m),{galleryId:s}))}),{dropboxId:l.dropboxId,name:l.name,description:l.description,photos:[],id:s}});n.length||n.push({dropboxId:"",name:"Other photos",description:"",photos:[],id:this.propertyFeaturePhotosFacade.createId()}),this.propertyFeaturePhotosFacade.setAllGalleries(n),this.propertyFeaturePhotosFacade.setAllPhotos(t),this.propertyFeaturePhotosFacade.selectCurrentGallery(n[n.length-1].id)}initStateChangesSubscription(){this.propertyFeaturePhotosFacade.galleriesWithPhotos$.pipe((0,F.R)(this.destroyed),(0,ee.T)(1)).subscribe(()=>{this.singlePropertyFacade.setPristineStatus(!1)})}initPhotoCollectionSubscription(o){const t=this.propertyFilesRepository.getPropertyPhotos(o.tonomoExternalId).pipe((0,te.d)({bufferSize:1,refCount:!0}),(0,F.R)(this.destroyed));return t.subscribe(n=>{this.propertyFeaturePhotosFacade.setPhotoCollection(n)}),t}setImagesInRow(o){this.propertyFeaturePhotosFacade.setImagesInRow(o)}addGallery(o){this.propertyFeaturePhotosFacade.addOneGallery(o)}updatePhotoItem(o){this.propertyFeaturePhotosFacade.updateManyPhotos([o])}onPhotoMove(o){this.propertyFeaturePhotosFacade.changePhotoOrder(o)}onGalleryMove(o){this.propertyFeaturePhotosFacade.changeGalleryOrder({fromIndex:o.previousIndex,toIndex:o.currentIndex})}togglePhotoSelectionMode(){this.propertyFeaturePhotosFacade.togglePhotoSelectionMode()}onSortImages(o){this.propertyFeaturePhotosFacade.sortGalleryPhotos(o)}togglePhotoSelection(o){this.propertyFeaturePhotosFacade.togglePhotoSelection(o)}setCoverPhotoForCurrentGallery(o){this.propertyFeaturePhotosFacade.setCoverPhotoForCurrentGallery(o),this.setVideoCoverUpdates()}setVideoCoverUpdates(){return(0,L.mG)(this,void 0,void 0,function*(){const o=yield this.singlePropertyFacade.property$.pipe((0,P.q)(1)).toPromise();let t=(null==o?void 0:o.videos)||[];t=t.map(n=>Object.assign(Object.assign({},n),{isCover:!1}
1)),this.videoUpdates={videos:t}})}deletePhoto(o){this.isDefaultGallerySelected?this.propertyFeaturePhotosFacade.deletePhoto(o):this.propertyFeaturePhotosFacade.assignPhotosToDefaultGallery([o])}deleteSelectedPhotos(){this.isDefaultGallerySelected?this.propertyFeaturePhotosFacade.deleteSelectedPhotos():this.selectedPhotoKeys$.pipe((0,P.q)(1),(0,T.U)(o=>[...o])).subscribe(o=>{this.propertyFeaturePhotosFacade.assignPhotosToDefaultGallery(o)})}hideSelectedPhotos(){this.propertyFeaturePhotosFacade.hideSelectedPhotos()}showSelectedPhotos(){this.propertyFeaturePhotosFacade.showSelectedPhotos()}deleteCurrentGalleryPhotos(){this.isDefaultGallerySelected?this.propertyFeaturePhotosFacade.deleteCurrentGalleryPhotos():this.currentGalleryPhotos$.pipe((0,P.q)(1)).subscribe(o=>{const t=o.map(n=>n.storeKey);this.propertyFeaturePhotosFacade.assignPhotosToDefaultGallery(t)})}selectAllPhotos(){this.propertyFeaturePhotosFacade.selectAllPhotos()}unselectAllPhotos(){this.propertyFeaturePhotosFacade.deselectAllPhotos()}removeGallery(o){this.propertyFeaturePhotosFacade.removeOneGallery(o.id)}openGallery(o){this.propertyFeaturePhotosFacade.selectCurrentGallery(o.id)}updateGallery(o){this.propertyFeaturePhotosFacade.updateOneGallery(o)}openDefaultGallery(){this.propertyFeaturePhotosFacade.defaultGallery$.pipe((0,P.q)(1)).subscribe(o=>{this.propertyFeaturePhotosFacade.selectCurrentGallery(o.id)})}addNewPhotos(o){const t=o.filter(n=>"success"===n.state).map(n=>{const l=n.metadata.customMetadata;return{name:l.fileName||"",storeKey:l.storeKey}});this.propertyFeaturePhotosFacade.addManyPhotos(t),this.propertyFilesRepository.refreshPhotos(this.orderId)}openChoosePhotosDialog(){this.defaultGalleryPhotos$.pipe((0,P.q)(1)).subscribe(o=>{this.choosePhotoDialogService.openDialog({photos:o}).pipe((0,k.h)(t=>Boolean(t))).subscribe(t=>{const n=t.map(l=>l.storeKey);this.propertyFeaturePhotosFacade.assignPhotosToCurrentGallery(n)})})}pullDeliveryImages(){this.deliverySyncInProgress=!0;const o=this.orderId;this.propertyId$.pipe((0,P.q)(1),(0,E.w)(t=>this.listingWebsitesService.syncDeliveryWithSPW(t,{spwSyncOptions:{syncImages:!0,syncVideos:!1,syncTours:!1,syncFloorPlans:!1,syncDocuments:!1}})),(0,U.K)(()=>(0,$.of)({status:"error"})),(0,D.b)(()=>this.deliverySyncInProgress=!1),(0,k.h)(t=>"ok"===t.status),(0,D.b)(()=>this.propertyFilesRepository.refreshPhotos(o)),(0,E.w)(()=>this.propertiesStoreRepository.refresh(o))).subscribe(t=>{this.isDestroyed||(null==t?void 0:t.tonomoExternalId)!==o||(this.mapAndSetGalleries(t),setTimeout(()=>this.singlePropertyFacade.setPristineStatus(!0)))})}onSaveChanges(){(0,H.aj)([this.propertyFeaturePhotosFacade.galleriesWithPhotos$,this.singlePropertyFacade.property$]).pipe((0,P.q)(1)).subscribe(([o,t])=>{this.singlePropertyFacade.updateProperty(Object.assign(Object.assign({galleries:o},this.videoUpdates),{tonomoExternalId:t.tonomoExternalId}))})}canDeactivate(){return this.filesUploadInProgress$.pipe((0,P.q)(1),(0,E.w)(o=>o?this.confirmDialogService.confirm({message:["Media files are being downloaded.","Do you want to continue downloading?"],okButtonText:"Continue",cancelButtonText:"Undo"}).pipe((0,T.U)(s=>!s),(0,D.b)(s=>{s&&(this.fileUploadComponentStore.cancelUploading(),this.singlePropertyFacade.setPristineStatus(!0))})):this.singlePropertyFacade.canDeactivate()))}initHasDeliverableImages(o,t){(null==o?void 0:o.isNativeUpload)?this.nativeDeliveryService.get(t).pipe((0,T.U)(n=>n.photos.length>0),(0,U.K)(()=>(0,$.of)(!1)),(0,F.R)(this.destroyed)).subscribe(n=>this.hasDeliverableImages=n):this.orderDeliveryRepository.watchDeliverableImages(t).pipe((0,F.R)(this.destroyed)).subscribe(n=>this.hasDeliverableImages=n.length>0)}watchDeliverySyncStatus(o){const t=this.orderMetadataRepositoryService.getById$(o);(0,H.aj)([t,this.syncInProgress$,(0,q.F)(1e3)]).pipe((0,F.R)(this.destroyed),(0,k.h)(([n,l])=>l),(0,k.h)(([n])=>!!(null==n?void 0:n.startDeliverySyncDate))).subscribe(([n])=>{const l=n,s=l.startDeliverySyncDate.seconds;j.Z.firestore.Timestamp.now().seconds-s<=300||this.reportedSyncFailureAt!==s&&(this.reportedSyncFailureAt=s,this.orderDeliveryRepository.markDeliverySyncFailed(l.id).c
1atch(console.error))})}}return r.\u0275fac=function(o){return new(o||r)(e.\u0275\u0275directiveInject(f.DNF),e.\u0275\u0275directiveInject(f.$X_),e.\u0275\u0275directiveInject(i.RV),e.\u0275\u0275directiveInject(de),e.\u0275\u0275directiveInject(i.Dw),e.\u0275\u0275directiveInject(i.fm),e.\u0275\u0275directiveInject(z.bN),e.\u0275\u0275directiveInject(Y.wQ),e.\u0275\u0275directiveInject(Y.y2),e.\u0275\u0275directiveInject(oe.zz),e.\u0275\u0275directiveInject(ne.fR),e.\u0275\u0275directiveInject(N._ZM),e.\u0275\u0275directiveInject(N.ZlF))},r.\u0275cmp=e.\u0275\u0275defineComponent({type:r,selectors:[["tn-property-feature-photos"]],features:[e.\u0275\u0275ProvidersFeature([de])],decls:10,vars:12,consts:[["class","pb-8",4,"ngIf"],[4,"ngIf"],[1,"flex-auto"],[1,"pb-8"],[1,"flex"],["uiIcon","close",1,"ml-auto","cursor-pointer","p-8","text-gray-50","hover:text-gray-90",3,"click"],["cdkDropList","",3,"cdkDropListDropped",4,"ngIf"],[3,"showCaption","addGallery",4,"ngIf"],["class","mt-24",4,"ngIf"],[1,"my-16"],[3,"allowedFileTypes","metadata","buttonText","collectionPath","headerText","storagePath","uploadedFiles",4,"ngIf"],["cdkDropList","",3,"cdkDropListDropped"],[4,"ngFor","ngForOf"],["cdkDrag","","class","mb-12",3,"disableAddPhotos","cdkDragDisabled","gallery","previewUrls","openGallery","removeGallery","updateGallery",4,"ngIf"],["cdkDrag","",1,"mb-12",3,"disableAddPhotos","cdkDragDisabled","gallery","previewUrls","openGallery","removeGallery","updateGallery"],[3,"showCaption","addGallery"],[1,"mt-24"],[1,""],[3,"allowedFileTypes","metadata","buttonText","collectionPath","headerText","storagePath","uploadedFiles"],["uiBtnSize","small","uiBtnTheme","main","themeMode","tertiary","class","mr-8","customActionBtn","",3,"uiBtnLoading","click",4,"ngIf"],["uiBtnSize","small","uiBtnTheme","main","themeMode","tertiary","class","mr-8","customActionBtn","",3,"click",4,"ngIf"],["uiBtnSize","small","uiBtnTheme","main","themeMode","tertiary","customActionBtn","",1,"mr-8",3,"uiBtnLoading","click"],["uiBtnSize","small","uiBtnTheme","main","themeMode","tertiary","customActionBtn","",1,"mr-8",3,"click"],["class","mb-20",3,"imagesInRow","photoSelectionOn","galleryDownloadUrl","allowImagesDownload","changeImagesInRow","deleteAll","deselectAll","selectAll","togglePhotoSelectionMode","sort",4,"ngIf"],[1,"mb-20",3,"imagesInRow","photoSelectionOn","galleryDownloadUrl","allowImagesDownload","changeImagesInRow","deleteAll","deselectAll","selectAll","togglePhotoSelectionMode","sort"],[3,"colsNumber","isDefaultGallerySelected","photoItems","photoSelectionOn","photosCollection","selectedKeys","uploadSnapshots","allowImagesDownload","delete","move","setAsCover","toggleSelection","updatePhotoItem",4,"ngIf","ngIfElse"],["loadingPhotoList",""],[3,"colsNumber","isDefaultGallerySelected","photoItems","photoSelectionOn","photosCollection","selectedKeys","uploadSnapshots","allowImagesDownload","delete","move","setAsCover","toggleSelection","updatePhotoItem"],[1,"grid","justify-items-center","content-center","gap-16","h-full"],[3,"isAllSelectedPhotoHidden","selectedKeys","deleteSelected","hideSelected","showSelected","turnOffSelection"]],template:function(o,t){1&o&&(e.\u0275\u0275template(0,st,7,6,"tn-property-section-header",0),e.\u0275\u0275pipe(1,"async"),e.\u0275\u0275template(2,ct,9,6,"tn-property-section-header",1),e.\u0275\u0275pipe(3,"async"),e.\u0275\u0275template(4,St,14,18,"ng-container",1),e.\u0275\u0275pipe(5,"async"),e.\u0275\u0275element(6,"div",2)(7,"ui-file-upload-status-bar"),e.\u0275\u0275template(8,bt,4,6,"ui-snack-bar",1),e.\u0275\u0275pipe(9,"async")),2&o&&(e.\u0275\u0275property("ngIf",e.\u0275\u0275pipeBind1(1,4,t.isDefaultGallerySelected$)),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",!1===e.\u0275\u0275pipeBind1(3,6,t.isDefaultGallerySelected$)),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",e.\u0275\u0275pipeBind1(5,8,t.galleries$)),e.\u0275\u0275advance(4),e.\u0275\u0275property("ngIf",e.\u0275\u0275pipeBind1(9,10,t.photoSelectionOn$)))},directives:[v.NgIf,_e.A,R.a,x.Wj,v.NgForOf,be,x.Zt,Ee,Fe.j,M.s,B.V,De.T,Le,ot,nt.Ou,rt.B,it.E,at],pipes:[v.AsyncPipe,I.X$],styles:["[_nghost-%COMP%]{display:flex;min-height:100%;flex-direction:column;padding:1.5rem 1.5rem 2rem}.cdk-drop-list-dragging[_ngcontent-%COMP%] tn-photo-gallery-widget[_ngcontent-%COMP%]{transition:transform .3s cubic-bezier(0,0,.2,1)}"]}),r})(),canDeactivate:[i.$v]}];let wt=(()=>{class r{}return r.\u0275fac=function(o){return new(o||r)},r.\u0275mod=e.\u0275\u0275defineNgModule({type:r}),r.\u0275inj=e.\u0275\u0275defineInjector({imports:[[v.CommonModule,b.UX,J.Bz.forChild(It),x._t,f.eYi,z.gq,I.aw]]}),r})()},87366:(ue,V,c)=>{c.d(V,{qk:()=>W,bN:()=>P,gq:()=>z});var x=c(69808),v=c(93075),b=c(74202),J=c(51062),I=c(96410),i=c(5e3);let z=(()=>{class p{}
1return p.\u0275fac=function(d){return new(d||p)},p.\u0275mod=i.\u0275\u0275defineNgModule({type:p}),p.\u0275inj=i.\u0275\u0275defineInjector({imports:[[x.CommonModule,I.eYi,b.Bz,v.UX,J.aw]]}),p})();var f=c(48966),L=c(67656),j=c(255),K=c(66809),$=c(72751);function H(p,_){1&p&&i.\u0275\u0275element(0,"i",9)}function q(p,_){if(1&p){const d=i.\u0275\u0275getCurrentView();i.\u0275\u0275elementStart(0,"div",6),i.\u0275\u0275listener("click",function(){const g=i.\u0275\u0275restoreView(d).$implicit;return i.\u0275\u0275nextContext().toggleSelection(g.storeKey)}),i.\u0275\u0275template(1,H,1,0,"i",7),i.\u0275\u0275element(2,"img",8),i.\u0275\u0275elementEnd()}if(2&p){const d=_.$implicit,h=i.\u0275\u0275nextContext();i.\u0275\u0275advance(1),i.\u0275\u0275property("ngIf",h.selectedPhotoKeys.has(d.storeKey)),i.\u0275\u0275advance(1),i.\u0275\u0275property("src",d.thumbnail,i.\u0275\u0275sanitizeUrl)}}let T=(()=>{class p{constructor(d,h){this.dialogRef=d,this.data=h,this.selectedPhotoKeys=new Set}toggleSelection(d){this.data.singleSelection?this.selectedPhotoKeys=new Set([d]):(this.selectedPhotoKeys=new Set(this.selectedPhotoKeys),this.selectedPhotoKeys.has(d)?this.selectedPhotoKeys.delete(d):this.selectedPhotoKeys.add(d))}trackBy(d){return d}onSubmit(){const d=[...this.selectedPhotoKeys].map(h=>this.data.photos.find(w=>w.storeKey===h));this.dialogRef.close(d)}onCancel(){this.dialogRef.close()}}return p.\u0275fac=function(d){return new(d||p)(i.\u0275\u0275directiveInject(f.so),i.\u0275\u0275directiveInject(f.WI))},p.\u0275cmp=i.\u0275\u0275defineComponent({type:p,selectors:[["tn-choose-photo-dialog"]],decls:15,vars:7,consts:[[1,"p-min","pr-16","grid","grid-cols-6","gap-4"],["class","relative cursor-pointer",3,"click",4,"ngFor","ngForOf","ngForTrackBy"],[1,"body","text-gray-50"],[1,"body-semibold"],["uiBtnSize","medium","uiBtnTheme","main","themeMode","secondary","matDialogClose","",1,"ml-auto"],["uiBtnSize","medium","uiBtnTheme","main",3,"disabled","click"],[1,"relative","cursor-pointer",3,"click"],["class","selection-icon","size","22","uiIcon","check_circle","uiIconVariant","filled",4,"ngIf"],[1,"w-full","h-full","object-cover","rounded",3,"src"],["size","22","uiIcon","check_circle","uiIconVariant","filled",1,"selection-icon"]],template:function(d,h){1&d&&(i.\u0275\u0275elementStart(0,"ui-dialog-header"),i.\u0275\u0275text(1),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(2,"mat-dialog-content")(3,"div",0),i.\u0275\u0275template(4,q,3,2,"div",1),i.\u0275\u0275elementEnd()(),i.\u0275\u0275elementStart(5,"mat-dialog-actions")(6,"div")(7,"span",2),i.\u0275\u0275text(8,"Selected "),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(9,"span",3),i.\u0275\u0275text(10),i.\u0275\u0275elementEnd()(),i.\u0275\u0275elementStart(11,"button",4),i.\u0275\u0275text(12," Cancel "),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(13,"button",5),i.\u0275\u0275listener("click",function(){return h.onSubmit()}),i.\u0275\u0275text(14),i.\u0275\u0275elementEnd()()),2&d&&(i.\u0275\u0275advance(1),i.\u0275\u0275textInterpolate(h.data.dialogTitle||"Choose Photos"),i.\u0275\u0275advance(3),i.\u0275\u0275property("ngForOf",h.data.photos)("ngForTrackBy",h.trackBy),i.\u0275\u0275advance(6),i.\u0275\u0275textInterpolate2(" ",h.selectedPhotoKeys.size," of ",h.data.singleSelection?1:h.data.photos.length," "),i.\u0275\u0275advance(3),i.\u0275\u0275property("disabled",0===h.selectedPhotoKeys.size),i.\u0275\u0275advance(1),i.\u0275\u0275textInterpolate1(" ",h.data.submitBtnName||"Add Images"," "))},directives:[L.A,f.xY,x.NgForOf,x.NgIf,j.a,f.H8,K.s,$.V,f.ZT],styles:[".selection-icon[_ngcontent-%COMP%]{position:absolute;top:.75rem;left:.75rem;height:1.25rem;width:1.25rem;border-radius:9999px;--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));color:var(--brand-50, #228BE6)}"],changeDetection:0}),p})(),P=(()=>{class p{constructor(d){this.matDialog=d}openDialog(d){return this.matDialog.open(T,{panelClass:"app-v2",width:"calc(100vw - 240px)",data:d}).afterClosed()}}return p.\u0275fac=function(d){return new(d||p)(i.\u0275\u0275inject(f.uw))},p.\u0275prov=i.\u0275\u0275defineInjectable({token:p,factory:p.\u0275fac,providedIn:"root"}),p})();var E=c(53251),F=c(87238),ee=c(92338);function te(p,_){1&p&&i.\u0275\u0275element(0,"i",14)}function k(p,_){if(1&p){const d=i.\u0275\u0275getCurrentView();i.\u0275\u0275elementStart(0,"div",11),i.\u0275\u0275listener("click",function(){const g=i.\u0275\u0275restoreView(d).$implicit;return i.\u0275\u0275nextContext().togglePhotoSelection(g.storeKey)}),i.\u0275\u0275element(1,"img",12),i.\u0275\u0275template(2,te,1,0,"i",13),i.\u0275\u0275elementEnd()}if(2&p){const d=_.$implicit,h=i.\u0275\u0275nextContext();i.\u0275\u0275advance(1),i.\u0275\u0275property("src",d.thumbnail,i.\u0275\u0275sanitizeUrl),i.\u0275\u0275advance(1),i.\u0275\u0275property("ngIf",h.selectedPhotoKey===d.storeKey)}}function U(p,_){1&p&&i.\u0275\u0275element(0,"i",14)}function D(p,_){if(1&p){const d=i.\u0275\u0275getCurrentView();i.\u0275\u0275elementStart(0,"div",15),i.\u0275\u0275listener("click",function(){const g=i.\u0275\u0275restoreView(d).$implicit;return i.\u0275\u0275nextContext().toggleVideoSelection(g.id)}),i.\u0275\u0275element(1,"ui-video-player",16),i.\u0275\u0275template(2,U,1,0,"i",13),i.\u0275\u0275elementEnd()}if(2&p){const d=_.$implicit,h=i.\u0275\u0275nextContext();i.\u0275\u0275property("matTooltip",d.title),i.\u0275\u0275advance(1),i.\u0275\u0275property("url",d.url),i.\u0275\u0275advance(1),i.\u0275\u0275property("ngIf",h.selectedVideoId===d.id)}}const N=function(p){return["/admin/property-dashboard",p,"photo-gallery"]};function oe(p,_){if(1&p&&(i.\u0275\u0275elementStart(0,"div",17),i.\u0275\u0275text(1," Upload more photos in "),i.\u0275\u0275elementStart(2,"a",18),i.\u0275\u0275text(3," Photo Gallery "),i.\u0275\u0275elementEnd()()),2&p){const d=i.\u0275\u0275nextContext();i.\u0275\u0275advance(2),i.\u0275\u0275property("routerLink",i.\u0275\u0275pureFunction1(1,N,d.data.orderId))}}const Y=function(p){return["/admin/property-dashboard",p,"videos"]};function le(p,_){if(1&p&&(i.\u0275\u0275elementStart(0,"div",17),i.\u0275\u0275text(1," Upload more videos in "),i.\u0275\u0275elementStart(2,"a",18),i.\u0275\u0275text(3," Videos "),i.\u0275\u0275elementEnd()()),2&p){const d=i.\u0275\u0275nextContext();i.\u0275\u0275advance(2),i.\u0275\u0275property("routerLink",i.\u0275\u0275pureFunction1(1,Y,d.data.orderId))}}let ne=(()=>{class p{constructor(d,h){this.dialogRef=d,this.data=h,this.selectedPhotoKey=null,this.selectedVideoId=null,this.selectedTabIndex=0}togglePhotoSelection(d){this.selectedPhotoKey=this.selectedPhotoKey===d?null:d,this.selectedVideoId=null}toggleVideoSelection(d){this.selectedVideoId=this.selectedVideoId===d?null:d,this.selectedPhotoKey=null}trackBy(d){return d}onSubmit(){this.dialogRef.close({selectedPhoto:this.selectedPhotoKey&&this.data.photos.find(d=>d.storeKey===this.selectedPhotoKey),selectedVideo:this.selectedVideoId&&this.data.videos.find(d=>d.id===this.selectedVideoId)})}onCancel(){this.dialogRef.close()}}
1return p.\u0275fac=function(d){return new(d||p)(i.\u0275\u0275directiveInject(f.so),i.\u0275\u0275directiveInject(f.WI))},p.\u0275cmp=i.\u0275\u0275defineComponent({type:p,selectors:[["tn-choose-cover-dialog"]],decls:19,vars:10,consts:[["animationDuration","0ms",1,"pt-16",3,"selectedIndex","selectedIndexChange"],["label","Photos"],[1,"p-min","pt-16","pr-16","grid","grid-cols-6","gap-4"],["class","relative cursor-pointer",3,"click",4,"ngFor","ngForOf","ngForTrackBy"],["label","Videos"],["class","relative cursor-pointer",3,"matTooltip","click",4,"ngFor","ngForOf","ngForTrackBy"],[1,"justify-between"],["class","text-12 text-gray-50",4,"ngIf"],[1,"flex","justify-between","items-center","gap-8"],["uiBtnSize","medium","uiBtnTheme","main","themeMode","secondary","matDialogClose",""],["uiBtnSize","medium","uiBtnTheme","main",3,"disabled","click"],[1,"relative","cursor-pointer",3,"click"],[1,"w-full","h-full","object-cover","rounded",3,"src"],["class","selection-icon","size","22","uiIcon","check_circle","uiIconVariant","filled",4,"ngIf"],["size","22","uiIcon","check_circle","uiIconVariant","filled",1,"selection-icon"],[1,"relative","cursor-pointer",3,"matTooltip","click"],[1,"pointer-events-none",3,"url"],[1,"text-12","text-gray-50"],["matDialogClose","",1,"text-12",3,"routerLink"]],template:function(d,h){1&d&&(i.\u0275\u0275elementStart(0,"ui-dialog-header"),i.\u0275\u0275text(1),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(2,"mat-tab-group",0),i.\u0275\u0275listener("selectedIndexChange",function(g){return h.selectedTabIndex=g}),i.\u0275\u0275elementStart(3,"mat-tab",1)(4,"mat-dialog-content")(5,"div",2),i.\u0275\u0275template(6,k,3,2,"div",3),i.\u0275\u0275elementEnd()()(),i.\u0275\u0275elementStart(7,"mat-tab",4)(8,"mat-dialog-content")(9,"div",2),i.\u0275\u0275template(10,D,3,3,"div",5),i.\u0275\u0275elementEnd()()()(),i.\u0275\u0275elementStart(11,"mat-dialog-actions",6),i.\u0275\u0275template(12,oe,4,3,"div",7),i.\u0275\u0275template(13,le,4,3,"div",7),i.\u0275\u0275elementStart(14,"div",8)(15,"button",9),i.\u0275\u0275text(16," Cancel "),i.\u0275\u0275elementEnd(),i.\u0275\u0275elementStart(17,"button",10),i.\u0275\u0275listener("click",function(){return h.onSubmit()}),i.\u0275\u0275text(18),i.\u0275\u0275elementEnd()()()),2&d&&(i.\u0275\u0275advance(1),i.\u0275\u0275textInterpolate(h.data.dialogTitle||"Choose Cover"),i.\u0275\u0275advance(1),i.\u0275\u0275property("selectedIndex",h.selectedTabIndex),i.\u0275\u0275advance(4),i.\u0275\u0275property("ngForOf",h.data.photos)("ngForTrackBy",h.trackBy),i.\u0275\u0275advance(4),i.\u0275\u0275property("ngForOf",h.data.videos)("ngForTrackBy",h.trackBy),i.\u0275\u0275advance(2),i.\u0275\u0275property("ngIf",0===h.selectedTabIndex),i.\u0275\u0275advance(1),i.\u0275\u0275property("ngIf",1===h.selectedTabIndex),i.\u0275\u0275advance(4),i.\u0275\u0275property("disabled",null===h.selectedPhotoKey&&null===h.selectedVideoId),i.\u0275\u0275advance(1),i.\u0275\u0275textInterpolate1(" ",h.data.submitBtnName||"Save"," "))},directives:[L.A,E.SP,E.uX,f.xY,x.NgForOf,x.NgIf,j.a,F.gM,ee.p,f.H8,b.yS,f.ZT,K.s,$.V],styles:["mat-tab-group[_ngcontent-%COMP%] .mat-tab-body-wrapper{--dialog-inset: 0}.selection-icon[_ngcontent-%COMP%]{position:absolute;top:.75rem;left:.75rem;height:1.25rem;width:1.25rem;border-radius:9999px;--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));color:var(--brand-50, #228BE6)}"],changeDetection:0}),p})(),W=(()=>{class p{constructor(d){this.matDialog=d}openDialog(d){return this.matDialog.open(ne,{panelClass:"app-v2",width:"calc(100vw - 240px)",data:d}).afterClosed()}}return p.\u0275fac=function(d){return new(d||p)(i.\u0275\u0275inject(f.uw))},p.\u0275prov=i.\u0275\u0275defineInjectable({token:p,factory:p.\u0275fac,providedIn:"root"}),p})()}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.