1"use strict";(self.webpackChunklightx=self.webpackChunklightx||[]).push([[4868],{2820:(I,C,c)=>{c.d(C,{Z:()=>_});var d=c(54438);let _=(()=>{var m;class v{constructor(u){this.el=u,this.regex=new RegExp(/^[0-9]+(\.[0-9][0-9]*){0,1}$/g),this.specialKeys=["Backspace","Tab","End","Home","ArrowLeft","ArrowRight","Delete"]}onKeyDown(u){if((u.metaKey||u.ctrlKey)&&("v"===u.key||"a"===u.key||"c"===u.key))return;if(-1!==this.specialKeys.indexOf(u.key))return;let b=this.el.nativeElement.value.concat(u.key);b&&!String(b).match(this.regex)&&u.preventDefault()}}return(m=v).\u0275fac=function(u){return new(u||m)(d.rXU(d.aKT))},m.\u0275dir=d.FsC({type:m,selectors:[["","numbersOnly",""]],hostBindings:function(u,h){1&u&&d.bIt("keydown",function(t){return h.onKeyDown(t)})}}),v})()},18545:(I,C,c)=>{c.d(C,{m:()=>f});var d=c(54438),_=c(345);let f=(()=>{var m;class v{constructor(u){this.sanitizer=u}transform(u,h){switch(h){case"html":return this.sanitizer.bypassSecurityTrustHtml(u);case"url":return this.sanitizer.bypassSecurityTrustUrl(u);default:throw new Error(`Invalid safe type specified: ${h}`)}}}return(m=v).\u0275fac=function(u){return new(u||m)(d.rXU(_.up,16))},m.\u0275pipe=d.EJ8({name:"safe",type:m,pure:!0}),v})()},93391:(I,C,c)=>{c.d(C,{C:()=>v});var d=c(54438),_=c(60177),f=c(84341);const m=g=>({transition:g});let v=(()=>{var g;class u{constructor(){this.selected=!1,this.disabled=!1,this.loaded=!1,this.changeT=new d.bkB}ngAfterViewInit(){setTimeout(()=>{this.loaded=!0},100)}ngOnInit(){}changeToggle(){setTimeout(()=>{this.changeT.emit(this.selected)},200)}}return(g=u).\u0275fac=function(b){return new(b||g)},g.\u0275cmp=d.VBU({type:g,selectors:[["toggle-switch"]],inputs:{selected:"selected",disabled:"disabled"},outputs:{changeT:"changeT"},decls:3,vars:5,consts:[[1,"toggle-switch"],["type","checkbox",3,"ngModelChange","click","disabled","ngModel"],[1,"slider",3,"ngClass"]],template:function(b,t){1&b&&(d.j41(0,"label",0)(1,"input",1),d.mxI("ngModelChange",function(x){return d.DH7(t.selected,x)||(t.selected=x),x}),d.bIt("click",function(){return t.changeToggle()}),d.k0s(),d.nrm(2,"div",2),d.k0s()),2&b&&(d.R7$(),d.Y8G("disabled",t.disabled),d.R50("ngModel",t.selected),d.R7$(),d.Y8G("ngClass",d.eq3(3,m,t.loaded)))},dependencies:[_.YU,f.Zm,f.BC,f.vS],styles:['.toggle-switch[_ngcontent-%COMP%]{height:30px;width:56px;display:inline-block;position:relative;margin-bottom:.5rem}.toggle-switch[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{display:none}.toggle-switch[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:checked + .slider[_ngcontent-%COMP%]{background-color:#fff}.toggle-switch[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:checked + .slider[_ngcontent-%COMP%]:after{transform:translate(26px)}.toggle-switch[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%]{border-radius:20px;position:absolute;left:0;top:0;right:0;bottom:0;background-color:#fff}.toggle-switch[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%]:after{position:absolute;content:"";height:24px;width:24px;background-color:#626adf;left:4px;bottom:3px;border-radius:20px}.toggle-switch[_ngcontent-%COMP%] .transition[_ngcontent-%COMP%]{transition:2s}.toggle-switch[_ngcontent-%COMP%] .transition[_ngcontent-%COMP%]:after{transition:.4s}']}),u})()},72155:(I,C,c)=>{c.r(C),c.d(C,{AIVideoTemplateModule:()=>ie});var d=c(60177),_=c(74710),f=c(84341),m=c(33391),v=c(80962),g=c(16478),u=c(45312),h=c(68465),b=c(58525),t=c(54438),S=c(34183),x=c(24045),D=c(68010),B=c(94223),O=c(68287),T=c(62261);const E=["cpText"],N=["fileInput"],U=["productListingComponent"],X=(r,l)=>l.text,$=()=>["/ai-design"],H=r=>({"ps-3 pe-3":r}),M=r=>({"bottomStrip--hidden":r}),L=r=>({"info-red":r}),V=r=>({"d-none":r}),Y=(r,l,n)=>({"info-up":r,"info-blue":l,"info-red":n});function z(r,l){if(1&r&&(t.j41(0,"div",15)(1,"div",16)(2,"a",17),t.EFF(3,"Home"),t.k0s(),t.nrm(4,"pi",18),t.j41(5,"a",17),t.EFF(6),t.k0s(),t.nrm(7,"pi",18),t.j41(8,"span",19),t.EFF(9),t.k0s()()()),2&r){const n=t.XpG();t.R7$(2),t.Y8G("routerLink",n.env.isMobileView?"/":n.homeURL),t.R7$(3),t.Y8G("routerLink",t.lJ4(4,$)),t.R7$(),t.JRh(n.getBreadcrumbLabel()),t.R7$(3),t.JRh(null==n.selectedProduct?null:n.selectedProduct.displayName)}}function W(r,l){1&r&&t.nrm(0,"div")}function K(r,l){if(1&r&&(t.qex(0),t.DNE(1,W,1,0,"div",45),t.bVm()),2&r){t.XpG(5);const n=t.sdS(12);t.R7$(),t.Y8G("ngTemplateOutlet",n)}}function q(r,l){if(1&r){const n=t.RV6();t.j41(0,"div",29,3),t.bIt("obsChange",function(i){t.eBV(n);const o=t.XpG(4);return t.Njj(o.onChangeVisibility(i))}),t.k0s(),t.j41(2,"div",30)(3,"div",31)(4,"div",32)(5,"div",33)(6,"input",34),t.bIt("keyup.enter",function(){t.eBV(n);const i=t.XpG(4);return t.Njj(i.generatePrompt())}),t.mxI("ngModelChange",function(i){t.eBV(n);const o=t.XpG(4);return t.DH7(o.customPrompt,i)||(o.customPrompt=i),t.Njj(i)}),t.k0s(),t.j41(7,"div",35)(8,"span",36),t.EFF(9),t.k0s()()(),t.j41(10,"div",37)(11,"button",38),t.bIt("click",function(){t.eBV(n);const i=t.XpG(4);return t.Njj(i.generatePrompt())}),t.EFF(12),t.k0s()()()(),t.j41(13,"button",39),t.bIt("click",function(){t.eBV(n);const i=t.XpG(4);return i.isFocused=!0,t.Njj(i.focusIn())}),t.EFF(14,"Generate with AI"),t.k0s(),t.j41(15,"button",40),t.bIt("click",function(){t.eBV(n);const i=t.XpG(4);return t.Njj(i.uploadAndEdit())}),t.j41(16,"div",41),t.nrm(17,"pi",42),t.k0s(),t.EFF(18),t.k0s(),t.j41(19,"button",43),t.bIt("click",function(){t.eBV(n);const i=t.XpG(4);return t.Njj(i.uploadAndEdit())}),t.EFF(20),t.k0s(),t.DNE(21,K,2,1,"ng-container",44),t.k0s()}if(2&r){const n=t.sdS(1),e=t.XpG(4);t.Y8G("obsIntersectTarget",n),t.R7$(2),t.AVh("bottom-upload",null==e.headerSection||null==e.headerSection.metadata?null:e.headerSection.metadata.stripText),t.Y8G("ngClass",t.eq3(15,M,e.isFooterInView)),t.R7$(2),t.Y8G("ngClass",t.eq3(17,L,e.customPrompt.length>449)),t.R7$(2),t.Mz_("placeholder","Write a prompt to generate ",null==e.selectedProduct?null:e.selectedProduct.displayName,""),t.R50("ngModel",e.customPrompt),t.R7$(),t.Y8G("ngClass",t.eq3(19,V,e.customPrompt.length<401)),t.R7$(),t.Y8G("ngClass",e.customPrompt.length>449?"text-red":"grey-300"),t.R7$(),t.SpI("",e.customPrompt.length,"/450"),t.R7$(3),t.SpI(" ",null!=e.headerSection&&null!=e.headerSection.links[0]&&e.headerSection.links[0].text&&""!==(null==e.headerSection||null==e.headerSection.links[0]?null:e.headerSection.links[0].text.trim())?null==e.headerSection||null==e.headerSection.links[0]?null:e.headerSection.links[0].text:"Generate"," "),t.R7$(6),t.SpI(" ",null!=e.headerSection&&null!=e.headerSection.links[1]&&e.headerSection.links[1].text&&""!==(null==e.headerSection||null==e.headerSection.links[1]?null:e.headerSection.links[1].text.trim())?null==e.headerSection||null==e.headerSection.links[1]?null:e.headerSection.links[1].text:"Upload & Edit"," "),t.R7$(2),t.SpI(" ",null!=e.headerSection&&null!=e.headerSection.links[1]&&e.headerSection.links[1].text&&""!==(null==e.headerSection||null==e.headerSection.links[1]?null:e.headerSection.links[1].text.trim())?null==e.headerSection||null==e.headerSection.links[1]?null:e.headerSection.links[1].text:"Upload & Edit"," "),t.R7$(),t.Y8G("ngIf",e.isFocused)}}function Q(r,l){if(1&r&&(t.j41(0,"div"),t.DNE(1,q,22,21),t.k0s()),2&r){const n=l.$implicit;t.R7$(),t.vxM("generate_with_text"==(null==n?null:n.type)?1:-1)}}function J(r,l){if(1&r&&(t.j41(0,"div",28),t.Z7z(1,Q,2,1,"div",null,X),t.k0s()),2&r){const n=t.XpG(2);t.AVh("ai-listing-header",!n.env.isMobileView),t.R7$(),t.Dyx(n.headerSection.links)}}function Z(r,l){if(1&r){const n=t.RV6();t.j41(0,"div",29,3),t.bIt("obsChange",function(i){t.eBV(n);const o=t.XpG(3);return t.Njj(o.onChangeVisibility(i))}),t.k0s(),t.j41(2,"div",46)(3,"div",47)(4,"div",32)(5,"div",33)(6,"input",34),t.bIt("keyup.enter",function(){t.eBV(n);const i=t.XpG(3);return t.Njj(i.generatePrompt())}),t.mxI("ngModelChange",function(i){t.eBV(n);const o=t.XpG(3);return t.DH7(o.customPrompt,i)||(o.customPrompt=i),t.Njj(i)}),t.k0s(),t.j41(7,"div",35)(8,"span",36),t.EFF(9),t.k0s()()(),t.j41(10,"div",37)(11,"button",38),t.bIt("click",function(){t.eBV(n);const i=t.XpG(3);return t.Njj(i.generatePrompt())}),t.EFF(12),t.k0s()()()()()}if(2&r){const n=t.sdS(1),e=t.XpG(3);t.Y8G("obsIntersectTarget",n),t.R7$(2),t.AVh("ai-listing-header",!e.env.isMobileView),t.R7$(),t.AVh("bottom-upload",null==e.headerSection||null==e.headerSection.metadata?null:e.headerSection.metadata.stripText),t.Y8G("ngClass",t.eq3(14,M,e.isFooterInView)),t.R7$(),t.Y8G("ngClass",t.eq3(16,L,e.customPrompt.length>449)),t.R7$(2),t.Mz_("placeholder","Write a prompt to generate ",null==e.selectedProduct?null:e.selectedProduct.displayName,""),t.R50("ngModel",e.customPrompt),t.R7$(),t.Y8G("ngClass",t.eq3(18,V,e.customPrompt.length<401)),t.R7$(),t.Y8G("ngClass",e.customPrompt.length>449?"text-red":"grey-300"),t.R7$(),t.SpI("",e.customPrompt.length,"/450"),t.R7$(3),t.JRh(null!=e.headerSection&&null!=e.headerSection.links[0]&&e.headerSection.links[0].text&&""!==(null==e.headerSection||null==e.headerSection.links[0]?null:e.headerSection.links[0].text.trim())?null==e.headerSection||null==e.headerSection.links[0]?null:e.headerSection.links[0].text:"Generate")}}function tt(r,l){if(1&r){const n=t.RV6();t.j41(0,"div",29,3),t.bIt("obsChange",function(i){t.eBV(n);const o=t.XpG(3);return t.Njj(o.onChangeVisibility(i))}),t.k0s(),t.j41(2,"div",48)(3,"button",49),t.bIt("click",function(){t.eBV(n);const i=t.XpG(3),o=t.sdS(10);return t.Njj(i.openTool(o))}),t.EFF(4),t.k0s()()}if(2&r){const n=t.sdS(1),e=t.XpG(3);t.Y8G("obsIntersectTarget",n),t.R7$(2),t.AVh("bottom-upload",null==e.headerSection||null==e.headerSection.metadata?null:e.headerSection.metadata.stripText),t.Y8G("ngClass",t.eq3(5,M,e.isFooterInView)),t.R7$(2),t.JRh(null!=e.headerSection&&null!=e.headerSection.links[0]&&e.headerSection.links[0].text&&""!==(null==e.headerSection||null==e.headerSection.links[0]?null:e.headerSection.links[0].text.trim())?null==e.headerSection||null==e.headerSection.links[0]?null:e.headerSection.links[0].text:"Generate")}}function et(r,l){if(1&r&&t.DNE(0,Z,13,20)(1,tt,5,7),2&r){const n=t.XpG(2);t.vxM("generate_with_text"==(null==n.headerSection||null==n.headerSection.links[0]?null:n.headerSection.links[0].type)?0:1)}}function it(r,l){if(1&r){const n=t.RV6();t.j41(0,"div",50)(1,"div",51)(2,"div",52)(3,"div",53,4)(5,"ng-select",54),t.mxI("ngModelChange",function(i){t.eBV(n);const o=t.XpG(2);return t.DH7(o.selectedProduct,i)||(o.selectedProduct=i),t.Njj(i)}),t.bIt("change",function(i){t.eBV(n);const o=t.XpG(2);return t.Njj(o.changeDropDownListing(i))}),t.k0s()()()()()}if(2&r){const n=t.XpG(2),e=t.sdS(5);t.R7$(5),t.Y8G("items",e.productList)("clearSearchOnAdd",!1)("dropdownPosition","bottom"),t.R50("ngModel",n.selectedProduct),t.Y8G("clearable",!1)("searchable",!1)}}function nt(r,l){if(1&r&&t.nrm(0,"image-listing",61),2&r){const n=t.XpG(5);t.Y8G("productId",n.selectedProductId)("productFormat",null==n.selectedProduct?null:n.selectedProduct.format)}}
1function ot(r,l){if(1&r&&(t.j41(0,"div",59),t.DNE(1,nt,1,2,"image-listing",60),t.k0s()),2&r){const n=t.XpG(2).index;t.R7$(),t.Y8G("ngIf",0==n)}}function rt(r,l){if(1&r&&(t.j41(0,"div",59),t.nrm(1,"div",62)(2,"ai-design-templates",63),t.k0s()),2&r){const n=t.XpG(4);t.R7$(2),t.Y8G("metadata",n.metadata)("selectedProductId",n.selectedProductId)("type",n.type)("containerWidth",n.containerWidth)}}function st(r,l){if(1&r&&(t.qex(0),t.DNE(1,ot,2,1,"div",59)(2,rt,3,4,"div",59),t.bVm()),2&r){const n=t.XpG(3);t.R7$(),t.vxM("ai-video"==n.type?1:2)}}function at(r,l){if(1&r&&t.nrm(0,"story-faq-area",64),2&r){const n=t.XpG().$implicit;t.Y8G("area",n)("version","template-faq")}}function lt(r,l){if(1&r&&t.nrm(0,"story-faq-area",65),2&r){const n=t.XpG().$implicit;t.Y8G("area",n)("version","v1")}}function ct(r,l){if(1&r&&(t.qex(0),t.j41(1,"div",55),t.DNE(2,st,3,1,"ng-container",56)(3,at,1,2,"story-faq-area",57)(4,lt,1,2,"story-faq-area",58),t.k0s(),t.bVm()),2&r){const n=l.$implicit;t.R7$(),t.Y8G("ngSwitch",n.type),t.BMQ("dir","ltr"),t.R7$(),t.Y8G("ngSwitchCase","ai-video-heading"),t.R7$(),t.Y8G("ngSwitchCase","template-faq"),t.R7$(),t.Y8G("ngSwitchCase","questions")}}function dt(r,l){if(1&r&&(t.j41(0,"div",20)(1,"div",21)(2,"h1",22),t.EFF(3),t.k0s(),t.j41(4,"p",23),t.EFF(5),t.k0s(),t.DNE(6,J,3,2,"div",24)(7,et,2,1),t.k0s(),t.j41(8,"div",25),t.DNE(9,it,6,6,"div",26),t.k0s(),t.DNE(10,ct,5,5,"ng-container",27),t.k0s()),2&r){const n=t.XpG(),e=t.sdS(5);t.Y8G("ngClass",t.eq3(7,H,n.env.isMobileView)),t.R7$(3),t.SpI(" ",n.headerSection.title," "),t.R7$(2),t.SpI(" ",n.headerSection.desc1,""),t.R7$(),t.vxM(n.headerSection.links.length>1?6:(null==n.headerSection||null==n.headerSection.links?null:n.headerSection.links.length)>0?7:-1),t.R7$(3),t.Y8G("ngIf",e.productList&&n.selectedProductId),t.R7$(),t.Y8G("ngForOf",n.storyPage.sections)("ngForTrackBy",n.trackBySectionIndex)}}function pt(r,l){if(1&r&&(t.j41(0,"span",82),t.EFF(1),t.k0s()),2&r){const n=t.XpG(2);t.R7$(),t.SpI("",n.customPrompt.length,"/450")}}function ut(r,l){if(1&r){const n=t.RV6();t.j41(0,"div",83)(1,"buttons-scroll-menu",84),t.bIt("selectLayout",function(i){t.eBV(n);const o=t.XpG(2);return t.Njj(o.selectPrompt(i))}),t.k0s()()}if(2&r){const n=t.XpG(2);t.R7$(),t.Y8G("items",n.prompts)("type","prompt-mobile")}}function gt(r,l){if(1&r){const n=t.RV6();t.j41(0,"div",66)(1,"div",67)(2,"div",68),t.EFF(3," Enter Prompt"),t.j41(4,"pi",69),t.bIt("click",function(){t.eBV(n);const i=t.XpG();return t.Njj(i.focusOut())}),t.k0s()()(),t.j41(5,"div",70)(6,"div",71)(7,"div",72)(8,"div",73)(9,"div",74)(10,"textarea",75,5),t.bIt("keyup",function(){t.eBV(n);const i=t.XpG();return t.Njj(i.changePrompt())})("paste",function(i){t.eBV(n);const o=t.XpG();return t.Njj(o.onPaste(i))}),t.mxI("ngModelChange",function(i){t.eBV(n);const o=t.XpG();return t.DH7(o.customPrompt,i)||(o.customPrompt=i),t.Njj(i)}),t.bIt("keydown.enter",function(i){t.eBV(n);const o=t.XpG();return t.Njj(o.onEnter(i))}),t.k0s(),t.DNE(12,pt,2,1,"span",76),t.k0s(),t.DNE(13,ut,2,2,"div",77),t.k0s()()()(),t.j41(14,"div",78)(15,"button",79),t.bIt("click",function(){t.eBV(n);const i=t.XpG();return t.Njj(i.generatePrompt())}),t.j41(16,"span",80),t.EFF(17,"Generate Now"),t.k0s()()()(),t.j41(18,"div",81),t.bIt("click",function(){t.eBV(n);const i=t.XpG();return t.Njj(i.focusOut())}),t.k0s()}if(2&r){let n;const e=t.XpG();t.R7$(9),t.Y8G("ngClass",t.sMw(7,Y,e.customPrompt.length,e.isFocused,e.customPrompt.length>449)),t.R7$(),t.AVh("blue-active",e.isFocused),t.R50("ngModel",e.customPrompt),t.R7$(2),t.Y8G("ngIf",e.customPrompt.length),t.R7$(),t.Y8G("ngIf",e.prompts.length>0),t.R7$(2),t.Y8G("disabled",(null==e.customPrompt||null==(n=e.customPrompt.trim())?null:n.length)<2)}}const j="lx-storyListingMobEditorReturn";let P=(()=>{var r;class l extends b.l{constructor(e,i,o,s,a,p,y,k,ne,oe,re,se){super(e),this.envInjector=e,this.route=i,this.storyPageService=o,this.seoService=s,this.authService=a,this.aiPhotoService=p,this.env=y,this.mediaContentService=k,this.viewportScroller=ne,this.document=oe,this.ngZone=re,this.cdr=se,this.type=g.b.aiVideoTemplate.type,this.pageType=g.b.pageType,this.groupPage="",this.containerWidth=0,this.isLoaded=!1,this.homeURL="/",this.categoryId=h.KK.AIVideoTemplate,this.customPrompt="",this.socialPlatformId=0,this.isFocused=!1,this.disabled=!1,this.prompts=[],this.isFooterInView=!1,this.storyPageRequestId=0,this.user=this.authService.currentUser(),this.setHomeUrl(),this.loggedInObserver=this.authService.loggedIn.subscribe(R=>{this.user=this.authService.currentUser(),this.setHomeUrl()}),this.routeSubscription=this.route.params.subscribe(R=>
1{this.langcode=this.route.snapshot.paramMap.get("langcode")||this.route.parent?.snapshot.paramMap.get("langcode")||this.route.parent?.parent?.snapshot.paramMap.get("langcode"),this.langcode&&this.seoService.updateLang(this.langcode);const A=this.route.snapshot.paramMap.get("slug");A&&(this.slug=A,this.getStoryPage())}),this.screenChangedSubscription=this.env.screenChanged.subscribe(R=>{this.setContainerWidth()})}ngAfterViewInit(){this.restoreScrollAfterMobileEditor(),this.env.isFooter&&setTimeout(()=>{const e=this.document.querySelector("app-footer");e&&(this.footerObserver=new IntersectionObserver(i=>{i.forEach(o=>{const s=o.isIntersecting;this.ngZone.run(()=>{this.isFooterInView=s,this.cdr.markForCheck()})})},{threshold:.1}),this.footerObserver.observe(e))},0)}normalizeProductId(e){return null!=e?String(e).trim():""}restoreScrollAfterMobileEditor(){const e=()=>{this.viewportScroller.scrollToPosition([0,0]),window.scrollTo(0,0),document.documentElement.scrollTop=0,document.body.scrollTop=0};e(),requestAnimationFrame(e),setTimeout(e,0),setTimeout(e,100)}onProductselect(e){if(!e)return;const i=this.normalizeProductId(e.productId);if(!i)return;this.selectedProduct=e,this.selectedProductId!==i&&(this.selectedProductId=i),this.slug=e.storyPageUrl||e.productAlias;let o=this.type;"ai-video"==this.type?o=g.b.aiVideoTemplate.urlPart:"ai-design-templates"==this.type&&(o=g.b.aiDesignTemplates.urlPart);const s=o.split("/").filter(p=>p.length>0),a=this.langcode?["/",this.langcode,...s,this.slug]:["/",...s,this.slug];this.router.navigate(a).then(p=>{p||this.getStoryPage()})}onFirstProductLoaded(e){if(e){const i=()=>{this.selectedProductId?(this.selectedProduct=this.productListingComponent.productList.find(o=>o.productId==this.selectedProductId),this.setAiVideoHomeUrlFromProduct(e)):setTimeout(i,20)};i()}}getTypeByUrl(){const e=this.router.url;return e.includes("ai-video/image-to-video")?(this.categoryId=h.KK.AIVideoTemplate,"ai-video"):e.includes("ai-design/templates")?(this.categoryId=h.KK.AIDesign,"ai-design-templates"):e.includes("ai-mockup-generator")?(this.categoryId=h.KK.AIMockup,"ai-mockup-generator"):"ai-video"}getStoryPage(){this.type=this.getTypeByUrl();const e=++this.storyPageRequestId;this.storyPageSubscription?.unsubscribe(),this.storyPageSubscription=this.storyPageService.getStoryPageContentCancellable(this.type,this.pageType,this.slug,i=>{if(e!==this.storyPageRequestId)return;this.storyPage=i.body.storyPage;let o={};if(this.storyPage){let s=this.storyPage.sections[0]?.metadata?.queryString;s&&(s=this.aiUploadImageService.getParams(s)),this.storyPage?.sections[0]?.links?.length>0&&(o=this.storyPage?.sections[0]?.links[0]?.metadata);for(let p of this.storyPage.sections)if("ai-video-heading"==p.type){this.headerSection=p;break}if(this.metadata=Object.assign({},this.storyPage?.metadata,this.storyPage?.sections[0]?.metadata,o,s),this.socialPlatformId=Number(this.metadata?.social_platform_id||0),this.metadata?.productId){const p=this.normalizeProductId(this.metadata.productId);p&&this.selectedProductId!==p&&(this.selectedProductId=p)}this.seoService.updatePageTitle(this.storyPage.pageTitle),this.seoService.updatePageMeta("description",this.storyPage.pageDescription),this.groupPage=this.storyPage.targetTool,this.setLangUrls(),this.isLoaded=!0,this.selectedProductId&&this.productListingComponent.productList.length>0&&(this.selectedProduct=this.productListingComponent.productList.find(p=>p.productId==this.selectedProductId)),this.updateBreadcrumbMeta();const a=this.getMetadata();a&&(this.storyPage.prMetadata=a),this.getPrompts(),this.setContainerWidth()}else this.notFound()},i=>{e===this.storyPageRequestId&&i&&1e3===i.statusCode&&this.notFound()},this.langcode)}setLangUrls(){this.storyPageService.storyPageLanguageListing(g.b.photoEditor.type,g.b.pageType,this.slug,this.groupPage,e=>{this.seoService.setLangUrls(e.body.storyPage,g.b.photoEditor.type,this.slug)},e=>{})}notFound(){this.router.navigate(["/404"],{skipLocationChange:!0})}getMetadata(){if(this.storyPage&&this.storyPage.sections&&this.storyPage.sections.length>0){const e=this.storyPage.sections.filter(i=>i.type==v.H.AI_DESIGN_BANNER_HEADER)[0];if(e&&e.metadata)return e.metadata}return null}setHomeUrl(){this.homeURL=this.user?g.b.AFTER_LOGIN_REDIRATION_URI:"/"}setAiVideoHomeUrlFromProduct(e){e?.storyPageUrl&&(this.aiVideoHomeUrl=this.getBreadcrumbUrl(),this.storyPage&&this.updateBreadcrumbMeta())}getBreadcrumbLabel(){switch(this.type){case g.b.aiDesignTemplates.type:return"AI Design";case"ai-mockup-generator":return"AI Mockup Generator";default:return"AI Video Templates"}}getBreadcrumbUrl(){switch(this.type){case g.b.aiDesignTemplates.type:return`/${g.b.aiDesign.urlPart}`;case"ai-mockup-generator":return"/ai-mockup-generator/";default:return`/${g.b.aiVideoTemplate.urlPart}/`}}updateBreadcrumbMeta(){if(!this.storyPage)return;const e=this.getBreadcrumbLabel(),i=[{name:"Home",url:u.c.siteUrl+"/"}];i.push({name:e,url:u.c.siteUrl+this.getBreadcrumbUrl()}),i.push({name:this.storyPage?.displayName||this.selectedProduct?.displayName||"",url:u.c.siteUrl+this.router.url});const o=this.seoService.generateBreadcrumbSchema(i);this.seoService.addBreadcrumbSchemaToDOM(o)}changeDropDownListing(e){e&&this.onProductselect(e)}generatePrompt(){this.customPrompt&&this.customPrompt.trim().length>1&&(this.metadata.textPrompt=this.customPrompt,this.aiUploadImageService.loadInputTextToAiEditor(this.metadata))}uploadAndEdit(){if(this.envService.isMobileView&&this.envService.isiOS)return this.envService.openPlayStoreUrl(),!1;this.fileInput&&this.fileInput.nativeElement.click()}generate(){this.aiUploadImageService.loadInputTextToAiEditor(this.metadata)}onFileUploaded(e){if(e&&e.length>0){const i=e[0];this.env.isMobileView&&"ai-design-templates"==this.type&&(this.metadata.isStyleRefImage=!0),this.metadata.productId=this.selectedProductId,this.aiUploadImageService.aiUploadImage(i,this.metadata).then(o=>{if(o&&"ai-design-templates"==this.type){const s={imgUrl:o.imgUrl,productId:this.selectedProductId};this.env.isMobileView?this.goToInspiraction(s):this.createPopupService.openInsprrationsEditDialog(s,this.aiPhotoService).then(a=>{a.result.then(p=>{})})}})}}goToInspiraction(e){this.aiPhotoService.isCompareEnable=!1,e.imgUrl=e.imgUrl?e.imgUrl:e.urls[0],this.aiPhotoService.mobileImageObj=e,sessionStorage.setItem(j,"1"),this.router.navigate(["/mob-ai-editor/edit"],{queryParams:{tab:"design-tools",toolName:"design",productId:e?.productId?e?.productId:0,isEd:!0,from:"story",isU
1pload:!!e?.isUpload&&e.isUpload}})}openTool(e){const i=this.headerSection.metadata.queryString?this.aiUploadImageService.getParams(this.headerSection?.metadata?.queryString):{};if(this.headerSection.metadata=Object.assign({},this.headerSection.metadata,i),this.headerSection.metadata.slug=this.slug,this.env.isMobileView&&this.env.isiOS)return this.env.openPlayStoreUrl(),!1;super.openTool(this.headerSection,e)}onChangeVisibility(e){let i=document.querySelector(".bottom-upload");i&&(i.classList.contains("d-none")&&i.classList.remove("d-none"),e.visible&&scrollY>=200?i.classList.contains("fixed-upload-btn")||i.classList.add("fixed-upload-btn","for-mobile-upload"):i.classList.contains("fixed-upload-btn")&&i.classList.remove("fixed-upload-btn","for-mobile-upload"))}selectPrompt(e){this.customPrompt=e.prompt}focusIn(){if(this.envService.isMobileView&&this.envService.isiOS)return this.isFocused=!1,this.envService.openPlayStoreUrl(),!1;this.disabled=!this.customPrompt.trim(),this.isFocused=!0,setTimeout(()=>{this.cpText&&this.cpText.nativeElement&&this.cpText.nativeElement.focus()},500)}focusOut(){this.isFocused=!1}changePrompt(){this.customPrompt=this.customPrompt}onPaste(e){this.customPrompt=this.customPrompt}onEnter(e){this.customPrompt=this.customPrompt}getPrompts(e=null){let i;"ai-mockup-generator"==this.type?i=h.Jl.AiMockup:"ai-design-templates"==this.type&&(i=h.Jl.AiDesign),this.selectedProductId&&i&&this.mediaContentService.getPrompts(i,o=>{o&&o.prompts&&(this.prompts=o.prompts),e&&e()},o=>{},Number(this.selectedProductId))}ngOnDestroy(){this.storyPageSubscription?.unsubscribe(),this.footerObserver&&this.footerObserver.disconnect()}setContainerWidth(){const e=document.getElementById("dataDiv");e&&(this.containerWidth=e.offsetWidth)}trackBySectionIndex(e){return e}}return(r=l).\u0275fac=function(e){return new(e||r)(t.rXU(t.uvJ),t.rXU(_.nX),t.rXU(S.K),t.rXU(x.F),t.rXU(D.u),t.rXU(B.s),t.rXU(O.L),t.rXU(T.Z),t.rXU(d.Xr),t.rXU(d.qQ),t.rXU(t.SKi),t.rXU(t.gRc))},r.\u0275cmp=t.VBU({type:r,selectors:[["story-cum-listing"]],viewQuery:function(e,i){if(1&e&&(t.GBs(E,5),t.GBs(N,5),t.GBs(U,5)),2&e){let o;t.mGM(o=t.lsd())&&(i.cpText=o.first),t.mGM(o=t.lsd())&&(i.fileInput=o.first),t.mGM(o=t.lsd())&&(i.productListingComponent=o.first)}},features:[t.Vt3],decls:13,vars:6,consts:[["productListingComponent",""],["fileInput",""],["generatePromptTemplate",""],["nameuplod",""],["myDrop","ngbDropdown"],["cpText",""],[1,"container-fluid","m-ltrt","p-0","aiExplorePage"],[1,"container-fluid","explorePadding"],[1,"row","g-0"],[1,"cat-left-panel","position-sticky","mr-10","d-none","d-lg-block","pl-60","pe-0","panelBg","panelBg-left"],[3,"onProductselect","onFirstProductLoaded","selectedProductId","categoryId","useSubcategoryAccordion"],[1,"cat-right-panel","ps-0","pe-0","overflow-hidden"],["class","exploreContentPadding mb-3","style","min-height: 24px;",4,"ngIf"],[3,"ngClass",4,"ngIf"],["type","file",2,"display","none",3,"change","accept"],[1,"exploreContentPadding","mb-3",2,"min-height","24px"],[1,"darkThemeBreadcrumb","text-14"],[3,"routerLink"],["name","breadcrumbarrow",1,"ms-1","me-1"],[1,"text-primary","text-capitalize"],[3,"ngClass"],[1,"listing-top-banner","d-flex","align-items-start","p-3","p-lg-4","border-radius-24","flex-column"],[1,"text-28","text-black","text-capitalize","lh-125","text-semi",2,"min-height","35px"],[1,"text-lg","grey-800","mt-2","lh-160"],[1,"aiBannerHeader","mt-10","ai-listing-header","d-flex","w-100",3,"ai-listing-header"],[1,"mb-10"],["class","row d-lg-none",4,"ngIf"],[4,"ngFor","ngForOf","ngForTrackBy"],[1,"aiBannerHeader","mt-10","ai-listing-header","d-flex","w-100"],["observeVisibility","",3,"obsChange","obsIntersectTarget"],[1,"d-none","d-xl-flex","position-relative","w-100","me-2",3,"ngClass"],[1,"position-relative","inputSearch","border-radius-20","d-none","d-xl-block",2,"min-width","600px"],[1,"info-blue","position-relative",2,"padding","1.22px",3,"ngClass"],[1,"form-group","position-relative",2,"z-index","2"],["maxlength","450","type","search","aria-describedby","search",1,"form-control","border-radius-20",2,"height","53.56px",3,"keyup.enter","ngModelChange","ngModel","placeholder"],[1,"position-absolute","top-0","h-100","d-flex","align-items-center","justify-content-center",2,"right","135px","width","60px",3,"ngClass"],[1,"counter","text-11",3,"ngClass"],[1,"position-absolute","p-2","top-0","right-0",2,"z-index","3"],[1,"btn","btn-primary","btn-gradient","d-flex","align-items-center","text-semi","btn-h40","pe-4","ps-4","btnGenerate","border-0",3,"click"],[1,"btn","btn-white","d-inline-flex","d-xl-none","align-items-center","text-semi","btn-h40","grey-800","text-nowrap","ps-3","pe-3","text-13",2,"margin-right","8px !important",3,"click"],[1,"d-none","d-xl-flex","btn","btn-upload-custom","border-radius-20","bg-white","align-items-center","text-semi","btn-h48","grey-800","text-nowrap","ps-2","pe-3","ms-2","text-13",2,"border","1p
1x solid #C9CAD4","height","56px !important",3,"click"],[1,"icon-bg","d-none","d-xl-flex","align-items-center","justify-content-center","mr-8"],["name","uploadimage",1,"f-24","grey-800"],[1,"d-inline-flex","d-xl-none","btn","btn-white","border-radius-12","bg-white","align-items-center","text-semi","btn-h40","ps-3","pe-3","grey-800","text-13",3,"click"],[4,"ngIf"],[4,"ngTemplateOutlet"],[1,"aiBannerHeader","mt-10","ai-listing-header","w-100"],[1,"d-none","d-xl-block","position-relative","inputSearch","w-100","me-2","border-radius-20",2,"max-width","600px",3,"ngClass"],[1,"d-flex","position-relative","w-100","single","mt-3",3,"ngClass"],[1,"btn","btn-white","btn-h40","text-13","grey-800","border-0",3,"click"],[1,"row","d-lg-none"],[1,"col-12"],[1,"select-product-menu"],["ngbDropdown","","is-open","false",1,"d-inline-block","mt-4","w-100","graphicProductPageMobile","mb-1",2,"max-width","576px"],["bindLabel","displayName",1,"media-template",3,"ngModelChange","change","items","clearSearchOnAdd","dropdownPosition","ngModel","clearable","searchable"],[3,"ngSwitch"],[4,"ngSwitchCase"],["class","d-flex",3,"area","version",4,"ngSwitchCase"],["class","d-flex w-100 mb-14",3,"area","version",4,"ngSwitchCase"],[1,"mb-13"],[3,"productId","productFormat",4,"ngIf"],[3,"productId","productFormat"],["id","dataDiv",2,"width","100%","height","1px","background","transparent"],[1,"video-template-listing",3,"metadata","selectedProductId","type","containerWidth"],[1,"d-flex",3,"area","version"],[1,"d-flex","w-100","mb-14",3,"area","version"],[1,"p-3","pt-9","pb-9","position-fixed","bg-white","w-100",2,"bottom","0px","z-index","99999","border-radius","20px 20px 0px 0px","left","0px"],[1,"wp-100","d-flex","align-items-center","justify-content-between","mb-2"],[1,"text-lg","text-semi","grey-800","w-100","d-flex","align-items-center","justify-content-between"],["name","previewclose",3,"click"],[1,"card","drawer-card","mb-3","mt-0"],[1,"card-body"],[1,"btn-panel"],[1,"card-body","prompt-view"],[1,"textarea-col","position-relative",3,"ngClass"],["id","cprompt","name","cprompt","rows","4","cols","50","maxlength","450",1,"prompt-text",3,"keyup","paste","ngModelChange","keydown.enter","ngModel"],["class","prompt-info text-regular position-relative d-flex align-items-center","style","min-height: 24px;",4,"ngIf"],["class","d-flex mt-3 mobile-prompt",4,"ngIf"],[1,"d-flex","align-items-center","justify-content-center","w-100"],["id","btn-generate",1,"btn","btn-primary-gradient","btn-primary-m","text-13","btn-h44","w-100","d-flex","align-items-center","justify-content-center",3,"click","disabled"],[1,"text-lg"],[1,"showpreview-overlay","align-items-center","justify-content-start","position-fixed","d-flex",2,"left","0px","z-index","9999",3,"click"],[1,"prompt-info","text-regular","position-relative","d-flex","align-items-center",2,"min-height","24px"],[1,"d-flex","mt-3","mobile-prompt"],[2,"max-width","-webkit-fill-available",3,"selectLayout","items","type"]],template:function(e,i){if(1&e){const o=t.RV6();t.j41(0,"div",6)(1,"div",7)(2,"div",8)(3,"div",9)(4,"app-product-listing",10,0),t.bIt("onProductselect",function(a){return t.eBV(o),t.Njj(i.onProductselect(a))})("onFirstProductLoaded",function(a){return t.eBV(o),t.Njj(i.onFirstProductLoaded(a))}),t.k0s()(),t.j41(6,"div",11),t.DNE(7,z,10,5,"div",12)(8,dt,11,9,"div",13),t.k0s()()()(),t.j41(9,"input",14,1),t.bIt("change",function(a){return t.eBV(o),t.Njj(i.onFileUploaded(a.target.files))}),t.k0s(),t.DNE(11,gt,19,11,"ng-template",null,2,t.C5r)}2&e&&(t.R7$(4),t.Y8G("selectedProductId",i.selectedProductId)("categoryId",i.categoryId)("useSubcategoryAccordion","ai-video"===i.type),t.R7$(3),t.Y8G("ngIf","ai-design-templates"===i.type),t.R7$(),t.Y8G("ngIf",i.isLoaded&&i.storyPage),t.R7$(),t.Y8G("accept",i.aiUploadImageService.fileImageAccept))},styles:['.aiExplorePage[_ngcontent-%COMP%]{margin-top:85px}@media (max-width: 576px){.aiExplorePage[_ngcontent-%COMP%]{margin-top:95px}}.explorePadding[_ngcontent-%COMP%]{padding:0 20px 0 0}@media (max-width: 576px){.explorePadding[_ngcontent-%COMP%]{padding:0}}@media (max-width: 576px){.exploreContentPadding[_ngcontent-%COMP%]{padding:0 16px}.explorePage.exploreContentPadding[_ngcontent-%COMP%]{min-height:400px}}.pt-40[_ngcontent-%COMP%]{padding-top:40px}.pb-40[_ngcontent-%COMP%]{padding-bottom:40px}.add-index[_ngcontent-%COMP%]{z-index:1002}.listing-top-banner[_ngcontent-%COMP%]{background:linear-gradient(262deg,#ebdef5 .63%,#c6c6ef);background:url(https://static.lightxeditor.com/assets/images/ai-design-explore-page.png) no-repeat;background-position:center;background-size:cover}.panelBg[_ngcontent-%COMP%]{padding:0;min-width:280px;max-width:280px;background:#fff;border-radius:0 16px 16px 0;top:85px;margin-top:0;height:calc(85vh - var(--sales-height))}@media (max-width: 767px){.listing-top-banner[_ngcontent-%COMP%]{background:linear-gradient(262deg,#dadcf4 .53%,#e7d6fa 99.74%
1)!important;border-radius:16px!important}.listing-top-banner[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{font-size:24px!important}.bottom-upload.fixed-upload-btn[_ngcontent-%COMP%]{text-align:center}}.h-56[_ngcontent-%COMP%]{height:56px!important}.icon-bg[_ngcontent-%COMP%]{width:40px;height:40px;border-radius:12px;background:#f6f6f8}@media (min-width: 577px){.btn-white[_ngcontent-%COMP%]{border:1px solid #C9CAD4}}.btn-white[_ngcontent-%COMP%]:active{border-color:#fff!important}.btn-upload-custom[_ngcontent-%COMP%]:hover{background:#f7f8fd!important}.bottom-upload.fixed-upload-btn[_ngcontent-%COMP%]{position:fixed!important;justify-content:center!important}.bottom-upload.fixed-upload-btn[_ngcontent-%COMP%]{padding:5px}.bottom-upload.fixed-upload-btn[_ngcontent-%COMP%] .inputSearch[_ngcontent-%COMP%]{width:auto!important}.bottom-upload.fixed-upload-btn[_ngcontent-%COMP%] .btn-upload-custom[_ngcontent-%COMP%]{margin:0 0 0 8px!important;padding-left:8px!important;padding-right:16px!important}.bottom-upload.fixed-upload-btn.single[_ngcontent-%COMP%] .btn-white[_ngcontent-%COMP%]{margin-top:0!important;margin-bottom:0!important}.prompt-view[_ngcontent-%COMP%] .textarea-col[_ngcontent-%COMP%]{width:100%;height:178px;border-radius:12px;background:#eeedf3;padding:4px;border:0px!important}.prompt-view[_ngcontent-%COMP%] .textarea-col[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.92px;border:none;background:linear-gradient(90deg,#c9cad4 -4% 100%);-webkit-mask:linear-gradient(90deg,#C9CAD4 -4%,#C9CAD4 100%) content-box,linear-gradient(90deg,#C9CAD4 -4%,#C9CAD4 100%);-webkit-mask-composite:xor;mask-composite:exclude;z-index:1}.prompt-view[_ngcontent-%COMP%] .textarea-col[_ngcontent-%COMP%]:hover{border:1px solid #B0B3BF}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]{resize:none;outline:none;width:100%;height:144px;padding:8px;font-size:13px;color:#b0b3bf;border:0px;background:transparent;border-radius:12px;line-height:18px;position:relative;z-index:2}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-scrollbar{width:4px;height:4px;border-radius:12px}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:#e3e3e3;border-radius:12px;margin-top:8px}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:#9a9a9a;border-radius:12px}.prompt-view[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background:#555}.prompt-view[_ngcontent-%COMP%] .prompt-info[_ngcontent-%COMP%]{font-size:11px;color:#b0b3bf;margin-top:0;padding-left:8px;line-height:10px}.info-up[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.9px;border:none;background:linear-gradient(90deg,#c9cad4 -4% 100%)!important;-webkit-mask:linear-gradient(90deg,#C9CAD4 -4%,#C9CAD4 100%) content-box,linear-gradient(90deg,#C9CAD4 -4%,#C9CAD4 100%)!important;-webkit-mask-composite:xor!important;mask-composite:exclude!important;z-index:1}.info-blue[_ngcontent-%COMP%]{background:linear-gradient(90deg,#fc5cff0d -4%,#2520f60d)!important}.info-blue[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.92px;border:none;background:linear-gradient(90deg,#fc5cff -4%,#2520f6)!important;-webkit-mask:linear-gradient(90deg,#FC5CFF -4%,#2520F6 100%) content-box,linear-gradient(90deg,#FC5CFF -4%,#2520F6 100%)!important;-webkit-mask-composite:xor!important;mask-composite:exclude!important;z-index:1}.info-blue[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#626adf!important}.info-red[_ngcontent-%COMP%]{background:linear-gradient(90deg,#fc5cff0d -4%,#2520f60d)!important}.info-red[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;padding:.92px;border:none;background:linear-gradient(90deg,#f25555 -4% 100%)!important;-webkit-mask:linear-gradient(90deg,#F25555 -4%,#F25555 100%) content-box,linear-gradient(90deg,#F25555 -4%,#F25555 100%)!important;-webkit-mask-composite:xor!important;mask-composite:exclude!important;z-index:1}.info-red[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#f25555!important}.ai-listing-header[_ngcontent-%COMP%] .info-red[_ngcontent-%COMP%]:after, .ai-listing-header[_ngcontent-%COMP%] .info-blue[_ngcontent-%COMP%]:after, .ai-listing-header[_ngcontent-%COMP%] .info-up[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:20px;padding:1.22px;border:none;z-index:1}.ai-listing-header[_ngcontent-%COMP%] .info-up[_ngcontent-%COMP%]{border:0px!important}.ai-listing-header[_ngcontent-%COMP%] .info-up[_ngcontent-%COMP%]:after{background:linear-gradient(90deg,#c9cad4 -4% 100%)!important;-webkit-mask:linear-gradient(90deg,#C9CAD4 -4%,#C9CAD4 100%) content-box,linear-gradient(90deg,#C9CAD4 -4%,#C9CAD4 100%)!important;-webkit-mask-composite:xor!important;mask-composite:exclude!important}.ai-listing-header[_ngcontent-%COMP%] .info-blue[_ngcontent-%COMP%]{border:0px!important;background:#fff!important;border-radius:20px}.ai-listing-header[_ngcontent-%COMP%] .info-blue[_ngcontent-%COMP%]:after{background:linear-gradient(90deg,#df61ff -4%,#3ad0ff)!important;-webkit-mask:linear-gradient(90deg,#DF61FF -4%,#3AD0FF 100%) content-box,linear-gradient(90deg,#DF61FF -4%,#3AD0FF 100%)!important;-webkit-mask-composite:xor!important;mask-composite:exclude!important}.ai-listing-header[_ngcontent-%COMP%] .info-blue[_ngcontent-%COMP%]:hover{background:#f7f8fd!important}.ai-listing-header[_ngcontent-%COMP%] .info-blue[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#626adf!important}.ai-listing-header[_ngcontent-%COMP%] .info-red[_ngcontent-%COMP%]{border:0px!important;background:#fff!important}.ai-listing-header[_ngcontent-%COMP%] .info-red[_ngcontent-%COMP%]:after{background:linear-gradient(90deg,#f25555 -4% 100%)!important;-webkit-mask:linear-gradient(90deg,#F25555 -4%,#F25555 100%) content-box,linear-gradient(90deg,#F25555 -4%,#F25555 100%)!important;-webkit-mask-composite:xor!important;mask-composite:exclude!important}.ai-listing-header[_ngcontent-%COMP%] .info-red[_ngcontent-%COMP%]:hover{background:#f7f8fd!important}.ai-listing-header[_ngcontent-%COMP%] .info-red[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#f25555!important}.prompt-text[_ngcontent-%COMP%]{color:#272b34!important}.showpreview-overlay[_ngcontent-%COMP%]{display:none;background:#0003;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);width:100%;height:100%;top:0;bottom:0;z-index:999}.mobile-prompt-text[_ngcontent-%COMP%]{border:1px solid #C9CAD4;background:linear-gradient(90deg,#fc5cff05 -4%,#2520f605),#fff;padding:8px 12px;
1height:110px;text-align:left}.bottomStrip--hidden[_ngcontent-%COMP%]{opacity:0;visibility:hidden;transform:translateY(100%);pointer-events:none}']}),l})();const mt=[{path:"",component:P},{path:":langcode/:slug",component:P},{path:":slug",component:P}];let ht=(()=>{var r;class l{}return(r=l).\u0275fac=function(e){return new(e||r)},r.\u0275mod=t.$C({type:r}),r.\u0275inj=t.G2t({imports:[_.iI.forChild(mt),_.iI]}),l})();var _t=c(92452),w=c(68064),ft=c(33645);const bt=["scrollContainer"],vt=r=>({"expanded-subcategory":r}),Ct=r=>({menuItemSelected:r});function xt(r,l){if(1&r){const n=t.RV6();t.j41(0,"div",20)(1,"button",21),t.bIt("click",function(){const i=t.eBV(n).$implicit,o=t.XpG(4);return t.Njj(o.changeProduct(i))}),t.j41(2,"span"),t.EFF(3),t.k0s()()()}if(2&r){const n=l.$implicit,e=t.XpG(4);t.Y8G("id",n.productId),t.R7$(),t.Y8G("ngClass",t.eq3(3,Ct,e.selectedProductId==n.productId)),t.R7$(2),t.JRh(n.displayName)}}function Pt(r,l){if(1&r&&(t.j41(0,"div",18),t.DNE(1,xt,4,5,"div",19),t.k0s()),2&r){const n=t.XpG().$implicit;t.R7$(),t.Y8G("ngForOf",n.storeProducts)}}function yt(r,l){if(1&r){const n=t.RV6();t.j41(0,"div",6)(1,"div",7)(2,"div",8)(3,"button",9),t.bIt("click",function(){const i=t.eBV(n).$implicit,o=t.XpG(2);return t.Njj(o.toggleSubCategory(i.categoryId))}),t.j41(4,"div",10),t.EFF(5),t.k0s()(),t.j41(6,"button",11),t.bIt("click",function(){const i=t.eBV(n).$implicit,o=t.XpG(2);return t.Njj(o.toggleSubCategory(i.categoryId))}),t.j41(7,"span",12),t.nrm(8,"pi",13),t.k0s(),t.j41(9,"span",14),t.nrm(10,"pi",15),t.k0s()()()(),t.j41(11,"div",16)(12,"div",17),t.DNE(13,Pt,2,1,"ng-template"),t.k0s()()()}if(2&r){const n=l.$implicit,e=t.XpG(2);t.Mz_("ngbAccordionItem","sub-cat-",n.categoryId,""),t.Y8G("ngClass",t.eq3(5,vt,e.activeSubCategoryId===n.categoryId))("collapsed",e.activeSubCategoryId!==n.categoryId),t.R7$(5),t.JRh(n.gaName)}}function It(r,l){if(1&r&&(t.qex(0),t.j41(1,"div",4),t.DNE(2,yt,14,7,"div",5),t.k0s(),t.bVm()),2&r){const n=t.XpG();t.R7$(),t.Y8G("closeOthers",!0),t.R7$(),t.Y8G("ngForOf",n.subCategoryList)}}function St(r,l){if(1&r){const n=t.RV6();t.j41(0,"li",24),t.bIt("click",function(){const i=t.eBV(n).$implicit,o=t.XpG(2);return t.Njj(o.changeProduct(i))}),t.j41(1,"span"),t.nrm(2,"img",25),t.k0s(),t.j41(3,"span"),t.EFF(4),t.k0s()()}if(2&r){const n=l.$implicit,e=t.XpG(2);t.AVh("liActive",e.selectedProductId==n.productId),t.BMQ("id",n.productId),t.R7$(2),t.AVh("imgActive",e.selectedProductId==n.productId),t.Y8G("src",n.iconUrl,t.B4B),t.R7$(2),t.JRh(n.displayName)}}function Mt(r,l){if(1&r&&(t.j41(0,"ul",22),t.DNE(1,St,5,7,"li",23),t.k0s()),2&r){const n=t.XpG();t.R7$(),t.Y8G("ngForOf",n.productList)}}let wt=(()=>{var r;class l{constructor(e){this.mediaContentService=e,this.onProductselect=new t.bkB,this.onFirstProductLoaded=new t.bkB,this.useSubcategoryAccordion=!1,this.productList=[],this.subCategoryList=[],this.activeSubCategoryId=null,this.pageNumber=0,this.ProductRow=99,this.scrollTopOffset=20}ngOnInit(){this.loadProducts()}ngOnChanges(e){e.categoryId&&!e.categoryId.firstChange||e.useSubcategoryAccordion&&!e.useSubcategoryAccordion.firstChange?this.loadProducts():e.selectedProductId&&this.selectedProductId&&this.productList.length&&(this.setActiveSubCategory(),this.scrollActiveIntoView())}loadProducts(e=null){this.isLoaded=!1,this.productList=[],this.subCategoryList=[],this.activeSubCategoryId=null,this.useSubcategoryAccordion?this.getCategoryDetails(e):this.getLegacyProductListing(e)}getCategoryDetails(e=null){this.mediaContentService.getCategoryDetails(this.categoryId,_t.i.Main,i=>{this.isLoaded=!0,i&&(this.subCategoryList=i?.storeCategory?.subCategoryList||[],this.productList=this.subCategoryList.reduce((o,s)=>{const a=s?.storeProducts||[];return a.length&&o.push(...a),o},[]),this.setActiveSubCategory(),this.productList&&this.productList.length>0&&(this.onFirstProductLoaded.emit(this.productList[0]),this.selectedProductId&&this.scrollActiveIntoView()),e&&e())},i=>{this.isLoaded=!0})}getLegacyProductListing(e=null){this.mediaContentService.getProductListing(this.categoryId,this.pageNumber,i=>{this.isLoaded=!0,i&&(this.productList=i.storeProducts||[],this.productList&&this.productList.length>0&&(this.onFirstProductLoaded.emit(this.productList[0]),this.selectedProductId&&this.scrollActiveIntoView()),e&&e())},i=>{this.isLoaded=!0},null,null,this.ProductRow)}changeProduct(e){e&&(this.useSubcategoryAccordion&&this.setActiveSubCategory(e.productId),this.onProductselect.emit(e))}toggleSubCategory(e){this.useSubcategoryAccordion&&(this.activeSubCategoryId=this.activeSubCategoryId===e?null:e)}setActiveSubCategory(e=null){const i=String(e||this.selectedProductId||"");if(this.subCategoryList?.length)if(i){for(const o of this.subCategoryList)if((o?.storeProducts||[]).some(p=>String(p?.productId)===i))return void(this.activeSubCategoryId=o?.categoryId||null);this.activeSubCategoryId=this.subCategoryList[0]?.categoryId||null}else this.activeSubCategoryId=this.subCategoryList[0]?.categoryId||null;else this.activeSubCategoryId=null}scrollActiveIntoView(){setTimeout(()=>{const e=this.scrollContainer?.nativeElement;if(!e||!this.selectedProductId)return;const i=e.querySelector(".menuItemSelected")||e.querySelector(`#${CSS.escape(String(this.selectedProductId))}`);if(!i)return;const o=e.getBoundingClientRect(),s=i.getBoundingClientRect();e.scrollTo({top:Math.max(0,e.scrollTop+s.top-o.top-this.scrollTopOffset-this.scrollTopOffset),behavior:"smooth"})},1e3)}}return(r=l).\u0275fac=function(e){return new(e||r)(t.rXU(T.Z))},r.\u0275cmp=t.VBU({type:r,selectors:[["app-product-listing"]],viewQuery:function(e,i){if(1&e&&t.GBs(bt,5),2&e){let o;t.mGM(o=t.lsd())&&(i.scrollContainer=o.first)}},inputs:{selectedProductId:"selectedProductId",useSubcategoryAccordion:"useSubcategoryAccordion",categoryId:"categoryId"},outputs:{onProductselect:"onProductselect",onFirstProductLoaded:"onFirstProductLoaded"}
1,features:[t.OA$],decls:5,vars:6,consts:[["scrollContainer",""],["legacyProductListing",""],["customScrollDir","",1,"is-popover-tb","scroll-container"],[4,"ngIf","ngIfElse"],["ngbAccordion","","id","productList",1,"w-100","mt-3","pt-0","pb-0",3,"closeOthers"],["class","product-accordion-item",3,"ngbAccordionItem","ngClass","collapsed",4,"ngFor","ngForOf"],[1,"product-accordion-item",3,"ngbAccordionItem","ngClass","collapsed"],["ngbAccordionHeader",""],[1,"d-flex","align-items-center","justify-content-between","sub-item","w-100"],["type","button","ngbAccordionButton","",1,"btn-acc-title","w-100",3,"click"],[1,"text-normal","grey-800","text-semi"],["type","button","ngbAccordionButton","",1,"btn-link","btn-collapse","p-0",3,"click"],[1,"text-sm","collapse-text","lh-none"],["name","dropdownArrowDown",1,"f-24","text-dark"],[1,"text-sm","expand-text","lh-none"],["name","dropdownArrowUp",1,"f-24","text-dark"],["ngbAccordionCollapse",""],["ngbAccordionBody",""],[1,"content","product-list-body"],["class","mt-1",3,"id",4,"ngFor","ngForOf"],[1,"mt-1",3,"id"],["type","button",1,"btn-dropdown","text-normal","grey-800","border-radius-12","w-100","text-start","border-0","btn-h40","ps-3","pe-3","inner","pointer","d-flex","align-items-center",3,"click","ngClass"],["id","productList",1,"w-100","list-unstyled","mt-3","pt-0","pb-0"],[3,"liActive","click",4,"ngFor","ngForOf"],[3,"click"],[1,"mr-8",3,"src"]],template:function(e,i){if(1&e&&(t.j41(0,"div",2,0),t.DNE(2,It,3,2,"ng-container",3)(3,Mt,2,1,"ng-template",null,1,t.C5r),t.k0s()),2&e){const o=t.sdS(4);t.xc7("padding",i.useSubcategoryAccordion?"0 6px 16px 12px":null),t.AVh("product-listing-scroll",i.useSubcategoryAccordion),t.R7$(2),t.Y8G("ngIf",i.useSubcategoryAccordion)("ngIfElse",o)}},dependencies:[d.YU,d.Sq,d.bT,m.WP,m.r6,m.tW,m.x7,m.UA,m.$R,w.b,ft.q],styles:[".btn-dropdown[_ngcontent-%COMP%]{background:transparent}.btn-dropdown[_ngcontent-%COMP%]:hover{background:#626adf0d}.scroll-container[_ngcontent-%COMP%] > ul[_ngcontent-%COMP%] > li[_ngcontent-%COMP%]{height:48px;border-radius:12px;cursor:pointer;display:flex;align-items:center;border:1px solid transparent;font-size:14px;color:#28282a;padding:0 12px;margin-top:2px}.scroll-container[_ngcontent-%COMP%] > ul[_ngcontent-%COMP%] > li[_ngcontent-%COMP%]:last-child{margin-bottom:0!important}.scroll-container[_ngcontent-%COMP%] > ul[_ngcontent-%COMP%] > li[_ngcontent-%COMP%]:hover{background:#626adf0d;border:1px solid transparent}.scroll-container[_ngcontent-%COMP%] > ul[_ngcontent-%COMP%] > li[_ngcontent-%COMP%]:first-child{margin-top:0}.scroll-container[_ngcontent-%COMP%] > ul[_ngcontent-%COMP%] > li[_ngcontent-%COMP%]:last-child{margin-bottom:12px}.liActive[_ngcontent-%COMP%]{border:1px solid #eeebff!important;background:linear-gradient(90deg,#df61ff26 -4%,#3ad0ff26)!important;font-weight:600!important}.menuItemSelected[_ngcontent-%COMP%]{background:linear-gradient(90deg,#df61ff26 -4%,#3ad0ff26)!important;font-weight:500!important}.imgActive[_ngcontent-%COMP%]{filter:brightness(0) saturate(100%) invert(28%) sepia(8%) saturate(770%) hue-rotate(193deg) brightness(93%) contrast(89%)}#productList[_ngcontent-%COMP%] .accordion-item{border:1px solid transparent;background:transparent;border-radius:16px!important;margin-top:4px;padding:4px}#productList[_ngcontent-%COMP%] .accordion-item:not(.expanded-subcategory):hover{background:#626adf0d}#productList[_ngcontent-%COMP%] .accordion-header{margin:0}#productList[_ngcontent-%COMP%] .accordion-button{box-shadow:none!important;border-radius:14px!important;padding:0!important;background:transparent!important}#productList[_ngcontent-%COMP%] .accordion-collapse{margin-top:0}#productList[_ngcontent-%COMP%] .accordion-body{padding:0}.sub-item[_ngcontent-%COMP%]{min-height:40px;padding:0 4px 0 16px}.btn-acc-title[_ngcontent-%COMP%]{text-align:left}.product-accordion-item.expanded-subcategory[_ngcontent-%COMP%]{border-color:#a9f3!important;background:linear-gradient(90deg,#df61ff05 -4%,#3ad0ff05)!important;border-bottom:1px solid rgba(170,153,255,.2)!important}.product-list-body[_ngcontent-%COMP%]{padding:0 4px 4px}"]}),l})();var kt=c(14121),Ot=c(79421),Tt=c(23679),Lt=c(23639),Vt=c(99754),jt=c(16471),Ft=c(67294),Gt=c(32764);const Rt=["container"],At=["vid"];function Dt(r,l){if(1&r&&t.nrm(0,"source",20),2&r){const n=t.XpG(),e=n.$implicit,i=n.index,o=t.XpG();t.BMQ("src",o.isMobile&&o.isMobileVideoVisible(i)?e.videoHighRes:null,t.B4B)}}function Bt(r,l){if(1&r&&t.nrm(0,"source",21),2&r){const n=t.XpG(),e=n.$implicit,i=n.index,o=t.XpG();t.BMQ("src",o.isMobile&&o.isMobileVideoVisible(i)?e.videoHighRes:null,t.B4B)}}function Et(r,l){1&r&&(t.j41(0,"div",22),t.nrm(1,"pi",23),t.k0s())}function Nt(r,l){1&r&&(t.j41(0,"div",24),t.nrm(1,"div",25),t.k0s())}function Ut(r,l){1&r&&(t.j41(0,"div",26),t.nrm(1,"div",25),t.k0s())}function Xt(r,l){if(1&r){const n=t.RV6();t.j41(0,"div",10,1),t.bIt("mouseleave",function(){const i=t.eBV(n).index,o=t.XpG();return t.Njj(o.clearVideoLoading(i))}),t.j41(2,"div",11)(3,"video",12,2),t.bIt("contextmenu",function(i){t.eBV(n);const o=t.XpG();return t.Njj(o.isMobile?i.preventDefault():null)})("canplay",function(){const i=t.eBV(n).index,o=t.sdS(4),s=t.XpG();return t.Njj(s.onVideoCanPlay(o,i))})("playing",function(){const i=t.eBV(n).index,o=t.XpG();return t.Njj(o.onVideoPlaying(i))})("waiting",function(){const i=t.eBV(n).index,o=t.XpG();return t.Njj(o.onVideoWaiting(i))})("stalled",function(){const i=t.eBV(n).index,o=t.XpG();return t.Njj(o.onVideoWaiting(i))})("seeking",function(){const i=t.eBV(n).index,o=t.XpG();return t.Njj(o.onVideoWaiting(i))})("mouseenter",function(){const i=t.eBV(n),o=i.$implicit,s=i.index,a=t.sdS(4),p=t.XpG();return t.Njj(p.onVideoMouseEnter(a,s,o.videoHighRes))})("mouseleave",function(){const i=t.eBV(n).index,o=t.sdS(4),s=t.XpG();return t.Njj(s.onVideoMouseLeave(o,i))})("click",function(i){const o=t.eBV(n).$implicit,s=t.XpG();return t.Njj(s.templateClick(o.item,i))}),t.DNE(5,Dt,1,1,"source",13)(6,Bt,1,1,"source",14),t.k0s()(),t.DNE(7,Et,2,0,"div",15)(8,Nt,2,0,"div",16)(9,Ut,2,0,"div",17),t.j41(10,"div",18),t.bIt("click",function(i){const o=t.eBV(n).$implicit,s=t.XpG();return t.Njj(s.openTemplateVideoPreview(o,i))}),t.nrm(11,"pi",19),t.k0s()()}if(2&r){const n=l.$implicit,e=l.index,i=t.XpG();t.ZvI("img-div img-format-",n.format," ms-1 mt-1 mb-1 position-relative"),t.xc7("margin-right",i.thumbRightMargin,"px"),t.R7$(3),t.Y8G("poster",null==n?null:n.posterImage,t.B4B)("loop",i.isMobile),t.BMQ("data-video-index",e)("crossorigin","anonymous")("referrerpolicy","no-referrer")("title",(null==n?null:n.title)||(null==n?null:n.alt)||"")("autoplay",i.isMobile&&i.isMobileVideoVisible(e)?"":null),t.R7$(2),t.Y8G("ngIf",null==n?null:n.videoHighRes),t.R7$(),t.Y8G("ngIf",null==n?null:n.videoHighRes),t.R7$(),t.Y8G("ngIf",!i.isMobile&&!i.isVideoLoading(e)),t.R7$(),t.Y8G("ngIf",!i.isMobile&&i.isVideoLoading(e)),t.R7$(),t.Y8G("ngIf",i.isMobileVideoLoading(e)),t.R7$(),t.AVh("overlay--disabled",!i.getTemplatePreviewVideoUrl(n))}}function $t(r,l){if(1&r&&(t.j41(0,"div",28),t.nrm(1,"div",11),t.k0s()),2&r){const n=t.XpG(2);t.ZvI("list-thumb-place blank anim-blank-view img-div img-format-",n.mainSelectedFormat," ms-1 mt-1 mb-1"),t.xc7("margin-right",n.thumbRightMargin,"px")}}function Ht(r,l){if(1&r&&(t.qex(0),t.DNE(1,$t,2,5,"div",27),t.bVm()),2&r){const n=t.XpG();t.R7$(),t.Y8G("ngForOf",n.Arr(8).fill(1))}}function Yt(r,l){if(1&r){const n=t.RV6();t.j41(0,"div",29)(1,"button",30),t.bIt("click",function(){t.eBV(n);const i=t.XpG();return t.Njj(i.loadMore())}
1),t.EFF(2,"Load more"),t.k0s()()}if(2&r){const n=t.XpG();t.R7$(),t.Y8G("disabled",!n.isLoaded)}}function zt(r,l){if(1&r){const n=t.RV6();t.j41(0,"button",41),t.bIt("click",function(){t.eBV(n),t.XpG();const i=t.sdS(5),o=t.XpG();return t.Njj(o.toggleTemplatePreviewMute(i))}),t.nrm(1,"pi",37),t.k0s()}if(2&r){const n=t.XpG(2);t.R7$(),t.Y8G("name",n.previewIsMuted?"mute":"unmute")}}function Wt(r,l){if(1&r){const n=t.RV6();t.j41(0,"div",31)(1,"button",32),t.bIt("click",function(){t.eBV(n);const i=t.XpG();return t.Njj(i.closeTemplateVideoPreview())}),t.nrm(2,"pi",33),t.k0s(),t.j41(3,"div",34)(4,"video",35,3),t.bIt("play",function(){t.eBV(n);const i=t.XpG();return t.Njj(i.previewIsPlaying=!0)})("pause",function(){t.eBV(n);const i=t.XpG();return t.Njj(i.previewIsPlaying=!1)})("loadedmetadata",function(){t.eBV(n);const i=t.sdS(5),o=t.XpG();return t.Njj(o.onTemplatePreviewMetadata(i))})("canplay",function(){t.eBV(n);const i=t.sdS(5),o=t.XpG();return t.Njj(o.onTemplatePreviewCanPlay(i))})("playing",function(){t.eBV(n);const i=t.sdS(5),o=t.XpG();return t.Njj(o.updatePreviewHasAudio(i))})("timeupdate",function(){t.eBV(n);const i=t.sdS(5),o=t.XpG();return t.Njj(o.onTemplatePreviewTimeUpdate(i))})("ended",function(){t.eBV(n);const i=t.sdS(5),o=t.XpG();return t.Njj(o.onTemplatePreviewEnded(i))}),t.k0s(),t.j41(6,"button",36),t.bIt("click",function(){t.eBV(n);const i=t.sdS(5),o=t.XpG();return t.Njj(o.toggleTemplatePreviewPlay(i))}),t.nrm(7,"pi",37),t.k0s(),t.DNE(8,zt,2,1,"button",38),t.j41(9,"div",39)(10,"span",40),t.EFF(11),t.k0s(),t.EFF(12),t.k0s()()()}if(2&r){const n=t.XpG();t.R7$(4),t.Y8G("src",n.templatePreviewVideoUrl,t.B4B)("muted",n.previewIsMuted),t.R7$(3),t.Y8G("name",n.previewIsPlaying?"pausenew":"playnew"),t.R7$(),t.Y8G("ngIf",n.previewHasAudio),t.R7$(),t.xc7("left",n.previewHasAudio?104:56,"px"),t.R7$(2),t.JRh(n.previewCurrentTime),t.R7$(),t.SpI("\xa0/ ",n.previewDuration," ")}}let Kt=(()=>{var r;class l{constructor(e,i,o,s,a,p,y,k){this.templateService=e,this.modalService=i,this.envService=o,this.router=s,this.zone=a,this.cdr=p,this.renderer=y,this.document=k,this.productFormatCode=2,this.modelTypeId=71,this.isProductsEnd=!1,this.isLoaded=!1,this.inProgress=!1,this.pageNumber=0,this.rowsCount=30,this.mainSelectedProduct={productId:"",displayName:"",imageObjects:[],bgColors:"",desc:"",format:"",storyPageUrl:"",title:""},this.isNewVersion=!1,this.isFirstTime=!0,this.mainSelectedFormat=1,this.thumbLeftMargin=0,this.thumbRightMargin=4,this.Arr=Array,this.videoLoadingState={},this.videoHoverState={},this.templatesRequestId=0,this.mobileVisibleVideoIndexes=new Set,this.showTemplateVideoPreview=!1,this.templatePreviewVideoUrl="",this.previewIsPlaying=!1,this.previewIsMuted=!1,this.previewHasAudio=!1,this.previewCurrentTime="00:00",this.previewDuration="00:00",this.previewAudioDetectionDone=!1}ngOnChanges(e){const i=e.productFormat;i&&this.applyPlaceholderFormat(i.currentValue);const o=e.productId;if(!o)return;const s=null!=o.previousValue?String(o.previousValue).trim():null,a=null!=o.currentValue?String(o.currentValue).trim():"";!a||null!==s&&s===a||(this.resetListingForProductChange(),this.getTemplatesByProductId())}resetListingForProductChange(){this.pageNumber=0,this.isProductsEnd=!1,this.mainSelectedProduct={productId:"",displayName:"",imageObjects:[],bgColors:"",desc:"",format:"",storyPageUrl:"",title:""},this.applyPlaceholderFormat(this.productFormat)}applyPlaceholderFormat(e){const i=Number(e);!Number.isFinite(i)||i<=0||(this.mainSelectedFormat=i,this.productFormatCode=i,this.imageSizel(i))}getTemplatesByProductId(e=null){this.isLoaded=!1,this.inProgress=!0;const i=0===this.pageNumber;let o={pageNumber:this.pageNumber,rows:this.rowsCount,productId:this.productId,tagId:this.selectedTag?this.selectedTag.tagId:null,format:null};const s=++this.templatesRequestId;this.templatesSubscription?.unsubscribe(),this.templatesSubscription=this.templateService.getNewTemplatesByProductIdCancellable(o,a=>{if(s!==this.templatesRequestId)return;let p=a.storeProductImages;this.isFirstTime&&p&&0===p.length||(this.isFirstTime=!1,this.isLoaded=!0,this.inProgress=!1,a&&(this.mainSelectedProduct.displayName=a.displayName,this.mainSelectedProduct.productId=a.productId,this.mainSelectedProduct.title=a.title,this.productFormatCode=a.format,this.modelTypeId=a.modelTypeId,this.productCreditConfig=a.productCreditConfig||null,this.mainSelectedProduct.bgColors=a.bgColors?a.bgColors:"linear-gradient(85.82deg, rgb(245, 216, 218) -0.23%, rgb(245, 216, 218) 98.8%)",this.mainSelectedProduct.storyPageUrl=a.storyPageUrl,this.mainSelectedProduct.desc=a.desc),this.mainSelectedFormat=a.format,p&&p.length>0?(i&&(this.mainSelectedProduct.imageObjects=[]),this.mainSelectedProduct=this.getFormattedProduct(this.mainSelectedProduct,p),this.isProductsEnd=p.length<this.rowsCount):this.isProductsEnd=!0,e&&e())},a=>{s===this.templatesRequestId&&console.log(a)})}getFormattedProduct(e,i){let s,o=[];for(let a=0;a<i.length;a++)s=i[a],o.push({video:s.videoThumbUrl,videoLowRes:s.videoThumbUrl,videoHighRes:s.imgUrl,posterImage:s.thumbUrl.replace("low_res","high_res"),lazy:e.imageObjects.length+1+a>10,item:s,format:s.format,imageSizel:this.imageSizel(this.productFormatCode)});return o&&o.length>0&&(e.imageObjects=e.imageObjects.concat(o)),e}imageSizel(e){let i=1095;this.container&&(i=this.container.nativeElement.clientWidth);let o=this.templateService.getImageSizeL(e,i);return this.thumbLeftMargin=o.space,o}get rowHeight(){let e;if(this.envService.isMobileView)switch(this.productFormatCode){case 1:case 2:default:e=150;break;case 3:e=200}else switch(this.productFormatCode){case 1:e=150;break;case 3:e=300;break;default:e=205}return e}templateClick(e,i){if(this.envService.isMobileView){if(this.envService.isiOS)return void this.envService.openPlayStoreUrl();const o=74==(e?.modelTypeId||this.modelTypeId),s=o?"duoimageanimate":jt.Fs.ImageToAnimate,a=e?.categoryId||e?.subCategoryId||e?.storeCategoryId||null;sessionStorage.setItem(j,"1"),this.router.navigate(["/mob-ai-editor/edit"],{queryParams:{toolName:s,tab:Ft.sv.AI_VIDEO_TOOLS,from:"story",lv:"v5",duo:o?1:0,productId:e?.productId||this.productId,prodImageId:e?.productImageId,...a&&{catId:a}}})}else this.openTemplateDetailDialog(e)}loadMore(){this.pageNumber=this.pageNumber+1,this.getTemplatesByProductId()}openTemplateDetailDialog(e){const i=this.modalService.open(Vt.f,{centered:!0,size:"lg",backdrop:"static",windowClass:"ai-video-templates-dialog dynamic-field-case"});return i.componentInstance.activeImgObj=e,i.componentInstance.productId=this.productId,i.componentInstance.modelTypeId=this.modelTypeId,i.componentInstance.productCreditConfig=this.productCreditConfig,i}onVideoMouseEnter(e,i,o){if(this.isMobile)return;if(this.videoHoverState[i]=!0,!o)return void(this.videoLoadingState[i]=!1);e.getAttribute("src")!==o&&(e.src=o,e.load()),this.videoLoadingState[i]=e.readyState<HTMLMediaElement.HAVE_FUTURE_DATA,e.muted||(e.muted=!0);const s=e.play();s&&"function"==typeof s.then&&s.catch(()=>{this.videoLoadingState[i]=!1})}onVideoMouseLeave(e,i){if(!this.isMobile){this.videoHoverState[i]=!1,this.videoLoadingState[i]=!1;try{e.pause()}catch{}this.releaseDesktopVideo(e)}}clearVideoLoading(e){this.isMobile||(this.videoHoverState[e]=!1,this.videoLoadingState[e]=!1)}onVideoPlaying(e){this.videoLoadingState[e]=!1}onVideoWaiting(e){this.isMobile&&!this.mobileVisibleVideoIndexes.has(e)||!this.isMobile&&!this.videoHoverState[e]||(this.videoLoadingState[e]=!0)}isVideoLoading(e){return!this.isMobile&&!!this.videoLoadingState[e]}isMobileVideoLoading(e){return this.isMobile&&!!this.videoLoadingState[e]}isMobileVideoVisible(e){return!this.isMobile||this.mobileVisibleVideoIndexes.has(e)}get isMobile(){return this.envService.isMobileView}ngAfterViewInit(){this.applyPlaceholderFormat(this.productFormat),this.videosChangedSub=this.videos.changes.subscribe(()=>{this.playMobileVideos()}),this.screenChangedSub=this.envService.screenChanged.subscribe(()=>{this.playMobileVideos()}),this.playMobileVideos()}ngOnDestroy(){this.closeTemplateVideoPreview(),this.templatesSubscription?.unsubscribe(),this.videosChangedSub?.unsubscribe(),this.screenChangedSub&&this.screenChangedSub.unsubscribe(),this.mobileVideoObserver?.disconnect(),this.isMobile||this.videos?.forEach(e
1=>this.releaseDesktopVideo(e.nativeElement))}getTemplatePreviewVideoUrl(e){return e?.videoHighRes||e?.item?.imgUrl||e?.item?.videoThumbUrl||e?.video||""}openTemplateVideoPreview(e,i){i?.stopPropagation();const o=this.getTemplatePreviewVideoUrl(e);o&&(this.pauseListingVideos(),this.templatePreviewVideoUrl=o,this.previewCurrentTime="00:00",this.previewDuration="00:00",this.previewIsPlaying=!1,this.previewIsMuted=!1,this.previewHasAudio=!1!==e?.item?.hasAudio&&0!==e?.item?.hasAudio,this.previewAudioDetectionDone=!1===e?.item?.hasAudio||0===e?.item?.hasAudio,this.showTemplateVideoPreview=!0,this.renderer.addClass(this.document.body,"overflow-hidden"))}closeTemplateVideoPreview(){this.showTemplateVideoPreview&&(this.showTemplateVideoPreview=!1,this.templatePreviewVideoUrl="",this.previewIsPlaying=!1,this.previewIsMuted=!1,this.previewHasAudio=!1,this.previewAudioDetectionDone=!1,this.previewCurrentTime="00:00",this.previewDuration="00:00",this.renderer.removeClass(this.document.body,"overflow-hidden"))}toggleTemplatePreviewPlay(e){if(!e)return;if(!e.paused&&!e.ended)return void e.pause();const i=e.play();i&&"function"==typeof i.then&&i.catch(()=>{})}toggleTemplatePreviewMute(e){if(e&&(this.previewIsMuted=!this.previewIsMuted,e.muted=this.previewIsMuted,!this.previewIsMuted&&e.paused)){const i=e.play();i&&"function"==typeof i.then&&i.then(()=>this.previewIsPlaying=!0).catch(()=>{})}}onTemplatePreviewMetadata(e){e&&(e.muted=this.previewIsMuted,this.updatePreviewHasAudio(e),this.previewDuration=this.formatPreviewTime(e.duration),this.previewCurrentTime=this.formatPreviewTime(e.currentTime))}onTemplatePreviewCanPlay(e){if(!e)return;e.muted=this.previewIsMuted,this.updatePreviewHasAudio(e);const i=e.play();i&&"function"==typeof i.then&&i.then(()=>this.previewIsPlaying=!0).catch(()=>{})}onTemplatePreviewTimeUpdate(e){e&&(this.updatePreviewHasAudio(e),this.previewCurrentTime=this.formatPreviewTime(e.currentTime),e.duration&&isFinite(e.duration)&&(this.previewDuration=this.formatPreviewTime(e.duration)))}onTemplatePreviewEnded(e){this.previewIsPlaying=!1,this.previewCurrentTime="00:00",e&&(e.currentTime=0)}updatePreviewHasAudio(e){if(!e||this.previewAudioDetectionDone)return;const i=this.detectPreviewHasAudio(e);!0===i?(this.previewHasAudio=!0,this.previewAudioDetectionDone=!0):!1===i&&(this.previewHasAudio=!1,this.previewAudioDetectionDone=!0)}detectPreviewHasAudio(e){try{const i=e;if(i.audioTracks&&"number"==typeof i.audioTracks.length)return i.audioTracks.length>0;if("boolean"==typeof i.mozHasAudio)return i.mozHasAudio;if("number"==typeof i.webkitAudioDecodedByteCount&&i.webkitAudioDecodedByteCount>0||i.mozAudioTracks?.length)return!0}catch{}return null}formatPreviewTime(e){if(!isFinite(e)||e<0)return"00:00";const i=Math.floor(e),o=Math.floor(i/60),s=i%60;return`${String(o).padStart(2,"0")}:${String(s).padStart(2,"0")}`}pauseListingVideos(){this.videos?.forEach(e=>{try{e.nativeElement.pause()}catch{}})}onVideoCanPlay(e,i){this.isMobile?this.tryPlayVideo(e,i):this.videoLoadingState[i]=!1}playMobileVideos(){this.mobileVideoObserver?.disconnect(),this.isMobile&&this.videos?.length?(this.seedInitialVisibleMobileVideos(),this.cdr.detectChanges(),setTimeout(()=>{this.videos.forEach(e=>{const i=e.nativeElement,o=Number(i.dataset.videoIndex);Number.isFinite(o)&&this.mobileVisibleVideoIndexes.has(o)&&(i.load(),this.tryPlayVideo(i,o))})},0),this.mobileVideoObserver=new IntersectionObserver(e=>{this.zone.run(()=>{let i=!1;e.forEach(o=>{const s=o.target,a=Number(s.dataset.videoIndex);if(Number.isFinite(a))if(o.isIntersecting&&o.intersectionRatio>=.25)this.mobileVisibleVideoIndexes.has(a)||(this.mobileVisibleVideoIndexes.add(a),i=!0),this.videoLoadingState[a]=s.readyState<HTMLMediaElement.HAVE_FUTURE_DATA,setTimeout(()=>{s.load(),this.tryPlayVideo(s,a)},0);else{this.mobileVisibleVideoIndexes.has(a)&&(this.mobileVisibleVideoIndexes.delete(a),i=!0),this.videoLoadingState[a]=!1;try{s.pause()}catch{}s.load()}}),i&&this.cdr.detectChanges()})},{threshold:[0,.25,.5]}),this.videos.forEach(e=>this.mobileVideoObserver?.observe(e.nativeElement))):this.mobileVisibleVideoIndexes.clear()}tryPlayVideo(e,i){if(!e||this.isMobile&&!this.mobileVisibleVideoIndexes.has(i))return;this.videoLoadingState[i]=e.readyState<HTMLMediaElement.HAVE_FUTURE_DATA,e.muted||(e.muted=!0);const o=e.play();
1o&&"function"==typeof o.then&&(o.then(()=>{this.videoLoadingState[i]=!1}),o.catch(()=>{this.videoLoadingState[i]=!1}))}releaseDesktopVideo(e){if(e&&!this.isMobile){try{e.pause()}catch{}e.querySelectorAll("source").forEach(i=>i.removeAttribute("src")),e.removeAttribute("src"),e.load()}}seedInitialVisibleMobileVideos(){if(!this.isMobile||!this.videos?.length)return;const e=window.innerHeight||document.documentElement.clientHeight||0,i=window.innerWidth||document.documentElement.clientWidth||0;this.mobileVisibleVideoIndexes.clear(),this.videos.forEach(o=>{const s=o.nativeElement,a=Number(s.dataset.videoIndex);if(!Number.isFinite(a))return;const p=s.getBoundingClientRect();p.bottom>0&&p.top<e&&p.right>0&&p.left<i?this.mobileVisibleVideoIndexes.add(a):this.videoLoadingState[a]=!1})}}return(r=l).\u0275fac=function(e){return new(e||r)(t.rXU(Gt.I),t.rXU(m.Bq),t.rXU(O.L),t.rXU(_.Ix),t.rXU(t.SKi),t.rXU(t.gRc),t.rXU(t.sFG),t.rXU(d.qQ))},r.\u0275cmp=t.VBU({type:r,selectors:[["image-listing"]],viewQuery:function(e,i){if(1&e&&(t.GBs(Rt,7),t.GBs(At,5)),2&e){let o;t.mGM(o=t.lsd())&&(i.container=o.first),t.mGM(o=t.lsd())&&(i.videos=o)}},inputs:{productId:"productId",productFormat:"productFormat"},features:[t.OA$],decls:7,vars:11,consts:[["container",""],["imageDiv",""],["vid",""],["templatePreviewVid",""],[1,"container-fluid","p-0","ai-video-template"],[1,"templates-thumbs-list"],[3,"margin-right","class","mouseleave",4,"ngFor","ngForOf"],[4,"ngIf"],["class","col-12 d-flex justify-content-center mt-3 mb-0",4,"ngIf"],["class","template-video-preview position-fixed w-100 h-100 d-flex align-items-center justify-content-center",4,"ngIf"],[3,"mouseleave"],[1,"c-img",2,"height","var(--row-height)"],["muted","","preload","none","playsinline","",1,"border-radius-lg",2,"width","100%","object-fit","cover","display","block",3,"contextmenu","canplay","playing","waiting","stalled","seeking","mouseenter","mouseleave","click","poster","loop"],["media","(min-width: 768px)","type","video/mp4",4,"ngIf"],["type","video/mp4",4,"ngIf"],["class","btn-video-action position-absolute border-radius-50 d-flex align-items-center justify-content-center",4,"ngIf"],["class","btn-video-loading position-absolute border-radius-50 d-flex align-items-center justify-content-center",4,"ngIf"],["class","btn-video-loading btn-video-loading--center position-absolute border-radius-50 d-flex align-items-center justify-content-center",4,"ngIf"],[1,"icon-preview","position-absolute",3,"click"],["name","fullscreen","aria-hidden","true",1,"f-24","text-white"],["media","(min-width: 768px)","type","video/mp4"],["type","video/mp4"],[1,"btn-video-action","position-absolute","border-radius-50","d-flex","align-items-center","justify-content-center"],["name","playnew",1,"f-16","text-white"],[1,"btn-video-loading","position-absolute","border-radius-50","d-flex","align-items-center","justify-content-center"],["role","status",1,"spinner-border","spinner-border-sm","text-white"],[1,"btn-video-loading","btn-video-loading--center","position-absolute","border-radius-50","d-flex","align-items-center","justify-content-center"],["style","height:auto",3,"margin-right","class",4,"ngFor","ngForOf"],[2,"height","auto"],[1,"col-12","d-flex","justify-content-center","mt-3","mb-0"],["_ngcontent-prm-c104","","type","submit",1,"btn-all","btn-outline-primary","btn-h48","text-lg","ps-5","pe-5","mt-10",3,"click","disabled"],[1,"template-video-preview","position-fixed","w-100","h-100","d-flex","align-items-center","justify-content-center"],["type","button",1,"template-video-preview__close","position-absolute","d-flex","align-items-center","justify-content-center","text-white","pointer",3,"click"],["name","close",1,"f-24","text-white"],[1,"template-video-preview__player","position-relative","w-100"],["playsinline","","autoplay","","loop","","preload","metadata",1,"w-100","h-100",3,"play","pause","loadedmetadata","canplay","playing","timeupdate","ended","src","muted"],["type","button",1,"btn-video-action","btn-play","position-absolute","d-flex","align-items-center","justify-content-center","text-white","pointer",3,"click"],[1,"f-24",3,"name"],["type","button","class","btn-video-action btn-audio position-absolute d-flex align-items-center justify-content-center text-white pointer",3,"click",4,"ngIf"],[1,"vid-time","d-inline-flex","align-items-center","justify-content-center","text-13","text-white","text-regular","lh-125","position-absolute"],[2,"min-width","39px"],["type","button",1,"btn-video-action","btn-audio","position-absolute","d-flex","align-items-center","justify-content-center","text-white","pointer",3,"click"]],template:function(e,i){1&e&&(t.j41(0,"div",4,0)(2,"div",5),t.DNE(3,Xt,12,19,"div",6)(4,Ht,2,1,"ng-container",7),t.k0s()(),t.DNE(5,Yt,3,1,"div",8)(6,Wt,13,8,"div",9)),2&e&&(t.R7$(2),t.muq("--row-height: ",i.rowHeight,"px;"),t.xc7("margin-left",11-i.thumbLeftMargin,"px")("margin-right",-i.thumbRightMargin,"px"),t.R7$(),t.Y8G("ngForOf",i.mainSelectedProduct.imageObjects),t.R7$(),t.Y8G("ngIf",!i.isLoaded),t.R7$(),t.Y8G("ngIf",!i.isProductsEnd&&i.mainSelectedProduct.imageObjects.length>0),t.R7$(),t.Y8G("ngIf",i.showTemplateVideoPreview))},dependencies:[d.Sq,d.bT,w.b],styles:[".btn-video-action[_ngcontent-%COMP%]{bottom:8px;left:8px;height:32px;width:32px;background:#60657699;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);border:0px}.btn-video-action[_ngcontent-%COMP%]:hover{background:#606576cc}.btn-video-loading[_ngcontent-%COMP%]{bottom:8px;left:8px;height:32px;width:32px;background:#60657699;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);border:0}.btn-video-loading--center[_ngcontent-%COMP%]{top:50%;left:50%;bottom:auto;transform:translate(-50%,-50%)}.template-video-preview[_ngcontent-%COMP%]{top:0;right:0;bottom:0;left:0;z-index:100002;background:#000}.template-video-preview__close[_ngcontent-%COMP%]{top:16px;left:16px;width:40px;height:40px;border:0;border-radius:40px;background:#fff3;z-index:2}.template-video-preview__player[_ngcontent-%COMP%] video[_ngcontent-%COMP%]{display:block;max-height:100vh;object-fit:contain;background:#000}.template-video-preview[_ngcontent-%COMP%] .btn-video-action[_ngcontent-%COMP%]{bottom:8px;left:8px;height:40px;width:40px;border-radius:40px;background:#60657699;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);border:0}.template-video-preview[_ngcontent-%COMP%] .btn-audio[_ngcontent-%COMP%]{left:56px}
1.template-video-preview[_ngcontent-%COMP%] .vid-time[_ngcontent-%COMP%]{border-radius:8px;background:#5f6578b3;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);padding:8px 10px;bottom:8px;min-height:40px}.img-div[_ngcontent-%COMP%] .overlay[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;cursor:pointer;z-index:2}.img-div[_ngcontent-%COMP%] .overlay[_ngcontent-%COMP%] .view-eye[_ngcontent-%COMP%]{margin-top:0}.img-div[_ngcontent-%COMP%] .overlay.overlay--disabled[_ngcontent-%COMP%]{opacity:0!important;pointer-events:none}.img-div[_ngcontent-%COMP%]:hover .btn-video-action[_ngcontent-%COMP%]{display:none!important}@media (max-width: 576px){.ai-video-template[_ngcontent-%COMP%] .img-div[_ngcontent-%COMP%] .overlay[_ngcontent-%COMP%]:not(.overlay--disabled){visibility:visible;opacity:1}}.ai-video-template[_ngcontent-%COMP%] .templates-thumbs-list[_ngcontent-%COMP%] .img-format-3[_ngcontent-%COMP%]{width:calc((100% - 48px) / 6);flex-grow:inherit}.ai-video-template[_ngcontent-%COMP%] .templates-thumbs-list[_ngcontent-%COMP%] .img-format-1[_ngcontent-%COMP%]{width:calc((100% - 32px)/4);flex-grow:inherit}.ai-video-template[_ngcontent-%COMP%] .templates-thumbs-list[_ngcontent-%COMP%] .img-format-2[_ngcontent-%COMP%]{width:calc((100% - 40px)/5);flex-grow:inherit}@media (max-width: 1400px){.ai-video-template[_ngcontent-%COMP%] .templates-thumbs-list[_ngcontent-%COMP%] .img-format-3[_ngcontent-%COMP%]{flex:0 0 calc((100% - 64px)/5)}.ai-video-template[_ngcontent-%COMP%] .templates-thumbs-list[_ngcontent-%COMP%] .img-format-2[_ngcontent-%COMP%]{flex:0 0 calc((100% - 32px)/4)}}@media (max-width: 1200px){.ai-video-template[_ngcontent-%COMP%] .templates-thumbs-list[_ngcontent-%COMP%] .img-format-3[_ngcontent-%COMP%]{flex:0 0 calc((100% - 42px)/5)}.ai-video-template[_ngcontent-%COMP%] .templates-thumbs-list[_ngcontent-%COMP%] .img-format-1[_ngcontent-%COMP%], .ai-video-template[_ngcontent-%COMP%] .templates-thumbs-list[_ngcontent-%COMP%] .img-format-2[_ngcontent-%COMP%]{flex:0 0 calc((100% - 24px) / 3)}}@media (max-width: 992px){.ai-video-template[_ngcontent-%COMP%] .templates-thumbs-list[_ngcontent-%COMP%] .img-format-3[_ngcontent-%COMP%]{flex:0 0 calc((100% - 42px)/5)}.btn-video-action[_ngcontent-%COMP%]{display:none!important}}@media (max-width: 600px){.ai-video-template[_ngcontent-%COMP%] .templates-thumbs-list[_ngcontent-%COMP%] .img-format-3[_ngcontent-%COMP%]{flex:0 0 calc((100% - 16px)/2)}.ai-video-template[_ngcontent-%COMP%] .templates-thumbs-list[_ngcontent-%COMP%] .img-format-1[_ngcontent-%COMP%]{flex:0 0 calc((100% - 16px)*1)}.ai-video-template[_ngcontent-%COMP%] .templates-thumbs-list[_ngcontent-%COMP%] .img-format-2[_ngcontent-%COMP%]{flex:0 0 calc((100% - 16px)/2)}}@media (max-width: 400px){.ai-video-template[_ngcontent-%COMP%] .templates-thumbs-list[_ngcontent-%COMP%] .img-format-3[_ngcontent-%COMP%]{flex:0 0 calc((100% - 16px)/2)}.ai-video-template[_ngcontent-%COMP%] .templates-thumbs-list[_ngcontent-%COMP%] .img-format-1[_ngcontent-%COMP%], .ai-video-template[_ngcontent-%COMP%] .templates-thumbs-list[_ngcontent-%COMP%] .img-format-2[_ngcontent-%COMP%]{flex:0 0 calc((100% - 8px)*1)}}.icon-preview[_ngcontent-%COMP%]{border-radius:99px;background:#959aa766;height:40px;width:40px;display:flex;align-items:center;justify-content:center;color:#fff;right:8px;top:8px}"]}),l})();var qt=c(83339),F=c(89818),Qt=c(2578),G=c(30586),Jt=c(7060),Zt=c(80838),te=c(90660),ee=c(36561);let ie=(()=>{var r;class l{}return(r=l).\u0275fac=function(e){return new(e||r)},r.\u0275mod=t.$C({type:r}),r.\u0275inj=t.G2t({imports:[d.MD,f.YN,_.iI,m.UN,ht,kt.K,Ot.r,Tt.Y,Lt.I,qt.G,F.MQ,Qt.T,G.B,Jt.U]}),l})();t.wjB(P,[d.YU,d.Sq,d.bT,d.T3,d.ux,d.e1,f.me,f.BC,f.tU,f.vS,_.Wk,m.tg,Zt.P,w.b,F.vr,te.v,G.w,ee.B,wt,Kt],[])}}]);
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.