1"use strict";(self.webpackChunkinitiative_as_a_service=self.webpackChunkinitiative_as_a_service||[]).push([["default-src_app_features_page-preview_page-preview_module_ts"],{63228(y,C,t){t.d(C,{P:()=>j});var f=t(21413),h=t(96697),v=t(56977),l=t(12429),O=t(44570),o=t(12257),E=t(5558),p=t(91708),r=t(32067),D=t(1835),M=t(92549),U=t(68129),I=t(17077),T=t(79375),P=t(17705),u=t(2615),i=t(73664),K=t(91029),A=t(82049),R=t(61945),N=t(29185),L=t(8277),W=t(80633),$=t(95416),F=t(85217),n=t(72200),b=t(396),_=t(50229);const g=()=>[];function S(d,m){if(1&d){const e=i.RV6();i.j41(0,"app-page-builder",3),i.bIt("configurationChange",function(a){const c=u.eBV(e).ngIf,G=i.XpG(2);return u.Njj(G.onChange(a,c))})("pageChange",function(a){u.eBV(e);const c=i.XpG(2);return u.Njj(c.openPage(a))})("openLink",function(a){u.eBV(e);const c=i.XpG(2);return u.Njj(c.openLocation(a))})("uiConfigChange",function(a){u.eBV(e);const c=i.XpG(2);return u.Njj(c.onUIConfigChange(a))}),i.k0s()}if(2&d){const e=m.ngIf,s=i.XpG(2);i.Y8G("sfid",s.site.id)("configuration",s.widgetsConfiguration)("logo",s.site.configuration.logo||"")("uiConfig",s.site.configuration.ui||null)("navLinks",e)("socials",s.site.configuration.socials||i.lJ4(13,g))("tieredCentre",null==s.site.community?null:s.site.community.tieredCentre)("policyUrl",s.site.configuration.policyUrl||null)("isEditingEnabled",s.isEditingEnabled)("authenticatedSpace",s.site.permissions.authenticatedSpace)("activePage",s.path)("page",s.currentPage)("siteName",s.site.configuration.name||"")}}function B(d,m){if(1&d){const e=i.RV6();i.qex(0),i.j41(1,"app-global-nav",1),i.bIt("globalNavError",function(){u.eBV(e);const a=i.XpG();return u.Njj(a.onGlobalNavError())}),i.k0s(),i.DNE(2,S,1,14,"app-page-builder",2),i.nI1(3,"async"),i.bVm()}if(2&d){const e=i.XpG();i.R7$(),i.Y8G("disableInitialLogin",!0)("globalNavigationEnable",e.globalNavigationEnable)("tier",e.selectedTierName),i.R7$(),i.Y8G("ngIf",i.bMT(3,4,e.pagesSnapshots$))}}let j=(()=>{class d{constructor(e,s,a,c,G,w,V,X,x){this.route=e,this.pagesSnapshotsService=s,this.sitesSnapshotsService=a,this.siteService=c,this.pagesDraftService=G,this.designSettingsService=w,this.cdr=V,this.snackBar=X,this.storageService=x,this.widgetsConfiguration=[],this.pagesSnapshots$=this.pagesSnapshotsService.pagesSnapshots$,this.isEditingEnabled=!0,this.permissions$=this.siteService.permissions$,this.currentPage=null,this.destroy$=new f.B}ngOnInit(){const e=T.F.findParam(this.route.snapshot,"siteId");if(this.path=T.F.findParam(this.route.snapshot,"path"),this.subpageId=T.F.findParam(this.route.snapshot,"subpageId"),this.isEditingEnabled="preview"!==this.route.snapshot.queryParamMap.get("origin")&&!this.subpageId,this.selectedTierName=this.storageService.getLocalStorageItem(l.Z.TIER),this.permissions$.getValue()||this.siteService.getSitePermission(e).pipe((0,h.s)(1)).subscribe(),e){this.pagesSnapshots$.value.length||this.pagesSnapshotsService.getPagesSnapshot(e).pipe((0,h.s)(1)).subscribe(),this.siteService.setCurrentUserPermissions(e).pipe((0,h.s)(1),(0,v.Q)(this.destroy$)).subscribe();const s=this.sitesSnapshotsService.currentSite$.value;s?this.updateSiteConfiguration(s):this.sitesSnapshotsService.getSiteSnapshot(e).pipe((0,v.Q)(this.destroy$)).subscribe(a=>{this.updateSiteConfiguration(a)})}this.route.data.pipe((0,v.Q)(this.destroy$)).subscribe(({data:s})=>{if(this.pageType)return;this.currentPage=s;const a=(0,U.F)(this.pagesSnapshots$.getValue(),this.path),c=this.getPageDraft(e,a);this.subpageId?this.widgetsConfiguration=O.d.get(s.type)?.widgets||I.m.get(s?.type)?.widgets:c?this.widgetsConfiguration=c:s?.json?.widgets?.length?this.widgetsConfiguration=s?.json?.widgets:s?.type&&(this.widgetsConfiguration=I.m.get(s.type)?.widgets),window.parent.postMessage({loaded:!0},"*"),this.cdr.detectChanges()})}ngOnChanges(e){"pageType"in e&&this.pageType&&(this.widgetsConfiguration=I.m.get(this.pageType)?.widgets)}onChange(e,s){this.path===o.n.PAGE_NOT_FOUND?this.onUIConfigChange({...this.site?.configuration.ui,pageNotFoundTemplate:{widgets:e}}):s.length&&window.parent.postMessage({value:{id:(0,U.F)(s,this.path),configuration:e}},"*")}onGlobalNavError(){this.globalNavigationEnable=!1}onUIConfigChange(e){window.parent.postMessage({uiConfig:e},"*")}openPage({path:e},s){window.parent.postMessage({path:e,openLinkInNewTab:s},"*")}openLocation(e){if(e.isGoHome){const s=this.pagesSnapshots$.value?.find(a=>a.isHome)||this.pagesSnapshots$.value[0];this.openPage({path:s.path},e.openLinkInNewTab)}else e.isGoBack?window.parent.postMessage({goBack:!0},"*"):e.url&&"#"!==e.url?this.openLink(e):this.openPage({path:o.n.PAGE_NOT_FOUND},e.openLinkInNewTab)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}updateSiteConfiguration(e){this.site=e,!this.pageType&&this.path===o.n.PAGE_NOT_FOUND&&(this.widgetsConfiguration=this.site?.configuration.ui?.pageNotFoundTemplate?.widgets||I.m.get(E.g.PAGE_
1NOT_FOUND)?.widgets),this.globalNavigationEnable=e.configuration.globalNavigation,this.cdr.detectChanges()}getPageDraft(e,s){const a=this.pagesDraftService.getDraftConfigurationFromStorage();return a&&a[e]&&a[e][s]?a[e][s]:null}openLink({openLinkInNewTab:e,url:s,isAbsolute:a}){if(a)e?window.open(s,"_blank"):window.parent.location.href=s;else if(s.includes(r.a))this.snackBar.openFromComponent(p.Y,D.UE);else{if(!this.site?.configuration.path)return;{const c=(0,M.TE)((0,M.i5)(s,this.site?.configuration.path));e?window.open(c,"_blank"):window.parent.location.href=c,this.cdr.detectChanges()}}}static{this.\u0275fac=function(s){return new(s||d)(i.rXU(K.nX),i.rXU(A.h),i.rXU(R.X),i.rXU(N.T),i.rXU(L.L),i.rXU(W.D),i.rXU(P.gRc),i.rXU($.UG),i.rXU(F.n))}}static{this.\u0275cmp=i.VBU({type:d,selectors:[["app-design"]],inputs:{pageType:"pageType"},standalone:!1,features:[i.OA$],decls:1,vars:1,consts:[[4,"ngIf"],[3,"globalNavError","disableInitialLogin","globalNavigationEnable","tier"],[3,"sfid","configuration","logo","uiConfig","navLinks","socials","tieredCentre","policyUrl","isEditingEnabled","authenticatedSpace","activePage","page","siteName","configurationChange","pageChange","openLink","uiConfigChange",4,"ngIf"],[3,"configurationChange","pageChange","openLink","uiConfigChange","sfid","configuration","logo","uiConfig","navLinks","socials","tieredCentre","policyUrl","isEditingEnabled","authenticatedSpace","activePage","page","siteName"]],template:function(s,a){1&s&&i.DNE(0,B,4,6,"ng-container",0),2&s&&i.Y8G("ngIf",a.site)},dependencies:[n.bT,b.I,_.Y,n.Jj],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;height:100%}"],changeDetection:0})}}return d})()},89518(y,C,t){t.d(C,{PagePreviewModule:()=>F});var f=t(72200),h=t(64411),v=t(69738),l=t(38132),O=t(63228),o=t(7673),E=t(96354),p=t(25558),r=t(12257),D=t(12429),M=t(88192),U=t(94091),I=t(68129),T=t(19792),P=t(2615),u=t(82049),i=t(27449),K=t(85217);let A=(()=>{class n{constructor(_,g,S){this.pagesSnapshotsService=_,this.pageSnapshotService=g,this.storageService=S}resolve(_){const g=_.queryParamMap.get("siteId"),S=_.queryParamMap.get("path"),B=this.storageService.getLocalStorageItem(D.Z.TIER),j=_.queryParamMap.get("tier"),d=U.Z.isPreview()?j:B===M.J.PUBLIC?"everyone":B;return this.pagesSnapshotsService.getPagesSnapshot(g,d).pipe((0,E.T)(m=>({pages:m,pageId:(0,I.F)(m,S)})),(0,E.T)(({pageId:m})=>m),(0,p.n)(m=>{const e=T.Zk.find(s=>S.includes(s));return e?(0,o.of)(T.wD[e]):m?this.pageSnapshotService.getPageSnapshot(g,m):(S!==r.n.PAGE_NOT_FOUND&&window.parent.postMessage({path:r.n.PAGE_NOT_FOUND},"*"),(0,o.of)({}))}))}static{this.\u0275fac=function(g){return new(g||n)(P.KVO(u.h),P.KVO(i.D),P.KVO(K.n))}}static{this.\u0275prov=P.jDH({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();var R=t(61945);let N=(()=>{class n{constructor(_){this.sitesSnapshotsService=_}resolve(_){const g=_.queryParamMap.get("siteId");return this.sitesSnapshotsService.getSiteSnapshot(g)}static{this.\u0275fac=function(g){return new(g||n)(P.KVO(R.X))}}static{this.\u0275prov=P.jDH({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();var L=t(73664);const W=[{path:"",component:O.P,resolve:{data:A,site:N},runGuardsAndResolvers:"always"}];let $=(()=>{class n{static{this.\u0275fac=function(g){return new(g||n)}}static{this.\u0275mod=L.$C({type:n})}static{this.\u0275inj=P.G2t({imports:[l.iI.forChild(W),l.iI]})}}return n})(),F=(()=>{class n{static{this.\u0275fac=function(g){return new(g||n)}}static{this.\u0275mod=L.$C({type:n})}static{this.\u0275inj=P.G2t({imports:[f.MD,$,v.r,h.r]})}}return n})()},27449(y,C,t){t.d(C,{D:()=>O});var f=t(84412),h=t(2615),v=t(29330),l=t(73878);let O=(()=>{class o{constructor(p,r){this.httpClient=p,this.apiEndpointService=r,this.url$=new f.t("")}getPageSnapshot(p,r){const D=`${this.apiEndpointService.getFWSEndpoint()}/communities/v1/sites/${p}/pages/${r}`;return this.httpClient.get(D)}updatePageSnapshot(p,r,D){const M=`${this.apiEndpointService.getFWSEndpoint()}/communities/v1/sites/${p}/pages/${r}`;return this.httpClient.patch(M,D)}deletePageSnapshot(p,r){const D=`${this.apiEndpointService.getFWSEndpoint()}/communities/v1/sites/${p}/pages/${r}`;return this.httpClient.delete(D)}static{this.\u0275fac=function(r){return new(r||o)(h.KVO(v.Qq),h.KVO(l.J))}}static{this.\u0275prov=h.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o}
1)()},8277(y,C,t){t.d(C,{L:()=>v});var f=t(2615),h=t(85217);let v=(()=>{class l{constructor(o){this.storageService=o,this.pageDraftStorageKey="pageDraftStorageKey"}setDraftConfigurationToStorage(o,E){const p=this.getDraftConfigurationFromStorage(),r=p?{...p,[E]:o}:{[E]:o};this.storageService.setLocalStorageItem(this.pageDraftStorageKey,JSON.stringify(r))}removeDraftConfigurationFromStorage(){this.storageService.removeLocalStorageItem(this.pageDraftStorageKey)}getDraftConfigurationFromStorage(){const o=this.storageService.getLocalStorageItem(this.pageDraftStorageKey);return o?JSON.parse(o):null}static{this.\u0275fac=function(E){return new(E||l)(f.KVO(h.n))}}static{this.\u0275prov=f.jDH({token:l,factory:l.\u0275fac,providedIn:"root"})}}return l})()},68129(y,C,t){function f(h,v){return h.find(O=>O.path===v)?.id}t.d(C,{F:()=>f})}}]);
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.