@qaecy/cue-ui 0.0.37 → 0.0.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/112.js +1 -1
- package/137.js +1 -0
- package/153.js +1 -0
- package/222.js +1 -0
- package/311.js +1 -1
- package/329.js +1 -0
- package/336.js +1 -1
- package/347.js +1 -0
- package/36.js +1 -1
- package/376.js +1 -1
- package/382.js +1 -1
- package/41.js +1 -0
- package/419.js +1 -1
- package/423.js +1 -0
- package/493.js +1 -1
- package/586.js +1 -0
- package/613.js +1 -0
- package/614.js +1 -0
- package/628.js +1 -0
- package/629.js +1 -1
- package/673.js +1 -0
- package/675.js +1 -1
- package/695.js +1 -0
- package/7.js +1 -0
- package/836.js +1 -0
- package/872.js +1 -1
- package/879.js +1 -0
- package/911.js +1 -0
- package/957.js +1 -0
- package/README.md +195 -11
- package/common.js +1 -1
- package/index.js +1 -1
- package/main.js +1 -1
- package/package.json +1 -1
- package/170.js +0 -1
- package/5.js +0 -1
- package/571.js +0 -1
- package/611.js +0 -1
- package/627.js +0 -1
- package/722.js +0 -1
- package/773.js +0 -1
- package/828.js +0 -1
- package/834.js +0 -1
- package/953.js +0 -1
- package/995.js +0 -1
package/36.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[36],{3036(_,F,e){e.r(F),e.d(F,{DocumentViewer:()=>V});var I=e(467),Q=e(9769),a=e(5802),h=e(7705),T=e(2271),o=e(5547),f=e(3418),r=e(6114);const M={bim:()=>Promise.all([e.e(598),e.e(76),e.e(419)]).then(e.bind(e,6419)).then(i=>i.BIMFragmentsViewer),cad:()=>Promise.all([e.e(598),e.e(560),e.e(76),e.e(629)]).then(e.bind(e,5873)).then(i=>i.DXFViewer),image:()=>e.e(560).then(e.bind(e,8560)).then(i=>i.ImageViewer),markdown:()=>e.e(376).then(e.bind(e,4376)).then(i=>i.MarkdownViewer),pdf:()=>Promise.all([e.e(560),e.e(76),e.e(311)]).then(e.bind(e,4311)).then(i=>i.PDFViewer),text:()=>e.e(523).then(e.bind(e,3523)).then(i=>i.TextViewer),spreadsheet:()=>Promise.all([e.e(903),e.e(336)]).then(e.bind(e,8336)).then(i=>i.Spreadsheet),code:()=>Promise.all([e.e(284),e.e(722)]).then(e.bind(e,2722)).then(i=>i.CodeViewer),email:()=>e.e(740).then(e.bind(e,5740)).then(i=>i.EmailViewer)},y=new Map([[r.N.DXF,"cad"],[r.N.FRAG,"bim"],[r.N.PDF,"pdf"],[r.N.PNG,"image"],[r.N.JPG,"image"],[r.N.JPEG,"image"],[r.N.SVG,"image"],[r.N.GIF,"image"],[r.N.WEBP,"image"],[r.N.BMP,"image"],[r.N.AVIF,"image"],[r.N.APNG,"image"],[r.N.CSV,"spreadsheet"],[r.N.XLSX,"spreadsheet"],[r.N.XLS,"spreadsheet"],[r.N.JSON,"code"],[r.N.JSONLD,"code"],[r.N.XML,"code"],[r.N.CSS,"code"],[r.N.JS,"code"],[r.N.HTML,"code"],[r.N.HTM,"code"],[r.N.SH,"code"],[r.N.TXT,"text"],[r.N.RST,"text"],[r.N.MD,"markdown"]]);var x=e(8807),L=e(2065);const b=["*"];let A=(()=>{class i{width=(0,h.hFB)("auto");height=(0,h.hFB)("auto");style=(0,h.hFB)("");getStyles=(0,T.EW)(()=>this.style());static \u0275fac=function(s){return new(s||i)};static \u0275cmp=o.VBU({type:i,selectors:[["cue-container"]],hostVars:6,hostBindings:function(s,c){2&s&&(o.Aen(c.getStyles()),o.xc7("max-width",c.width())("max-height",c.height()))},inputs:{width:[1,"width"],height:[1,"height"],style:[1,"style"]},ngContentSelectors:b,decls:1,vars:0,template:function(s,c){1&s&&(o.NAR(),o.SdG(0))},styles:["[_nghost-%COMP%]{display:flex;align-items:stretch;container-name:cue-container;container-type:inline-size}[_nghost-%COMP%] > *[_ngcontent-%COMP%]{flex:1;max-width:100%}"]})}return i})();var E=e(2245),O=e(5381),H=e(5971),j=e(3319),w=e(5448),m=e(2014),$=e(7851),P=e(3191);let g=(()=>{class i{searchService=(0,a.WQX)(P.g);entityBeingPlaced=(0,a.vPA)(void 0);confirmedPlacement=(0,a.vPA)(void 0);rdfBaseURL=(0,a.vPA)("");contentUUID=(0,a.vPA)("");activePdfDoc=(0,a.vPA)(null);currentPage=(0,a.vPA)(1);requestedPage=(0,a.vPA)(null);navigateToPage(t){this.currentPage.set(t),this.requestedPage.set(t)}entityTextSearchResults=(0,a.vPA)([]);entityTextSearchResultsOnCurrentPage=(0,T.EW)(()=>this.entityTextSearchResults().filter(t=>t.page===this.currentPage()));currentPlacementBbox=(0,a.vPA)(null);categoryPreviewBoxes=(0,a.vPA)([]);_lastMatchIndex=(0,a.vPA)(null);matchCycleDisplay=(0,T.EW)(()=>{const t=this._lastMatchIndex(),s=this.entityTextSearchResultsOnCurrentPage().length;return null===t||0===s?"":`${t+1}/${s}`});cycleTextMatch(){const t=this.entityTextSearchResultsOnCurrentPage();if(!t.length)return;const s=this._lastMatchIndex(),c=null===s?0:(s+1)%t.length;this._lastMatchIndex.set(c);const n=t[c].xywhStr.replace("percent:",""),[p,v,d,l]=n.split(",").map(Number),U=Math.max(0,p-.5),B=Math.max(0,v-.5),N=Math.min(100-U,d+1),R=Math.min(100-B,l+1);this.currentPlacementBbox.set({xywhStr:`percent:${U.toFixed(2)},${B.toFixed(2)},${N.toFixed(2)},${R.toFixed(2)}`,color:"rgba(255, 160, 0, 0.9)",allowRemove:!1})}setManualBbox(t){this._lastMatchIndex.set(null),this.currentPlacementBbox.set({...t,allowRemove:!1})}clearPlacement(){this.currentPlacementBbox.set(null),this._lastMatchIndex.set(null)}constructor(){(0,a.QZP)(()=>{const t=this.entityBeingPlaced(),s=this.activePdfDoc();t?.value&&s?this.searchService.searchAll(s,t.value).then(c=>{this.entityTextSearchResults.set(c)}):this.entityTextSearchResults.set([])}),(0,a.QZP)(()=>{this.currentPage(),this._lastMatchIndex.set(null),this.currentPlacementBbox.set(null)}),(0,a.QZP)(()=>{const t=this.entityBeingPlaced();this._lastMatchIndex.set(null),void 0===t&&this.currentPlacementBbox.set(null)})}static \u0275fac=function(s){return new(s||i)};static \u0275prov=a.jDH({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var D=e(9352);const C=["viewerTarget"];function S(i,J){if(1&i){const t=o.RV6();o.j41(0,"cue-flexcontainer",2)(1,"cue-typography"),o.EFF(2),o.nI1(3,"transloco"),o.k0s(),o.j41(4,"cue-button",3),o.bIt("click",function(){a.eBV(t);const c=o.XpG();return a.Njj(c.downloadFile())}),o.j41(5,"cue-button-padder"),o.nrm(6,"cue-button-icon",4),o.k0s(),o.j41(7,"cue-button-label"),o.EFF(8),o.nI1(9,"transloco"),o.k0s()()()}2&i&&(o.R7$(2),o.JRh(o.bMT(3,2,"components.documentViewer.infoNoViewer")),o.R7$(6),o.JRh(o.bMT(9,4,"common.buttons.download")))}let V=(()=>{class i{_eps=(0,a.WQX)(g);_destroyed=!1;url=h.hFB.required();suffix=(0,h.hFB)();settings=(0,h.hFB)(new f.DocumentViewerSettings);viewerTypeOverride=(0,h.hFB)(void 0);interactions=(0,h.CGW)();viewerType=(0,T.EW)(()=>{const t=this.viewerTypeOverride();if(t)return t;const s=this.url(),c=void 0!==this.suffix()?this.suffix()?.trim():`.${s.split(".").pop()?.trim()}`,n=c?y.get(c):void 0;return console.log("[DocumentViewer] viewerType resolved",{url:s?.substring(0,80),suffix:c,viewerType:n}),void 0!==c?n:void 0});currentComponent=(0,a.vPA)(null);noViewer=(0,T.EW)(()=>null===this.currentComponent());isLoading=(0,a.vPA)(!1);viewerTarget;currentRef;_interactionsState=(0,a.vPA)(new f.DocumentViewerInteractions);constructor(){(0,a.QZP)(()=>{const t=this.viewerType(),s=this.url();console.log("[DocumentViewer] url/viewerType effect \u2014",{viewerType:t,url:s?.substring(0,80),destroyed:this._destroyed}),t?("pdf"!==t&&this._eps.activePdfDoc.set(null),this.isLoading.set(!0),this.loadViewerComponent(t,s,this.settings())):(this.viewerTarget.clear(),this.currentRef?.destroy(),this.currentRef=void 0,console.info("No viewer available for this file type"),this.currentComponent.set(null),this.isLoading.set(!1),this._eps.activePdfDoc.set(null))}),(0,a.QZP)(()=>{this.interactions.emit(this._interactionsState())}),(0,a.QZP)(()=>{const t=this.settings().pdf,s=this.currentRef;s&&s.setInput("settings",t)})}ngOnDestroy(){this._destroyed=!0,this.viewerTarget.clear(),this.currentRef?.destroy(),this.currentRef=void 0}loadViewerComponent(t,s,c){var n=this;return(0,I.A)(function*(){console.log("[DocumentViewer] loadViewerComponent",{viewerType:t,url:s?.substring(0,100)});try{const p=M[t],v=yield p();if(n._destroyed)return;if(n.currentComponent.set(v),n.isLoading.set(!1),n.viewerTarget.clear(),n.currentRef?.destroy(),n.currentRef=n.viewerTarget.createComponent(v),"pdf"===t)n.currentRef.setInput("src",s),void 0!==c?.pdf&&n.currentRef.setInput("settings",c.pdf),n.currentRef.instance.pdfLoaded&&n.currentRef.instance.pdfLoaded.subscribe(d=>{n._eps.currentPage.set(1),n._eps.activePdfDoc.set(d)}),n.currentRef.instance.settingsChange&&n.currentRef.instance.settingsChange.subscribe(d=>{const l=parseInt(d?.page,10);!isNaN(l)&&l>0&&n._eps.currentPage.set(l)}),n.currentRef.instance.artefactDrawn&&n.currentRef.instance.artefactDrawn.subscribe(d=>{"xywh"===d.type&&n._eps.setManualBbox(d.def)}),n.currentRef.instance.artefactEdited&&n.currentRef.instance.artefactEdited.subscribe(d=>{"bbox"===d.type&&n._eps.setManualBbox(d.after)});else if("bim"===t){const d=new x.di("model","Model",s);d.visible=!0,n.currentRef.setInput("data",{models:[d]}),void 0!==c?.bim&&n.currentRef.setInput("settings",c.bim),n.currentRef.instance.selectedElements&&n.currentRef.instance.selectedElements.subscribe(l=>{n._interactionsState.update(u=>(u.bim.selectedElements=l,Object.assign({},u)))}),n.currentRef.instance.clickedElement&&n.currentRef.instance.clickedElement.subscribe(l=>{n._interactionsState.update(u=>(u.bim.clickedElement=l,Object.assign({},u)))})}else if("cad"===t)n.currentRef.setInput("fileURL",s),void 0!==c?.cad&&n.currentRef.setInput("settings",c.cad);else if("image"===t)n.currentRef.setInput("src",s);else if("markdown"===t)n.currentRef.setInput("fileURL",s);else if("text"===t)n.currentRef.setInput("fileURL",s);else if("spreadsheet"===t){const d=n.suffix()?.split(".").pop()||s.split(".").pop()||"csv";n.currentRef.setInput("data",{url:s,format:d})}else if("code"===t){const u={".json":"json",".jsonld":"jsonld",".xml":"xml",".html":"xml",".htm":"xml",".css":"text",".js":"text",".sh":"text"}[n.suffix()??`.${s.split(".").pop()??""}`]??"text";n.currentRef.setInput("fileURL",s),n.currentRef.setInput("codeType",u)}else"email"===t&&n.currentRef.setInput("fileURL",s)}catch(p){console.error("Failed to load viewer component:",p),n.currentComponent.set(null)}})()}downloadFile(){var t=this;return(0,I.A)(function*(){const c=yield(yield fetch(t.url())).blob();(0,L.KE)(c,`document${t.suffix()??""}`)})()}static \u0275fac=function(s){return new(s||i)};static \u0275cmp=o.VBU({type:i,selectors:[["cue-doc-viewer"]],viewQuery:function(s,c){if(1&s&&o.GBs(C,7,o.c1b),2&s){let n;o.mGM(n=o.lsd())&&(c.viewerTarget=n.first)}},inputs:{url:[1,"url"],suffix:[1,"suffix"],settings:[1,"settings"],viewerTypeOverride:[1,"viewerTypeOverride"]},outputs:{interactions:"interactions"},decls:4,vars:2,consts:[["viewerTarget",""],[2,"height","100%","width","100%",3,"cueLogoLoader"],["direction","column","align","center","justify","center",2,"height","100%","width","100%"],[3,"click"],["icon","download"]],template:function(s,c){1&s&&(o.j41(0,"cue-container",1),o.eu8(1,null,0),o.nVh(3,S,10,6,"cue-flexcontainer",2),o.k0s()),2&s&&(o.Y8G("cueLogoLoader",c.isLoading()),o.R7$(3),o.vxM(!c.isLoading()&&c.noViewer()?3:-1))},dependencies:[Q.MD,A,E.Typography,O.n,H.$,j.a,w.L,m.z,$.k,D.Kj],styles:["[_nghost-%COMP%]{display:contents}"],changeDetection:0})}return i})()},3191(_,F,e){e.d(F,{g:()=>a});var I=e(467),Q=e(5802);let a=(()=>{class h{searchPage(o,f,r){return(0,I.A)(function*(){if(!r||!r.trim())return[];const M=r.toLowerCase(),y=yield o.getPage(f),x=y.getViewport({scale:1}),b=(yield y.getTextContent()).items,A=[];let E="";const O=[],H=[];for(let m=0;m<b.length;m++){const P=b[m].str??"";for(let g=0;g<P.length;g++)E+=P[g],O.push(m),H.push(g)}const j=E.toLowerCase();let w=0;for(;w<j.length;){const m=j.indexOf(M,w);if(-1===m)break;const $=m+M.length-1;w=m+1;const P=new Set;for(let v=m;v<=$;v++)P.add(O[v]);let g=1/0,D=1/0,C=-1/0,S=-1/0;for(const v of P){const d=b[v],[l,u,U,B,N,R]=d.transform,G=d.width??0,W=d.height??Math.abs(l||B||12),X=Math.sqrt(l*l+u*u)||1,Z=l/X,K=u/X,Y=U/X,z=B/X,ne=[[N,R],[N+Z*G,R+K*G],[N+Z*G+Y*W,R+K*G+z*W],[N+Y*W,R+z*W]];for(const[se,oe]of ne){const[k,q]=x.convertToViewportPoint(se,oe);g=Math.min(g,k),D=Math.min(D,q),C=Math.max(C,k),S=Math.max(S,q)}}const V=x.width,i=x.height,J=.005*V,t=.005*i,c=(D-t)/i*100,n=(C-g+2*J)/V*100,p=(S-D+2*t)/i*100;n>0&&p>0&&A.push({page:f,xywhStr:`percent:${((g-J)/V*100).toFixed(2)},${c.toFixed(2)},${n.toFixed(2)},${p.toFixed(2)}`})}return A})()}searchAll(o,f){var r=this;return(0,I.A)(function*(){if(!f||!f.trim())return[];const M=o.numPages,y=[];for(let x=1;x<=M;x++){const L=yield r.searchPage(o,x,f);y.push(...L)}return y})()}static \u0275fac=function(f){return new(f||h)};static \u0275prov=Q.jDH({token:h,factory:h.\u0275fac,providedIn:"root"})}return h})()}}]);
|
|
1
|
+
"use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[36],{3036(J,M,p){p.r(M),p.d(M,{DocumentViewer:()=>G});var f=p(467),e=p(9769),d=p(5802),t=p(7705),N=p(2271),u=p(5547),g=p(3418),c=p(6114);const R={bim:()=>Promise.all([p.e(598),p.e(76),p.e(419)]).then(p.bind(p,6419)).then(r=>r.BIMFragmentsViewer),cad:()=>Promise.all([p.e(598),p.e(560),p.e(76),p.e(629)]).then(p.bind(p,5873)).then(r=>r.DXFViewer),image:()=>p.e(560).then(p.bind(p,8560)).then(r=>r.ImageViewer),markdown:()=>Promise.all([p.e(222),p.e(586)]).then(p.bind(p,6586)).then(r=>r.MarkdownViewer),pdf:()=>Promise.all([p.e(560),p.e(311)]).then(p.bind(p,4311)).then(r=>r.PDFViewer),text:()=>p.e(523).then(p.bind(p,3523)).then(r=>r.TextViewer),spreadsheet:()=>Promise.all([p.e(903),p.e(336)]).then(p.bind(p,8336)).then(r=>r.Spreadsheet),code:()=>Promise.all([p.e(284),p.e(836),p.e(329)]).then(p.bind(p,329)).then(r=>r.CodeViewer),email:()=>p.e(740).then(p.bind(p,5740)).then(r=>r.EmailViewer)},D=new Map([[c.N.DXF,"cad"],[c.N.FRAG,"bim"],[c.N.PDF,"pdf"],[c.N.PNG,"image"],[c.N.JPG,"image"],[c.N.JPEG,"image"],[c.N.SVG,"image"],[c.N.GIF,"image"],[c.N.WEBP,"image"],[c.N.BMP,"image"],[c.N.AVIF,"image"],[c.N.APNG,"image"],[c.N.CSV,"spreadsheet"],[c.N.XLSX,"spreadsheet"],[c.N.XLS,"spreadsheet"],[c.N.JSON,"code"],[c.N.JSONLD,"code"],[c.N.XML,"code"],[c.N.CSS,"code"],[c.N.JS,"code"],[c.N.HTML,"code"],[c.N.HTM,"code"],[c.N.SH,"code"],[c.N.TXT,"text"],[c.N.RST,"text"],[c.N.MD,"markdown"]]);var T=p(8807),V=p(2065);const C=["*"];let H=(()=>{class r{width=(0,t.hFB)("auto");height=(0,t.hFB)("auto");style=(0,t.hFB)("");getStyles=(0,N.EW)(()=>this.style());static \u0275fac=function(s){return new(s||r)};static \u0275cmp=u.VBU({type:r,selectors:[["cue-container"]],hostVars:6,hostBindings:function(s,a){2&s&&(u.Aen(a.getStyles()),u.xc7("max-width",a.width())("max-height",a.height()))},inputs:{width:[1,"width"],height:[1,"height"],style:[1,"style"]},ngContentSelectors:C,decls:1,vars:0,template:function(s,a){1&s&&(u.NAR(),u.SdG(0))},styles:["[_nghost-%COMP%]{display:flex;align-items:stretch;container-name:cue-container;container-type:inline-size}[_nghost-%COMP%] > *[_ngcontent-%COMP%]{flex:1;max-width:100%}"]})}return r})();var w=p(2245),E=p(5381),z=p(5971),X=p(3319),L=p(5448),l=p(2014),U=p(7851),I=p(3191);let y=(()=>{class r{searchService=(0,d.WQX)(I.g);entityBeingPlaced=(0,d.vPA)(void 0);confirmedPlacement=(0,d.vPA)(void 0);rdfBaseURL=(0,d.vPA)("");contentUUID=(0,d.vPA)("");activePdfDoc=(0,d.vPA)(null);currentPage=(0,d.vPA)(1);requestedPage=(0,d.vPA)(null);navigateToPage(n){this.currentPage.set(n),this.requestedPage.set(n)}entityTextSearchResults=(0,d.vPA)([]);entityTextSearchResultsOnCurrentPage=(0,N.EW)(()=>this.entityTextSearchResults().filter(n=>n.page===this.currentPage()));currentPlacementBbox=(0,d.vPA)(null);categoryPreviewBoxes=(0,d.vPA)([]);_lastMatchIndex=(0,d.vPA)(null);matchCycleDisplay=(0,N.EW)(()=>{const n=this._lastMatchIndex(),s=this.entityTextSearchResultsOnCurrentPage().length;return null===n||0===s?"":`${n+1}/${s}`});cycleTextMatch(){const n=this.entityTextSearchResultsOnCurrentPage();if(!n.length)return;const s=this._lastMatchIndex(),a=null===s?0:(s+1)%n.length;this._lastMatchIndex.set(a);const o=n[a].xywhStr.replace("percent:",""),[A,P,i,m]=o.split(",").map(Number),W=Math.max(0,A-.5),b=Math.max(0,P-.5),S=Math.min(100-W,i+1),x=Math.min(100-b,m+1);this.currentPlacementBbox.set({xywhStr:`percent:${W.toFixed(2)},${b.toFixed(2)},${S.toFixed(2)},${x.toFixed(2)}`,color:"rgba(255, 160, 0, 0.9)",allowRemove:!1})}setManualBbox(n){this._lastMatchIndex.set(null),this.currentPlacementBbox.set({...n,allowRemove:!1})}clearPlacement(){this.currentPlacementBbox.set(null),this._lastMatchIndex.set(null)}constructor(){(0,d.QZP)(()=>{const n=this.entityBeingPlaced(),s=this.activePdfDoc();n?.value&&s?this.searchService.searchAll(s,n.value).then(a=>{this.entityTextSearchResults.set(a)}):this.entityTextSearchResults.set([])}),(0,d.QZP)(()=>{this.currentPage(),this._lastMatchIndex.set(null),this.currentPlacementBbox.set(null)}),(0,d.QZP)(()=>{const n=this.entityBeingPlaced();this._lastMatchIndex.set(null),void 0===n&&this.currentPlacementBbox.set(null)})}static \u0275fac=function(s){return new(s||r)};static \u0275prov=d.jDH({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();var v=p(9352);const O=["viewerTarget"];function B(r,$){if(1&r){const n=u.RV6();u.j41(0,"cue-flexcontainer",2)(1,"cue-typography"),u.EFF(2),u.nI1(3,"transloco"),u.k0s(),u.j41(4,"cue-button",3),u.bIt("click",function(){d.eBV(n);const a=u.XpG();return d.Njj(a.downloadFile())}),u.j41(5,"cue-button-padder"),u.nrm(6,"cue-button-icon",4),u.k0s(),u.j41(7,"cue-button-label"),u.EFF(8),u.nI1(9,"transloco"),u.k0s()()()}2&r&&(u.R7$(2),u.JRh(u.bMT(3,2,"components.documentViewer.infoNoViewer")),u.R7$(6),u.JRh(u.bMT(9,4,"common.buttons.download")))}let G=(()=>{class r{_eps=(0,d.WQX)(y);_destroyed=!1;url=t.hFB.required();suffix=(0,t.hFB)();settings=(0,t.hFB)(new g.DocumentViewerSettings);viewerTypeOverride=(0,t.hFB)(void 0);interactions=(0,t.CGW)();viewerType=(0,N.EW)(()=>{const n=this.viewerTypeOverride();if(n)return n;const s=this.url(),a=void 0!==this.suffix()?this.suffix()?.trim():`.${s.split(".").pop()?.trim()}`,o=a?D.get(a):void 0;return console.log("[DocumentViewer] viewerType resolved",{url:s?.substring(0,80),suffix:a,viewerType:o}),void 0!==a?o:void 0});currentComponent=(0,d.vPA)(null);noViewer=(0,N.EW)(()=>null===this.currentComponent());isLoading=(0,d.vPA)(!1);viewerTarget;currentRef;_interactionsState=(0,d.vPA)(new g.DocumentViewerInteractions);constructor(){(0,d.QZP)(()=>{const n=this.viewerType(),s=this.url();console.log("[DocumentViewer] url/viewerType effect \u2014",{viewerType:n,url:s?.substring(0,80),destroyed:this._destroyed}),n?("pdf"!==n&&this._eps.activePdfDoc.set(null),this.isLoading.set(!0),this.loadViewerComponent(n,s,this.settings())):(this.viewerTarget.clear(),this.currentRef?.destroy(),this.currentRef=void 0,console.info("No viewer available for this file type"),this.currentComponent.set(null),this.isLoading.set(!1),this._eps.activePdfDoc.set(null))}),(0,d.QZP)(()=>{this.interactions.emit(this._interactionsState())}),(0,d.QZP)(()=>{const n=this.settings().pdf,s=this.currentRef;s&&s.setInput("settings",n)})}ngOnDestroy(){this._destroyed=!0,this.viewerTarget.clear(),this.currentRef?.destroy(),this.currentRef=void 0}loadViewerComponent(n,s,a){var o=this;return(0,f.A)(function*(){console.log("[DocumentViewer] loadViewerComponent",{viewerType:n,url:s?.substring(0,100)});try{const A=R[n],P=yield A();if(o._destroyed)return;if(o.currentComponent.set(P),o.isLoading.set(!1),o.viewerTarget.clear(),o.currentRef?.destroy(),o.currentRef=o.viewerTarget.createComponent(P),"pdf"===n)o.currentRef.setInput("src",s),void 0!==a?.pdf&&o.currentRef.setInput("settings",a.pdf),o.currentRef.instance.pdfLoaded&&o.currentRef.instance.pdfLoaded.subscribe(i=>{o._eps.currentPage.set(1),o._eps.activePdfDoc.set(i)}),o.currentRef.instance.settingsChange&&o.currentRef.instance.settingsChange.subscribe(i=>{const m=parseInt(i?.page,10);!isNaN(m)&&m>0&&o._eps.currentPage.set(m)}),o.currentRef.instance.artefactDrawn&&o.currentRef.instance.artefactDrawn.subscribe(i=>{"xywh"===i.type&&o._eps.setManualBbox(i.def)}),o.currentRef.instance.artefactEdited&&o.currentRef.instance.artefactEdited.subscribe(i=>{"bbox"===i.type&&o._eps.setManualBbox(i.after)});else if("bim"===n){const i=new T.di("model","Model",s);i.visible=!0,o.currentRef.setInput("data",{models:[i]}),void 0!==a?.bim&&o.currentRef.setInput("settings",a.bim),o.currentRef.instance.selectedElements&&o.currentRef.instance.selectedElements.subscribe(m=>{o._interactionsState.update(h=>(h.bim.selectedElements=m,Object.assign({},h)))}),o.currentRef.instance.clickedElement&&o.currentRef.instance.clickedElement.subscribe(m=>{o._interactionsState.update(h=>(h.bim.clickedElement=m,Object.assign({},h)))})}else if("cad"===n)o.currentRef.setInput("fileURL",s),void 0!==a?.cad&&o.currentRef.setInput("settings",a.cad);else if("image"===n)o.currentRef.setInput("src",s);else if("markdown"===n)o.currentRef.setInput("fileURL",s);else if("text"===n)o.currentRef.setInput("fileURL",s);else if("spreadsheet"===n){const i=o.suffix()?.split(".").pop()||s.split(".").pop()||"csv";o.currentRef.setInput("data",{url:s,format:i})}else if("code"===n){const h={".json":"json",".jsonld":"jsonld",".xml":"xml",".html":"xml",".htm":"xml",".css":"text",".js":"text",".sh":"text"}[o.suffix()??`.${s.split(".").pop()??""}`]??"text";o.currentRef.setInput("fileURL",s),o.currentRef.setInput("codeType",h)}else"email"===n&&o.currentRef.setInput("fileURL",s)}catch(A){console.error("Failed to load viewer component:",A),o.currentComponent.set(null)}})()}downloadFile(){var n=this;return(0,f.A)(function*(){const a=yield(yield fetch(n.url())).blob();(0,V.KE)(a,`document${n.suffix()??""}`)})()}static \u0275fac=function(s){return new(s||r)};static \u0275cmp=u.VBU({type:r,selectors:[["cue-doc-viewer"]],viewQuery:function(s,a){if(1&s&&u.GBs(O,7,u.c1b),2&s){let o;u.mGM(o=u.lsd())&&(a.viewerTarget=o.first)}},inputs:{url:[1,"url"],suffix:[1,"suffix"],settings:[1,"settings"],viewerTypeOverride:[1,"viewerTypeOverride"]},outputs:{interactions:"interactions"},decls:4,vars:2,consts:[["viewerTarget",""],[2,"height","100%","width","100%",3,"cueLogoLoader"],["direction","column","align","center","justify","center",2,"height","100%","width","100%"],[3,"click"],["icon","download"]],template:function(s,a){1&s&&(u.j41(0,"cue-container",1),u.eu8(1,null,0),u.nVh(3,B,10,6,"cue-flexcontainer",2),u.k0s()),2&s&&(u.Y8G("cueLogoLoader",a.isLoading()),u.R7$(3),u.vxM(!a.isLoading()&&a.noViewer()?3:-1))},dependencies:[e.MD,H,w.Typography,E.n,z.$,X.a,L.L,l.z,U.k,v.Kj],styles:["[_nghost-%COMP%]{display:contents}"],changeDetection:0})}return r})()},3191(J,M,p){p.d(M,{g:()=>d});var f=p(467),e=p(5802);let d=(()=>{class t{searchPage(u,g,c){return(0,f.A)(function*(){if(!c||!c.trim())return[];const R=c.toLowerCase(),D=yield u.getPage(g),T=D.getViewport({scale:1}),C=(yield D.getTextContent()).items,H=[];let w="";const E=[],z=[];for(let l=0;l<C.length;l++){const I=C[l].str??"";for(let y=0;y<I.length;y++)w+=I[y],E.push(l),z.push(y)}const X=w.toLowerCase();let L=0;for(;L<X.length;){const l=X.indexOf(R,L);if(-1===l)break;const U=l+R.length-1;L=l+1;const I=new Set;for(let P=l;P<=U;P++)I.add(E[P]);let y=1/0,v=1/0,O=-1/0,B=-1/0;for(const P of I){const i=C[P],[m,h,W,b,S,x]=i.transform,j=i.width??0,K=i.height??Math.abs(m||b||12),Z=Math.sqrt(m*m+h*h)||1,Q=m/Z,Y=h/Z,k=W/Z,q=b/Z,fe=[[S,x],[S+Q*j,x+Y*j],[S+Q*j+k*K,x+Y*j+q*K],[S+k*K,x+q*K]];for(const[pe,ne]of fe){const[F,_]=T.convertToViewportPoint(pe,ne);y=Math.min(y,F),v=Math.min(v,_),O=Math.max(O,F),B=Math.max(B,_)}}const G=T.width,r=T.height,$=.005*G,n=.005*r,a=(v-n)/r*100,o=(O-y+2*$)/G*100,A=(B-v+2*n)/r*100;o>0&&A>0&&H.push({page:g,xywhStr:`percent:${((y-$)/G*100).toFixed(2)},${a.toFixed(2)},${o.toFixed(2)},${A.toFixed(2)}`})}return H})()}searchAll(u,g){var c=this;return(0,f.A)(function*(){if(!g||!g.trim())return[];const R=u.numPages,D=[];for(let T=1;T<=R;T++){const V=yield c.searchPage(u,T,g);D.push(...V)}return D})()}static \u0275fac=function(g){return new(g||t)};static \u0275prov=e.jDH({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})()},6114(J,M,p){p.d(M,{N:()=>e,V:()=>d});var f=p(4820),e=function(t){return t.AAC=".aac",t.ABW=".abw",t.ARC=".arc",t.AVIF=".avif",t.AVI=".avi",t.APNG=".apng",t.BAK=".bak",t.BIN=".bin",t.BMC=".bmc",t.BMP=".bmp",t.BZ=".bz",t.BZ2=".bz2",t.C3D=".c3d",t.CPG=".cpg",t.CSS=".css",t.CSV=".csv",t.DAT=".dat",t.DOC=".doc",t.DOCX=".docx",t.E57=".e57",t.EPUB=".epub",t.EXE=".exe",t.FFS=".ffs",t.FME=".fme",t.FMW=".fmw",t.FRAG=".fragments",t.GH=".gh",t.GZ=".gz",t.GIF=".gif",t.HTML=".html",t.HTM=".htm",t.ICO=".ico",t.ICS=".ics",t.JAR=".jar",t.JPG=".jpg",t.JPEG=".jpeg",t.JSON=".json",t.JSONLD=".jsonld",t.JS=".js",t.MOV=".mov",t.MP3=".mp3",t.MP4=".mp4",t.MPEG=".mpeg",t.MSI=".msi",t.MTL=".mtl",t.ODP=".odp",t.ODS=".ods",t.ODT=".odt",t.OGA=".oga",t.OGG=".ogg",t.OGV=".ogv",t.OGX=".ogx",t.OTF=".otf",t.PNG=".png",t.PDF=".pdf",t.PHP=".php",t.PKG=".pkg",t.PPT=".ppt",t.PPTX=".pptx",t.PS=".ps",t.RAR=".rar",t.RCP=".rcp",t.RTF=".rtf",t.SH=".sh",t.SLK=".slk",t.SVG=".svg",t.TAR=".tar",t.TIFF=".tiff",t.TIF=".tif",t.TTF=".ttf",t.TXT=".txt",t.VGL=".vgl",t.VWX=".vwx",t.WAV=".wav",t.WEBM=".webm",t.WEBP=".webp",t.WMV=".wmv",t.WOFF=".woff",t.WOFF2=".woff2",t.XLS=".xls",t.XLSX=".xlsx",t.XHTML=".xhtml",t.XML=".xml",t.XYZ=".xyz",t.ZIP=".zip",t.SEVEN_Z=".7z",t.DBF=".dbf",t.EML=".eml",t.EMLX=".emlx",t.MBX=".mbx",t.MD=".md",t.MSG=".msg",t.RST=".rst",t.HEIC=".heic",t.MPP=".mpp",t.TSV=".tsv",t.B3DM=".b3dm",t.I3DM=".i3dm",t.PNTS=".pnts",t.CMPT=".cmpt",t.GLTF=".gltf",t.GLB=".glb",t.IFC=".ifc",t.IFCZIP=".ifczip",t.IFXML=".ifcxml",t.THREEDM=".3dm",t.THREEDS=".3ds",t.GHP=".ghp",t.RVT=".rvt",t.RFA=".rfa",t.RFT=".rft",t.RTE=".rte",t.PLA=".pla",t.PLN=".pln",t.GSM=".gsm",t.SMC=".smc",t.BCF=".bcf",t.DWG=".dwg",t.DWL=".dwl",t.DXF=".dxf",t.DGN=".dgn",t.NWD=".nwd",t.OBJ=".obj",t.C4D=".c4d",t.TEKLASTRUCTURES=".teklastructures",t.PTS=".pts",t.LAS=".las",t.LAZ=".laz",t.USDZ=".usdz",t.USDA=".usda",t.USDC=".usdc",t.USD=".usd",t.PSD=".psd",t.PSP=".psp",t.AI=".ai",t.SBN=".sbn",t.SBX=".sbx",t.SHX=".shx",t.SKP=".skp",t.STL=".stl",t.FBX=".fbx",t.KML=".kml",t.SHP=".shp",t}(e||{});const d={[e.AAC]:{type:f.p.AUDIO,open:!0,suffix:".aac"},[e.ABW]:{type:f.p.TEXT,open:!0,suffix:".abw"},[e.ARC]:{type:f.p.ARCHIVE,open:!1,suffix:".arc"},[e.AVIF]:{type:f.p.IMAGE,open:!0,suffix:".avif"},[e.AVI]:{type:f.p.VIDEO,open:!0,suffix:".avi"},[e.APNG]:{type:f.p.IMAGE,open:!0,suffix:".apng"},[e.BAK]:{type:f.p.BACKUP,open:!1,suffix:".bak"},[e.BIN]:{type:f.p.BINARY,open:!1,suffix:".bin"},[e.BMC]:{type:f.p.BIM,open:!1,suffix:".bmc"},[e.BMP]:{type:f.p.IMAGE,open:!0,suffix:".bmp"},[e.BZ]:{type:f.p.ARCHIVE,open:!0,suffix:".bz"},[e.BZ2]:{type:f.p.ARCHIVE,open:!0,suffix:".bz2"},[e.C3D]:{type:f.p.THREE_D,open:!0,suffix:".c3d"},[e.CPG]:{type:f.p.GEOSPATIAL,open:!0,suffix:".cpg"},[e.CSS]:{type:f.p.MARKUP,open:!0,suffix:".css"},[e.CSV]:{type:f.p.DATA,open:!0,suffix:".csv"},[e.DAT]:{type:f.p.DATA,open:!1,suffix:".dat"},[e.DBF]:{type:f.p.DATA,open:!0,suffix:".dbf"},[e.DOC]:{type:f.p.TEXT,open:!1,suffix:".doc"},[e.DOCX]:{type:f.p.TEXT,open:!0,suffix:".docx"},[e.E57]:{type:f.p.THREE_D,open:!0,suffix:".e57"},[e.EPUB]:{type:f.p.TEXT,open:!0,suffix:".epub"},[e.EXE]:{type:f.p.INSTALLER,open:!1,suffix:".exe"},[e.FFS]:{type:f.p.AUTOMATION,open:!1,suffix:".ffs"},[e.FME]:{type:f.p.AUTOMATION,open:!1,suffix:".fme"},[e.FMW]:{type:f.p.AUTOMATION,open:!1,suffix:".fmw"},[e.FRAG]:{type:f.p.BIM,open:!0,suffix:".fragments"},[e.GH]:{type:f.p.THREE_D,open:!1,suffix:".gh"},[e.GZ]:{type:f.p.ARCHIVE,open:!0,suffix:".gz"},[e.GIF]:{type:f.p.IMAGE,open:!0,suffix:".gif"},[e.HTML]:{type:f.p.MARKUP,open:!0,suffix:".html"},[e.HTM]:{type:f.p.MARKUP,open:!0,suffix:".htm"},[e.ICO]:{type:f.p.IMAGE,open:!1,suffix:".ico"},[e.ICS]:{type:f.p.DATA,open:!0,suffix:".ics"},[e.JAR]:{type:f.p.ARCHIVE,open:!0,suffix:".jar"},[e.JPG]:{type:f.p.IMAGE,open:!0,suffix:".jpg"},[e.JPEG]:{type:f.p.IMAGE,open:!0,suffix:".jpeg"},[e.JSON]:{type:f.p.DATA,open:!0,suffix:".json"},[e.JSONLD]:{type:f.p.DATA,open:!0,suffix:".jsonld"},[e.JS]:{type:f.p.SCRIPT,open:!0,suffix:".js"},[e.MSI]:{type:f.p.INSTALLER,open:!1,suffix:".msi"},[e.MOV]:{type:f.p.VIDEO,open:!0,suffix:".mov"},[e.MP3]:{type:f.p.AUDIO,open:!0,suffix:".mp3"},[e.MP4]:{type:f.p.VIDEO,open:!0,suffix:".mp4"},[e.MPEG]:{type:f.p.VIDEO,open:!0,suffix:".mpeg"},[e.MTL]:{type:f.p.THREE_D,open:!0,suffix:".mtl"},[e.ODP]:{type:f.p.PRESENTATION,open:!0,suffix:".odp"},[e.ODS]:{type:f.p.SPREADSHEET,open:!0,suffix:".ods"},[e.ODT]:{type:f.p.TEXT,open:!0,suffix:".odt"},[e.OGA]:{type:f.p.AUDIO,open:!0,suffix:".oga"},[e.OGG]:{type:f.p.AUDIO,open:!0,suffix:".ogg"},[e.OGV]:{type:f.p.VIDEO,open:!0,suffix:".ogv"},[e.OGX]:{type:f.p.VIDEO,open:!0,suffix:".ogx"},[e.OTF]:{type:f.p.FONT,open:!0,suffix:".otf"},[e.PNG]:{type:f.p.IMAGE,open:!0,suffix:".png"},[e.PDF]:{type:f.p.TEXT,open:!0,suffix:".pdf"},[e.PHP]:{type:f.p.SCRIPT,open:!0,suffix:".php"},[e.PKG]:{type:f.p.INSTALLER,open:!1,suffix:".pkg"},[e.PPT]:{type:f.p.PRESENTATION,open:!1,suffix:".ppt"},[e.PPTX]:{type:f.p.PRESENTATION,open:!0,suffix:".pptx"},[e.PS]:{type:f.p.IMAGE,open:!1,suffix:".ps"},[e.RAR]:{type:f.p.ARCHIVE,open:!1,suffix:".rar"},[e.RCP]:{type:f.p.THREE_D,open:!1,suffix:".rcp"},[e.RTF]:{type:f.p.TEXT,open:!0,suffix:".rtf"},[e.SBN]:{type:f.p.GEOSPATIAL,open:!1,suffix:".sbn"},[e.SBX]:{type:f.p.GEOSPATIAL,open:!1,suffix:".sbx"},[e.SHX]:{type:f.p.GEOSPATIAL,open:!0,suffix:".shx"},[e.SH]:{type:f.p.SCRIPT,open:!0,suffix:".sh"},[e.SLK]:{type:f.p.DATA,open:!0,suffix:".slk"},[e.SVG]:{type:f.p.IMAGE,open:!0,suffix:".svg"},[e.TAR]:{type:f.p.ARCHIVE,open:!0,suffix:".tar"},[e.TIFF]:{type:f.p.IMAGE,open:!0,suffix:".tiff"},[e.TIF]:{type:f.p.IMAGE,open:!0,suffix:".tif"},[e.TTF]:{type:f.p.FONT,open:!0,suffix:".ttf"},[e.TXT]:{type:f.p.TEXT,open:!0,suffix:".txt"},[e.VGL]:{type:f.p.THREE_D,open:!1,suffix:".vgl"},[e.VWX]:{type:f.p.CAD,open:!1,suffix:".vwx"},[e.WAV]:{type:f.p.AUDIO,open:!0,suffix:".wav"},[e.WEBM]:{type:f.p.VIDEO,open:!0,suffix:".webm"},[e.WEBP]:{type:f.p.IMAGE,open:!0,suffix:".webp"},[e.WMV]:{type:f.p.VIDEO,open:!0,suffix:".wmv"},[e.WOFF]:{type:f.p.FONT,open:!0,suffix:".woff"},[e.WOFF2]:{type:f.p.FONT,open:!0,suffix:".woff2"},[e.XLS]:{type:f.p.SPREADSHEET,open:!1,suffix:".xls"},[e.XLSX]:{type:f.p.SPREADSHEET,open:!0,suffix:".xlsx"},[e.XHTML]:{type:f.p.MARKUP,open:!0,suffix:".xhtml"},[e.XML]:{type:f.p.DATA,open:!0,suffix:".xml"},[e.XYZ]:{type:f.p.THREE_D,open:!0,suffix:".xyz"},[e.ZIP]:{type:f.p.ARCHIVE,open:!0,suffix:".zip"},[e.SEVEN_Z]:{type:f.p.ARCHIVE,open:!0,suffix:".7z"},[e.EML]:{type:f.p.EMAIL,open:!0,suffix:".eml"},[e.EMLX]:{type:f.p.EMAIL,open:!0,suffix:".emlx"},[e.MBX]:{type:f.p.EMAIL,open:!0,suffix:".mbx"},[e.MD]:{type:f.p.TEXT,open:!0,suffix:".md"},[e.MSG]:{type:f.p.EMAIL,open:!1,suffix:".msg"},[e.RST]:{type:f.p.TEXT,open:!0,suffix:".rst"},[e.HEIC]:{type:f.p.IMAGE,open:!1,suffix:".heic"},[e.MPP]:{type:f.p.PLANNING,open:!1,suffix:".mpp"},[e.TSV]:{type:f.p.DATA,open:!0,suffix:".tsv"},[e.B3DM]:{type:f.p.THREE_D,open:!0,suffix:".b3dm"},[e.I3DM]:{type:f.p.THREE_D,open:!0,suffix:".i3dm"},[e.PNTS]:{type:f.p.THREE_D,open:!1,suffix:".pnts"},[e.CMPT]:{type:f.p.THREE_D,open:!1,suffix:".cmpt"},[e.GLTF]:{type:f.p.THREE_D,open:!0,suffix:".gltf"},[e.GLB]:{type:f.p.THREE_D,open:!0,suffix:".glb"},[e.IFC]:{type:f.p.BIM,open:!0,suffix:".ifc"},[e.IFCZIP]:{type:f.p.BIM,open:!0,suffix:".ifczip"},[e.IFXML]:{type:f.p.BIM,open:!0,suffix:".ifcxml"},[e.THREEDM]:{type:f.p.CAD,open:!1,suffix:".3dm"},[e.THREEDS]:{type:f.p.THREE_D,open:!1,suffix:".3ds"},[e.GHP]:{type:f.p.CAD,open:!1,suffix:".ghp"},[e.RVT]:{type:f.p.BIM,open:!1,suffix:".rvt"},[e.RFA]:{type:f.p.BIM,open:!1,suffix:".rfa"},[e.RFT]:{type:f.p.BIM,open:!1,suffix:".rft"},[e.RTE]:{type:f.p.BIM,open:!1,suffix:".rte"},[e.PLA]:{type:f.p.BIM,open:!1,suffix:".pla"},[e.PLN]:{type:f.p.BIM,open:!1,suffix:".pln"},[e.GSM]:{type:f.p.BIM,open:!1,suffix:".gsm"},[e.SMC]:{type:f.p.BIM,open:!1,suffix:".smc"},[e.STL]:{type:f.p.THREE_D,open:!0,suffix:".stl"},[e.BCF]:{type:f.p.BIM,open:!0,suffix:".bcf"},[e.DWG]:{type:f.p.CAD,open:!1,suffix:".dwg"},[e.DWL]:{type:f.p.CAD,open:!1,suffix:".dwl"},[e.DXF]:{type:f.p.CAD,open:!0,suffix:".dxf"},[e.DGN]:{type:f.p.CAD,open:!1,suffix:".dgn"},[e.NWD]:{type:f.p.BIM,open:!1,suffix:".nwd"},[e.OBJ]:{type:f.p.THREE_D,open:!0,suffix:".obj"},[e.C4D]:{type:f.p.THREE_D,open:!1,suffix:".c4d"},[e.TEKLASTRUCTURES]:{type:f.p.BIM,open:!1,suffix:".teklastructures"},[e.PTS]:{type:f.p.THREE_D,open:!1,suffix:".pts"},[e.LAS]:{type:f.p.THREE_D,open:!0,suffix:".las"},[e.LAZ]:{type:f.p.THREE_D,open:!0,suffix:".laz"},[e.USDZ]:{type:f.p.THREE_D,open:!0,suffix:".usdz"},[e.USDA]:{type:f.p.THREE_D,open:!0,suffix:".usda"},[e.USDC]:{type:f.p.THREE_D,open:!0,suffix:".usdc"},[e.USD]:{type:f.p.THREE_D,open:!0,suffix:".usd"},[e.PSD]:{type:f.p.IMAGE,open:!1,suffix:".psd"},[e.PSP]:{type:f.p.IMAGE,open:!1,suffix:".psp"},[e.AI]:{type:f.p.IMAGE,open:!1,suffix:".ai"},[e.SKP]:{type:f.p.THREE_D,open:!1,suffix:".skp"},[e.FBX]:{type:f.p.THREE_D,open:!0,suffix:".fbx"},[e.KML]:{type:f.p.GEOSPATIAL,open:!0,suffix:".kml"},[e.SHP]:{type:f.p.GEOSPATIAL,open:!0,suffix:".shp"}}},4820(J,M,p){p.d(M,{p:()=>f});var f=function(e){return e.AUTOMATION="automation",e.ARCHIVE="archive",e.AUDIO="audio",e.BACKUP="backup",e.BINARY="binary",e.BIM="bim",e.CAD="cad",e.DATA="data",e.EMAIL="email",e.FONT="font",e.GEOSPATIAL="geospatial",e.IMAGE="image",e.INSTALLER="installer",e.MARKUP="markup",e.MULTIMEDIA="multimedia",e.PLANNING="planning",e.PRESENTATION="presentation",e.SCRIPT="script",e.SPREADSHEET="spreadsheet",e.TEXT="text",e.THREE_D="3d",e.UNKNOWN="unknown",e.VIDEO="video",e}(f||{})}}]);
|
package/376.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[376],{4376(re,V,k){k.d(V,{MarkdownViewer:()=>Nn});var N=k(467),g=k(5802),T=k(7705),w=k(5547),L=k(4226),j=k(2771),E=k(7673),C=k(4572),z=k(1397),U=k(8141),b=k(9437);const x=(0,k(1853).L)(o=>function(){o(this),this.name="EmptyError",this.message="no elements in sequence"});var B=k(5964),P=k(6697),Z=k(9974),he=k(4360);function dt(o=gt){return(0,Z.N)((r,e)=>{let t=!1;r.subscribe((0,he._)(e,n=>{t=!0,e.next(n)},()=>t?e.complete():e.error(o())))})}function gt(){return new x}var ft=k(3669);function je(o,r){const e=arguments.length>=2;return t=>t.pipe(o?(0,B.p)((n,s)=>o(n,s,t)):ft.D,(0,P.s)(1),e?function G(o){return(0,Z.N)((r,e)=>{let t=!1;r.subscribe((0,he._)(e,n=>{t=!0,e.next(n)},()=>{t||e.next(o),e.complete()}))})}(r):dt(()=>new x))}var mt=k(6354),de=k(177),bt=k(345);const Fe=new g.nKC("All of the settings registered in the whole app."),xe=new g.nKC("The settings collected from all ancestor injectors"),Le=new g.nKC("The settings for the currently loaded module."),se="__ngx_dynamic_hooks_content",we="dynamic-component-anchor",A="__ngx_dynamic_hooks_anchor_id",M="__ngx_dynamic_hooks_anchor_parsetoken",xt=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"];var Se=function(o){return o[o.All=0]="All",o[o.Linear=1]="Linear",o[o.None=2]="None",o}(Se||{});const v={},We="[a-zA-Z_$]+[a-zA-Z0-9_$]*",Ie="[a-zA-Z$\\-_:][a-zA-Z$\\-_:0-9\\.]*";function D(o,r){if(!r.global)throw Error("TypeError: matchAll called with a non-global RegExp argument");const e=[];let t=r.exec(o);for(;null!==t;)e.push(t),t=r.exec(o);return r.lastIndex=0,e}function Te(o){return void 0!==o?.__ngContext__}v.attributeNameNoBracketsRegex="("+Ie+")",v.attributeNameBracketsRegex="\\[("+Ie+")\\]",v.attributeNameRoundBracketsRegex="\\(("+Ie+")\\)",v.attributeNameRegex="(?:"+v.attributeNameNoBracketsRegex+"|"+v.attributeNameBracketsRegex+"|"+v.attributeNameRoundBracketsRegex+")",v.attributeValueDoubleQuotesRegex='"((?:\\\\.|[^"])*?)"',v.attributeValueSingleQuotesRegex="'((?:\\\\.|[^'])*?)'",v.variablePathDotNotation="\\."+We,v.variableBracketsNotation="\\[[^\\]]*\\]",v.variablePathFunctionCall="\\([^\\)]*\\)",v.variablePathPartRegex="(?:"+v.variablePathDotNotation+"|"+v.variableBracketsNotation+"|"+v.variablePathFunctionCall+")",v.contextVariableRegex="context"+v.variablePathPartRegex+"*",v.placeholderVariablePathDotNotation="\\@@@cxtDot@@@"+We,v.placeholderVariableBracketsNotation="@@@cxtOpenSquareBracket@@@[^\\]]*@@@cxtCloseSquareBracket@@@",v.placeholderVariablePathFunctionCall="@@@cxtOpenRoundBracket@@@[^\\)]*@@@cxtCloseRoundBracket@@@",v.placeholderVariablePathPartRegex="(?:"+v.placeholderVariablePathDotNotation+"|"+v.placeholderVariableBracketsNotation+"|"+v.placeholderVariablePathFunctionCall+")",v.placeholderContextVariableRegex="__CXT__"+v.placeholderVariablePathPartRegex+"*";class St{constructor(r,e,t,n){this.configResolver=e,this.tagHookFinder=t,this.bindingsValueManager=n,this.savedBindings={},this.config=this.configResolver.processConfig(r),this.name=this.config.name}findHooks(r,e,t){let n=this.config.enclosing?this.tagHookFinder.findEnclosingTags(r,this.config.selector,this.config.bracketStyle,t):this.tagHookFinder.findSingleTags(r,this.config.selector,this.config.bracketStyle,t);return this.config.allowSelfClosing&&(n=[...n,...this.tagHookFinder.findSelfClosingTags(r,this.config.selector,this.config.bracketStyle,t)],n.sort((s,i)=>s.openingTagStartIndex-i.openingTagStartIndex)),n}loadComponent(r,e,t,n,s){return{component:this.config.component,hostElementTag:this.config.hostElementTag||this.config.selector,injector:this.config.injector,environmentInjector:this.config.environmentInjector}}getBindings(r,e,t,n){let s=this.savedBindings[r];return void 0===s&&(s=this.createBindings(e.openingTag),this.savedBindings[r]=s),this.bindingsValueManager.checkInputBindings(s.inputs,t,this.config,n),this.bindingsValueManager.checkOutputBindings(s.outputs,this.config,n),{inputs:this.getValuesFromSavedBindings(s.inputs),outputs:this.getValuesFromSavedBindings(s.outputs)}}createBindings(r){const e=this.collectRawInputs(r),t={};for(const[i,a]of Object.entries(e))t[i]={raw:a,parsed:!1,value:null,boundContextVariables:{}};const n=this.collectRawOutputs(r),s={};for(const[i,a]of Object.entries(n))s[i]={raw:a,parsed:!1,value:null,boundContextVariables:{}};return{inputs:t,outputs:s}}collectRawInputs(r){const e=this.getBindingsFromOpeningTag(r,"noBracketInputs",this.config.inputsBlacklist||null,this.config.inputsWhitelist||null),t=this.getBindingsFromOpeningTag(r,"bracketInputs",this.config.inputsBlacklist||null,this.config.inputsWhitelist||null);for(const[n,s]of Object.entries(e))e[n]="'"+s+"'";return{...e,...t}}collectRawOutputs(r){return this.getBindingsFromOpeningTag(r,"outputs",this.config.outputsBlacklist||null,this.config.outputsWhitelist||null)}getBindingsFromOpeningTag(r,e,t,n){const s={},i="(?:"+v.attributeValueDoubleQuotesRegex+"|"+v.attributeValueSingleQuotesRegex+")";let a;switch(e){case"noBracketInputs":a=v.attributeNameNoBracketsRegex;break;case"bracketInputs":a=v.attributeNameBracketsRegex;break;case"outputs":a=v.attributeNameRoundBracketsRegex}const u=D(r,new RegExp(a+"="+i,"gim"));for(const p of u){let h=p[2]||p[3];void 0===h&&"noBracketInputs"===e&&(h=""),s[p[1]]=h}const d={};for(const[p,h]of Object.entries(s))t&&t.includes(p)||n&&!n.includes(p)||(d[p]=h);return d}getValuesFromSavedBindings(r){const e={};for(const[t,n]of Object.entries(r))e[t]=n.value;return e}}class It{constructor(r,e,t,n){this.configResolver=e,this.platformService=t,this.bindingsValueManager=n,this.savedBindings={},this.config=this.configResolver.processConfig(r),this.name=this.config.name}findHookElements(r,e,t){return Array.from(this.platformService.querySelectorAll(r,this.config.selector))}loadComponent(r,e,t,n,s){return this.scrubAngularBindingAttrs(e.element),{component:this.config.component,hostElementTag:this.config.hostElementTag,injector:this.config.injector,environmentInjector:this.config.environmentInjector}}getBindings(r,e,t,n){let s=this.savedBindings[r];return void 0===s&&(s=this.createBindings(e.elementSnapshot),this.savedBindings[r]=s),this.bindingsValueManager.checkInputBindings(s.inputs,t,this.config,n),this.bindingsValueManager.checkOutputBindings(s.outputs,this.config,n),{inputs:this.getValuesFromSavedBindings(s.inputs),outputs:this.getValuesFromSavedBindings(s.outputs)}}scrubAngularBindingAttrs(r){const e=Array.from(r.attributes).map(t=>t.name).filter(t=>t.startsWith("[")&&t.endsWith("]")||t.startsWith("(")&&t.endsWith(")"));for(const t of e)this.platformService.removeAttribute(r,t)}createBindings(r){const e=this.collectRawBindings(r,"inputs",this.config.inputsBlacklist||null,this.config.inputsWhitelist||null),t={};for(const[i,a]of Object.entries(e))t[i]={raw:a,parsed:!1,value:null,boundContextVariables:{}};const n=this.collectRawBindings(r,"outputs",this.config.outputsBlacklist||null,this.config.outputsWhitelist||null),s={};for(const[i,a]of Object.entries(n))s[i]={raw:a,parsed:!1,value:null,boundContextVariables:{}};return{inputs:t,outputs:s}}collectRawBindings(r,e,t,n){const s={},i=this.platformService.getAttributeNames(r);for(let l of i)if("inputs"===e&&(!l.startsWith("(")||!l.endsWith(")"))||"outputs"===e&&l.startsWith("(")&&l.endsWith(")")){let c=this.platformService.getAttribute(r,l);"inputs"===e&&l.startsWith("[")&&l.endsWith("]")&&""===c&&(c=void 0),"inputs"===e&&(!l.startsWith("[")||!l.endsWith("]"))&&(c=`'${c}'`),l=l.replace(/^\[|^\(|\]$|\)$/g,""),s[l]=c}const a={};for(const[l,c]of Object.entries(s))t&&t.includes(l)||n&&!n.includes(l)||(a[l]=c);return a}getValuesFromSavedBindings(r){const e={};for(const[t,n]of Object.entries(r))e[t]=n.value;return e}}const Tt={component:void 0,name:void 0,parseWithRegex:!1,selector:void 0,hostElementTag:void 0,injector:void 0,allowSelfClosing:!0,enclosing:!0,bracketStyle:{opening:"<",closing:">"},parseInputs:!0,unescapeStrings:!0,inputsBlacklist:void 0,inputsWhitelist:void 0,outputsBlacklist:void 0,outputsWhitelist:void 0,allowContextInBindings:!0,allowContextFunctionCalls:!0};let Et=(()=>{class o{constructor(){}processConfig(e){const t=JSON.parse(JSON.stringify(Tt));if(!e||!e.hasOwnProperty("component"))throw Error('Missing the required "component" property for the SelectorHookParserConfig. Must be either the component class or a LazyLoadComponentConfig.');if(t.component=e.component,e.component.hasOwnProperty("prototype")){const n=(0,T.HJs)(e.component);t.selector=n.selector}else{if(!e.component.hasOwnProperty("importPromise")||!e.component.hasOwnProperty("importName"))throw Error('The "component" property in the SelectorHookParserConfig must either contain the component class or a LazyLoadComponentConfig.');if(!e.hasOwnProperty("selector"))throw Error('When using lazy-loaded dynamic components, you have to specify the "selector" property in the parser config, as the real selector can\'t be known before the component is loaded.')}if(e.hasOwnProperty("name")){if("string"!=typeof e.name)throw Error('The submitted "name" property in the SelectorHookParserConfig must be of type string, was '+typeof e.name);t.name=e.name}if(e.hasOwnProperty("selector")){if("string"!=typeof e.selector)throw Error('The submitted "selector" property in the SelectorHookParserConfig must be of type string, was '+typeof e.selector);t.selector=e.selector}if(e.hasOwnProperty("hostElementTag")){if("string"!=typeof e.hostElementTag)throw Error('The submitted "hostElementTag" property in the SelectorHookParserConfig must be of type string, was '+typeof e.hostElementTag);t.hostElementTag=e.hostElementTag}if(e.hasOwnProperty("parseWithRegex")){if("boolean"!=typeof e.parseWithRegex)throw Error('The submitted "parseWithRegex" property in the SelectorHookParserConfig must be of type boolean, was '+typeof e.parseWithRegex);t.parseWithRegex=e.parseWithRegex}if(e.hasOwnProperty("allowSelfClosing")){if("boolean"!=typeof e.allowSelfClosing)throw Error('The submitted "allowSelfClosing" property in the SelectorHookParserConfig must be of type boolean, was '+typeof e.allowSelfClosing);t.allowSelfClosing=e.allowSelfClosing}if(e.hasOwnProperty("enclosing")){if("boolean"!=typeof e.enclosing)throw Error('The submitted "enclosing" property in the SelectorHookParserConfig must be of type boolean, was '+typeof e.enclosing);t.enclosing=e.enclosing}if(e.hasOwnProperty("bracketStyle")){if("object"!=typeof e.bracketStyle||"string"!=typeof e.bracketStyle.opening||"string"!=typeof e.bracketStyle.closing)throw Error('The submitted "bracketStyle" property in the SelectorHookParserConfig must have the form {opening: string, closing: string}');t.bracketStyle=e.bracketStyle}if(e.hasOwnProperty("injector")&&(t.injector=e.injector),e.hasOwnProperty("environmentInjector")&&(t.environmentInjector=e.environmentInjector),e.hasOwnProperty("unescapeStrings")){if("boolean"!=typeof e.unescapeStrings)throw Error('The submitted "unescapeStrings" property in the SelectorHookParserConfig must be of type boolean, was '+typeof e.unescapeStrings);t.unescapeStrings=e.unescapeStrings}if(e.hasOwnProperty("parseInputs")){if("boolean"!=typeof e.parseInputs)throw Error('The submitted "parseInputs" property in the SelectorHookParserConfig must be of type boolean, was '+typeof e.parseInputs);t.parseInputs=e.parseInputs}if(e.hasOwnProperty("inputsBlacklist")){if(!Array.isArray(e.inputsBlacklist))throw Error('The submitted "inputsBlacklist" property in the SelectorHookParserConfig must be an array of strings.');for(const n of e.inputsBlacklist)if("string"!=typeof n)throw Error('All entries of the submitted "inputsBlacklist" property in the SelectorHookParserConfig must be of type string, '+typeof n+" found.");t.inputsBlacklist=e.inputsBlacklist}if(e.hasOwnProperty("inputsWhitelist")){if(!Array.isArray(e.inputsWhitelist))throw Error('The submitted "inputsWhitelist" property in the SelectorHookParserConfig must be an array of strings.');for(const n of e.inputsWhitelist)if("string"!=typeof n)throw Error('All entries of the submitted "inputsWhitelist" property in the SelectorHookParserConfig must be of type string, '+typeof n+" found.");t.inputsWhitelist=e.inputsWhitelist}if(e.hasOwnProperty("outputsBlacklist")){if(!Array.isArray(e.outputsBlacklist))throw Error('The submitted "outputsBlacklist" property in the SelectorHookParserConfig must be an array of strings.');for(const n of e.outputsBlacklist)if("string"!=typeof n)throw Error('All entries of the submitted "outputsBlacklist" property in the SelectorHookParserConfig must be of type string, '+typeof n+" found.");t.outputsBlacklist=e.outputsBlacklist}if(e.hasOwnProperty("outputsWhitelist")){if(!Array.isArray(e.outputsWhitelist))throw Error('The submitted "outputsWhitelist" property in the SelectorHookParserConfig must be an array of strings.');for(const n of e.outputsWhitelist)if("string"!=typeof n)throw Error('All entries of the submitted "outputsWhitelist" property in the SelectorHookParserConfig must be of type string, '+typeof n+" found.");t.outputsWhitelist=e.outputsWhitelist}if(e.hasOwnProperty("allowContextInBindings")){if("boolean"!=typeof e.allowContextInBindings)throw Error('The submitted "allowContextInBindings" property in the SelectorHookParserConfig must be of type boolean, was '+typeof e.allowContextInBindings);t.allowContextInBindings=e.allowContextInBindings}if(e.hasOwnProperty("allowContextFunctionCalls")){if("boolean"!=typeof e.allowContextFunctionCalls)throw Error('The submitted "allowContextFunctionCalls" property in the SelectorHookParserConfig must be of type boolean, was '+typeof e.allowContextFunctionCalls);t.allowContextFunctionCalls=e.allowContextFunctionCalls}return t}static{this.\u0275fac=function(t){return new(t||o)}}static{this.\u0275prov=g.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})();const Ke=new g.nKC("An injection token to retrieve an optionally user-provided PlatformService");let Ct=(()=>{class o{constructor(e,t,n){this.document=e,this.rendererFactory=t,this.sanitizer=n,this.renderer=this.rendererFactory.createRenderer(null,null)}getNgVersion(){if(typeof this.document<"u"){const t=this.querySelectorAll(this.document,"[ng-version]")?.[0]?.getAttribute("ng-version");if(t)return parseInt(t,10)}return null}sanitize(e){return this.sanitizer.sanitize(w.WPN.HTML,e)||""}createElement(e){return this.renderer.createElement(e)}sortElements(e,t){return e===t?0:e.compareDocumentPosition?2&e.compareDocumentPosition(t)?1:-1:e.sourceIndex-t.sourceIndex}cloneElement(e){return e.cloneNode(!0)}getTagName(e){return e.tagName}getOpeningTag(e){const n=e.outerHTML.length;return e.outerHTML.slice(0,"/"===e.outerHTML[n-2]?n:n-e.innerHTML.length-e.tagName.length-3)}getClosingTag(e){return e.outerHTML.slice(e.outerHTML.length-e.tagName.length-3)}getAttributeNames(e){return"function"==typeof e.getAttributeNames?e.getAttributeNames():[]}getAttribute(e,t){return"function"==typeof e.getAttribute?e.getAttribute(t):null}setAttribute(e,t,n){this.renderer.setAttribute(e,t,n)}removeAttribute(e,t){this.renderer.removeAttribute(e,t)}getParentNode(e){try{return this.renderer.parentNode(e)}catch{return null}}querySelectorAll(e,t){return Array.from(e.querySelectorAll(t))}getChildNodes(e){return Array.prototype.slice.call(e.childNodes)}appendChild(e,t){this.renderer.appendChild(e,t)}insertBefore(e,t,n){this.renderer.insertBefore(e,t,n)}clearChildNodes(e){if(e)for(;e.firstChild;)this.removeChild(e,e.firstChild)}removeChild(e,t){e.removeChild(t)}getInnerContent(e){return e.innerHTML}setInnerContent(e,t){e&&(e.innerHTML=t)}isTextNode(e){return e.nodeType===Node.TEXT_NODE}createTextNode(e){return document.createTextNode(e)}getTextContent(e){return e.textContent}dispatchEvent(e,t,n){e.dispatchEvent(new CustomEvent(t,{detail:n,bubbles:!0}))}static{this.\u0275fac=function(t){return new(t||o)(g.KVO(g.qQL),g.KVO(w._9s),g.KVO(bt.up))}}static{this.\u0275prov=g.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})(),J=(()=>{class o{constructor(e,t){this.userPlatformService=e,this.defaultPlatformService=t}getFor(e){return this.userPlatformService&&"function"==typeof this.userPlatformService[e]?this.userPlatformService:this.defaultPlatformService}getNgVersion(){return this.getFor("getNgVersion").getNgVersion()}sanitize(e){return this.getFor("sanitize").sanitize(e)}createElement(e){return this.getFor("createElement").createElement(e)}sortElements(e,t){return this.getFor("sortElements").sortElements(e,t)}cloneElement(e){return this.getFor("cloneElement").cloneElement(e)}getTagName(e){return this.getFor("getTagName").getTagName(e)}getOpeningTag(e){return this.getFor("getOpeningTag").getOpeningTag(e)}getClosingTag(e){return this.getFor("getClosingTag").getClosingTag(e)}getAttributeNames(e){return this.getFor("getAttributeNames").getAttributeNames(e)}getAttribute(e,t){return this.getFor("getAttribute").getAttribute(e,t)}setAttribute(e,t,n){return this.getFor("setAttribute").setAttribute(e,t,n)}removeAttribute(e,t){return this.getFor("removeAttribute").removeAttribute(e,t)}getParentNode(e){return this.getFor("getParentNode").getParentNode(e)}querySelectorAll(e,t){return this.getFor("querySelectorAll").querySelectorAll(e,t)}getChildNodes(e){return this.getFor("getChildNodes").getChildNodes(e)}appendChild(e,t){return this.getFor("appendChild").appendChild(e,t)}insertBefore(e,t,n){return this.getFor("insertBefore").insertBefore(e,t,n)}clearChildNodes(e){return this.getFor("clearChildNodes").clearChildNodes(e)}removeChild(e,t){return this.getFor("removeChild").removeChild(e,t)}getInnerContent(e){return this.getFor("getInnerContent").getInnerContent(e)}setInnerContent(e,t){return this.getFor("setInnerContent").setInnerContent(e,t)}isTextNode(e){return this.getFor("isTextNode").isTextNode(e)}createTextNode(e){return this.getFor("createTextNode").createTextNode(e)}getTextContent(e){return this.getFor("getTextContent").getTextContent(e)}dispatchEvent(e,t,n){return this.getFor("dispatchEvent").dispatchEvent(e,t,n)}static{this.\u0275fac=function(t){return new(t||o)(g.KVO(Ke,8),g.KVO(Ct))}}static{this.\u0275prov=g.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})(),W=(()=>{class o{constructor(e){this.platformId=e}log(e,t){this.handleLog(e,t,"log")}warn(e,t){this.handleLog(e,t,"warn")}error(e,t){this.handleLog(e,t,"error")}handleLog(e,t,n){(t.logOptions?.dev&&this.isDevMode()&&(0,de.UE)(this.platformId)||t.logOptions?.prod&&!this.isDevMode()&&(0,de.UE)(this.platformId)||t.logOptions?.ssr&&!(0,de.UE)(this.platformId))&&console[n](...e)}isDevMode(){return(0,T.naY)()}static{this.\u0275fac=function(t){return new(t||o)(g.KVO(w.Agw))}}static{this.\u0275prov=g.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})(),Rt=(()=>{class o{constructor(e){this.logger=e}find(e,t,n,s,i={sanitize:!0,convertHTMLEntities:!0,fixParagraphTags:!0,updateOnPushOnly:!1,compareInputsByValue:!1,compareOutputsByValue:!1,compareByValueDepth:5,triggerDOMEvents:!1,ignoreInputAliases:!1,ignoreOutputAliases:!1,acceptInputsForAnyProperty:!1,acceptOutputsForAnyObservable:!1,logOptions:{dev:!0,prod:!1,ssr:!1}}){return n?this.findEnclosingHooks(e,t,n,s,i):this.findSingletagHooks(e,t)}findSingletagHooks(e,t){const n=[],s=D(e,t);for(const i of s)n.push({openingTagStartIndex:i.index,openingTagEndIndex:i.index+i[0].length,closingTagStartIndex:null,closingTagEndIndex:null});return n}findEnclosingHooks(e,t,n,s,i={sanitize:!0,convertHTMLEntities:!0,fixParagraphTags:!0,updateOnPushOnly:!1,compareInputsByValue:!1,compareOutputsByValue:!1,compareByValueDepth:5,triggerDOMEvents:!1,ignoreInputAliases:!1,ignoreOutputAliases:!1,acceptInputsForAnyProperty:!1,acceptOutputsForAnyObservable:!1,logOptions:{dev:!0,prod:!1,ssr:!1}}){const a=[],l=[],c=D(e,t);for(const p of c)a.push({isOpening:!0,value:p[0],startIndex:p.index,endIndex:p.index+p[0].length});const u=D(e,n);for(const p of u)a.push({isOpening:!1,value:p[0],startIndex:p.index,endIndex:p.index+p[0].length});a.sort((p,h)=>p.startIndex-h.startIndex);const d=[];for(const[p,h]of a.entries())if(p>0&&h.startIndex<a[p-1].endIndex)this.logger.warn(['Syntax error - New tag "'+h.value+'" started at position '+h.startIndex+' before previous tag "'+a[p-1].value+'" ended at position '+a[p-1].endIndex+". Ignoring."],i);else if(h.isOpening)d.push(h);else{if(0===d.length){this.logger.warn(['Syntax error - Closing tag without preceding opening tag found: "'+h.value+'". Ignoring.'],i);continue}if(!1===s&&d.length>1){d.pop();continue}const f=d[d.length-1];l.push({openingTagStartIndex:f.startIndex,openingTagEndIndex:f.startIndex+f.value.length,closingTagStartIndex:h.startIndex,closingTagEndIndex:h.startIndex+h.value.length}),d.pop()}return d.length>0&&this.logger.warn(["Syntax error - Opening tags without corresponding closing tags found."],i),l}static{this.\u0275fac=function(t){return new(t||o)(g.KVO(W))}}static{this.\u0275prov=g.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})(),Ot=(()=>{class o{constructor(e){this.hookFinder=e}findSingleTags(e,t,n={opening:"<",closing:">"},s){const i=this.generateOpeningTagRegex(t,n);return this.hookFinder.find(e,i,void 0,void 0,s)}findEnclosingTags(e,t,n={opening:"<",closing:">"},s){const i=this.generateOpeningTagRegex(t,n),a=this.generateClosingTagRegex(t,n);return this.hookFinder.find(e,i,a,!0,s)}findSelfClosingTags(e,t,n={opening:"<",closing:">"},s){const i=this.generateOpeningTagRegex(t,n,!0);return this.hookFinder.find(e,i,void 0,void 0,s)}generateOpeningTagRegex(e,t={opening:"<",closing:">"},n=!1){const s=this.escapeRegex(t.opening),i=this.escapeRegex(e),a=(n?"\\/":"")+this.escapeRegex(t.closing);return new RegExp(s+i+"(?:\\s*"+a+"|(?:\\s+"+v.attributeNameRegex+"=(?:"+v.attributeValueDoubleQuotesRegex+"|"+v.attributeValueSingleQuotesRegex+"))+\\s*"+a+")","gim")}generateClosingTagRegex(e,t={opening:"<",closing:">"}){const n=this.escapeRegex(t.opening)+"/",s=this.escapeRegex(e),i=this.escapeRegex(t.closing);return new RegExp(n+s+i,"gim")}escapeRegex(e){return e.replace(new RegExp("[-\\/\\\\^$*+?.()|[\\]{}]","g"),"\\$&")}static{this.\u0275fac=function(t){return new(t||o)(g.KVO(Rt))}}static{this.\u0275prov=g.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})(),Bt=(()=>{class o{encodeSubstrings(e){const i=[...D(e,/'/gm).filter(u=>0===u.index||"\\"!==e[u.index-1]),...D(e,/"/gm).filter(u=>0===u.index||"\\"!==e[u.index-1]),...D(e,/`/gm).filter(u=>0===u.index||"\\"!==e[u.index-1])];i.sort((u,d)=>u.index-d.index);const a=[];let l=null;for(const u of i)l?l[0]===u[0]&&(a.push({startIndex:l.index+1,endIndex:u.index}),l=null):l=u;if(null!==l)throw Error("Input parse error. String was opened, but not closed.");return this.encodeTextSegments(e,a,this.encodeStringSpecialChars)}encodeStringSpecialChars(e){return(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=e.replace(/'/g,"@@@singlequote@@@")).replace(/"/g,"@@@doublequote@@@")).replace(/`/g,"@@@gravequote@@@")).replace(/:/g,"@@@colon@@@")).replace(/;/g,"@@@semicolon@@@")).replace(/\./g,"@@@dot@@@")).replace(/,/g,"@@@comma@@@")).replace(/\\/g,"@@@backslash@@@")).replace(/\(/g,"@@@openRoundBracket@@@")).replace(/\)/g,"@@@closeRoundBracket@@@")).replace(/\[/g,"@@@openSquareBracket@@@")).replace(/\]/g,"@@@closeSquareBracket@@@")).replace(/\{/g,"@@@openCurlyBracket@@@")).replace(/\}/g,"@@@closeCurlyBracket@@@")}decodeStringSpecialChars(e){return(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=e.replace(/@@@singlequote@@@/g,"'")).replace(/@@@doublequote@@@/g,'"')).replace(/@@@gravequote@@@/g,"`")).replace(/@@@colon@@@/g,":")).replace(/@@@semicolon@@@/g,";")).replace(/@@@dot@@@/g,".")).replace(/@@@comma@@@/g,",")).replace(/@@@backslash@@@/g,"\\")).replace(/@@@openRoundBracket@@@/g,"(")).replace(/@@@closeRoundBracket@@@/g,")")).replace(/@@@openSquareBracket@@@/g,"[")).replace(/@@@closeSquareBracket@@@/g,"]")).replace(/@@@openCurlyBracket@@@/g,"{")).replace(/@@@closeCurlyBracket@@@/g,"}")}encodeSubfunctions(e){const s=[...D(e,/\(/gm),...D(e,/\)/gm)];s.sort((c,u)=>c.index-u.index);const i=[],a=[];for(const c of s)if("("===c[0])a.push(c);else{if(0===a.length)throw Error("Input parse error. Closed function bracket without opening it first.");1===a.length&&i.push({startIndex:a[0].index+1,endIndex:c.index}),a.pop()}if(0!==a.length)throw Error("Input parse error. Opened function bracket without closing it.");return this.encodeTextSegments(e,i,this.encodeFunctionBrackets)}encodeFunctionBrackets(e){return(e=e.replace(/\(/g,"@@@fnOpenBracket@@@")).replace(/\)/g,"@@@fnCloseBracket@@@")}decodeFunctionBrackets(e){return(e=e.replace(/@@@fnOpenBracket@@@/g,"(")).replace(/@@@fnCloseBracket@@@/g,")")}encodeVariableSubbrackets(e){const s=D(e,new RegExp("(?:[a-zA-Z_$\\])])(\\[)","gm")),i=[];for(const c of s){const u=e.substring(c.index+2),h=[...D(u,/\[/gm),...D(u,/\]/gm)];h.sort((m,O)=>m.index-O.index);let f=1;for(const m of h)if(f="]"===m[0]?f-1:f+1,0===f){i.push({startIndex:c.index+2,endIndex:c.index+2+m.index});break}if(0!==f)throw Error("Input parse error. Opened bracket without closing it.")}const a=[];for(const c of i)(0===a.length||a[a.length-1].endIndex<c.startIndex)&&a.push(c);return this.encodeTextSegments(e,a,this.encodeVariableBrackets)}encodeVariableBrackets(e){return(e=e.replace(/\[/g,"@@@variableOpeningBracket@@@")).replace(/\]/g,"@@@variableClosingBracket@@@")}decodeVariableBrackets(e){return(e=e.replace(/@@@variableOpeningBracket@@@/g,"[")).replace(/@@@variableClosingBracket@@@/g,"]")}transformContextVarIntoPlacerholder(e){return(e=(e=(e=(e=(e=(e="__CXT__"+e.substring(7)).replace(/\"/g,"@@@cxtDoubleQuote@@@")).replace(/\./g,"@@@cxtDot@@@")).replace(/\[/g,"@@@cxtOpenSquareBracket@@@")).replace(/\]/g,"@@@cxtCloseSquareBracket@@@")).replace(/\(/g,"@@@cxtOpenRoundBracket@@@")).replace(/\)/g,"@@@cxtCloseRoundBracket@@@")}transformPlaceholderIntoContextVar(e){return(e=(e=(e=(e=(e=(e="context"+e.substring(7)).replace(/@@@cxtDoubleQuote@@@/g,'"')).replace(/@@@cxtDot@@@/g,".")).replace(/@@@cxtOpenSquareBracket@@@/g,"[")).replace(/@@@cxtCloseSquareBracket@@@/g,"]")).replace(/@@@cxtOpenRoundBracket@@@/g,"(")).replace(/@@@cxtCloseRoundBracket@@@/g,")")}encodeTextSegments(e,t,n){const s=[];for(const l of t){const c=0===s.length?0:s[s.length-1].endIndex;s.push({type:"text",startIndex:c,endIndex:l.startIndex,string:e.substring(c,l.startIndex)}),s.push({type:"special",startIndex:l.startIndex,endIndex:l.endIndex,string:e.substring(l.startIndex,l.endIndex)})}const i=0===s.length?0:s[s.length-1].endIndex;s.push({type:"text",startIndex:i,endIndex:e.length-1,string:e.substring(i)});for(const l of s)"special"===l.type&&(l.string=n(l.string));let a="";for(const l of s)a+=l.string;return a}stripSlashes(e){return e.replace(/\\(.)/g,"$1")}escapeDoubleQuotes(e){return e.replace(/\\/g,"\\\\").replace(/\"/g,'\\"')}static{this.\u0275fac=function(t){return new(t||o)}}static{this.\u0275prov=g.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})(),At=(()=>{class o{constructor(e,t){this.dataTypeEncoder=e,this.logger=t}evaluate(e,t={},n,s=!0,i={},a=!0,l={sanitize:!0,convertHTMLEntities:!0,fixParagraphTags:!0,updateOnPushOnly:!1,compareInputsByValue:!1,compareOutputsByValue:!1,compareByValueDepth:5,triggerDOMEvents:!1,ignoreInputAliases:!1,ignoreOutputAliases:!1,acceptInputsForAnyProperty:!1,acceptOutputsForAnyObservable:!1,logOptions:{dev:!0,prod:!1,ssr:!1}}){if("null"===e)return null;if("undefined"!==e){if("true"===e)return!0;if("false"===e)return!1;if(!isNaN(e))return parseInt(e,10);if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'")||e.startsWith("`")&&e.endsWith("`")){let c=e.substring(1,e.length-1);return c=s?this.dataTypeEncoder.stripSlashes(c):c,c}if((e=this.encodeDataTypeString(e)).startsWith("{")&&e.endsWith("}")||e.startsWith("[")&&e.endsWith("]")){const c=this.parseAsJSON(e,s);return this.loadJSONVariables(c,t,n,s,i,a,l)}if("$event"===e)return n;if(e.match(new RegExp("^\\s*"+v.contextVariableRegex+"\\s*$","gm")))return this.loadContextVariable(e,t,n,s,i,a,l);throw Error('Data type for following input was not recognized and could not be parsed: "'+e+'"')}}encodeDataTypeString(e){return e=this.dataTypeEncoder.encodeSubstrings(e),e=this.dataTypeEncoder.encodeSubfunctions(e),this.dataTypeEncoder.encodeVariableSubbrackets(e)}decodeDataTypeString(e){return e=this.dataTypeEncoder.decodeStringSpecialChars(e),e=this.dataTypeEncoder.decodeFunctionBrackets(e),(e=this.dataTypeEncoder.decodeVariableBrackets(e)).trim()}parseAsJSON(e,t){if((e=(e=(e=e.replace(/\'(\\.|[^\'])*?\'/gm,l=>'"'+l.slice(1,-1)+'"')).replace(/\`(\\.|[^\`])*?\`/gm,l=>'"'+l.slice(1,-1)+'"')).replace(/"?([a-z0-9A-Z_]+)"?\s*:/g,'"$1": ')).match(/"?__proto__"?\s*:/g))throw Error('Setting the "__proto__" property in a hook input object is not allowed.');if(e.match(/"?prototype"?\s*:/g))throw Error('Setting the "prototype" property in a hook input object is not allowed.');if(e.match(/"?constructor"?\s*:/g))throw Error('Setting the "constructor" property in a hook input object is not allowed.');e=this.replaceValuesInJSONString(e,"undefined",l=>"null"),e=this.replaceValuesInJSONString(e,v.contextVariableRegex,l=>'"'+this.dataTypeEncoder.transformContextVarIntoPlacerholder(l)+'"'),e=this.replaceValuesInJSONString(e,"\\$event",l=>'"__EVENT__"');const a=JSON.parse(e);return this.decodeJSONStrings(a,t),a}replaceValuesInJSONString(e,t,n){return e.replace(new RegExp("(?:(:\\s*)("+t+")(?=\\s*[,}])|([\\[,]\\s*)("+t+")(?=\\s*[\\],]))","gm"),(a,l,c,u,d)=>(l||u)+n(c||d))}decodeJSONStrings(e,t){for(const n in e)if("string"==typeof e[n]){if('__EVENT__"'===e[n]||e[n].match(new RegExp("^\\s*"+v.placeholderContextVariableRegex+"\\s*$","gm")))continue;let s=this.decodeDataTypeString(e[n]);s=t?this.dataTypeEncoder.stripSlashes(s):s,e[n]=s}else"object"==typeof e[n]&&this.decodeJSONStrings(e[n],t)}loadJSONVariables(e,t,n,s,i,a,l){for(const c in e)if("string"==typeof e[c]){if("__EVENT__"===e[c])e[c]=n;else if(e[c].match(new RegExp("^\\s*"+v.placeholderContextVariableRegex+"\\s*$","gm"))){const u=this.dataTypeEncoder.transformPlaceholderIntoContextVar(e[c].trim());e[c]=this.loadContextVariable(u,t,n,s,i,a,l)}}else"object"==typeof e[c]&&this.loadJSONVariables(e[c],t,n,s,i,a,l);return e}loadContextVariable(e,t={},n,s=!0,i={},a=!0,l={sanitize:!0,convertHTMLEntities:!0,fixParagraphTags:!0,updateOnPushOnly:!1,compareInputsByValue:!1,compareOutputsByValue:!1,compareByValueDepth:5,triggerDOMEvents:!1,ignoreInputAliases:!1,ignoreOutputAliases:!1,acceptInputsForAnyProperty:!1,acceptOutputsForAnyObservable:!1,logOptions:{dev:!0,prod:!1,ssr:!1}}){try{const c=e.substring(7);if(""===c.trim())return t;const u=[],d=D(c,new RegExp(v.variablePathPartRegex,"gm"));for(const p of d){if(p[0].startsWith(".")&&u.push({type:"property",value:p[0].substring(1)}),p[0].startsWith("[")&&p[0].endsWith("]")){let h=p[0].substring(1,p[0].length-1);h=this.decodeDataTypeString(h),h=this.evaluate(h,t,n,s,i,a),u.push({type:"property",value:h})}if(p[0].startsWith("(")&&p[0].endsWith(")")){if(!a)throw Error("Tried to call a function in a context variable. This has been disallowed in the current config.");const h=p[0].substring(1,p[0].length-1),f=[];if(""!==h)for(const m of h.split(",")){let O=this.decodeDataTypeString(m);O=this.evaluate(O,t,n,s,i,a),f.push(O)}u.push({type:"function",value:f})}}try{const p=this.fetchContextVariable(t,u);return i[this.decodeDataTypeString(e)]=p,p}catch{throw Error('The required context variable "'+this.decodeDataTypeString(e)+'" could not be found in the context object. Returning undefined instead.')}}catch(c){return this.logger.warn([c],l),void(i[this.decodeDataTypeString(e)]=void 0)}}fetchContextVariable(e,t){if("__proto__"===t[0].value)throw Error("Accessing the __proto__ property through a context variable is not allowed.");if("prototype"===t[0].value)throw Error("Accessing the prototype property through a context variable is not allowed.");if("constructor"===t[0].value)throw Error("Accessing the constructor property through a context variable is not allowed.");if(void 0===e)throw Error("Context variable path could not be resolved. Trying to access "+("property"===t[0].type?'property "'+t[0].value+'" of undefined.':"undefined function."));let n;return"property"===t[0].type?e.hasOwnProperty(t[0].value)?(n=e[t[0].value],"function"==typeof n&&(n=n.bind(e))):e.__proto__.hasOwnProperty(t[0].value)?(n=e.__proto__[t[0].value],"function"==typeof n&&(n=n.bind(e))):n=void 0:"function"===t[0].type&&(n=e(...t[0].value)),t.shift(),t.length>0&&(n=this.fetchContextVariable(n,t)),n}static{this.\u0275fac=function(t){return new(t||o)(g.KVO(Bt),g.KVO(W))}}static{this.\u0275prov=g.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})(),Pt=(()=>{class o{constructor(e,t){this.dataTypeParser=e,this.logger=t}checkInputBindings(e,t,n,s){for(const[i,a]of Object.entries(e))if(n.parseInputs)if(a.parsed)this.updateInputBindingIfStale(a,t,n);else try{a.value=this.dataTypeParser.evaluate(a.raw,n.allowContextInBindings?t:{},void 0,n.unescapeStrings,a.boundContextVariables,n.allowContextFunctionCalls,s),a.parsed=!0}catch(l){this.logger.error(["Hook input parsing error\nselector: "+n.selector+"\ninput: "+i+'\nvalue: "'+a.value+'"'],s),this.logger.error([l.stack],s),delete e[i]}else a.value=a.raw}updateInputBindingIfStale(e,t,n){if(Object.keys(e.boundContextVariables).length>0){let s=!1;for(const[i,a]of Object.entries(e.boundContextVariables)){const l=this.dataTypeParser.encodeDataTypeString(i);if(this.dataTypeParser.loadContextVariable(l,t,void 0,n.unescapeStrings,{},n.allowContextFunctionCalls)!==a){s=!0;break}}s&&(e.boundContextVariables={},e.value=this.dataTypeParser.evaluate(e.raw,n.allowContextInBindings?t:{},void 0,n.unescapeStrings,e.boundContextVariables,n.allowContextFunctionCalls))}}checkOutputBindings(e,t,n){for(const[s,i]of Object.entries(e))i.parsed||(i.value=(a,l)=>{try{this.dataTypeParser.evaluate(i.raw,t.allowContextInBindings?l:{},a,t.unescapeStrings,i.boundContextVariables,t.allowContextFunctionCalls)}catch(c){this.logger.error(["Hook output parsing error\nselector: "+t.selector+"\noutput: "+s+'\nvalue: "'+i.value+'"'],n),this.logger.error([c.stack],n)}},i.parsed=!0)}static{this.\u0275fac=function(t){return new(t||o)(g.KVO(At),g.KVO(W))}}static{this.\u0275prov=g.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})(),Nt=(()=>{class o{constructor(e,t,n,s,i,a){this.injector=e,this.parserResolver=t,this.platformService=n,this.tagHookFinder=s,this.bindingsValueManager=i,this.logger=a}resolve(e,t,n,s,i){const a=[];for(const u of e){const d=this.resolveEntry(u,t,i);d&&a.push(d)}const l=this.validateParserFunctions(a,i);if(this.checkParserNames(l,i),!n&&!s)return l;this.checkBlackAndWhitelist(l,n,s,i);const c=[];for(const u of l)u.hasOwnProperty("name")&&"string"==typeof u.name&&(n&&n.includes(u.name)||s&&!s.includes(u.name))||c.push(u);return c}resolveEntry(e,t,n){if(e.hasOwnProperty("prototype")){if((0,T.HJs)(e))return this.createSelectorHookParser({component:e});try{return t.get(e)}catch{return new e}}else if("object"==typeof e){if("Object"!==e.constructor.name)return e;try{return this.createSelectorHookParser(e)}catch(s){return this.logger.error(["Invalid parser config - "+s.message,e],n),null}}return this.logger.error(["Invalid parser config - ",e],n),null}createSelectorHookParser(e){return e.hasOwnProperty("parseWithRegex")&&e.parseWithRegex||e.hasOwnProperty("enclosing")&&!e.enclosing||e.hasOwnProperty("bracketStyle")&&e.bracketStyle?new St(e,this.parserResolver,this.tagHookFinder,this.bindingsValueManager):new It(e,this.parserResolver,this.platformService,this.bindingsValueManager)}validateParserFunctions(e,t){const n=[];for(const s of e)"function"==typeof s.findHooks||"function"==typeof s.findHookElements?"function"==typeof s.loadComponent?"function"==typeof s.getBindings?n.push(s):this.logger.error(['Submitted parser does not implement "getBindings()". Removing from list of active parsers:',s],t):this.logger.error(['Submitted parser does not implement "loadComponent()". Removing from list of active parsers:',s],t):this.logger.error(['Submitted parser neither implements "findHooks()" nor "findHookElements()". One is required. Removing from list of active parsers:',s],t);return n}checkParserNames(e,t){const n=e.map(a=>a.name).filter(a=>void 0!==a),s=[],i=[];for(const a of n)s.includes(a)&&!i.includes(a)&&(this.logger.warn(['Parser name "'+a+'" is not unique and appears multiple times in the list of active parsers.'],t),i.push(a)),s.push(a)}checkBlackAndWhitelist(e,t,n,s){const i=e.map(a=>a.name).filter(a=>void 0!==a);if(t)for(const a of t)i.includes(a)||this.logger.warn(['Blacklisted parser name "'+a+'" does not appear in the list of global parsers names. Make sure both spellings are identical.'],s);if(n)for(const a of n)i.includes(a)||this.logger.warn(['Whitelisted parser name "'+a+'" does not appear in the list of global parsers names. Make sure both spellings are identical.'],s)}static{this.\u0275fac=function(t){return new(t||o)(g.KVO(g.zZn),g.KVO(Et),g.KVO(J),g.KVO(Ot),g.KVO(Pt),g.KVO(W))}}static{this.\u0275prov=g.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})(),Dt=(()=>{class o{constructor(e){this.parserEntryResolver=e}resolve(e,t,n,s,i,a=null,l=null,c=null,u=null){let d={};n=n||[],s=s||[];const p={options:{sanitize:!0,convertHTMLEntities:!0,fixParagraphTags:!0,updateOnPushOnly:!1,compareInputsByValue:!1,compareOutputsByValue:!1,compareByValueDepth:5,triggerDOMEvents:!1,ignoreInputAliases:!1,ignoreOutputAliases:!1,acceptInputsForAnyProperty:!1,acceptOutputsForAnyObservable:!1,logOptions:{dev:!0,prod:!1,ssr:!1}}};d=(i=i||{}).hasOwnProperty("inheritance")&&i.inheritance!==Se.Linear?this.mergeSettings(i.inheritance===Se.All?[p,...n,...s,{options:l||void 0}]:[p,i||{},{options:l||void 0}]):this.mergeSettings([p,...s,{parsers:a||void 0,options:l||void 0}]);const h=d.options;t&&"string"!=typeof t&&(h.sanitize=!1);let f=[];return a?f=this.parserEntryResolver.resolve(a,e,null,null,h):d.parsers&&(f=this.parserEntryResolver.resolve(d.parsers,e,c,u,h)),{parsers:f,options:h}}mergeSettings(e){const t={};for(const n of e){if(void 0!==n.parsers){void 0===t.parsers&&(t.parsers=[]);for(const s of n.parsers)t.parsers.includes(s)||t.parsers.push(s)}void 0!==n.options&&(void 0===t.options&&(t.options={}),t.options=this.recursiveAssign(t.options,n.options))}return t}recursiveAssign(e,t){if(Object(t)!==t)return t;Object(e)!==e&&(e={});for(const n in t)e[n]=this.recursiveAssign(e[n],t[n]);return e}static{this.\u0275fac=function(t){return new(t||o)(g.KVO(Nt))}}static{this.\u0275prov=g.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})();const qe="_ngx_dynamic_hooks_node_placeholder";let $t=(()=>{class o{constructor(e,t){this.platformService=e,this.logger=t}findInElement(e,t,n,s,i,a){for(const l of n)if("function"==typeof l.findHooks){this.checkElement(e,t,n,s,i,a);break}}checkElement(e,t,n,s,i,a,l={counter:0,nodes:{}}){let c=this.platformService.getChildNodes(e),u="";const d={};for(const f of c)if(this.platformService.isTextNode(f))u+=this.platformService.getTextContent(f);else{const m=l.counter++;u+=`${qe}__${m}__`,d[m]=f}const p=Object.keys(a).length,h=this.find(u,t,n,s,i,a);if(Object.keys(a).length>p&&(this.platformService.clearChildNodes(e),this.platformService.setInnerContent(e,h.content),c=this.platformService.getChildNodes(e),l.nodes={...l.nodes,...d}),Object.keys(l.nodes).length)for(const f of c)if(this.platformService.isTextNode(f)){let m=this.platformService.getTextContent(f);if(m){const O=D(m,new RegExp(`${qe}__(\\d*)__`,"g"));if(O.length){const R=[];let H=0;for(const X of O){const ne=m.substring(H,X.index),F=parseInt(X[1]);ne&&R.push(this.platformService.createTextNode(ne)),F&&l.nodes[F]&&(R.push(l.nodes[F]),delete l.nodes[F]),H=X.index+X[0].length}const pe=m.substring(H);pe&&R.push(this.platformService.createTextNode(pe));const te=this.platformService.getParentNode(f);for(const X of R)this.platformService.insertBefore(te,X,f);this.platformService.removeChild(te,f),c=this.platformService.getChildNodes(te)}}}for(const f of c)f.nodeType!==Node.TEXT_NODE&&this.checkElement(f,t,n,s,i,a,l)}find(e,t,n,s,i,a){if(""===e)return{content:e,hookIndex:a};i.convertHTMLEntities&&(e=this.convertHTMLEntities(e));let l=[];for(const u of n)if("function"==typeof u.findHooks)for(const d of u.findHooks(e,t,i))l.push({parser:u,hookPosition:d});l.sort((u,d)=>u.hookPosition.openingTagStartIndex-d.hookPosition.openingTagStartIndex),l=this.validateHookPositions(l,e,i);const c=[];for(const u of l){const d=Object.keys(a).length+1,p=this.getHookSegments(u.hookPosition,e);if(c.push({startIndex:u.hookPosition.openingTagStartIndex,endIndex:u.hookPosition.openingTagEndIndex,replacement:`<${we} ${A}="${d}" ${M}="${s}">`}),c.push({startIndex:p.enclosing?u.hookPosition.closingTagStartIndex:u.hookPosition.openingTagEndIndex,endIndex:p.enclosing?u.hookPosition.closingTagEndIndex:u.hookPosition.openingTagEndIndex,replacement:`</${we}>`}),a[d]={id:d,parser:u.parser,value:{openingTag:p.openingTag,closingTag:p.closingTag,element:null,elementSnapshot:null},data:null,isLazy:!1,bindings:null,previousBindings:null,componentRef:null,dirtyInputs:new Set,outputSubscriptions:{},htmlEventSubscriptions:{}},p.enclosing&&i.fixParagraphTags){const h=this.removeTagArtifacts(p.textBefore,"<p>","</p>",p.innerValue,"</p>","<p>");p.textBefore=h.firstText,p.innerValue=h.secondText;const f=this.removeTagArtifacts(p.innerValue,"<p>","</p>",p.textAfter,"</p>","<p>");p.innerValue=f.firstText,p.textAfter=f.secondText,e=p.textBefore+p.openingTag+p.innerValue+p.closingTag+p.textAfter}}c.sort((u,d)=>{let p=d.startIndex-u.startIndex;return 0===p&&(p=d.endIndex-u.endIndex),p});for(const u of c){const d=e.substring(0,u.startIndex),p=e.substring(u.endIndex);e=d+u.replacement+p}return{content:e,hookIndex:a}}getHookSegments(e,t){const n=Number.isInteger(e.closingTagStartIndex)&&Number.isInteger(e.closingTagEndIndex);return{enclosing:n,textBefore:t.substring(0,e.openingTagStartIndex),openingTag:t.substring(e.openingTagStartIndex,e.openingTagEndIndex),innerValue:n?t.substring(e.openingTagEndIndex,e.closingTagStartIndex):null,closingTag:n?t.substring(e.closingTagStartIndex,e.closingTagEndIndex):null,textAfter:t.substring(n?e.closingTagEndIndex:e.openingTagEndIndex)}}validateHookPositions(e,t,n){const s=[];e:for(const[i,a]of e.entries()){const l=Number.isInteger(a.hookPosition.closingTagStartIndex)&&Number.isInteger(a.hookPosition.closingTagEndIndex),c=a.hookPosition;if(c.openingTagStartIndex>=c.openingTagEndIndex){this.logger.warn(["Text hook error: openingTagEndIndex has to be greater than openingTagStartIndex. Ignoring.",c],n);continue}if(l&&c.openingTagEndIndex>c.closingTagStartIndex){this.logger.warn(["Text hook error: closingTagStartIndex has to be greater than openingTagEndIndex. Ignoring.",c],n);continue}if(l&&c.closingTagStartIndex>=c.closingTagEndIndex){this.logger.warn(["Text hook error: closingTagEndIndex has to be greater than closingTagStartIndex. Ignoring.",c],n);continue}const u=e.slice(0,i);for(const d of u){const p=d.hookPosition,h=Number.isInteger(p.closingTagStartIndex)&&Number.isInteger(p.closingTagEndIndex);if(c.openingTagStartIndex===p.openingTagStartIndex&&c.openingTagEndIndex===p.openingTagEndIndex&&(!l||!h||c.closingTagStartIndex===p.closingTagStartIndex&&c.closingTagEndIndex===p.closingTagEndIndex)){this.generateHookPosWarning("A text hook with the same position as another text hook was found. There may be multiple parsers looking for the same text pattern. Ignoring duplicates.",c,p,t,n);continue e}if(c.openingTagStartIndex<p.openingTagEndIndex){this.generateHookPosWarning("Text hook error: Hook opening tag starts before previous hook opening tag ends. Ignoring.",c,p,t,n);continue e}if(h&&!(c.openingTagEndIndex<=p.closingTagStartIndex||c.openingTagStartIndex>=p.closingTagEndIndex)){this.generateHookPosWarning("Text hook error: Opening tag of hook overlaps with closing tag of previous hook. Ignoring.",c,p,t,n);continue e}if(h&&l&&!(c.closingTagEndIndex<=p.closingTagStartIndex||c.closingTagStartIndex>=p.closingTagEndIndex)){this.generateHookPosWarning("Text hook error: Closing tag of hook overlaps with closing tag of previous hook. Ignoring.",c,p,t,n);continue e}if(l&&h&&c.openingTagEndIndex<=p.closingTagStartIndex&&c.closingTagStartIndex>=p.closingTagEndIndex){this.generateHookPosWarning("Text hook error: The closing tag of a nested hook lies beyond the closing tag of the outer hook. Ignoring.",c,p,t,n);continue e}}s.push(a)}return s}generateHookPosWarning(e,t,n,s,i){const a=this.getHookSegments(n,s),l=this.getHookSegments(t,s);this.logger.warn([e+"\nFirst hook: ",{openingTag:a.openingTag,openingTagStartIndex:n.openingTagStartIndex,openingTagEndIndex:n.openingTagEndIndex,closingTag:a.closingTag,closingTagStartIndex:n.closingTagStartIndex,closingTagEndIndex:n.closingTagEndIndex},"\nSecond hook:",{openingTag:l.openingTag,openingTagStartIndex:t.openingTagStartIndex,openingTagEndIndex:t.openingTagEndIndex,closingTag:l.closingTag,closingTagStartIndex:t.closingTagStartIndex,closingTagEndIndex:t.closingTagEndIndex}],i)}removeTagArtifacts(e,t,n,s,i,a){let l=!1,c=!1;const u=e.lastIndexOf(t),d=e.lastIndexOf(n);(u>=0&&-1===d||u>d)&&(l=!0);const p=s.indexOf(i),h=s.indexOf(a);return(p>=0&&-1===h||p<h)&&(c=!0),l&&c&&(e=e.substring(0,u)+" ".repeat(t.length)+e.substring(u+t.length),s=s.substring(0,p)+" ".repeat(i.length)+s.substring(p+i.length)),{firstText:e,secondText:s}}convertHTMLEntities(e){const t=this.platformService.createElement("div");return e.replace(/&[#A-Za-z0-9]+;/gi,s=>" "===s?" ":(this.platformService.setInnerContent(t,s),this.platformService.getTextContent(t)))}static{this.\u0275fac=function(t){return new(t||o)(g.KVO(J),g.KVO(W))}}static{this.\u0275prov=g.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})(),Mt=(()=>{class o{constructor(e,t){this.platformService=e,this.logger=t}find(e,t,n,s,i,a){let l=[];for(const c of n)if("function"==typeof c.findHookElements)for(const u of c.findHookElements(e,t,i))l.push({parser:c,hookElement:u});l=function wt(o,r,e){return[...o].sort(function(n,s){return"function"==typeof e&&(n=e(n),s=e(s)),r(n,s)})}(l,this.platformService.sortElements.bind(this.platformService),c=>c.hookElement),l=this.validateHookElements(l,e,i);for(const c of l){const u=Object.keys(a).length+1;a[u]={id:u,parser:c.parser,value:{openingTag:this.platformService.getOpeningTag(c.hookElement),closingTag:this.platformService.getClosingTag(c.hookElement),element:c.hookElement,elementSnapshot:this.platformService.cloneElement(c.hookElement)},data:null,isLazy:!1,bindings:null,previousBindings:null,componentRef:null,dirtyInputs:new Set,outputSubscriptions:{},htmlEventSubscriptions:{}},this.platformService.setAttribute(c.hookElement,A,u.toString()),this.platformService.setAttribute(c.hookElement,M,s)}return a}validateHookElements(e,t,n){const s=[];for(const[i,a]of e.entries())s.slice(0,i).findIndex(u=>u.hookElement===a.hookElement)>=0||this.platformService.getAttributeNames(a.hookElement).includes(A)||this.platformService.getAttributeNames(a.hookElement).includes(M)?this.logger.warn(["An element hook tried to use an element that was found by another hook before. There may be multiple parsers looking for the same elements. Ignoring duplicates.",a.hookElement],n):Te(a.hookElement)||s.push(a);return s}static{this.\u0275fac=function(t){return new(t||o)(g.KVO(J),g.KVO(W))}}static{this.\u0275prov=g.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})();const Ee="dynamic-hooks-sanitization-placeholder",zt=new RegExp(`</?${Ee}.*?>`,"g");let Vt=(()=>{class o{constructor(e){this.platformService=e,this.attrWhitelist=[A,M,"class","href","src"]}sanitize(e,t,n){const s={};for(const c of Object.values(t)){const u=this.platformService.querySelectorAll(e,`[${A}="${c.id}"][${M}="${n}"]`)?.[0];if(u){s[c.id]=u;const d=this.platformService.getParentNode(u),p=this.platformService.getChildNodes(u),h=this.platformService.createElement(Ee);this.platformService.setAttribute(h,A,c.id.toString()),this.platformService.setAttribute(h,M,n),this.platformService.insertBefore(d,h,u),this.platformService.removeChild(d,u);for(const f of p)this.platformService.appendChild(h,f)}}let i=this.platformService.getInnerContent(e);i=this.findAndEncodeTags(i,zt);const a=console.warn;console.warn=()=>{};let l=this.platformService.sanitize(i);console.warn=a,l=this.decodeTagString(l),e.innerHTML=l||"";for(const[c,u]of Object.entries(s)){const d=this.platformService.querySelectorAll(e,`${Ee}[${A}="${c}"]`)?.[0];if(d){const p=this.platformService.getParentNode(d),h=this.platformService.getChildNodes(d);this.platformService.insertBefore(p,u,d),this.platformService.removeChild(p,d);for(const f of h)this.platformService.appendChild(u,f);this.sanitizeElementAttrs(u)}}return e}sanitizeElementAttrs(e){const t=this.platformService.getAttributeNames(e),n=this.platformService.createElement("div"),s=this.platformService.createElement("span");this.platformService.appendChild(n,s);for(const l of t){try{this.platformService.setAttribute(s,l,this.platformService.getAttribute(e,l))}catch{}try{l!==A&&l!==M&&this.platformService.removeAttribute(e,l)}catch{}}n.innerHTML=this.platformService.sanitize(this.platformService.getInnerContent(n));const i=this.platformService.querySelectorAll(n,"span")[0],a=this.platformService.getAttributeNames(i);for(const l of a)try{this.platformService.setAttribute(e,l,this.platformService.getAttribute(i,l))}catch{}return e}findAndEncodeTags(e,t){let n=e;const s=D(e,t);s.sort((i,a)=>a.index-i.index);for(const i of s){const a=i.index,l=i.index+i[0].length,c=n.substring(0,a),u=this.encodeTagString(n.substring(a,l)),d=n.substring(l);n=c+u+d}return n}encodeTagString(e){return(e=(e=e.replace(/</g,"@@@hook-lt@@@")).replace(/>/g,"@@@hook-gt@@@")).replace(/"/g,"@@@hook-dq@@@")}decodeTagString(e){return(e=(e=e.replace(/@@@hook-lt@@@/g,"<")).replace(/@@@hook-gt@@@/g,">")).replace(/@@@hook-dq@@@/g,'"')}static{this.\u0275fac=function(t){return new(t||o)(g.KVO(J))}}static{this.\u0275prov=g.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})(),Ht=(()=>{class o{constructor(e){this.logger=e}isEqual(e,t,n,s={sanitize:!0,convertHTMLEntities:!0,fixParagraphTags:!0,updateOnPushOnly:!1,compareInputsByValue:!1,compareOutputsByValue:!1,compareByValueDepth:5,triggerDOMEvents:!1,ignoreInputAliases:!1,ignoreOutputAliases:!1,acceptInputsForAnyProperty:!1,acceptOutputsForAnyObservable:!1,logOptions:{dev:!0,prod:!1,ssr:!1}}){const i=this.detailedStringify(e,n),a=this.detailedStringify(t,n);return null===i.result||null===a.result?(this.logger.warn(["Objects could not be compared by value as one or both of them could not be stringified. Returning false. \n","Objects:",e,t],s),!1):i.result===a.result}detailedStringify(e,t){try{const n={count:0},s=this.decycle(e,[],t,n);return{result:JSON.stringify(s,(a,l)=>void 0===l?"undefined":"function"==typeof l||"symbol"==typeof l?l.toString():l),depthReachedCount:n.count}}catch{return{result:null,depthReachedCount:0}}}decycle(e,t=[],n=5,s){if(t.length>n)return s.count++,null;if(!e||"object"!=typeof e||e instanceof Date)return e;for(const a of t)if(this.objEqualsProperties(e,a))return null;const i=t.concat([e]);if(Array.isArray(e)){const a=[];for(const l of e)a.push(this.decycle(l,i,n,s));return a}{const a={};for(const l of Object.keys(e))a[l]=this.decycle(e[l],i,n,s);return a}}objEqualsProperties(e,t){const n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;for(const i of n)if(e[i]!==t[i])return!1;return!0}static{this.\u0275fac=function(t){return new(t||o)(g.KVO(W))}}static{this.\u0275prov=g.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})(),Ue=(()=>{class o{constructor(e,t){this.deepComparer=e,this.logger=t}refresh(e,t,n,s){for(const[i,a]of Object.entries(e))this.updateBindings(a,t,n);if(s)for(const i of Object.values(e)){if(!i.componentRef)return;"function"==typeof i.componentRef.instance.onDynamicChanges&&i.componentRef.instance.onDynamicChanges({context:t})}}updateBindings(e,t,n){e.componentRef&&(e.bindings=e.parser.getBindings(e.id,e.value,t,n),this.updateComponentWithNewInputs(e,n),this.updateComponentWithNewOutputs(e,t,n),e.previousBindings={inputs:this.savePreviousBindings(e,"inputs",n.compareInputsByValue,n.compareByValueDepth),outputs:this.savePreviousBindings(e,"outputs",n.compareOutputsByValue,n.compareByValueDepth)})}savePreviousBindings(e,t,n,s){const i={};if(e.bindings.hasOwnProperty(t))for(const[a,l]of Object.entries(e.bindings[t]))i[a]={reference:l,stringified:n?this.deepComparer.detailedStringify(l,s):null};return i}updateComponentWithNewInputs(e,t){const n=e.componentRef.instance,s=this.getChangedBindings(e,"inputs",t),i=[],a=(0,T.HJs)(e.componentRef.componentType);for(const[l,c]of Object.entries(s)){const u=t.ignoreInputAliases?"propName":"templateName",d=a.inputs.find(p=>l===p[u])||a.inputs.find(p=>l.toLowerCase()===p[u].toLowerCase())||a.inputs.find(p=>l.replace(/-/g,"")===p[u])||a.inputs.find(p=>l.replace(/-/g,"").toLowerCase()===p[u].toLowerCase());if(d)i.push({propName:d.propName,templateName:d.templateName,value:c});else if(t.acceptInputsForAnyProperty){const h=Object.getOwnPropertyNames(n).find(f=>l===f)||Object.getOwnPropertyNames(n).find(f=>l.toLowerCase()===f.toLowerCase())||l;if(["__proto__","prototype","constructor"].includes(h)){this.logger.error(['Tried to overwrite a __proto__, prototype or constructor property with input "'+h+'" for hook "'+e.componentRef.componentType.name+'". This is not allowed.'],t);continue}i.push({propName:h,templateName:null,value:c})}}for(const{propName:l,templateName:c,value:u}of i)c?e.componentRef?.setInput(c,u):l&&(e.componentRef.instance[l]=u);i.length&&e.componentRef?.changeDetectorRef.detectChanges()}updateComponentWithNewOutputs(e,t,n){const s=e.componentRef.instance,i=this.getChangedBindings(e,"outputs",n),a=[],l=(0,T.HJs)(e.componentRef.componentType);for(const[c,u]of Object.entries(i)){const d=n.ignoreOutputAliases?"propName":"templateName",p=l.outputs.find(h=>c===h[d])||l.outputs.find(h=>c.toLowerCase()===h[d].toLowerCase())||l.outputs.find(h=>c.replace(/-/g,"")===h[d])||l.outputs.find(h=>c.replace(/-/g,"").toLowerCase()===h[d].toLowerCase());if(p)a.push({propName:p.propName,templateName:p.templateName,value:u});else if(n.acceptOutputsForAnyObservable){let h=Object.getOwnPropertyNames(s).find(f=>s[f]instanceof L.c&&c===f)||Object.getOwnPropertyNames(s).find(f=>s[f]instanceof L.c&&c.toLowerCase()===f.toLowerCase());h&&a.push({propName:h,templateName:null,value:u})}}for(const{propName:c,value:d}of a)e.outputSubscriptions[c]&&e.outputSubscriptions[c].unsubscribe(),e.outputSubscriptions[c]=e.componentRef.instance[c].subscribe(p=>{d(p,t)})}getChangedBindings(e,t,n){const s={};if(e.bindings.hasOwnProperty(t))for(const[i,a]of Object.entries(e.bindings[t]))if(e.previousBindings&&e.previousBindings[t].hasOwnProperty(i))if("inputs"===t?n.compareInputsByValue:n.compareOutputsByValue){const l=this.deepComparer.detailedStringify(a,n.compareByValueDepth);this.checkDetailedStringifyResultPair(i,e.componentRef.componentType.name,n,e.previousBindings[t][i].stringified,l)?l.result!==e.previousBindings[t][i].stringified.result&&(s[i]=a):a!==e.previousBindings[t][i].reference&&(s[i]=a)}else a!==e.previousBindings[t][i].reference&&(s[i]=a);else s[i]=a;return s}checkDetailedStringifyResultPair(e,t,n,s,i){return null===s.result&&null===i.result?(this.logger.warn(['Could stringify neither new nor old value for hook binding "'+e+'" for component "'+t+'" to compare by value. Defaulting to comparison by reference instead.'],n),!1):null===s.result?(this.logger.warn(['Could not stringify old value for hook binding "'+e+'" for component "'+t+'" to compare by value. Defaulting to comparison by reference instead.'],n),!1):null===i.result?(this.logger.warn(['Could not stringify new value for hook binding "'+e+'" for component "'+t+'" to compare by value. Defaulting to comparison by reference instead.'],n),!1):(s.depthReachedCount>0&&i.depthReachedCount>0?this.logger.warn(["Maximum compareByValueDepth of "+n.compareByValueDepth+" reached "+i.depthReachedCount+" time(s) for new value and "+s.depthReachedCount+' time(s) for old value while comparing binding "'+e+'" for component "'+t+".\n","If this impacts performance, consider simplifying this binding, reducing comparison depth or setting compareInputsByValue/compareOutputsByValue to false."],n):s.depthReachedCount>0?this.logger.warn(["Maximum compareByValueDepth of "+n.compareByValueDepth+" reached "+s.depthReachedCount+' time(s) for old value while comparing binding "'+e+'" for component "'+t+".\n","If this impacts performance, consider simplifying this binding, reducing comparison depth or setting compareInputsByValue/compareOutputsByValue to false."],n):i.depthReachedCount>0&&this.logger.warn(["Maximum compareByValueDepth of "+n.compareByValueDepth+" reached "+i.depthReachedCount+' time(s) for new value while comparing binding "'+e+'" for component "'+t+".\n","If this impacts performance, consider simplifying this binding, reducing comparison depth or setting compareInputsByValue/compareOutputsByValue to false."],n),!0)}static{this.\u0275fac=function(t){return new(t||o)(g.KVO(Ht),g.KVO(W))}}static{this.\u0275prov=g.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})(),jt=(()=>{class o{constructor(e,t,n,s,i){this.platformId=e,this.appRef=t,this.componentUpdater=n,this.platformService=s,this.logger=i}init(e,t,n,s,i,a,l){const c=new j.m(1),u=[],d={};if(0===Object.keys(t).length)return c.next(!0),c;for(let h of this.platformService.querySelectorAll(e,`[${A}][${M}]`)){const f=parseInt(this.platformService.getAttribute(h,A));if(0===this.platformService.querySelectorAll(e,`[${A}="${f}"][${M}="${n}"]`).length){delete t[f];continue}const m=t[f];m.data=m.parser.loadComponent(m.id,m.value,s,this.platformService.getChildNodes(h),i),m.isLazy=m.data.component.hasOwnProperty("importPromise")&&m.data.component.hasOwnProperty("importName"),(0,de.UE)(this.platformId)||!m.isLazy?(!m.data.hostElementTag&&xt.includes(this.platformService.getTagName(h).toLowerCase())&&(m.data.hostElementTag=we),m.data.hostElementTag&&(h=this.useCustomHostElement(h,m.data.hostElementTag),m.value.element=h),this.createContentSlotElements(h,m,n),d[f]=h):delete t[f]}const p=Object.keys(d).map(h=>parseInt(h));for(const[h,f]of Object.entries(t))p.includes(parseInt(h))||(this.logger.warn(["Error when trying to load components - The anchor element for the following hook was found initially, but could not be found again for loading the component. Ignoring.",f],i),delete t[h]);for(const[h,f]of Object.entries(d)){const m=t[h];u.push((0,E.of)(!0).pipe((0,z.Z)(()=>this.loadComponentClass(m.data.component))).pipe((0,U.M)(O=>{const R=this.extractContentSlotElements(f,n);this.createComponent(m,s,f,R,i,O,a,l)})).pipe((0,b.W)(O=>(this.logger.error([O.stack],i),delete t[m.id],(0,E.of)(null)))))}return 0===u.length?(c.next(!0),c):((0,C.z)([...u]).pipe(je()).subscribe(()=>{for(const h of Object.values(t)){const f=[];("function"==typeof h.componentRef.instance.onDynamicMount||"function"==typeof h.componentRef.instance.onDynamicChanges)&&this.findContentChildren(h.componentRef.location.nativeElement,f,t,n),"function"==typeof h.componentRef.instance.onDynamicChanges&&h.componentRef.instance.onDynamicChanges({contentChildren:f}),"function"==typeof h.componentRef.instance.onDynamicMount&&h.componentRef.instance.onDynamicMount({context:s,contentChildren:f})}for(const h of Object.values(d))this.platformService.removeAttribute(h,A),this.platformService.removeAttribute(h,M),this.platformService.removeAttribute(h,"ng-version");c.next(!0)}),c)}useCustomHostElement(e,t){const n=this.platformService.createElement(t);this.platformService.setAttribute(n,A,this.platformService.getAttribute(e,A)),this.platformService.setAttribute(n,M,this.platformService.getAttribute(e,M)),this.platformService.removeAttribute(e,A),this.platformService.removeAttribute(e,M);const s=this.platformService.getChildNodes(e);for(const i of s)this.platformService.appendChild(n,i);return this.platformService.insertBefore(this.platformService.getParentNode(e),n,e),this.platformService.removeChild(this.platformService.getParentNode(e),e),n}createContentSlotElements(e,t,n){let s;s=t.data.hasOwnProperty("content")&&Array.isArray(t.data.content)?t.data.content:[this.platformService.getChildNodes(e)],this.platformService.clearChildNodes(e);for(const[i,a]of s.entries())if(null!=a){const l=this.platformService.createElement("dynamic-component-contentslot");this.platformService.setAttribute(l,"slotIndex",i.toString()),this.platformService.setAttribute(l,"parsetoken",n);for(const c of a)this.platformService.appendChild(l,c);this.platformService.appendChild(e,l)}}extractContentSlotElements(e,t){const n=[],s=this.platformService.getChildNodes(e).filter(i=>"DYNAMIC-COMPONENT-CONTENTSLOT"===this.platformService.getTagName(i)&&this.platformService.getAttribute(i,"parsetoken")===t);for(const i of s){const a=this.platformService.getAttribute(i,"slotIndex");n[parseInt(a)]=this.platformService.getChildNodes(i)}return this.platformService.clearChildNodes(e),n}loadComponentClass(e){const t=new j.m(1);if(e.hasOwnProperty("prototype"))t.next(e);else if("function"==typeof e)e().then(n=>{t.next(n)});else{if(!e.hasOwnProperty("importPromise")||!e.hasOwnProperty("importName"))throw Error('The "component" property of a returned HookData object must either contain the component class, a function that returns a promise with the component class or an explicit LazyLoadComponentConfig');if(e.importPromise instanceof Promise)throw Error('When lazy-loading a component, the "importPromise"-field must contain a function returning the import-promise, but it contained the promise itself.');e.importPromise().then(n=>{const s=e.importName,i=Object.prototype.hasOwnProperty.call(n,s)?n[s]:n.default;t.next(i)})}return t}createComponent(e,t,n,s,i,a,l,c){const u=(0,T.a0P)(a,{hostElement:n,environmentInjector:e.data.environmentInjector||l,elementInjector:e.data.injector||c,projectableNodes:s});e.componentRef=u,this.mapOutputsToHTMLEvents(e,i),this.componentUpdater.updateBindings(e,t,i),"function"==typeof e.componentRef.instance.onDynamicChanges&&void 0!==t&&e.componentRef.instance.onDynamicChanges({context:t}),this.appRef.attachView(u.hostView),u.changeDetectorRef.detectChanges()}mapOutputsToHTMLEvents(e,t){const n=(0,T.HJs)(e.componentRef.componentType);for(const s of n.outputs){const i=t.ignoreOutputAliases?s.propName:s.templateName;e.htmlEventSubscriptions[i]=e.componentRef.instance[s.propName].subscribe(a=>{t.triggerDOMEvents&&this.platformService.dispatchEvent(e.componentRef?.location.nativeElement,i,a)})}}findContentChildren(e,t=[],n,s){const i=this.platformService.getChildNodes(e);null!=i&&i.length>0&&i.forEach((a,l)=>{let c=!1;const u=this.platformService.getAttribute(a,M);if(null!==u&&u===s&&this.platformService.getAttribute(a,A)){const p=parseInt(this.platformService.getAttribute(a,A),10);n.hasOwnProperty(p)&&(t.push({componentRef:n[p].componentRef,contentChildren:[],hookValue:n[p].value}),c=!0)}this.findContentChildren(a,c?t[t.length-1].contentChildren:t,n,s)})}static{this.\u0275fac=function(t){return new(t||o)(g.KVO(w.Agw),g.KVO(w.o8S),g.KVO(Ue),g.KVO(J),g.KVO(W))}}static{this.\u0275prov=g.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})(),Ze=(()=>{class o{constructor(e,t,n,s,i,a,l,c,u,d,p){this.allSettings=e,this.ancestorSettings=t,this.moduleSettings=n,this.settingsResolver=s,this.textHookFinder=i,this.elementHookFinder=a,this.contentSanitizer=l,this.componentCreator=c,this.platformService=u,this.environmentInjector=d,this.injector=p}parse(e=null,t=null,n=null,s=null,i=null,a=null,l=null,c={},u=null,d=null){const p=u||this.environmentInjector,h=d||this.injector,{parsers:f,options:m}=this.settingsResolver.resolve(h,e,this.allSettings,this.ancestorSettings,this.moduleSettings,t,s,i,a);if(!e)return(0,E.of)({element:l||this.platformService.createElement("div"),hookIndex:c,context:n,usedParsers:f,usedOptions:m,usedInjector:h,usedEnvironmentInjector:p,destroy:()=>this.destroy(c)});const O=Math.random().toString(36).substring(2,12);let R="string"==typeof e?this.platformService.createElement("div"):e;if(this.platformService.setAttribute(R,se,"1"),"string"==typeof e){const H=this.textHookFinder.find(e,n,f,O,m,c);this.platformService.setInnerContent(R,H.content)}else this.textHookFinder.findInElement(R,n,f,O,m,c);if(c=this.elementHookFinder.find(R,n,f,O,m,c),m?.sanitize&&this.contentSanitizer.sanitize(R,c,O),l&&l!==R){this.platformService.removeAttribute(R,se),this.platformService.setAttribute(l,se,"1"),this.platformService.clearChildNodes(l);for(const H of this.platformService.getChildNodes(R))this.platformService.appendChild(l,H);R=l}return this.componentCreator.init(R,c,O,n,m,p,h).pipe(je()).pipe((0,mt.T)(H=>(this.platformService.removeAttribute(R,se),{element:R,hookIndex:c,context:n,usedParsers:f,usedOptions:m,usedInjector:h,usedEnvironmentInjector:p,destroy:()=>this.destroy(c)})))}destroy(e){if(e){for(const t of Object.values(e))t.componentRef&&t.componentRef.destroy();for(const t of Object.values(e)){for(const n of Object.values(t.outputSubscriptions))n&&n.unsubscribe();for(const n of Object.values(t.htmlEventSubscriptions))n&&n.unsubscribe()}}}static{this.\u0275fac=function(t){return new(t||o)(g.KVO(Fe,8),g.KVO(xe,8),g.KVO(Le,8),g.KVO(Dt),g.KVO($t),g.KVO(Mt),g.KVO(Vt),g.KVO(jt),g.KVO(J),g.KVO(g.uvJ),g.KVO(g.zZn))}}static{this.\u0275prov=g.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})(),Ut=(()=>{class o{constructor(e,t,n,s,i,a){this.hostElement=e,this.dynamicHooksService=t,this.componentUpdater=n,this.platformService=s,this.environmentInjector=i,this.injector=a,this.content=null,this.context=null,this.globalParsersBlacklist=null,this.globalParsersWhitelist=null,this.parsers=null,this.options=null,this.componentsLoaded=new g.bkB,this.hookIndex={},this.activeOptions={sanitize:!0,convertHTMLEntities:!0,fixParagraphTags:!0,updateOnPushOnly:!1,compareInputsByValue:!1,compareOutputsByValue:!1,compareByValueDepth:5,triggerDOMEvents:!1,ignoreInputAliases:!1,ignoreOutputAliases:!1,acceptInputsForAnyProperty:!1,acceptOutputsForAnyObservable:!1,logOptions:{dev:!0,prod:!1,ssr:!1}},this.activeParsers=[],this.token=Math.random().toString(36).substring(2,12),this.initialized=!1}ngDoCheck(){this.activeOptions.updateOnPushOnly||this.refresh(!1)}ngOnChanges(e){e.hasOwnProperty("content")||e.hasOwnProperty("globalParsersBlacklist")||e.hasOwnProperty("globalParsersWhitelist")||e.hasOwnProperty("parsers")||e.hasOwnProperty("options")?(this.reset(),this.parse(this.content)):e.hasOwnProperty("context")&&this.refresh(!0)}ngAfterViewInit(){}ngAfterViewChecked(){}ngOnDestroy(){this.reset()}reset(){this.dynamicHooksService.destroy(this.hookIndex),this.platformService.setInnerContent(this.hostElement.nativeElement,""),this.hookIndex={},this.activeOptions={sanitize:!0,convertHTMLEntities:!0,fixParagraphTags:!0,updateOnPushOnly:!1,compareInputsByValue:!1,compareOutputsByValue:!1,compareByValueDepth:5,triggerDOMEvents:!1,ignoreInputAliases:!1,ignoreOutputAliases:!1,acceptInputsForAnyProperty:!1,acceptOutputsForAnyObservable:!1,logOptions:{dev:!0,prod:!1,ssr:!1}},this.activeParsers=[],this.initialized=!1}parse(e){this.dynamicHooksService.parse(e,this.parsers,this.context,this.options,this.globalParsersBlacklist,this.globalParsersWhitelist,this.hostElement.nativeElement,this.hookIndex,this.environmentInjector,this.injector).subscribe(t=>{this.activeParsers=t.usedParsers,this.activeOptions=t.usedOptions,this.initialized=!0;const n=Object.values(this.hookIndex).map(s=>({hookId:s.id,hookValue:s.value,hookParser:s.parser,componentRef:s.componentRef}));this.componentsLoaded.emit(n)})}refresh(e){this.initialized&&this.componentUpdater.refresh(this.hookIndex,this.context,this.activeOptions,e)}static{this.\u0275fac=function(t){return new(t||o)(w.rXU(w.aKT),w.rXU(Ze),w.rXU(Ue),w.rXU(J),w.rXU(g.uvJ),w.rXU(g.zZn))}}static{this.\u0275cmp=w.VBU({type:o,selectors:[["ngx-dynamic-hooks"]],inputs:{content:"content",context:"context",globalParsersBlacklist:"globalParsersBlacklist",globalParsersWhitelist:"globalParsersWhitelist",parsers:"parsers",options:"options"},outputs:{componentsLoaded:"componentsLoaded"},features:[w.OA$],decls:0,vars:0,template:function(t,n){},encapsulation:2})}}return o})();var Y={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function Ge(o){Y=o}var ie={exec:()=>null};function S(o,r=""){let e="string"==typeof o?o:o.source;const t={replace:(n,s)=>{let i="string"==typeof s?s:s.source;return i=i.replace($.caret,"$1"),e=e.replace(n,i),t},getRegex:()=>new RegExp(e,r)};return t}var $={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:o=>new RegExp(`^( {0,3}${o})((?:[\t ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:o=>new RegExp(`^ {0,${Math.min(3,o-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),hrRegex:o=>new RegExp(`^ {0,${Math.min(3,o-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:o=>new RegExp(`^ {0,${Math.min(3,o-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:o=>new RegExp(`^ {0,${Math.min(3,o-1)}}#`),htmlBeginRegex:o=>new RegExp(`^ {0,${Math.min(3,o-1)}}<(?:[a-z].*>|!--)`,"i")},ae=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Oe=/(?:[*+-]|\d{1,9}[.)])/,Qe=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Xe=S(Qe).replace(/bull/g,Oe).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Jt=S(Qe).replace(/bull/g,Oe).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Be=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Ae=/(?!\s*\])(?:\\.|[^\[\]\\])+/,en=S(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Ae).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),tn=S(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Oe).getRegex(),fe="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Pe=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,nn=S("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$))","i").replace("comment",Pe).replace("tag",fe).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Je=S(Be).replace("hr",ae).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",fe).getRegex(),Ne={blockquote:S(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Je).getRegex(),code:/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,def:en,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:ae,html:nn,lheading:Xe,list:tn,newline:/^(?:[ \t]*(?:\n|$))+/,paragraph:Je,table:ie,text:/^[^\n]+/},Ye=S("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ae).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3}\t)[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",fe).getRegex(),sn={...Ne,lheading:Jt,table:Ye,paragraph:S(Be).replace("hr",ae).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Ye).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",fe).getRegex()},on={...Ne,html:S("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",Pe).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:ie,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:S(Be).replace("hr",ae).replace("heading"," *#{1,6} *[^\n]").replace("lheading",Xe).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},et=/^( {2,}|\\)\n(?!\s*$)/,me=/[\p{P}\p{S}]/u,De=/[\s\p{P}\p{S}]/u,tt=/[^\s\p{P}\p{S}]/u,un=S(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,De).getRegex(),nt=/(?!~)[\p{P}\p{S}]/u,rt=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,gn=S(rt,"u").replace(/punct/g,me).getRegex(),fn=S(rt,"u").replace(/punct/g,nt).getRegex(),st="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",mn=S(st,"gu").replace(/notPunctSpace/g,tt).replace(/punctSpace/g,De).replace(/punct/g,me).getRegex(),bn=S(st,"gu").replace(/notPunctSpace/g,/(?:[^\s\p{P}\p{S}]|~)/u).replace(/punctSpace/g,/(?!~)[\s\p{P}\p{S}]/u).replace(/punct/g,nt).getRegex(),yn=S("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,tt).replace(/punctSpace/g,De).replace(/punct/g,me).getRegex(),vn=S(/\\(punct)/,"gu").replace(/punct/g,me).getRegex(),kn=S(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),xn=S(Pe).replace("(?:--\x3e|$)","--\x3e").getRegex(),wn=S("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",xn).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),be=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Sn=S(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",be).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),ot=S(/^!?\[(label)\]\[(ref)\]/).replace("label",be).replace("ref",Ae).getRegex(),it=S(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ae).getRegex(),$e={_backpedal:ie,anyPunctuation:vn,autolink:kn,blockSkip:/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,br:et,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:ie,emStrongLDelim:gn,emStrongRDelimAst:mn,emStrongRDelimUnd:yn,escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,link:Sn,nolink:it,punctuation:un,reflink:ot,reflinkSearch:S("reflink|nolink(?!\\()","g").replace("reflink",ot).replace("nolink",it).getRegex(),tag:wn,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:ie},Tn={...$e,link:S(/^!?\[(label)\]\((.*?)\)/).replace("label",be).getRegex(),reflink:S(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",be).getRegex()},Me={...$e,emStrongRDelimAst:bn,emStrongLDelim:fn,url:S(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},En={...Me,br:S(et).replace("{2,}","*").getRegex(),text:S(Me.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},ye={normal:Ne,gfm:sn,pedantic:on},le={normal:$e,gfm:Me,breaks:En,pedantic:Tn},Cn={"&":"&","<":"<",">":">",'"':""","'":"'"},at=o=>Cn[o];function _(o,r){if(r){if($.escapeTest.test(o))return o.replace($.escapeReplace,at)}else if($.escapeTestNoEncode.test(o))return o.replace($.escapeReplaceNoEncode,at);return o}function lt(o){try{o=encodeURI(o).replace($.percentDecode,"%")}catch{return null}return o}function ct(o,r){const t=o.replace($.findPipe,(s,i,a)=>{let l=!1,c=i;for(;--c>=0&&"\\"===a[c];)l=!l;return l?"|":" |"}).split($.splitPipe);let n=0;if(t[0].trim()||t.shift(),t.length>0&&!t.at(-1)?.trim()&&t.pop(),r)if(t.length>r)t.splice(r);else for(;t.length<r;)t.push("");for(;n<t.length;n++)t[n]=t[n].trim().replace($.slashPipe,"|");return t}function ce(o,r,e){const t=o.length;if(0===t)return"";let n=0;for(;n<t;){const s=o.charAt(t-n-1);if(s!==r||e){if(s===r||!e)break;n++}else n++}return o.slice(0,t-n)}function ut(o,r,e,t,n){const s=r.href,i=r.title||null,a=o[1].replace(n.other.outputLinkReplace,"$1");t.state.inLink=!0;const l={type:"!"===o[0].charAt(0)?"image":"link",raw:e,href:s,title:i,text:a,tokens:t.inlineTokens(a)};return t.state.inLink=!1,l}var ve=class{options;rules;lexer;constructor(o){this.options=o||Y}space(o){const r=this.rules.block.newline.exec(o);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(o){const r=this.rules.block.code.exec(o);if(r){const e=r[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?e:ce(e,"\n")}}}fences(o){const r=this.rules.block.fences.exec(o);if(r){const e=r[0],t=function On(o,r,e){const t=o.match(e.other.indentCodeCompensation);if(null===t)return r;const n=t[1];return r.split("\n").map(s=>{const i=s.match(e.other.beginningSpace);if(null===i)return s;const[a]=i;return a.length>=n.length?s.slice(n.length):s}).join("\n")}(e,r[3]||"",this.rules);return{type:"code",raw:e,lang:r[2]?r[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):r[2],text:t}}}heading(o){const r=this.rules.block.heading.exec(o);if(r){let e=r[2].trim();if(this.rules.other.endingHash.test(e)){const t=ce(e,"#");(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(o){const r=this.rules.block.hr.exec(o);if(r)return{type:"hr",raw:ce(r[0],"\n")}}blockquote(o){const r=this.rules.block.blockquote.exec(o);if(r){let e=ce(r[0],"\n").split("\n"),t="",n="";const s=[];for(;e.length>0;){let i=!1;const a=[];let l;for(l=0;l<e.length;l++)if(this.rules.other.blockquoteStart.test(e[l]))a.push(e[l]),i=!0;else{if(i)break;a.push(e[l])}e=e.slice(l);const c=a.join("\n"),u=c.replace(this.rules.other.blockquoteSetextReplace,"\n $1").replace(this.rules.other.blockquoteSetextReplace2,"");t=t?`${t}\n${c}`:c,n=n?`${n}\n${u}`:u;const d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(u,s,!0),this.lexer.state.top=d,0===e.length)break;const p=s.at(-1);if("code"===p?.type)break;if("blockquote"===p?.type){const h=p,f=h.raw+"\n"+e.join("\n"),m=this.blockquote(f);s[s.length-1]=m,t=t.substring(0,t.length-h.raw.length)+m.raw,n=n.substring(0,n.length-h.text.length)+m.text;break}if("list"===p?.type){const h=p,f=h.raw+"\n"+e.join("\n"),m=this.list(f);s[s.length-1]=m,t=t.substring(0,t.length-p.raw.length)+m.raw,n=n.substring(0,n.length-h.raw.length)+m.raw,e=f.substring(s.at(-1).raw.length).split("\n");continue}}return{type:"blockquote",raw:t,tokens:s,text:n}}}list(o){let r=this.rules.block.list.exec(o);if(r){let e=r[1].trim();const t=e.length>1,n={type:"list",raw:"",ordered:t,start:t?+e.slice(0,-1):"",loose:!1,items:[]};e=t?`\\d{1,9}\\${e.slice(-1)}`:`\\${e}`,this.options.pedantic&&(e=t?e:"[*+-]");const s=this.rules.other.listItemRegex(e);let i=!1;for(;o;){let l=!1,c="",u="";if(!(r=s.exec(o))||this.rules.block.hr.test(o))break;c=r[0],o=o.substring(c.length);let d=r[2].split("\n",1)[0].replace(this.rules.other.listReplaceTabs,R=>" ".repeat(3*R.length)),p=o.split("\n",1)[0],h=!d.trim(),f=0;if(this.options.pedantic?(f=2,u=d.trimStart()):h?f=r[1].length+1:(f=r[2].search(this.rules.other.nonSpaceChar),f=f>4?1:f,u=d.slice(f),f+=r[1].length),h&&this.rules.other.blankLine.test(p)&&(c+=p+"\n",o=o.substring(p.length+1),l=!0),!l){const R=this.rules.other.nextBulletRegex(f),H=this.rules.other.hrRegex(f),pe=this.rules.other.fencesBeginRegex(f),te=this.rules.other.headingBeginRegex(f),X=this.rules.other.htmlBeginRegex(f);for(;o;){const ne=o.split("\n",1)[0];let F;if(p=ne,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting," "),F=p):F=p.replace(this.rules.other.tabCharGlobal," "),pe.test(p)||te.test(p)||X.test(p)||R.test(p)||H.test(p))break;if(F.search(this.rules.other.nonSpaceChar)>=f||!p.trim())u+="\n"+F.slice(f);else{if(h||d.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||pe.test(d)||te.test(d)||H.test(d))break;u+="\n"+p}!h&&!p.trim()&&(h=!0),c+=ne+"\n",o=o.substring(ne.length+1),d=F.slice(f)}}n.loose||(i?n.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(i=!0));let O,m=null;this.options.gfm&&(m=this.rules.other.listIsTask.exec(u),m&&(O="[ ] "!==m[0],u=u.replace(this.rules.other.listReplaceTask,""))),n.items.push({type:"list_item",raw:c,task:!!m,checked:O,loose:!1,text:u,tokens:[]}),n.raw+=c}const a=n.items.at(-1);if(!a)return;a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd(),n.raw=n.raw.trimEnd();for(let l=0;l<n.items.length;l++)if(this.lexer.state.top=!1,n.items[l].tokens=this.lexer.blockTokens(n.items[l].text,[]),!n.loose){const c=n.items[l].tokens.filter(d=>"space"===d.type),u=c.length>0&&c.some(d=>this.rules.other.anyLine.test(d.raw));n.loose=u}if(n.loose)for(let l=0;l<n.items.length;l++)n.items[l].loose=!0;return n}}html(o){const r=this.rules.block.html.exec(o);if(r)return{type:"html",block:!0,raw:r[0],pre:"pre"===r[1]||"script"===r[1]||"style"===r[1],text:r[0]}}def(o){const r=this.rules.block.def.exec(o);if(r){const e=r[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),t=r[2]?r[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",n=r[3]?r[3].substring(1,r[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):r[3];return{type:"def",tag:e,raw:r[0],href:t,title:n}}}table(o){const r=this.rules.block.table.exec(o);if(!r||!this.rules.other.tableDelimiter.test(r[2]))return;const e=ct(r[1]),t=r[2].replace(this.rules.other.tableAlignChars,"").split("|"),n=r[3]?.trim()?r[3].replace(this.rules.other.tableRowBlankLine,"").split("\n"):[],s={type:"table",raw:r[0],header:[],align:[],rows:[]};if(e.length===t.length){for(const i of t)this.rules.other.tableAlignRight.test(i)?s.align.push("right"):this.rules.other.tableAlignCenter.test(i)?s.align.push("center"):this.rules.other.tableAlignLeft.test(i)?s.align.push("left"):s.align.push(null);for(let i=0;i<e.length;i++)s.header.push({text:e[i],tokens:this.lexer.inline(e[i]),header:!0,align:s.align[i]});for(const i of n)s.rows.push(ct(i,s.header.length).map((a,l)=>({text:a,tokens:this.lexer.inline(a),header:!1,align:s.align[l]})));return s}}lheading(o){const r=this.rules.block.lheading.exec(o);if(r)return{type:"heading",raw:r[0],depth:"="===r[2].charAt(0)?1:2,text:r[1],tokens:this.lexer.inline(r[1])}}paragraph(o){const r=this.rules.block.paragraph.exec(o);if(r){const e="\n"===r[1].charAt(r[1].length-1)?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:e,tokens:this.lexer.inline(e)}}}text(o){const r=this.rules.block.text.exec(o);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(o){const r=this.rules.inline.escape.exec(o);if(r)return{type:"escape",raw:r[0],text:r[1]}}tag(o){const r=this.rules.inline.tag.exec(o);if(r)return!this.lexer.state.inLink&&this.rules.other.startATag.test(r[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:r[0]}}link(o){const r=this.rules.inline.link.exec(o);if(r){const e=r[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;const s=ce(e.slice(0,-1),"\\");if((e.length-s.length)%2==0)return}else{const s=function Rn(o,r){if(-1===o.indexOf(r[1]))return-1;let e=0;for(let t=0;t<o.length;t++)if("\\"===o[t])t++;else if(o[t]===r[0])e++;else if(o[t]===r[1]&&(e--,e<0))return t;return e>0?-2:-1}(r[2],"()");if(-2===s)return;if(s>-1){const a=(0===r[0].indexOf("!")?5:4)+r[1].length+s;r[2]=r[2].substring(0,s),r[0]=r[0].substring(0,a).trim(),r[3]=""}}let t=r[2],n="";if(this.options.pedantic){const s=this.rules.other.pedanticHrefTitle.exec(t);s&&(t=s[1],n=s[3])}else n=r[3]?r[3].slice(1,-1):"";return t=t.trim(),this.rules.other.startAngleBracket.test(t)&&(t=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?t.slice(1):t.slice(1,-1)),ut(r,{href:t&&t.replace(this.rules.inline.anyPunctuation,"$1"),title:n&&n.replace(this.rules.inline.anyPunctuation,"$1")},r[0],this.lexer,this.rules)}}reflink(o,r){let e;if((e=this.rules.inline.reflink.exec(o))||(e=this.rules.inline.nolink.exec(o))){const n=r[(e[2]||e[1]).replace(this.rules.other.multipleSpaceGlobal," ").toLowerCase()];if(!n){const s=e[0].charAt(0);return{type:"text",raw:s,text:s}}return ut(e,n,e[0],this.lexer,this.rules)}}emStrong(o,r,e=""){let t=this.rules.inline.emStrongLDelim.exec(o);if(!(!t||t[3]&&e.match(this.rules.other.unicodeAlphaNumeric))&&(!t[1]&&!t[2]||!e||this.rules.inline.punctuation.exec(e))){const s=[...t[0]].length-1;let i,a,l=s,c=0;const u="*"===t[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,r=r.slice(-1*o.length+s);null!=(t=u.exec(r));){if(i=t[1]||t[2]||t[3]||t[4]||t[5]||t[6],!i)continue;if(a=[...i].length,t[3]||t[4]){l+=a;continue}if((t[5]||t[6])&&s%3&&!((s+a)%3)){c+=a;continue}if(l-=a,l>0)continue;a=Math.min(a,a+l+c);const d=[...t[0]][0].length,p=o.slice(0,s+t.index+d+a);if(Math.min(s,a)%2){const f=p.slice(1,-1);return{type:"em",raw:p,text:f,tokens:this.lexer.inlineTokens(f)}}const h=p.slice(2,-2);return{type:"strong",raw:p,text:h,tokens:this.lexer.inlineTokens(h)}}}}codespan(o){const r=this.rules.inline.code.exec(o);if(r){let e=r[2].replace(this.rules.other.newLineCharGlobal," ");const t=this.rules.other.nonSpaceChar.test(e),n=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return t&&n&&(e=e.substring(1,e.length-1)),{type:"codespan",raw:r[0],text:e}}}br(o){const r=this.rules.inline.br.exec(o);if(r)return{type:"br",raw:r[0]}}del(o){const r=this.rules.inline.del.exec(o);if(r)return{type:"del",raw:r[0],text:r[2],tokens:this.lexer.inlineTokens(r[2])}}autolink(o){const r=this.rules.inline.autolink.exec(o);if(r){let e,t;return"@"===r[2]?(e=r[1],t="mailto:"+e):(e=r[1],t=e),{type:"link",raw:r[0],text:e,href:t,tokens:[{type:"text",raw:e,text:e}]}}}url(o){let r;if(r=this.rules.inline.url.exec(o)){let e,t;if("@"===r[2])e=r[0],t="mailto:"+e;else{let n;do{n=r[0],r[0]=this.rules.inline._backpedal.exec(r[0])?.[0]??""}while(n!==r[0]);e=r[0],t="www."===r[1]?"http://"+r[0]:r[0]}return{type:"link",raw:r[0],text:e,href:t,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(o){const r=this.rules.inline.text.exec(o);if(r)return{type:"text",raw:r[0],text:r[0],escaped:this.lexer.state.inRawBlock}}},K=class Ve{tokens;options;state;tokenizer;inlineQueue;constructor(r){this.tokens=[],this.tokens.links=Object.create(null),this.options=r||Y,this.options.tokenizer=this.options.tokenizer||new ve,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const e={other:$,block:ye.normal,inline:le.normal};this.options.pedantic?(e.block=ye.pedantic,e.inline=le.pedantic):this.options.gfm&&(e.block=ye.gfm,e.inline=this.options.breaks?le.breaks:le.gfm),this.tokenizer.rules=e}static get rules(){return{block:ye,inline:le}}static lex(r,e){return new Ve(e).lex(r)}static lexInline(r,e){return new Ve(e).inlineTokens(r)}lex(r){r=r.replace($.carriageReturn,"\n"),this.blockTokens(r,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){const t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(r,e=[],t=!1){for(this.options.pedantic&&(r=r.replace($.tabCharGlobal," ").replace($.spaceLine,""));r;){let n;if(this.options.extensions?.block?.some(i=>!!(n=i.call({lexer:this},r,e))&&(r=r.substring(n.raw.length),e.push(n),!0)))continue;if(n=this.tokenizer.space(r)){r=r.substring(n.raw.length);const i=e.at(-1);1===n.raw.length&&void 0!==i?i.raw+="\n":e.push(n);continue}if(n=this.tokenizer.code(r)){r=r.substring(n.raw.length);const i=e.at(-1);"paragraph"===i?.type||"text"===i?.type?(i.raw+="\n"+n.raw,i.text+="\n"+n.text,this.inlineQueue.at(-1).src=i.text):e.push(n);continue}if(n=this.tokenizer.fences(r)){r=r.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.heading(r)){r=r.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.hr(r)){r=r.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.blockquote(r)){r=r.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.list(r)){r=r.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.html(r)){r=r.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.def(r)){r=r.substring(n.raw.length);const i=e.at(-1);"paragraph"===i?.type||"text"===i?.type?(i.raw+="\n"+n.raw,i.text+="\n"+n.raw,this.inlineQueue.at(-1).src=i.text):this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title});continue}if(n=this.tokenizer.table(r)){r=r.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.lheading(r)){r=r.substring(n.raw.length),e.push(n);continue}let s=r;if(this.options.extensions?.startBlock){let i=1/0;const a=r.slice(1);let l;this.options.extensions.startBlock.forEach(c=>{l=c.call({lexer:this},a),"number"==typeof l&&l>=0&&(i=Math.min(i,l))}),i<1/0&&i>=0&&(s=r.substring(0,i+1))}if(this.state.top&&(n=this.tokenizer.paragraph(s))){const i=e.at(-1);t&&"paragraph"===i?.type?(i.raw+="\n"+n.raw,i.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=i.text):e.push(n),t=s.length!==r.length,r=r.substring(n.raw.length);continue}if(n=this.tokenizer.text(r)){r=r.substring(n.raw.length);const i=e.at(-1);"text"===i?.type?(i.raw+="\n"+n.raw,i.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=i.text):e.push(n);continue}if(r){const i="Infinite loop on byte: "+r.charCodeAt(0);if(this.options.silent){console.error(i);break}throw new Error(i)}}return this.state.top=!0,e}inline(r,e=[]){return this.inlineQueue.push({src:r,tokens:e}),e}inlineTokens(r,e=[]){let t=r,n=null;if(this.tokens.links){const a=Object.keys(this.tokens.links);if(a.length>0)for(;null!=(n=this.tokenizer.rules.inline.reflinkSearch.exec(t));)a.includes(n[0].slice(n[0].lastIndexOf("[")+1,-1))&&(t=t.slice(0,n.index)+"["+"a".repeat(n[0].length-2)+"]"+t.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(n=this.tokenizer.rules.inline.anyPunctuation.exec(t));)t=t.slice(0,n.index)+"++"+t.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;null!=(n=this.tokenizer.rules.inline.blockSkip.exec(t));)t=t.slice(0,n.index)+"["+"a".repeat(n[0].length-2)+"]"+t.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let s=!1,i="";for(;r;){let a;if(s||(i=""),s=!1,this.options.extensions?.inline?.some(c=>!!(a=c.call({lexer:this},r,e))&&(r=r.substring(a.raw.length),e.push(a),!0)))continue;if(a=this.tokenizer.escape(r)){r=r.substring(a.raw.length),e.push(a);continue}if(a=this.tokenizer.tag(r)){r=r.substring(a.raw.length),e.push(a);continue}if(a=this.tokenizer.link(r)){r=r.substring(a.raw.length),e.push(a);continue}if(a=this.tokenizer.reflink(r,this.tokens.links)){r=r.substring(a.raw.length);const c=e.at(-1);"text"===a.type&&"text"===c?.type?(c.raw+=a.raw,c.text+=a.text):e.push(a);continue}if(a=this.tokenizer.emStrong(r,t,i)){r=r.substring(a.raw.length),e.push(a);continue}if(a=this.tokenizer.codespan(r)){r=r.substring(a.raw.length),e.push(a);continue}if(a=this.tokenizer.br(r)){r=r.substring(a.raw.length),e.push(a);continue}if(a=this.tokenizer.del(r)){r=r.substring(a.raw.length),e.push(a);continue}if(a=this.tokenizer.autolink(r)){r=r.substring(a.raw.length),e.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(r))){r=r.substring(a.raw.length),e.push(a);continue}let l=r;if(this.options.extensions?.startInline){let c=1/0;const u=r.slice(1);let d;this.options.extensions.startInline.forEach(p=>{d=p.call({lexer:this},u),"number"==typeof d&&d>=0&&(c=Math.min(c,d))}),c<1/0&&c>=0&&(l=r.substring(0,c+1))}if(a=this.tokenizer.inlineText(l)){r=r.substring(a.raw.length),"_"!==a.raw.slice(-1)&&(i=a.raw.slice(-1)),s=!0;const c=e.at(-1);"text"===c?.type?(c.raw+=a.raw,c.text+=a.text):e.push(a);continue}if(r){const c="Infinite loop on byte: "+r.charCodeAt(0);if(this.options.silent){console.error(c);break}throw new Error(c)}}return e}},ue=class{options;parser;constructor(o){this.options=o||Y}space(o){return""}code({text:o,lang:r,escaped:e}){const t=(r||"").match($.notSpaceStart)?.[0],n=o.replace($.endingNewline,"")+"\n";return t?'<pre><code class="language-'+_(t)+'">'+(e?n:_(n,!0))+"</code></pre>\n":"<pre><code>"+(e?n:_(n,!0))+"</code></pre>\n"}blockquote({tokens:o}){return`<blockquote>\n${this.parser.parse(o)}</blockquote>\n`}html({text:o}){return o}heading({tokens:o,depth:r}){return`<h${r}>${this.parser.parseInline(o)}</h${r}>\n`}hr(o){return"<hr>\n"}list(o){const r=o.ordered,e=o.start;let t="";for(let i=0;i<o.items.length;i++)t+=this.listitem(o.items[i]);const n=r?"ol":"ul";return"<"+n+(r&&1!==e?' start="'+e+'"':"")+">\n"+t+"</"+n+">\n"}listitem(o){let r="";if(o.task){const e=this.checkbox({checked:!!o.checked});o.loose?"paragraph"===o.tokens[0]?.type?(o.tokens[0].text=e+" "+o.tokens[0].text,o.tokens[0].tokens&&o.tokens[0].tokens.length>0&&"text"===o.tokens[0].tokens[0].type&&(o.tokens[0].tokens[0].text=e+" "+_(o.tokens[0].tokens[0].text),o.tokens[0].tokens[0].escaped=!0)):o.tokens.unshift({type:"text",raw:e+" ",text:e+" ",escaped:!0}):r+=e+" "}return r+=this.parser.parse(o.tokens,!!o.loose),`<li>${r}</li>\n`}checkbox({checked:o}){return"<input "+(o?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:o}){return`<p>${this.parser.parseInline(o)}</p>\n`}table(o){let r="",e="";for(let n=0;n<o.header.length;n++)e+=this.tablecell(o.header[n]);r+=this.tablerow({text:e});let t="";for(let n=0;n<o.rows.length;n++){const s=o.rows[n];e="";for(let i=0;i<s.length;i++)e+=this.tablecell(s[i]);t+=this.tablerow({text:e})}return t&&(t=`<tbody>${t}</tbody>`),"<table>\n<thead>\n"+r+"</thead>\n"+t+"</table>\n"}tablerow({text:o}){return`<tr>\n${o}</tr>\n`}tablecell(o){const r=this.parser.parseInline(o.tokens),e=o.header?"th":"td";return(o.align?`<${e} align="${o.align}">`:`<${e}>`)+r+`</${e}>\n`}strong({tokens:o}){return`<strong>${this.parser.parseInline(o)}</strong>`}em({tokens:o}){return`<em>${this.parser.parseInline(o)}</em>`}codespan({text:o}){return`<code>${_(o,!0)}</code>`}br(o){return"<br>"}del({tokens:o}){return`<del>${this.parser.parseInline(o)}</del>`}link({href:o,title:r,tokens:e}){const t=this.parser.parseInline(e),n=lt(o);if(null===n)return t;let s='<a href="'+(o=n)+'"';return r&&(s+=' title="'+_(r)+'"'),s+=">"+t+"</a>",s}image({href:o,title:r,text:e,tokens:t}){t&&(e=this.parser.parseInline(t,this.parser.textRenderer));const n=lt(o);if(null===n)return _(e);let s=`<img src="${o=n}" alt="${e}"`;return r&&(s+=` title="${_(r)}"`),s+=">",s}text(o){return"tokens"in o&&o.tokens?this.parser.parseInline(o.tokens):"escaped"in o&&o.escaped?o.text:_(o.text)}},ze=class{strong({text:o}){return o}em({text:o}){return o}codespan({text:o}){return o}del({text:o}){return o}html({text:o}){return o}text({text:o}){return o}link({text:o}){return""+o}image({text:o}){return""+o}br(){return""}},q=class He{options;renderer;textRenderer;constructor(r){this.options=r||Y,this.options.renderer=this.options.renderer||new ue,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ze}static parse(r,e){return new He(e).parse(r)}static parseInline(r,e){return new He(e).parseInline(r)}parse(r,e=!0){let t="";for(let n=0;n<r.length;n++){const s=r[n];if(this.options.extensions?.renderers?.[s.type]){const a=s,l=this.options.extensions.renderers[a.type].call({parser:this},a);if(!1!==l||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(a.type)){t+=l||"";continue}}const i=s;switch(i.type){case"space":t+=this.renderer.space(i);continue;case"hr":t+=this.renderer.hr(i);continue;case"heading":t+=this.renderer.heading(i);continue;case"code":t+=this.renderer.code(i);continue;case"table":t+=this.renderer.table(i);continue;case"blockquote":t+=this.renderer.blockquote(i);continue;case"list":t+=this.renderer.list(i);continue;case"html":t+=this.renderer.html(i);continue;case"paragraph":t+=this.renderer.paragraph(i);continue;case"text":{let a=i,l=this.renderer.text(a);for(;n+1<r.length&&"text"===r[n+1].type;)a=r[++n],l+="\n"+this.renderer.text(a);t+=e?this.renderer.paragraph({type:"paragraph",raw:l,text:l,tokens:[{type:"text",raw:l,text:l,escaped:!0}]}):l;continue}default:{const a='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return t}parseInline(r,e=this.renderer){let t="";for(let n=0;n<r.length;n++){const s=r[n];if(this.options.extensions?.renderers?.[s.type]){const a=this.options.extensions.renderers[s.type].call({parser:this},s);if(!1!==a||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type)){t+=a||"";continue}}const i=s;switch(i.type){case"escape":case"text":t+=e.text(i);break;case"html":t+=e.html(i);break;case"link":t+=e.link(i);break;case"image":t+=e.image(i);break;case"strong":t+=e.strong(i);break;case"em":t+=e.em(i);break;case"codespan":t+=e.codespan(i);break;case"br":t+=e.br(i);break;case"del":t+=e.del(i);break;default:{const a='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return t}},ke=class{options;block;constructor(r){this.options=r||Y}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(r){return r}postprocess(r){return r}processAllTokens(r){return r}provideLexer(){return this.block?K.lex:K.lexInline}provideParser(){return this.block?q.parse:q.parseInline}},ee=new class{defaults={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=q;Renderer=ue;TextRenderer=ze;Lexer=K;Tokenizer=ve;Hooks=ke;constructor(...o){this.use(...o)}walkTokens(o,r){let e=[];for(const t of o)switch(e=e.concat(r.call(this,t)),t.type){case"table":{const n=t;for(const s of n.header)e=e.concat(this.walkTokens(s.tokens,r));for(const s of n.rows)for(const i of s)e=e.concat(this.walkTokens(i.tokens,r));break}case"list":e=e.concat(this.walkTokens(t.items,r));break;default:{const n=t;this.defaults.extensions?.childTokens?.[n.type]?this.defaults.extensions.childTokens[n.type].forEach(s=>{const i=n[s].flat(1/0);e=e.concat(this.walkTokens(i,r))}):n.tokens&&(e=e.concat(this.walkTokens(n.tokens,r)))}}return e}use(...o){const r=this.defaults.extensions||{renderers:{},childTokens:{}};return o.forEach(e=>{const t={...e};if(t.async=this.defaults.async||t.async||!1,e.extensions&&(e.extensions.forEach(n=>{if(!n.name)throw new Error("extension name required");if("renderer"in n){const s=r.renderers[n.name];r.renderers[n.name]=s?function(...i){let a=n.renderer.apply(this,i);return!1===a&&(a=s.apply(this,i)),a}:n.renderer}if("tokenizer"in n){if(!n.level||"block"!==n.level&&"inline"!==n.level)throw new Error("extension level must be 'block' or 'inline'");const s=r[n.level];s?s.unshift(n.tokenizer):r[n.level]=[n.tokenizer],n.start&&("block"===n.level?r.startBlock?r.startBlock.push(n.start):r.startBlock=[n.start]:"inline"===n.level&&(r.startInline?r.startInline.push(n.start):r.startInline=[n.start]))}"childTokens"in n&&n.childTokens&&(r.childTokens[n.name]=n.childTokens)}),t.extensions=r),e.renderer){const n=this.defaults.renderer||new ue(this.defaults);for(const s in e.renderer){if(!(s in n))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;const a=e.renderer[s],l=n[s];n[s]=(...c)=>{let u=a.apply(n,c);return!1===u&&(u=l.apply(n,c)),u||""}}t.renderer=n}if(e.tokenizer){const n=this.defaults.tokenizer||new ve(this.defaults);for(const s in e.tokenizer){if(!(s in n))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;const a=e.tokenizer[s],l=n[s];n[s]=(...c)=>{let u=a.apply(n,c);return!1===u&&(u=l.apply(n,c)),u}}t.tokenizer=n}if(e.hooks){const n=this.defaults.hooks||new ke;for(const s in e.hooks){if(!(s in n))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;const a=e.hooks[s],l=n[s];n[s]=ke.passThroughHooks.has(s)?c=>{if(this.defaults.async)return Promise.resolve(a.call(n,c)).then(d=>l.call(n,d));const u=a.call(n,c);return l.call(n,u)}:(...c)=>{let u=a.apply(n,c);return!1===u&&(u=l.apply(n,c)),u}}t.hooks=n}if(e.walkTokens){const n=this.defaults.walkTokens,s=e.walkTokens;t.walkTokens=function(i){let a=[];return a.push(s.call(this,i)),n&&(a=a.concat(n.call(this,i))),a}}this.defaults={...this.defaults,...t}}),this}setOptions(o){return this.defaults={...this.defaults,...o},this}lexer(o,r){return K.lex(o,r??this.defaults)}parser(o,r){return q.parse(o,r??this.defaults)}parseMarkdown(o){return(e,t)=>{const n={...t},s={...this.defaults,...n},i=this.onError(!!s.silent,!!s.async);if(!0===this.defaults.async&&!1===n.async)return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||null===e)return i(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof e)return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));s.hooks&&(s.hooks.options=s,s.hooks.block=o);const a=s.hooks?s.hooks.provideLexer():o?K.lex:K.lexInline,l=s.hooks?s.hooks.provideParser():o?q.parse:q.parseInline;if(s.async)return Promise.resolve(s.hooks?s.hooks.preprocess(e):e).then(c=>a(c,s)).then(c=>s.hooks?s.hooks.processAllTokens(c):c).then(c=>s.walkTokens?Promise.all(this.walkTokens(c,s.walkTokens)).then(()=>c):c).then(c=>l(c,s)).then(c=>s.hooks?s.hooks.postprocess(c):c).catch(i);try{s.hooks&&(e=s.hooks.preprocess(e));let c=a(e,s);s.hooks&&(c=s.hooks.processAllTokens(c)),s.walkTokens&&this.walkTokens(c,s.walkTokens);let u=l(c,s);return s.hooks&&(u=s.hooks.postprocess(u)),u}catch(c){return i(c)}}}onError(o,r){return e=>{if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",o){const t="<p>An error occurred:</p><pre>"+_(e.message+"",!0)+"</pre>";return r?Promise.resolve(t):t}if(r)return Promise.reject(e);throw e}}};function I(o,r){return ee.parse(o,r)}I.options=I.setOptions=function(o){return ee.setOptions(o),Ge(I.defaults=ee.defaults),I},I.getDefaults=function Re(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}},I.defaults=Y,I.use=function(...o){return ee.use(...o),Ge(I.defaults=ee.defaults),I},I.walkTokens=function(o,r){return ee.walkTokens(o,r)},I.parseInline=ee.parseInline,I.Parser=q,I.parser=q.parse,I.Renderer=ue,I.TextRenderer=ze,I.Lexer=K,I.lexer=K.lex,I.Tokenizer=ve,I.Hooks=ke,I.parse=I;var pt=k(58),ht=k(2306),An=k(140);class Pn extends ue{baseSize;documentListHandlers;entityListHandlers;_handlers;context={};counters={};getIndex(r){const e=this.counters[r]||0;return this.counters[r]=e+1,e}constructor(r="m",e){super(),this.baseSize=r,this._handlers=e,this.documentListHandlers=e?.documentList,this.entityListHandlers=e?.entityList,this.setupRenderers()}resetContext(){this.context={},this.counters={}}getContext(){return this.context}scaleSize(r){const e=["xs","s","m","l","xl"],t=e.indexOf(this.baseSize),n=e.indexOf(r);return e[Math.max(0,Math.min(e.length-1,n+(t-2)))]}setupRenderers(){this.heading=({tokens:r,depth:e})=>{const i=this.scaleSize({1:"xl",2:"l",3:"l",4:"m",5:"m",6:"s"}[e]),a={1:"bold",2:"semibold",3:"semibold",4:"semibold",5:"medium",6:"medium"}[e],l=this.parser?.parseInline(r)||"";return`<cue-typography size="${i}" weight="${a}"${this.getIndex("heading")>0?' style="margin-top: 24px; display: block;"':' style="display: block;"'}>${l}</cue-typography>\n`},this.paragraph=({tokens:r})=>{const e=this.scaleSize("m"),t=this.parser?.parseInline(r)||"";return/^(?:\s*,?\s*<cue-href-chip\b[^>]*><\/cue-href-chip>)+\s*$/.test(t)?`<div style="display: flex; gap: 6px; flex-wrap: wrap;">${t.replace(/(<\/cue-href-chip>)\s*,?\s*/g,"$1").trim()}</div>\n`:`<div class="cue-md-p"><cue-typography size="${e}" weight="regular">${t}</cue-typography></div>\n`},this.listitem=({tokens:r})=>{const e=this.scaleSize("m");return`<li class="cue-md-li" style="font-size: var(--cue-font-${e}-size);"><cue-typography size="${e}" weight="regular">${this.parser?.parseInline(r)||""}</cue-typography></li>`},this.tablecell=({tokens:r,header:e,align:t})=>{const n=e?"th":"td",i=e?"semibold":"regular";return`<${n}${t?` style="text-align: ${t}"`:""}><cue-typography size="${this.scaleSize("m")}" weight="${i}">${this.parser?.parseInline(r)||""}</cue-typography></${n}>`},this.blockquote=({text:r,tokens:e})=>/^\[!(NOTE|WARNING|IMPORTANT|TIP|CAUTION)\]/i.test(r.trimStart())?"":`<blockquote class="cue-md-blockquote"><cue-typography size="${this.scaleSize("m")}" weight="regular">${this.parser?.parse(e)||""}</cue-typography></blockquote>`,this.link=({href:r,title:e,tokens:t})=>{const n=this.parser?.parseInline(t)||"";if(!r){const i=this.getIndex("hrefchip"),a=`hrefchip_menuitems_${i}`,l=`hrefchip_id_${i}`,c=`hrefchip_click_${i}`,u=n.replace(/<[^>]*>/g,"");return this.context[l]=u,this.context[a]=()=>this._handlers?.hrefChip?.menuItems?.(u)??[],this.context[c]=()=>{this._handlers?.hrefChip?.clicked?.(u)},`<cue-href-chip [label]="context.${l}" [menuItems]="context.${a}()" (clicked)="context.${c}()"></cue-href-chip>`}return`<a href="${r}"${e?` title="${e}"`:""} target="_blank" rel="noopener noreferrer">${n}</a>`},this.codespan=({text:r})=>`<code class="cue-code-inline">${r}</code>`,this.code=r=>{const e="36px";if("document-list"===r.lang){const t=r.documentRefs;if(!t||0===t.length)return"";const s=`doc_refs_${this.getIndex("doc")}`;return this.context[s]=t,this._handlers?.availableContentCategories&&(this.context.availableContentCategories=this._handlers.availableContentCategories),`<cue-document-list [documentRefs]="context.${s}" [documentdata]="context.documentdata" [handlers]="context.documentlisthandlers" [availableContentCategories]="context.availableContentCategories" (clickedDocument)="context.documentclickedrow($event)" style="margin-bottom: ${e};"></cue-document-list>`}if("entity-list"===r.lang){const t=r.iris;if(!t)return"";const s=`entity_iris_${this.getIndex("entity")}`;return this.context[s]=t,this._handlers?.availableEntityCategories&&(this.context.availableEntityCategories=this._handlers.availableEntityCategories),this._handlers?.availableEntityRelationships&&(this.context.availableEntityRelationships=this._handlers.availableEntityRelationships),`<cue-ent-list-inner [entities]="context.${s}" [entitydata]="context.entitydata" [entityLocations]="context.entitylocations" [handlers]="context.entitylisthandlers" [availableEntityCategories]="context.availableEntityCategories" [availableEntityRelationships]="context.availableEntityRelationships" [mapboxToken]="context.mapboxToken" (rowClicked)="context.entityclickedrow($event)" style="margin-bottom: ${e};"></cue-ent-list-inner>`}if("map"===r.lang){const t=r.mapData;if(!t||!t.layers)return"";const n=this.getIndex("map"),s=`map_layers_${n}`,i=`map_settings_${n}`;return this.context[s]=t.layers,this.context[i]=t.settings,`<cue-card style="height: 300px; display: block; margin-bottom: ${e};" [padded]="false"><cue-map [layers]="context.${s}" [settings]="context.${i}"></cue-map></cue-card>`}return`<div style="margin-bottom: ${e};">${super.code(r)}</div>`}}walkTokens(r){return(0,N.A)(function*(){if("code"===r.type&&"document-list"===r.lang){const e=r.text.split("\n").filter(s=>s.trim().length>0),t=new Map,n=[];for(const s of e){const i=s.trim(),a=i.match(/^(.+)\?page=(\d+)$/);if(a){const l=a[1],c=a[2];t.has(l)||(t.set(l,{id:l,pages:[]}),n.push(l));const u=t.get(l);u.pages||(u.pages=[]),u.pages.push({id:i,page:c,relevance:0})}else t.has(i)||(t.set(i,{id:i}),n.push(i))}r.documentRefs=n.map(s=>t.get(s))}if("code"===r.type&&"entity-list"===r.lang){const e=r.text.split("\n").filter(t=>t.trim().length>0);r.iris=e}if("code"===r.type&&"map"===r.lang){const e=r.text.split("\n").filter(l=>l.trim().length>0),t=e[0]?.trim()||"",n=e.slice(1),s={};n.forEach(l=>{const c=l.split(";"),u=c[0]?.trim(),d=c[1]?.trim(),p=c[2]?.trim();if(!u||!d)return;const h=(0,pt.S)(d);if(!h)return;const f=(0,pt.n)(h);let m={};if(p)try{m=JSON.parse(p)}catch{}s[u]||(s[u]=[]),s[u].push({type:"Feature",properties:m,geometry:f})});const i=[];Object.keys(s).forEach(l=>{const c=new ht.ux(l);c.collection=new An.o(s[l]),i.push(c)});const a=new ht.yY;a.mapboxToken=t,a.contextMenu.showFlyTo=!1,r.mapData={layers:i,settings:a}}})()}}let Nn=(()=>{class o{envInjector=(0,g.WQX)(g.uvJ);fileURL=T.hFB.required();html=(0,g.vPA)("");hookOptions={sanitize:!1,globalParsersBlueprint:{environmentInjector:this.envInjector}};parsers=[{component:{importPromise:()=>Promise.resolve().then(k.bind(k,2245)),importName:"Typography"},selector:"cue-typography"}];onFile=(0,g.QZP)((()=>{var e=this;return(0,N.A)(function*(){const n=yield(yield fetch(e.fileURL())).text(),s=new Pn("m");s.resetContext();const i=yield I.parse(n,{gfm:!0,breaks:!1,renderer:s,async:!0,walkTokens:s.walkTokens.bind(s)});e.html.set(i)})})());static \u0275fac=function(t){return new(t||o)};static \u0275cmp=w.VBU({type:o,selectors:[["cue-md-viewer"]],inputs:{fileURL:[1,"fileURL"]},decls:2,vars:3,consts:[[1,"page"],[3,"parsers","content","options"]],template:function(t,n){1&t&&(w.j41(0,"div",0),w.nrm(1,"ngx-dynamic-hooks",1),w.k0s()),2&t&&(w.R7$(),w.Y8G("parsers",n.parsers)("content",n.html())("options",n.hookOptions))},dependencies:[Ut],styles:[".page[_ngcontent-%COMP%]{overflow-y:auto;height:100%;padding:16px;box-sizing:border-box}[_nghost-%COMP%] cue-typography{display:inline-block}[_nghost-%COMP%] .cue-md-p{margin-bottom:24px;opacity:.9;line-height:1.6;display:block}[_nghost-%COMP%] .cue-md-p:last-child{margin-bottom:0}[_nghost-%COMP%] .cue-md-blockquote{margin-bottom:24px;opacity:.9;border-left:4px solid var(--cue-border-color);padding-left:16px}[_nghost-%COMP%] ul, [_nghost-%COMP%] ol{margin-bottom:24px;padding-left:28px;font-family:var(--cue-font-family);opacity:.9;line-height:1.6}[_nghost-%COMP%] li.cue-md-li{margin-bottom:12px}[_nghost-%COMP%] table{margin-bottom:24px;border-collapse:collapse;width:100%}[_nghost-%COMP%] th, [_nghost-%COMP%] td{padding:8px 12px;border-bottom:1px solid var(--cue-border-color, #eee);text-align:left}[_nghost-%COMP%] th cue-typography{font-weight:var(--cue-font-weight-semibold)}[_nghost-%COMP%] .cue-code-inline{background-color:var(--cue-border-color);padding:0 4px;border-radius:4px;font-family:monospace;font-size:1.1em;font-weight:500;color:var(--cue-main-foreground)}"],changeDetection:0})}return o})()},2306(re,V,k){k.d(V,{AA:()=>w,ux:()=>L,yY:()=>T});var N=k(140),g=k(8402);class T{mapboxToken;contextMenu={showProperties:!0,showFlyTo:!0};toolbar=new w}class w{hidden=!1;position="bottom";margin="20px";displayZoom=!0;displayGeofenceDraw=!1;displayLayerToggle=!0;clearGeofenceAfterDraw=!0}class L{label;id;collection=new N.o;color;visible=!0;cluster=!0;zoomToFit=!0;category;constructor(E,C=(0,g.A)()){this.label=E,this.id=C}}},140(re,V,k){k.d(V,{o:()=>N});class N{type="FeatureCollection";features=[];bbox;id;constructor(T=[]){this.features=T}addFeature(T){this.features.push(T)}removeFeature(T){return this.features.splice(T,1)[0]}getFeatureCount(){return this.features.length}clear(){this.features=[]}}},58(re,V,k){function N(b){let y=0,x=-1,B=-1;for(let P=0;P<b.length;P++)if("("===b[P])y++,1===y&&(x=P+1);else if(")"===b[P]&&(y--,0===y)){B=P;break}return-1!==x&&-1!==B?b.substring(x,B):null}k.d(V,{S:()=>z,n:()=>U});class g{x;y;z;constructor(y,x,B){this.x=y,this.y=x,this.z=B}}class T{points;constructor(y){this.points=y}}class w{lines;constructor(y){this.lines=y}}function z(b){if(b){if((b=b.trim().toUpperCase()).startsWith("POINT"))return function j(b){b=b.trim().toUpperCase();const x=N(b)?.split(" ")??[];return b.includes("POINT Z")?new g(parseFloat(x[0]),parseFloat(x[1]),parseFloat(x[2])):new g(parseFloat(x[0]),parseFloat(x[1]))}(b);if(b.startsWith("LINESTRING"))return function L(b){const y=N(b=b.trim().toUpperCase()),x=[];return y?.split(",").map(B=>B.trim().split(" ").map(P=>parseFloat(P))).map(B=>{x.push(new g(B[0],B[1],B[2]))}),new T(x)}(b);if(b.startsWith("POLYGON"))return function E(b){const y=N(b=b.trim().toUpperCase());if(!y)return new w([]);const x=y.match(/\(([^)]+)\)/g);if(!x)return new w([]);const B=x.map(P=>{const Z=N(P);return Z?Z.split(",").map(he=>{const G=he.trim().split(" ");return G.length>=3?new g(parseFloat(G[0]),parseFloat(G[1]),parseFloat(G[2])):new g(parseFloat(G[0]),parseFloat(G[1]))}):[]});return new w(B)}(b)}}function U(b){if(b instanceof g)return{type:"Point",coordinates:void 0!==b.z?[b.x,b.y,b.z]:[b.x,b.y]};if(b instanceof T)return{type:"LineString",coordinates:b.points.map(y=>void 0!==y.z?[y.x,y.y,y.z]:[y.x,y.y])};if(b instanceof w)return{type:"Polygon",coordinates:b.lines.map(y=>y.map(x=>void 0!==x.z?[x.x,x.y,x.z]:[x.x,x.y]))};throw new Error("Unknown WKT type")}},5332(re,V,k){k.d(V,{k:()=>w});for(var g=[],T=0;T<256;++T)g.push((T+256).toString(16).slice(1));function w(E,C=0){return(g[E[C+0]]+g[E[C+1]]+g[E[C+2]]+g[E[C+3]]+"-"+g[E[C+4]]+g[E[C+5]]+"-"+g[E[C+6]]+g[E[C+7]]+"-"+g[E[C+8]]+g[E[C+9]]+"-"+g[E[C+10]]+g[E[C+11]]+g[E[C+12]]+g[E[C+13]]+g[E[C+14]]+g[E[C+15]]).toLowerCase()}},8402(re,V,k){k.d(V,{A:()=>C});const g={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};var T,w=new Uint8Array(16);function L(){if(!T&&!(T=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return T(w)}var j=k(5332);const C=function E(z,U,b){if(g.randomUUID&&!U&&!z)return g.randomUUID();var y=(z=z||{}).random||(z.rng||L)();if(y[6]=15&y[6]|64,y[8]=63&y[8]|128,U){b=b||0;for(var x=0;x<16;++x)U[b+x]=y[x];return U}return(0,j.k)(y)}}}]);
|
|
1
|
+
"use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[376],{6376(k,g,b){function d(s,e){let t=function m(s,e){let r=0;return s.color?r=s.color:e.tables&&e.tables.layer&&e.tables.layer.layers[s.layer]&&(r=e.tables.layer.layers[s.layer].color),(null==r||16777215===r)&&(r=0),r}(s,e).toString(16);for(;t.length<6;)t="0"+t;return"#"+t}function A(s){if(s=function T(s){let e=s.replace(/\\P/g,"\n");return e=e.replace(/\\X/g,"\n"),e}(s),!s.includes(";"))return{text:w(s)};let e=s;const r={};["f","A","Q","H","W","T"].forEach(i=>{r[i]=function $(s,e,r){const t=new RegExp(`(?<=${e})(.*?)(?=${r})`,"s"),i=s.match(t);return i?i[1].trim():void 0}(s,`\\\\${i}`,";"),void 0!==r[i]&&(e=e.replace(`\\${i}${r[i]};`,""))});const t=s.lastIndexOf(";");return s=w(s.substring(t+1)),e=e.replace(s,""),{text:s,formatting:r}}function w(s){return(s=(s=(s=(s=s.replace(/\\{/g,"\0LBRACE")).replace(/\\}/g,"\0RBRACE")).replace(/[{}]/g,"")).replace(/__LBRACE__/g,"{")).replace(/__RBRACE__/g,"}")}b.r(g),b.d(g,{DrawEntitySVG:()=>x});const f="http://www.w3.org/2000/svg";class x{_svg;_currentGroup;entityMap=new Map;_idCounter=0;constructor(){this._svg=document.createElementNS(f,"svg"),this._svg.setAttribute("xmlns",f)}fromEntity(e,r,t=!0){t||this._resetSVG(),Array.isArray(e)?e.forEach(i=>this.fromEntity(i,r,!0)):"ARC"===e.type?this._drawArc(e,r):"CIRCLE"===e.type?this._drawCircle(e,r):"INSERT"===e.type?this._drawBlock(e,r):"LINE"===e.type?this._drawLine(e,r):"LWPOLYLINE"===e.type||"POLYLINE"===e.type?this._drawPath(e,r):"POINT"===e.type?this._drawPoint(e,r):"SPLINE"===e.type?this._drawSpline(e,r):"SOLID"===e.type?this._drawSolid(e,r):"ELLIPSE"===e.type?this._drawEllipse(e,r):"TEXT"===e.type?this._drawText(e,r):"MTEXT"===e.type?this._drawMtext(e,r):"DIMENSION"===e.type&&!(7&e.dimensionType)&&this._drawDimension(e,r)}asString(){return this._svg.outerHTML}asElement(){return this._svg}_resetSVG(){this._svg=document.createElementNS(f,"svg"),this._svg.setAttribute("xmlns",f),this.entityMap.clear(),this._idCounter=0}_drawBlock(e,r){const t=r.blocks[e.name];if(!t||!t.entities)return;const i=this._appendElementOfType("g",e);this._currentGroup=i;const n=this._buildGroupTransformation(e);""!==n&&i.setAttribute("transform",n),t.entities.forEach(o=>{this.fromEntity(o,r)}),this._currentGroup=void 0}_drawLine(e,r){const t=this._appendElementOfType("line",e);t.setAttribute("x1",e.vertices[0].x.toString()),t.setAttribute("y1",e.vertices[0].y.toString()),t.setAttribute("x2",e.vertices[1].x.toString()),t.setAttribute("y2",e.vertices[1].y.toString()),this._setStrokeFill(e,r,t)}_drawPath(e,r){const t=e.vertices.some(c=>void 0!==c.bulge&&Math.abs(c.bulge)>1e-4);if(2===e.vertices.length&&!t)return this._drawLine(e,r);const i=this._appendElementOfType("path",e);let n=!0===e.shape||!0===e.closed,o=e.vertices;if(!n&&o.length>3){const c=o[0],a=o[o.length-1];Math.abs(c.x-a.x)<.001&&Math.abs(c.y-a.y)<.001&&(n=!0,o=o.slice(0,-1))}const u=this._verticeArrayToPath(o,n,e.extrusion);i.setAttribute("d",u),this._setStrokeFill(e,r,i)}_drawArc(e,r){const t=this._appendElementOfType("path",e),i=this._arcPath(e.center,e.radius,e.startAngle,e.endAngle,e.extrusion);t.setAttribute("d",i),this._setStrokeFill(e,r,t)}_drawCircle(e,r){const t=this._appendElementOfType("circle",e);t.setAttribute("cx",e.center.x.toString()),t.setAttribute("cy",e.center.y.toString()),t.setAttribute("r",e.radius.toString()),this._setStrokeFill(e,r,t)}_drawText(e,r){const t=this._appendElementOfType("text",e);t.setAttribute("x",e.startPoint.x.toString()),t.setAttribute("y",e.startPoint.y.toString());const i=A(e.text);t.innerHTML=i.text,this._setTextAppearance(e,r,t)}_drawPoint(e,r){const t=this._appendElementOfType("circle",e);t.setAttribute("cx",e.position.x.toString()),t.setAttribute("cy",e.position.y.toString()),t.setAttribute("r","0.0001"),t.setAttribute("stroke",d(e,r)),t.setAttribute("fill","none"),t.setAttribute("vector-effect","non-scaling-stroke"),t.setAttribute("stroke-width","2"),t.classList.add("dxf-path")}_drawDimension(e,r){const t=r.blocks[e.block];if(!t||!t.entities)return;const i=this._appendElementOfType("g",e);this._currentGroup=i,t.entities.forEach(n=>{this.fromEntity(n,r)}),this._currentGroup=void 0}_drawEllipse(e,r){}_drawSpline(e,r){}_drawSolid(e,r){}_drawMtext(e,r){const t=this._appendElementOfType("text",e);t.setAttribute("x",e.position.x.toString()),t.setAttribute("y",e.position.y.toString());const i=A(e.text);t.innerHTML=i.text,this._setMTextAppearance(e,r,t)}_setStrokeFill(e,r,t){t.setAttribute("stroke",d(e,r)),t.setAttribute("fill","none"),t.setAttribute("stroke-width",((void 0!==e.lineweight&&e.lineweight>0?e.lineweight:25)/1e5).toString()),t.setAttribute("vector-effect","non-scaling-stroke"),t.classList.add("dxf-path")}_setTextAppearance(e,r,t){t.setAttribute("fill",d(e,r)),t.setAttribute("font-size",(e.textHeight/1e3).toString()),e.rotation&&t.setAttribute("transform",`rotate(${e.rotation})`)}_setMTextAppearance(e,r,t){t.setAttribute("fill",d(e,r)),t.setAttribute("font-size",(e.height/1e3).toString()),e.rotation&&t.setAttribute("transform",`rotate(${e.rotation})`)}_buildGroupTransformation(e){let r="";return void 0!==e.position&&(r+=` translate(${e.position.x} ${e.position.y})`),void 0!==e.xScale&&void 0!==e.yScale&&(r+=` scale(${e.xScale} ${e.yScale})`),void 0!==e.rotation&&(r+=` rotate(${e.rotation})`),r.trim()}_appendElementOfType(e,r){const t=document.createElementNS(f,e);if(r){const i="dxf-entity-"+this._idCounter++;t.setAttribute("data-dxf-id",i),this.entityMap.set(i,r)}return void 0!==this._currentGroup?this._currentGroup.appendChild(t):this._svg.appendChild(t),t}_arcPath(e,r,t,i,n){const o=e.x+r*Math.cos(t),u=e.y+r*Math.sin(t),c=e.x+r*Math.cos(i),a=e.y+r*Math.sin(i),h=n&&n.z<0;let l=i-t;for(;l<0;)l+=2*Math.PI;for(;l>2*Math.PI;)l-=2*Math.PI;return l<1e-4?`M ${o} ${u}`:`M ${o} ${u} A ${r} ${r} 0 ${l>Math.PI?1:0} ${h?0:1} ${c} ${a}`}_verticeArrayToPath(e,r=!1,t){let i="";const n=r?e.length:e.length-1;for(let o=0;o<n;o++){const{x:u,y:c,bulge:a}=e[o],{x:h,y:l}=e[(o+1)%e.length];if(void 0!==a&&Math.abs(a)>1e-4){const _=Math.sqrt((u-h)**2+(c-l)**2),p=Math.abs(a),S=_/2*(1+p*p)/(2*p),E=t&&t.z<0;0===o&&(i+=`M ${u} ${c} `),i+=`A ${S} ${S} 0 ${p>1?1:0} ${a>0?E?0:1:E?1:0} ${h} ${l} `}else 0===o&&(i+=`M ${u} ${c} `),i+=`L ${h} ${l} `}return r&&(i+=" Z"),i.trim()}}}}]);
|
package/382.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[382],{2382(E,f,r){r.d(f,{CueDocumentList:()=>A});var h=r(467),a=r(7705),c=r(5802),p=r(2271),C=r(8611),v=r(2065),w=r(4372),b=r(5381),O=r(2245),o=r(5547);function M(i,P){if(1&i&&(o.j41(0,"cue-flexcontainer",0)(1,"cue-typography",2),o.EFF(2),o.k0s()()),2&i){const t=o.XpG();o.R7$(2),o.SpI(" ",t.errorMessage()," ")}}function I(i,P){if(1&i){const t=o.RV6();o.j41(0,"cue-doc-list",3),o.bIt("clickedDocument",function(s){c.eBV(t);const n=o.XpG();return c.Njj(n.clickedDocument.emit(s))})("clickedDownloadDocument",function(s){c.eBV(t);const n=o.XpG();return c.Njj(n.clickedDownloadDocument.emit(s))})("clickedOpenInDir",function(s){c.eBV(t);const n=o.XpG();return c.Njj(n.clickedOpenInDir.emit(s))})("clickedOpen",function(s){c.eBV(t);const n=o.XpG();return c.Njj(n.clickedOpen.emit(s))}),o.k0s()}if(2&i){const t=o.XpG();o.Y8G("documentRefs",t.documentRefs())("documentData",t.documentData())("handlers",t.handlers())("availableContentCategories",t.availableContentCategories())("detailedView",t.detailedView())("simple",t.simple())("pageSize",t.pageSize())("prefetchPages",t.prefetchPages())("showOpenInDocumentViewerAction",t.showOpenInDocumentViewerAction())("showOpenInFileManagerAction",t.showOpenInFileManagerAction())("customOverlayActions",t.customOverlayActions())("variant",t.variant())}}function D(i){return i.split("?")[0].trim()}let A=(()=>{class i{projectId=(0,a.hFB)(void 0);uuids=(0,a.hFB)([]);sdkState=(0,a.hFB)(void 0);detailedView=(0,a.hFB)(!1);simple=(0,a.hFB)(!1);pageSize=(0,a.hFB)(10);prefetchPages=(0,a.hFB)(3);showOpenInDocumentViewerAction=(0,a.hFB)(!1);showOpenInFileManagerAction=(0,a.hFB)(!1);customMenuItems=(0,a.hFB)([]);variant=(0,a.hFB)("none");clickedDocument=(0,a.CGW)();clickedDownloadDocument=(0,a.CGW)();clickedOpenInDir=(0,a.CGW)();clickedOpen=(0,a.CGW)();state=(0,c.vPA)("idle");errorMessage=(0,c.vPA)(null);documentData=(0,c.vPA)({});availableContentCategories=(0,c.vPA)(void 0);documentRefs=(0,p.EW)(()=>{const t=new Set;return(this.uuids()??[]).map(D).filter(e=>!!e).filter(e=>!t.has(e)&&(t.add(e),!0)).map(e=>({id:e}))});customOverlayActions=(0,p.EW)(()=>(this.customMenuItems()||[]).map(e=>({label:e.label,icon:e.icon,action:s=>{e.action(s.rowData,s)}})));handlers=(0,p.EW)(()=>{var t=this;const e=this._docs();if(e)return{requestData:(s=(0,h.A)(function*(n){const m=n.map(D).filter(u=>!!u),d=m.filter(u=>!t.documentData()[u]);if(console.debug("[CueDocumentListWC] requestData",{requestedCount:m.length,missingCount:d.length,missing:d}),d.length)try{const u=e,l=t.simple()&&u.fetchDocumentDataSimple?yield u.fetchDocumentDataSimple(d):yield e.fetchDocumentData(d);console.debug("[CueDocumentListWC] fetchDocumentData resolved",{fetchedCount:Object.keys(l).length,ids:Object.keys(l)});const g={};Object.values(l).forEach(_=>{g[_.id]=function y(i){return{id:i.id,path:i.path,suffix:i.suffix,size:i.size,contentIRI:i.contentIRI,providerId:i.providerId,tags:i.tags??[],summary:i.summary??"",categories:i.categories??[],subject:i.subject,relevance:0}}(_)}),Object.keys(g).length>0&&t.documentData.update(_=>({..._,...g}))}catch(u){console.error("[CueDocumentListWC] Failed to fetch document data:",u),t.errorMessage.set(u instanceof Error?u.message:String(u)),t.state.set("error")}}),function(m){return s.apply(this,arguments)}),requestDownload:function(){var s=(0,h.A)(function*(n){const m=t._cue(),d=t.projectId();if(m&&d)try{const u=yield m.storage.getDownloadUrl(d,n.id,n.suffix,"raw"),l=yield fetch(u);if(!l.ok)throw new Error(`Download failed: ${l.status} ${l.statusText}`);const g=yield l.blob(),_=(0,w.M)(n.path)||`${n.id}${n.suffix||""}`;(0,v.KE)(g,_)}catch(u){console.error("[CueDocumentListWC] Failed to download document:",u)}});return function(m){return s.apply(this,arguments)}}(),requestOpen:(s,n)=>{console.log("[CueDocumentListWC] requestOpen",{documentUUID:s,document:n})},requestOpenInDir:(s,n)=>{console.log("[CueDocumentListWC] requestOpenInDir",{documentUUID:s,document:n})}};var s});_cue=(0,c.vPA)(void 0);_docs=(0,c.vPA)(void 0);_ownedView;_inputWarningTimer;_unsubscribeCategories;_lastSetupSignature;constructor(){this._inputWarningTimer=setTimeout(()=>{this.projectId()||console.warn('[cue-document-list] Required input "projectId" is not set. Pass the Cue project ID to load documents.'),this.sdkState()||console.warn('[cue-document-list] Required input "sdkState" is not set. Pass a { cue, view, or documents } object to enable document loading.')},3e3),(0,c.QZP)(()=>{const t=this.projectId(),e=this.sdkState(),s=e?.language??"en";if(console.debug("[CueDocumentListWC] input state changed",{projectId:t,uuids:this.uuids().length,hasSdkState:!!e,hasCue:!!e?.cue,hasView:!!e?.view,hasDocuments:!!e?.documents}),!t||!e)return this._clearRuntimeState(),void this.state.set("idle");const n={projectId:t,cue:e.cue,view:e.view,documents:e.documents,language:s,simple:this.simple()};if(this._isSameSetupSignature(n))return this.state.set("ready"),void this.errorMessage.set(null);this._setupFromSdkState(t,e),this._lastSetupSignature=n,this.state.set("ready"),this.errorMessage.set(null)}),(0,c.QZP)(()=>{const t=new Set(this.documentRefs().map(e=>e.id));this.documentData.update(e=>Object.fromEntries(Object.entries(e).filter(([n])=>t.has(n))))})}ngOnDestroy(){clearTimeout(this._inputWarningTimer),this._cleanupOwnedView(),this._unsubscribeCategories?.(),this._unsubscribeCategories=void 0}_setupFromSdkState(t,e){const s=e.language??"en";if(this.documentData.set({}),this._cleanupOwnedView(),this._unsubscribeCategories?.(),this._unsubscribeCategories=void 0,this.availableContentCategories.set(e.availableContentCategories?e.availableContentCategories:void 0),e.documents)return e.documents.setLanguage(s),this._docs.set(e.documents),void this._cue.set(e.cue);if(e.view)return e.view.setLanguage(s),this._docs.set(e.view.documents),this._cue.set(e.cue),void(this.simple()||this._bindCategoriesFromView(e.view));if(e.cue){if(this.simple())return this._docs.set(e.cue.createProjectDocuments(t)),this._cue.set(e.cue),void this.availableContentCategories.set(void 0);const n=e.cue.createProjectView(t,{language:s});return this._ownedView=n,this._docs.set(n.documents),this._cue.set(e.cue),void this._bindCategoriesFromView(n)}this._docs.set(void 0),this._cue.set(void 0),this.errorMessage.set("sdkState must include cue, view, or documents to load data."),this.state.set("error")}_bindCategoriesFromView(t){const e=()=>{this.availableContentCategories.set(t.availableContentCategories.get())};e(),this._unsubscribeCategories=t.availableContentCategories.subscribe(e)}_clearRuntimeState(){this._cleanupOwnedView(),this._unsubscribeCategories?.(),this._unsubscribeCategories=void 0,this._docs.set(void 0),this._cue.set(void 0),this.documentData.set({}),this.availableContentCategories.set(void 0),this.errorMessage.set(null),this._lastSetupSignature=void 0}_cleanupOwnedView(){this._ownedView&&(this._ownedView.destroy(),this._ownedView=void 0)}_isSameSetupSignature(t){const e=this._lastSetupSignature;return!!e&&e.projectId===t.projectId&&e.cue===t.cue&&e.view===t.view&&e.documents===t.documents&&e.language===t.language&&e.simple===t.simple}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=o.VBU({type:i,selectors:[["cue-document-list"]],inputs:{projectId:[1,"projectId"],uuids:[1,"uuids"],sdkState:[1,"sdkState"],detailedView:[1,"detailedView"],simple:[1,"simple"],pageSize:[1,"pageSize"],prefetchPages:[1,"prefetchPages"],showOpenInDocumentViewerAction:[1,"showOpenInDocumentViewerAction"],showOpenInFileManagerAction:[1,"showOpenInFileManagerAction"],customMenuItems:[1,"customMenuItems"],variant:[1,"variant"]},outputs:{clickedDocument:"clickedDocument",clickedDownloadDocument:"clickedDownloadDocument",clickedOpenInDir:"clickedOpenInDir",clickedOpen:"clickedOpen"},decls:2,vars:1,consts:[["direction","column","align","center","justify","center",2,"height","100%","width","100%","padding","8px"],[3,"documentRefs","documentData","handlers","availableContentCategories","detailedView","simple","pageSize","prefetchPages","showOpenInDocumentViewerAction","showOpenInFileManagerAction","customOverlayActions","variant"],[2,"color","#c44","font-size","13px"],[3,"clickedDocument","clickedDownloadDocument","clickedOpenInDir","clickedOpen","documentRefs","documentData","handlers","availableContentCategories","detailedView","simple","pageSize","prefetchPages","showOpenInDocumentViewerAction","showOpenInFileManagerAction","customOverlayActions","variant"]],template:function(e,s){1&e&&o.nVh(0,M,3,1,"cue-flexcontainer",0)(1,I,1,12,"cue-doc-list",1),2&e&&o.vxM("error"===s.state()?0:1)},dependencies:[C.g,b.n,O.Typography],styles:["[_nghost-%COMP%]{display:block;width:100%}"],changeDetection:0})}return i})()}}]);
|
|
1
|
+
"use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[382],{2382(M,w,_){_.d(w,{CueDocumentList:()=>j});var D=_(467),u=_(7705),a=_(5802),v=_(2271),b=_(4879),g=_(2065),m=_(4372),s=_(5381),p=_(2245),c=_(5547);function I(o,y){if(1&o&&(c.j41(0,"cue-flexcontainer",0)(1,"cue-typography",2),c.EFF(2),c.k0s()()),2&o){const t=c.XpG();c.R7$(2),c.SpI(" ",t.errorMessage()," ")}}function A(o,y){1&o&&(c.j41(0,"cue-flexcontainer",0)(1,"cue-typography",3),c.EFF(2," Loading documents\u2026 "),c.k0s()())}function E(o,y){if(1&o){const t=c.RV6();c.j41(0,"cue-doc-list",4),c.bIt("clickedDocument",function(n){a.eBV(t);const i=c.XpG();return a.Njj(i.clickedDocument.emit(n))})("clickedDownloadDocument",function(n){a.eBV(t);const i=c.XpG();return a.Njj(i.clickedDownloadDocument.emit(n))})("clickedOpenInDir",function(n){a.eBV(t);const i=c.XpG();return a.Njj(i.clickedOpenInDir.emit(n))})("clickedOpen",function(n){a.eBV(t);const i=c.XpG();return a.Njj(i.clickedOpen.emit(n))}),c.k0s()}if(2&o){const t=c.XpG();c.Y8G("documentRefs",t.documentRefs())("documentData",t.documentData())("handlers",t.handlers())("availableContentCategories",t.availableContentCategories())("detailedView",t.detailedView())("simple",t.simple())("pageSize",t.pageSize())("prefetchPages",t.prefetchPages())("showOpenInDocumentViewerAction",t.showOpenInDocumentViewerAction())("showOpenInFileManagerAction",t.showOpenInFileManagerAction())("customOverlayActions",t.customOverlayActions())("variant",t.variant())}}function O(o){return o.split("?")[0].trim()}let j=(()=>{class o{projectId=(0,u.hFB)(void 0);uuids=(0,u.hFB)([]);suffixes=(0,u.hFB)(void 0);mimeTypes=(0,u.hFB)(void 0);contentCategories=(0,u.hFB)(void 0);sdkState=(0,u.hFB)(void 0);detailedView=(0,u.hFB)(!1);simple=(0,u.hFB)(!1);pageSize=(0,u.hFB)(10);prefetchPages=(0,u.hFB)(3);showOpenInDocumentViewerAction=(0,u.hFB)(!1);showOpenInFileManagerAction=(0,u.hFB)(!1);customMenuItems=(0,u.hFB)([]);variant=(0,u.hFB)("none");clickedDocument=(0,u.CGW)();clickedDownloadDocument=(0,u.CGW)();clickedOpenInDir=(0,u.CGW)();clickedOpen=(0,u.CGW)();state=(0,a.vPA)("idle");errorMessage=(0,a.vPA)(null);documentData=(0,a.vPA)({});availableContentCategories=(0,a.vPA)(void 0);_filterResolvedUuids=(0,a.vPA)(void 0);documentRefs=(0,v.EW)(()=>{const t=new Set;return(void 0!==this._filterResolvedUuids()?this._filterResolvedUuids()??[]:this.uuids()??[]).map(O).filter(n=>!!n).filter(n=>!t.has(n)&&(t.add(n),!0)).map(n=>({id:n}))});customOverlayActions=(0,v.EW)(()=>(this.customMenuItems()||[]).map(e=>({label:e.label,icon:e.icon,action:n=>{e.action(n.rowData,n)}})));handlers=(0,v.EW)(()=>{var t=this;const e=this._docs();if(e)return{requestData:(n=(0,D.A)(function*(i){const l=i.map(O).filter(r=>!!r),d=l.filter(r=>!t.documentData()[r]);if(console.debug("[CueDocumentListWC] requestData",{requestedCount:l.length,missingCount:d.length,missing:d}),d.length)try{const r=e,h=t.simple()&&r.fetchDocumentDataSimple?yield r.fetchDocumentDataSimple(d):yield e.fetchDocumentData(d);console.debug("[CueDocumentListWC] fetchDocumentData resolved",{fetchedCount:Object.keys(h).length,ids:Object.keys(h)});const C={};Object.values(h).forEach(f=>{C[f.id]=function P(o){return{id:o.id,path:o.path,suffix:o.suffix,size:o.size,contentIRI:o.contentIRI,providerId:o.providerId,tags:o.tags??[],summary:o.summary??"",categories:o.categories??[],subject:o.subject,relevance:0}}(f)}),Object.keys(C).length>0&&t.documentData.update(f=>({...f,...C}))}catch(r){console.error("[CueDocumentListWC] Failed to fetch document data:",r),t.errorMessage.set(r instanceof Error?r.message:String(r)),t.state.set("error")}}),function(l){return n.apply(this,arguments)}),requestDownload:function(){var n=(0,D.A)(function*(i){const l=t._cue(),d=t.projectId();if(l&&d)try{const r=yield l.storage.getDownloadUrl(d,i.id,i.suffix,"raw"),h=yield fetch(r);if(!h.ok)throw new Error(`Download failed: ${h.status} ${h.statusText}`);const C=yield h.blob(),f=(0,m.M)(i.path)||`${i.id}${i.suffix||""}`;(0,g.KE)(C,f)}catch(r){console.error("[CueDocumentListWC] Failed to download document:",r)}});return function(l){return n.apply(this,arguments)}}(),requestOpen:(n,i)=>{console.log("[CueDocumentListWC] requestOpen",{documentUUID:n,document:i})},requestOpenInDir:(n,i)=>{console.log("[CueDocumentListWC] requestOpenInDir",{documentUUID:n,document:i})}};var n});_cue=(0,a.vPA)(void 0);_docs=(0,a.vPA)(void 0);_ownedView;_inputWarningTimer;_unsubscribeCategories;_lastSetupSignature;constructor(){this._inputWarningTimer=setTimeout(()=>{this.projectId()||console.warn('[cue-document-list] Required input "projectId" is not set. Pass the Cue project ID to load documents.'),this.sdkState()||console.warn('[cue-document-list] Required input "sdkState" is not set. Pass a { cue, view, or documents } object to enable document loading.')},3e3),(0,a.QZP)(()=>{const t=this.projectId(),e=this.sdkState(),n=e?.language??"en";if(console.debug("[CueDocumentListWC] input state changed",{projectId:t,uuids:this.uuids().length,hasSdkState:!!e,hasCue:!!e?.cue,hasView:!!e?.view,hasDocuments:!!e?.documents}),!t||!e)return this._clearRuntimeState(),void this.state.set("idle");const i={projectId:t,cue:e.cue,view:e.view,documents:e.documents,language:n,simple:this.simple()};if(this._isSameSetupSignature(i))return this.state.set("ready"),void this.errorMessage.set(null);this._setupFromSdkState(t,e),this._lastSetupSignature=i,this.state.set("ready"),this.errorMessage.set(null)}),(0,a.QZP)(()=>{const t=this.suffixes(),e=this.mimeTypes(),n=this.contentCategories(),i=this._docs();void 0!==t||void 0!==e||void 0!==n?this._fetchByFilter(t,e,n,i):this._filterResolvedUuids.set(void 0)}),(0,a.QZP)(()=>{const t=new Set(this.documentRefs().map(e=>e.id));this.documentData.update(e=>Object.fromEntries(Object.entries(e).filter(([i])=>t.has(i))))})}ngOnDestroy(){clearTimeout(this._inputWarningTimer),this._cleanupOwnedView(),this._unsubscribeCategories?.(),this._unsubscribeCategories=void 0}_setupFromSdkState(t,e){const n=e.language??"en";if(this.documentData.set({}),this._cleanupOwnedView(),this._unsubscribeCategories?.(),this._unsubscribeCategories=void 0,this.availableContentCategories.set(e.availableContentCategories?e.availableContentCategories:void 0),e.documents)return e.documents.setLanguage(n),this._docs.set(e.documents),void this._cue.set(e.cue);if(e.view)return e.view.setLanguage(n),this._docs.set(e.view.documents),this._cue.set(e.cue),void(this.simple()||this._bindCategoriesFromView(e.view));if(e.cue){if(this.simple())return this._docs.set(e.cue.createProjectDocuments(t)),this._cue.set(e.cue),void this.availableContentCategories.set(void 0);const i=e.cue.createProjectView(t,{language:n});return this._ownedView=i,this._docs.set(i.documents),this._cue.set(e.cue),void this._bindCategoriesFromView(i)}this._docs.set(void 0),this._cue.set(void 0),this.errorMessage.set("sdkState must include cue, view, or documents to load data."),this.state.set("error")}_bindCategoriesFromView(t){const e=()=>{this.availableContentCategories.set(t.availableContentCategories.get())};e(),this._unsubscribeCategories=t.availableContentCategories.subscribe(e)}_clearRuntimeState(){this._cleanupOwnedView(),this._unsubscribeCategories?.(),this._unsubscribeCategories=void 0,this._docs.set(void 0),this._cue.set(void 0),this.documentData.set({}),this.availableContentCategories.set(void 0),this.errorMessage.set(null),this._lastSetupSignature=void 0}_cleanupOwnedView(){this._ownedView&&(this._ownedView.destroy(),this._ownedView=void 0)}_fetchByFilter(t,e,n,i){var l=this;return(0,D.A)(function*(){if(i){l.state.set("loading");try{let d;if(void 0!==t&&t.length>0)d=yield i.documentsBySuffix(t);else if(void 0!==e&&e.length>0)d=yield i.documentsByMime(e);else{if(!(void 0!==n&&n.length>0))return l._filterResolvedUuids.set([]),void l.state.set("ready");d=yield i.documentsByContentCategory(n)}l._filterResolvedUuids.set(d.map(r=>r.uuid)),l.state.set("ready")}catch(d){console.error("[CueDocumentListWC] Failed to fetch documents by filter",d),l.errorMessage.set(d instanceof Error?d.message:"Failed to load documents."),l.state.set("error")}}else l._filterResolvedUuids.set([])})()}_isSameSetupSignature(t){const e=this._lastSetupSignature;return!!e&&e.projectId===t.projectId&&e.cue===t.cue&&e.view===t.view&&e.documents===t.documents&&e.language===t.language&&e.simple===t.simple}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=c.VBU({type:o,selectors:[["cue-document-list"]],inputs:{projectId:[1,"projectId"],uuids:[1,"uuids"],suffixes:[1,"suffixes"],mimeTypes:[1,"mimeTypes"],contentCategories:[1,"contentCategories"],sdkState:[1,"sdkState"],detailedView:[1,"detailedView"],simple:[1,"simple"],pageSize:[1,"pageSize"],prefetchPages:[1,"prefetchPages"],showOpenInDocumentViewerAction:[1,"showOpenInDocumentViewerAction"],showOpenInFileManagerAction:[1,"showOpenInFileManagerAction"],customMenuItems:[1,"customMenuItems"],variant:[1,"variant"]},outputs:{clickedDocument:"clickedDocument",clickedDownloadDocument:"clickedDownloadDocument",clickedOpenInDir:"clickedOpenInDir",clickedOpen:"clickedOpen"},decls:3,vars:1,consts:[["direction","column","align","center","justify","center",2,"height","100%","width","100%","padding","8px"],[3,"documentRefs","documentData","handlers","availableContentCategories","detailedView","simple","pageSize","prefetchPages","showOpenInDocumentViewerAction","showOpenInFileManagerAction","customOverlayActions","variant"],[2,"color","#c44","font-size","13px"],[2,"color","#9ca3af","font-size","13px"],[3,"clickedDocument","clickedDownloadDocument","clickedOpenInDir","clickedOpen","documentRefs","documentData","handlers","availableContentCategories","detailedView","simple","pageSize","prefetchPages","showOpenInDocumentViewerAction","showOpenInFileManagerAction","customOverlayActions","variant"]],template:function(e,n){1&e&&c.nVh(0,I,3,1,"cue-flexcontainer",0)(1,A,3,0,"cue-flexcontainer",0)(2,E,1,12,"cue-doc-list",1),2&e&&c.vxM("error"===n.state()?0:"loading"===n.state()?1:2)},dependencies:[b.g,s.n,p.Typography],styles:["[_nghost-%COMP%]{display:block;width:100%}"],changeDetection:0})}return o})()},2065(M,w,_){function a(g,m,s="text/plain"){return function D(g,m="data.zip"){const s=document.createElement("a"),p=URL.createObjectURL(g);s.href=p,s.download=m,document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(p)}(new Blob([g],{type:s}),m)}function v(g,m){const s=document.createElement("a");s.style.display="hidden",s.setAttribute("href",window.URL.createObjectURL(g)),s.setAttribute("download",m),document.body.appendChild(s),s.click(),s.remove()}_.d(w,{KE:()=>v,YN:()=>a})}}]);
|
package/41.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[41],{5448(N,B,d){"use strict";d.d(B,{L:()=>P});var g=d(7705),S=d(2245),a=d(5547);const D=["*"];let P=(()=>{class m{fontSize=(0,g.hFB)("m");italic=(0,g.hFB)(!1);noWrap=(0,g.hFB)(!0);static \u0275fac=function(b){return new(b||m)};static \u0275cmp=a.VBU({type:m,selectors:[["cue-button-label"]],inputs:{fontSize:[1,"fontSize"],italic:[1,"italic"],noWrap:[1,"noWrap"]},ngContentSelectors:D,decls:3,vars:3,consts:[[3,"size","italic","noWrap"]],template:function(b,p){1&b&&(a.NAR(),a.j41(0,"div")(1,"cue-typography",0),a.SdG(2),a.k0s()()),2&b&&(a.R7$(),a.Y8G("size",p.fontSize())("italic",p.italic())("noWrap",p.noWrap()))},dependencies:[S.Typography],styles:["div[_ngcontent-%COMP%]{transform:translateY(.05em)}"]})}return m})()},9695(N,B,d){"use strict";d.d(B,{d:()=>m});var g=d(7705),S=d(29),a=d(5547);function D(i,w){if(1&i&&a.nrm(0,"cue-svg-icon",2),2&i){const b=a.XpG();a.Y8G("name",b.iconChecked())}}function P(i,w){if(1&i&&a.nrm(0,"cue-svg-icon",2),2&i){const b=a.XpG();a.Y8G("name",b.icon())}}let m=(()=>{class i{size=(0,g.hFB)("m");icon=(0,g.hFB)(void 0);iconChecked=(0,g.hFB)(void 0);disabled=(0,g.hFB)(!1);checked=(0,g.geq)(!1);toggleChange=(0,g.CGW)();toggle(){this.checked.set(!this.checked()),this.toggleChange.emit(this.checked())}static \u0275fac=function(p){return new(p||i)};static \u0275cmp=a.VBU({type:i,selectors:[["cue-input-switch"]],hostVars:5,hostBindings:function(p,_){2&p&&(a.BMQ("size",_.size()),a.AVh("checked",_.checked())("disabled",_.disabled()))},inputs:{size:[1,"size"],icon:[1,"icon"],iconChecked:[1,"iconChecked"],disabled:[1,"disabled"],checked:[1,"checked"]},outputs:{checked:"checkedChange",toggleChange:"toggleChange"},decls:4,vars:3,consts:[["type","checkbox",3,"click","checked","disabled"],[1,"indicator"],[3,"name"]],template:function(p,_){1&p&&(a.j41(0,"input",0),a.bIt("click",function(){return _.toggle()}),a.k0s(),a.j41(1,"div",1),a.nVh(2,D,1,1,"cue-svg-icon",2)(3,P,1,1,"cue-svg-icon",2),a.k0s()),2&p&&(a.Y8G("checked",_.checked())("disabled",_.disabled()),a.R7$(2),a.vxM(_.checked()&&_.iconChecked()?2:_.icon()?3:-1))},dependencies:[S.A],styles:["[_nghost-%COMP%]{--cue-input-switch-height: 18px;--cue-input-switch-width: calc(var(--cue-input-switch-height) * 1.7);--cue-input-switch-inset: 2px;--cue-input-switch-indicator-width: calc( var(--cue-input-switch-height) - (2 * var(--cue-input-switch-inset)) );--cue-input-switch-icon-width: calc( var(--cue-input-switch-indicator-width) - (2 * var(--cue-input-switch-inset)) );display:block;flex-shrink:0;position:relative;height:var(--cue-input-switch-height);width:var(--cue-input-switch-width);border-radius:var(--cue-input-switch-height);--cue-icon-width: var(--cue-input-switch-icon-width);background:var(--cue-input-switch-background);transition:background-color .4s ease}[size=xs][_nghost-%COMP%]{--cue-input-switch-height: 12px;--cue-input-switch-inset: 1px}[size=s][_nghost-%COMP%]{--cue-input-switch-height: 14px;--cue-input-switch-inset: 1px}[size=m][_nghost-%COMP%]{--cue-input-switch-height: 18px;--cue-input-switch-inset: 2px}[size=l][_nghost-%COMP%]{--cue-input-switch-height: 22px;--cue-input-switch-inset: 3px}[size=xl][_nghost-%COMP%]{--cue-input-switch-height: 28px;--cue-input-switch-inset: 3px}@container cue-container (width < 20em){[_nghost-%COMP%]{--cue-input-switch-height: 16px}[size=xs][_nghost-%COMP%]{--cue-input-switch-height: 10px}[size=s][_nghost-%COMP%]{--cue-input-switch-height: 12px}[size=m][_nghost-%COMP%]{--cue-input-switch-height: 16px}[size=l][_nghost-%COMP%]{--cue-input-switch-height: 18px}[size=xl][_nghost-%COMP%]{--cue-input-switch-height: 20px}}.checked[_nghost-%COMP%]{background:var(--cue-input-switch-checked-background)}.disabled[_nghost-%COMP%]{background:var(--cue-input-switch-disabled-background);cursor:default}[_nghost-%COMP%] .indicator[_ngcontent-%COMP%]{pointer-events:none;position:absolute;left:var(--cue-input-switch-inset);top:var(--cue-input-switch-inset);width:var(--cue-input-switch-indicator-width);aspect-ratio:1;border-radius:50%;display:flex;align-items:center;justify-content:center;background-color:var(--cue-input-switch-indicator-background);color:var(--cue-input-switch-indicator-foreground);transition:left .4s ease,background-color .4s ease,color .4s ease}.checked[_nghost-%COMP%] .indicator[_ngcontent-%COMP%]{left:calc(var(--cue-input-switch-width) - var(--cue-input-switch-inset) - var( --cue-input-switch-indicator-width ));background:var(--cue-input-switch-checked-indicator-background);color:var(--cue-input-switch-checked-indicator-foreground)}.disabled[_nghost-%COMP%] .indicator[_ngcontent-%COMP%]{background:var(--cue-input-switch-disabled-indicator-background);color:var(--cue-input-switch-disabled-indicator-foreground)}input[_ngcontent-%COMP%]{all:unset;position:absolute;inset:0;cursor:pointer;border-radius:var(--cue-input-switch-height)}input[_ngcontent-%COMP%]:focus-visible:not(:disabled) + .indicator[_ngcontent-%COMP%]{outline:1px solid var(--cue-input-switch-focus-color);outline-offset:2px}"]})}return i})()},5745(N,B,d){"use strict";d.d(B,{a:()=>V});var g=d(7705),S=d(5802),a=d(5187),D=d(5381),P=d(29),m=d(2245),i=d(5547);const w=["dialog"],b=["*"];function p(C,U){if(1&C&&(i.j41(0,"cue-typography",4),i.EFF(1),i.k0s()),2&C){const h=i.XpG(2);i.R7$(),i.JRh(h.label())}}function _(C,U){if(1&C){const h=i.RV6();i.j41(0,"cue-svg-icon",7),i.bIt("click",function(){S.eBV(h);const O=i.XpG(2);return S.Njj(O.onClose())}),i.k0s()}}function A(C,U){if(1&C&&(i.j41(0,"cue-flexcontainer",3),i.bIt("click",function(k){return k.stopPropagation()}),i.nVh(1,p,2,1,"cue-typography",4),i.j41(2,"cue-card",5),i.bIt("click",function(k){return k.stopPropagation()}),i.nVh(3,_,1,0,"cue-svg-icon",6),i.j41(4,"cue-flexcontainer"),i.SdG(5),i.k0s()()()),2&C){const h=i.XpG();i.R7$(),i.vxM(h.label()?1:-1),i.R7$(),i.Aen(h.minWidth()?"position: relative; min-width: min("+h.minWidth()+", 80vw)":"position: relative"),i.R7$(),i.vxM(h.displayCloseBtn()?3:-1),i.R7$(),i.Aen("width: 100%; margin-top: "+(h.displayCloseBtn()?"16px":"0"))}}let V=(()=>{class C{visible=(0,g.geq)(!0);closeOnBackgroundClick=(0,g.hFB)(!0);displayCloseBtn=(0,g.hFB)(!0);label=(0,g.hFB)("");minWidth=(0,g.hFB)();close=(0,g.CGW)();dialogRef=g.ebz.required("dialog");constructor(){(0,S.QZP)(()=>{const h=this.dialogRef().nativeElement;this.visible()?h.open||h.showModal():h.open&&h.close()})}onBackdropClick(){this.closeOnBackgroundClick()&&this.onClose()}onClose(){this.visible.set(!1),this.close.emit()}static \u0275fac=function(k){return new(k||C)};static \u0275cmp=i.VBU({type:C,selectors:[["cue-modal"]],viewQuery:function(k,O){1&k&&i.wEZ(O.dialogRef,w,5),2&k&&i.NyB()},inputs:{visible:[1,"visible"],closeOnBackgroundClick:[1,"closeOnBackgroundClick"],displayCloseBtn:[1,"displayCloseBtn"],label:[1,"label"],minWidth:[1,"minWidth"]},outputs:{visible:"visibleChange",close:"close"},ngContentSelectors:b,decls:3,vars:1,consts:[["dialog",""],[1,"modal-dialog",3,"cancel","click"],["direction","column","gap","s","align","center",2,"max-width","80vw"],["direction","column","gap","s","align","center",2,"max-width","80vw",3,"click"],["weight","medium"],[3,"click"],["name","close",1,"close-btn"],["name","close",1,"close-btn",3,"click"]],template:function(k,O){1&k&&(i.NAR(),i.j41(0,"dialog",1,0),i.bIt("cancel",function(){return O.onClose()})("click",function(){return O.onBackdropClick()}),i.nVh(2,A,6,6,"cue-flexcontainer",2),i.k0s()),2&k&&(i.R7$(2),i.vxM(O.visible()?2:-1))},dependencies:[a.Z,D.n,P.A,m.Typography],styles:[".close-btn[_ngcontent-%COMP%]{position:absolute;right:8px;top:8px;cursor:pointer}.modal-dialog[_ngcontent-%COMP%]{padding:0;border:none;background:transparent;overflow:visible;margin:auto;outline:none}.modal-dialog[_ngcontent-%COMP%]::backdrop{background-color:var(--cue-modal-overlay-color, rgba(0, 0, 0, .5))}"]})}return C})()},7374(N){N.exports=function(){"use strict";var d=6e4,g=36e5,S="millisecond",a="second",D="minute",P="hour",m="day",i="week",w="month",b="quarter",p="year",_="date",A="Invalid Date",V=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,C=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,U={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(s){var n=["th","st","nd","rd"],t=s%100;return"["+s+(n[(t-20)%10]||n[t]||n[0])+"]"}},h=function(s,n,t){var c=String(s);return!c||c.length>=n?s:""+Array(n+1-c.length).join(t)+s},k={s:h,z:function(s){var n=-s.utcOffset(),t=Math.abs(n),c=Math.floor(t/60),e=t%60;return(n<=0?"+":"-")+h(c,2,"0")+":"+h(e,2,"0")},m:function s(n,t){if(n.date()<t.date())return-s(t,n);var c=12*(t.year()-n.year())+(t.month()-n.month()),e=n.clone().add(c,w),o=t-e<0,r=n.clone().add(c+(o?-1:1),w);return+(-(c+(t-e)/(o?e-r:r-e))||0)},a:function(s){return s<0?Math.ceil(s)||0:Math.floor(s)},p:function(s){return{M:w,y:p,w:i,d:m,D:_,h:P,m:D,s:a,ms:S,Q:b}[s]||String(s||"").toLowerCase().replace(/s$/,"")},u:function(s){return void 0===s}},O="en",E={};E[O]=U;var H="$isDayjsObject",G=function(s){return s instanceof Y||!(!s||!s[H])},F=function s(n,t,c){var e;if(!n)return O;if("string"==typeof n){var o=n.toLowerCase();E[o]&&(e=o),t&&(E[o]=t,e=o);var r=n.split("-");if(!e&&r.length>1)return s(r[0])}else{var l=n.name;E[l]=n,e=l}return!c&&e&&(O=e),e||!c&&O},v=function(s,n){if(G(s))return s.clone();var t="object"==typeof n?n:{};return t.date=s,t.args=arguments,new Y(t)},u=k;u.l=F,u.i=G,u.w=function(s,n){return v(s,{locale:n.$L,utc:n.$u,x:n.$x,$offset:n.$offset})};var Y=function(){function s(t){this.$L=F(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[H]=!0}var n=s.prototype;return n.parse=function(t){this.$d=function(c){var e=c.date,o=c.utc;if(null===e)return new Date(NaN);if(u.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match(V);if(r){var l=r[2]-1||0,f=(r[7]||"0").substring(0,3);return o?new Date(Date.UTC(r[1],l,r[3]||1,r[4]||0,r[5]||0,r[6]||0,f)):new Date(r[1],l,r[3]||1,r[4]||0,r[5]||0,r[6]||0,f)}}return new Date(e)}(t),this.init()},n.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},n.$utils=function(){return u},n.isValid=function(){return this.$d.toString()!==A},n.isSame=function(t,c){var e=v(t);return this.startOf(c)<=e&&e<=this.endOf(c)},n.isAfter=function(t,c){return v(t)<this.startOf(c)},n.isBefore=function(t,c){return this.endOf(c)<v(t)},n.$g=function(t,c,e){return u.u(t)?this[c]:this.set(e,t)},n.unix=function(){return Math.floor(this.valueOf()/1e3)},n.valueOf=function(){return this.$d.getTime()},n.startOf=function(t,c){var e=this,o=!!u.u(c)||c,r=u.p(t),l=function(R,y){var T=u.w(e.$u?Date.UTC(e.$y,y,R):new Date(e.$y,y,R),e);return o?T:T.endOf(m)},f=function(R,y){return u.w(e.toDate()[R].apply(e.toDate("s"),(o?[0,0,0,0]:[23,59,59,999]).slice(y)),e)},M=this.$W,$=this.$M,x=this.$D,z="set"+(this.$u?"UTC":"");switch(r){case p:return o?l(1,0):l(31,11);case w:return o?l(1,$):l(0,$+1);case i:var W=this.$locale().weekStart||0,L=(M<W?M+7:M)-W;return l(o?x-L:x+(6-L),$);case m:case _:return f(z+"Hours",0);case P:return f(z+"Minutes",1);case D:return f(z+"Seconds",2);case a:return f(z+"Milliseconds",3);default:return this.clone()}},n.endOf=function(t){return this.startOf(t,!1)},n.$set=function(t,c){var e,o=u.p(t),r="set"+(this.$u?"UTC":""),l=(e={},e[m]=r+"Date",e[_]=r+"Date",e[w]=r+"Month",e[p]=r+"FullYear",e[P]=r+"Hours",e[D]=r+"Minutes",e[a]=r+"Seconds",e[S]=r+"Milliseconds",e)[o],f=o===m?this.$D+(c-this.$W):c;if(o===w||o===p){var M=this.clone().set(_,1);M.$d[l](f),M.init(),this.$d=M.set(_,Math.min(this.$D,M.daysInMonth())).$d}else l&&this.$d[l](f);return this.init(),this},n.set=function(t,c){return this.clone().$set(t,c)},n.get=function(t){return this[u.p(t)]()},n.add=function(t,c){var e,o=this;t=Number(t);var r=u.p(c),l=function($){var x=v(o);return u.w(x.date(x.date()+Math.round($*t)),o)};if(r===w)return this.set(w,this.$M+t);if(r===p)return this.set(p,this.$y+t);if(r===m)return l(1);if(r===i)return l(7);var f=(e={},e[D]=d,e[P]=g,e[a]=1e3,e)[r]||1,M=this.$d.getTime()+t*f;return u.w(M,this)},n.subtract=function(t,c){return this.add(-1*t,c)},n.format=function(t){var c=this,e=this.$locale();if(!this.isValid())return e.invalidDate||A;var o=t||"YYYY-MM-DDTHH:mm:ssZ",r=u.z(this),l=this.$H,f=this.$m,M=this.$M,$=e.weekdays,x=e.months,W=function(y,T,I,j){return y&&(y[T]||y(c,o))||I[T].slice(0,j)},L=function(y){return u.s(l%12||12,y,"0")},R=e.meridiem||function(y,T,I){var j=y<12?"AM":"PM";return I?j.toLowerCase():j};return o.replace(C,function(y,T){return T||function(I){switch(I){case"YY":return String(c.$y).slice(-2);case"YYYY":return u.s(c.$y,4,"0");case"M":return M+1;case"MM":return u.s(M+1,2,"0");case"MMM":return W(e.monthsShort,M,x,3);case"MMMM":return W(x,M);case"D":return c.$D;case"DD":return u.s(c.$D,2,"0");case"d":return String(c.$W);case"dd":return W(e.weekdaysMin,c.$W,$,2);case"ddd":return W(e.weekdaysShort,c.$W,$,3);case"dddd":return $[c.$W];case"H":return String(l);case"HH":return u.s(l,2,"0");case"h":return L(1);case"hh":return L(2);case"a":return R(l,f,!0);case"A":return R(l,f,!1);case"m":return String(f);case"mm":return u.s(f,2,"0");case"s":return String(c.$s);case"ss":return u.s(c.$s,2,"0");case"SSS":return u.s(c.$ms,3,"0");case"Z":return r}return null}(y)||r.replace(":","")})},n.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},n.diff=function(t,c,e){var o,r=this,l=u.p(c),f=v(t),M=(f.utcOffset()-this.utcOffset())*d,$=this-f,x=function(){return u.m(r,f)};switch(l){case p:o=x()/12;break;case w:o=x();break;case b:o=x()/3;break;case i:o=($-M)/6048e5;break;case m:o=($-M)/864e5;break;case P:o=$/g;break;case D:o=$/d;break;case a:o=$/1e3;break;default:o=$}return e?o:u.a(o)},n.daysInMonth=function(){return this.endOf(w).$D},n.$locale=function(){return E[this.$L]},n.locale=function(t,c){if(!t)return this.$L;var e=this.clone(),o=F(t,c,!0);return o&&(e.$L=o),e},n.clone=function(){return u.w(this.$d,this)},n.toDate=function(){return new Date(this.valueOf())},n.toJSON=function(){return this.isValid()?this.toISOString():null},n.toISOString=function(){return this.$d.toISOString()},n.toString=function(){return this.$d.toUTCString()},s}(),K=Y.prototype;return v.prototype=K,[["$ms",S],["$s",a],["$m",D],["$H",P],["$W",m],["$M",w],["$y",p],["$D",_]].forEach(function(s){K[s[1]]=function(n){return this.$g(n,s[0],s[1])}}),v.extend=function(s,n){return s.$i||(s(n,Y,v),s.$i=!0),v},v.locale=F,v.isDayjs=G,v.unix=function(s){return v(1e3*s)},v.en=E[O],v.Ls=E,v.p={},v}()}}]);
|