@qaecy/cue-ui 0.0.38 → 0.0.40

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 CHANGED
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[112],{4853(B,F,l){l.d(F,{H:()=>j});var _=l(7705),u=l(5802),m=l(7089),c=l(7023),e=l(5381),f=l(5971),E=l(3319),x=l(356),R=l(6279),r=l(5547);const y=()=>({position:"bottomleft"}),p=(C,T)=>T.label||C;function P(C,T){if(1&C){const v=r.RV6();r.j41(0,"cue-menu-item",4),r.bIt("click",function(){const D=u.eBV(v).$implicit;return u.Njj(D.action())}),r.EFF(1),r.k0s()}if(2&C){const v=T.$implicit;r.Y8G("selected",v.selected),r.R7$(),r.JRh(v.label)}}function w(C,T){if(1&C&&(r.j41(0,"cue-menu-wrap"),r.Z7z(1,P,2,2,"cue-menu-item",3,p),r.k0s()),2&C){const v=r.XpG();r.R7$(),r.Dyx(v.contextMenuItems())}}function O(C,T){if(1&C){const v=r.RV6();r.j41(0,"cue-button",5),r.bIt("click",function(D){const L=u.eBV(v).$implicit,k=r.XpG();return u.Njj(k.handleClick(D,L))}),r.nrm(1,"cue-button-icon",6),r.k0s()}if(2&C){const v=T.$implicit,b=r.XpG(),D=r.sdS(1);r.Y8G("cueTooltip",v.label)("variant",v.variant?v.variant:b.variant())("size",b.size())("cueContextMenu",D)("contextMenuData",r.lJ4(7,y))("cueContextEnabled",void 0!==v.contextMenuItems&&v.contextMenuItems.length>0),r.R7$(),r.Y8G("icon",v.icon)}}let j=(()=>{class C{items=_.hFB.required();noGap=(0,_.hFB)(!0);direction=(0,_.hFB)("row");size=(0,_.hFB)("xs");variant=(0,_.hFB)("tertiary");mouseEnter=(0,_.CGW)();mouseLeave=(0,_.CGW)();contextMenuItems=(0,u.vPA)([]);handleClick(v,b){v.stopPropagation(),b.contextMenuItems&&b.contextMenuItems.length>0?this.contextMenuItems.set(b.contextMenuItems):b.action&&(this.contextMenuItems.set([]),b.action())}static \u0275fac=function(b){return new(b||C)};static \u0275cmp=r.VBU({type:C,selectors:[["cue-entity-menu"]],inputs:{items:[1,"items"],noGap:[1,"noGap"],direction:[1,"direction"],size:[1,"size"],variant:[1,"variant"]},outputs:{mouseEnter:"mouseEnter",mouseLeave:"mouseLeave"},decls:5,vars:2,consts:[["contextMenu",""],["gap","s","justify","end",2,"width","100%",3,"mouseenter","mouseleave","direction","noGap"],["trigger","leftclick",3,"cueTooltip","variant","size","cueContextMenu","contextMenuData","cueContextEnabled"],[3,"selected"],[3,"click","selected"],["trigger","leftclick",3,"click","cueTooltip","variant","size","cueContextMenu","contextMenuData","cueContextEnabled"],[3,"icon"]],template:function(b,D){1&b&&(r.DNE(0,w,3,0,"ng-template",null,0,r.C5r),r.j41(2,"cue-flexcontainer",1),r.bIt("mouseenter",function(){return D.mouseEnter.emit()})("mouseleave",function(){return D.mouseLeave.emit()}),r.Z7z(3,O,2,8,"cue-button",2,p),r.k0s()),2&b&&(r.R7$(2),r.Y8G("direction",D.direction())("noGap",D.noGap()),r.R7$(),r.Dyx(D.items()))},dependencies:[e.n,f.$,m.d,E.a,c.Q,x.M,R.D],encapsulation:2,changeDetection:0})}return C})()},1024(B,F,l){l.d(F,{p:()=>m});var _=l(5547);const u=["*"];let m=(()=>{class c{static \u0275fac=function(E){return new(E||c)};static \u0275cmp=_.VBU({type:c,selectors:[["cue-key-val-list"]],ngContentSelectors:u,decls:2,vars:0,consts:[[1,"key-val-list"]],template:function(E,x){1&E&&(_.NAR(),_.rj2(0,"div",0),_.SdG(1),_.eux())},styles:[".key-val-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:var(--cue-grid-gap-s)}"]})}return c})()},9421(B,F,l){l.d(F,{F:()=>E});var _=l(7705),u=l(5802),m=l(2271),c=l(7335),e=l(2245),f=l(5547);let E=(()=>{class x{entityMenuDirective;size=(0,_.hFB)("m");key=_.hFB.required();val=_.geq.required();options=(0,_.hFB)([]);suffix=(0,_.hFB)("");valueChange=(0,_.CGW)();editModeEnabled=(0,u.vPA)(!1);valueChanged=(0,m.EW)(()=>this.val()!==this.newValue());newValue=(0,m.uu)(()=>this.val());labelSize=(0,m.EW)(()=>{switch(this.size()){case"s":return"xs";case"m":return"s";case"l":return"m";case"xl":return"l"}});onKeyPress(r){this.editModeEnabled()&&("Escape"===r.key?(this._reset(),r.stopPropagation()):"Enter"===r.key&&this._emitChange())}saveCancelMenu=(0,m.EW)(()=>{const r=[{icon:"close",label:"Cancel",action:()=>this._reset()}];return this.valueChanged()&&r.push({icon:"save",label:"Save",action:()=>this._emitChange()}),r});selectionChange(r){this.newValue.set(r?.toString()??"")}inputChange(r){this.newValue.set(r)}_emitChange(){this.valueChange.emit(this.newValue()),this.val.set(this.newValue()),this.editModeEnabled.set(!1)}_reset(){this.newValue.set(this.val()),this.editModeEnabled.set(!1)}static \u0275fac=function(y){return new(y||x)};static \u0275cmp=f.VBU({type:x,selectors:[["cue-key-val"]],viewQuery:function(y,p){if(1&y&&f.GBs(c.e,5),2&y){let P;f.mGM(P=f.lsd())&&(p.entityMenuDirective=P.first)}},hostBindings:function(y,p){1&y&&f.bIt("keydown",function(w){return p.onKeyPress(w)},f.EBC)},inputs:{size:[1,"size"],key:[1,"key"],val:[1,"val"],options:[1,"options"],suffix:[1,"suffix"]},outputs:{val:"valChange",valueChange:"valueChange"},decls:8,vars:5,consts:[[1,"key-val-container"],[3,"size"],[1,"value-content"]],template:function(y,p){1&y&&(f.j41(0,"dl",0)(1,"dt")(2,"cue-typography",1),f.EFF(3),f.k0s()(),f.j41(4,"dd")(5,"cue-typography",1)(6,"span",2),f.EFF(7),f.k0s()()()()),2&y&&(f.R7$(2),f.Y8G("size",p.labelSize()),f.R7$(),f.JRh(p.key()),f.R7$(2),f.Y8G("size",p.size()),f.R7$(2),f.Lme("",p.val()," ",p.suffix()))},dependencies:[e.Typography],styles:[".key-val-container[_ngcontent-%COMP%]{margin:0;display:flex;flex-direction:column;gap:var(--cue-grid-gap-s, 8px)}dt[_ngcontent-%COMP%], dd[_ngcontent-%COMP%]{margin:0}.read-mode-container[_ngcontent-%COMP%]{display:inline-flex;align-items:center;width:100%;position:relative}.read-mode-container.interactive[_ngcontent-%COMP%]:hover{cursor:pointer}.value-content[_ngcontent-%COMP%]{flex:1}[_nghost-%COMP%]{color:var(--cue-typography-text-color, inherit)}dt[_ngcontent-%COMP%] cue-typography[_ngcontent-%COMP%], dd[_ngcontent-%COMP%] cue-typography[_ngcontent-%COMP%], .value-content[_ngcontent-%COMP%]{color:var(--cue-typography-text-color, inherit)!important}dt[_ngcontent-%COMP%] cue-typography[_ngcontent-%COMP%] div[_ngcontent-%COMP%], dd[_ngcontent-%COMP%] cue-typography[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{color:var(--cue-typography-text-color, inherit)!important}[_ngcontent-%COMP%]:deep(cue-svg-icon), [_ngcontent-%COMP%]:deep(cue-entity-menu cue-svg-icon){color:var(--cue-icon-color, inherit)!important}.dirty-indicator[_ngcontent-%COMP%]{opacity:.8;margin-left:4px;color:var(--cue-typography-text-color, inherit)!important;font-weight:700;font-size:.4em;transform:translateY(-1em)}"]})}return x})()},7335(B,F,l){l.d(F,{e:()=>x});var _=l(7705),u=l(5802),m=l(5547),c=l(8359),e=l(6939),f=l(63),E=l(4853);let x=(()=>{class R{_targetEl=(0,u.WQX)(m.aKT);_overlay=(0,u.WQX)(f.hJ);_overlayRef;_isOverlayHovered=!1;_subscriptions;display=(0,_.hFB)("on-hover");menuItems=_.hFB.required();menuEnabled=(0,_.hFB)(!0);onMouseEnter(){if("on-hover"===this.display()){if(!this.menuItems().length)return void this.removeOverlayMenu();this.appendOverlayMenu()}}onMouseLeave(){this._checkShouldRemoveOverlay()}appendOverlayMenu(){if(!this.menuItems().length||this._overlayRef)return;const y=this._overlay.create({positionStrategy:this._overlay.position().flexibleConnectedTo(this._targetEl).withPositions([{originX:"end",originY:"center",overlayX:"start",overlayY:"center",offsetX:2,offsetY:0}])});this._overlayRef=y;const p=window.getComputedStyle(this._targetEl.nativeElement).color;y.overlayElement.style.color=p;const P=new e.A8(E.H),w=y.attach(P);w.instance.items=this.menuItems,this._subscriptions&&this._subscriptions.unsubscribe(),this._subscriptions=new c.yU,this._subscriptions.add(w.instance.mouseEnter.subscribe(()=>{this._isOverlayHovered=!0})),this._subscriptions.add(w.instance.mouseLeave.subscribe(()=>{this._isOverlayHovered=!1,this._checkShouldRemoveOverlay()}))}removeOverlayMenu(){this._overlayRef&&(this._subscriptions&&(this._subscriptions.unsubscribe(),this._subscriptions=void 0),this._overlayRef.detach(),this._overlayRef.dispose(),this._overlayRef=void 0)}_checkShouldRemoveOverlay(){setTimeout(()=>{this._isOverlayHovered||this.removeOverlayMenu()},300)}static \u0275fac=function(p){return new(p||R)};static \u0275dir=m.FsC({type:R,selectors:[["","cueEntityMenu",""]],hostBindings:function(p,P){1&p&&m.bIt("mouseenter",function(){return P.onMouseEnter()})("mouseleave",function(){return P.onMouseLeave()})},inputs:{display:[1,"display"],menuItems:[1,"menuItems"],menuEnabled:[1,"menuEnabled"]}})}return R})()},3112(B,F,l){l.d(F,{CueDocumentViewer:()=>Te});var _=l(467),u=l(7705),m=l(2271),c=l(5802),e=l(5547),f=l(9769),E=l(5381),x=l(2245),R=l(1024),r=l(9421),y=l(5903),p=l(9352),P=l(6117),w=l(8547),O=l(3319),j=l(5971),C=l(7573);const T=(o,g)=>t=>t.isHighlight;function v(o,g){if(1&o&&(e.j41(0,"span",3),e.EFF(1),e.k0s()),2&o){const t=e.XpG(2).$implicit;e.R7$(),e.JRh(t.highlight.label)}}function b(o,g){if(1&o){const t=e.RV6();e.j41(0,"cue-button",5),e.bIt("click",function(i){c.eBV(t);const a=e.XpG(2).$implicit,s=e.XpG();return c.Njj(s.onDeleteHighlight(i,a.highlight))}),e.nrm(1,"cue-button-icon",6),e.k0s()}}function D(o,g){if(1&o){const t=e.RV6();e.j41(0,"span",2),e.bIt("click",function(){c.eBV(t);const i=e.XpG().$implicit,a=e.XpG();return c.Njj(a.onHighlightClick(i.highlight))}),e.nVh(1,v,2,1,"span",3),e.EFF(2),e.nVh(3,b,2,0,"cue-button",4),e.k0s()}if(2&o){const t=e.XpG().$implicit,n=e.XpG();e.BMQ("data-segment-start",t.segmentStart),e.R7$(),e.vxM(t.highlight.label?1:-1),e.R7$(),e.SpI(" ",t.text," "),e.R7$(),e.vxM(n.allowDelete()?3:-1)}}function L(o,g){if(1&o&&(e.j41(0,"span"),e.EFF(1),e.k0s()),2&o){const t=e.XpG().$implicit;e.BMQ("data-segment-start",t.segmentStart),e.R7$(),e.JRh(t.text)}}function k(o,g){if(1&o&&e.nVh(0,D,4,4,"span",1)(1,L,2,2,"span"),2&o){const t=g.$implicit;e.vxM(t.isHighlight&&t.highlight?0:1)}}let z=(()=>{class o{path=u.hFB.required();highlights=(0,u.hFB)([]);allowDelete=(0,u.hFB)(!1);allowAdd=(0,u.hFB)(!1);size=(0,u.hFB)("m");highlightClick=(0,u.CGW)();deleteHighlight=(0,u.CGW)();textSelected=(0,u.CGW)();segments=(0,m.EW)(()=>this.parseSegments(this.path(),this.highlights()));parseSegments(t,n){const i=n.filter(h=>h.path===t);if(0===i.length)return[{text:t,isHighlight:!1,segmentStart:0}];const a=[...i].sort((h,M)=>h.start-M.start),s=[];let d=0;for(const h of a)h.start>d&&s.push({text:t.substring(d,h.start),isHighlight:!1,segmentStart:d}),s.push({text:t.substring(h.start,h.end),isHighlight:!0,highlight:h,segmentStart:h.start}),d=h.end;return d<t.length&&s.push({text:t.substring(d),isHighlight:!1,segmentStart:d}),s}onHighlightClick(t){const n=this.path().substring(t.start,t.end);this.highlightClick.emit({path:this.path(),highlight:t,text:n})}onDeleteHighlight(t,n){t.stopPropagation(),this.deleteHighlight.emit({path:this.path(),highlight:n})}onMouseUp(t){if(!this.allowAdd())return;const n=window.getSelection();if(!n||n.isCollapsed||!n.rangeCount||!n.toString().trim())return;const a=n.getRangeAt(0),s=t.currentTarget,d=this.getAbsoluteOffset(s,a.startContainer,a.startOffset),h=this.getAbsoluteOffset(s,a.endContainer,a.endOffset);n.removeAllRanges(),h>d&&this.textSelected.emit({path:this.path(),start:d,end:h,text:this.path().substring(d,h)})}getAbsoluteOffset(t,n,i){let a=n.nodeType===Node.TEXT_NODE?n.parentElement:n;for(;a&&a!==t;){if(a instanceof HTMLElement&&a.hasAttribute("data-segment-start")){const M=parseInt(a.getAttribute("data-segment-start"),10);let I=0;const N=document.createTreeWalker(a,NodeFilter.SHOW_TEXT);let V=N.nextNode();for(;V&&V!==n;)I+=V.textContent?.length??0,V=N.nextNode();return M+I+i}a=a.parentElement}const s=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);let d=0,h=s.nextNode();for(;h&&h!==n;)d+=h.textContent?.length??0,h=s.nextNode();return d+i}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=e.VBU({type:o,selectors:[["cue-file-path-viewer"]],inputs:{path:[1,"path"],highlights:[1,"highlights"],allowDelete:[1,"allowDelete"],allowAdd:[1,"allowAdd"],size:[1,"size"]},outputs:{highlightClick:"highlightClick",deleteHighlight:"deleteHighlight",textSelected:"textSelected"},decls:3,vars:7,consts:[[1,"path-content",3,"mouseup"],[1,"highlight-segment"],[1,"highlight-segment",3,"click"],[1,"highlight-label"],["size","xs","aria-label","Remove highlight",1,"delete-button"],["size","xs","aria-label","Remove highlight",1,"delete-button",3,"click"],["icon","close"]],template:function(n,i){1&n&&(e.j41(0,"div",0),e.bIt("mouseup",function(s){return i.onMouseUp(s)}),e.Z7z(1,k,2,1,null,null,e.Vm6),e.k0s()),2&n&&(e.AVh("size-s","s"===i.size())("allow-add",i.allowAdd())("has-highlights",i.segments().some(e._m7(6,T,i))),e.R7$(),e.Dyx(i.segments()))},dependencies:[f.MD,j.$,O.a],styles:["[_nghost-%COMP%]{display:contents}.path-content[_ngcontent-%COMP%]{display:block;flex:1;min-width:0;word-break:break-all;text-align:start;font-family:var(--cue-font-family);font-size:var(--cue-font-m-size);line-height:var(--cue-font-m-line-height);letter-spacing:var(--cue-font-m-letter-spacing);font-weight:var(--cue-font-weight-regular)}.path-content.size-s[_ngcontent-%COMP%]{font-size:var(--cue-font-s-size);line-height:var(--cue-font-s-line-height);letter-spacing:var(--cue-font-s-letter-spacing)}.path-content.allow-add[_ngcontent-%COMP%]{cursor:text;-webkit-user-select:text;user-select:text}.path-content.has-highlights[_ngcontent-%COMP%]{padding-top:.8rem;line-height:2.3rem}.highlight-segment[_ngcontent-%COMP%]{display:inline-block;vertical-align:text-bottom;position:relative;line-height:normal;font-weight:var(--cue-font-weight-medium);cursor:pointer;padding:0 .2rem;border-radius:3px;border:1px solid currentColor;transition:all .2s ease}.highlight-segment[_ngcontent-%COMP%] .highlight-label[_ngcontent-%COMP%]{font-family:var(--cue-font-family);position:absolute;bottom:100%;left:0;font-size:.5rem;line-height:1;opacity:.7;margin-bottom:.15rem;white-space:nowrap;pointer-events:none}.highlight-segment[_ngcontent-%COMP%] .delete-button[_ngcontent-%COMP%]{position:absolute;top:-12px;right:-12px;z-index:10;opacity:0;transition:opacity .2s ease;pointer-events:none}.highlight-segment[_ngcontent-%COMP%]:hover{background:color-mix(in srgb,currentColor 12%,transparent)}.highlight-segment[_ngcontent-%COMP%]:hover .delete-button[_ngcontent-%COMP%]{opacity:1;pointer-events:all}"],changeDetection:0})}return o})();var H=l(5745),X=l(2444),K=l(9695),Y=l(5448),J=l(6950);const G=o=>({count:o}),Q=(o,g)=>t=>t.iri;function Z(o,g){1&o&&(e.j41(0,"cue-typography",11),e.EFF(1),e.nI1(2,"transloco"),e.k0s()),2&o&&(e.R7$(),e.JRh(e.bMT(2,1,"components.documentInfo.infoLoadingFilePaths")))}function q(o,g){if(1&o){const t=e.RV6();e.j41(0,"cue-ag-grid",16),e.bIt("selectedRows",function(i){c.eBV(t);const a=e.XpG(4);return c.Njj(a.onMatchedPathsSelectionChange(i))}),e.k0s()}if(2&o){const t=e.XpG(4);e.Y8G("rowData",t._matchTableRowData())("columnDefs",t._matchTableColDefs())("rowSelection",t._matchTableRowSelection)}}function ee(o,g){if(1&o){const t=e.RV6();e.j41(0,"cue-flexcontainer",12)(1,"cue-button",13),e.bIt("click",function(){c.eBV(t);const i=e.XpG(3);return c.Njj(i._matchTableExpanded.set(!i._matchTableExpanded()))}),e.nrm(2,"cue-button-icon",14),e.j41(3,"cue-button-label"),e.EFF(4),e.nI1(5,"transloco"),e.k0s()(),e.nVh(6,q,1,3,"cue-ag-grid",15),e.k0s(),e.j41(7,"cue-typography",11),e.EFF(8),e.nI1(9,"transloco"),e.k0s()}if(2&o){const t=e.XpG(3);e.R7$(2),e.Y8G("icon",t._matchTableExpanded()?"arrow-up":"arrow-dropdown"),e.R7$(2),e.JRh(e.i5U(5,4,1===t._matchCount()?"components.documentInfo.filePathMatched":"components.documentInfo.filePathsMatched",e.eq3(10,G,t._matchCount()))),e.R7$(2),e.vxM(t._matchTableExpanded()?6:-1),e.R7$(2),e.JRh(e.i5U(9,7,"components.documentInfo.applyToNPaths",e.eq3(12,G,t._selectedPaths().length)))}}function te(o,g){if(1&o&&e.nVh(0,Z,3,3,"cue-typography",11)(1,ee,10,14),2&o){const t=e.XpG(2);e.vxM(t._fileLocationsLoading()?0:null!==t._fileLocations()?1:-1)}}function ne(o,g){if(1&o){const t=e.RV6();e.j41(0,"cue-flexcontainer",9)(1,"cue-input-switch",10),e.bIt("toggleChange",function(i){c.eBV(t);const a=e.XpG();return c.Njj(a.onApplyToAllChange(i))}),e.k0s(),e.j41(2,"cue-typography",11),e.EFF(3),e.nI1(4,"transloco"),e.k0s()(),e.nVh(5,te,2,1)}if(2&o){const t=e.XpG();e.R7$(),e.Y8G("checked",t._applyToAllFiles()),e.R7$(2),e.JRh(e.bMT(4,3,"components.documentInfo.applyToAllFiles")),e.R7$(2),e.vxM(t._applyToAllFiles()?5:-1)}}function ie(o,g){if(1&o&&(e.j41(0,"cue-typography",8),e.EFF(1),e.nI1(2,"transloco"),e.k0s()),2&o){const t=e.XpG();e.R7$(),e.Lme("",e.bMT(2,2,"components.documentInfo.errorSavingEntityMention"),": ",t._saveError())}}let oe=(()=>{class o{selection=u.hFB.required();availableEntityCategories=(0,u.hFB)([]);fileLocations=(0,u.hFB)([]);requestFileLocations=(0,u.hFB)(void 0);requestFilePathEntityAdd=(0,u.hFB)(void 0);confirm=(0,u.CGW)();cancel=(0,u.CGW)();_selectedEntityCategory=(0,c.vPA)("");_applyToAllFiles=(0,c.vPA)(!1);_fileLocations=(0,c.vPA)(null);_fileLocationsLoading=(0,c.vPA)(!1);_matchTableExpanded=(0,c.vPA)(!1);_selectedPaths=(0,c.vPA)([]);_saving=(0,c.vPA)(!1);_saveError=(0,c.vPA)(null);_dirPrefix=(0,m.EW)(()=>{const t=this.selection();return t.path.substring(0,t.end)});_matchedLocations=(0,m.EW)(()=>{const t=this._fileLocations();if(!t)return[];const n=this._dirPrefix();return t.filter(i=>i.path.startsWith(n))});_matchCount=(0,m.EW)(()=>this._matchedLocations().length);_matchTableRowData=(0,m.EW)(()=>this._matchedLocations().map(t=>({iri:t.iri,path:t.path,providerId:t.providerId})));_entityCategoryLabelMap=(0,m.EW)(()=>this.availableEntityCategories().reduce((t,n)=>(t[n.iri]=n.label,t),{}));_matchTableRowSelection={mode:"multiRow",selectAll:"filtered"};_filePathLabel=(0,p.Xx)("components.contentBlocks.documentViewer.labelFilePath");_matchTableColDefs=(0,m.EW)(()=>[{headerName:this._filePathLabel(),field:"path",flex:1,filter:!0,sortable:!0}]);onEntityCategoryChange(t){this._selectedEntityCategory.set("string"==typeof t?t:String(t??""))}onApplyToAllChange(t){var n=this;return(0,_.A)(function*(){if(n._applyToAllFiles.set(t),n._matchTableExpanded.set(!1),!t)return n._fileLocations.set(null),void n._selectedPaths.set([]);const i=n.requestFileLocations();if(i){n._fileLocationsLoading.set(!0);try{const a=yield i();n._fileLocations.set(a);const s=n._dirPrefix();n._selectedPaths.set(a.filter(d=>d.path.startsWith(s)))}finally{n._fileLocationsLoading.set(!1)}}})()}onMatchedPathsSelectionChange(t){const n=this._fileLocations()??[];this._selectedPaths.set(t.map(i=>n.find(a=>a.path===i.path)??{iri:"",path:i.path}))}onConfirm(){var t=this;return(0,_.A)(function*(){const n=t._selectedEntityCategory();if(!n)return;const i=t.selection().path,a=t._fileLocations()?.find(h=>h.path===i)??t.fileLocations().find(h=>h.path===i)??{iri:"",path:i},s=t._applyToAllFiles()&&t._selectedPaths().length>0?t._selectedPaths():[a],d=t.requestFilePathEntityAdd();if(d){t._saving.set(!0),t._saveError.set(null);try{yield d(n,s)}catch(h){return console.error("[EntityMentionModal] Failed to save entity mention:",h),t._saveError.set(h instanceof Error?h.message:String(h)),void t._saving.set(!1)}t._saving.set(!1)}t.confirm.emit({entityCategory:n,paths:s})})()}onCancel(){this.cancel.emit()}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=e.VBU({type:o,selectors:[["cue-entity-mention-modal"]],inputs:{selection:[1,"selection"],availableEntityCategories:[1,"availableEntityCategories"],fileLocations:[1,"fileLocations"],requestFileLocations:[1,"requestFileLocations"],requestFilePathEntityAdd:[1,"requestFilePathEntityAdd"]},outputs:{confirm:"confirm",cancel:"cancel"},decls:18,vars:24,consts:[[3,"close","displayCloseBtn","closeOnBackgroundClick"],[1,"modal-content"],["direction","column","gap","m"],[3,"key","val"],[3,"valueChange","value","options","labelMap","label","showFilter"],["direction","row","justify","center"],[3,"click","disabled"],["variant","secondary",3,"click","disabled"],["size","s",2,"color","var(--cue-error)"],["direction","row","gap","s","align","center"],[3,"toggleChange","checked"],["size","s"],["direction","column","gap","xs"],["variant","ghost","size","xs",3,"click"],[3,"icon"],["size","s","height","220px",3,"rowData","columnDefs","rowSelection"],["size","s","height","220px",3,"selectedRows","rowData","columnDefs","rowSelection"]],template:function(n,i){1&n&&(e.j41(0,"cue-modal",0),e.bIt("close",function(){return i.onCancel()}),e.j41(1,"div",1)(2,"cue-flexcontainer",2),e.nrm(3,"cue-key-val",3),e.nI1(4,"transloco"),e.j41(5,"cue-select",4),e.nI1(6,"transloco"),e.bIt("valueChange",function(s){return i.onEntityCategoryChange(s)}),e.k0s(),e.nVh(7,ne,6,5),e.j41(8,"cue-flexcontainer",5)(9,"cue-button",6),e.bIt("click",function(){return i.onCancel()}),e.j41(10,"cue-button-label"),e.EFF(11),e.nI1(12,"transloco"),e.k0s()(),e.j41(13,"cue-button",7),e.bIt("click",function(){return i.onConfirm()}),e.j41(14,"cue-button-label"),e.EFF(15),e.nI1(16,"transloco"),e.k0s()()(),e.nVh(17,ie,3,4,"cue-typography",8),e.k0s()()()),2&n&&(e.Y8G("displayCloseBtn",!1)("closeOnBackgroundClick",!1),e.R7$(3),e.Y8G("key",e.bMT(4,15,"components.documentInfo.labelSelectedText"))("val",i.selection().text),e.R7$(2),e.Y8G("value",i._selectedEntityCategory())("options",i.availableEntityCategories().map(e._m7(17,Q,i)))("labelMap",i._entityCategoryLabelMap())("label",e.bMT(6,18,"components.entityInfo.labelEntityCategory"))("showFilter",i.availableEntityCategories().length>5),e.R7$(2),e.vxM(i.requestFileLocations()?7:-1),e.R7$(2),e.Y8G("disabled",i._saving()),e.R7$(2),e.JRh(e.bMT(12,20,"components.modals.rdfEdit.buttonCancel")),e.R7$(2),e.Y8G("disabled",!i._selectedEntityCategory()||i._saving()),e.R7$(2),e.JRh(e.bMT(16,22,"components.modals.rdfEdit.buttonSave")),e.R7$(2),e.vxM(i._saveError()?17:-1))},dependencies:[E.n,r.F,O.a,j.$,Y.L,x.Typography,H.a,X.l,K.d,J.R,p.Kj],styles:[".modal-content[_ngcontent-%COMP%]{width:640px;max-width:calc(100vw - 32px)}"],changeDetection:0})}return o})();const ae=()=>[];function se(o,g){if(1&o&&(e.nrm(0,"cue-key-val",6),e.nI1(1,"transloco")),2&o){const t=e.XpG(2);e.Y8G("key",e.bMT(1,2,"components.contentBlocks.documentViewer.labelSubject"))("val",t.subject())}}function le(o,g){if(1&o&&(e.j41(0,"cue-key-val-list"),e.nVh(1,se,2,4,"cue-key-val",6),e.k0s()),2&o){const t=e.XpG();e.R7$(),e.vxM(t.subject()?1:-1)}}function re(o,g){if(1&o&&(e.j41(0,"cue-flexcontainer",4)(1,"cue-menu",7)(2,"cue-button",8,0),e.nrm(4,"cue-button-icon",9),e.k0s(),e.nrm(5,"cue-menu-nested",10),e.k0s()()),2&o){const t=e.XpG();e.R7$(5),e.Y8G("items",t.menuItems())}}function ce(o,g){if(1&o&&(e.nrm(0,"cue-key-val-editable",11),e.nI1(1,"transloco"),e.nI1(2,"transloco")),2&o){const t=e.XpG(2);e.Y8G("key",1===t.contentCategories().length?e.bMT(1,4,"components.contentBlocks.documentViewer.labelContentCategory"):e.bMT(2,6,"components.contentBlocks.documentViewer.labelContentCategories"))("val",t.contentCategoriesString())("rdfConfig",t.rdfEditConfig())("editDisabled",!t.contentCategoriesEditable())}}function ue(o,g){if(1&o&&(e.j41(0,"span",15),e.EFF(1),e.k0s()),2&o){const t=e.XpG(3);e.R7$(),e.Lme("(",t.currentFilePathIndex()+1,"/",t.fileLocations().length,")")}}function de(o,g){if(1&o){const t=e.RV6();e.j41(0,"cue-button",19),e.bIt("click",function(){c.eBV(t);const i=e.XpG(3);return c.Njj(i.prevFilePath())}),e.nrm(1,"cue-button-icon",20),e.k0s()}if(2&o){const t=e.XpG(3);e.Y8G("disabled",0===t.currentFilePathIndex())}}function he(o,g){if(1&o){const t=e.RV6();e.j41(0,"cue-button",19),e.bIt("click",function(){c.eBV(t);const i=e.XpG(3);return c.Njj(i.nextFilePath())}),e.nrm(1,"cue-button-icon",21),e.k0s()}if(2&o){const t=e.XpG(3);e.Y8G("disabled",t.currentFilePathIndex()===t.fileLocations().length-1)}}function ge(o,g){if(1&o){const t=e.RV6();e.j41(0,"dl",12)(1,"dt",13)(2,"cue-typography",14),e.EFF(3),e.nI1(4,"transloco"),e.nVh(5,ue,2,2,"span",15),e.k0s()(),e.j41(6,"dd",16),e.nVh(7,de,2,1,"cue-button",17),e.j41(8,"cue-file-path-viewer",18),e.bIt("textSelected",function(i){c.eBV(t);const a=e.XpG(2);return c.Njj(a.onTextSelected(i))}),e.k0s(),e.nVh(9,he,2,1,"cue-button",17),e.k0s()()}if(2&o){const t=e.XpG(2);e.R7$(3),e.SpI(" ",e.bMT(4,8,"components.contentBlocks.documentViewer.labelFilePath")," "),e.R7$(2),e.vxM(t.fileLocations().length>1?5:-1),e.R7$(2),e.vxM(t.fileLocations().length>1?7:-1),e.R7$(),e.Y8G("path",t.fileLocations()[t.currentFilePathIndex()].path)("highlights",t.filePathEntitiesVisible()?t.filePathHighlights():e.lJ4(10,ae))("allowDelete",t.filePathEntitiesEditable())("allowAdd",t.filePathEntitiesEditable()),e.R7$(),e.vxM(t.fileLocations().length>1?9:-1)}}function _e(o,g){if(1&o&&(e.j41(0,"cue-key-val-list"),e.nrm(1,"hr"),e.nVh(2,ce,3,8,"cue-key-val-editable",11),e.nVh(3,ge,10,11,"dl",12),e.k0s()),2&o){const t=e.XpG();e.R7$(2),e.vxM(t.contentCategories()&&t.contentCategories().length>0?2:-1),e.R7$(),e.vxM(t.fileLocations().length>0?3:-1)}}function me(o,g){if(1&o){const t=e.RV6();e.j41(0,"cue-entity-mention-modal",22),e.bIt("confirm",function(i){c.eBV(t);const a=e.XpG();return c.Njj(a.onEntityMentionConfirm(i))})("cancel",function(){c.eBV(t);const i=e.XpG();return c.Njj(i.onEntityMentionCancel())}),e.k0s()}if(2&o){const t=e.XpG();e.Y8G("selection",t._pendingSelection())("availableEntityCategories",t.availableEntityCategories())("fileLocations",t.fileLocations())("requestFileLocations",t._fileLocationsProvider())("requestFilePathEntityAdd",t._requestFilePathEntityAdd())}}let fe=(()=>{class o{subject=u.hFB.required();handlers=u.hFB.required();dataChanged=(0,u.CGW)();filePathEntityAdded=(0,u.CGW)();fileLocations=(0,u.hFB)([]);_fileLocationsProvider=(0,m.EW)(()=>{const t=this.handlers().requestFileLocations;if(t)return t;const n=this.fileLocations();return n.length?()=>Promise.resolve(n):void 0});filePathEntities=(0,u.geq)([]);contentCategories=(0,u.hFB)([]);contentCategoriesEditable=(0,u.hFB)(!1);filePathEntitiesVisible=(0,u.hFB)(!1);filePathEntitiesEditable=(0,u.hFB)(!1);menuItems=(0,u.hFB)([]);availableContentCategories=(0,u.hFB)([]);availableEntityCategories=(0,u.hFB)([]);collapsed=(0,u.hFB)(!1);hasDocInfo=(0,m.EW)(()=>{const t=""!==this.subject(),n=this.fileLocations().length>0;return t||n});currentFilePathIndex=(0,c.vPA)(0);_entityCategoryModalVisible=(0,c.vPA)(!1);_pendingSelection=(0,c.vPA)(null);_requestFilePathEntityAdd=(0,m.EW)(()=>{var t=this;const n=this.handlers().requestFilePathEntityAdd;if(n)return function(){var i=(0,_.A)(function*(a,s){const d=t._pendingSelection();d&&(yield n({paths:s,start:d.start,end:d.end,text:d.text,entityCategory:a,folderPath:d.path.substring(0,d.end)}))});return function(a,s){return i.apply(this,arguments)}}()});prevFilePath(){this.currentFilePathIndex()>0&&this.currentFilePathIndex.update(t=>t-1)}nextFilePath(){this.currentFilePathIndex()<this.fileLocations().length-1&&this.currentFilePathIndex.update(t=>t+1)}filePathHighlights=(0,m.EW)(()=>this.filePathEntities().map(t=>({path:t.path,start:t.startIndex,end:t.endIndex,label:this.availableEntityCategories().find(n=>n.iri===t.entityCategory)?.label??t.entityCategory.split("/").pop()??t.entityCategory})));entityCategoryLabelMap=(0,m.EW)(()=>this.availableEntityCategories().reduce((t,n)=>(t[n.iri]=n.label,t),{}));onTextSelected(t){this._pendingSelection.set(t),this._entityCategoryModalVisible.set(!0)}onEntityMentionConfirm(t){const n=this._pendingSelection();n&&(this.filePathEntities.update(i=>[...i,...t.paths.map(a=>({path:a.path,entityCategory:t.entityCategory,startIndex:n.start,endIndex:n.end}))]),this.filePathEntityAdded.emit({paths:t.paths,start:n.start,end:n.end,text:n.text,entityCategory:t.entityCategory,folderPath:n.path.substring(0,n.end)}),this._entityCategoryModalVisible.set(!1),this._pendingSelection.set(null))}onEntityMentionCancel(){this._entityCategoryModalVisible.set(!1),this._pendingSelection.set(null)}_contentCategories=(0,m.uu)(()=>this.contentCategories());contentCategoriesString=(0,m.EW)(()=>this._contentCategories().map(t=>this._iriToString(t)).sort().join(", "));_iriToString(t){const n=this.availableContentCategories()?.find(i=>i.iri===t);return n?n.label:t}infoChangeContentCategory=(0,p.Xx)("components.documentInfo.infoChangeContentCategory");rdfEditConfig=(0,m.EW)(()=>{var t=this;const n=this.handlers()?.requestRDFChange;var i;if(void 0!==n)return{message:this.infoChangeContentCategory(),existingValue:this._contentCategories(),dataType:"multiselect",options:this.availableContentCategories()?.map(i=>i.iri),optionLabelMap:this.availableContentCategories()?.reduce((i,a)=>(i[a.iri]=a.label,i),{}),requestSave:(i=(0,_.A)(function*(a){console.log(a);const s={subject:t.subject(),predicate:`${C.E.qcy}contentCategory`,objects:t._contentCategories(),newObjects:a.newValue,type:"contentCategory",comment:a.comment};yield n(s),t._contentCategories.set(a.newValue),t.dataChanged.emit({contentCategories:a.newValue})}),function(s){return i.apply(this,arguments)})};console.warn("No RDF change request handler defined")});static \u0275fac=function(n){return new(n||o)};static \u0275cmp=e.VBU({type:o,selectors:[["cue-document-info"]],inputs:{subject:[1,"subject"],handlers:[1,"handlers"],fileLocations:[1,"fileLocations"],filePathEntities:[1,"filePathEntities"],contentCategories:[1,"contentCategories"],contentCategoriesEditable:[1,"contentCategoriesEditable"],filePathEntitiesVisible:[1,"filePathEntitiesVisible"],filePathEntitiesEditable:[1,"filePathEntitiesEditable"],menuItems:[1,"menuItems"],availableContentCategories:[1,"availableContentCategories"],availableEntityCategories:[1,"availableEntityCategories"],collapsed:[1,"collapsed"]},outputs:{dataChanged:"dataChanged",filePathEntityAdded:"filePathEntityAdded",filePathEntities:"filePathEntitiesChange"},decls:7,vars:4,consts:[["trigger",""],["direction","column",2,"min-height","50px"],["direction","row"],["direction","column",2,"flex","1 1"],["direction","column",2,"width","50px"],[3,"selection","availableEntityCategories","fileLocations","requestFileLocations","requestFilePathEntityAdd"],["size","l",3,"key","val"],["positioning","bottomleft"],["trigger","","variant","tertiary"],["icon","more-vert"],["menu","",3,"items"],["size","s",3,"key","val","rdfConfig","editDisabled"],[1,"file-path-nav-container"],[1,"file-path-label"],["size","xs"],[1,"path-counter"],[1,"file-path-row"],["variant","tertiary","size","xs",3,"disabled"],["size","s",3,"textSelected","path","highlights","allowDelete","allowAdd"],["variant","tertiary","size","xs",3,"click","disabled"],["icon","paginator-back"],["icon","paginator-next"],[3,"confirm","cancel","selection","availableEntityCategories","fileLocations","requestFileLocations","requestFilePathEntityAdd"]],template:function(n,i){1&n&&(e.j41(0,"cue-flexcontainer",1)(1,"cue-flexcontainer",2)(2,"cue-flexcontainer",3),e.nVh(3,le,2,1,"cue-key-val-list"),e.k0s(),e.nVh(4,re,6,1,"cue-flexcontainer",4),e.k0s(),e.nVh(5,_e,4,2,"cue-key-val-list"),e.k0s(),e.nVh(6,me,1,5,"cue-entity-mention-modal",5)),2&n&&(e.R7$(3),e.vxM(i.fileLocations().length>0||i.subject()?3:-1),e.R7$(),e.vxM(i.menuItems().length>0?4:-1),e.R7$(),e.vxM(!i.collapsed()&&i.hasDocInfo()?5:-1),e.R7$(),e.vxM(i._entityCategoryModalVisible()&&i._pendingSelection()?6:-1))},dependencies:[E.n,R.p,r.F,y.L,P.W,w.T,O.a,j.$,z,x.Typography,oe,p.Kj],styles:[".file-path-nav-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2px}.file-path-label[_ngcontent-%COMP%]{display:block;margin:0}.file-path-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px;margin:0;overflow:visible;padding:1px}.file-path-row[_ngcontent-%COMP%] cue-file-path-viewer[_ngcontent-%COMP%]{flex:1;overflow:visible;min-width:0}.path-counter[_ngcontent-%COMP%]{opacity:.6}"],changeDetection:0})}return o})();class pe{requestRDFChange;requestFileLocations;requestFilePathEntityAdd}var ve=l(2065),ye=l(5187);const Ce=["viewerHost"];function be(o,g){if(1&o&&e.nrm(0,"cue-document-info",4),2&o){const t=e.XpG(2);e.Y8G("subject",t._docSubject())("handlers",t._docInfoHandlers)("menuItems",t._menuItems())}}function Me(o,g){1&o&&(e.j41(0,"cue-flexcontainer",5)(1,"cue-typography"),e.EFF(2,"Loading\u2026"),e.k0s()())}function Ee(o,g){if(1&o&&(e.j41(0,"cue-flexcontainer",5)(1,"cue-typography",7),e.EFF(2),e.k0s()()),2&o){const t=e.XpG(2);e.R7$(2),e.JRh(t.errorMessage())}}function xe(o,g){if(1&o&&(e.j41(0,"div",3),e.nVh(1,be,1,3,"cue-document-info",4),e.nVh(2,Me,3,0,"cue-flexcontainer",5)(3,Ee,3,1,"cue-flexcontainer",5),e.j41(4,"div",6),e.eu8(5,null,1),e.k0s()()),2&o){const t=e.XpG();e.R7$(),e.vxM(t.showDocumentInfo()&&"ready"===t.state()?1:-1),e.R7$(),e.vxM("loading"===t.state()?2:"error"===t.state()?3:-1)}}function De(o,g){1&o&&e.eu8(0)}function Pe(o,g){if(1&o&&(e.j41(0,"cue-card",2),e.DNE(1,De,1,0,"ng-container",8),e.k0s()),2&o){const t=e.XpG(),n=e.sdS(1);e.Y8G("variant",t._cardVariant())("padded",!0),e.R7$(),e.Y8G("ngTemplateOutlet",n)}}function we(o,g){1&o&&e.eu8(0)}function Fe(o,g){if(1&o&&e.DNE(0,we,1,0,"ng-container",8),2&o){e.XpG();const t=e.sdS(1);e.Y8G("ngTemplateOutlet",t)}}const Ie=[".fragments",".dxf",".pdf",".png",".jpg",".jpeg",".svg",".gif",".webp",".bmp",".avif",".apng",".xlsx",".xls",".csv",".json",".jsonld",".xml",".css",".js",".html",".htm",".sh",".txt",".rst",".md"];function $(o){const[g,t]=o.split("?"),n=g.trim();let i=null;if(t){const s=new URLSearchParams(t).get("page");if(null!==s){const d=parseInt(s,10);!isNaN(d)&&d>0&&(i=d)}}return{uuid:n,page:i}}let Te=(()=>{class o{set _viewerHostRef(t){if(this._viewerHost=t,t&&this._lastRenderArgs){const{url:n,suffix:i,page:a,viewerTypeOverride:s}=this._lastRenderArgs;this._renderViewer(n,i,a,s)}}_viewerHost;_lastRenderArgs;currentViewerRef;cue=(0,u.hFB)(void 0);uuid=(0,u.hFB)(void 0);projectId=(0,u.hFB)(void 0);showDocumentInfo=(0,u.hFB)(!0);extraMenuItems=(0,u.hFB)([]);portalBaseURL=(0,u.hFB)("https://cue.qaecy.com");variant=(0,u.hFB)("none");_cardVariant=(0,m.EW)(()=>this.variant());state=(0,c.vPA)("idle");errorMessage=(0,c.vPA)(null);resolvedUrl=(0,c.vPA)(null);resolvedSuffix=(0,c.vPA)(null);_docSubject=(0,c.vPA)("");_alternatives=(0,c.vPA)([]);_originalUuid=(0,c.vPA)(null);_originalDocSuffix=(0,c.vPA)(null);_cueSnapshot=null;_projectIdSnapshot=null;_inputWarningTimer;_docInfoHandlers=new pe;_menuItems=(0,m.EW)(()=>{const t=[],n=this._originalUuid(),i=this._originalDocSuffix();n&&i&&t.push({icon:"download",label:"Download file",action:()=>this._downloadOriginal()});const a=this.uuid(),s=this.projectId();if(a&&s){const{uuid:h}=$(a),M=this.portalBaseURL().replace(/\/$/,"");t.push({icon:"external-link",label:"Open in Cue",action:()=>window.open(`${M}/r/${s}/${h}`,"_blank","noopener,noreferrer")})}const d=this._alternatives();if(d.length>1){const h=this.resolvedSuffix();t.push({icon:"document",label:"Alternative representation",children:d.map(M=>({label:M.original?`Original (${M.suffix.replace(".","").toUpperCase()})`:M.suffix.replace(".","").toUpperCase(),tooltip:h===M.suffix?"Currently shown":void 0,action:()=>this._switchToAlternative(M)}))})}return t.push(...this.extraMenuItems()),t});constructor(){this._inputWarningTimer=setTimeout(()=>{this.cue()||console.warn('[cue-document-viewer] Required input "cue" is not set. Pass an authenticated Cue SDK instance.'),this.uuid()||console.warn('[cue-document-viewer] Required input "uuid" is not set. Pass the document UUID to display.'),this.projectId()||console.warn('[cue-document-viewer] Required input "projectId" is not set. Pass the Cue project ID the document belongs to.')},3e3),(0,c.QZP)(()=>{const t=this.cue(),n=this.uuid(),i=this.projectId();t&&n&&i?this._load(t,n,i):this.state.set("idle")})}ngOnDestroy(){clearTimeout(this._inputWarningTimer)}_load(t,n,i){var a=this;return(0,_.A)(function*(){if(t&&n&&i){a.state.set("loading"),a.resolvedUrl.set(null),a.resolvedSuffix.set(null),a.errorMessage.set(null),a._docSubject.set(""),a._originalUuid.set(null),a._originalDocSuffix.set(null),a._alternatives.set([]),a._viewerHost?.clear(),a.currentViewerRef?.destroy(),a.currentViewerRef=void 0,a._lastRenderArgs=void 0;try{a._cueSnapshot=t,a._projectIdSnapshot=i;const{uuid:s,page:d}=$(n),h=t.createProjectDocuments(i),I=(yield h.fetchDocumentData([s]))[s];if(!I)throw new Error(`Document '${s}' not found in project '${i}'.`);a._docSubject.set(I.subject??""),a._originalUuid.set(s),a._originalDocSuffix.set(I.suffix);const N=yield h.fetchAlternativeRepresentations(s);a._alternatives.set([{uuid:s,suffix:I.suffix,original:!0},...N.filter(A=>A.id!==s).map(A=>({uuid:A.id,suffix:A.suffix,original:!1,remoteRelativePath:A.remoteRelativePath}))]);const{uuid:V,suffix:S,remoteRelativePath:W}=function Re(o,g){const t=[o,...g];let n,i=1/0;for(const a of t){const s=Ie.indexOf(a.suffix);-1!==s&&s<i&&(i=s,n=a)}return n?{uuid:n.id,suffix:n.suffix,remoteRelativePath:n.remoteRelativePath}:{uuid:o.id,suffix:o.suffix}}(I,N),U=W?yield t.storage.getAltRepDownloadUrl(W):yield t.storage.getDownloadUrl(i,V,S);a.resolvedUrl.set(U),a.resolvedSuffix.set(S);const Ve=[".eml",".msg",".emlx",".mbx"].includes(I.suffix)&&".json"===S?"email":void 0;yield a._renderViewer(U,S,d,Ve),a.state.set("ready")}catch(s){const d=s instanceof Error?s.message:String(s);console.error("[CueDocumentViewerWC] Failed to load document:",d),a.errorMessage.set(d),a.state.set("error")}}else a.state.set("idle")})()}_renderViewer(t,n,i,a){var s=this;return(0,_.A)(function*(){try{const{DocumentViewer:d}=yield Promise.all([l.e(418),l.e(627),l.e(76),l.e(36)]).then(l.bind(l,3036)),{DocumentViewerSettings:h}=yield l.e(418).then(l.bind(l,3418));s._viewerHost?.clear(),s.currentViewerRef?.destroy();const M=new h;if(null!==i&&(M.pdf.page=String(i)),!s._viewerHost)throw new Error("viewerHost is not yet available \u2014 view has not been initialized.");s._lastRenderArgs={url:t,suffix:n,page:i,viewerTypeOverride:a},s.currentViewerRef=s._viewerHost.createComponent(d),s.currentViewerRef.setInput("url",t),s.currentViewerRef.setInput("suffix",n),s.currentViewerRef.setInput("settings",M),a&&s.currentViewerRef.setInput("viewerTypeOverride",a)}catch(d){throw new Error(`Failed to load viewer component: ${d instanceof Error?d.message:String(d)}`)}})()}_switchToAlternative(t){var n=this;return(0,_.A)(function*(){const i=n._cueSnapshot,a=n._projectIdSnapshot;if(i&&a)try{const s=t.remoteRelativePath?yield i.storage.getAltRepDownloadUrl(t.remoteRelativePath):yield i.storage.getDownloadUrl(a,t.uuid,t.suffix);n.resolvedUrl.set(s),n.resolvedSuffix.set(t.suffix),yield n._renderViewer(s,t.suffix,null)}catch(s){console.error("[CueDocumentViewerWC] Failed to switch to alternative:",s)}})()}_downloadOriginal(){var t=this;return(0,_.A)(function*(){const n=t._cueSnapshot,i=t._projectIdSnapshot,a=t._originalUuid(),s=t._originalDocSuffix();if(n&&i&&a&&s)try{const d=yield n.storage.getDownloadUrl(i,a,s),M=yield(yield fetch(d)).blob();(0,ve.KE)(M,`${a}${s}`)}catch(d){console.error("[CueDocumentViewerWC] Failed to download original:",d)}})()}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=e.VBU({type:o,selectors:[["cue-document-viewer-wc"]],viewQuery:function(n,i){if(1&n&&e.GBs(Ce,5,e.c1b),2&n){let a;e.mGM(a=e.lsd())&&(i._viewerHostRef=a.first)}},inputs:{cue:[1,"cue"],uuid:[1,"uuid"],projectId:[1,"projectId"],showDocumentInfo:[1,"showDocumentInfo"],extraMenuItems:[1,"extraMenuItems"],portalBaseURL:[1,"portalBaseURL"],variant:[1,"variant"]},decls:4,vars:1,consts:[["body",""],["viewerHost",""],[2,"height","100%","width","100%",3,"variant","padded"],[2,"display","flex","flex-direction","column","height","100%","width","100%"],[3,"subject","handlers","menuItems"],["direction","column","align","center","justify","center",2,"flex","1","width","100%"],[2,"flex","1","min-height","0","overflow","hidden"],[2,"color","#c44","font-size","13px"],[4,"ngTemplateOutlet"]],template:function(n,i){1&n&&(e.DNE(0,xe,7,2,"ng-template",null,0,e.C5r),e.nVh(2,Pe,2,3,"cue-card",2)(3,Fe,1,1,"ng-container")),2&n&&(e.R7$(2),e.vxM("none"!==i.variant()?2:3))},dependencies:[f.MD,f.T3,E.n,x.Typography,fe,ye.Z],styles:["[_nghost-%COMP%]{display:contents}"],changeDetection:0})}return o})()}}]);
1
+ "use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[112],{4853(O,w,l){l.d(w,{H:()=>j});var h=l(7705),u=l(5802),m=l(7089),r=l(7023),e=l(5381),f=l(5971),E=l(3319),x=l(356),R=l(6279),c=l(5547);const y=()=>({position:"bottomleft"}),p=(C,T)=>T.label||C;function P(C,T){if(1&C){const v=c.RV6();c.j41(0,"cue-menu-item",4),c.bIt("click",function(){const D=u.eBV(v).$implicit;return u.Njj(D.action())}),c.EFF(1),c.k0s()}if(2&C){const v=T.$implicit;c.Y8G("selected",v.selected),c.R7$(),c.JRh(v.label)}}function I(C,T){if(1&C&&(c.j41(0,"cue-menu-wrap"),c.Z7z(1,P,2,2,"cue-menu-item",3,p),c.k0s()),2&C){const v=c.XpG();c.R7$(),c.Dyx(v.contextMenuItems())}}function L(C,T){if(1&C){const v=c.RV6();c.j41(0,"cue-button",5),c.bIt("click",function(D){const A=u.eBV(v).$implicit,k=c.XpG();return u.Njj(k.handleClick(D,A))}),c.nrm(1,"cue-button-icon",6),c.k0s()}if(2&C){const v=T.$implicit,b=c.XpG(),D=c.sdS(1);c.Y8G("cueTooltip",v.label)("variant",v.variant?v.variant:b.variant())("size",b.size())("cueContextMenu",D)("contextMenuData",c.lJ4(7,y))("cueContextEnabled",void 0!==v.contextMenuItems&&v.contextMenuItems.length>0),c.R7$(),c.Y8G("icon",v.icon)}}let j=(()=>{class C{items=h.hFB.required();noGap=(0,h.hFB)(!0);direction=(0,h.hFB)("row");size=(0,h.hFB)("xs");variant=(0,h.hFB)("tertiary");mouseEnter=(0,h.CGW)();mouseLeave=(0,h.CGW)();contextMenuItems=(0,u.vPA)([]);handleClick(v,b){v.stopPropagation(),b.contextMenuItems&&b.contextMenuItems.length>0?this.contextMenuItems.set(b.contextMenuItems):b.action&&(this.contextMenuItems.set([]),b.action())}static \u0275fac=function(b){return new(b||C)};static \u0275cmp=c.VBU({type:C,selectors:[["cue-entity-menu"]],inputs:{items:[1,"items"],noGap:[1,"noGap"],direction:[1,"direction"],size:[1,"size"],variant:[1,"variant"]},outputs:{mouseEnter:"mouseEnter",mouseLeave:"mouseLeave"},decls:5,vars:2,consts:[["contextMenu",""],["gap","s","justify","end",2,"width","100%",3,"mouseenter","mouseleave","direction","noGap"],["trigger","leftclick",3,"cueTooltip","variant","size","cueContextMenu","contextMenuData","cueContextEnabled"],[3,"selected"],[3,"click","selected"],["trigger","leftclick",3,"click","cueTooltip","variant","size","cueContextMenu","contextMenuData","cueContextEnabled"],[3,"icon"]],template:function(b,D){1&b&&(c.DNE(0,I,3,0,"ng-template",null,0,c.C5r),c.j41(2,"cue-flexcontainer",1),c.bIt("mouseenter",function(){return D.mouseEnter.emit()})("mouseleave",function(){return D.mouseLeave.emit()}),c.Z7z(3,L,2,8,"cue-button",2,p),c.k0s()),2&b&&(c.R7$(2),c.Y8G("direction",D.direction())("noGap",D.noGap()),c.R7$(),c.Dyx(D.items()))},dependencies:[e.n,f.$,m.d,E.a,r.Q,x.M,R.D],encapsulation:2,changeDetection:0})}return C})()},1024(O,w,l){l.d(w,{p:()=>m});var h=l(5547);const u=["*"];let m=(()=>{class r{static \u0275fac=function(E){return new(E||r)};static \u0275cmp=h.VBU({type:r,selectors:[["cue-key-val-list"]],ngContentSelectors:u,decls:2,vars:0,consts:[[1,"key-val-list"]],template:function(E,x){1&E&&(h.NAR(),h.rj2(0,"div",0),h.SdG(1),h.eux())},styles:[".key-val-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:var(--cue-grid-gap-s)}"]})}return r})()},9421(O,w,l){l.d(w,{F:()=>E});var h=l(7705),u=l(5802),m=l(2271),r=l(7335),e=l(2245),f=l(5547);let E=(()=>{class x{entityMenuDirective;size=(0,h.hFB)("m");key=h.hFB.required();val=h.geq.required();options=(0,h.hFB)([]);suffix=(0,h.hFB)("");valueChange=(0,h.CGW)();editModeEnabled=(0,u.vPA)(!1);valueChanged=(0,m.EW)(()=>this.val()!==this.newValue());newValue=(0,m.uu)(()=>this.val());labelSize=(0,m.EW)(()=>{switch(this.size()){case"s":return"xs";case"m":return"s";case"l":return"m";case"xl":return"l"}});onKeyPress(c){this.editModeEnabled()&&("Escape"===c.key?(this._reset(),c.stopPropagation()):"Enter"===c.key&&this._emitChange())}saveCancelMenu=(0,m.EW)(()=>{const c=[{icon:"close",label:"Cancel",action:()=>this._reset()}];return this.valueChanged()&&c.push({icon:"save",label:"Save",action:()=>this._emitChange()}),c});selectionChange(c){this.newValue.set(c?.toString()??"")}inputChange(c){this.newValue.set(c)}_emitChange(){this.valueChange.emit(this.newValue()),this.val.set(this.newValue()),this.editModeEnabled.set(!1)}_reset(){this.newValue.set(this.val()),this.editModeEnabled.set(!1)}static \u0275fac=function(y){return new(y||x)};static \u0275cmp=f.VBU({type:x,selectors:[["cue-key-val"]],viewQuery:function(y,p){if(1&y&&f.GBs(r.e,5),2&y){let P;f.mGM(P=f.lsd())&&(p.entityMenuDirective=P.first)}},hostBindings:function(y,p){1&y&&f.bIt("keydown",function(I){return p.onKeyPress(I)},f.EBC)},inputs:{size:[1,"size"],key:[1,"key"],val:[1,"val"],options:[1,"options"],suffix:[1,"suffix"]},outputs:{val:"valChange",valueChange:"valueChange"},decls:8,vars:5,consts:[[1,"key-val-container"],[3,"size"],[1,"value-content"]],template:function(y,p){1&y&&(f.j41(0,"dl",0)(1,"dt")(2,"cue-typography",1),f.EFF(3),f.k0s()(),f.j41(4,"dd")(5,"cue-typography",1)(6,"span",2),f.EFF(7),f.k0s()()()()),2&y&&(f.R7$(2),f.Y8G("size",p.labelSize()),f.R7$(),f.JRh(p.key()),f.R7$(2),f.Y8G("size",p.size()),f.R7$(2),f.Lme("",p.val()," ",p.suffix()))},dependencies:[e.Typography],styles:[".key-val-container[_ngcontent-%COMP%]{margin:0;display:flex;flex-direction:column;gap:var(--cue-grid-gap-s, 8px)}dt[_ngcontent-%COMP%], dd[_ngcontent-%COMP%]{margin:0}.read-mode-container[_ngcontent-%COMP%]{display:inline-flex;align-items:center;width:100%;position:relative}.read-mode-container.interactive[_ngcontent-%COMP%]:hover{cursor:pointer}.value-content[_ngcontent-%COMP%]{flex:1}[_nghost-%COMP%]{color:var(--cue-typography-text-color, inherit)}dt[_ngcontent-%COMP%] cue-typography[_ngcontent-%COMP%], dd[_ngcontent-%COMP%] cue-typography[_ngcontent-%COMP%], .value-content[_ngcontent-%COMP%]{color:var(--cue-typography-text-color, inherit)!important}dt[_ngcontent-%COMP%] cue-typography[_ngcontent-%COMP%] div[_ngcontent-%COMP%], dd[_ngcontent-%COMP%] cue-typography[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{color:var(--cue-typography-text-color, inherit)!important}[_ngcontent-%COMP%]:deep(cue-svg-icon), [_ngcontent-%COMP%]:deep(cue-entity-menu cue-svg-icon){color:var(--cue-icon-color, inherit)!important}.dirty-indicator[_ngcontent-%COMP%]{opacity:.8;margin-left:4px;color:var(--cue-typography-text-color, inherit)!important;font-weight:700;font-size:.4em;transform:translateY(-1em)}"]})}return x})()},7335(O,w,l){l.d(w,{e:()=>x});var h=l(7705),u=l(5802),m=l(5547),r=l(8359),e=l(6939),f=l(63),E=l(4853);let x=(()=>{class R{_targetEl=(0,u.WQX)(m.aKT);_overlay=(0,u.WQX)(f.hJ);_overlayRef;_isOverlayHovered=!1;_subscriptions;display=(0,h.hFB)("on-hover");menuItems=h.hFB.required();menuEnabled=(0,h.hFB)(!0);onMouseEnter(){if("on-hover"===this.display()){if(!this.menuItems().length)return void this.removeOverlayMenu();this.appendOverlayMenu()}}onMouseLeave(){this._checkShouldRemoveOverlay()}appendOverlayMenu(){if(!this.menuItems().length||this._overlayRef)return;const y=this._overlay.create({positionStrategy:this._overlay.position().flexibleConnectedTo(this._targetEl).withPositions([{originX:"end",originY:"center",overlayX:"start",overlayY:"center",offsetX:2,offsetY:0}])});this._overlayRef=y;const p=window.getComputedStyle(this._targetEl.nativeElement).color;y.overlayElement.style.color=p;const P=new e.A8(E.H),I=y.attach(P);I.instance.items=this.menuItems,this._subscriptions&&this._subscriptions.unsubscribe(),this._subscriptions=new r.yU,this._subscriptions.add(I.instance.mouseEnter.subscribe(()=>{this._isOverlayHovered=!0})),this._subscriptions.add(I.instance.mouseLeave.subscribe(()=>{this._isOverlayHovered=!1,this._checkShouldRemoveOverlay()}))}removeOverlayMenu(){this._overlayRef&&(this._subscriptions&&(this._subscriptions.unsubscribe(),this._subscriptions=void 0),this._overlayRef.detach(),this._overlayRef.dispose(),this._overlayRef=void 0)}_checkShouldRemoveOverlay(){setTimeout(()=>{this._isOverlayHovered||this.removeOverlayMenu()},300)}static \u0275fac=function(p){return new(p||R)};static \u0275dir=m.FsC({type:R,selectors:[["","cueEntityMenu",""]],hostBindings:function(p,P){1&p&&m.bIt("mouseenter",function(){return P.onMouseEnter()})("mouseleave",function(){return P.onMouseLeave()})},inputs:{display:[1,"display"],menuItems:[1,"menuItems"],menuEnabled:[1,"menuEnabled"]}})}return R})()},3112(O,w,l){l.d(w,{CueDocumentViewer:()=>Te});var h=l(467),u=l(7705),m=l(2271),r=l(5802),e=l(5547),f=l(9769),E=l(5381),x=l(2245),R=l(1024),c=l(9421),y=l(5903),p=l(9352),P=l(6117),I=l(8547),L=l(3319),j=l(5971),C=l(7573);const T=(o,_)=>t=>t.isHighlight;function v(o,_){if(1&o&&(e.j41(0,"span",3),e.EFF(1),e.k0s()),2&o){const t=e.XpG(2).$implicit;e.R7$(),e.JRh(t.highlight.label)}}function b(o,_){if(1&o){const t=e.RV6();e.j41(0,"cue-button",5),e.bIt("click",function(i){r.eBV(t);const a=e.XpG(2).$implicit,s=e.XpG();return r.Njj(s.onDeleteHighlight(i,a.highlight))}),e.nrm(1,"cue-button-icon",6),e.k0s()}}function D(o,_){if(1&o){const t=e.RV6();e.j41(0,"span",2),e.bIt("click",function(){r.eBV(t);const i=e.XpG().$implicit,a=e.XpG();return r.Njj(a.onHighlightClick(i.highlight))}),e.nVh(1,v,2,1,"span",3),e.EFF(2),e.nVh(3,b,2,0,"cue-button",4),e.k0s()}if(2&o){const t=e.XpG().$implicit,n=e.XpG();e.BMQ("data-segment-start",t.segmentStart),e.R7$(),e.vxM(t.highlight.label?1:-1),e.R7$(),e.SpI(" ",t.text," "),e.R7$(),e.vxM(n.allowDelete()?3:-1)}}function A(o,_){if(1&o&&(e.j41(0,"span"),e.EFF(1),e.k0s()),2&o){const t=e.XpG().$implicit;e.BMQ("data-segment-start",t.segmentStart),e.R7$(),e.JRh(t.text)}}function k(o,_){if(1&o&&e.nVh(0,D,4,4,"span",1)(1,A,2,2,"span"),2&o){const t=_.$implicit;e.vxM(t.isHighlight&&t.highlight?0:1)}}let z=(()=>{class o{path=u.hFB.required();highlights=(0,u.hFB)([]);allowDelete=(0,u.hFB)(!1);allowAdd=(0,u.hFB)(!1);size=(0,u.hFB)("m");highlightClick=(0,u.CGW)();deleteHighlight=(0,u.CGW)();textSelected=(0,u.CGW)();segments=(0,m.EW)(()=>this.parseSegments(this.path(),this.highlights()));parseSegments(t,n){const i=n.filter(g=>g.path===t);if(0===i.length)return[{text:t,isHighlight:!1,segmentStart:0}];const a=[...i].sort((g,M)=>g.start-M.start),s=[];let d=0;for(const g of a)g.start>d&&s.push({text:t.substring(d,g.start),isHighlight:!1,segmentStart:d}),s.push({text:t.substring(g.start,g.end),isHighlight:!0,highlight:g,segmentStart:g.start}),d=g.end;return d<t.length&&s.push({text:t.substring(d),isHighlight:!1,segmentStart:d}),s}onHighlightClick(t){const n=this.path().substring(t.start,t.end);this.highlightClick.emit({path:this.path(),highlight:t,text:n})}onDeleteHighlight(t,n){t.stopPropagation(),this.deleteHighlight.emit({path:this.path(),highlight:n})}onMouseUp(t){if(!this.allowAdd())return;const n=window.getSelection();if(!n||n.isCollapsed||!n.rangeCount||!n.toString().trim())return;const a=n.getRangeAt(0),s=t.currentTarget,d=this.getAbsoluteOffset(s,a.startContainer,a.startOffset),g=this.getAbsoluteOffset(s,a.endContainer,a.endOffset);n.removeAllRanges(),g>d&&this.textSelected.emit({path:this.path(),start:d,end:g,text:this.path().substring(d,g)})}getAbsoluteOffset(t,n,i){let a=n.nodeType===Node.TEXT_NODE?n.parentElement:n;for(;a&&a!==t;){if(a instanceof HTMLElement&&a.hasAttribute("data-segment-start")){const M=parseInt(a.getAttribute("data-segment-start"),10);let F=0;const N=document.createTreeWalker(a,NodeFilter.SHOW_TEXT);let V=N.nextNode();for(;V&&V!==n;)F+=V.textContent?.length??0,V=N.nextNode();return M+F+i}a=a.parentElement}const s=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);let d=0,g=s.nextNode();for(;g&&g!==n;)d+=g.textContent?.length??0,g=s.nextNode();return d+i}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=e.VBU({type:o,selectors:[["cue-file-path-viewer"]],inputs:{path:[1,"path"],highlights:[1,"highlights"],allowDelete:[1,"allowDelete"],allowAdd:[1,"allowAdd"],size:[1,"size"]},outputs:{highlightClick:"highlightClick",deleteHighlight:"deleteHighlight",textSelected:"textSelected"},decls:3,vars:7,consts:[[1,"path-content",3,"mouseup"],[1,"highlight-segment"],[1,"highlight-segment",3,"click"],[1,"highlight-label"],["size","xs","aria-label","Remove highlight",1,"delete-button"],["size","xs","aria-label","Remove highlight",1,"delete-button",3,"click"],["icon","close"]],template:function(n,i){1&n&&(e.j41(0,"div",0),e.bIt("mouseup",function(s){return i.onMouseUp(s)}),e.Z7z(1,k,2,1,null,null,e.Vm6),e.k0s()),2&n&&(e.AVh("size-s","s"===i.size())("allow-add",i.allowAdd())("has-highlights",i.segments().some(e._m7(6,T,i))),e.R7$(),e.Dyx(i.segments()))},dependencies:[f.MD,j.$,L.a],styles:["[_nghost-%COMP%]{display:contents}.path-content[_ngcontent-%COMP%]{display:block;flex:1;min-width:0;word-break:break-all;text-align:start;font-family:var(--cue-font-family);font-size:var(--cue-font-m-size);line-height:var(--cue-font-m-line-height);letter-spacing:var(--cue-font-m-letter-spacing);font-weight:var(--cue-font-weight-regular)}.path-content.size-s[_ngcontent-%COMP%]{font-size:var(--cue-font-s-size);line-height:var(--cue-font-s-line-height);letter-spacing:var(--cue-font-s-letter-spacing)}.path-content.allow-add[_ngcontent-%COMP%]{cursor:text;-webkit-user-select:text;user-select:text}.path-content.has-highlights[_ngcontent-%COMP%]{padding-top:.8rem;line-height:2.3rem}.highlight-segment[_ngcontent-%COMP%]{display:inline-block;vertical-align:text-bottom;position:relative;line-height:normal;font-weight:var(--cue-font-weight-medium);cursor:pointer;padding:0 .2rem;border-radius:3px;border:1px solid currentColor;transition:all .2s ease}.highlight-segment[_ngcontent-%COMP%] .highlight-label[_ngcontent-%COMP%]{font-family:var(--cue-font-family);position:absolute;bottom:100%;left:0;font-size:.5rem;line-height:1;opacity:.7;margin-bottom:.15rem;white-space:nowrap;pointer-events:none}.highlight-segment[_ngcontent-%COMP%] .delete-button[_ngcontent-%COMP%]{position:absolute;top:-12px;right:-12px;z-index:10;opacity:0;transition:opacity .2s ease;pointer-events:none}.highlight-segment[_ngcontent-%COMP%]:hover{background:color-mix(in srgb,currentColor 12%,transparent)}.highlight-segment[_ngcontent-%COMP%]:hover .delete-button[_ngcontent-%COMP%]{opacity:1;pointer-events:all}"],changeDetection:0})}return o})();var H=l(5745),X=l(2444),K=l(9695),Y=l(5448),J=l(2611);const G=o=>({count:o}),Q=(o,_)=>t=>t.iri;function Z(o,_){1&o&&(e.j41(0,"cue-typography",11),e.EFF(1),e.nI1(2,"transloco"),e.k0s()),2&o&&(e.R7$(),e.JRh(e.bMT(2,1,"components.documentInfo.infoLoadingFilePaths")))}function q(o,_){if(1&o){const t=e.RV6();e.j41(0,"cue-ag-grid",16),e.bIt("selectedRows",function(i){r.eBV(t);const a=e.XpG(4);return r.Njj(a.onMatchedPathsSelectionChange(i))}),e.k0s()}if(2&o){const t=e.XpG(4);e.Y8G("rowData",t._matchTableRowData())("columnDefs",t._matchTableColDefs())("rowSelection",t._matchTableRowSelection)}}function ee(o,_){if(1&o){const t=e.RV6();e.j41(0,"cue-flexcontainer",12)(1,"cue-button",13),e.bIt("click",function(){r.eBV(t);const i=e.XpG(3);return r.Njj(i._matchTableExpanded.set(!i._matchTableExpanded()))}),e.nrm(2,"cue-button-icon",14),e.j41(3,"cue-button-label"),e.EFF(4),e.nI1(5,"transloco"),e.k0s()(),e.nVh(6,q,1,3,"cue-ag-grid",15),e.k0s(),e.j41(7,"cue-typography",11),e.EFF(8),e.nI1(9,"transloco"),e.k0s()}if(2&o){const t=e.XpG(3);e.R7$(2),e.Y8G("icon",t._matchTableExpanded()?"arrow-up":"arrow-dropdown"),e.R7$(2),e.JRh(e.i5U(5,4,1===t._matchCount()?"components.documentInfo.filePathMatched":"components.documentInfo.filePathsMatched",e.eq3(10,G,t._matchCount()))),e.R7$(2),e.vxM(t._matchTableExpanded()?6:-1),e.R7$(2),e.JRh(e.i5U(9,7,"components.documentInfo.applyToNPaths",e.eq3(12,G,t._selectedPaths().length)))}}function te(o,_){if(1&o&&e.nVh(0,Z,3,3,"cue-typography",11)(1,ee,10,14),2&o){const t=e.XpG(2);e.vxM(t._fileLocationsLoading()?0:null!==t._fileLocations()?1:-1)}}function ne(o,_){if(1&o){const t=e.RV6();e.j41(0,"cue-flexcontainer",9)(1,"cue-input-switch",10),e.bIt("toggleChange",function(i){r.eBV(t);const a=e.XpG();return r.Njj(a.onApplyToAllChange(i))}),e.k0s(),e.j41(2,"cue-typography",11),e.EFF(3),e.nI1(4,"transloco"),e.k0s()(),e.nVh(5,te,2,1)}if(2&o){const t=e.XpG();e.R7$(),e.Y8G("checked",t._applyToAllFiles()),e.R7$(2),e.JRh(e.bMT(4,3,"components.documentInfo.applyToAllFiles")),e.R7$(2),e.vxM(t._applyToAllFiles()?5:-1)}}function ie(o,_){if(1&o&&(e.j41(0,"cue-typography",8),e.EFF(1),e.nI1(2,"transloco"),e.k0s()),2&o){const t=e.XpG();e.R7$(),e.Lme("",e.bMT(2,2,"components.documentInfo.errorSavingEntityMention"),": ",t._saveError())}}let oe=(()=>{class o{selection=u.hFB.required();availableEntityCategories=(0,u.hFB)([]);fileLocations=(0,u.hFB)([]);requestFileLocations=(0,u.hFB)(void 0);requestFilePathEntityAdd=(0,u.hFB)(void 0);confirm=(0,u.CGW)();cancel=(0,u.CGW)();_selectedEntityCategory=(0,r.vPA)("");_applyToAllFiles=(0,r.vPA)(!1);_fileLocations=(0,r.vPA)(null);_fileLocationsLoading=(0,r.vPA)(!1);_matchTableExpanded=(0,r.vPA)(!1);_selectedPaths=(0,r.vPA)([]);_saving=(0,r.vPA)(!1);_saveError=(0,r.vPA)(null);_dirPrefix=(0,m.EW)(()=>{const t=this.selection();return t.path.substring(0,t.end)});_matchedLocations=(0,m.EW)(()=>{const t=this._fileLocations();if(!t)return[];const n=this._dirPrefix();return t.filter(i=>i.path.startsWith(n))});_matchCount=(0,m.EW)(()=>this._matchedLocations().length);_matchTableRowData=(0,m.EW)(()=>this._matchedLocations().map(t=>({iri:t.iri,path:t.path,providerId:t.providerId})));_entityCategoryLabelMap=(0,m.EW)(()=>this.availableEntityCategories().reduce((t,n)=>(t[n.iri]=n.label,t),{}));_matchTableRowSelection={mode:"multiRow",selectAll:"filtered"};_filePathLabel=(0,p.Xx)("components.contentBlocks.documentViewer.labelFilePath");_matchTableColDefs=(0,m.EW)(()=>[{headerName:this._filePathLabel(),field:"path",flex:1,filter:!0,sortable:!0}]);onEntityCategoryChange(t){this._selectedEntityCategory.set("string"==typeof t?t:String(t??""))}onApplyToAllChange(t){var n=this;return(0,h.A)(function*(){if(n._applyToAllFiles.set(t),n._matchTableExpanded.set(!1),!t)return n._fileLocations.set(null),void n._selectedPaths.set([]);const i=n.requestFileLocations();if(i){n._fileLocationsLoading.set(!0);try{const a=yield i();n._fileLocations.set(a);const s=n._dirPrefix();n._selectedPaths.set(a.filter(d=>d.path.startsWith(s)))}finally{n._fileLocationsLoading.set(!1)}}})()}onMatchedPathsSelectionChange(t){const n=this._fileLocations()??[];this._selectedPaths.set(t.map(i=>n.find(a=>a.path===i.path)??{iri:"",path:i.path}))}onConfirm(){var t=this;return(0,h.A)(function*(){const n=t._selectedEntityCategory();if(!n)return;const i=t.selection().path,a=t._fileLocations()?.find(g=>g.path===i)??t.fileLocations().find(g=>g.path===i)??{iri:"",path:i},s=t._applyToAllFiles()&&t._selectedPaths().length>0?t._selectedPaths():[a],d=t.requestFilePathEntityAdd();if(d){t._saving.set(!0),t._saveError.set(null);try{yield d(n,s)}catch(g){return console.error("[EntityMentionModal] Failed to save entity mention:",g),t._saveError.set(g instanceof Error?g.message:String(g)),void t._saving.set(!1)}t._saving.set(!1)}t.confirm.emit({entityCategory:n,paths:s})})()}onCancel(){this.cancel.emit()}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=e.VBU({type:o,selectors:[["cue-entity-mention-modal"]],inputs:{selection:[1,"selection"],availableEntityCategories:[1,"availableEntityCategories"],fileLocations:[1,"fileLocations"],requestFileLocations:[1,"requestFileLocations"],requestFilePathEntityAdd:[1,"requestFilePathEntityAdd"]},outputs:{confirm:"confirm",cancel:"cancel"},decls:18,vars:24,consts:[[3,"close","displayCloseBtn","closeOnBackgroundClick"],[1,"modal-content"],["direction","column","gap","m"],[3,"key","val"],[3,"valueChange","value","options","labelMap","label","showFilter"],["direction","row","justify","center"],[3,"click","disabled"],["variant","secondary",3,"click","disabled"],["size","s",2,"color","var(--cue-error)"],["direction","row","gap","s","align","center"],[3,"toggleChange","checked"],["size","s"],["direction","column","gap","xs"],["variant","ghost","size","xs",3,"click"],[3,"icon"],["size","s","height","220px",3,"rowData","columnDefs","rowSelection"],["size","s","height","220px",3,"selectedRows","rowData","columnDefs","rowSelection"]],template:function(n,i){1&n&&(e.j41(0,"cue-modal",0),e.bIt("close",function(){return i.onCancel()}),e.j41(1,"div",1)(2,"cue-flexcontainer",2),e.nrm(3,"cue-key-val",3),e.nI1(4,"transloco"),e.j41(5,"cue-select",4),e.nI1(6,"transloco"),e.bIt("valueChange",function(s){return i.onEntityCategoryChange(s)}),e.k0s(),e.nVh(7,ne,6,5),e.j41(8,"cue-flexcontainer",5)(9,"cue-button",6),e.bIt("click",function(){return i.onCancel()}),e.j41(10,"cue-button-label"),e.EFF(11),e.nI1(12,"transloco"),e.k0s()(),e.j41(13,"cue-button",7),e.bIt("click",function(){return i.onConfirm()}),e.j41(14,"cue-button-label"),e.EFF(15),e.nI1(16,"transloco"),e.k0s()()(),e.nVh(17,ie,3,4,"cue-typography",8),e.k0s()()()),2&n&&(e.Y8G("displayCloseBtn",!1)("closeOnBackgroundClick",!1),e.R7$(3),e.Y8G("key",e.bMT(4,15,"components.documentInfo.labelSelectedText"))("val",i.selection().text),e.R7$(2),e.Y8G("value",i._selectedEntityCategory())("options",i.availableEntityCategories().map(e._m7(17,Q,i)))("labelMap",i._entityCategoryLabelMap())("label",e.bMT(6,18,"components.entityInfo.labelEntityCategory"))("showFilter",i.availableEntityCategories().length>5),e.R7$(2),e.vxM(i.requestFileLocations()?7:-1),e.R7$(2),e.Y8G("disabled",i._saving()),e.R7$(2),e.JRh(e.bMT(12,20,"components.modals.rdfEdit.buttonCancel")),e.R7$(2),e.Y8G("disabled",!i._selectedEntityCategory()||i._saving()),e.R7$(2),e.JRh(e.bMT(16,22,"components.modals.rdfEdit.buttonSave")),e.R7$(2),e.vxM(i._saveError()?17:-1))},dependencies:[E.n,c.F,L.a,j.$,Y.L,x.Typography,H.a,X.l,K.d,J.R,p.Kj],styles:[".modal-content[_ngcontent-%COMP%]{width:640px;max-width:calc(100vw - 32px)}"],changeDetection:0})}return o})();const ae=()=>[];function se(o,_){if(1&o&&(e.nrm(0,"cue-key-val",6),e.nI1(1,"transloco")),2&o){const t=e.XpG(2);e.Y8G("key",e.bMT(1,2,"components.contentBlocks.documentViewer.labelSubject"))("val",t.subject())}}function le(o,_){if(1&o&&(e.j41(0,"cue-key-val-list"),e.nVh(1,se,2,4,"cue-key-val",6),e.k0s()),2&o){const t=e.XpG();e.R7$(),e.vxM(t.subject()?1:-1)}}function ce(o,_){if(1&o&&(e.j41(0,"cue-flexcontainer",4)(1,"cue-menu",7)(2,"cue-button",8,0),e.nrm(4,"cue-button-icon",9),e.k0s(),e.nrm(5,"cue-menu-nested",10),e.k0s()()),2&o){const t=e.XpG();e.R7$(5),e.Y8G("items",t.menuItems())}}function re(o,_){if(1&o&&(e.nrm(0,"cue-key-val-editable",11),e.nI1(1,"transloco"),e.nI1(2,"transloco")),2&o){const t=e.XpG(2);e.Y8G("key",1===t.contentCategories().length?e.bMT(1,4,"components.contentBlocks.documentViewer.labelContentCategory"):e.bMT(2,6,"components.contentBlocks.documentViewer.labelContentCategories"))("val",t.contentCategoriesString())("rdfConfig",t.rdfEditConfig())("editDisabled",!t.contentCategoriesEditable())}}function ue(o,_){if(1&o&&(e.j41(0,"span",15),e.EFF(1),e.k0s()),2&o){const t=e.XpG(3);e.R7$(),e.Lme("(",t.currentFilePathIndex()+1,"/",t.fileLocations().length,")")}}function de(o,_){if(1&o){const t=e.RV6();e.j41(0,"cue-button",19),e.bIt("click",function(){r.eBV(t);const i=e.XpG(3);return r.Njj(i.prevFilePath())}),e.nrm(1,"cue-button-icon",20),e.k0s()}if(2&o){const t=e.XpG(3);e.Y8G("disabled",0===t.currentFilePathIndex())}}function ge(o,_){if(1&o){const t=e.RV6();e.j41(0,"cue-button",19),e.bIt("click",function(){r.eBV(t);const i=e.XpG(3);return r.Njj(i.nextFilePath())}),e.nrm(1,"cue-button-icon",21),e.k0s()}if(2&o){const t=e.XpG(3);e.Y8G("disabled",t.currentFilePathIndex()===t.fileLocations().length-1)}}function he(o,_){if(1&o){const t=e.RV6();e.j41(0,"dl",12)(1,"dt",13)(2,"cue-typography",14),e.EFF(3),e.nI1(4,"transloco"),e.nVh(5,ue,2,2,"span",15),e.k0s()(),e.j41(6,"dd",16),e.nVh(7,de,2,1,"cue-button",17),e.j41(8,"cue-file-path-viewer",18),e.bIt("textSelected",function(i){r.eBV(t);const a=e.XpG(2);return r.Njj(a.onTextSelected(i))}),e.k0s(),e.nVh(9,ge,2,1,"cue-button",17),e.k0s()()}if(2&o){const t=e.XpG(2);e.R7$(3),e.SpI(" ",e.bMT(4,8,"components.contentBlocks.documentViewer.labelFilePath")," "),e.R7$(2),e.vxM(t.fileLocations().length>1?5:-1),e.R7$(2),e.vxM(t.fileLocations().length>1?7:-1),e.R7$(),e.Y8G("path",t.fileLocations()[t.currentFilePathIndex()].path)("highlights",t.filePathEntitiesVisible()?t.filePathHighlights():e.lJ4(10,ae))("allowDelete",t.filePathEntitiesEditable())("allowAdd",t.filePathEntitiesEditable()),e.R7$(),e.vxM(t.fileLocations().length>1?9:-1)}}function _e(o,_){if(1&o&&(e.j41(0,"cue-key-val-list"),e.nrm(1,"hr"),e.nVh(2,re,3,8,"cue-key-val-editable",11),e.nVh(3,he,10,11,"dl",12),e.k0s()),2&o){const t=e.XpG();e.R7$(2),e.vxM(t.contentCategories()&&t.contentCategories().length>0?2:-1),e.R7$(),e.vxM(t.fileLocations().length>0?3:-1)}}function me(o,_){if(1&o){const t=e.RV6();e.j41(0,"cue-entity-mention-modal",22),e.bIt("confirm",function(i){r.eBV(t);const a=e.XpG();return r.Njj(a.onEntityMentionConfirm(i))})("cancel",function(){r.eBV(t);const i=e.XpG();return r.Njj(i.onEntityMentionCancel())}),e.k0s()}if(2&o){const t=e.XpG();e.Y8G("selection",t._pendingSelection())("availableEntityCategories",t.availableEntityCategories())("fileLocations",t.fileLocations())("requestFileLocations",t._fileLocationsProvider())("requestFilePathEntityAdd",t._requestFilePathEntityAdd())}}let fe=(()=>{class o{subject=u.hFB.required();handlers=u.hFB.required();dataChanged=(0,u.CGW)();filePathEntityAdded=(0,u.CGW)();fileLocations=(0,u.hFB)([]);_fileLocationsProvider=(0,m.EW)(()=>{const t=this.handlers().requestFileLocations;if(t)return t;const n=this.fileLocations();return n.length?()=>Promise.resolve(n):void 0});filePathEntities=(0,u.geq)([]);contentCategories=(0,u.hFB)([]);contentCategoriesEditable=(0,u.hFB)(!1);filePathEntitiesVisible=(0,u.hFB)(!1);filePathEntitiesEditable=(0,u.hFB)(!1);menuItems=(0,u.hFB)([]);availableContentCategories=(0,u.hFB)([]);availableEntityCategories=(0,u.hFB)([]);collapsed=(0,u.hFB)(!1);hasDocInfo=(0,m.EW)(()=>{const t=""!==this.subject(),n=this.fileLocations().length>0;return t||n});currentFilePathIndex=(0,r.vPA)(0);_entityCategoryModalVisible=(0,r.vPA)(!1);_pendingSelection=(0,r.vPA)(null);_requestFilePathEntityAdd=(0,m.EW)(()=>{var t=this;const n=this.handlers().requestFilePathEntityAdd;if(n)return function(){var i=(0,h.A)(function*(a,s){const d=t._pendingSelection();d&&(yield n({paths:s,start:d.start,end:d.end,text:d.text,entityCategory:a,folderPath:d.path.substring(0,d.end)}))});return function(a,s){return i.apply(this,arguments)}}()});prevFilePath(){this.currentFilePathIndex()>0&&this.currentFilePathIndex.update(t=>t-1)}nextFilePath(){this.currentFilePathIndex()<this.fileLocations().length-1&&this.currentFilePathIndex.update(t=>t+1)}filePathHighlights=(0,m.EW)(()=>this.filePathEntities().map(t=>({path:t.path,start:t.startIndex,end:t.endIndex,label:this.availableEntityCategories().find(n=>n.iri===t.entityCategory)?.label??t.entityCategory.split("/").pop()??t.entityCategory})));entityCategoryLabelMap=(0,m.EW)(()=>this.availableEntityCategories().reduce((t,n)=>(t[n.iri]=n.label,t),{}));onTextSelected(t){this._pendingSelection.set(t),this._entityCategoryModalVisible.set(!0)}onEntityMentionConfirm(t){const n=this._pendingSelection();n&&(this.filePathEntities.update(i=>[...i,...t.paths.map(a=>({path:a.path,entityCategory:t.entityCategory,startIndex:n.start,endIndex:n.end}))]),this.filePathEntityAdded.emit({paths:t.paths,start:n.start,end:n.end,text:n.text,entityCategory:t.entityCategory,folderPath:n.path.substring(0,n.end)}),this._entityCategoryModalVisible.set(!1),this._pendingSelection.set(null))}onEntityMentionCancel(){this._entityCategoryModalVisible.set(!1),this._pendingSelection.set(null)}_contentCategories=(0,m.uu)(()=>this.contentCategories());contentCategoriesString=(0,m.EW)(()=>this._contentCategories().map(t=>this._iriToString(t)).sort().join(", "));_iriToString(t){const n=this.availableContentCategories()?.find(i=>i.iri===t);return n?n.label:t}infoChangeContentCategory=(0,p.Xx)("components.documentInfo.infoChangeContentCategory");rdfEditConfig=(0,m.EW)(()=>{var t=this;const n=this.handlers()?.requestRDFChange;var i;if(void 0!==n)return{message:this.infoChangeContentCategory(),existingValue:this._contentCategories(),dataType:"multiselect",options:this.availableContentCategories()?.map(i=>i.iri),optionLabelMap:this.availableContentCategories()?.reduce((i,a)=>(i[a.iri]=a.label,i),{}),requestSave:(i=(0,h.A)(function*(a){console.log(a);const s={subject:t.subject(),predicate:`${C.E.qcy}contentCategory`,objects:t._contentCategories(),newObjects:a.newValue,type:"contentCategory",comment:a.comment};yield n(s),t._contentCategories.set(a.newValue),t.dataChanged.emit({contentCategories:a.newValue})}),function(s){return i.apply(this,arguments)})};console.warn("No RDF change request handler defined")});static \u0275fac=function(n){return new(n||o)};static \u0275cmp=e.VBU({type:o,selectors:[["cue-document-info"]],inputs:{subject:[1,"subject"],handlers:[1,"handlers"],fileLocations:[1,"fileLocations"],filePathEntities:[1,"filePathEntities"],contentCategories:[1,"contentCategories"],contentCategoriesEditable:[1,"contentCategoriesEditable"],filePathEntitiesVisible:[1,"filePathEntitiesVisible"],filePathEntitiesEditable:[1,"filePathEntitiesEditable"],menuItems:[1,"menuItems"],availableContentCategories:[1,"availableContentCategories"],availableEntityCategories:[1,"availableEntityCategories"],collapsed:[1,"collapsed"]},outputs:{dataChanged:"dataChanged",filePathEntityAdded:"filePathEntityAdded",filePathEntities:"filePathEntitiesChange"},decls:7,vars:4,consts:[["trigger",""],["direction","column",2,"min-height","50px"],["direction","row"],["direction","column",2,"flex","1 1"],["direction","column",2,"width","50px"],[3,"selection","availableEntityCategories","fileLocations","requestFileLocations","requestFilePathEntityAdd"],["size","l",3,"key","val"],["positioning","bottomleft"],["trigger","","variant","tertiary"],["icon","more-vert"],["menu","",3,"items"],["size","s",3,"key","val","rdfConfig","editDisabled"],[1,"file-path-nav-container"],[1,"file-path-label"],["size","xs"],[1,"path-counter"],[1,"file-path-row"],["variant","tertiary","size","xs",3,"disabled"],["size","s",3,"textSelected","path","highlights","allowDelete","allowAdd"],["variant","tertiary","size","xs",3,"click","disabled"],["icon","paginator-back"],["icon","paginator-next"],[3,"confirm","cancel","selection","availableEntityCategories","fileLocations","requestFileLocations","requestFilePathEntityAdd"]],template:function(n,i){1&n&&(e.j41(0,"cue-flexcontainer",1)(1,"cue-flexcontainer",2)(2,"cue-flexcontainer",3),e.nVh(3,le,2,1,"cue-key-val-list"),e.k0s(),e.nVh(4,ce,6,1,"cue-flexcontainer",4),e.k0s(),e.nVh(5,_e,4,2,"cue-key-val-list"),e.k0s(),e.nVh(6,me,1,5,"cue-entity-mention-modal",5)),2&n&&(e.R7$(3),e.vxM(i.fileLocations().length>0||i.subject()?3:-1),e.R7$(),e.vxM(i.menuItems().length>0?4:-1),e.R7$(),e.vxM(!i.collapsed()&&i.hasDocInfo()?5:-1),e.R7$(),e.vxM(i._entityCategoryModalVisible()&&i._pendingSelection()?6:-1))},dependencies:[E.n,R.p,c.F,y.L,P.W,I.T,L.a,j.$,z,x.Typography,oe,p.Kj],styles:[".file-path-nav-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2px}.file-path-label[_ngcontent-%COMP%]{display:block;margin:0}.file-path-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px;margin:0;overflow:visible;padding:1px}.file-path-row[_ngcontent-%COMP%] cue-file-path-viewer[_ngcontent-%COMP%]{flex:1;overflow:visible;min-width:0}.path-counter[_ngcontent-%COMP%]{opacity:.6}"],changeDetection:0})}return o})();class pe{requestRDFChange;requestFileLocations;requestFilePathEntityAdd}var ve=l(2065),ye=l(5187);const Ce=["viewerHost"];function be(o,_){if(1&o&&e.nrm(0,"cue-document-info",4),2&o){const t=e.XpG(2);e.Y8G("subject",t._docSubject())("handlers",t._docInfoHandlers)("menuItems",t._menuItems())}}function Me(o,_){1&o&&(e.j41(0,"cue-flexcontainer",5)(1,"cue-typography"),e.EFF(2,"Loading\u2026"),e.k0s()())}function Ee(o,_){if(1&o&&(e.j41(0,"cue-flexcontainer",5)(1,"cue-typography",7),e.EFF(2),e.k0s()()),2&o){const t=e.XpG(2);e.R7$(2),e.JRh(t.errorMessage())}}function xe(o,_){if(1&o&&(e.j41(0,"div",3),e.nVh(1,be,1,3,"cue-document-info",4),e.nVh(2,Me,3,0,"cue-flexcontainer",5)(3,Ee,3,1,"cue-flexcontainer",5),e.j41(4,"div",6),e.eu8(5,null,1),e.k0s()()),2&o){const t=e.XpG();e.R7$(),e.vxM(t.showDocumentInfo()&&"ready"===t.state()?1:-1),e.R7$(),e.vxM("loading"===t.state()?2:"error"===t.state()?3:-1)}}function De(o,_){1&o&&e.eu8(0)}function Pe(o,_){if(1&o&&(e.j41(0,"cue-card",2),e.DNE(1,De,1,0,"ng-container",8),e.k0s()),2&o){const t=e.XpG(),n=e.sdS(1);e.Y8G("variant",t._cardVariant())("padded",!0),e.R7$(),e.Y8G("ngTemplateOutlet",n)}}function we(o,_){1&o&&e.eu8(0)}function Ie(o,_){if(1&o&&e.DNE(0,we,1,0,"ng-container",8),2&o){e.XpG();const t=e.sdS(1);e.Y8G("ngTemplateOutlet",t)}}const Fe=[".fragments",".dxf",".pdf",".png",".jpg",".jpeg",".svg",".gif",".webp",".bmp",".avif",".apng",".xlsx",".xls",".csv",".json",".jsonld",".xml",".css",".js",".html",".htm",".sh",".txt",".rst",".md"];function $(o){const[_,t]=o.split("?"),n=_.trim();let i=null;if(t){const s=new URLSearchParams(t).get("page");if(null!==s){const d=parseInt(s,10);!isNaN(d)&&d>0&&(i=d)}}return{uuid:n,page:i}}let Te=(()=>{class o{set _viewerHostRef(t){if(this._viewerHost=t,t&&this._lastRenderArgs){const{url:n,suffix:i,page:a,viewerTypeOverride:s}=this._lastRenderArgs;this._renderViewer(n,i,a,s)}}_viewerHost;_lastRenderArgs;currentViewerRef;cue=(0,u.hFB)(void 0);uuid=(0,u.hFB)(void 0);projectId=(0,u.hFB)(void 0);showDocumentInfo=(0,u.hFB)(!0);extraMenuItems=(0,u.hFB)([]);portalBaseURL=(0,u.hFB)("https://cue.qaecy.com");variant=(0,u.hFB)("none");_cardVariant=(0,m.EW)(()=>this.variant());state=(0,r.vPA)("idle");errorMessage=(0,r.vPA)(null);resolvedUrl=(0,r.vPA)(null);resolvedSuffix=(0,r.vPA)(null);_docSubject=(0,r.vPA)("");_alternatives=(0,r.vPA)([]);_originalUuid=(0,r.vPA)(null);_originalDocSuffix=(0,r.vPA)(null);_cueSnapshot=null;_projectIdSnapshot=null;_inputWarningTimer;_docInfoHandlers=new pe;_menuItems=(0,m.EW)(()=>{const t=[],n=this._originalUuid(),i=this._originalDocSuffix();n&&i&&t.push({icon:"download",label:"Download file",action:()=>this._downloadOriginal()});const a=this.uuid(),s=this.projectId();if(a&&s){const{uuid:g}=$(a),M=this.portalBaseURL().replace(/\/$/,"");t.push({icon:"external-link",label:"Open in Cue",action:()=>window.open(`${M}/r/${s}/${g}`,"_blank","noopener,noreferrer")})}const d=this._alternatives();if(d.length>1){const g=this.resolvedSuffix();t.push({icon:"document",label:"Alternative representation",children:d.map(M=>({label:M.original?`Original (${M.suffix.replace(".","").toUpperCase()})`:M.suffix.replace(".","").toUpperCase(),tooltip:g===M.suffix?"Currently shown":void 0,action:()=>this._switchToAlternative(M)}))})}return t.push(...this.extraMenuItems()),t});constructor(){this._inputWarningTimer=setTimeout(()=>{this.cue()||console.warn('[cue-document-viewer] Required input "cue" is not set. Pass an authenticated Cue SDK instance.'),this.uuid()||console.warn('[cue-document-viewer] Required input "uuid" is not set. Pass the document UUID to display.'),this.projectId()||console.warn('[cue-document-viewer] Required input "projectId" is not set. Pass the Cue project ID the document belongs to.')},3e3),(0,r.QZP)(()=>{const t=this.cue(),n=this.uuid(),i=this.projectId();t&&n&&i?this._load(t,n,i):this.state.set("idle")})}ngOnDestroy(){clearTimeout(this._inputWarningTimer)}_load(t,n,i){var a=this;return(0,h.A)(function*(){if(t&&n&&i){a.state.set("loading"),a.resolvedUrl.set(null),a.resolvedSuffix.set(null),a.errorMessage.set(null),a._docSubject.set(""),a._originalUuid.set(null),a._originalDocSuffix.set(null),a._alternatives.set([]),a._viewerHost?.clear(),a.currentViewerRef?.destroy(),a.currentViewerRef=void 0,a._lastRenderArgs=void 0;try{a._cueSnapshot=t,a._projectIdSnapshot=i;const{uuid:s,page:d}=$(n),g=t.createProjectDocuments(i),F=(yield g.fetchDocumentData([s]))[s];if(!F)throw new Error(`Document '${s}' not found in project '${i}'.`);a._docSubject.set(F.subject??""),a._originalUuid.set(s),a._originalDocSuffix.set(F.suffix);const N=yield g.fetchAlternativeRepresentations(s);a._alternatives.set([{uuid:s,suffix:F.suffix,original:!0},...N.filter(B=>B.id!==s).map(B=>({uuid:B.id,suffix:B.suffix,original:!1,remoteRelativePath:B.remoteRelativePath}))]);const{uuid:V,suffix:S,remoteRelativePath:W}=function Re(o,_){const t=[o,..._];let n,i=1/0;for(const a of t){const s=Fe.indexOf(a.suffix);-1!==s&&s<i&&(i=s,n=a)}return n?{uuid:n.id,suffix:n.suffix,remoteRelativePath:n.remoteRelativePath}:{uuid:o.id,suffix:o.suffix}}(F,N),U=W?yield t.storage.getAltRepDownloadUrl(W):yield t.storage.getDownloadUrl(i,V,S);a.resolvedUrl.set(U),a.resolvedSuffix.set(S);const Ve=[".eml",".msg",".emlx",".mbx"].includes(F.suffix)&&".json"===S?"email":void 0;yield a._renderViewer(U,S,d,Ve),a.state.set("ready")}catch(s){const d=s instanceof Error?s.message:String(s);console.error("[CueDocumentViewerWC] Failed to load document:",d),a.errorMessage.set(d),a.state.set("error")}}else a.state.set("idle")})()}_renderViewer(t,n,i,a){var s=this;return(0,h.A)(function*(){try{const{DocumentViewer:d}=yield Promise.all([l.e(418),l.e(76),l.e(36)]).then(l.bind(l,3036)),{DocumentViewerSettings:g}=yield l.e(418).then(l.bind(l,3418));s._viewerHost?.clear(),s.currentViewerRef?.destroy();const M=new g;if(null!==i&&(M.pdf.page=String(i)),!s._viewerHost)throw new Error("viewerHost is not yet available \u2014 view has not been initialized.");s._lastRenderArgs={url:t,suffix:n,page:i,viewerTypeOverride:a},s.currentViewerRef=s._viewerHost.createComponent(d),s.currentViewerRef.setInput("url",t),s.currentViewerRef.setInput("suffix",n),s.currentViewerRef.setInput("settings",M),a&&s.currentViewerRef.setInput("viewerTypeOverride",a)}catch(d){throw new Error(`Failed to load viewer component: ${d instanceof Error?d.message:String(d)}`)}})()}_switchToAlternative(t){var n=this;return(0,h.A)(function*(){const i=n._cueSnapshot,a=n._projectIdSnapshot;if(i&&a)try{const s=t.remoteRelativePath?yield i.storage.getAltRepDownloadUrl(t.remoteRelativePath):yield i.storage.getDownloadUrl(a,t.uuid,t.suffix);n.resolvedUrl.set(s),n.resolvedSuffix.set(t.suffix),yield n._renderViewer(s,t.suffix,null)}catch(s){console.error("[CueDocumentViewerWC] Failed to switch to alternative:",s)}})()}_downloadOriginal(){var t=this;return(0,h.A)(function*(){const n=t._cueSnapshot,i=t._projectIdSnapshot,a=t._originalUuid(),s=t._originalDocSuffix();if(n&&i&&a&&s)try{const d=yield n.storage.getDownloadUrl(i,a,s),M=yield(yield fetch(d)).blob();(0,ve.KE)(M,`${a}${s}`)}catch(d){console.error("[CueDocumentViewerWC] Failed to download original:",d)}})()}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=e.VBU({type:o,selectors:[["cue-document-viewer-wc"]],viewQuery:function(n,i){if(1&n&&e.GBs(Ce,5,e.c1b),2&n){let a;e.mGM(a=e.lsd())&&(i._viewerHostRef=a.first)}},inputs:{cue:[1,"cue"],uuid:[1,"uuid"],projectId:[1,"projectId"],showDocumentInfo:[1,"showDocumentInfo"],extraMenuItems:[1,"extraMenuItems"],portalBaseURL:[1,"portalBaseURL"],variant:[1,"variant"]},decls:4,vars:1,consts:[["body",""],["viewerHost",""],[2,"height","100%","width","100%",3,"variant","padded"],[2,"display","flex","flex-direction","column","height","100%","width","100%"],[3,"subject","handlers","menuItems"],["direction","column","align","center","justify","center",2,"flex","1","width","100%"],[2,"flex","1","min-height","0","overflow","hidden"],[2,"color","#c44","font-size","13px"],[4,"ngTemplateOutlet"]],template:function(n,i){1&n&&(e.DNE(0,xe,7,2,"ng-template",null,0,e.C5r),e.nVh(2,Pe,2,3,"cue-card",2)(3,Ie,1,1,"ng-container")),2&n&&(e.R7$(2),e.vxM("none"!==i.variant()?2:3))},dependencies:[f.MD,f.T3,E.n,x.Typography,fe,ye.Z],styles:["[_nghost-%COMP%]{display:contents}"],changeDetection:0})}return o})()},7573(O,w,l){l.d(w,{E:()=>h});const h={qcy:"https://dev.qaecy.com/ont#","qcy-e":"https://dev.qaecy.com/enum#","qcy-f":"https://dev.qaecy.com/functions#",obc:"https://w3id.org/obc#",dicc:"https://w3id.org/digitalconstruction/0.5/Contexts#",dicv:"https://w3id.org/digitalconstruction/0.5/Variables#",dice:"https://w3id.org/digitalconstruction/0.5/Entities#",dicp:"https://w3id.org/digitalconstruction/0.5/Processes#",dica:"https://w3id.org/digitalconstruction/0.5/Agents#",dici:"https://w3id.org/digitalconstruction/0.5/Information#",dicbm:"https://w3id.org/digitalconstruction/0.5/Materials#",dicob:"https://w3id.org/digitalconstruction/0.5/Occupancy#",dicl:"https://w3id.org/digitalconstruction/0.5/Lifecycle#",dices:"https://w3id.org/digitalconstruction/0.5/Energy#",dicu:"https://w3id.org/digitalconstruction/0.5/Units#",diclvl:"https://w3id.org/digitalconstruction/0.5/Levels#",dicstg:"https://w3id.org/digitalconstruction/0.5/Stages#"}}}]);
package/137.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[137],{5137(F,B,a){a.d(B,{BlockProjectDocuments:()=>L});var v=a(467),f=a(7705),r=a(5802),u=a(2271),y=a(6114),_=a(7993),C=a(3615),D=a(1493),S=a(9352),P=a(2245),z=a(5381),t=a(5547);const R=i=>({percent:i}),T=i=>({count:i});function O(i,d){if(1&i){const e=t.RV6();t.j41(0,"cue-block-documents-by-suffix",11),t.bIt("navigated",function(c){r.eBV(e);const s=t.XpG();return r.Njj(s.handleNavigated(c))}),t.k0s()}if(2&i){t.XpG();const e=t.r8f(2),n=t.r8f(4);t.Y8G("data",e)("config",n)}}function N(i,d){if(1&i){const e=t.RV6();t.j41(0,"cue-block-documents-by-content-category",11),t.bIt("navigated",function(c){r.eBV(e);const s=t.XpG();return r.Njj(s.handleNavigated(c))}),t.k0s()}if(2&i){t.XpG();const e=t.r8f(3),n=t.r8f(4);t.Y8G("data",e)("config",n)}}function E(i,d){if(1&i&&(t.nrm(0,"cue-typography",7),t.nI1(1,"transloco")),2&i){const e=t.XpG();t.Y8G("innerHTML",t.i5U(1,1,"components.contentBlocks.projectDocuments.pctOpenFormats",t.eq3(4,R,e.openFormatPct())),t.npT)}}function A(i,d){if(1&i){const e=t.RV6();t.j41(0,"cue-typography",12),t.nI1(1,"transloco"),t.bIt("click",function(){r.eBV(e);const c=t.XpG();return r.Njj(c.getDuplicates())}),t.k0s()}2&i&&t.Y8G("innerHTML",t.i5U(1,1,1===d?"components.contentBlocks.projectDocuments.duplicateFilesSingular":"components.contentBlocks.projectDocuments.duplicateFilesPlural",t.eq3(4,T,d)),t.npT)}function G(i,d){if(1&i&&(t.j41(0,"cue-typography",10),t.EFF(1),t.k0s()),2&i){const e=t.XpG();t.R7$(),t.SpI("\u2696\ufe0f ",e.humanSize()," ")}}function $(i,d){if(1&i&&(t.j41(0,"cue-typography",10),t.EFF(1),t.k0s()),2&i){const e=t.XpG();t.R7$(),t.E5c("",e.filterKey(),": ",e.humanSizeFiltered()," (",e.countFiltered(),")")}}let L=(()=>{class i{data=(0,f.hFB)(void 0);_data=(0,r.vPA)(void 0);constructor(){let e=null;(0,r.QZP)(()=>{const n=this.data();null!==e&&clearTimeout(e),(0,u.O8)(()=>this._data.set(n)),e=setTimeout(()=>{e=null,(0,u.O8)(()=>this._data.set(this.data()))},100)})}config=f.hFB.required();handlers=(0,u.EW)(()=>this.config().handlers);filterKey=(0,r.vPA)("");bySuffix=(0,u.EW)(()=>{const e=this._data();if(e?.documentsBySuffix&&0!==Object.keys(e.documentsBySuffix).length)return{documents:e.documentsBySuffix}});byContentCategory=(0,u.EW)(()=>{const e=this._data();if(e?.documentsByContentCategory&&0!==Object.keys(e.documentsByContentCategory).length)return{documents:e.documentsByContentCategory}});duplicateCount=(0,u.EW)(()=>this._data()?.duplicateCount??0);size=(0,u.EW)(()=>{const e=this._data();if(!e)return 0;const n=Object.values(e.documentsBySuffix||{}).reduce((s,o)=>s+(o?.size||0),0),c=Object.values(e.documentsByContentCategory||{}).reduce((s,o)=>s+(o?.size||0),0);return Math.max(n,c)});documentCount=(0,u.EW)(()=>{const e=this._data();if(!e)return 0;const n=Object.values(e.documentsBySuffix||{}).reduce((s,o)=>s+(o?.count||0),0),c=Object.values(e.documentsByContentCategory||{}).reduce((s,o)=>s+(o?.count||0),0);return Math.max(n,c)});sizeFiltered=(0,r.vPA)(0);countFiltered=(0,r.vPA)(0);humanSize=(0,u.EW)(()=>(0,D.b)(this.size()));humanSizeFiltered=(0,u.EW)(()=>(0,D.b)(this.sizeFiltered()));openFormatPct=(0,u.EW)(()=>{const e=this._data();if(!e?.documentsBySuffix)return 0;let n=0,c=0;for(const[o,l]of Object.entries(e.documentsBySuffix)){if(!l)continue;const g=Number(l.count||0);n+=g;const b=o.toLowerCase().trim(),x=b.startsWith(".")?b:`.${b}`;y.V[x]?.open&&(c+=g)}return n>0?Math.round(c/n*100):null});configWithFilterResolver=(0,u.EW)(()=>{var e=this;const n=this.config();return{...n,handlers:{...n.handlers,docListFilterRequest:(c=(0,v.A)(function*(s,o){if(console.log("[ProjectDocuments] docListFilterRequest",s,o),!o||0===o.length)return;const l="contentCat"===s?(i=>{const d=i.split("#").pop()??i,e={AgreementDocument:"Agreement",ArchitecturalDesignDocument:"Architectural Design",AsBuiltDocument:"As-Built",BudgetEstimateDocument:"Budget Estimate",CertificationDocument:"Certification",ComplianceDocument:"Compliance",CorrespondenceDocument:"Correspondence",ConstructionContract:"Construction Contract",ConstructionProcessDocument:"Construction Process",ContractCondition:"Contract Condition",ContractRole:"Contract Role",ContractualDocument:"Contract",CostControlDocument:"Cost Control",DesignDocument:"Design Document",EmailAddress:"Email Address",EngineeringDesignDocument:"Engineering Design",FinancialAdministrativeDocument:"Financial/Administrative",FunctionalRequirementsDocument:"Functional Requirements",InspectionDocument:"Inspection",InsuranceBondDocument:"Insurance/Bond",InteriorDesignDocument:"Interior Design",MarketingCloseoutDocument:"Marketing Closeout",MiscDocument:"Miscellaneous",OperationManual:"Operation Manual",OperationsMaintenanceDocument:"Operations & Maintenance",OperationsManualDocument:"Operations Manual",OtherDocument:"Other",OtherContent:"Other Content",ProgressStatusReport:"Progress Status Report",QualityAssuranceDocument:"Quality Assurance",QualityControlDocument:"Quality Control",RegulatoryComplianceDocument:"Regulatory Compliance",SafetyDocument:"Safety",ScheduleDocument:"Schedule",SiteAssessmentDocument:"Site Assessment",TechnicalRequirementsDocument:"Technical Requirements",TechnicalSpecificationDocument:"Technical Specification",TenderingDocument:"Tendering Document",TermsAndConditionsDocument:"Terms & Conditions"};return void 0===e[d]&&console.log(`No pretty label for category: ${d}`),e[d]??d})(o[0]):o[0];if(e.filterKey.set(l),"suffix"===s){const m=e._data()?.documentsBySuffix;if(m){const M=o.reduce((h,p)=>h+(m[p.toLowerCase()]?.size||0),0),k=o.reduce((h,p)=>h+(m[p.toLowerCase()]?.count||0),0);e.sizeFiltered.set(M),e.countFiltered.set(k)}}else if("contentCat"===s){const m=e._data()?.documentsByContentCategory;if(m){const M=o.reduce((h,p)=>h+(m[p]?.size||0),0),k=o.reduce((h,p)=>h+(m[p]?.count||0),0);e.sizeFiltered.set(M),e.countFiltered.set(k)}}const g=n.handlers?.requestDocumentsByFilter;if(!g)return void console.warn("No requestDocumentsByFilter handler defined");const x=yield g([{type:"suffix"===s?"suffix":"content",included:o,excluded:[]}]);return{ids:x.map(m=>({id:m})),totalCount:x.length}}),function(o,l){return c.apply(this,arguments)})}};var c});handleNavigated(e){if(!e)return this.sizeFiltered.set(0),this.countFiltered.set(0),void this.filterKey.set("");this.filterKey.set(e.label);const n=this._data();if(!n)return;let c=0,s=0;if("suffix"===e.filterBy){const o=n.documentsBySuffix;e.values.forEach(l=>{const g=l.toLowerCase();c+=o[g]?.size||0,s+=o[g]?.count||0})}else if("contentCat"===e.filterBy){const o=n.documentsByContentCategory;e.values.forEach(l=>{c+=o[l]?.size||0,s+=o[l]?.count||0})}this.sizeFiltered.set(c),this.countFiltered.set(s)}handleCanvasClick(){this.sizeFiltered.set(0),this.countFiltered.set(0)}getDuplicates(){var e=this;return(0,v.A)(function*(){const n=e.handlers()?.subsequentBlockRequest;if(void 0===n)return void console.warn("No handler for subsequent block request");const c=e.handlers()?.documentDuplicatesRequest;if(!c)return void console.warn("No documentDuplicatesRequest handler defined");const s=yield c();n({id:"document-duplicates",config:e.config(),data:s,focusOnAdd:!0},"Duplicates",!0)})()}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=t.VBU({type:i,selectors:[["cue-block-project-documents"]],inputs:{data:[1,"data"],config:[1,"config"]},decls:19,vars:13,consts:[["direction","column"],[1,"container",3,"click"],["id","chart-1",1,"chart"],[3,"data","config"],["id","chart-2",1,"chart"],["direction","column","align","center",1,"stats"],[1,"stat-line"],["size","l",3,"innerHTML"],["size","l",1,"clickable",3,"innerHTML"],["direction","column","align","center",1,"sizes"],["size","l"],[3,"navigated","data","config"],["size","l",1,"clickable",3,"click","innerHTML"]],template:function(n,c){if(1&n&&(t.j41(0,"cue-flexcontainer",0)(1,"div",1),t.bIt("click",function(){return c.handleCanvasClick()}),t.SS7(2)(3)(4),t.j41(5,"div",2),t.nVh(6,O,1,2,"cue-block-documents-by-suffix",3),t.k0s(),t.j41(7,"div",4),t.nVh(8,N,1,2,"cue-block-documents-by-content-category",3),t.k0s(),t.j41(9,"cue-flexcontainer",5)(10,"div",6),t.nVh(11,E,2,6,"cue-typography",7),t.k0s(),t.j41(12,"div",6),t.nVh(13,A,2,6,"cue-typography",8),t.k0s()(),t.j41(14,"cue-flexcontainer",9)(15,"div",6),t.nVh(16,G,2,1,"cue-typography",10),t.k0s(),t.j41(17,"div",6),t.nVh(18,$,2,3,"cue-typography",10),t.k0s()()()()),2&n){let s;t.R7$(2);const o=t.bH3(c.bySuffix());t.R7$();const l=t.bH3(c.byContentCategory());t.R7$(),t.bH3(c.configWithFilterResolver()),t.R7$(),t.xc7("opacity",o?1:0),t.R7$(),t.vxM(o?6:-1),t.R7$(),t.xc7("opacity",l?1:0),t.R7$(),t.vxM(l?8:-1),t.R7$(3),t.vxM(null!==c.openFormatPct()?11:-1),t.R7$(2),t.vxM((s=c.duplicateCount())?13:-1,s),t.R7$(3),t.vxM(c.size()>0?16:-1),t.R7$(2),t.vxM(c.sizeFiltered()>0?18:-1)}},dependencies:[P.Typography,z.n,_.o,C.Y,S.Kj],styles:[".container[_ngcontent-%COMP%]{height:700px;width:100%;position:relative;overflow:hidden}.chart[_ngcontent-%COMP%]{position:absolute;width:470px;height:350px;transition:opacity .5s ease-in-out}#chart-1[_ngcontent-%COMP%]{top:20px;left:0}#chart-2[_ngcontent-%COMP%]{bottom:50px;right:0}.stats[_ngcontent-%COMP%]{position:absolute;right:230px;top:180px;transform:translate(50%);min-height:80px;justify-content:center}.sizes[_ngcontent-%COMP%]{position:absolute;left:230px;bottom:180px;transform:translate(-50%);min-height:80px;justify-content:center}.stat-line[_ngcontent-%COMP%]{height:32px;display:flex;align-items:center;justify-content:center}.clickable[_ngcontent-%COMP%]:hover{cursor:pointer;transform:scale(1.05)}"],changeDetection:0})}return i})()},1493(F,B,a){function v(f,r=!1,u=1){const y=r?1e3:1024;if(Math.abs(f)<y)return f+" B";const _=r?["kB","MB","GB","TB","PB","EB","ZB","YB"]:["KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"];let C=-1;const D=10**u;do{f/=y,++C}while(Math.round(Math.abs(f)*D)/D>=y&&C<_.length-1);return f.toFixed(u)+" "+_[C]}a.d(B,{b:()=>v})}}]);
package/153.js ADDED
@@ -0,0 +1 @@
1
+ (self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[153],{5661(L,S,a){"use strict";a.d(S,{pC:()=>B,pL:()=>X,rx:()=>V});var _=a(7705),l=a(5802),t=a(5547),M=a(7598),s=a(2245),b=a(5381),T=a(5971),h=a(3319),m=a(7089),R=a(1096),r=a(9769),i=a(6642),o=a(9352);const p=x=>[x],e=(x,O)=>({$implicit:x,index:O});function u(x,O){if(1&x){const v=t.RV6();t.j41(0,"cue-table-column-settings-modal",9),t.bIt("updateColumn",function(E){const A=l.eBV(v),N=t.XpG();return l.Njj(N.updateColumnDef(A.index,E))})("close",function(){l.eBV(v);const E=t.XpG();return l.Njj(E.handleModalClose())}),t.k0s()}if(2&x){const v=O,D=t.XpG();t.Y8G("columnDef",v.col)("columnIndex",v.index)("settings",D.settings())}}function C(x,O){1&x&&t.eu8(0)}function f(x,O){if(1&x&&t.DNE(0,C,1,0,"ng-container",13),2&x){const v=t.XpG(),D=v.$implicit,E=v.$index;t.Y8G("ngTemplateOutlet",O.templateRef)("ngTemplateOutletContext",t.l_i(2,e,D,E))}}function y(x,O){if(1&x){const v=t.RV6();t.j41(0,"cue-button",14),t.nI1(1,"transloco"),t.bIt("click",function(){l.eBV(v);const E=t.XpG(),A=E.$implicit,N=E.$index,w=t.XpG();return l.Njj(w.showColumnSettings(A,N))}),t.nrm(2,"cue-button-icon",15),t.k0s()}2&x&&t.Y8G("cueTooltip",t.bMT(1,1,"components.agGridColumnSelect.tooltipSettings"))}function G(x,O){if(1&x&&(t.j41(0,"div",8)(1,"cue-flexcontainer",10)(2,"cue-typography"),t.EFF(3),t.k0s(),t.nrm(4,"span",11),t.nVh(5,f,1,5,"ng-container"),t.nVh(6,y,3,3,"cue-button",12),t.k0s()()),2&x){let v;const D=O.$implicit,E=t.XpG();t.R7$(3),t.JRh(E.getLabel(D)),t.R7$(2),t.vxM((v=E.columnItemTpl())?5:-1,v),t.R7$(),t.vxM(E.settings().allowEditing?6:-1)}}function P(x,O){1&x&&t.eu8(0)}function I(x,O){1&x&&t.DNE(0,P,1,0,"ng-container",16),2&x&&t.Y8G("ngTemplateOutlet",O.templateRef)}function W(x,O){if(1&x&&(t.j41(0,"div",8)(1,"cue-typography"),t.EFF(2),t.k0s()()),2&x){const v=O.$implicit,D=t.XpG();t.R7$(2),t.JRh(D.getLabel(v))}}let B=(()=>{class x{templateRef=(0,l.WQX)(t.C4Q);static ngTemplateContextGuard(v,D){return!0}static \u0275fac=function(D){return new(D||x)};static \u0275dir=t.FsC({type:x,selectors:[["","cueColumnItem",""]]})}return x})(),V=(()=>{class x{templateRef=(0,l.WQX)(t.C4Q);static \u0275fac=function(D){return new(D||x)};static \u0275dir=t.FsC({type:x,selectors:[["","cueColumnListFooter",""]]})}return x})(),X=(()=>{class x{columnDefs=_.geq.required();columnDefsGross=(0,_.geq)([]);settings=(0,_.hFB)(new R.e);shown=(0,_.CGW)();columnItemTpl=(0,_.sbv)(B);columnListFooterTpl=(0,_.sbv)(V);shownColumns=(0,l.vPA)([]);hiddenColumns=(0,l.vPA)([]);displayColumnSettings=(0,l.vPA)(void 0);onNoColumnDefsGross=(0,l.QZP)(()=>{(!this.columnDefsGross()||0===this.columnDefsGross().length)&&this.columnDefsGross.set(this.columnDefs())});onColumnDefs=(0,l.QZP)(()=>{const v=this.columnDefs().map(E=>E.field),D=this.columnDefsGross().filter(E=>!v.includes(E.field));this.shownColumns.update(()=>[...this.columnDefs()]),this.hiddenColumns.update(()=>[...D])});drop(v){v.previousContainer===v.container?(0,M.HD)(v.container.data,v.previousIndex,v.currentIndex):(0,M.eg)(v.previousContainer.data,v.container.data,v.previousIndex,v.currentIndex);const D=this.shownColumns();this.columnDefs.update(()=>[...D]),this.shown.emit(D)}showColumnSettings(v,D){this.displayColumnSettings.set({col:v,index:D})}updateColumnDef(v,D){const E=this.columnDefs().map((A,N)=>N===v?{...A,...D}:A);this.columnDefs.set(E),this.shown.emit(E),this.shownColumns.set(E)}getLabel(v){return v.headerName||(0,i.x)(v.field)||"Unknown"}handleModalClose(){this.displayColumnSettings.set(void 0)}static \u0275fac=function(D){return new(D||x)};static \u0275cmp=t.VBU({type:x,selectors:[["cue-ag-grid-column-select"]],contentQueries:function(D,E,A){1&D&&t.C6U(A,E.columnItemTpl,B,5)(A,E.columnListFooterTpl,V,5),2&D&&t.NyB(2)},inputs:{columnDefs:[1,"columnDefs"],columnDefsGross:[1,"columnDefsGross"],settings:[1,"settings"]},outputs:{columnDefs:"columnDefsChange",columnDefsGross:"columnDefsGrossChange",shown:"shown"},decls:22,vars:19,consts:[["todoList","cdkDropList"],["doneList","cdkDropList"],[3,"columnDef","columnIndex","settings"],["size","xs","color","muted",2,"display","block","margin-bottom","8px"],["direction","row",2,"align-items","stretch","gap","12px"],["direction","column",1,"panel"],["size","l"],["cdkDropList","",1,"list",3,"cdkDropListDropped","cdkDropListData","cdkDropListConnectedTo"],["cdkDrag","",1,"box","draggable"],[3,"updateColumn","close","columnDef","columnIndex","settings"],["front","","justify","space-between","align","center",2,"width","100%"],[2,"display","flex","flex","1"],["variant","tertiary","size","s",3,"cueTooltip"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["variant","tertiary","size","s",3,"click","cueTooltip"],["icon","settings"],[4,"ngTemplateOutlet"]],template:function(D,E){if(1&D&&(t.nVh(0,u,1,3,"cue-table-column-settings-modal",2),t.j41(1,"cue-typography",3),t.EFF(2),t.nI1(3,"transloco"),t.k0s(),t.j41(4,"cue-flexcontainer",4)(5,"cue-flexcontainer",5)(6,"cue-typography",6),t.EFF(7),t.nI1(8,"transloco"),t.k0s(),t.j41(9,"div",7,0),t.bIt("cdkDropListDropped",function(N){return E.drop(N)}),t.Z7z(11,G,7,3,"div",8,t.Vm6),t.nVh(13,I,1,1,"ng-container"),t.k0s()(),t.j41(14,"cue-flexcontainer",5)(15,"cue-typography",6),t.EFF(16),t.nI1(17,"transloco"),t.k0s(),t.j41(18,"div",7,1),t.bIt("cdkDropListDropped",function(N){return E.drop(N)}),t.Z7z(20,W,3,1,"div",8,t.Vm6),t.k0s()()()),2&D){let A,N;const w=t.sdS(10),$=t.sdS(19);t.vxM((A=E.displayColumnSettings())?0:-1,A),t.R7$(2),t.JRh(t.bMT(3,9,"components.agGridColumnSelect.dragHint")),t.R7$(5),t.JRh(t.bMT(8,11,"components.agGridColumnSelect.titleShown"));const j=E.shownColumns();t.R7$(2),t.Y8G("cdkDropListData",j)("cdkDropListConnectedTo",t.eq3(15,p,$)),t.R7$(2),t.Dyx(j),t.R7$(2),t.vxM((N=E.columnListFooterTpl())?13:-1,N),t.R7$(3),t.JRh(t.bMT(17,13,"components.agGridColumnSelect.titleHidden"));const Y=E.hiddenColumns();t.R7$(2),t.Y8G("cdkDropListData",Y)("cdkDropListConnectedTo",t.eq3(17,p,w)),t.R7$(2),t.Dyx(Y)}},dependencies:[M.O7,M.T1,s.Typography,b.n,T.$,h.a,m.d,R.T,r.T3,o.Kj],styles:[".panel[_ngcontent-%COMP%]{width:50%;display:flex;flex-direction:column;gap:8px}.list[_ngcontent-%COMP%]{border:1px solid var(--cue-card-border-color);min-height:60px;flex:1;background:var(--cue-main-background);border-radius:var(--cue-card-border-radius);overflow:hidden;display:block}.list.cdk-drop-list-receiving[_ngcontent-%COMP%]{border-color:var(--cue-primary);border-style:dashed}.box[_ngcontent-%COMP%]{padding:calc(var(--cue-card-padding-y) * .6) var(--cue-card-padding-x);border-bottom:1px solid var(--cue-card-border-color);color:var(--cue-main-foreground);display:flex;flex-direction:row;align-items:center;justify-content:space-between;box-sizing:border-box;background:var(--cue-main-background);font-size:14px;transition:background .15s ease}.box[_ngcontent-%COMP%]:hover{background:color-mix(in srgb,var(--cue-main-foreground) 5%,var(--cue-main-background))}.draggable[_ngcontent-%COMP%]{cursor:grab}.draggable[_ngcontent-%COMP%]:active{cursor:grabbing}.cdk-drag-preview[_ngcontent-%COMP%]{box-sizing:border-box;border-radius:var(--cue-card-border-radius);border:1px solid var(--cue-card-border-color);background:var(--cue-main-background);color:var(--cue-main-foreground);padding:calc(var(--cue-card-padding-y) * .6) var(--cue-card-padding-x);font-size:14px;box-shadow:var(--cue-card-box-shadow)}.cdk-drag-placeholder[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--cue-primary) 10%,var(--cue-main-background));border-bottom:1px dashed var(--cue-primary);min-height:40px;opacity:1}.cdk-drag-animating[_ngcontent-%COMP%]{transition:transform .25s cubic-bezier(0,0,.2,1)}.box[_ngcontent-%COMP%]:last-child{border-bottom:none}.list.cdk-drop-list-dragging[_ngcontent-%COMP%] .box[_ngcontent-%COMP%]:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}"],changeDetection:0})}return x})()},1096(L,S,a){"use strict";a.d(S,{e:()=>ue,T:()=>pe});var _=a(7705),l=a(2271),t=a(9352),M=a(2245),s=a(5381),b=a(2444),T=a(9695),h=a(5745),m=a(8957),R=a(5971),r=a(3319),i=a(5764),o=a(5802),p=a(7089),e=a(5547);let u=(()=>{class c{_value=(0,o.vPA)("");_options=(0,o.vPA)([]);_disabled=(0,o.vPA)(!1);_disabledTooltip=(0,o.vPA)("");_canChange=(0,o.vPA)(void 0);_optionValues=(0,l.EW)(()=>this._options().map(n=>n.value));_labelMap=(0,l.EW)(()=>Object.fromEntries(this._options().map(n=>[n.value,n.label])));_params;agInit(n){this._apply(n)}refresh(n){return this._apply(n),!0}onValueChange(n){if(void 0===n)return;const g=String(n),d=this._canChange();d&&!d(g)||(this._value.set(g),this._params.setValue?.(g))}_apply(n){this._params=n,this._value.set(n.value??"");const g="function"==typeof n.colDef?.cellRendererParams?n.colDef.cellRendererParams(n):n.colDef?.cellRendererParams??{};this._options.set(g.options??[]),this._disabled.set(g.disabled??!1),this._disabledTooltip.set(g.disabledTooltip??""),this._canChange.set(g.canChange??void 0)}static \u0275fac=function(g){return new(g||c)};static \u0275cmp=e.VBU({type:c,selectors:[["cue-select-cell-renderer"]],decls:1,vars:7,consts:[[3,"valueChange","options","labelMap","value","underline","menuPosition","disabled","cueTooltip"]],template:function(g,d){1&g&&(e.j41(0,"cue-select",0),e.bIt("valueChange",function(_e){return d.onValueChange(_e)}),e.k0s()),2&g&&e.Y8G("options",d._optionValues())("labelMap",d._labelMap())("value",d._value())("underline",!1)("menuPosition","bottomleft")("disabled",d._disabled())("cueTooltip",d._disabled()?d._disabledTooltip():"")},dependencies:[b.l,p.d],styles:["[_nghost-%COMP%]{display:block;width:100%;overflow:visible;--cue-input-value-color: currentColor}[_nghost-%COMP%] .select-trigger{font-size:var(--ag-font-size, inherit)}"],changeDetection:0})}return c})();var C=a(7374),f=a.n(C),y=a(4955),G=a.n(y),P=a(5164),I=a.n(P);a(9785),a(2269),a(1409),a(4230),a(2494),a(9531),f().extend(G()),f().extend(I());let v=(()=>{class c{_transloco=(0,o.WQX)(t.JO);transform(n,g="dateTime"){if(!n)return"";const d=this._transloco.getActiveLang(),F=f()(n).locale(d);return"timeAgo"===g?F.fromNow():F.format("date"===g?"LL":"shortDate"===g?"L":"LLL")}static \u0275fac=function(g){return new(g||c)};static \u0275pipe=e.EJ8({name:"cueLocalDate",type:c,pure:!0})}return c})(),D=(()=>{class c{_value=(0,o.vPA)("");_format=(0,o.vPA)("dateTime");agInit(n){this._apply(n)}refresh(n){return this._apply(n),!0}_apply(n){this._value.set(n.value??""),this._format.set(n.colDef?.cellRendererParams?.dateFormat??"dateTime")}static \u0275fac=function(g){return new(g||c)};static \u0275cmp=e.VBU({type:c,selectors:[["cue-date-cell-renderer"]],decls:2,vars:4,template:function(g,d){1&g&&(e.EFF(0),e.nI1(1,"cueLocalDate")),2&g&&e.JRh(e.i5U(1,1,d._value(),d._format()))},dependencies:[v],encapsulation:2,changeDetection:0})}return c})();const E=["*"];function A(c,k){1&c&&e.SdG(0)}let N=(()=>{class c{label=_.hFB.required();expanded=(0,_.geq)(!1);size=(0,_.hFB)("m");info=(0,_.hFB)("");expandToggled=(0,_.CGW)();toggle(){this.expanded.set(!this.expanded()),this.expandToggled.emit(this.expanded())}static \u0275fac=function(g){return new(g||c)};static \u0275cmp=e.VBU({type:c,selectors:[["cue-expansion-panel"]],inputs:{label:[1,"label"],expanded:[1,"expanded"],size:[1,"size"],info:[1,"info"]},outputs:{expanded:"expandedChange",expandToggled:"expandToggled"},ngContentSelectors:E,decls:8,vars:9,consts:[["direction","column","gap","xs",2,"width","100%"],["justify","space-between","align","center",1,"expansion-header",3,"click"],[3,"size","info"],["variant","ghost",3,"size"],["icon","arrow-dropdown"]],template:function(g,d){1&g&&(e.NAR(),e.j41(0,"cue-flexcontainer",0)(1,"cue-flexcontainer",1),e.bIt("click",function(){return d.toggle()}),e.j41(2,"cue-typography",2),e.EFF(3),e.k0s(),e.j41(4,"cue-button",3)(5,"span"),e.nrm(6,"cue-button-icon",4),e.k0s()()(),e.nVh(7,A,1,0),e.k0s()),2&g&&(e.R7$(2),e.Y8G("size",d.size())("info",d.info()),e.R7$(),e.JRh(d.label()),e.R7$(),e.Y8G("size",d.size()),e.R7$(),e.AVh("rotate",!0)("rotate-180",d.expanded()),e.R7$(2),e.vxM(d.expanded()?7:-1))},dependencies:[M.Typography,s.n,R.$,r.a],styles:[".expansion-header[_ngcontent-%COMP%]{cursor:pointer}.expansion-content[_ngcontent-%COMP%]{overflow:hidden;transition:max-height .3s cubic-bezier(.4,0,.2,1)}.rotate[_ngcontent-%COMP%]{transition:transform .3s cubic-bezier(.4,0,.2,1);display:inline-block}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}"],changeDetection:0})}return c})();var w=a(6642),$=a(3183),j=a(5902),Y=a(7400);const U=["*",[["","cueDisplayContent",""]],[["","cueDataContent",""]],[["","cueBehaviorContent",""]],[["","cueExtraContent",""]]],z=["*","[cueDisplayContent]","[cueDataContent]","[cueBehaviorContent]","[cueExtraContent]"],H=(c,k)=>k.name;function K(c,k){if(1&c){const n=e.RV6();e.j41(0,"cue-input",7),e.nI1(1,"transloco"),e.bIt("valueChange",function(d){o.eBV(n);const F=e.XpG(2);return o.Njj(F.setLabel(d))}),e.k0s()}if(2&c){const n=e.XpG(2);e.Y8G("label",e.bMT(1,2,"components.agGridColumnSelect.labelLabel"))("value",n.label())}}function J(c,k){if(1&c){const n=e.RV6();e.j41(0,"cue-button",11),e.bIt("click",function(){const d=o.eBV(n).$implicit,F=e.XpG(3);return o.Njj(F.setTextAlign(d))}),e.nrm(1,"cue-button-icon",12),e.k0s()}if(2&c){const n=k.$implicit,g=e.XpG(3);e.Y8G("selected",g.textAlign()===n),e.R7$(),e.Y8G("icon",g.ALIGN_ICON[n])}}function Q(c,k){if(1&c&&(e.j41(0,"cue-typography",8),e.EFF(1),e.nI1(2,"transloco"),e.k0s(),e.j41(3,"cue-flexcontainer",9),e.Z7z(4,J,2,2,"cue-button",10,e.Vm6),e.k0s()),2&c){const n=e.XpG(2);e.R7$(),e.SpI(" ",e.bMT(2,1,"components.agGridColumnSelect.labelTextAlign")," "),e.R7$(3),e.Dyx(n.alignOptions)}}function Z(c,k){if(1&c){const n=e.RV6();e.j41(0,"cue-flexcontainer",6)(1,"cue-typography",13),e.nI1(2,"transloco"),e.EFF(3),e.nI1(4,"transloco"),e.k0s(),e.j41(5,"cue-input-switch",14),e.bIt("checkedChange",function(d){o.eBV(n);const F=e.XpG(2);return o.Njj(F.setMultiline(d))}),e.k0s()()}if(2&c){const n=e.XpG(2);e.R7$(),e.Y8G("cueTooltip",e.bMT(2,3,"components.agGridColumnSelect.tooltipMultiline")),e.R7$(2),e.JRh(e.bMT(4,5,"components.agGridColumnSelect.labelMultiline")),e.R7$(2),e.Y8G("checked",n.multiline())}}function q(c,k){if(1&c&&(e.j41(0,"cue-expansion-panel",2),e.nI1(1,"transloco"),e.j41(2,"cue-flexcontainer",4),e.nVh(3,K,2,4,"cue-input",5),e.nVh(4,Q,6,3),e.nVh(5,Z,6,7,"cue-flexcontainer",6),e.SdG(6,1),e.k0s()()),2&c){const n=e.XpG();e.Y8G("label",e.bMT(1,5,"components.agGridColumnSelect.groupDisplay"))("expanded",!0),e.R7$(3),e.vxM(n.settings().allowSettingLabel?3:-1),e.R7$(),e.vxM(n.settings().allowSettingTextAlign?4:-1),e.R7$(),e.vxM(n.settings().allowSettingMultiline?5:-1)}}function ee(c,k){if(1&c){const n=e.RV6();e.j41(0,"cue-select",16),e.nI1(1,"transloco"),e.bIt("valueChange",function(d){o.eBV(n);const F=e.XpG(2);return o.Njj(F.setFilterType(d))}),e.k0s()}if(2&c){const n=e.XpG(2);e.Y8G("label",e.bMT(1,4,"components.agGridColumnSelect.labelFilterType"))("value",n.filterType())("options",n.filterTypeOptions)("labelMap",n.filterTypeLabelMap())}}function te(c,k){if(1&c){const n=e.RV6();e.j41(0,"cue-input",7),e.nI1(1,"transloco"),e.bIt("valueChange",function(d){o.eBV(n);const F=e.XpG(2);return o.Njj(F.setEnumValues(d))}),e.k0s()}if(2&c){const n=e.XpG(2);e.Y8G("label",e.bMT(1,2,"components.agGridColumnSelect.labelEnumValues"))("value",n.enumValuesText())}}function ne(c,k){if(1&c){const n=e.RV6();e.j41(0,"cue-select",16),e.bIt("valueChange",function(d){o.eBV(n);const F=e.XpG(3);return o.Njj(F.setDateFormat(d))}),e.k0s()}if(2&c){const n=e.XpG(3);e.Y8G("label",n._labelDateFormat())("value",n.dateFormat())("options",n.dateFormatOptions)("labelMap",n.dateFormatLabelMap())}}function oe(c,k){if(1&c){const n=e.RV6();e.j41(0,"cue-select",16),e.bIt("valueChange",function(d){o.eBV(n);const F=e.XpG(2);return o.Njj(F.setDataType(d))}),e.k0s(),e.nVh(1,ne,1,4,"cue-select",15)}if(2&c){const n=e.XpG(2);e.Y8G("label",n._labelDataType())("value",n.dataType())("options",n.dataTypeOptions)("labelMap",n.dataTypeLabelMap()),e.R7$(),e.vxM("date"===n.dataType()?1:-1)}}function ae(c,k){if(1&c&&(e.j41(0,"cue-expansion-panel",3),e.nI1(1,"transloco"),e.j41(2,"cue-flexcontainer",4),e.nVh(3,ee,2,6,"cue-select",15),e.nVh(4,te,2,4,"cue-input",5),e.nVh(5,oe,2,5),e.SdG(6,2),e.k0s()()),2&c){const n=e.XpG();e.Y8G("label",e.bMT(1,4,"components.agGridColumnSelect.groupData")),e.R7$(3),e.vxM(n.settings().allowSettingFilterType?3:-1),e.R7$(),e.vxM(n.settings().allowSettingEnumValues?4:-1),e.R7$(),e.vxM(n.settings().allowSettingDataType?5:-1)}}function ie(c,k){if(1&c){const n=e.RV6();e.j41(0,"cue-expansion-panel",3),e.nI1(1,"transloco"),e.j41(2,"cue-flexcontainer",4)(3,"cue-flexcontainer",6)(4,"cue-typography",13),e.nI1(5,"transloco"),e.EFF(6),e.nI1(7,"transloco"),e.k0s(),e.j41(8,"cue-input-switch",14),e.bIt("checkedChange",function(d){o.eBV(n);const F=e.XpG();return o.Njj(F.setEditable(d))}),e.k0s()(),e.SdG(9,3),e.k0s()()}if(2&c){const n=e.XpG();e.Y8G("label",e.bMT(1,4,"components.agGridColumnSelect.groupBehavior")),e.R7$(4),e.Y8G("cueTooltip",e.bMT(5,6,"components.agGridColumnSelect.tooltipAllowEditing")),e.R7$(2),e.JRh(e.bMT(7,8,"components.agGridColumnSelect.labelEditable")),e.R7$(2),e.Y8G("checked",n.editable())}}function le(c,k){if(1&c&&(e.j41(0,"cue-expansion-panel",2)(1,"cue-flexcontainer",4),e.SdG(2,4),e.k0s()()),2&c){const n=e.XpG();e.Y8G("label",n.extraPanelLabel())("expanded",n.extraPanelExpanded())}}function re(c,k){if(1&c&&(e.j41(0,"cue-typography",19),e.EFF(1),e.nI1(2,"transloco"),e.j41(3,"strong"),e.EFF(4),e.k0s()()),2&c){const n=e.XpG(2);e.R7$(),e.SpI(" ",e.bMT(2,2,"components.agGridColumnSelect.labelPostProcessPreview"),": "),e.R7$(3),e.JRh(n.postProcessFormulaPreview())}}function se(c,k){if(1&c&&(e.j41(0,"cue-flexcontainer",21)(1,"cue-typography",22),e.EFF(2),e.k0s(),e.j41(3,"cue-typography",23),e.EFF(4),e.k0s()()),2&c){const n=k.$implicit;e.R7$(2),e.JRh(n.signature),e.R7$(2),e.JRh(n.description)}}function ce(c,k){if(1&c){const n=e.RV6();e.j41(0,"cue-expansion-panel",3),e.nI1(1,"transloco"),e.j41(2,"cue-flexcontainer",17)(3,"cue-input",18),e.nI1(4,"transloco"),e.nI1(5,"transloco"),e.nI1(6,"transloco"),e.bIt("valueChange",function(d){o.eBV(n);const F=e.XpG();return o.Njj(F.setPostProcessFormula(d))}),e.k0s(),e.nVh(7,re,5,4,"cue-typography",19),e.j41(8,"cue-expansion-panel",20),e.nI1(9,"transloco"),e.j41(10,"cue-flexcontainer",17),e.Z7z(11,se,5,2,"cue-flexcontainer",21,H),e.k0s()()()()}if(2&c){const n=e.XpG();e.Y8G("label",e.bMT(1,9,"components.agGridColumnSelect.groupPostProcess")),e.R7$(3),e.Y8G("label",e.bMT(4,11,"components.agGridColumnSelect.labelPostProcessFormula"))("info",e.bMT(5,13,"components.agGridColumnSelect.tooltipPostProcessFormula"))("placeholder",e.bMT(6,15,"components.agGridColumnSelect.placeholderPostProcessFormula"))("value",n.postProcessFormula())("error",n.postProcessFormulaError()??void 0),e.R7$(4),e.vxM(n.postProcessFormulaPreview()?7:-1),e.R7$(),e.Y8G("label",e.bMT(9,17,"components.agGridColumnSelect.labelPostProcessFunctions"))("expanded",!1),e.R7$(3),e.Dyx(n.formulaFunctions)}}class ue{allowEditing=!0;allowToggleEditable=!0;allowToggleHideOnHover=!0;allowSettingTextAlign=!0;allowSettingLabel=!0;allowSettingFilterType=!0;allowSettingMultiline=!0;allowSettingEnumValues=!0;allowSettingDataType=!1;allowSettingPostProcess=!0}const de={Text:j.U,Number:"agNumberColumnFilter",Date:"agDateColumnFilter",Select:$.A,None:!1,Auto:!0},me={agTextColumnFilter:"Text",agNumberColumnFilter:"Number",agDateColumnFilter:"Date",false:"None",true:"Auto"};let pe=(()=>{class c{columnDef=_.geq.required();columnIndex=(0,_.hFB)();updateColumn=(0,_.CGW)();close=(0,_.CGW)();settings=_.hFB.required();extraPanelLabel=(0,_.hFB)();extraPanelExpanded=(0,_.hFB)(!0);minWidth=(0,_.hFB)("600px");alignOptions=["left","center","right"];filterTypeOptions=["Text","Number","Date","Select","None","Auto"];dateFormatOptions=["dateTime","date","shortDate","timeAgo"];dataTypeOptions=["text","number","date","boolean"];_labelDataType=(0,t.Xx)("components.agGridColumnSelect.labelDataType");_labelDateFormat=(0,t.Xx)("components.agGridColumnSelect.labelDateFormat");_dtText=(0,t.Xx)("components.agGridColumnSelect.dataTypeText");_dtNumber=(0,t.Xx)("components.agGridColumnSelect.dataTypeNumber");_dtDate=(0,t.Xx)("components.agGridColumnSelect.dataTypeDate");_dtBoolean=(0,t.Xx)("components.agGridColumnSelect.dataTypeBoolean");_dfDateTime=(0,t.Xx)("components.agGridColumnSelect.dateFormatDateTime");_dfDate=(0,t.Xx)("components.agGridColumnSelect.dateFormatDate");_dfShortDate=(0,t.Xx)("components.agGridColumnSelect.dateFormatShortDate");_dfTimeAgo=(0,t.Xx)("components.agGridColumnSelect.dateFormatTimeAgo");dataTypeLabelMap=(0,l.EW)(()=>({text:this._dtText(),number:this._dtNumber(),date:this._dtDate(),boolean:this._dtBoolean()}));dateFormatLabelMap=(0,l.EW)(()=>({dateTime:this._dfDateTime(),date:this._dfDate(),shortDate:this._dfShortDate(),timeAgo:this._dfTimeAgo()}));_labelText=(0,t.Xx)("components.agGridColumnSelect.filterTypeText");_labelNumber=(0,t.Xx)("components.agGridColumnSelect.filterTypeNumber");_labelDate=(0,t.Xx)("components.agGridColumnSelect.filterTypeDate");_labelSelect=(0,t.Xx)("components.agGridColumnSelect.filterTypeSelect");_labelNone=(0,t.Xx)("components.agGridColumnSelect.filterTypeNone");_labelAuto=(0,t.Xx)("components.agGridColumnSelect.filterTypeAuto");filterTypeLabelMap=(0,l.EW)(()=>({Text:this._labelText(),Number:this._labelNumber(),Date:this._labelDate(),Select:this._labelSelect(),None:this._labelNone(),Auto:this._labelAuto()}));ALIGN_ICON={center:"text-align-center",left:"text-align-left",right:"text-align-right"};dataType=(0,l.EW)(()=>{const n=this.columnDef().cellRenderer;return n===D||"DateCellRenderer"===n?"date":"text"});dateFormat=(0,l.EW)(()=>{const n=this.columnDef().cellRenderer;return n===D||"DateCellRenderer"===n?this.columnDef().cellRendererParams?.dateFormat??"dateTime":"dateTime"});editable=(0,l.EW)(()=>!0===this.columnDef().editable);multiline=(0,l.EW)(()=>{const n=this.columnDef().cellRenderer;return n===i.l||"MultilineCellRenderer"===n});_ALIGN_TO_FLEX={left:"flex-start",right:"flex-end",center:"center"};_FLEX_TO_ALIGN={"flex-start":"left","flex-end":"right",center:"center",left:"left",right:"right"};textAlign=(0,l.uu)(()=>{const n=this.columnDef().cellStyle;return n?.textAlign||this._FLEX_TO_ALIGN[n?.justifyContent]||"left"});filterType=(0,l.EW)(()=>{const n=this.columnDef().filter;return n===$.A?"Select":n===j.U?"Text":me[n]||"Auto"});enumValuesText=(0,l.EW)(()=>(this.columnDef().cellRendererParams?.options??[]).map(g=>g.value).join(", "));label=(0,l.EW)(()=>this.columnDef().headerName||(0,w.x)(this.columnDef().field)||"Unknown");setEditable(n){const g=this.columnDef().cellRendererParams;this.updateColumn.emit(g?.options?.length?{editable:n,cellRendererParams:{...g,disabled:!n}}:{editable:n})}setMultiline(n){this.updateColumn.emit({cellRenderer:n?i.l:void 0,cellRendererParams:{lineHeight:"1.8"},autoHeight:!0})}setLabel(n){this.updateColumn.emit({headerName:n})}setTextAlign(n){const g=this.columnDef().cellStyle||{};this.updateColumn.emit({cellStyle:{...g,display:"flex",justifyContent:this._ALIGN_TO_FLEX[n]??n,textAlign:n},headerClass:`header-align-${n}`}),this.textAlign.set(n)}setFilterType(n){this.updateColumn.emit({filter:de[n]??!0})}setEnumValues(n){const g=n.split(",").map(d=>d.trim()).filter(d=>d.length>0);if(0===g.length)this.updateColumn.emit({cellRenderer:void 0,cellRendererParams:void 0});else{const d=g.map(F=>({value:F,label:F}));this.updateColumn.emit({cellRenderer:u,cellRendererParams:{options:d,disabled:!this.editable()}})}}setDateFormat(n){n&&this.updateColumn.emit({cellRenderer:D,cellRendererParams:{dateFormat:n}})}setDataType(n){this.updateColumn.emit("date"===n?{cellRenderer:D,cellRendererParams:{dateFormat:"dateTime"}}:{cellRenderer:void 0,cellRendererParams:void 0})}formulaFunctions=Y.Zv;postProcessFormula=(0,l.EW)(()=>(0,Y.PH)(this.columnDef().postProcess));postProcessFormulaError=(0,l.EW)(()=>(0,Y.NF)(this.postProcessFormula()));postProcessFormulaPreview=(0,l.EW)(()=>{const n=this.postProcessFormula();return!n||this.postProcessFormulaError()?"":(0,Y.w9)(n,"42")});setPostProcessFormula(n){const g=n.trim();this.updateColumn.emit({postProcess:g?{type:"formula",expression:g}:void 0})}static \u0275fac=function(g){return new(g||c)};static \u0275cmp=e.VBU({type:c,selectors:[["cue-table-column-settings-modal"]],inputs:{columnDef:[1,"columnDef"],columnIndex:[1,"columnIndex"],settings:[1,"settings"],extraPanelLabel:[1,"extraPanelLabel"],extraPanelExpanded:[1,"extraPanelExpanded"],minWidth:[1,"minWidth"]},outputs:{columnDef:"columnDefChange",updateColumn:"updateColumn",close:"close"},ngContentSelectors:z,decls:9,vars:9,consts:[[3,"close","label","minWidth"],["direction","column","gap","s",2,"overflow-y","auto","max-height","70vh","min-height","0","width","100%"],[3,"label","expanded"],[3,"label"],["direction","column"],[3,"label","value"],["direction","row","gap","l","justify","space-between","align","center"],[3,"valueChange","label","value"],["size","s"],["direction","row"],["variant","tertiary","size","s",3,"selected"],["variant","tertiary","size","s",3,"click","selected"],[3,"icon"],["size","m",3,"cueTooltip"],["size","m",3,"checkedChange","checked"],[3,"label","value","options","labelMap"],[3,"valueChange","label","value","options","labelMap"],["direction","column","gap","xs"],[3,"valueChange","label","info","placeholder","value","error"],["size","xs",2,"opacity","0.65"],["size","s",3,"label","expanded"],["direction","row","gap","s","align","start"],["size","xs",2,"font-family","monospace","min-width","210px","flex-shrink","0"],["size","xs",2,"opacity","0.7"]],template:function(g,d){1&g&&(e.NAR(U),e.j41(0,"cue-modal",0),e.nI1(1,"transloco"),e.bIt("close",function(){return d.close.emit()}),e.j41(2,"cue-flexcontainer",1),e.nVh(3,q,7,7,"cue-expansion-panel",2),e.nVh(4,ae,7,6,"cue-expansion-panel",3),e.nVh(5,ie,10,10,"cue-expansion-panel",3),e.nVh(6,le,3,2,"cue-expansion-panel",2),e.nVh(7,ce,13,19,"cue-expansion-panel",3),e.SdG(8),e.k0s()()),2&g&&(e.Y8G("label",e.bMT(1,7,"components.agGridColumnSelect.titleColumnSettings"))("minWidth",d.minWidth()),e.R7$(3),e.vxM(d.settings().allowSettingLabel||d.settings().allowSettingTextAlign||d.settings().allowSettingMultiline?3:-1),e.R7$(),e.vxM(d.settings().allowSettingFilterType||d.settings().allowSettingEnumValues||d.settings().allowSettingDataType?4:-1),e.R7$(),e.vxM(d.settings().allowToggleEditable?5:-1),e.R7$(),e.vxM(d.extraPanelLabel()?6:-1),e.R7$(),e.vxM(d.settings().allowSettingPostProcess?7:-1))},dependencies:[h.a,s.n,M.Typography,b.l,T.d,p.d,m.p,R.$,r.a,N,t.Kj],encapsulation:2,changeDetection:0})}return c})()},6642(L,S,a){"use strict";function _(l){if(l)return l.replace(/([A-Z])/g," $1").replace(/^./,t=>t.toUpperCase())}a.d(S,{x:()=>_})},3183(L,S,a){"use strict";a.d(S,{A:()=>o});var _=a(7705),l=a(5802),t=a(9417),M=a(1359),s=a(8957),b=a(2245),T=a(5381),h=a(5547);const m=(p,e)=>e.value;function R(p,e){if(1&p){const u=h.RV6();h.j41(0,"cue-input",6),h.bIt("valueChange",function(f){l.eBV(u);const y=h.XpG();return y.searchText=f,l.Njj(y.onSearchChange())}),h.k0s()}if(2&p){const u=h.XpG();h.Y8G("value",u.searchText)}}function r(p,e){if(1&p){const u=h.RV6();h.j41(0,"cue-checkbox",7),h.bIt("checkedChange",function(f){const y=l.eBV(u).$implicit,G=h.XpG();return y.selected=f,l.Njj(G.onSelectionChange())}),h.k0s()}if(2&p){const u=e.$implicit;h.Y8G("label",u.value||"(blank)")("checked",u.selected)}}function i(p,e){1&p&&(h.j41(0,"cue-typography",5),h.EFF(1,"No results"),h.k0s())}let o=(()=>{class p{_cdr=(0,l.WQX)(_.gRc);_params;options=[];filteredOptions=[];searchText="";agInit(u){this._params=u}afterGuiAttached(u){this._refreshOptions(),this._cdr.markForCheck()}onNewRowsLoaded(){this._refreshOptions(),this._cdr.markForCheck()}isFilterActive(){return this.options.some(u=>!u.selected)}doesFilterPass(u){const C=new Set(this.options.filter(P=>P.selected).map(P=>P.value)),f=this._params.getValue(u.node),y=null==f?"":String(f);return"..."===y||"Loading..."===y||(""===y?C.has(""):y.split(", ").map(P=>P.trim()).some(P=>C.has(P)))}getModel(){return this.isFilterActive()?{selectedValues:this.options.filter(u=>u.selected).map(u=>u.value)}:null}setModel(u){if(u){const C=new Set(u.selectedValues);this.options.forEach(f=>f.selected=C.has(f.value))}else this.options.forEach(C=>C.selected=!0);this._applySearch(),this._cdr.markForCheck()}onSelectionChange(){this._params.filterChangedCallback(),this._cdr.markForCheck()}onSearchChange(){this._applySearch(),this._cdr.markForCheck()}get allSelected(){return this.options.length>0&&this.options.every(u=>u.selected)}toggleAll(u){this.options.forEach(C=>C.selected=u),this._applySearch(),this._params.filterChangedCallback(),this._cdr.markForCheck()}_refreshOptions(){const u=new Set;this._params.api.forEachNode(f=>{const y=this._params.getValue(f);if(null==y||""===y)u.add("");else{const G=String(y);if("..."===G||"Loading..."===G)return;const P=G.split(", ").map(I=>I.trim());for(const I of P)u.add(I)}});const C=new Map(this.options.map(f=>[f.value,f.selected]));this.options=Array.from(u).sort((f,y)=>f.localeCompare(y)).map(f=>({value:f,selected:C.get(f)??!0})),this._applySearch()}_applySearch(){const u=this.searchText.toLowerCase().trim();this.filteredOptions=u?this.options.filter(C=>C.value.toLowerCase().includes(u)):this.options}static \u0275fac=function(C){return new(C||p)};static \u0275cmp=h.VBU({type:p,selectors:[["cue-multi-select-filter"]],decls:7,vars:3,consts:[["direction","column","gap","s"],["placeholder","Search...","size","s",3,"value"],["size","s","label","Select all",3,"checkedChange","checked"],[1,"msf-list"],["size","s",3,"label","checked"],["size","s"],["placeholder","Search...","size","s",3,"valueChange","value"],["size","s",3,"checkedChange","label","checked"]],template:function(C,f){1&C&&(h.j41(0,"cue-flexcontainer",0),h.nVh(1,R,1,1,"cue-input",1),h.j41(2,"cue-checkbox",2),h.bIt("checkedChange",function(G){return f.toggleAll(G)}),h.k0s(),h.j41(3,"div",3),h.Z7z(4,r,1,2,"cue-checkbox",4,m),h.nVh(6,i,2,0,"cue-typography",5),h.k0s()()),2&C&&(h.R7$(),h.vxM(f.options.length>10?1:-1),h.R7$(),h.Y8G("checked",f.allSelected),h.R7$(2),h.Dyx(f.filteredOptions),h.R7$(2),h.vxM(0===f.filteredOptions.length?6:-1))},dependencies:[t.YN,M.S,s.p,b.Typography,T.n],styles:["[_nghost-%COMP%]{display:block;padding:var(--cue-card-padding-y) var(--cue-card-padding-x);min-width:200px;max-width:300px;box-sizing:border-box}.msf-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2px;max-height:200px;overflow-y:auto}"],changeDetection:0})}return p})()},5902(L,S,a){"use strict";a.d(S,{U:()=>i});var _=a(7705),l=a(5802),t=a(2271),M=a(9352),s=a(8957),b=a(2444),T=a(2245),h=a(5381),m=a(5547);function R(o,p){if(1&o){const e=m.RV6();m.j41(0,"cue-input",4),m.bIt("valueChange",function(C){l.eBV(e);const f=m.XpG();return l.Njj(f.onValueChange(C))}),m.k0s()}if(2&o){const e=m.XpG();m.Y8G("value",e.filterText)}}function r(o,p){if(1&o){const e=m.RV6();m.j41(0,"cue-typography",5),m.bIt("click",function(){l.eBV(e);const C=m.XpG();return l.Njj(C.clear())}),m.EFF(1,"Clear"),m.k0s()}}let i=(()=>{class o{_cdr=(0,l.WQX)(_.gRc);_params;filterText="";filterType="contains";filterTypeOptions=["contains","notContains","equals","notEqual","startsWith","endsWith","blank","notBlank"];_labelContains=(0,M.Xx)("components.agGridColumnSelect.textFilterContains");_labelNotContains=(0,M.Xx)("components.agGridColumnSelect.textFilterNotContains");_labelEquals=(0,M.Xx)("components.agGridColumnSelect.textFilterEquals");_labelNotEqual=(0,M.Xx)("components.agGridColumnSelect.textFilterNotEqual");_labelStartsWith=(0,M.Xx)("components.agGridColumnSelect.textFilterStartsWith");_labelEndsWith=(0,M.Xx)("components.agGridColumnSelect.textFilterEndsWith");_labelBlank=(0,M.Xx)("components.agGridColumnSelect.textFilterBlank");_labelNotBlank=(0,M.Xx)("components.agGridColumnSelect.textFilterNotBlank");filterTypeLabelMap=(0,t.EW)(()=>({contains:this._labelContains(),notContains:this._labelNotContains(),equals:this._labelEquals(),notEqual:this._labelNotEqual(),startsWith:this._labelStartsWith(),endsWith:this._labelEndsWith(),blank:this._labelBlank(),notBlank:this._labelNotBlank()}));showTextInput=(0,t.EW)(()=>!["blank","notBlank"].includes(this.filterType));agInit(e){this._params=e}afterGuiAttached(e){this._cdr.markForCheck()}isFilterActive(){return!!["blank","notBlank"].includes(this.filterType)||this.filterText.trim().length>0}doesFilterPass(e){const u=this._params.getValue(e.node),C=null==u?"":String(u),f=this.filterText.toLowerCase().trim(),y=C.toLowerCase();switch(this.filterType){case"contains":default:return y.includes(f);case"notContains":return!y.includes(f);case"equals":return y===f;case"notEqual":return y!==f;case"startsWith":return y.startsWith(f);case"endsWith":return y.endsWith(f);case"blank":return""===C;case"notBlank":return""!==C}}getModel(){return this.isFilterActive()?{filterType:"text",type:this.filterType,filter:this.filterText}:null}setModel(e){this.filterText=e?.filter??"",this.filterType=e?.type??"contains",this._cdr.markForCheck()}onValueChange(e){this.filterText=e,this._params.filterChangedCallback(),this._cdr.markForCheck()}onFilterTypeChange(e){this.filterType=String(e||"contains"),["blank","notBlank"].includes(this.filterType)&&(this.filterText=""),this._params.filterChangedCallback(),this._cdr.markForCheck()}clear(){this.filterText="",this.filterType="contains",this._params.filterChangedCallback(),this._cdr.markForCheck()}static \u0275fac=function(u){return new(u||o)};static \u0275cmp=m.VBU({type:o,selectors:[["cue-text-filter"]],decls:4,vars:5,consts:[["direction","column","gap","s"],["size","s",3,"valueChange","value","options","labelMap"],["placeholder","Filter...","size","s",3,"value"],["size","s",2,"cursor","pointer","text-align","right"],["placeholder","Filter...","size","s",3,"valueChange","value"],["size","s",2,"cursor","pointer","text-align","right",3,"click"]],template:function(u,C){1&u&&(m.j41(0,"cue-flexcontainer",0)(1,"cue-select",1),m.bIt("valueChange",function(y){return C.onFilterTypeChange(y)}),m.k0s(),m.nVh(2,R,1,1,"cue-input",2),m.nVh(3,r,2,0,"cue-typography",3),m.k0s()),2&u&&(m.R7$(),m.Y8G("value",C.filterType)("options",C.filterTypeOptions)("labelMap",C.filterTypeLabelMap()),m.R7$(),m.vxM(C.showTextInput()?2:-1),m.R7$(),m.vxM(C.filterText||"contains"!==C.filterType?3:-1))},dependencies:[s.p,b.l,T.Typography,h.n],styles:["[_nghost-%COMP%]{display:block;padding:var(--cue-card-padding-y) var(--cue-card-padding-x);min-width:180px;max-width:280px;box-sizing:border-box}"],changeDetection:0})}return o})()},5764(L,S,a){"use strict";a.d(S,{l:()=>l});var _=a(5547);let l=(()=>{class t{value="";lineHeight="1.5";agInit(s){this.value=s.value||"",this.lineHeight=s.colDef&&s.colDef.cellRendererParams&&s.colDef.cellRendererParams.lineHeight||s.context&&s.context.lineHeight||"1.5"}refresh(s){return this.value=s.value||"",!0}static \u0275fac=function(b){return new(b||t)};static \u0275cmp=_.VBU({type:t,selectors:[["cue-multiline-cell-renderer"]],decls:2,vars:3,consts:[[1,"multiline-cell"]],template:function(b,T){1&b&&(_.rj2(0,"div",0),_.EFF(1),_.eux()),2&b&&(_.xc7("line-height",T.lineHeight),_.R7$(),_.JRh(T.value))},styles:[".multiline-cell[_ngcontent-%COMP%]{white-space:pre-wrap;word-wrap:break-word;padding:4px 2px;text-align:left}"]})}return t})()},7717(L,S,a){"use strict";a.d(S,{R:()=>t});var _=a(7705),l=a(5547);let t=(()=>{class M{cueFlip=(0,_.geq)(!1);get flipped(){return this.cueFlip()}static \u0275fac=function(T){return new(T||M)};static \u0275dir=l.FsC({type:M,selectors:[["","cueFlip",""]],hostVars:2,hostBindings:function(T,h){2&T&&l.AVh("flipped",h.flipped)},inputs:{cueFlip:[1,"cueFlip"]},outputs:{cueFlip:"cueFlipChange"}})}return M})()},7400(L,S,a){"use strict";function l(r){return r&&"none"!==r.type?"round"===r.type?`ROUND(?val, ${r.decimals})`:"prefix"===r.type?`PREFIX(?val, "${r.value.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`:"suffix"===r.type?`SUFFIX(?val, "${r.value.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`:"formula"===r.type?r.expression:"":""}function t(r,i){if(!i||"none"===i.type)return r;if("round"===i.type){const o=Number(r);return isNaN(o)?r:o.toFixed(i.decimals)}return"prefix"===i.type?r&&`${i.value}${r}`:"suffix"===i.type?r&&`${r}${i.value}`:"formula"===i.type?s(i.expression,r):r}a.d(S,{NF:()=>b,PH:()=>l,Zv:()=>M,g4:()=>t,w9:()=>s});const M=[{name:"ROUND",signature:"ROUND(?val, decimals)",description:"Round to N decimal places"},{name:"FLOOR",signature:"FLOOR(?val)",description:"Round down to nearest integer"},{name:"CEIL",signature:"CEIL(?val)",description:"Round up to nearest integer"},{name:"ABS",signature:"ABS(?val)",description:"Absolute value"},{name:"SQRT",signature:"SQRT(?val)",description:"Square root"},{name:"MIN",signature:"MIN(a, b)",description:"Smaller of two numbers"},{name:"MAX",signature:"MAX(a, b)",description:"Larger of two numbers"},{name:"CONCAT",signature:"CONCAT(a, b, ...)",description:"Concatenate strings"},{name:"PREFIX",signature:'PREFIX(?val, "text")',description:"Prepend text (skipped if value is empty)"},{name:"SUFFIX",signature:'SUFFIX(?val, "text")',description:"Append text (skipped if value is empty)"},{name:"TRIM",signature:"TRIM(?val)",description:"Remove leading/trailing whitespace"},{name:"UPPER",signature:"UPPER(?val)",description:"Convert to uppercase"},{name:"LOWER",signature:"LOWER(?val)",description:"Convert to lowercase"},{name:"LEN",signature:"LEN(?val)",description:"String length"},{name:"REPLACE",signature:'REPLACE(?val, "a", "b")',description:'Replace all occurrences of "a" with "b"'},{name:"NUM",signature:"NUM(?val)",description:"Parse as number"},{name:"STR",signature:"STR(?val)",description:"Convert to string"},{name:"IF",signature:"IF(condition, then, else)",description:"Conditional expression"},{name:"AFTER_LAST",signature:'AFTER_LAST(?val, "sep")',description:"Substring after the last occurrence of sep"},{name:"AFTER_FIRST",signature:'AFTER_FIRST(?val, "sep")',description:"Substring after the first occurrence of sep"},{name:"BEFORE_LAST",signature:'BEFORE_LAST(?val, "sep")',description:"Substring before the last occurrence of sep"},{name:"BEFORE_FIRST",signature:'BEFORE_FIRST(?val, "sep")',description:"Substring before the first occurrence of sep"},{name:"SEGMENT",signature:'SEGMENT(?val, "sep", n)',description:"Get the Nth segment (0-based) when splitting ?val by sep"}];function s(r,i){if(!r||!r.trim())return i;try{const o=T(r),p=new h(o,{"?val":i}).parse();return null==p?"":String(p)}catch{return i}}function b(r){if(!r||!r.trim())return null;try{const i=T(r);return new h(i,{"?val":"42"}).parse(),null}catch(i){return i?.message??"Invalid formula"}}function T(r){const i=[];let o=0;for(;o<r.length;){if(/\s/.test(r[o])){o++;continue}if('"'===r[o]||"'"===r[o]){const e=r[o++];let u="";for(;o<r.length&&r[o]!==e;)u+="\\"===r[o]?r[++o]:r[o],o++;if(r[o]!==e)throw new Error("Unterminated string literal");o++,i.push({kind:"str",val:u});continue}const p=r.slice(o).match(/^(\d+\.?\d*|\.\d+)([eE][+-]?\d+)?/);if(p)i.push({kind:"num",val:p[0]}),o+=p[0].length;else{if("?"===r[o]){let e="?";for(o++;o<r.length&&/\w/.test(r[o]);)e+=r[o++];i.push({kind:"var",val:e});continue}if(/[A-Za-z_]/.test(r[o])){let e="";for(;o<r.length&&/\w/.test(r[o]);)e+=r[o++];i.push({kind:"ident",val:e.toUpperCase()});continue}if("**"!==r.slice(o,o+2)){if(!"+-*/%(),".includes(r[o]))throw new Error(`Unexpected character "${r[o]}" at position ${o}`);i.push({kind:"op",val:r[o++]})}else i.push({kind:"op",val:"**"}),o+=2}}return i.push({kind:"eof",val:""}),i}class h{tokens;vars;pos=0;constructor(i,o){this.tokens=i,this.vars=o}parse(){const i=this.expr();if("eof"!==this.tokens[this.pos].kind)throw new Error(`Unexpected token "${this.tokens[this.pos].val}" after expression`);return i}peek(){return this.tokens[this.pos]}next(){return this.tokens[this.pos++]}eat(i){if(this.peek().val!==i)throw new Error(`Expected "${i}", got "${this.peek().val||"end of input"}"`);this.pos++}expr(){return this.additive()}additive(){let i=this.multiplicative();for(;"op"===this.peek().kind&&("+"===this.peek().val||"-"===this.peek().val);){const o=this.next().val,p=this.multiplicative();i="+"===o?"string"==typeof i||"string"==typeof p?String(i)+String(p):i+p:m(i)-m(p)}return i}multiplicative(){let i=this.power();for(;"op"===this.peek().kind&&("*"===this.peek().val||"/"===this.peek().val||"%"===this.peek().val);){const o=this.next().val,p=this.power();if("*"===o)i=m(i)*m(p);else if("/"===o){const e=m(p);i=0!==e?m(i)/e:0}else i=m(i)%m(p)}return i}power(){const i=this.unary();return"op"===this.peek().kind&&"**"===this.peek().val?(this.next(),Math.pow(m(i),m(this.power()))):i}unary(){return"op"===this.peek().kind&&"-"===this.peek().val?(this.next(),-m(this.primary())):this.primary()}primary(){const i=this.peek();if("num"===i.kind)return this.next(),Number(i.val);if("str"===i.kind)return this.next(),i.val;if("var"===i.kind)return this.next(),this.vars[i.val]??"";if("ident"===i.kind)return this.funcCall();if("op"===i.kind&&"("===i.val){this.next();const o=this.expr();return this.eat(")"),o}throw new Error(`Unexpected token: "${i.val}"`)}funcCall(){const i=this.next().val;this.eat("(");const o=[];if(")"!==this.peek().val)for(o.push(this.expr());","===this.peek().val;)this.next(),o.push(this.expr());return this.eat(")"),function R(r,i){const o=p=>i[p]??"";switch(r){case"ROUND":return Number(m(o(0)).toFixed(Math.max(0,m(o(1)))));case"FLOOR":return Math.floor(m(o(0)));case"CEIL":return Math.ceil(m(o(0)));case"ABS":return Math.abs(m(o(0)));case"SQRT":return Math.sqrt(m(o(0)));case"MIN":return Math.min(...i.map(m));case"MAX":return Math.max(...i.map(m));case"CONCAT":return i.map(p=>String(p)).join("");case"TRIM":return String(o(0)).trim();case"UPPER":return String(o(0)).toUpperCase();case"LOWER":return String(o(0)).toLowerCase();case"LEN":return String(o(0)).length;case"REPLACE":return String(o(0)).replaceAll(String(o(1)),String(o(2)));case"NUM":return m(o(0));case"STR":return String(o(0));case"PREFIX":return String(o(0))?String(o(1))+String(o(0)):String(o(0));case"SUFFIX":return String(o(0))?String(o(0))+String(o(1)):String(o(0));case"IF":return 0!==m(o(0))&&""!==o(0)&&"false"!==o(0)?o(1):o(2);case"AFTER_LAST":{const p=String(o(0)),e=String(o(1)),u=p.lastIndexOf(e);return-1===u?p:p.slice(u+e.length)}case"AFTER_FIRST":{const p=String(o(0)),e=String(o(1)),u=p.indexOf(e);return-1===u?p:p.slice(u+e.length)}case"BEFORE_LAST":{const p=String(o(0)),e=String(o(1)),u=p.lastIndexOf(e);return-1===u?p:p.slice(0,u)}case"BEFORE_FIRST":{const p=String(o(0)),e=String(o(1)),u=p.indexOf(e);return-1===u?p:p.slice(0,u)}case"SEGMENT":return String(o(0)).split(String(o(1)))[m(o(2))]??"";default:throw new Error(`Unknown function: "${r}"`)}}(i,o)}}function m(r){if("number"==typeof r)return r;const i=Number(r);return isNaN(i)?0:i}},2269(L,S,a){L.exports=function(_){"use strict";var t=function l(s){return s&&"object"==typeof s&&"default"in s?s:{default:s}}(_),M={name:"da",weekdays:"s\xf8ndag_mandag_tirsdag_onsdag_torsdag_fredag_l\xf8rdag".split("_"),weekdaysShort:"s\xf8n._man._tirs._ons._tors._fre._l\xf8r.".split("_"),weekdaysMin:"s\xf8._ma._ti._on._to._fr._l\xf8.".split("_"),months:"januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december".split("_"),monthsShort:"jan._feb._mar._apr._maj_juni_juli_aug._sept._okt._nov._dec.".split("_"),weekStart:1,yearStart:4,ordinal:function(s){return s+"."},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd [d.] D. MMMM YYYY [kl.] HH:mm"},relativeTime:{future:"om %s",past:"%s siden",s:"f\xe5 sekunder",m:"et minut",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dage",M:"en m\xe5ned",MM:"%d m\xe5neder",y:"et \xe5r",yy:"%d \xe5r"}};return t.default.locale(M,null,!0),M}(a(7374))},1409(L,S,a){L.exports=function(_){"use strict";var t=function l(T){return T&&"object"==typeof T&&"default"in T?T:{default:T}}(_),M={s:"ein paar Sekunden",m:["eine Minute","einer Minute"],mm:"%d Minuten",h:["eine Stunde","einer Stunde"],hh:"%d Stunden",d:["ein Tag","einem Tag"],dd:["%d Tage","%d Tagen"],M:["ein Monat","einem Monat"],MM:["%d Monate","%d Monaten"],y:["ein Jahr","einem Jahr"],yy:["%d Jahre","%d Jahren"]};function s(T,h,m){var R=M[m];return Array.isArray(R)&&(R=R[h?0:1]),R.replace("%d",T)}var b={name:"de",weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),months:"Januar_Februar_M\xe4rz_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._M\xe4rz_Apr._Mai_Juni_Juli_Aug._Sept._Okt._Nov._Dez.".split("_"),ordinal:function(T){return T+"."},weekStart:1,yearStart:4,formats:{LTS:"HH:mm:ss",LT:"HH:mm",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},relativeTime:{future:"in %s",past:"vor %s",s,m:s,mm:s,h:s,hh:s,d:s,dd:s,M:s,MM:s,y:s,yy:s}};return t.default.locale(b,null,!0),b}(a(7374))},9785(L){L.exports=function(){"use strict";return{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 a=["th","st","nd","rd"],_=S%100;return"["+S+(a[(_-20)%10]||a[_]||a[0])+"]"}}}()},2494(L,S,a){L.exports=function(_){"use strict";var t=function l(s){return s&&"object"==typeof s&&"default"in s?s:{default:s}}(_),M={name:"es",monthsShort:"ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),weekdays:"domingo_lunes_martes_mi\xe9rcoles_jueves_viernes_s\xe1bado".split("_"),weekdaysShort:"dom._lun._mar._mi\xe9._jue._vie._s\xe1b.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_s\xe1".split("_"),months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),weekStart:1,formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un d\xeda",dd:"%d d\xedas",M:"un mes",MM:"%d meses",y:"un a\xf1o",yy:"%d a\xf1os"},ordinal:function(s){return s+"\xba"}};return t.default.locale(M,null,!0),M}(a(7374))},4230(L,S,a){L.exports=function(_){"use strict";var t=function l(s){return s&&"object"==typeof s&&"default"in s?s:{default:s}}(_),M={name:"fr",weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),months:"janvier_f\xe9vrier_mars_avril_mai_juin_juillet_ao\xfbt_septembre_octobre_novembre_d\xe9cembre".split("_"),monthsShort:"janv._f\xe9vr._mars_avr._mai_juin_juil._ao\xfbt_sept._oct._nov._d\xe9c.".split("_"),weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},ordinal:function(s){return s+(1===s?"er":"")}};return t.default.locale(M,null,!0),M}(a(7374))},9531(L,S,a){L.exports=function(_){"use strict";var t=function l(s){return s&&"object"==typeof s&&"default"in s?s:{default:s}}(_),M={name:"it",weekdays:"domenica_luned\xec_marted\xec_mercoled\xec_gioved\xec_venerd\xec_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),weekStart:1,monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"tra %s",past:"%s fa",s:"qualche secondo",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},ordinal:function(s){return s+"\xba"}};return t.default.locale(M,null,!0),M}(a(7374))},4955(L){L.exports=function(){"use strict";var S={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(a,_,l){var t=_.prototype,M=t.format;l.en.formats=S,t.format=function(s){void 0===s&&(s="YYYY-MM-DDTHH:mm:ssZ");var m,b=this.$locale().formats,T=(m=void 0===b?{}:b,s.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(R,r,i){var o=i&&i.toUpperCase();return r||m[i]||S[i]||m[o].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(p,e,u){return e||u.slice(1)})}));return M.call(this,T)}}}()},5164(L){L.exports=function(){"use strict";return function(S,a,_){S=S||{};var l=a.prototype,t={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function M(b,T,h,m){return l.fromToBase(b,T,h,m)}_.en.relativeTime=t,l.fromToBase=function(b,T,h,m,R){for(var r,i,o,p=h.$locale().relativeTime||t,e=S.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],u=e.length,C=0;C<u;C+=1){var f=e[C];f.d&&(r=m?_(b).diff(h,f.d,!0):h.diff(b,f.d,!0));var y=(S.rounding||Math.round)(Math.abs(r));if(o=r>0,y<=f.r||!f.r){y<=1&&C>0&&(f=e[C-1]);var G=p[f.l];R&&(y=R(""+y)),i="string"==typeof G?G.replace("%d",y):G(y,T,f.l,o);break}}if(T)return i;var P=o?p.future:p.past;return"function"==typeof P?P(i):P.replace("%s",i)},l.to=function(b,T){return M(b,T,this,!0)},l.from=function(b,T){return M(b,T,this)};var s=function(b){return b.$u?_.utc():_()};l.toNow=function(b){return this.to(s(this),b)},l.fromNow=function(b){return this.from(s(this),b)}}}()}}]);
package/222.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[222],{222(tt,de,be){be.d(de,{A4:()=>z,xI:()=>g});var R={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function J(r){R=r}var $={exec:()=>null};function p(r,e=""){let t="string"==typeof r?r:r.source;const s={replace:(n,i)=>{let l="string"==typeof i?i:i.source;return l=l.replace(d.caret,"$1"),t=t.replace(n,l),s},getRegex:()=>new RegExp(t,e)};return s}var d={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:r=>new RegExp(`^( {0,3}${r})((?:[\t ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),hrRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}#`),htmlBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}<(?:[a-z].*>|!--)`,"i")},T=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Z=/(?:[*+-]|\d{1,9}[.)])/,K=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,V=p(K).replace(/bull/g,Z).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(),Re=p(K).replace(/bull/g,Z).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(),D=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,M=/(?!\s*\])(?:\\.|[^\[\]\\])+/,$e=p(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",M).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Te=p(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Z).getRegex(),I="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",O=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,ve=p("^ {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",O).replace("tag",I).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Y=p(D).replace("hr",T).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",I).getRegex(),G={blockquote:p(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Y).getRegex(),code:/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,def:$e,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:T,html:ve,lheading:V,list:Te,newline:/^(?:[ \t]*(?:\n|$))+/,paragraph:Y,table:$,text:/^[^\n]+/},ee=p("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",T).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",I).getRegex(),ze={...G,lheading:Re,table:ee,paragraph:p(D).replace("hr",T).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",ee).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",I).getRegex()},Ae={...G,html:p("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",O).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:$,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:p(D).replace("hr",T).replace("heading"," *#{1,6} *[^\n]").replace("lheading",V).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},te=/^( {2,}|\\)\n(?!\s*$)/,L=/[\p{P}\p{S}]/u,N=/[\s\p{P}\p{S}]/u,ne=/[^\s\p{P}\p{S}]/u,Pe=p(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,N).getRegex(),re=/(?!~)[\p{P}\p{S}]/u,se=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Ze=p(se,"u").replace(/punct/g,L).getRegex(),De=p(se,"u").replace(/punct/g,re).getRegex(),ie="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Me=p(ie,"gu").replace(/notPunctSpace/g,ne).replace(/punctSpace/g,N).replace(/punct/g,L).getRegex(),Oe=p(ie,"gu").replace(/notPunctSpace/g,/(?:[^\s\p{P}\p{S}]|~)/u).replace(/punctSpace/g,/(?!~)[\s\p{P}\p{S}]/u).replace(/punct/g,re).getRegex(),Ge=p("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ne).replace(/punctSpace/g,N).replace(/punct/g,L).getRegex(),Ne=p(/\\(punct)/,"gu").replace(/punct/g,L).getRegex(),je=p(/^<(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(),He=p(O).replace("(?:--\x3e|$)","--\x3e").getRegex(),Qe=p("^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",He).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),C=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Fe=p(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",C).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),le=p(/^!?\[(label)\]\[(ref)\]/).replace("label",C).replace("ref",M).getRegex(),ae=p(/^!?\[(ref)\](?:\[\])?/).replace("ref",M).getRegex(),j={_backpedal:$,anyPunctuation:Ne,autolink:je,blockSkip:/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,br:te,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:$,emStrongLDelim:Ze,emStrongRDelimAst:Me,emStrongRDelimUnd:Ge,escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,link:Fe,nolink:ae,punctuation:Pe,reflink:le,reflinkSearch:p("reflink|nolink(?!\\()","g").replace("reflink",le).replace("nolink",ae).getRegex(),tag:Qe,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:$},Xe={...j,link:p(/^!?\[(label)\]\((.*?)\)/).replace("label",C).getRegex(),reflink:p(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",C).getRegex()},H={...j,emStrongRDelimAst:Oe,emStrongLDelim:De,url:p(/^((?: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.!#$%&'*+\/=?_`{\|}~-]+@)))/},We={...H,br:p(te).replace("{2,}","*").getRegex(),text:p(H.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},P={normal:G,gfm:ze,pedantic:Ae},v={normal:j,gfm:H,breaks:We,pedantic:Xe},Je={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},oe=r=>Je[r];function m(r,e){if(e){if(d.escapeTest.test(r))return r.replace(d.escapeReplace,oe)}else if(d.escapeTestNoEncode.test(r))return r.replace(d.escapeReplaceNoEncode,oe);return r}function ce(r){try{r=encodeURI(r).replace(d.percentDecode,"%")}catch{return null}return r}function he(r,e){const s=r.replace(d.findPipe,(i,l,a)=>{let c=!1,o=l;for(;--o>=0&&"\\"===a[o];)c=!c;return c?"|":" |"}).split(d.splitPipe);let n=0;if(s[0].trim()||s.shift(),s.length>0&&!s.at(-1)?.trim()&&s.pop(),e)if(s.length>e)s.splice(e);else for(;s.length<e;)s.push("");for(;n<s.length;n++)s[n]=s[n].trim().replace(d.slashPipe,"|");return s}function _(r,e,t){const s=r.length;if(0===s)return"";let n=0;for(;n<s;){const i=r.charAt(s-n-1);if(i!==e||t){if(i===e||!t)break;n++}else n++}return r.slice(0,s-n)}function pe(r,e,t,s,n){const i=e.href,l=e.title||null,a=r[1].replace(n.other.outputLinkReplace,"$1");s.state.inLink=!0;const c={type:"!"===r[0].charAt(0)?"image":"link",raw:t,href:i,title:l,text:a,tokens:s.inlineTokens(a)};return s.state.inLink=!1,c}var B=class{options;rules;lexer;constructor(r){this.options=r||R}space(r){const e=this.rules.block.newline.exec(r);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(r){const e=this.rules.block.code.exec(r);if(e){const t=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?t:_(t,"\n")}}}fences(r){const e=this.rules.block.fences.exec(r);if(e){const t=e[0],s=function Ve(r,e,t){const s=r.match(t.other.indentCodeCompensation);if(null===s)return e;const n=s[1];return e.split("\n").map(i=>{const l=i.match(t.other.beginningSpace);if(null===l)return i;const[a]=l;return a.length>=n.length?i.slice(n.length):i}).join("\n")}(t,e[3]||"",this.rules);return{type:"code",raw:t,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:s}}}heading(r){const e=this.rules.block.heading.exec(r);if(e){let t=e[2].trim();if(this.rules.other.endingHash.test(t)){const s=_(t,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceChar.test(s))&&(t=s.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(r){const e=this.rules.block.hr.exec(r);if(e)return{type:"hr",raw:_(e[0],"\n")}}blockquote(r){const e=this.rules.block.blockquote.exec(r);if(e){let t=_(e[0],"\n").split("\n"),s="",n="";const i=[];for(;t.length>0;){let l=!1;const a=[];let c;for(c=0;c<t.length;c++)if(this.rules.other.blockquoteStart.test(t[c]))a.push(t[c]),l=!0;else{if(l)break;a.push(t[c])}t=t.slice(c);const o=a.join("\n"),h=o.replace(this.rules.other.blockquoteSetextReplace,"\n $1").replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}\n${o}`:o,n=n?`${n}\n${h}`:h;const k=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(h,i,!0),this.lexer.state.top=k,0===t.length)break;const u=i.at(-1);if("code"===u?.type)break;if("blockquote"===u?.type){const b=u,f=b.raw+"\n"+t.join("\n"),x=this.blockquote(f);i[i.length-1]=x,s=s.substring(0,s.length-b.raw.length)+x.raw,n=n.substring(0,n.length-b.text.length)+x.text;break}if("list"===u?.type){const b=u,f=b.raw+"\n"+t.join("\n"),x=this.list(f);i[i.length-1]=x,s=s.substring(0,s.length-u.raw.length)+x.raw,n=n.substring(0,n.length-b.raw.length)+x.raw,t=f.substring(i.at(-1).raw.length).split("\n");continue}}return{type:"blockquote",raw:s,tokens:i,text:n}}}list(r){let e=this.rules.block.list.exec(r);if(e){let t=e[1].trim();const s=t.length>1,n={type:"list",raw:"",ordered:s,start:s?+t.slice(0,-1):"",loose:!1,items:[]};t=s?`\\d{1,9}\\${t.slice(-1)}`:`\\${t}`,this.options.pedantic&&(t=s?t:"[*+-]");const i=this.rules.other.listItemRegex(t);let l=!1;for(;r;){let c=!1,o="",h="";if(!(e=i.exec(r))||this.rules.block.hr.test(r))break;o=e[0],r=r.substring(o.length);let k=e[2].split("\n",1)[0].replace(this.rules.other.listReplaceTabs,F=>" ".repeat(3*F.length)),u=r.split("\n",1)[0],b=!k.trim(),f=0;if(this.options.pedantic?(f=2,h=k.trimStart()):b?f=e[1].length+1:(f=e[2].search(this.rules.other.nonSpaceChar),f=f>4?1:f,h=k.slice(f),f+=e[1].length),b&&this.rules.other.blankLine.test(u)&&(o+=u+"\n",r=r.substring(u.length+1),c=!0),!c){const F=this.rules.other.nextBulletRegex(f),ge=this.rules.other.hrRegex(f),fe=this.rules.other.fencesBeginRegex(f),ke=this.rules.other.headingBeginRegex(f),et=this.rules.other.htmlBeginRegex(f);for(;r;){const U=r.split("\n",1)[0];let A;if(u=U,this.options.pedantic?(u=u.replace(this.rules.other.listReplaceNesting," "),A=u):A=u.replace(this.rules.other.tabCharGlobal," "),fe.test(u)||ke.test(u)||et.test(u)||F.test(u)||ge.test(u))break;if(A.search(this.rules.other.nonSpaceChar)>=f||!u.trim())h+="\n"+A.slice(f);else{if(b||k.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||fe.test(k)||ke.test(k)||ge.test(k))break;h+="\n"+u}!b&&!u.trim()&&(b=!0),o+=U+"\n",r=r.substring(U.length+1),k=A.slice(f)}}n.loose||(l?n.loose=!0:this.rules.other.doubleBlankLine.test(o)&&(l=!0));let ue,x=null;this.options.gfm&&(x=this.rules.other.listIsTask.exec(h),x&&(ue="[ ] "!==x[0],h=h.replace(this.rules.other.listReplaceTask,""))),n.items.push({type:"list_item",raw:o,task:!!x,checked:ue,loose:!1,text:h,tokens:[]}),n.raw+=o}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 c=0;c<n.items.length;c++)if(this.lexer.state.top=!1,n.items[c].tokens=this.lexer.blockTokens(n.items[c].text,[]),!n.loose){const o=n.items[c].tokens.filter(k=>"space"===k.type),h=o.length>0&&o.some(k=>this.rules.other.anyLine.test(k.raw));n.loose=h}if(n.loose)for(let c=0;c<n.items.length;c++)n.items[c].loose=!0;return n}}html(r){const e=this.rules.block.html.exec(r);if(e)return{type:"html",block:!0,raw:e[0],pre:"pre"===e[1]||"script"===e[1]||"style"===e[1],text:e[0]}}def(r){const e=this.rules.block.def.exec(r);if(e){const t=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),s=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",n=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:t,raw:e[0],href:s,title:n}}}table(r){const e=this.rules.block.table.exec(r);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;const t=he(e[1]),s=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),n=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split("\n"):[],i={type:"table",raw:e[0],header:[],align:[],rows:[]};if(t.length===s.length){for(const l of s)this.rules.other.tableAlignRight.test(l)?i.align.push("right"):this.rules.other.tableAlignCenter.test(l)?i.align.push("center"):this.rules.other.tableAlignLeft.test(l)?i.align.push("left"):i.align.push(null);for(let l=0;l<t.length;l++)i.header.push({text:t[l],tokens:this.lexer.inline(t[l]),header:!0,align:i.align[l]});for(const l of n)i.rows.push(he(l,i.header.length).map((a,c)=>({text:a,tokens:this.lexer.inline(a),header:!1,align:i.align[c]})));return i}}lheading(r){const e=this.rules.block.lheading.exec(r);if(e)return{type:"heading",raw:e[0],depth:"="===e[2].charAt(0)?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(r){const e=this.rules.block.paragraph.exec(r);if(e){const t="\n"===e[1].charAt(e[1].length-1)?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(r){const e=this.rules.block.text.exec(r);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(r){const e=this.rules.inline.escape.exec(r);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(r){const e=this.rules.inline.tag.exec(r);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(r){const e=this.rules.inline.link.exec(r);if(e){const t=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(t)){if(!this.rules.other.endAngleBracket.test(t))return;const i=_(t.slice(0,-1),"\\");if((t.length-i.length)%2==0)return}else{const i=function Ke(r,e){if(-1===r.indexOf(e[1]))return-1;let t=0;for(let s=0;s<r.length;s++)if("\\"===r[s])s++;else if(r[s]===e[0])t++;else if(r[s]===e[1]&&(t--,t<0))return s;return t>0?-2:-1}(e[2],"()");if(-2===i)return;if(i>-1){const a=(0===e[0].indexOf("!")?5:4)+e[1].length+i;e[2]=e[2].substring(0,i),e[0]=e[0].substring(0,a).trim(),e[3]=""}}let s=e[2],n="";if(this.options.pedantic){const i=this.rules.other.pedanticHrefTitle.exec(s);i&&(s=i[1],n=i[3])}else n=e[3]?e[3].slice(1,-1):"";return s=s.trim(),this.rules.other.startAngleBracket.test(s)&&(s=this.options.pedantic&&!this.rules.other.endAngleBracket.test(t)?s.slice(1):s.slice(1,-1)),pe(e,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:n&&n.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(r,e){let t;if((t=this.rules.inline.reflink.exec(r))||(t=this.rules.inline.nolink.exec(r))){const n=e[(t[2]||t[1]).replace(this.rules.other.multipleSpaceGlobal," ").toLowerCase()];if(!n){const i=t[0].charAt(0);return{type:"text",raw:i,text:i}}return pe(t,n,t[0],this.lexer,this.rules)}}emStrong(r,e,t=""){let s=this.rules.inline.emStrongLDelim.exec(r);if(!(!s||s[3]&&t.match(this.rules.other.unicodeAlphaNumeric))&&(!s[1]&&!s[2]||!t||this.rules.inline.punctuation.exec(t))){const i=[...s[0]].length-1;let l,a,c=i,o=0;const h="*"===s[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,e=e.slice(-1*r.length+i);null!=(s=h.exec(e));){if(l=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!l)continue;if(a=[...l].length,s[3]||s[4]){c+=a;continue}if((s[5]||s[6])&&i%3&&!((i+a)%3)){o+=a;continue}if(c-=a,c>0)continue;a=Math.min(a,a+c+o);const k=[...s[0]][0].length,u=r.slice(0,i+s.index+k+a);if(Math.min(i,a)%2){const f=u.slice(1,-1);return{type:"em",raw:u,text:f,tokens:this.lexer.inlineTokens(f)}}const b=u.slice(2,-2);return{type:"strong",raw:u,text:b,tokens:this.lexer.inlineTokens(b)}}}}codespan(r){const e=this.rules.inline.code.exec(r);if(e){let t=e[2].replace(this.rules.other.newLineCharGlobal," ");const s=this.rules.other.nonSpaceChar.test(t),n=this.rules.other.startingSpaceChar.test(t)&&this.rules.other.endingSpaceChar.test(t);return s&&n&&(t=t.substring(1,t.length-1)),{type:"codespan",raw:e[0],text:t}}}br(r){const e=this.rules.inline.br.exec(r);if(e)return{type:"br",raw:e[0]}}del(r){const e=this.rules.inline.del.exec(r);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(r){const e=this.rules.inline.autolink.exec(r);if(e){let t,s;return"@"===e[2]?(t=e[1],s="mailto:"+t):(t=e[1],s=t),{type:"link",raw:e[0],text:t,href:s,tokens:[{type:"text",raw:t,text:t}]}}}url(r){let e;if(e=this.rules.inline.url.exec(r)){let t,s;if("@"===e[2])t=e[0],s="mailto:"+t;else{let n;do{n=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??""}while(n!==e[0]);t=e[0],s="www."===e[1]?"http://"+e[0]:e[0]}return{type:"link",raw:e[0],text:t,href:s,tokens:[{type:"text",raw:t,text:t}]}}}inlineText(r){const e=this.rules.inline.text.exec(r);if(e)return{type:"text",raw:e[0],text:e[0],escaped:this.lexer.state.inRawBlock}}},w=class X{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||R,this.options.tokenizer=this.options.tokenizer||new B,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 t={other:d,block:P.normal,inline:v.normal};this.options.pedantic?(t.block=P.pedantic,t.inline=v.pedantic):this.options.gfm&&(t.block=P.gfm,t.inline=this.options.breaks?v.breaks:v.gfm),this.tokenizer.rules=t}static get rules(){return{block:P,inline:v}}static lex(e,t){return new X(t).lex(e)}static lexInline(e,t){return new X(t).inlineTokens(e)}lex(e){e=e.replace(d.carriageReturn,"\n"),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){const s=this.inlineQueue[t];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],s=!1){for(this.options.pedantic&&(e=e.replace(d.tabCharGlobal," ").replace(d.spaceLine,""));e;){let n;if(this.options.extensions?.block?.some(l=>!!(n=l.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))continue;if(n=this.tokenizer.space(e)){e=e.substring(n.raw.length);const l=t.at(-1);1===n.raw.length&&void 0!==l?l.raw+="\n":t.push(n);continue}if(n=this.tokenizer.code(e)){e=e.substring(n.raw.length);const l=t.at(-1);"paragraph"===l?.type||"text"===l?.type?(l.raw+="\n"+n.raw,l.text+="\n"+n.text,this.inlineQueue.at(-1).src=l.text):t.push(n);continue}if(n=this.tokenizer.fences(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.heading(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.hr(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.blockquote(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.list(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.html(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.def(e)){e=e.substring(n.raw.length);const l=t.at(-1);"paragraph"===l?.type||"text"===l?.type?(l.raw+="\n"+n.raw,l.text+="\n"+n.raw,this.inlineQueue.at(-1).src=l.text):this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title});continue}if(n=this.tokenizer.table(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.lheading(e)){e=e.substring(n.raw.length),t.push(n);continue}let i=e;if(this.options.extensions?.startBlock){let l=1/0;const a=e.slice(1);let c;this.options.extensions.startBlock.forEach(o=>{c=o.call({lexer:this},a),"number"==typeof c&&c>=0&&(l=Math.min(l,c))}),l<1/0&&l>=0&&(i=e.substring(0,l+1))}if(this.state.top&&(n=this.tokenizer.paragraph(i))){const l=t.at(-1);s&&"paragraph"===l?.type?(l.raw+="\n"+n.raw,l.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):t.push(n),s=i.length!==e.length,e=e.substring(n.raw.length);continue}if(n=this.tokenizer.text(e)){e=e.substring(n.raw.length);const l=t.at(-1);"text"===l?.type?(l.raw+="\n"+n.raw,l.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):t.push(n);continue}if(e){const l="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(l);break}throw new Error(l)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let s=e,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(s));)a.includes(n[0].slice(n[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,n.index)+"["+"a".repeat(n[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(n=this.tokenizer.rules.inline.anyPunctuation.exec(s));)s=s.slice(0,n.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;null!=(n=this.tokenizer.rules.inline.blockSkip.exec(s));)s=s.slice(0,n.index)+"["+"a".repeat(n[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let i=!1,l="";for(;e;){let a;if(i||(l=""),i=!1,this.options.extensions?.inline?.some(o=>!!(a=o.call({lexer:this},e,t))&&(e=e.substring(a.raw.length),t.push(a),!0)))continue;if(a=this.tokenizer.escape(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.tag(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.link(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(a.raw.length);const o=t.at(-1);"text"===a.type&&"text"===o?.type?(o.raw+=a.raw,o.text+=a.text):t.push(a);continue}if(a=this.tokenizer.emStrong(e,s,l)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.codespan(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.br(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.del(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.autolink(e)){e=e.substring(a.raw.length),t.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(e))){e=e.substring(a.raw.length),t.push(a);continue}let c=e;if(this.options.extensions?.startInline){let o=1/0;const h=e.slice(1);let k;this.options.extensions.startInline.forEach(u=>{k=u.call({lexer:this},h),"number"==typeof k&&k>=0&&(o=Math.min(o,k))}),o<1/0&&o>=0&&(c=e.substring(0,o+1))}if(a=this.tokenizer.inlineText(c)){e=e.substring(a.raw.length),"_"!==a.raw.slice(-1)&&(l=a.raw.slice(-1)),i=!0;const o=t.at(-1);"text"===o?.type?(o.raw+=a.raw,o.text+=a.text):t.push(a);continue}if(e){const o="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(o);break}throw new Error(o)}}return t}},z=class{options;parser;constructor(r){this.options=r||R}space(r){return""}code({text:r,lang:e,escaped:t}){const s=(e||"").match(d.notSpaceStart)?.[0],n=r.replace(d.endingNewline,"")+"\n";return s?'<pre><code class="language-'+m(s)+'">'+(t?n:m(n,!0))+"</code></pre>\n":"<pre><code>"+(t?n:m(n,!0))+"</code></pre>\n"}blockquote({tokens:r}){return`<blockquote>\n${this.parser.parse(r)}</blockquote>\n`}html({text:r}){return r}heading({tokens:r,depth:e}){return`<h${e}>${this.parser.parseInline(r)}</h${e}>\n`}hr(r){return"<hr>\n"}list(r){const e=r.ordered,t=r.start;let s="";for(let l=0;l<r.items.length;l++)s+=this.listitem(r.items[l]);const n=e?"ol":"ul";return"<"+n+(e&&1!==t?' start="'+t+'"':"")+">\n"+s+"</"+n+">\n"}listitem(r){let e="";if(r.task){const t=this.checkbox({checked:!!r.checked});r.loose?"paragraph"===r.tokens[0]?.type?(r.tokens[0].text=t+" "+r.tokens[0].text,r.tokens[0].tokens&&r.tokens[0].tokens.length>0&&"text"===r.tokens[0].tokens[0].type&&(r.tokens[0].tokens[0].text=t+" "+m(r.tokens[0].tokens[0].text),r.tokens[0].tokens[0].escaped=!0)):r.tokens.unshift({type:"text",raw:t+" ",text:t+" ",escaped:!0}):e+=t+" "}return e+=this.parser.parse(r.tokens,!!r.loose),`<li>${e}</li>\n`}checkbox({checked:r}){return"<input "+(r?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:r}){return`<p>${this.parser.parseInline(r)}</p>\n`}table(r){let e="",t="";for(let n=0;n<r.header.length;n++)t+=this.tablecell(r.header[n]);e+=this.tablerow({text:t});let s="";for(let n=0;n<r.rows.length;n++){const i=r.rows[n];t="";for(let l=0;l<i.length;l++)t+=this.tablecell(i[l]);s+=this.tablerow({text:t})}return s&&(s=`<tbody>${s}</tbody>`),"<table>\n<thead>\n"+e+"</thead>\n"+s+"</table>\n"}tablerow({text:r}){return`<tr>\n${r}</tr>\n`}tablecell(r){const e=this.parser.parseInline(r.tokens),t=r.header?"th":"td";return(r.align?`<${t} align="${r.align}">`:`<${t}>`)+e+`</${t}>\n`}strong({tokens:r}){return`<strong>${this.parser.parseInline(r)}</strong>`}em({tokens:r}){return`<em>${this.parser.parseInline(r)}</em>`}codespan({text:r}){return`<code>${m(r,!0)}</code>`}br(r){return"<br>"}del({tokens:r}){return`<del>${this.parser.parseInline(r)}</del>`}link({href:r,title:e,tokens:t}){const s=this.parser.parseInline(t),n=ce(r);if(null===n)return s;let i='<a href="'+(r=n)+'"';return e&&(i+=' title="'+m(e)+'"'),i+=">"+s+"</a>",i}image({href:r,title:e,text:t,tokens:s}){s&&(t=this.parser.parseInline(s,this.parser.textRenderer));const n=ce(r);if(null===n)return m(t);let i=`<img src="${r=n}" alt="${t}"`;return e&&(i+=` title="${m(e)}"`),i+=">",i}text(r){return"tokens"in r&&r.tokens?this.parser.parseInline(r.tokens):"escaped"in r&&r.escaped?r.text:m(r.text)}},Q=class{strong({text:r}){return r}em({text:r}){return r}codespan({text:r}){return r}del({text:r}){return r}html({text:r}){return r}text({text:r}){return r}link({text:r}){return""+r}image({text:r}){return""+r}br(){return""}},y=class W{options;renderer;textRenderer;constructor(e){this.options=e||R,this.options.renderer=this.options.renderer||new z,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Q}static parse(e,t){return new W(t).parse(e)}static parseInline(e,t){return new W(t).parseInline(e)}parse(e,t=!0){let s="";for(let n=0;n<e.length;n++){const i=e[n];if(this.options.extensions?.renderers?.[i.type]){const a=i,c=this.options.extensions.renderers[a.type].call({parser:this},a);if(!1!==c||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(a.type)){s+=c||"";continue}}const l=i;switch(l.type){case"space":s+=this.renderer.space(l);continue;case"hr":s+=this.renderer.hr(l);continue;case"heading":s+=this.renderer.heading(l);continue;case"code":s+=this.renderer.code(l);continue;case"table":s+=this.renderer.table(l);continue;case"blockquote":s+=this.renderer.blockquote(l);continue;case"list":s+=this.renderer.list(l);continue;case"html":s+=this.renderer.html(l);continue;case"paragraph":s+=this.renderer.paragraph(l);continue;case"text":{let a=l,c=this.renderer.text(a);for(;n+1<e.length&&"text"===e[n+1].type;)a=e[++n],c+="\n"+this.renderer.text(a);s+=t?this.renderer.paragraph({type:"paragraph",raw:c,text:c,tokens:[{type:"text",raw:c,text:c,escaped:!0}]}):c;continue}default:{const a='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return s}parseInline(e,t=this.renderer){let s="";for(let n=0;n<e.length;n++){const i=e[n];if(this.options.extensions?.renderers?.[i.type]){const a=this.options.extensions.renderers[i.type].call({parser:this},i);if(!1!==a||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){s+=a||"";continue}}const l=i;switch(l.type){case"escape":case"text":s+=t.text(l);break;case"html":s+=t.html(l);break;case"link":s+=t.link(l);break;case"image":s+=t.image(l);break;case"strong":s+=t.strong(l);break;case"em":s+=t.em(l);break;case"codespan":s+=t.codespan(l);break;case"br":s+=t.br(l);break;case"del":s+=t.del(l);break;default:{const a='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return s}},E=class{options;block;constructor(e){this.options=e||R}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?w.lex:w.lexInline}provideParser(){return this.block?y.parse:y.parseInline}},S=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=y;Renderer=z;TextRenderer=Q;Lexer=w;Tokenizer=B;Hooks=E;constructor(...r){this.use(...r)}walkTokens(r,e){let t=[];for(const s of r)switch(t=t.concat(e.call(this,s)),s.type){case"table":{const n=s;for(const i of n.header)t=t.concat(this.walkTokens(i.tokens,e));for(const i of n.rows)for(const l of i)t=t.concat(this.walkTokens(l.tokens,e));break}case"list":t=t.concat(this.walkTokens(s.items,e));break;default:{const n=s;this.defaults.extensions?.childTokens?.[n.type]?this.defaults.extensions.childTokens[n.type].forEach(i=>{const l=n[i].flat(1/0);t=t.concat(this.walkTokens(l,e))}):n.tokens&&(t=t.concat(this.walkTokens(n.tokens,e)))}}return t}use(...r){const e=this.defaults.extensions||{renderers:{},childTokens:{}};return r.forEach(t=>{const s={...t};if(s.async=this.defaults.async||s.async||!1,t.extensions&&(t.extensions.forEach(n=>{if(!n.name)throw new Error("extension name required");if("renderer"in n){const i=e.renderers[n.name];e.renderers[n.name]=i?function(...l){let a=n.renderer.apply(this,l);return!1===a&&(a=i.apply(this,l)),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 i=e[n.level];i?i.unshift(n.tokenizer):e[n.level]=[n.tokenizer],n.start&&("block"===n.level?e.startBlock?e.startBlock.push(n.start):e.startBlock=[n.start]:"inline"===n.level&&(e.startInline?e.startInline.push(n.start):e.startInline=[n.start]))}"childTokens"in n&&n.childTokens&&(e.childTokens[n.name]=n.childTokens)}),s.extensions=e),t.renderer){const n=this.defaults.renderer||new z(this.defaults);for(const i in t.renderer){if(!(i in n))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;const a=t.renderer[i],c=n[i];n[i]=(...o)=>{let h=a.apply(n,o);return!1===h&&(h=c.apply(n,o)),h||""}}s.renderer=n}if(t.tokenizer){const n=this.defaults.tokenizer||new B(this.defaults);for(const i in t.tokenizer){if(!(i in n))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;const a=t.tokenizer[i],c=n[i];n[i]=(...o)=>{let h=a.apply(n,o);return!1===h&&(h=c.apply(n,o)),h}}s.tokenizer=n}if(t.hooks){const n=this.defaults.hooks||new E;for(const i in t.hooks){if(!(i in n))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;const a=t.hooks[i],c=n[i];n[i]=E.passThroughHooks.has(i)?o=>{if(this.defaults.async)return Promise.resolve(a.call(n,o)).then(k=>c.call(n,k));const h=a.call(n,o);return c.call(n,h)}:(...o)=>{let h=a.apply(n,o);return!1===h&&(h=c.apply(n,o)),h}}s.hooks=n}if(t.walkTokens){const n=this.defaults.walkTokens,i=t.walkTokens;s.walkTokens=function(l){let a=[];return a.push(i.call(this,l)),n&&(a=a.concat(n.call(this,l))),a}}this.defaults={...this.defaults,...s}}),this}setOptions(r){return this.defaults={...this.defaults,...r},this}lexer(r,e){return w.lex(r,e??this.defaults)}parser(r,e){return y.parse(r,e??this.defaults)}parseMarkdown(r){return(t,s)=>{const n={...s},i={...this.defaults,...n},l=this.onError(!!i.silent,!!i.async);if(!0===this.defaults.async&&!1===n.async)return l(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 t>"u"||null===t)return l(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof t)return l(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));i.hooks&&(i.hooks.options=i,i.hooks.block=r);const a=i.hooks?i.hooks.provideLexer():r?w.lex:w.lexInline,c=i.hooks?i.hooks.provideParser():r?y.parse:y.parseInline;if(i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(t):t).then(o=>a(o,i)).then(o=>i.hooks?i.hooks.processAllTokens(o):o).then(o=>i.walkTokens?Promise.all(this.walkTokens(o,i.walkTokens)).then(()=>o):o).then(o=>c(o,i)).then(o=>i.hooks?i.hooks.postprocess(o):o).catch(l);try{i.hooks&&(t=i.hooks.preprocess(t));let o=a(t,i);i.hooks&&(o=i.hooks.processAllTokens(o)),i.walkTokens&&this.walkTokens(o,i.walkTokens);let h=c(o,i);return i.hooks&&(h=i.hooks.postprocess(h)),h}catch(o){return l(o)}}}onError(r,e){return t=>{if(t.message+="\nPlease report this to https://github.com/markedjs/marked.",r){const s="<p>An error occurred:</p><pre>"+m(t.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(t);throw t}}};function g(r,e){return S.parse(r,e)}g.options=g.setOptions=function(r){return S.setOptions(r),J(g.defaults=S.defaults),g},g.getDefaults=function q(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}},g.defaults=R,g.use=function(...r){return S.use(...r),J(g.defaults=S.defaults),g},g.walkTokens=function(r,e){return S.walkTokens(r,e)},g.parseInline=S.parseInline,g.Parser=y,g.parser=y.parse,g.Renderer=z,g.TextRenderer=Q,g.Lexer=w,g.lexer=w.lex,g.Tokenizer=B,g.Hooks=E,g.parse=g}}]);