@qaecy/cue-ui 0.0.66 → 0.0.68
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/1153.js +1 -1
- package/1231.js +1 -0
- package/1320.js +1 -0
- package/179.js +1 -0
- package/1837.js +1 -1
- package/198.js +1 -0
- package/2130.js +1 -1
- package/2317.js +1 -1
- package/2559.js +1 -1
- package/2775.js +1 -1
- package/29.js +1 -1
- package/3.js +1 -0
- package/3036.js +1 -1
- package/3202.js +1 -1
- package/3213.js +1 -1
- package/3614.js +1 -1
- package/3630.js +1 -0
- package/3632.js +7 -0
- package/3786.js +1 -1
- package/4098.js +1 -1
- package/4415.js +1 -1
- package/4660.js +1 -0
- package/469.js +1 -0
- package/5649.js +1 -1
- package/6233.js +1 -1
- package/6423.js +1 -1
- package/6439.js +1 -1
- package/6442.js +1 -0
- package/650.js +1 -1
- package/675.js +1 -0
- package/6751.js +1 -1
- package/6947.js +1 -1
- package/7003.js +1 -0
- package/7108.js +1 -0
- package/7154.js +1 -1
- package/7573.js +1 -0
- package/7719.js +1 -1
- package/7727.js +1 -1
- package/8629.js +1 -0
- package/8647.js +1 -0
- package/9231.js +1 -0
- package/9396.js +1 -1
- package/README.md +20 -0
- package/common.js +1 -1
- package/ifclite-pointcloud-decode.js +1 -0
- package/index.js +1 -1
- package/main.js +1 -1
- package/package.json +3 -1
- package/pdf.worker.min.mjs +21 -0
- package/runtime.js +1 -1
- package/styles.css +1 -1
- package/wasm/ifc-lite_bg.wasm +0 -0
- package/1778.js +0 -1
- package/487.js +0 -1
- package/6780.js +0 -7
- package/7598.js +0 -1
- package/9707.js +0 -1
package/6751.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[6751],{56034(X,G,y){y.d(G,{y:()=>R});var I=y(17705),b=y(67598),r=y(49769),x=y(65187),S=y(42245),k=y(35381),w=y(20029),M=y(32271),v=y(35547);const T=["*"];let H=(()=>{class D{style=(0,I.hFB)("");gap=(0,I.hFB)("m");columns=(0,I.hFB)(1);getStyles=(0,M.EW)(()=>`\n grid-template-columns: repeat(${this.columns()}, minmax(0, 1fr));\n gap: var(--cue-grid-gap-${this.gap()});\n ${this.style()}\n `);static \u0275fac=function(A){return new(A||D)};static \u0275cmp=v.VBU({type:D,selectors:[["cue-grid"]],hostVars:2,hostBindings:function(A,E){2&A&&v.Aen(E.getStyles())},inputs:{style:[1,"style"],gap:[1,"gap"],columns:[1,"columns"]},ngContentSelectors:T,decls:1,vars:0,template:function(A,E){1&A&&(v.NAR(),v.SdG(0))},styles:["[_nghost-%COMP%]{display:grid}"]})}return D})();const O=["*"];function V(D,J){if(1&D&&(v.j41(0,"cue-typography",2),v.EFF(1),v.k0s()),2&D){const B=v.XpG();v.R7$(),v.SpI(" ",B.label()," ")}}let R=(()=>{class D{label=(0,I.hFB)("");variant=(0,I.hFB)("default");shadow=(0,I.hFB)(!1);padded=(0,I.hFB)(!0);showCloseBtn=(0,I.hFB)(!0);position=(0,I.hFB)("top-left");clickedClose=(0,I.CGW)();margin=(0,I.hFB)("0.5rem");close(B){B.stopPropagation(),B.stopImmediatePropagation(),this.clickedClose.emit()}static \u0275fac=function(A){return new(A||D)};static \u0275cmp=v.VBU({type:D,selectors:[["cue-draggable-card"]],inputs:{label:[1,"label"],variant:[1,"variant"],shadow:[1,"shadow"],padded:[1,"padded"],showCloseBtn:[1,"showCloseBtn"],position:[1,"position"],margin:[1,"margin"]},outputs:{clickedClose:"clickedClose"},ngContentSelectors:O,decls:8,vars:14,consts:[["cdkDrag","",1,"panel",3,"variant","shadow","padded"],["justify","end"],["size","l"],[2,"width","100%"],["name","close",2,"cursor","pointer",3,"click"]],template:function(A,E){1&A&&(v.NAR(),v.j41(0,"cue-card",0)(1,"cue-typography")(2,"cue-grid")(3,"cue-flexcontainer",1),v.nVh(4,V,2,1,"cue-typography",2),v.nrm(5,"span",3),v.j41(6,"cue-svg-icon",4),v.bIt("click",function(te){return E.close(te)}),v.k0s()(),v.SdG(7),v.k0s()()()),2&A&&(v.xc7("top","top-left"===E.position()||"top-right"===E.position()?E.margin():"null")("bottom","bottom-left"===E.position()||"bottom-right"===E.position()?E.margin():"null")("left","top-left"===E.position()||"bottom-left"===E.position()?E.margin():"null")("right","top-right"===E.position()||"bottom-right"===E.position()?E.margin():"null"),v.Y8G("variant",E.variant())("shadow",E.shadow())("padded",E.padded()),v.R7$(3),v.xc7("padding",E.padded()?"0":"10px"),v.R7$(),v.vxM(E.label()&&"undefined"!==E.label()?4:-1))},dependencies:[r.MD,x.Card,H,S.Typography,k.FlexContainer,w.A,b.T1],styles:[".panel[_ngcontent-%COMP%]{position:absolute;width:fit-content;z-index:100}"]})}return D})()},29134(X,G,y){y.d(G,{v:()=>S});var I=y(17705),b=y(56034),r=y(57517),x=y(35547);let S=(()=>{class k{title=(0,I.hFB)("Legend");layers=(0,I.hFB)([]);position=(0,I.hFB)("top-left");close=(0,I.CGW)();visibilityChange=(0,I.CGW)();layerChange=(0,I.CGW)();visibilityAll=(0,I.CGW)();static \u0275fac=function(v){return new(v||k)};static \u0275cmp=x.VBU({type:k,selectors:[["cue-color-legend-panel"]],inputs:{title:[1,"title"],layers:[1,"layers"],position:[1,"position"]},outputs:{close:"close",visibilityChange:"visibilityChange",layerChange:"layerChange",visibilityAll:"visibilityAll"},decls:3,vars:4,consts:[[3,"clickedClose","label","padded","position"],[1,"content"],[3,"visibilityAll","layerChange","visibilityChange","layers"]],template:function(v,T){1&v&&(x.j41(0,"cue-draggable-card",0),x.bIt("clickedClose",function(){return T.close.emit()}),x.j41(1,"div",1)(2,"cue-layer-legend",2),x.bIt("visibilityAll",function(O){return T.visibilityAll.emit(O)})("layerChange",function(O){return T.layerChange.emit(O)})("visibilityChange",function(O){return T.visibilityChange.emit(O)}),x.k0s()()()),2&v&&(x.Y8G("label",T.title())("padded",!1)("position",T.position()),x.R7$(2),x.Y8G("layers",T.layers()))},dependencies:[b.y,r.P],styles:[".content[_ngcontent-%COMP%]{padding-left:10px;padding-right:10px;margin-bottom:30px;font-size:.8em;max-height:200px;max-width:180px;overflow:auto}"]})}return k})()},4487(X,G,y){y.d(G,{t:()=>ft});var I=y(10467),b=y(17705),r=y(85802),x=y(32271),S=y(49769),k=y(55745);class w{hideClassAssignmentTriples=!0;hideDatatypePropertyTriples=!0;collapseIntoClassificationLabels=[];preferredLabelLanguage="en";showClassLabelOnInstance=!0;edgeWidths={};nodeSizes={};nodeColors={}}var v=y(68402);class T{_doc;_omitClassAssignments;_omitDatatypeProperties;_preferredLabelLanguage;_collapseIntoClassificationLabels;_edgeWidths;_nodeSizes;_nodeColors;_context;_nodes=[];_edges=[];_seenNodes=[];_resourceLabels={};_resourceAltLabels={};_resolvedCollapsePredicates=new Set;_knownPrefixes={schema:"http://schema.org/"};constructor(l,e=!0,o=!0,n="en",s=[],a={},c={},d={}){this._doc=l,this._omitClassAssignments=e,this._omitDatatypeProperties=o,this._preferredLabelLanguage=n,this._collapseIntoClassificationLabels=s,this._edgeWidths=a,this._nodeSizes=c,this._nodeColors=d}get elementData(){return{nodes:this._nodes,edges:this._edges}}init(){var l=this;return(0,I.A)(function*(){return"http://schema.org/"==l._doc["@context"]&&(l._doc["@context"]="https://schema.org/"),l._context={...l._doc["@context"],...l._knownPrefixes},l._nodes=[],l._edges=[],l._seenNodes=[],l._resourceLabels={},l._resourceAltLabels={},l._resolvedCollapsePredicates=new Set(l._collapseIntoClassificationLabels.map(n=>l._expandIRI(n))),(yield(yield l._loadToRDF())(l._doc)).forEach(n=>l._processQuad(n)),l._nodes=l._appendNames(l._nodes),l._edges=l._appendNames(l._edges),{nodes:l._nodes,edges:l._edges}})()}append(l){var e=this;return(0,I.A)(function*(){return(yield(yield e._loadToRDF())(l)).forEach(s=>e._processQuad(s)),e._nodes=e._appendNames(e._nodes),e._edges=e._appendNames(e._edges),{nodes:e._nodes,edges:e._edges}})()}_loadToRDF(){return(0,I.A)(function*(){const l=yield y.e(2130).then(y.t.bind(y,32130,23));return l.toRDF??l.default.toRDF})()}_processQuad(l){const e=l.subject.value;let o=l.predicate.value,n=l.object.value;if("http://www.w3.org/2004/02/skos/core#prefLabel"===o||"http://www.w3.org/2000/01/rdf-schema#label"===o||"http://schema.org/name"===o)return void(Object.keys(this._resourceLabels).includes(e)?this._resourceLabels[e].push(l.object):this._resourceLabels[e]=[l.object]);if("http://www.w3.org/2004/02/skos/core#altLabel"===o)return void(Object.keys(this._resourceAltLabels).includes(e)?this._resourceAltLabels[e].push(l.object):this._resourceAltLabels[e]=[l.object]);if(this._appendNamedNode(e),this._resolvedCollapsePredicates.has(o)){const a=this._nodes.find(c=>c.data.id===e);return void(void 0!==a&&(void 0===a.data.boxLabels&&(a.data.boxLabels=[]),a.data.boxLabels.push(this._appendPrefix(n))))}if("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"===o&&(o="a",this._seenNodes.includes(e))){const a=this._nodes.find(c=>c.data.id===e);void 0!==a&&(void 0===a.data.boxLabels&&(a.data.boxLabels=[]),a.data.boxLabels.push(this._appendPrefix(n)))}const s=l.object.termType;if("Literal"===s){if(n=this._appendLiteralNode(n),this._seenNodes.includes(e)){const a=this._nodes.find(c=>c.data.id===e);if(void 0!==a){void 0===a.data.properties&&(a.data.properties={});const c=this._getIdFromIRI(o);a.data.properties[c]=l.object.value}}}else"BlankNode"===s?this._appendNamedNode(n,"individual"):"NamedNode"===s?this._appendNamedNode(n,"a"===o?"class":"individual"):console.warn("Unknown term type "+s);this._appendEdge(e,o,n,"Literal"===s)}_appendNames(l){return l.map(e=>{const o=e.data.iri,n=(void 0!==e.data.id?this._resourceLabels[e.data.id]:void 0)??(void 0!==o?this._resourceLabels[o]:void 0)??(void 0!==e.data.id?this._resourceAltLabels[e.data.id]:void 0)??(void 0!==o?this._resourceAltLabels[o]:void 0);if(Array.isArray(n))1===n.length?e.data.label=n[0].value:console.log("MORE THAN ONE LABEL NOT YET SUPPORTED");else{if("class"===e.classes){if(null==e.data.iri)return e;e.data.label=this._getIdFromIRI(e.data.iri)}if("edge"===e.classes){if(null==e.data.iri)return e;e.data.label=this._getIdFromIRI(e.data.iri)}}const s=e.data;if(void 0!==s.size){const a=void 0!==s.iri?this._nodeSizes[s.iri]:void 0;void 0!==a?s.size=a:""!=e.data.label&&(s.size=44);const c=void 0!==s.iri?this._nodeColors[s.iri]:void 0;void 0!==c&&(s.color=c),Array.isArray(s.boxLabels)&&(s.boxLabels=s.boxLabels.map(d=>{const h=this._expandIRI(d),u=this._resourceLabels[h]??this._resourceAltLabels[h];return Array.isArray(u)&&u.length>0?u[0].value:d}))}return e})}_appendNamedNode(l,e="individual"){if(!this._omitClassAssignments||"class"!==e)if(this._seenNodes.includes(l)){if("class"===e){const o=this._nodes.find(n=>n.data.id===l);null!=o&&(o.classes=e)}}else this._nodes.push({data:{id:l,iri:l,label:"",size:24},classes:e}),this._seenNodes.push(l)}_appendLiteralNode(l){if(this._omitDatatypeProperties)return"";""===l&&(l="-");const e=this._camelize(l);return this._seenNodes.includes(e)||(this._nodes.push({data:{id:e,label:l,size:2*l.length},classes:"literal"}),this._seenNodes.push(e)),e}_appendEdge(l,e,o,n=!1){if(this._omitClassAssignments&&"a"===e||this._omitDatatypeProperties&&n)return;const s=this._edgeWidths[e];this._edges.push({data:{id:(0,v.A)(),source:l,target:o,label:this._appendPrefix(e),iri:e,...void 0!==s?{width:s}:{}},classes:"edge"})}_expandIRI(l){if(l.startsWith("http://")||l.startsWith("https://"))return l;const e=l.indexOf(":");if(e>0){const o=l.substring(0,e),n=l.substring(e+1),s=this._context?.[o];if(s)return s+n}return l}_appendPrefix(l){const e=Object.keys(this._context),o=Object.values(this._context);for(const n in o){const s=o[n];if(l.startsWith(s)){l=l.replace(s,`${e[n]}:`);break}}return l}_camelize(l){return l.replace(/(?:^\w|[A-Z]|\b\w)/g,function(e,o){return 0===o?e.toLowerCase():e.toUpperCase()}).replace(/\s+/g,"")}_getIdFromIRI(l){return l.includes("#")?l.split("#")[1]:l.split("/").pop()??l}}class H{_doc;_settings;_elementDataHandler;_elementData;constructor(l,e=new w){this._doc=l,this._settings=e,this._elementDataHandler=new T(this._doc,this._settings.hideClassAssignmentTriples,this._settings.hideDatatypePropertyTriples,this._settings.preferredLabelLanguage,this._settings.collapseIntoClassificationLabels,this._settings.edgeWidths,this._settings.nodeSizes,this._settings.nodeColors)}set settings(l){this._settings=l,this._elementDataHandler=new T(this._doc,this._settings.hideClassAssignmentTriples,this._settings.hideDatatypePropertyTriples,this._settings.preferredLabelLanguage,this._settings.collapseIntoClassificationLabels,this._settings.edgeWidths,this._settings.nodeSizes,this._settings.nodeColors)}init(){var l=this;return(0,I.A)(function*(){return l._elementData=yield l._elementDataHandler.init(),l._elementData})()}appendElementData(l){var e=this;return(0,I.A)(function*(){return e._elementData=yield e._elementDataHandler.append(l),e._elementData})()}compact(){console.log("COMPACT")}expand(){console.log("EXPAND")}}class V{props={display:!0,displayOnlyOnHover:!0};boxLabels={display:!0,displayOnlyOnHover:!1}}function Q(i,l,e=new V){function o(){i.nodes().forEach(a=>{const c=a.renderedHeight(),d=document.getElementById(`box-${a.id()}`);if(d){if(e.boxLabels.display){const h=a.data().boxLabels;if(void 0!==h){let u=document.getElementById(`labels-box-${a.id()}`);u?u.style.bottom=c/2-10+"px":(u=document.createElement("div"),u.id=`labels-box-${a.id()}`,u.className="box-label",u.style.bottom=c/2-10+"px",e.boxLabels.displayOnlyOnHover&&(u.style.display="none"),d.appendChild(u),h.forEach((g,m)=>{if(!u)return;const p=document.createElement("div");p.id=`labels-box-${a.id()}-${m}`,p.className="entry",p.innerHTML=g,u.appendChild(p)}))}}if(e.props.display){const h=a.data().properties;if(void 0!==h){let u=document.getElementById(`props-box-${a.id()}`);u?u.style.top=c/2-10+"px":(u=document.createElement("div"),u.id=`props-box-${a.id()}`,u.style.right="0px",u.className="property",u.style.top=c/2-10+"px",e.props.displayOnlyOnHover&&(u.style.display="none"),d.appendChild(u),Object.keys(h).forEach((g,m)=>{if(!u)return;const p=document.createElement("div");p.id=`props-box-${a.id()}-${m}`,p.className="entry",p.innerHTML=`<span class="key">${g}</span><span class="value">${h[g]}</span>`,u.appendChild(p)}))}}}})}!function O(i,l){function e(){i.nodes().forEach(n=>{const s=n.renderedPosition();let a=document.getElementById(`box-${n.id()}`);a||(a=document.createElement("div"),a.id=`box-${n.id()}`,a.style.position="absolute",l.appendChild(a)),a.style.left=`${s.x}px`,a.style.top=`${s.y}px`})}e(),i.on("position","node",e),i.on("pan zoom",e),i.on("remove","node",function o(n){const s=n.target.id(),a=document.getElementById(`box-${s}`);a&&a.remove()}),window.addEventListener("resize",e)}(i,l),o(),i.on("zoom",()=>{o(),function s(){if(!e.boxLabels.display)return;const c=i.zoom()>=.6;i.nodes().forEach(d=>{const h=document.getElementById(`labels-box-${d.id()}`);h&&(e.boxLabels.displayOnlyOnHover||(h.style.display=c?"flex":"none"))})}()}),i.on("mouseover","node",a=>{const c=a.target;if(e.props.displayOnlyOnHover){const d=document.getElementById(`props-box-${c.id()}`);d&&(d.style.display="flex")}if(e.boxLabels.displayOnlyOnHover){const d=document.getElementById(`labels-box-${c.id()}`);d&&(d.style.display="flex")}}),i.on("mouseout","node",a=>{const c=a.target;if(e.props.displayOnlyOnHover){const d=document.getElementById(`props-box-${c.id()}`);d&&(d.style.display="none")}if(e.boxLabels.displayOnlyOnHover){const d=document.getElementById(`labels-box-${c.id()}`);d&&(d.style.display="none")}})}function R(i){return getComputedStyle(document.documentElement).getPropertyValue(i).trim()}const D={get backgroundColor(){return R("--cue-main-background")||"#f5f6f9"},get edgeColor(){return R("--cue-primary")||"#2859e1"},edgeFontSize:"5rem",edgeWidth:"1.5rem",get nodeColor(){return R("--cue-primary")||"#2859e1"},nodeOpacity:"0.9",font:"Poppins",directed:!0,labelSelector:"label",showNodeLabels:!0,showEdgeLabels:!0,get hoverBorderColor(){return R("--cue-primary")||"#2859e1"},get textColor(){return R("--cue-primaryContrast")||"#ffffff"}},J=(i=D)=>{const l=R("--cue-primary")||"#2859e1",e=R("--cue-primaryContrast")||"#ffffff",o=R("--cue-accent")||"#e2f552",n=R("--cue-accentContrast")||"#121c2b",s=R("--cue-neutral")||"#8394b0",a=R("--cue-main-foreground")||"#121c2b",c=i.backgroundColor;return[{selector:"node",style:{label:d=>d.data(i.labelSelector)&&i.showNodeLabels?d.data(i.labelSelector):"",shape:"round-rectangle","text-valign":"bottom","text-margin-y":10,"font-family":i.font,"font-size":"6rem",opacity:i.nodeOpacity,color:a,"text-outline-width":0,"text-outline-color":d=>d.data("color")?d.data("color"):l,"background-color":d=>d.data("color")?d.data("color"):l,width:d=>d.data("size")?d.data("size"):"24",height:d=>d.data("size")?d.data("size"):"24","background-image":d=>d.data("imgPath")?d.data("imgPath"):"none","background-fit":"cover","background-width":"100%","background-height":"100%","background-image-opacity":.2}},{selector:"edge",style:{label:"","font-family":i.font,"font-size":i.edgeFontSize,color:l,"target-arrow-color":l,"curve-style":"bezier","target-arrow-shape":i.directed?"triangle":"none","arrow-scale":.8,"line-color":l,"line-opacity":.5,width:d=>d.data("width")?d.data("width"):i.edgeWidth}},{selector:"edge.edge-hover, edge.neighbor-hover",style:{label:d=>d.data(i.labelSelector)&&i.showEdgeLabels?d.data(i.labelSelector):"","line-opacity":1,width:d=>d.data("width")?d.data("width"):i.edgeWidth,"text-valign":"center","text-rotation":"autorotate","text-background-opacity":1,"text-background-color":c,"text-background-padding":4,"font-size":i.edgeFontSize,"font-weight":"600"}},{selector:".triple",style:{"background-color":c,"border-color":d=>d.data("color")?d.data("color"):l}},{selector:".literal",style:{label:d=>d.data(i.labelSelector)?d.data(i.labelSelector):"","text-valign":"center","font-size":"6rem","border-color":a,"background-color":c,"text-outline-width":0,"border-width":0,"background-opacity":0,color:a}},{selector:".loading",style:{shape:"ellipse","pie-size":"100%","pie-1-background-color":l,"pie-1-background-size":d=>`${d.data("pct")}%`,"pie-2-background-color":o,"pie-2-background-size":d=>100-parseInt(d.data("pct"))+"%",label:d=>void 0!==d.data("pct")&&100!==d.data("pct")?`${parseInt(d.data("pct"))}%`:"","font-size":"5rem","border-width":1,"border-opacity":1,"border-color":e}},{selector:".dropzone",style:{"border-color":l,"border-width":6,"border-opacity":1}},{selector:".collapser",style:{"background-color":s,"text-outline-color":s,"text-outline-width":0,"text-valign":"center",color:e,"border-width":0,"border-opacity":0,opacity:1}},{selector:".collapser-expanded",style:{opacity:.65}},{selector:".class",style:{"background-color":o,"text-outline-color":o,color:n}},{selector:".faded",style:{opacity:.12}},{selector:"node.focused",style:{"outline-color":d=>d.data("color")||l,"outline-width":"2px","outline-offset":"3px","outline-opacity":.5,"outline-style":"solid"}},{selector:"node.selected",style:{"outline-color":o,"outline-width":"3px","outline-offset":"2px","outline-opacity":1,"outline-style":"solid"}},{selector:"edge.selected",style:{"line-color":o,"target-arrow-color":o,"line-opacity":1,width:d=>d.data("width")?Number(d.data("width"))+1.5:3}}]};let A;class he{_requestId;_animationRunning=!1;constructor(l,e=!0,o=1e-4,n=.02){this._build(l,e,o,n)}stop(){void 0!==this._requestId&&(cancelAnimationFrame(this._requestId),this._requestId=void 0,this._animationRunning=!1)}_build(l,e=!0,o=1e-4,n=.02){const s=()=>{this._animationRunning&&(l.nodes().forEach((a,c)=>{const d=a.position(),h=Math.sin(performance.now()*o+c)*n,u=Math.cos(performance.now()*o+c)*n;a.position({x:d.x+h,y:d.y+u})}),this._requestId=requestAnimationFrame(s))};this._animationRunning=!0,this._requestId=requestAnimationFrame(s),e&&l.on("mouseover","node",()=>{this.stop()})}}var ge=y(25970),t=y(35547);const _e=["graphContainer"],fe=(i,l)=>l.key,ne=(i,l)=>l.id;function me(i,l){if(1&i&&(t.j41(0,"div",5)(1,"span",6),t.EFF(2),t.k0s(),t.j41(3,"span",7),t.EFF(4),t.k0s()()),2&i){const e=l.$implicit;t.R7$(2),t.JRh(e.key),t.R7$(2),t.JRh(e.value)}}function be(i,l){if(1&i&&(t.j41(0,"div",4),t.Z7z(1,me,5,2,"div",5,fe),t.k0s()),2&i){const e=l;t.xc7("left",e.x,"px")("top",e.y,"px"),t.R7$(),t.Dyx(e.entries)}}function ye(i,l){if(1&i){const e=t.RV6();t.j41(0,"button",10),t.bIt("mousedown",function(n){return n.stopPropagation()})("click",function(){const n=r.eBV(e).$implicit,s=t.XpG(2);return r.Njj(s._onContextMenuAction(n.id))}),t.EFF(1),t.k0s()}if(2&i){const e=l.$implicit;t.R7$(),t.SpI(" ",e.label," ")}}function Ce(i,l){if(1&i&&(t.j41(0,"div",8),t.Z7z(1,ye,2,1,"button",9,ne),t.k0s()),2&i){const e=t.XpG();t.xc7("left",e.contextMenuPos().x,"px")("top",e.contextMenuPos().y,"px"),t.R7$(),t.Dyx(e.contextMenuItems())}}function ve(i,l){if(1&i){const e=t.RV6();t.j41(0,"button",10),t.bIt("mousedown",function(n){return n.stopPropagation()})("click",function(){const n=r.eBV(e).$implicit,s=t.XpG(2);return r.Njj(s._onEdgeContextMenuAction(n.id))}),t.EFF(1),t.k0s()}if(2&i){const e=l.$implicit;t.R7$(),t.SpI(" ",e.label," ")}}function xe(i,l){if(1&i&&(t.j41(0,"div",8),t.Z7z(1,ve,2,1,"button",9,ne),t.k0s()),2&i){const e=t.XpG();t.xc7("left",e.edgeContextMenuPos().x,"px")("top",e.edgeContextMenuPos().y,"px"),t.R7$(),t.Dyx(e.edgeContextMenuItems())}}let q=(()=>{class i{elements=b.hFB.required();animate=(0,b.hFB)(!1);stopAnimationAfterFirstNodeHover=(0,b.hFB)(!0);layout=(0,b.hFB)("cose-bilkent");highlightNeighborsOnHover=(0,b.hFB)(!0);userZoomingEnabled=(0,b.hFB)(!0);userPanningEnabled=(0,b.hFB)(!0);appendHTMLLabels=(0,b.hFB)(!0);directed=(0,b.hFB)(!0);labelPropsSettings=(0,b.hFB)(new V);contextMenuItems=(0,b.hFB)([]);edgeContextMenuItems=(0,b.hFB)([]);selectableNodes=(0,b.hFB)(!1);selectableEdges=(0,b.hFB)(!1);selectedNodeIds=(0,b.geq)([]);selectedEdgeIds=(0,b.geq)([]);nodeHover=(0,b.CGW)();nodeClick=(0,b.CGW)();canvasClick=(0,b.CGW)();contextMenuAction=(0,b.CGW)();edgeContextMenuAction=(0,b.CGW)();_cy=(0,r.vPA)(void 0);_container=(0,r.vPA)(void 0);_animate;_positionCache=new Map;hoverNodeOverlay=(0,r.vPA)(null);contextMenuVisible=(0,r.vPA)(!1);contextMenuPos=(0,r.vPA)({x:0,y:0});_contextMenuNode=null;edgeContextMenuVisible=(0,r.vPA)(!1);edgeContextMenuPos=(0,r.vPA)({x:0,y:0});_edgeContextMenuLabel="";_edgeContextMenuEdge={source:"",target:""};graphContainer;static _edgeKey(e,o){return`${e}|${o}`}_styledElements=(0,x.EW)(()=>{const e=this.elements(),o=new Set(this.selectedNodeIds()),n=new Set(this.selectedEdgeIds());return 0===o.size&&0===n.size?e:{nodes:e.nodes.map(s=>o.has(s.data.id)?{...s,classes:`${s.classes??""} selected`.trim()}:s),edges:e.edges.map(s=>n.has(i._edgeKey(s.data.source,s.data.target))?{...s,classes:`${s.classes??""} selected`.trim()}:s)}});_cyLib=(0,r.vPA)(void 0);handleElements=(0,r.QZP)(()=>{const e=this._styledElements();if(void 0===this._container())return;const o=this._cyLib();if(void 0===o)return;const n=this._cy();n?this._patch(n,e):this._build(o),this._setupClickHoverEvents()});handleAnimate=(0,r.QZP)(()=>{const e=this._cy();void 0!==e&&(this.animate()?this._setAnimation(e):this._stopAnimation())});handleHTMLLabels=(0,r.QZP)(()=>{const e=this._cy(),o=this._container();if(void 0===e||void 0===o)return;const n=this.labelPropsSettings(),s=new V;s.boxLabels={...n.boxLabels},s.props={display:!1,displayOnlyOnHover:n.props.displayOnlyOnHover},Q(e,o,s)});_bodyObserver;_resizeDebounce;_startBodyObserver(){this._bodyObserver=new MutationObserver(()=>{this._reapplyStyles()}),this._bodyObserver.observe(document.body,{attributes:!0,attributeFilter:["class"]})}_reapplyStyles(){const e=this._cy(),o=this._container();if(!e||!o)return;const n=this._resolveParentBg(o),s={...D,directed:this.directed(),backgroundColor:n};e.style(J(s)).update()}_resolveParentBg(e){let o=e.parentElement;for(;o;){const n=window.getComputedStyle(o).backgroundColor;if(n&&"rgba(0, 0, 0, 0)"!==n&&"transparent"!==n)return n;o=o.parentElement}return"#ffffff"}ngAfterViewInit(){const e=this.graphContainer.nativeElement;void 0!==e&&this._container.update(()=>e),function K(){return A??=Promise.all([y.e(9516).then(y.bind(y,89516)),y.e(6894).then(y.t.bind(y,36894,23))]).then(([{default:i},{default:l}])=>{try{i.use(l)}catch{}return i}),A}().then(o=>this._cyLib.set(o))}ngOnDestroy(){this._bodyObserver?.disconnect(),clearTimeout(this._resizeDebounce),this._cy()?.destroy()}onResize(){const e=this._cy();e&&(e.resize(),clearTimeout(this._resizeDebounce),this._resizeDebounce=setTimeout(()=>{e.resize(),this._nodesHavePosition()||e.fit(void 0,60),e.center()},250))}_setAnimation(e){this._stopAnimation(),this._animate=new he(e,this.stopAnimationAfterFirstNodeHover(),1e-4,.02)}_stopAnimation(){this._animate?.stop()}_patch(e,o){const n=new Set(o.nodes.map(f=>f.data.id)),s=new Set(o.edges.map(f=>f.data.id??""));e.nodes().filter(f=>!n.has(f.id())).forEach(f=>{this._positionCache.set(f.id(),{...f.position()})}),e.remove(e.nodes().filter(f=>!n.has(f.id()))),e.remove(e.edges().filter(f=>!s.has(f.id())));const a=new Set(e.nodes().map(f=>f.id())),c=new Set(e.edges().map(f=>f.id()));for(const f of o.nodes)if(a.has(f.data.id)){const L=e.getElementById(f.data.id);L.data(f.data),L.classes(f.classes??"")}for(const f of o.edges)if(c.has(f.data.id??"")){const L=e.getElementById(f.data.id??"");L.data(f.data),L.classes(f.classes??"")}const d=o.nodes.filter(f=>!a.has(f.data.id)),h=o.edges.filter(f=>!c.has(f.data.id??""));if(0===d.length&&0===h.length)return;e.nodes().lock();const u=new Set(d.map(f=>f.data.id)),g=e.nodes();e.add([...d.map(f=>({group:"nodes",data:f.data,classes:f.classes??""})),...h.map(f=>({group:"edges",data:f.data,classes:f.classes??""}))]);const m=new Map;for(const f of h){const L=u.has(f.data.source),F=u.has(f.data.target??"");if(L&&!F){const P=e.getElementById(f.data.target??"");P.length>0&&!m.has(f.data.source)&&m.set(f.data.source,{...P.position()})}if(F&&!L){const P=e.getElementById(f.data.source);P.length>0&&!m.has(f.data.target)&&m.set(f.data.target,{...P.position()})}}const p=[];let C=0;if(e.nodes().filter(f=>u.has(f.id())).forEach(f=>{const L=this._positionCache.get(f.id());if(L)f.position(L),f.lock(),this._positionCache.delete(f.id());else{const F=m.get(f.id());if(F){const P=C++*(2*Math.PI/Math.max(d.length,1)),z=100+60*Math.random();f.position({x:F.x+z*Math.cos(P),y:F.y+z*Math.sin(P)})}else p.push(f)}}),p.length>0&&g.length>0){const f=g.boundingBox({}),L=(f.x1+f.x2)/2,F=(f.y1+f.y2)/2,P=Math.max(f.x2-f.x1,f.y2-f.y1)/2+180,z=2*Math.PI/Math.max(p.length,1);p.forEach((W,$)=>{W.position({x:L+P*Math.cos(z*$),y:F+P*Math.sin(z*$)})})}const _=this._container();if(_&&this.appendHTMLLabels()){const f=new V,L=this.labelPropsSettings();f.boxLabels={...L.boxLabels},f.props={display:!1,displayOnlyOnHover:L.props.displayOnlyOnHover},Q(e,_,f)}const N=e.layout({...this._layoutOptions(),randomize:!1,fit:!1,animate:!0});N.on("layoutstop",()=>e.nodes().unlock()),N.run()}_build(e){this._bodyObserver?.disconnect(),this._bodyObserver=void 0;const o=this._container(),n=o?this._resolveParentBg(o):D.backgroundColor,s={...D,directed:this.directed(),backgroundColor:n},a=J(s),c=this._nodesHavePosition()?{name:"preset",padding:100,animate:!1}:{...this._layoutOptions(),padding:80,animate:!1},d=e({container:this._container(),style:a,layout:c,elements:this._styledElements(),userZoomingEnabled:this.userZoomingEnabled(),userPanningEnabled:this.userPanningEnabled(),minZoom:.2,maxZoom:3});d.one("layoutstop",()=>{d.resize(),this._nodesHavePosition()||d.fit(void 0,60),d.center()}),this._cy.update(()=>d),this._startBodyObserver()}_setupClickHoverEvents(){const e=this._cy();if(null==e)return;let o=e.collection();e.nodes().unbind("tapstart"),e.nodes().bind("tapstart",n=>{const s=n.target.data();!s.isCollapser&&!s.isChainExpander&&this.contextMenuItems().length>0&&(n.originalEvent?.preventDefault(),n.originalEvent?.stopPropagation())}),e.nodes().unbind("click"),e.nodes().bind("click",n=>{const s=n.target,a=s.data();if(a.isCollapser||a.isChainExpander)return this.contextMenuVisible.set(!1),this.nodeClick.emit(a),void(o=o.union(s));if(this.selectableNodes()){const c=a.id;this.selectedNodeIds.update(d=>d.includes(c)?d.filter(h=>h!==c):[...d,c])}this.nodeClick.emit(a),o=o.union(s)}),e.nodes().unbind("cxttap"),e.nodes().bind("cxttap",n=>{if(!this.contextMenuItems().length)return;const s=n.target,a=s.data(),c=s.renderedPosition();this._contextMenuNode=a,this.contextMenuPos.set({x:c.x,y:c.y}),this.contextMenuVisible.set(!0),this.edgeContextMenuVisible.set(!1),this.nodeHover.emit(a)}),e.nodes().unbind("mouseover"),e.nodes().bind("mouseover",n=>{this._dimAllButNeighbors(n.target);const s=n.target.data();this.nodeHover.emit(s);const a=s.properties;if(this.labelPropsSettings().props.display&&a){const c=Object.entries(a).map(([d,h])=>({key:d,value:String(h)}));if(c.length>0){const d=n.target.renderedBoundingBox();this.hoverNodeOverlay.set({x:(d.x1+d.x2)/2,y:d.y2,entries:c})}}}),e.nodes().unbind("mouseout"),e.nodes().bind("mouseout",()=>{this._unDimAll(),this.nodeHover.emit(void 0),this.hoverNodeOverlay.set(null)}),e.nodes().unbind("drag"),e.nodes().bind("drag",n=>{if(null===this.hoverNodeOverlay())return;const s=n.target.renderedBoundingBox(),a=this.hoverNodeOverlay();this.hoverNodeOverlay.set({...a,x:(s.x1+s.x2)/2,y:s.y2})}),e.nodes().unbind("dragfree"),e.nodes().bind("dragfree",()=>{this.hoverNodeOverlay.set(null)}),e.edges().unbind("mouseover"),e.edges().bind("mouseover",n=>{n.target.addClass("edge-hover")}),e.edges().unbind("mouseout"),e.edges().bind("mouseout",n=>{n.target.removeClass("edge-hover")}),e.edges().unbind("tap"),e.edges().bind("tap",n=>{const s=n.target;if(this.selectableEdges()){const a=i._edgeKey(s.data("source"),s.data("target"));this.selectedEdgeIds.update(c=>c.includes(a)?c.filter(d=>d!==a):[...c,a])}}),e.edges().unbind("cxttap"),e.edges().bind("cxttap",n=>{if(!this.edgeContextMenuItems().length)return;const s=n.target,a=s.renderedMidpoint();this._edgeContextMenuLabel=s.data("label")??"",this._edgeContextMenuEdge={id:s.data("id"),iri:s.data("iri"),label:s.data("label"),source:s.data("source"),target:s.data("target"),color:s.data("color"),width:s.data("width")},this.edgeContextMenuPos.set({x:a.x,y:a.y}),this.edgeContextMenuVisible.set(!0),this.contextMenuVisible.set(!1)}),e.off("click"),e.on("click",n=>{0===Object.keys(n.target.data()).length&&(this.contextMenuVisible.set(!1),this.edgeContextMenuVisible.set(!1),this.canvasClick.emit())}),e.off("viewport"),e.on("viewport",()=>{this.contextMenuVisible.set(!1),this.edgeContextMenuVisible.set(!1)})}_onContextMenuAction(e){this.contextMenuVisible.set(!1),this._contextMenuNode&&this.contextMenuAction.emit({actionId:e,node:this._contextMenuNode})}_onEdgeContextMenuAction(e){this.edgeContextMenuVisible.set(!1),this.edgeContextMenuAction.emit({actionId:e,edgeLabel:this._edgeContextMenuLabel,edge:this._edgeContextMenuEdge})}_layoutOptions(){const e=this.layout();if("cose-bilkent"!==e)return{name:e};const o=this.elements().nodes,n=this.elements().edges,s=o.length>0?2*n.length/o.length:1,a=o.map(_=>{const L=[_.data.label||"",..._.data.boxLabels||[]].filter(Boolean);return Math.max(...L.map(F=>F.length),0)}),c=a.length>0?a.reduce((_,N)=>_+N,0)/a.length:0,d=a.length>0?Math.max(...a):0,u=1.5*c,g=.8*Math.max(0,d-20),m=7.2*s;return{name:"cose-bilkent",nodeDimensionsIncludeLabels:!0,randomize:!0,nodeRepulsion:Math.round(4500+500*s),idealEdgeLength:Math.round(48+u+g+m),edgeElasticity:.45,gravity:.25,gravityRange:3.8,numIter:2500}}_nodesHavePosition(){return void 0!==this.elements().nodes.find(o=>void 0!==o.position)}fitTo(e,o=80){const n=this._cy();if(!n||0===e.length)return;let s=n.collection();for(const a of e){const c=n.getElementById(a);c.length>0&&(s=s.union(c))}0!==s.length&&n.animate({fit:{eles:s,padding:o},duration:400,easing:"ease-in-out-cubic"})}_unDimAll(){const e=this._cy();null!=e&&(e.elements().forEach(o=>{o.removeClass("faded")}),e.edges().removeClass("neighbor-hover"))}_dimAllButNeighbors(e){const o=this._cy();if(null==o)return;const n=e.neighborhood().map(s=>s.id());o.elements().forEach(s=>{n.includes(s.id())||s.id()===e.id()?s.removeClass("faded"):s.addClass("faded")}),e.connectedEdges().addClass("neighbor-hover")}static \u0275fac=function(o){return new(o||i)};static \u0275cmp=t.VBU({type:i,selectors:[["cue-simple-graph"]],viewQuery:function(o,n){if(1&o&&t.GBs(_e,5),2&o){let s;t.mGM(s=t.lsd())&&(n.graphContainer=s.first)}},inputs:{elements:[1,"elements"],animate:[1,"animate"],stopAnimationAfterFirstNodeHover:[1,"stopAnimationAfterFirstNodeHover"],layout:[1,"layout"],highlightNeighborsOnHover:[1,"highlightNeighborsOnHover"],userZoomingEnabled:[1,"userZoomingEnabled"],userPanningEnabled:[1,"userPanningEnabled"],appendHTMLLabels:[1,"appendHTMLLabels"],directed:[1,"directed"],labelPropsSettings:[1,"labelPropsSettings"],contextMenuItems:[1,"contextMenuItems"],edgeContextMenuItems:[1,"edgeContextMenuItems"],selectableNodes:[1,"selectableNodes"],selectableEdges:[1,"selectableEdges"],selectedNodeIds:[1,"selectedNodeIds"],selectedEdgeIds:[1,"selectedEdgeIds"]},outputs:{selectedNodeIds:"selectedNodeIdsChange",selectedEdgeIds:"selectedEdgeIdsChange",nodeHover:"nodeHover",nodeClick:"nodeClick",canvasClick:"canvasClick",contextMenuAction:"contextMenuAction",edgeContextMenuAction:"edgeContextMenuAction"},decls:5,vars:3,consts:[["graphContainer",""],["id","graph","cueResized","",3,"resized"],[1,"node-props-overlay",3,"left","top"],[1,"cy-context-menu",3,"left","top"],[1,"node-props-overlay"],[1,"prop-row"],[1,"prop-key"],[1,"prop-value"],[1,"cy-context-menu"],[1,"cy-context-item"],[1,"cy-context-item",3,"mousedown","click"]],template:function(o,n){if(1&o&&(t.j41(0,"div",1,0),t.bIt("resized",function(){return n.onResize()}),t.nVh(2,be,3,4,"div",2),t.nVh(3,Ce,3,4,"div",3),t.nVh(4,xe,3,4,"div",3),t.k0s()),2&o){let s;t.R7$(2),t.vxM((s=n.hoverNodeOverlay())?2:-1,s),t.R7$(),t.vxM(n.contextMenuVisible()&&n.contextMenuItems().length>0?3:-1),t.R7$(),t.vxM(n.edgeContextMenuVisible()&&n.edgeContextMenuItems().length>0?4:-1)}},dependencies:[ge.C],styles:["[_nghost-%COMP%]{display:contents}#graph[_ngcontent-%COMP%]{display:block!important;text-align:left!important;margin:0!important;min-height:100px;flex:1 1;width:100%;position:relative;overflow:hidden} .box-label{position:absolute;pointer-events:none;display:flex;flex-direction:column;align-items:flex-start;gap:4px}.node-props-overlay[_ngcontent-%COMP%]{position:absolute;transform:translate(-50%,8px);z-index:20;pointer-events:none;background:var(--cue-menu-background-color);color:var(--cue-menu-foreground-color);border:1px solid var(--cue-menu-border-color);border-radius:var(--cue-menu-border-radius);box-shadow:var(--cue-menu-box-shadow);padding:var(--cue-menu-padding-y) var(--cue-menu-padding-x);display:flex;flex-direction:column;gap:8px;min-width:140px;max-width:260px}.prop-row[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2px}.prop-key[_ngcontent-%COMP%]{font-family:Poppins,sans-serif;font-size:.6rem;font-weight:600;color:var(--cue-neutral);text-transform:uppercase;letter-spacing:.05em}.prop-value[_ngcontent-%COMP%]{font-family:Poppins,sans-serif;font-size:.72rem;color:var(--cue-menu-foreground-color);overflow:hidden;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical}.cy-context-menu[_ngcontent-%COMP%]{position:absolute;z-index:30;background:var(--cue-menu-background-color);color:var(--cue-menu-foreground-color);border:1px solid var(--cue-menu-border-color);border-radius:var(--cue-menu-border-radius);box-shadow:var(--cue-menu-box-shadow);padding:4px 0;min-width:160px;display:flex;flex-direction:column}.cy-context-item[_ngcontent-%COMP%]{background:none;border:none;padding:8px 16px;text-align:left;font-family:Poppins,sans-serif;font-size:.8rem;color:var(--cue-menu-foreground-color);cursor:pointer}.cy-context-item[_ngcontent-%COMP%]:hover{background:var(--cue-menu-hover-color, rgba(0, 0, 0, .06))}"],changeDetection:0})}return i})();const oe=["#2859e1","#4caf50","#fc2626","#f59e0b","#8b5cf6","#06b6d4","#f97316","#14b8a6","#ec4899","#6366f1"],ee="__collapser__",Z="__chain__";var Le=y(29134),ke=y(56034),we=y(57517),De=y(16455),Te=y(68334),j=y(59352),de=y(85971),Pe=y(75448),le=y(13319),Re=y(65187),re=y(42245),Ae=y(35381),Fe=y(21359),Ge=y(58957);const Be=(i,l)=>({$implicit:i,depth:0,siblingsHaveChildren:l}),Oe=(i,l,e)=>({$implicit:i,depth:l,siblingsHaveChildren:e}),ce=(i,l)=>l.id;function je(i,l){if(1&i){const e=t.RV6();t.j41(0,"cue-input",5),t.mxI("valueChange",function(n){r.eBV(e);const s=t.XpG();return t.DH7(s.searchTerm,n)||(s.searchTerm=n),r.Njj(n)}),t.k0s()}if(2&i){const e=t.XpG();t.R50("value",e.searchTerm)}}function Se(i,l){1&i&&t.nrm(0,"span",6)}function He(i,l){if(1&i){const e=t.RV6();t.j41(0,"cue-flexcontainer",3),t.nVh(1,Se,1,0,"span",6),t.j41(2,"cue-checkbox",7),t.bIt("checkedChange",function(){r.eBV(e);const n=t.XpG();return r.Njj(n.toggleAll())}),t.k0s(),t.j41(3,"cue-typography",8),t.bIt("click",function(){r.eBV(e);const n=t.XpG();return r.Njj(n.toggleAll())}),t.EFF(4),t.k0s()()}if(2&i){const e=t.XpG();t.R7$(),t.vxM(e._rootHasChildren()?1:-1),t.R7$(),t.Y8G("checked",e._allChecked())("indeterminate",e._allIndeterminate()),t.R7$(2),t.JRh(e.selectAllLabel())}}function Ve(i,l){if(1&i&&t.eu8(0,4),2&i){const e=l.$implicit,o=t.XpG(),n=t.sdS(6);t.Y8G("ngTemplateOutlet",n)("ngTemplateOutletContext",t.l_i(2,Be,e,o._rootHasChildren()))}}function ze(i,l){if(1&i){const e=t.RV6();t.j41(0,"cue-button",13),t.bIt("click",function(){r.eBV(e);const n=t.XpG().$implicit,s=t.XpG();return r.Njj(s.toggleExpand(n.id))}),t.j41(1,"span",14),t.nrm(2,"cue-button-icon",15),t.k0s()()}if(2&i){const e=t.XpG().$implicit,o=t.XpG();t.R7$(),t.AVh("rotate-180",o.isExpanded(e.id))}}function $e(i,l){1&i&&t.nrm(0,"span",6)}function Xe(i,l){if(1&i&&t.eu8(0,4),2&i){const e=l.$implicit,o=t.XpG(2),n=o.$implicit,s=o.depth,a=t.XpG(),c=t.sdS(6);t.Y8G("ngTemplateOutlet",c)("ngTemplateOutletContext",t.sMw(2,Oe,e,s+1,a._listHasChildren(n.children)))}}function We(i,l){if(1&i&&t.Z7z(0,Xe,1,6,"ng-container",4,ce),2&i){const e=t.XpG().$implicit,o=t.XpG();t.Dyx(o._sortChildren(e.children))}}function Ue(i,l){if(1&i){const e=t.RV6();t.j41(0,"cue-flexcontainer",9),t.nVh(1,ze,3,2,"cue-button",10)(2,$e,1,0,"span",6),t.j41(3,"cue-checkbox",11),t.bIt("checkedChange",function(){const n=r.eBV(e).$implicit,s=t.XpG();return r.Njj(s.toggle(n))}),t.k0s(),t.j41(4,"cue-typography",12),t.bIt("click",function(){const n=r.eBV(e).$implicit,s=t.XpG();return r.Njj(s.toggle(n))}),t.EFF(5),t.k0s()(),t.nVh(6,We,2,0)}if(2&i){const e=l.$implicit,o=l.depth,n=l.siblingsHaveChildren,s=t.XpG();t.xc7("padding-left",16*o,"px"),t.R7$(),t.vxM(null!=e.children&&e.children.length?1:n?2:-1),t.R7$(2),t.Y8G("checked",s.isChecked(e))("indeterminate",s.isIndeterminate(e))("color",e.color),t.R7$(2),t.JRh(e.label),t.R7$(),t.vxM(null!=e.children&&e.children.length&&s.isExpanded(e.id)?6:-1)}}let Ze=(()=>{class i{nodes=(0,b.hFB)([]);uncheckedIds=(0,b.geq)(new Set);selectAllLabel=(0,b.hFB)("All");searchThreshold=(0,b.hFB)(10);searchTerm=(0,r.vPA)("");_expandedIds=(0,r.vPA)(new Set);_seenBranchIds=new Set;_initExpanded=(0,r.QZP)(()=>{const e=new Set,o=n=>{for(const s of n)s.children?.length&&(e.add(s.id),o(s.children))};o(this.nodes()),this._expandedIds.update(n=>{const s=new Set;return e.forEach(a=>{(n.has(a)||!this._seenBranchIds.has(a))&&s.add(a)}),s}),this._seenBranchIds=e});_countAll(e){return e.reduce((o,n)=>o+1+(n.children?this._countAll(n.children):0),0)}_showSearch=(0,x.EW)(()=>this._countAll(this.nodes())>this.searchThreshold());_matches(e,o){return!!e.label.toLowerCase().includes(o)||!!e.children?.some(n=>this._matches(n,o))}_filterTree(e,o){return e.filter(n=>this._matches(n,o)).map(n=>n.children?{...n,children:this._filterTree(n.children,o)}:n)}_filteredNodes=(0,x.EW)(()=>{const e=this.searchTerm().trim().toLowerCase();return e?this._filterTree(this.nodes(),e):this.nodes()});_sortedNodes=(0,x.EW)(()=>this._sortChildren(this._filteredNodes()));_listHasChildren(e){return!!e?.some(o=>o.children?.length)}_rootHasChildren=(0,x.EW)(()=>this._listHasChildren(this.nodes()));_sortChildren(e){return e?[...e].sort((o,n)=>n.weight-o.weight):[]}isExpanded(e){return!!this.searchTerm().trim()||this._expandedIds().has(e)}toggleExpand(e){this._expandedIds.update(o=>{const n=new Set(o);return n.has(e)?n.delete(e):n.add(e),n})}_descendantIds(e){const o=[e.id];return e.children?.forEach(n=>o.push(...this._descendantIds(n))),o}_allIds(e){return e.flatMap(o=>this._descendantIds(o))}_allChecked=(0,x.EW)(()=>{const e=this._allIds(this.nodes());if(0===e.length)return!0;const o=this.uncheckedIds();return e.every(n=>!o.has(n))});_allIndeterminate=(0,x.EW)(()=>{const e=this._allIds(this.nodes());if(0===e.length)return!1;const o=this.uncheckedIds(),n=e.filter(s=>o.has(s)).length;return n>0&&n<e.length});toggleAll(){const e=this._allIds(this.nodes()),o=this._allChecked();this.uncheckedIds.update(n=>{const s=new Set(n);return e.forEach(a=>o?s.add(a):s.delete(a)),s})}isChecked(e){const o=this.uncheckedIds();return this._descendantIds(e).every(n=>!o.has(n))}isIndeterminate(e){if(!e.children?.length)return!1;const o=this._descendantIds(e),n=this.uncheckedIds(),s=o.filter(a=>n.has(a)).length;return s>0&&s<o.length}toggle(e){const o=this._descendantIds(e),n=this.isChecked(e);this.uncheckedIds.update(s=>{const a=new Set(s);return o.forEach(c=>n?a.add(c):a.delete(c)),a})}static \u0275fac=function(o){return new(o||i)};static \u0275cmp=t.VBU({type:i,selectors:[["cue-tree-checklist"]],inputs:{nodes:[1,"nodes"],uncheckedIds:[1,"uncheckedIds"],selectAllLabel:[1,"selectAllLabel"],searchThreshold:[1,"searchThreshold"]},outputs:{uncheckedIds:"uncheckedIdsChange"},decls:7,vars:2,consts:[["row",""],["direction","column","gap","xs",2,"width","100%"],["icon","search","placeholder","Search\u2026","size","xs",1,"tc-search",3,"value"],["align","center","justify","start","gap","xs",1,"tc-select-all",2,"width","100%"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],["icon","search","placeholder","Search\u2026","size","xs",1,"tc-search",3,"valueChange","value"],[1,"tc-spacer"],["size","s",3,"checkedChange","checked","indeterminate"],["weight","semibold",2,"cursor","pointer",3,"click"],["align","center","justify","start","gap","xs",2,"width","100%"],["variant","ghost","size","xs"],["size","s",3,"checkedChange","checked","indeterminate","color"],[2,"cursor","pointer",3,"click"],["variant","ghost","size","xs",3,"click"],[1,"tc-caret"],["icon","arrow-dropdown"]],template:function(o,n){1&o&&(t.j41(0,"cue-flexcontainer",1),t.nVh(1,je,1,1,"cue-input",2),t.nVh(2,He,5,4,"cue-flexcontainer",3),t.Z7z(3,Ve,1,5,"ng-container",4,ce),t.k0s(),t.DNE(5,Ue,7,8,"ng-template",null,0,t.C5r)),2&o&&(t.R7$(),t.vxM(n._showSearch()?1:-1),t.R7$(),t.vxM(n._sortedNodes().length>0?2:-1),t.R7$(),t.Dyx(n._sortedNodes()))},dependencies:[Ae.FlexContainer,re.Typography,Fe.Checkbox,Ge.Input,de.Button,le.ButtonIcon,S.T3],styles:["[_nghost-%COMP%]{display:block;width:100%}.tc-spacer[_ngcontent-%COMP%]{display:inline-block;width:24px;flex:0 0 auto}.tc-caret[_ngcontent-%COMP%]{display:inline-flex;transition:transform .15s ease}.tc-caret.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.tc-select-all[_ngcontent-%COMP%]{padding-bottom:4px;margin-bottom:2px;border-bottom:1px solid var(--cue-border-color)}.tc-search[_ngcontent-%COMP%]{margin-bottom:4px}"],changeDetection:0})}return i})();function Ye(i,l){if(1&i){const e=t.RV6();t.j41(0,"cue-button",6),t.bIt("click",function(){r.eBV(e);const n=t.XpG(2);return r.Njj(n._fullscreenOpen.set(!n._fullscreenOpen()))}),t.nrm(1,"cue-button-icon",7),t.j41(2,"cue-button-label"),t.EFF(3),t.nI1(4,"transloco"),t.k0s()()}if(2&i){const e=t.XpG(2);t.xc7("position","absolute")("top","0.5rem")("left","0.5rem")("z-index",41),t.R7$(),t.Y8G("icon",e._fullscreenOpen()?"close":"fullscreen"),t.R7$(2),t.JRh(t.bMT(4,10,e._fullscreenOpen()?"components.graph.rdf.labelExitFullscreen":"components.graph.rdf.labelFullscreen"))}}function Qe(i,l){if(1&i){const e=t.RV6();t.j41(0,"cue-simple-graph",8),t.mxI("selectedNodeIdsChange",function(n){r.eBV(e);const s=t.XpG(2);return t.DH7(s.selectedNodeIds,n)||(s.selectedNodeIds=n),r.Njj(n)})("selectedEdgeIdsChange",function(n){r.eBV(e);const s=t.XpG(2);return t.DH7(s.selectedEdgeIds,n)||(s.selectedEdgeIds=n),r.Njj(n)}),t.bIt("nodeHover",function(n){r.eBV(e);const s=t.XpG(2);return r.Njj(s._onNodeHover(n))})("nodeClick",function(n){r.eBV(e);const s=t.XpG(2);return r.Njj(s._onNodeClick(n))})("canvasClick",function(){r.eBV(e);const n=t.XpG(2);return r.Njj(n._onCanvasClick())})("contextMenuAction",function(n){r.eBV(e);const s=t.XpG(2);return r.Njj(s._onContextMenuAction(n))})("edgeContextMenuAction",function(n){r.eBV(e);const s=t.XpG(2);return r.Njj(s._onEdgeContextMenuAction(n))}),t.k0s()}if(2&i){const e=t.XpG(2);t.Y8G("elements",l)("labelPropsSettings",e.labelPropsSettings())("contextMenuItems",e._nodeMenuItems())("edgeContextMenuItems",e._edgeMenuItems())("selectableNodes",e.selectableNodes())("selectableEdges",e.selectableEdges()),t.R50("selectedNodeIds",e.selectedNodeIds)("selectedEdgeIds",e.selectedEdgeIds)}}function Je(i,l){1&i&&t.EFF(0," No elements ")}function Ke(i,l){if(1&i){const e=t.RV6();t.j41(0,"button",21),t.bIt("click",function(){r.eBV(e);const n=t.XpG(4);return r.Njj(n._entitiesPanelExpanded.set(!n._entitiesPanelExpanded()))}),t.EFF(1),t.nI1(2,"transloco"),t.k0s()}if(2&i){const e=t.XpG(4);t.AVh("active",e._entitiesPanelExpanded()),t.R7$(),t.SpI(" ",t.bMT(2,3,"components.graph.rdf.legendEntities")," ")}}function qe(i,l){if(1&i){const e=t.RV6();t.j41(0,"button",21),t.bIt("click",function(){r.eBV(e);const n=t.XpG(4);return r.Njj(n._relationsPanelExpanded.set(!n._relationsPanelExpanded()))}),t.EFF(1),t.nI1(2,"transloco"),t.k0s()}if(2&i){const e=t.XpG(4);t.AVh("active",e._relationsPanelExpanded()),t.R7$(),t.SpI(" ",t.bMT(2,3,"components.graph.rdf.legendRelationships")," ")}}function et(i,l){if(1&i){const e=t.RV6();t.j41(0,"cue-card",19)(1,"div",22)(2,"cue-typography",23),t.EFF(3),t.nI1(4,"transloco"),t.k0s(),t.j41(5,"button",24),t.nI1(6,"transloco"),t.nI1(7,"transloco"),t.bIt("click",function(){r.eBV(e);const n=t.XpG(4);return r.Njj(n._invertCategorySelection())}),t.nrm(8,"cue-button-icon",25),t.k0s()(),t.j41(9,"cue-tree-checklist",26),t.nI1(10,"transloco"),t.bIt("uncheckedIdsChange",function(n){r.eBV(e);const s=t.XpG(4);return r.Njj(s._onCategoryTreeChange(n))}),t.k0s()()}if(2&i){const e=t.XpG(4);t.Y8G("shadow",!1),t.R7$(3),t.JRh(t.bMT(4,7,"components.graph.rdf.legendEntities")),t.R7$(2),t.BMQ("aria-label",t.bMT(6,9,"components.graph.rdf.labelInvertSelection"))("title",t.bMT(7,11,"components.graph.rdf.labelInvertSelection")),t.R7$(4),t.Y8G("nodes",e._categoryTree())("uncheckedIds",e._categoryUncheckedIds())("selectAllLabel",t.bMT(10,13,"components.graph.rdf.legendSelectAll"))}}function tt(i,l){if(1&i){const e=t.RV6();t.j41(0,"cue-card",19)(1,"div",22)(2,"cue-typography",23),t.EFF(3),t.nI1(4,"transloco"),t.k0s(),t.j41(5,"button",24),t.nI1(6,"transloco"),t.nI1(7,"transloco"),t.bIt("click",function(){r.eBV(e);const n=t.XpG(4);return r.Njj(n._invertPredicateSelection())}),t.nrm(8,"cue-button-icon",25),t.k0s()(),t.j41(9,"cue-tree-checklist",26),t.nI1(10,"transloco"),t.bIt("uncheckedIdsChange",function(n){r.eBV(e);const s=t.XpG(4);return r.Njj(s._onPredicateTreeChange(n))}),t.k0s()()}if(2&i){const e=t.XpG(4);t.Y8G("shadow",!1),t.R7$(3),t.JRh(t.bMT(4,7,"components.graph.rdf.legendRelationships")),t.R7$(2),t.BMQ("aria-label",t.bMT(6,9,"components.graph.rdf.labelInvertSelection"))("title",t.bMT(7,11,"components.graph.rdf.labelInvertSelection")),t.R7$(4),t.Y8G("nodes",e._relationshipTree())("uncheckedIds",e._predicateUncheckedIds())("selectAllLabel",t.bMT(10,13,"components.graph.rdf.legendSelectAll"))}}function nt(i,l){if(1&i){const e=t.RV6();t.j41(0,"cue-button",27),t.bIt("click",function(){r.eBV(e);const n=t.XpG(4);return r.Njj(n._resetAllFilters())}),t.j41(1,"cue-button-label"),t.EFF(2),t.nI1(3,"transloco"),t.k0s()()}2&i&&(t.R7$(2),t.JRh(t.bMT(3,1,"components.graph.rdf.labelResetFilters")))}function ot(i,l){if(1&i){const e=t.RV6();t.j41(0,"div",9)(1,"div",11)(2,"button",12),t.nI1(3,"transloco"),t.bIt("click",function(){r.eBV(e);const n=t.XpG(3);return r.Njj(n._hierarchyPanelOpen.set(!n._hierarchyPanelOpen()))}),t.j41(4,"span",13),t.nrm(5,"cue-button-icon",14),t.k0s()(),t.j41(6,"div",15)(7,"div",16),t.nVh(8,Ke,3,5,"button",17),t.nVh(9,qe,3,5,"button",17),t.k0s(),t.j41(10,"div",18),t.nVh(11,et,11,15,"cue-card",19),t.nVh(12,tt,11,15,"cue-card",19),t.k0s(),t.nVh(13,nt,4,3,"cue-button",20),t.k0s()()()}if(2&i){const e=t.XpG(3);t.R7$(),t.AVh("collapsed",!e._hierarchyPanelOpen()),t.R7$(),t.BMQ("aria-label",t.bMT(3,10,"components.graph.rdf.legendTitle")),t.R7$(2),t.AVh("rotate-180",e._hierarchyPanelOpen()),t.R7$(4),t.vxM(e._categoryTree().length>0?8:-1),t.R7$(),t.vxM(e._relationshipTree().length>0?9:-1),t.R7$(2),t.vxM(e._categoryTree().length>0&&e._entitiesPanelExpanded()?11:-1),t.R7$(),t.vxM(e._relationshipTree().length>0&&e._relationsPanelExpanded()?12:-1),t.R7$(),t.vxM(e._hasActiveFilters()?13:-1)}}function st(i,l){if(1&i){const e=t.RV6();t.j41(0,"cue-draggable-card",28),t.nI1(1,"transloco"),t.bIt("clickedClose",function(){r.eBV(e);const n=t.XpG(3);return r.Njj(n._tabbedLegendClosed.set(!0))}),t.j41(2,"cue-tabs",29)(3,"cue-tab",30),t.nI1(4,"transloco"),t.j41(5,"div",31)(6,"cue-layer-legend",32),t.bIt("visibilityAll",function(n){r.eBV(e);const s=t.XpG(3);return r.Njj(s._onCategoryVisibilityAll(n))})("layerChange",function(n){r.eBV(e);const s=t.XpG(3);return r.Njj(s._onCategoryLayerChange(n))}),t.k0s()()(),t.j41(7,"cue-tab",30),t.nI1(8,"transloco"),t.j41(9,"div",31)(10,"cue-layer-legend",32),t.bIt("visibilityAll",function(n){r.eBV(e);const s=t.XpG(3);return r.Njj(s._onPredicateVisibilityAll(n))})("layerChange",function(n){r.eBV(e);const s=t.XpG(3);return r.Njj(s._onPredicateLayerChange(n))}),t.k0s()()()()()}if(2&i){const e=t.XpG(3);t.Y8G("label",t.bMT(1,7,"components.graph.rdf.legendTitle"))("padded",!1)("position",e.legendPosition()),t.R7$(3),t.Y8G("label",t.bMT(4,9,"components.graph.rdf.legendEntities")),t.R7$(3),t.Y8G("layers",e._categoryLayers()),t.R7$(),t.Y8G("label",t.bMT(8,11,"components.graph.rdf.legendRelationships")),t.R7$(3),t.Y8G("layers",e._predicateLayers())}}function it(i,l){if(1&i){const e=t.RV6();t.j41(0,"cue-color-legend-panel",34),t.nI1(1,"transloco"),t.bIt("close",function(){r.eBV(e);const n=t.XpG(4);return r.Njj(n._legendClosed.set(!0))})("layerChange",function(n){r.eBV(e);const s=t.XpG(4);return r.Njj(s._onCategoryLayerChange(n))})("visibilityAll",function(n){r.eBV(e);const s=t.XpG(4);return r.Njj(s._onCategoryVisibilityAll(n))}),t.k0s()}if(2&i){const e=t.XpG(4);t.Y8G("title",t.bMT(1,2,"components.graph.rdf.legendCategories"))("layers",e._categoryLayers())}}function at(i,l){if(1&i){const e=t.RV6();t.j41(0,"cue-button",37),t.bIt("click",function(){r.eBV(e);const n=t.XpG(5);return r.Njj(n._unhideAllPredicates())}),t.j41(1,"cue-button-label"),t.EFF(2),t.nI1(3,"transloco"),t.k0s()()}2&i&&(t.xc7("position","absolute")("top","2.5rem")("right","0.5rem"),t.R7$(2),t.JRh(t.bMT(3,7,"components.graph.rdf.labelUnhideEdges")))}function dt(i,l){if(1&i){const e=t.RV6();t.j41(0,"cue-color-legend-panel",35),t.nI1(1,"transloco"),t.bIt("close",function(){r.eBV(e);const n=t.XpG(4);return r.Njj(n._predicateLegendClosed.set(!0))})("layerChange",function(n){r.eBV(e);const s=t.XpG(4);return r.Njj(s._onPredicateLayerChange(n))})("visibilityAll",function(n){r.eBV(e);const s=t.XpG(4);return r.Njj(s._onPredicateVisibilityAll(n))}),t.k0s(),t.nVh(2,at,4,9,"cue-button",36)}if(2&i){const e=t.XpG(4);t.Y8G("title",t.bMT(1,4,"components.graph.rdf.legendRelationships"))("layers",e._predicateLayers())("position",e.legendPosition()),t.R7$(2),t.vxM(e._anyPredicateHidden()?2:-1)}}function lt(i,l){if(1&i&&(t.nVh(0,it,2,4,"cue-color-legend-panel",33),t.nVh(1,dt,3,6)),2&i){const e=t.XpG(3);t.vxM(e.colorByCategory()&&e._categoryLayers().length>0&&!e._legendClosed()?0:-1),t.R7$(),t.vxM(e.showRelationshipLegend()&&e._predicateLayers().length>0&&!e._predicateLegendClosed()?1:-1)}}function rt(i,l){if(1&i&&t.nVh(0,ot,14,12,"div",9)(1,st,11,13,"cue-draggable-card",10)(2,lt,2,2),2&i){const e=t.XpG(2);t.vxM(e._hasHierarchyData()?0:e.tabbedLegend()&&!e._tabbedLegendClosed()?1:2)}}function ct(i,l){if(1&i){const e=t.RV6();t.j41(0,"cue-button",38),t.bIt("click",function(){r.eBV(e);const n=t.XpG(2);return r.Njj(n._resetIsolation())}),t.j41(1,"cue-button-label"),t.EFF(2),t.nI1(3,"transloco"),t.k0s()()}2&i&&(t.xc7("position","absolute")("bottom","0.5rem")("right","0.5rem"),t.R7$(2),t.JRh(t.bMT(3,7,"components.graph.rdf.labelResetIsolation")))}function ut(i,l){if(1&i&&(t.j41(0,"div",2),t.nVh(1,Ye,5,12,"cue-button",3),t.nVh(2,Qe,1,8,"cue-simple-graph",4)(3,Je,1,0),t.nVh(4,rt,3,1),t.nVh(5,ct,4,9,"cue-button",5),t.k0s()),2&i){let e,o;const n=t.XpG();t.R7$(),t.vxM(n.fullscreenEnabled()?1:-1),t.R7$(),t.vxM((e=n.elements())?2:3,e),t.R7$(2),t.vxM(n._legendVisible()?4:-1),t.R7$(),t.vxM((o=n._isolatedNodeId())?5:-1,o)}}function pt(i,l){1&i&&t.eu8(0)}function ht(i,l){if(1&i){const e=t.RV6();t.j41(0,"cue-modal",39),t.bIt("close",function(){r.eBV(e);const n=t.XpG();return r.Njj(n._fullscreenOpen.set(!1))}),t.DNE(1,pt,1,0,"ng-container",40),t.k0s()}if(2&i){t.XpG();const e=t.sdS(1);t.Y8G("visible",!0)("displayCloseBtn",!1),t.R7$(),t.Y8G("ngTemplateOutlet",e)}}function gt(i,l){1&i&&t.eu8(0)}function _t(i,l){if(1&i&&t.DNE(0,gt,1,0,"ng-container",40),2&i){t.XpG();const e=t.sdS(1);t.Y8G("ngTemplateOutlet",e)}}let ft=(()=>{class i{_graph=(0,b.ebz)(q);doc=(0,b.hFB)();collapseClasses=(0,b.hFB)(!0);collapseAttributes=(0,b.hFB)(!0);collapseRelationships=(0,b.hFB)(!0);classPredicates=(0,b.hFB)([]);focusNodes=(0,b.hFB)([]);focusNodeColor=(0,b.hFB)("red");zoomToFocusNodes=(0,b.hFB)(!1);colorByCategory=(0,b.hFB)(!1);showRelationshipLegend=(0,b.hFB)(!1);legendPosition=(0,b.hFB)("top-left");tabbedLegend=(0,b.hFB)(!1);categoryLabelsOnHover=(0,b.hFB)(!0);showFocusMenuItem=(0,b.hFB)(!0);nodeMenuItems=(0,b.hFB)(void 0);edgeMenuItems=(0,b.hFB)(void 0);edgeWidths=(0,b.hFB)({});nodeSizes=(0,b.hFB)({});nodeColors=(0,b.hFB)({});categoryHierarchy=(0,b.hFB)([]);relationshipHierarchy=(0,b.hFB)([]);fullscreenEnabled=(0,b.hFB)(!1);legendAlwaysVisible=(0,b.hFB)(!1);selectableNodes=(0,b.hFB)(!1);selectableEdges=(0,b.hFB)(!1);selectedNodeIds=(0,b.geq)([]);selectedEdgeIds=(0,b.geq)([]);_fullscreenOpen=(0,r.vPA)(!1);_legendVisible=(0,x.EW)(()=>this.legendAlwaysVisible()||!this.fullscreenEnabled()||this._fullscreenOpen());nodeHover=(0,b.CGW)();nodeClick=(0,b.CGW)();canvasClick=(0,b.CGW)();_fullElements=null;_collapserGroups=[];_chainGroups=[];_focusedNodeId=void 0;_hiddenNodeIds=new Set;_categoryColors=new Map;_labelFocusOnNeighbours=(0,j.Xx)("components.graph.rdf.labelFocusOnNeighbours");_labelIsolateNode=(0,j.Xx)("components.graph.rdf.labelIsolateNode");_labelUnhideEdges=(0,j.Xx)("components.graph.rdf.labelUnhideEdges");_labelHideEdgeType=(0,j.Xx)("components.graph.rdf.labelHideEdgeType");_labelCollapseRelationship=(0,j.Xx)("components.graph.rdf.labelCollapseRelationship");_labelExpandMore=(0,j.Xx)("components.graph.rdf.labelExpandMore");_labelCollapseExpanded=(0,j.Xx)("components.graph.rdf.labelCollapseExpanded");_hoveredNode=(0,r.vPA)(null);_isolatedNodeId=(0,r.vPA)(void 0);_nodeMenuItems=(0,x.EW)(()=>{const e=this.nodeMenuItems();if(void 0!==e)return e;const o=this._hoveredNode()?.id,n=!!o&&this._collapserGroups.some(g=>g.allTargetNodeIds.includes(o)),s=o?this._collapserGroups.find(g=>g.id===o):void 0,a=!!s&&s.visibleCount>0,c=!!s&&s.visibleCount<s.allTargetNodeIds.length,d=o?this._chainGroups.find(g=>g.id===o):void 0,h=!!d&&d.visibleCount>0,u=!!d&&d.visibleCount<d.hiddenNodeIds.length;return[...this.showFocusMenuItem()?[{id:"focus",label:this._labelFocusOnNeighbours()}]:[],{id:"isolate",label:this._labelIsolateNode()},...this._anyPredicateHidden()?[{id:"unhide-edges",label:this._labelUnhideEdges()}]:[],...c||u?[{id:"expand-more",label:this._labelExpandMore()}]:[],...a||h?[{id:"collapse-expanded",label:this._labelCollapseExpanded()}]:[],...n?[{id:"collapse-relationship",label:this._labelCollapseRelationship()}]:[]]});_edgeMenuItems=(0,x.EW)(()=>{const e=this.edgeMenuItems();return void 0!==e?e:[{id:"hide-edge-type",label:this._labelHideEdgeType()}]});elements=(0,r.vPA)(void 0);_survivingCategoryLabels=(0,r.vPA)(new Set);_survivingPredicateLabels=(0,r.vPA)(new Set);_categoryLayers=(0,r.vPA)([]);_legendClosed=(0,r.vPA)(!1);_predicateLayers=(0,r.vPA)([]);_predicateLegendClosed=(0,r.vPA)(!1);_nodeLayers=(0,r.vPA)([]);_tabbedLegendClosed=(0,r.vPA)(!1);_entitiesPanelExpanded=(0,r.vPA)(!0);_relationsPanelExpanded=(0,r.vPA)(!0);_hierarchyPanelOpen=(0,r.vPA)(!0);_anyPredicateHidden=(0,x.EW)(()=>this._predicateLayers().some(e=>!e.visible));_hasHierarchyData=(0,x.EW)(()=>this.categoryHierarchy().length>0||this.relationshipHierarchy().length>0);_categoryLayersActive=(0,x.EW)(()=>this._categoryLayers().length>0);_effectiveCategoryLayers=(0,x.EW)(()=>this._categoryLayersActive()?this._categoryLayers():this._nodeLayers());_categoryTree=(0,x.EW)(()=>this._buildHierarchyTree(this._effectiveCategoryLayers(),this.categoryHierarchy()));_relationshipTree=(0,x.EW)(()=>this._buildHierarchyTree(this._predicateLayers(),this.relationshipHierarchy()));_categoryUncheckedIds=(0,x.EW)(()=>this._uncheckedGroupIds(this._effectiveCategoryLayers(),this._survivingCategoryLabels()));_predicateUncheckedIds=(0,x.EW)(()=>this._uncheckedGroupIds(this._predicateLayers(),this._survivingPredicateLabels()));_hasActiveFilters=(0,x.EW)(()=>void 0!==this._isolatedNodeId()||this._categoryUncheckedIds().size>0||this._predicateUncheckedIds().size>0);_layerIdentity(e){return e.iri?e.iri.replace(/~\d+$/,""):e.label}_groupLayersByIdentity(e){const o=new Map;return e.forEach(n=>{const s=this._layerIdentity(n),a=o.get(s);a?a.push(n):o.set(s,[n])}),o}_uncheckedGroupIds(e,o){const n=new Set;return this._groupLayersByIdentity(e).forEach((s,a)=>{const c=s.every(h=>!h.visible),d=!s.some(h=>o.has(h.label));(c||d)&&n.add(a)}),n}_buildHierarchyTree(e,o){if(0===o.length)return[];const n=new Map(o.map(m=>[m.matchIri??m.label,m])),s=this._groupLayersByIdentity(e),a=new Map,c=[],d=new Set,u=m=>{if(d.has(m))return;d.add(m);const p=(m=>{let p=a.get(m);if(!p){const C=n.get(m),_=s.get(m);p={id:m,label:C?.label??_?.[0]?.label??m,weight:C?.weight??0,children:[]},a.set(m,p)}return p})(m),C=n.get(m)?.parentLabel,_=C?o.find(N=>N.label===C)?.matchIri??C:void 0;if(_&&_!==m){u(_);const N=a.get(_);N.children.includes(p)||N.children.push(p)}else c.push(p)};s.forEach((m,p)=>u(p));const g=m=>{const p=(m.children??[]).reduce((C,_)=>C+g(_),0);return m.children?.length||delete m.children,m.weight+=p,m.weight};return c.forEach(g),c}_onCategoryTreeChange(e){this._categoryLayersActive()?this._categoryLayers.update(o=>o.map(n=>({...n,visible:!e.has(this._layerIdentity(n))}))):(this._nodeLayers.update(o=>o.map(n=>({...n,visible:!e.has(this._layerIdentity(n))}))),this._syncHiddenNodeIds()),this._recomputeElements()}_invertCategorySelection(){const e=this._categoryUncheckedIds();this._categoryLayersActive()?this._categoryLayers.update(o=>o.map(n=>({...n,visible:e.has(this._layerIdentity(n))}))):(this._nodeLayers.update(o=>o.map(n=>({...n,visible:e.has(this._layerIdentity(n))}))),this._syncHiddenNodeIds()),this._recomputeElements()}_invertPredicateSelection(){const e=this._predicateUncheckedIds();this._predicateLayers.update(o=>o.map(n=>({...n,visible:e.has(this._layerIdentity(n))}))),this._recomputeElements()}_onPredicateTreeChange(e){this._predicateLayers.update(o=>o.map(n=>({...n,visible:!e.has(this._layerIdentity(n))}))),this._recomputeElements()}_unhideAllPredicates(){this._predicateLayers.update(e=>e.map(o=>({...o,visible:!0}))),this._recomputeElements()}_resetIsolation(){this._isolatedNodeId.set(void 0),this._recomputeElements()}_resetAllFilters(){this._isolatedNodeId.set(void 0),this._categoryLayers.update(e=>e.map(o=>({...o,visible:!0}))),this._nodeLayers.update(e=>e.map(o=>({...o,visible:!0}))),this._predicateLayers.update(e=>e.map(o=>({...o,visible:!0}))),this._hiddenNodeIds.clear(),this._recomputeElements()}onDoc=(0,r.QZP)((()=>{var e=this;return(0,I.A)(function*(){const o=e.doc();if(void 0===o)return;const n=new w;n.hideClassAssignmentTriples=e.collapseClasses(),n.hideDatatypePropertyTriples=e.collapseAttributes(),n.collapseIntoClassificationLabels=e.classPredicates(),n.edgeWidths=e.edgeWidths(),n.nodeSizes=e.nodeSizes(),n.nodeColors=e.nodeColors();const s=new H(o,n);let a;try{a=yield s.init(),console.log("[rdf-graph onDoc] elements:",a.nodes.length,"nodes,",a.edges.length,"edges")}catch(d){return void console.error("[rdf-graph onDoc] CytoscapeJSONLD.init() threw:",d)}e._fullElements=a,e._collapserGroups=e.collapseRelationships()?function Ne(i){const l=new Map,e=new Map;for(const s of i.edges)s.data.target&&l.set(s.data.target,(l.get(s.data.target)??0)+1),s.data.source&&e.set(s.data.source,(e.get(s.data.source)??0)+1);const o=new Map;for(const s of i.edges){const a=`${s.data.source}\0${s.data.label}`;o.has(a)||o.set(a,[]),o.get(a).push(s)}const n=[];for(const[s,a]of o){if(a.length<4)continue;const c=s.indexOf("\0"),d=s.slice(0,c),h=s.slice(c+1),u=a.map(g=>g.data.target).filter(g=>g&&1===(l.get(g)??0)&&0===(e.get(g)??0));u.length<4||n.push({id:`${ee}${d}\0${h}`,sourceId:d,predicateLabel:h,allTargetNodeIds:u,visibleCount:0})}return n}(a):[],e._chainGroups=function Me(i){const l=new Map,e=new Map;for(const h of i.nodes)l.set(h.data.id,[]),e.set(h.data.id,[]);for(const h of i.edges)l.get(h.data.source)?.push(h),h.data.target&&e.get(h.data.target)?.push(h);const o=new Map,n=(h,u=new Set)=>{if(o.has(h))return o.get(h);if(u.has(h))return 0;u.add(h);const p=1+(l.get(h)??[]).reduce((C,_)=>Math.max(C,_.data.target?n(_.data.target,u):0),0);return o.set(h,p),p};for(const h of i.nodes)n(h.data.id);const s=new Set,a=[...i.nodes].sort((h,u)=>(o.get(u.data.id)??0)-(o.get(h.data.id)??0));for(const h of a){if(s.size>=20)break;let u=h.data.id;for(;u&&!s.has(u)&&s.size<20;)s.add(u),u=(l.get(u)??[]).filter(m=>m.data.target&&!s.has(m.data.target)).sort((m,p)=>(o.get(p.data.target)??0)-(o.get(m.data.target)??0))[0]?.data.target}const c=new Set(i.nodes.map(h=>h.data.id).filter(h=>!s.has(h)));if(0===c.size)return[];const d=new Map;for(const h of s)for(const u of l.get(h)??[]){if(!u.data.target||!c.has(u.data.target))continue;const g=`${h}\0${u.data.label??""}`;d.has(g)||d.set(g,{id:`${Z}${h}\0${u.data.label??""}`,sourceId:h,predicateLabel:u.data.label??"",hiddenNodeIds:[],visibleCount:0});const m=d.get(g);let p=u.data.target;for(;p&&c.has(p)&&!m.hiddenNodeIds.includes(p);)m.hiddenNodeIds.push(p),c.delete(p),p=(l.get(p)??[]).filter(_=>_.data.target&&c.has(_.data.target)).sort((_,N)=>(o.get(N.data.target)??0)-(o.get(_.data.target)??0))[0]?.data.target}return c.size>0&&d.set("__orphan__",{id:`${Z}__orphan__`,sourceId:a[0]?.data.id??"",predicateLabel:"",hiddenNodeIds:[...c],visibleCount:0}),[...d.values()].filter(h=>h.hiddenNodeIds.length>0)}(a),e._categoryLayers.set(e._buildCategoryLayers(a)),e._predicateLayers.set(e._buildPredicateLayers(a)),e._nodeLayers.set(e._buildNodeLayers(a)),e._hiddenNodeIds.clear(),e._legendClosed.set(!1),e._predicateLegendClosed.set(!1),e._tabbedLegendClosed.set(!1),e._isolatedNodeId.set(void 0),e._recomputeElements();const c=e.focusNodes();c.length>0&&e.zoomToFocusNodes()&&setTimeout(()=>e._graph()?.fitTo(c),450)})})());focusEffect=(0,r.QZP)(()=>{const e=this.focusNodes();this._fullElements&&(this._recomputeElements(),e.length>0&&this.zoomToFocusNodes()&&setTimeout(()=>this._graph()?.fitTo(e),200))});fullscreenResizeEffect=(0,r.QZP)(()=>{this._fullscreenOpen()&&setTimeout(()=>this.triggerResize(),0)});closeFullscreen(){this._fullscreenOpen.set(!1)}triggerResize(){const e=this._graph();if(e){const o=e._cy();o.resize(),setTimeout(()=>{const n=o.container(),s=n?.offsetWidth||0,a=n?.offsetHeight||0;if(s>=100&&a>=100){o.resize();const c=o.elements();if(c.length>0){const d=c.nodes();if(!(d.length>0&&d.every(Y=>{const pe=Y.position();return 0!==pe.x||0!==pe.y}))){const Y=this._graph();return void(Y&&Y._build?.())}const u=Math.min(s,a),g=Math.min(Math.max(.15*u,40),120),m=c.boundingBox(),F=Math.min((s-2*g)/(m.w||1),(a-2*g)/(m.h||1)),P=c.nodes().length,z=c.edges().length,W=P>0?2*z/P:1;let $=2.5;W>10?$=1:W>6?$=1.5:W>3&&($=2);const ue=Math.min(Math.max(F,.2),$);o.animate(ue!==F?{zoom:ue,center:{eles:c},duration:300}:{fit:{eles:c,padding:g},duration:300})}}else console.warn("\u{1f3af} RDFGraph: container too small or invalid dimensions, skipping fit")},150)}}colorByCategoryEffect=(0,r.QZP)(()=>{this.colorByCategory()&&this._legendClosed.set(!1),this._fullElements&&this._recomputeElements()});showRelationshipLegendEffect=(0,r.QZP)(()=>{this.showRelationshipLegend()&&this._predicateLegendClosed.set(!1)});labelPropsSettings=(0,x.EW)(()=>{const e=new V;return e.boxLabels.display=this.collapseClasses(),e.props.display=this.collapseAttributes(),e.boxLabels.displayOnlyOnHover=this.colorByCategory()||this.categoryLabelsOnHover(),e});_onNodeHover(e){e&&this._hoveredNode.set(e),this.nodeHover.emit(e)}_onNodeClick(e){const o=e;if(o.isCollapser&&o.collapserGroupId){const n=this._collapserGroups.find(s=>s.id===o.collapserGroupId);if(n){const s=Math.min(n.visibleCount+5,n.allTargetNodeIds.length);return void(s!==n.visibleCount&&(n.visibleCount=s,this._recomputeElements()))}}if(o.isChainExpander&&o.chainGroupId){const n=this._chainGroups.find(s=>s.id===o.chainGroupId);if(n){const s=Math.min(n.visibleCount+5,n.hiddenNodeIds.length);return void(s!==n.visibleCount&&(n.visibleCount=s,this._recomputeElements()))}}this.nodeClick.emit(e)}_onCanvasClick(){this.canvasClick.emit(),this._focusedNodeId&&(this._focusedNodeId=void 0,this._recomputeElements())}_onContextMenuAction(e){const o=this.nodeMenuItems();if(void 0===o){if("focus"===e.actionId){const n=e.node.id;this._focusedNodeId=this._focusedNodeId===n?void 0:n,this._recomputeElements()}else if("isolate"===e.actionId)this._isolatedNodeId.set(e.node.id),this._recomputeElements();else if("unhide-edges"===e.actionId)this._unhideAllPredicates();else if("expand-more"===e.actionId){const n=e.node.id,s=this._collapserGroups.find(c=>c.id===n);s&&(s.visibleCount=Math.min(s.visibleCount+5,s.allTargetNodeIds.length));const a=this._chainGroups.find(c=>c.id===n);a&&(a.visibleCount=Math.min(a.visibleCount+5,a.hiddenNodeIds.length)),this._recomputeElements()}else if("collapse-expanded"===e.actionId){const n=e.node.id,s=this._collapserGroups.find(c=>c.id===n);s&&(s.visibleCount=0);const a=this._chainGroups.find(c=>c.id===n);a&&(a.visibleCount=0),this._recomputeElements()}else if("collapse-relationship"===e.actionId){const n=e.node.id;for(const s of this._collapserGroups)s.allTargetNodeIds.includes(n)&&(s.visibleCount=0);this._recomputeElements()}}else o.find(n=>n.id===e.actionId)?.action(e.node)}_onEdgeContextMenuAction(e){const o=this.edgeMenuItems();void 0===o?"hide-edge-type"===e.actionId&&(this._predicateLayers.update(n=>n.map(s=>s.label===e.edgeLabel?{...s,visible:!1}:s)),this._recomputeElements()):o.find(n=>n.id===e.actionId)?.action(e.edge)}_onCategoryLayerChange(e){this._categoryLayers.update(o=>[...o]),this._recomputeElements()}_onCategoryVisibilityAll(e){this._categoryLayers.update(o=>[...o]),this._recomputeElements()}_onPredicateLayerChange(e){this._predicateLayers.update(o=>[...o]),this._recomputeElements()}_onPredicateVisibilityAll(e){this._predicateLayers.update(o=>[...o]),this._recomputeElements()}_onNodeLayerChange(e){this._syncHiddenNodeIds(),this._nodeLayers.update(o=>[...o]),this._recomputeElements()}_onNodeVisibilityAll(e){this._syncHiddenNodeIds(),this._nodeLayers.update(o=>[...o]),this._recomputeElements()}_syncHiddenNodeIds(){this._hiddenNodeIds.clear();for(const e of this._nodeLayers())e.visible||this._hiddenNodeIds.add(e.label)}static _PREDICATE_COLOR="#4a90d9";_buildPredicateLayers(e){const o=new Map,n=[];for(const s of e.edges){const a=s.data.label??"";a&&!o.has(a)&&(o.set(a,s.data.iri),n.push(a))}return n.map(s=>({label:s,color:i._PREDICATE_COLOR,visible:!0,iri:o.get(s)}))}_buildCategoryLayers(e){const o=new Set,n=[];for(const s of e.nodes){if(s.data.id.startsWith(ee)||s.data.id.startsWith(Z))continue;const a=s.data.boxLabels?.[0];a&&!o.has(a)&&(o.add(a),n.push(a))}return this._categoryColors=function Ie(i){const l=new Map;return i.forEach((e,o)=>{l.set(e,oe[o%oe.length])}),l}(n),n.map(s=>({label:s,color:this._categoryColors.get(s),visible:!0}))}_buildNodeLayers(e){const o=new Set,n=[];for(const s of e.nodes){if(s.data.id.startsWith(ee)||s.data.id.startsWith(Z))continue;const a=s.data.label||s.data.id,c=s.data.boxLabels?.[0],d=c?this._categoryColors.get(c):void 0;a&&!o.has(a)&&(o.add(a),n.push({label:a,color:d,visible:!0}))}return n.sort((s,a)=>s.label.localeCompare(a.label))}_recomputeElements(){this.elements.set(this._display());const e=this._computeSurvivingLabels();this._survivingCategoryLabels.set(e.categories),this._survivingPredicateLabels.set(e.predicates)}_computeSurvivingLabels(){const e=this._fullElements;if(!e)return{categories:new Set,predicates:new Set};let o=e.nodes,n=e.edges;const s=new Set(this._predicateLayers().filter(u=>!u.visible).map(u=>u.label));if(s.size>0){n=n.filter(g=>!s.has(g.data.label??""));const u=new Set;n.forEach(g=>{u.add(g.data.source),u.add(g.data.target)}),o=o.filter(g=>u.has(g.data.id))}if(this._hiddenNodeIds.size>0){o=o.filter(g=>!this._hiddenNodeIds.has(g.data.label||g.data.id));const u=new Set(o.map(g=>g.data.id));n=n.filter(g=>u.has(g.data.source)&&u.has(g.data.target))}const a=new Set(this._categoryLayers().filter(u=>!u.visible).map(u=>u.label));if(a.size>0){o=o.filter(g=>{const m=g.data.boxLabels?.[0];return void 0===m||!a.has(m)});const u=new Set(o.map(g=>g.data.id));n=n.filter(g=>u.has(g.data.source)&&u.has(g.data.target))}const c=this._isolatedNodeId();if(c){const u=new Set([c]);n.forEach(g=>{g.data.source===c&&u.add(g.data.target??""),g.data.target===c&&u.add(g.data.source)}),o=o.filter(g=>u.has(g.data.id)),n=n.filter(g=>u.has(g.data.source)&&u.has(g.data.target??""))}const d=new Set;this._categoryLayersActive()?o.forEach(u=>{const g=u.data.boxLabels?.[0];g&&d.add(g)}):o.forEach(u=>{const g=u.data.label||u.data.id;g&&d.add(g)});const h=new Set;return n.forEach(u=>{u.data.label&&h.add(u.data.label)}),{categories:d,predicates:h}}_display(){if(!this._fullElements)return{nodes:[],edges:[]};const e=new Set(this._categoryLayers().filter(p=>!p.visible).map(p=>p.label)),o=new Map(this._fullElements.nodes.map(p=>[p.data.id,p.data.boxLabels?.[0]])),n=new Map(this._fullElements.nodes.map(p=>[p.data.id,p.data.label||p.data.id])),s=p=>{const C=o.get(p);return!(void 0===C||!e.has(C))||this._hiddenNodeIds.has(n.get(p)??"")},a=this._collapserGroups.map(p=>{const C=[],_=[];for(const N of p.allTargetNodeIds)(s(N)?_:C).push(N);return{...p,allTargetNodeIds:[...C,..._],visibleCount:Math.max(p.visibleCount,C.length)}}),c=this._chainGroups.map(p=>{let C=-1;return p.hiddenNodeIds.forEach((_,N)=>{s(_)||(C=N)}),{...p,visibleCount:Math.max(p.visibleCount,C+1)}});let d=function Ee(i,l,e){const o=new Set,n=new Set,s=[],a=[];for(const d of e){const h=d.hiddenNodeIds.length-d.visibleCount;if(h<2)continue;for(const m of d.hiddenNodeIds.slice(d.visibleCount))o.add(m);const u=d.visibleCount>0,g=u?d.hiddenNodeIds[d.visibleCount-1]:d.sourceId;s.push({data:{id:d.id,label:`+${h}`,size:28,isChainExpander:!0,isExpanded:u,chainGroupId:d.id},classes:u?"collapser collapser-expanded":"collapser"}),a.push({data:{id:`edge_${d.id}`,source:g,target:d.id,label:d.predicateLabel}})}for(const d of l){const h=d.allTargetNodeIds.length-d.visibleCount;if(h<2)continue;for(const m of d.allTargetNodeIds.slice(d.visibleCount))o.add(m);const u=i.edges.filter(m=>m.data.source===d.sourceId&&m.data.label===d.predicateLabel&&d.allTargetNodeIds.includes(m.data.target));for(const m of u)n.add(m.data.id??"");for(const m of u)d.allTargetNodeIds.indexOf(m.data.target)<d.visibleCount&&a.push(m);const g=d.visibleCount>0;s.push({data:{id:d.id,label:`+${h}`,size:28,isCollapser:!0,isExpanded:g,collapserGroupId:d.id},classes:g?"collapser collapser-expanded":"collapser"}),a.push({data:{id:`edge_${d.id}`,source:d.sourceId,target:d.id,label:d.predicateLabel}})}const c=new Set(s.map(d=>d.data.id));return{nodes:[...i.nodes.filter(d=>!o.has(d.data.id)),...s],edges:[...i.edges.filter(d=>!(n.has(d.data.id??"")||o.has(d.data.source)||o.has(d.data.target??"")||c.has(d.data.source)||c.has(d.data.target??""))),...a]}}(this._fullElements,a,c);const h=new Set(this._predicateLayers().filter(p=>!p.visible).map(p=>p.label));if(h.size>0){const p=d.edges.filter(_=>!h.has(_.data.label??"")),C=new Set;for(const _ of p)C.add(_.data.source),C.add(_.data.target);d={nodes:d.nodes.filter(_=>C.has(_.data.id)),edges:p}}if(this._hiddenNodeIds.size>0){const p=_=>this._hiddenNodeIds.has(n.get(_)??""),C=new Set(d.nodes.filter(_=>this._hiddenNodeIds.has(_.data.label||_.data.id)).map(_=>_.data.id));for(const _ of this._collapserGroups)_.allTargetNodeIds.every(p)&&C.add(_.id);for(const _ of this._chainGroups){const N=_.hiddenNodeIds.slice(_.visibleCount);N.length>0&&N.every(p)&&C.add(_.id)}C.size>0&&(d={nodes:d.nodes.filter(_=>!C.has(_.data.id)),edges:d.edges.filter(_=>!C.has(_.data.source)&&!C.has(_.data.target))})}if(e.size>0){const p=_=>{const N=o.get(_);return void 0!==N&&e.has(N)},C=new Set(d.nodes.filter(_=>{const N=_.data.boxLabels?.[0];return void 0!==N&&e.has(N)}).map(_=>_.data.id));for(const _ of this._collapserGroups)_.allTargetNodeIds.every(p)&&C.add(_.id);for(const _ of this._chainGroups){const N=_.hiddenNodeIds.slice(_.visibleCount);N.length>0&&N.every(p)&&C.add(_.id)}d={nodes:d.nodes.filter(_=>!C.has(_.data.id)),edges:d.edges.filter(_=>!C.has(_.data.source)&&!C.has(_.data.target))}}this.colorByCategory()&&(d={...d,nodes:d.nodes.map(p=>{const C=p.data.boxLabels?.[0],_=C?this._categoryColors.get(C):void 0;return _?{...p,data:{...p.data,color:_}}:p})});const u=this._isolatedNodeId();u&&(d=this._applyIsolation(d,u)),this._focusedNodeId&&(d=this._applyFocus(d,this._focusedNodeId));const g=new Set(this.focusNodes()),m=this.focusNodeColor();return g.size>0&&(d={...d,nodes:d.nodes.map(p=>{if(!g.has(p.data.id))return p;const C=p.classes?p.classes.trim():"";return{...p,data:{...p.data,color:m},classes:C?`${C} focused`:"focused"}})}),d}_applyIsolation(e,o){const n=new Set([o]);for(const s of e.edges)s.data.source===o&&n.add(s.data.target??""),s.data.target===o&&n.add(s.data.source);return{nodes:e.nodes.filter(s=>n.has(s.data.id)),edges:e.edges.filter(s=>n.has(s.data.source)&&n.has(s.data.target??""))}}_applyFocus(e,o){const n=new Set([o]);for(const a of e.edges)a.data.source===o&&n.add(a.data.target??""),a.data.target===o&&n.add(a.data.source);const s=(a,c)=>{const d=a?a.trim():"";return d?`${d} ${c}`:c};return{nodes:e.nodes.map(a=>n.has(a.data.id)?{...a,classes:s(a.classes,"focused")}:{...a,classes:s(a.classes,"faded")}),edges:e.edges.map(a=>n.has(a.data.source)&&n.has(a.data.target??"")?a:{...a,classes:s(a.classes,"faded")})}}static \u0275fac=function(o){return new(o||i)};static \u0275cmp=t.VBU({type:i,selectors:[["cue-rdf-graph"]],viewQuery:function(o,n){1&o&&t.wEZ(n._graph,q,5),2&o&&t.NyB()},inputs:{doc:[1,"doc"],collapseClasses:[1,"collapseClasses"],collapseAttributes:[1,"collapseAttributes"],collapseRelationships:[1,"collapseRelationships"],classPredicates:[1,"classPredicates"],focusNodes:[1,"focusNodes"],focusNodeColor:[1,"focusNodeColor"],zoomToFocusNodes:[1,"zoomToFocusNodes"],colorByCategory:[1,"colorByCategory"],showRelationshipLegend:[1,"showRelationshipLegend"],legendPosition:[1,"legendPosition"],tabbedLegend:[1,"tabbedLegend"],categoryLabelsOnHover:[1,"categoryLabelsOnHover"],showFocusMenuItem:[1,"showFocusMenuItem"],nodeMenuItems:[1,"nodeMenuItems"],edgeMenuItems:[1,"edgeMenuItems"],edgeWidths:[1,"edgeWidths"],nodeSizes:[1,"nodeSizes"],nodeColors:[1,"nodeColors"],categoryHierarchy:[1,"categoryHierarchy"],relationshipHierarchy:[1,"relationshipHierarchy"],fullscreenEnabled:[1,"fullscreenEnabled"],legendAlwaysVisible:[1,"legendAlwaysVisible"],selectableNodes:[1,"selectableNodes"],selectableEdges:[1,"selectableEdges"],selectedNodeIds:[1,"selectedNodeIds"],selectedEdgeIds:[1,"selectedEdgeIds"]},outputs:{selectedNodeIds:"selectedNodeIdsChange",selectedEdgeIds:"selectedEdgeIdsChange",nodeHover:"nodeHover",nodeClick:"nodeClick",canvasClick:"canvasClick"},decls:4,vars:1,consts:[["graphBody",""],["size","fullscreen",3,"visible","displayCloseBtn"],[2,"display","flex","flex-direction","column","position","relative","width","100%","flex","1","min-height","0"],["variant","ghost","size","s",1,"fullscreen-toggle",3,"position","top","left","zIndex"],[3,"elements","labelPropsSettings","contextMenuItems","edgeContextMenuItems","selectableNodes","selectableEdges","selectedNodeIds","selectedEdgeIds"],["variant","ghost","size","s",1,"isolation-reset-btn",3,"position","bottom","right"],["variant","ghost","size","s",1,"fullscreen-toggle",3,"click"],[3,"icon"],[3,"selectedNodeIdsChange","selectedEdgeIdsChange","nodeHover","nodeClick","canvasClick","contextMenuAction","edgeContextMenuAction","elements","labelPropsSettings","contextMenuItems","edgeContextMenuItems","selectableNodes","selectableEdges","selectedNodeIds","selectedEdgeIds"],[1,"hierarchy-panel"],[3,"label","padded","position"],[1,"hp-panel-row"],["type","button",1,"hp-edge-toggle",3,"click"],[1,"hp-edge-arrow"],["icon","arrow-back"],[1,"hp-panel-inner"],[1,"hp-pill-row"],["type","button",1,"hp-pill",3,"active"],[1,"hp-panel-body"],["variant","secondary",1,"hp-subcard",3,"shadow"],["variant","secondary","size","s",1,"hp-reset-btn"],["type","button",1,"hp-pill",3,"click"],[1,"hp-section-label"],["size","xs","weight","semibold"],["type","button",1,"hp-invert-btn",3,"click"],["icon","arrow-up-down"],[3,"uncheckedIdsChange","nodes","uncheckedIds","selectAllLabel"],["variant","secondary","size","s",1,"hp-reset-btn",3,"click"],[3,"clickedClose","label","padded","position"],[1,"legend-tabs"],[3,"label"],[1,"legend-content"],[3,"visibilityAll","layerChange","layers"],["position","top-right",3,"title","layers"],["position","top-right",3,"close","layerChange","visibilityAll","title","layers"],[3,"close","layerChange","visibilityAll","title","layers","position"],["variant","ghost","size","s",1,"unhide-btn",3,"position","top","right"],["variant","ghost","size","s",1,"unhide-btn",3,"click"],["variant","ghost","size","s",1,"isolation-reset-btn",3,"click"],["size","fullscreen",3,"close","visible","displayCloseBtn"],[4,"ngTemplateOutlet"]],template:function(o,n){1&o&&(t.DNE(0,ut,6,4,"ng-template",null,0,t.C5r),t.nVh(2,ht,2,3,"cue-modal",1)(3,_t,1,1,"ng-container")),2&o&&(t.R7$(2),t.vxM(n._fullscreenOpen()?2:3))},dependencies:[q,Le.v,ke.y,we.P,De.t,Te.o,de.Button,Pe.ButtonLabel,le.ButtonIcon,Ze,Re.Card,re.Typography,k.a,S.T3,j.Kj],styles:["[_nghost-%COMP%]{display:contents}.legend-tabs[_ngcontent-%COMP%]{width:180px}.legend-content[_ngcontent-%COMP%]{padding:4px 10px 24px;font-size:.8em;max-height:200px;overflow:auto}.hierarchy-panel[_ngcontent-%COMP%]{position:absolute;top:0;right:0;height:100%;width:288px;max-width:100%;z-index:40;overflow:hidden;pointer-events:none}.hp-panel-row[_ngcontent-%COMP%]{display:flex;align-items:stretch;height:100%;width:288px;transition:transform .22s cubic-bezier(.4,0,.2,1)}.hp-panel-row.collapsed[_ngcontent-%COMP%]{transform:translate(260px)}.hp-edge-toggle[_ngcontent-%COMP%]{flex:0 0 28px;width:28px;align-self:center;height:48px;border:1px solid var(--cue-card-border-color);border-right:none;border-radius:6px 0 0 6px;background:var(--cue-primary);color:var(--cue-primaryContrast);display:flex;align-items:center;justify-content:center;cursor:pointer;pointer-events:auto;box-shadow:-2px 0 8px #00000026}.hp-edge-arrow[_ngcontent-%COMP%]{display:inline-flex;transition:transform .2s ease}.hp-edge-arrow.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.hp-panel-inner[_ngcontent-%COMP%]{position:relative;flex:0 0 260px;width:260px;height:100%;background:var(--cue-primary);color:var(--cue-primaryContrast);border-radius:var(--cue-card-border-radius);border-left:1px solid rgba(255,255,255,.15);display:flex;flex-direction:column;overflow:hidden;box-shadow:-6px 0 24px #00000026;pointer-events:auto}.hp-pill-row[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:8px;padding:16px 16px 0;flex-shrink:0}.hp-pill[_ngcontent-%COMP%]{font-family:var(--cue-font-family);font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.05em;padding:5px 12px;border-radius:999px;background:#ffffff1f;color:#ffffffbf;border:1px solid rgba(255,255,255,.2);cursor:pointer;transition:background .15s,color .15s,border-color .15s}.hp-pill[_ngcontent-%COMP%]:hover{border-color:#fff6}.hp-pill.active[_ngcontent-%COMP%]{background:#ffffffe6;color:var(--cue-primary);border-color:#ffffffe6}.hp-panel-body[_ngcontent-%COMP%]{flex:1;overflow-y:auto;padding:12px;display:flex;flex-direction:column;gap:12px;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.2) transparent}.hp-reset-btn[_ngcontent-%COMP%]{flex-shrink:0;margin:8px 12px 12px;justify-content:center;box-shadow:0 -2px 12px #0003}.hp-subcard[_ngcontent-%COMP%]{flex-shrink:0}cue-card.hp-subcard[_ngcontent-%COMP%]{--cue-input-value-color: rgba(255, 255, 255, .75);--cue-input-border-bottom-color: rgba(255, 255, 255, .25);--cue-input-placeholder-color: rgba(255, 255, 255, .45)}.hp-section-label[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px}.hp-section-label[_ngcontent-%COMP%] cue-typography[_ngcontent-%COMP%]{opacity:.75}.hp-invert-btn[_ngcontent-%COMP%]{background:none;border:none;color:inherit;opacity:.55;cursor:pointer;padding:2px;display:flex;align-items:center;flex-shrink:0}.hp-invert-btn[_ngcontent-%COMP%]:hover{opacity:1}"],changeDetection:0})}return i})()},2065(X,G,y){function r(k,w,M="text/plain"){return function I(k,w="data.zip"){const M=document.createElement("a"),v=URL.createObjectURL(k);M.href=v,M.download=w,document.body.appendChild(M),M.click(),document.body.removeChild(M),URL.revokeObjectURL(v)}(new Blob([k],{type:M}),w)}function x(k,w){const M=document.createElement("a");M.style.display="hidden",M.setAttribute("href",window.URL.createObjectURL(k)),M.setAttribute("download",w),document.body.appendChild(M),M.click(),M.remove()}y.d(G,{KE:()=>x,YN:()=>r})},35401(X,G,y){y.d(G,{Q:()=>I});const I={foaf:"http://xmlns.com/foaf/0.1/",rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",skos:"http://www.w3.org/2004/02/skos/core#",geo:"http://www.opengis.net/ont/geosparql#",schema:"http://schema.org/"}},77573(X,G,y){y.d(G,{E:()=>I});const I={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#"}}}]);
|
|
1
|
+
"use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[6751],{56034(X,G,y){y.d(G,{y:()=>R});var I=y(17705),b=y(80469),r=y(49769),x=y(65187),S=y(42245),k=y(35381),w=y(20029),M=y(32271),v=y(35547);const T=["*"];let H=(()=>{class D{style=(0,I.hFB)("");gap=(0,I.hFB)("m");columns=(0,I.hFB)(1);getStyles=(0,M.EW)(()=>`\n grid-template-columns: repeat(${this.columns()}, minmax(0, 1fr));\n gap: var(--cue-grid-gap-${this.gap()});\n ${this.style()}\n `);static \u0275fac=function(A){return new(A||D)};static \u0275cmp=v.VBU({type:D,selectors:[["cue-grid"]],hostVars:2,hostBindings:function(A,E){2&A&&v.Aen(E.getStyles())},inputs:{style:[1,"style"],gap:[1,"gap"],columns:[1,"columns"]},ngContentSelectors:T,decls:1,vars:0,template:function(A,E){1&A&&(v.NAR(),v.SdG(0))},styles:["[_nghost-%COMP%]{display:grid}"]})}return D})();const O=["*"];function V(D,J){if(1&D&&(v.j41(0,"cue-typography",2),v.EFF(1),v.k0s()),2&D){const B=v.XpG();v.R7$(),v.SpI(" ",B.label()," ")}}let R=(()=>{class D{label=(0,I.hFB)("");variant=(0,I.hFB)("default");shadow=(0,I.hFB)(!1);padded=(0,I.hFB)(!0);showCloseBtn=(0,I.hFB)(!0);position=(0,I.hFB)("top-left");clickedClose=(0,I.CGW)();margin=(0,I.hFB)("0.5rem");close(B){B.stopPropagation(),B.stopImmediatePropagation(),this.clickedClose.emit()}static \u0275fac=function(A){return new(A||D)};static \u0275cmp=v.VBU({type:D,selectors:[["cue-draggable-card"]],inputs:{label:[1,"label"],variant:[1,"variant"],shadow:[1,"shadow"],padded:[1,"padded"],showCloseBtn:[1,"showCloseBtn"],position:[1,"position"],margin:[1,"margin"]},outputs:{clickedClose:"clickedClose"},ngContentSelectors:O,decls:8,vars:14,consts:[["cdkDrag","",1,"panel",3,"variant","shadow","padded"],["justify","end"],["size","l"],[2,"width","100%"],["name","close",2,"cursor","pointer",3,"click"]],template:function(A,E){1&A&&(v.NAR(),v.j41(0,"cue-card",0)(1,"cue-typography")(2,"cue-grid")(3,"cue-flexcontainer",1),v.nVh(4,V,2,1,"cue-typography",2),v.nrm(5,"span",3),v.j41(6,"cue-svg-icon",4),v.bIt("click",function(te){return E.close(te)}),v.k0s()(),v.SdG(7),v.k0s()()()),2&A&&(v.xc7("top","top-left"===E.position()||"top-right"===E.position()?E.margin():"null")("bottom","bottom-left"===E.position()||"bottom-right"===E.position()?E.margin():"null")("left","top-left"===E.position()||"bottom-left"===E.position()?E.margin():"null")("right","top-right"===E.position()||"bottom-right"===E.position()?E.margin():"null"),v.Y8G("variant",E.variant())("shadow",E.shadow())("padded",E.padded()),v.R7$(3),v.xc7("padding",E.padded()?"0":"10px"),v.R7$(),v.vxM(E.label()&&"undefined"!==E.label()?4:-1))},dependencies:[r.MD,x.Card,H,S.Typography,k.FlexContainer,w.A,b.T1],styles:[".panel[_ngcontent-%COMP%]{position:absolute;width:fit-content;z-index:100}"]})}return D})()},29134(X,G,y){y.d(G,{v:()=>S});var I=y(17705),b=y(56034),r=y(57517),x=y(35547);let S=(()=>{class k{title=(0,I.hFB)("Legend");layers=(0,I.hFB)([]);position=(0,I.hFB)("top-left");close=(0,I.CGW)();visibilityChange=(0,I.CGW)();layerChange=(0,I.CGW)();visibilityAll=(0,I.CGW)();static \u0275fac=function(v){return new(v||k)};static \u0275cmp=x.VBU({type:k,selectors:[["cue-color-legend-panel"]],inputs:{title:[1,"title"],layers:[1,"layers"],position:[1,"position"]},outputs:{close:"close",visibilityChange:"visibilityChange",layerChange:"layerChange",visibilityAll:"visibilityAll"},decls:3,vars:4,consts:[[3,"clickedClose","label","padded","position"],[1,"content"],[3,"visibilityAll","layerChange","visibilityChange","layers"]],template:function(v,T){1&v&&(x.j41(0,"cue-draggable-card",0),x.bIt("clickedClose",function(){return T.close.emit()}),x.j41(1,"div",1)(2,"cue-layer-legend",2),x.bIt("visibilityAll",function(O){return T.visibilityAll.emit(O)})("layerChange",function(O){return T.layerChange.emit(O)})("visibilityChange",function(O){return T.visibilityChange.emit(O)}),x.k0s()()()),2&v&&(x.Y8G("label",T.title())("padded",!1)("position",T.position()),x.R7$(2),x.Y8G("layers",T.layers()))},dependencies:[b.y,r.P],styles:[".content[_ngcontent-%COMP%]{padding-left:10px;padding-right:10px;margin-bottom:30px;font-size:.8em;max-height:200px;max-width:180px;overflow:auto}"]})}return k})()},4487(X,G,y){y.d(G,{t:()=>ft});var I=y(10467),b=y(17705),r=y(85802),x=y(32271),S=y(49769),k=y(21331);class w{hideClassAssignmentTriples=!0;hideDatatypePropertyTriples=!0;collapseIntoClassificationLabels=[];preferredLabelLanguage="en";showClassLabelOnInstance=!0;edgeWidths={};nodeSizes={};nodeColors={}}var v=y(68402);class T{_doc;_omitClassAssignments;_omitDatatypeProperties;_preferredLabelLanguage;_collapseIntoClassificationLabels;_edgeWidths;_nodeSizes;_nodeColors;_context;_nodes=[];_edges=[];_seenNodes=[];_resourceLabels={};_resourceAltLabels={};_resolvedCollapsePredicates=new Set;_knownPrefixes={schema:"http://schema.org/"};constructor(l,e=!0,o=!0,n="en",s=[],a={},c={},d={}){this._doc=l,this._omitClassAssignments=e,this._omitDatatypeProperties=o,this._preferredLabelLanguage=n,this._collapseIntoClassificationLabels=s,this._edgeWidths=a,this._nodeSizes=c,this._nodeColors=d}get elementData(){return{nodes:this._nodes,edges:this._edges}}init(){var l=this;return(0,I.A)(function*(){return"http://schema.org/"==l._doc["@context"]&&(l._doc["@context"]="https://schema.org/"),l._context={...l._doc["@context"],...l._knownPrefixes},l._nodes=[],l._edges=[],l._seenNodes=[],l._resourceLabels={},l._resourceAltLabels={},l._resolvedCollapsePredicates=new Set(l._collapseIntoClassificationLabels.map(n=>l._expandIRI(n))),(yield(yield l._loadToRDF())(l._doc)).forEach(n=>l._processQuad(n)),l._nodes=l._appendNames(l._nodes),l._edges=l._appendNames(l._edges),{nodes:l._nodes,edges:l._edges}})()}append(l){var e=this;return(0,I.A)(function*(){return(yield(yield e._loadToRDF())(l)).forEach(s=>e._processQuad(s)),e._nodes=e._appendNames(e._nodes),e._edges=e._appendNames(e._edges),{nodes:e._nodes,edges:e._edges}})()}_loadToRDF(){return(0,I.A)(function*(){const l=yield Promise.all([y.e(2076),y.e(2130)]).then(y.t.bind(y,32130,23));return l.toRDF??l.default.toRDF})()}_processQuad(l){const e=l.subject.value;let o=l.predicate.value,n=l.object.value;if("http://www.w3.org/2004/02/skos/core#prefLabel"===o||"http://www.w3.org/2000/01/rdf-schema#label"===o||"http://schema.org/name"===o)return void(Object.keys(this._resourceLabels).includes(e)?this._resourceLabels[e].push(l.object):this._resourceLabels[e]=[l.object]);if("http://www.w3.org/2004/02/skos/core#altLabel"===o)return void(Object.keys(this._resourceAltLabels).includes(e)?this._resourceAltLabels[e].push(l.object):this._resourceAltLabels[e]=[l.object]);if(this._appendNamedNode(e),this._resolvedCollapsePredicates.has(o)){const a=this._nodes.find(c=>c.data.id===e);return void(void 0!==a&&(void 0===a.data.boxLabels&&(a.data.boxLabels=[]),a.data.boxLabels.push(this._appendPrefix(n))))}if("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"===o&&(o="a",this._seenNodes.includes(e))){const a=this._nodes.find(c=>c.data.id===e);void 0!==a&&(void 0===a.data.boxLabels&&(a.data.boxLabels=[]),a.data.boxLabels.push(this._appendPrefix(n)))}const s=l.object.termType;if("Literal"===s){if(n=this._appendLiteralNode(n),this._seenNodes.includes(e)){const a=this._nodes.find(c=>c.data.id===e);if(void 0!==a){void 0===a.data.properties&&(a.data.properties={});const c=this._getIdFromIRI(o);a.data.properties[c]=l.object.value}}}else"BlankNode"===s?this._appendNamedNode(n,"individual"):"NamedNode"===s?this._appendNamedNode(n,"a"===o?"class":"individual"):console.warn("Unknown term type "+s);this._appendEdge(e,o,n,"Literal"===s)}_appendNames(l){return l.map(e=>{const o=e.data.iri,n=(void 0!==e.data.id?this._resourceLabels[e.data.id]:void 0)??(void 0!==o?this._resourceLabels[o]:void 0)??(void 0!==e.data.id?this._resourceAltLabels[e.data.id]:void 0)??(void 0!==o?this._resourceAltLabels[o]:void 0);if(Array.isArray(n))1===n.length?e.data.label=n[0].value:console.log("MORE THAN ONE LABEL NOT YET SUPPORTED");else{if("class"===e.classes){if(null==e.data.iri)return e;e.data.label=this._getIdFromIRI(e.data.iri)}if("edge"===e.classes){if(null==e.data.iri)return e;e.data.label=this._getIdFromIRI(e.data.iri)}}const s=e.data;if(void 0!==s.size){const a=void 0!==s.iri?this._nodeSizes[s.iri]:void 0;void 0!==a?s.size=a:""!=e.data.label&&(s.size=44);const c=void 0!==s.iri?this._nodeColors[s.iri]:void 0;void 0!==c&&(s.color=c),Array.isArray(s.boxLabels)&&(s.boxLabels=s.boxLabels.map(d=>{const p=this._expandIRI(d),u=this._resourceLabels[p]??this._resourceAltLabels[p];return Array.isArray(u)&&u.length>0?u[0].value:d}))}return e})}_appendNamedNode(l,e="individual"){if(!this._omitClassAssignments||"class"!==e)if(this._seenNodes.includes(l)){if("class"===e){const o=this._nodes.find(n=>n.data.id===l);null!=o&&(o.classes=e)}}else this._nodes.push({data:{id:l,iri:l,label:"",size:24},classes:e}),this._seenNodes.push(l)}_appendLiteralNode(l){if(this._omitDatatypeProperties)return"";""===l&&(l="-");const e=this._camelize(l);return this._seenNodes.includes(e)||(this._nodes.push({data:{id:e,label:l,size:2*l.length},classes:"literal"}),this._seenNodes.push(e)),e}_appendEdge(l,e,o,n=!1){if(this._omitClassAssignments&&"a"===e||this._omitDatatypeProperties&&n)return;const s=this._edgeWidths[e];this._edges.push({data:{id:(0,v.A)(),source:l,target:o,label:this._appendPrefix(e),iri:e,...void 0!==s?{width:s}:{}},classes:"edge"})}_expandIRI(l){if(l.startsWith("http://")||l.startsWith("https://"))return l;const e=l.indexOf(":");if(e>0){const o=l.substring(0,e),n=l.substring(e+1),s=this._context?.[o];if(s)return s+n}return l}_appendPrefix(l){const e=Object.keys(this._context),o=Object.values(this._context);for(const n in o){const s=o[n];if(l.startsWith(s)){l=l.replace(s,`${e[n]}:`);break}}return l}_camelize(l){return l.replace(/(?:^\w|[A-Z]|\b\w)/g,function(e,o){return 0===o?e.toLowerCase():e.toUpperCase()}).replace(/\s+/g,"")}_getIdFromIRI(l){return l.includes("#")?l.split("#")[1]:l.split("/").pop()??l}}class H{_doc;_settings;_elementDataHandler;_elementData;constructor(l,e=new w){this._doc=l,this._settings=e,this._elementDataHandler=new T(this._doc,this._settings.hideClassAssignmentTriples,this._settings.hideDatatypePropertyTriples,this._settings.preferredLabelLanguage,this._settings.collapseIntoClassificationLabels,this._settings.edgeWidths,this._settings.nodeSizes,this._settings.nodeColors)}set settings(l){this._settings=l,this._elementDataHandler=new T(this._doc,this._settings.hideClassAssignmentTriples,this._settings.hideDatatypePropertyTriples,this._settings.preferredLabelLanguage,this._settings.collapseIntoClassificationLabels,this._settings.edgeWidths,this._settings.nodeSizes,this._settings.nodeColors)}init(){var l=this;return(0,I.A)(function*(){return l._elementData=yield l._elementDataHandler.init(),l._elementData})()}appendElementData(l){var e=this;return(0,I.A)(function*(){return e._elementData=yield e._elementDataHandler.append(l),e._elementData})()}compact(){console.log("COMPACT")}expand(){console.log("EXPAND")}}class V{props={display:!0,displayOnlyOnHover:!0};boxLabels={display:!0,displayOnlyOnHover:!1}}function Q(i,l,e=new V){function o(){i.nodes().forEach(a=>{const c=a.renderedHeight(),d=document.getElementById(`box-${a.id()}`);if(d){if(e.boxLabels.display){const p=a.data().boxLabels;if(void 0!==p){let u=document.getElementById(`labels-box-${a.id()}`);u?u.style.bottom=c/2-10+"px":(u=document.createElement("div"),u.id=`labels-box-${a.id()}`,u.className="box-label",u.style.bottom=c/2-10+"px",e.boxLabels.displayOnlyOnHover&&(u.style.display="none"),d.appendChild(u),p.forEach((g,m)=>{if(!u)return;const h=document.createElement("div");h.id=`labels-box-${a.id()}-${m}`,h.className="entry",h.innerHTML=g,u.appendChild(h)}))}}if(e.props.display){const p=a.data().properties;if(void 0!==p){let u=document.getElementById(`props-box-${a.id()}`);u?u.style.top=c/2-10+"px":(u=document.createElement("div"),u.id=`props-box-${a.id()}`,u.style.right="0px",u.className="property",u.style.top=c/2-10+"px",e.props.displayOnlyOnHover&&(u.style.display="none"),d.appendChild(u),Object.keys(p).forEach((g,m)=>{if(!u)return;const h=document.createElement("div");h.id=`props-box-${a.id()}-${m}`,h.className="entry",h.innerHTML=`<span class="key">${g}</span><span class="value">${p[g]}</span>`,u.appendChild(h)}))}}}})}!function O(i,l){function e(){i.nodes().forEach(n=>{const s=n.renderedPosition();let a=document.getElementById(`box-${n.id()}`);a||(a=document.createElement("div"),a.id=`box-${n.id()}`,a.style.position="absolute",l.appendChild(a)),a.style.left=`${s.x}px`,a.style.top=`${s.y}px`})}e(),i.on("position","node",e),i.on("pan zoom",e),i.on("remove","node",function o(n){const s=n.target.id(),a=document.getElementById(`box-${s}`);a&&a.remove()}),window.addEventListener("resize",e)}(i,l),o(),i.on("zoom",()=>{o(),function s(){if(!e.boxLabels.display)return;const c=i.zoom()>=.6;i.nodes().forEach(d=>{const p=document.getElementById(`labels-box-${d.id()}`);p&&(e.boxLabels.displayOnlyOnHover||(p.style.display=c?"flex":"none"))})}()}),i.on("mouseover","node",a=>{const c=a.target;if(e.props.displayOnlyOnHover){const d=document.getElementById(`props-box-${c.id()}`);d&&(d.style.display="flex")}if(e.boxLabels.displayOnlyOnHover){const d=document.getElementById(`labels-box-${c.id()}`);d&&(d.style.display="flex")}}),i.on("mouseout","node",a=>{const c=a.target;if(e.props.displayOnlyOnHover){const d=document.getElementById(`props-box-${c.id()}`);d&&(d.style.display="none")}if(e.boxLabels.displayOnlyOnHover){const d=document.getElementById(`labels-box-${c.id()}`);d&&(d.style.display="none")}})}function R(i){return getComputedStyle(document.documentElement).getPropertyValue(i).trim()}const D={get backgroundColor(){return R("--cue-main-background")||"#f5f6f9"},get edgeColor(){return R("--cue-primary")||"#2859e1"},edgeFontSize:"5rem",edgeWidth:"1.5rem",get nodeColor(){return R("--cue-primary")||"#2859e1"},nodeOpacity:"0.9",font:"Poppins",directed:!0,labelSelector:"label",showNodeLabels:!0,showEdgeLabels:!0,get hoverBorderColor(){return R("--cue-primary")||"#2859e1"},get textColor(){return R("--cue-primaryContrast")||"#ffffff"}},J=(i=D)=>{const l=R("--cue-primary")||"#2859e1",e=R("--cue-primaryContrast")||"#ffffff",o=R("--cue-accent")||"#e2f552",n=R("--cue-accentContrast")||"#121c2b",s=R("--cue-neutral")||"#8394b0",a=R("--cue-main-foreground")||"#121c2b",c=i.backgroundColor;return[{selector:"node",style:{label:d=>d.data(i.labelSelector)&&i.showNodeLabels?d.data(i.labelSelector):"",shape:"round-rectangle","text-valign":"bottom","text-margin-y":10,"font-family":i.font,"font-size":"6rem",opacity:i.nodeOpacity,color:a,"text-outline-width":0,"text-outline-color":d=>d.data("color")?d.data("color"):l,"background-color":d=>d.data("color")?d.data("color"):l,width:d=>d.data("size")?d.data("size"):"24",height:d=>d.data("size")?d.data("size"):"24","background-image":d=>d.data("imgPath")?d.data("imgPath"):"none","background-fit":"cover","background-width":"100%","background-height":"100%","background-image-opacity":.2}},{selector:"edge",style:{label:"","font-family":i.font,"font-size":i.edgeFontSize,color:l,"target-arrow-color":l,"curve-style":"bezier","target-arrow-shape":i.directed?"triangle":"none","arrow-scale":.8,"line-color":l,"line-opacity":.5,width:d=>d.data("width")?d.data("width"):i.edgeWidth}},{selector:"edge.edge-hover, edge.neighbor-hover",style:{label:d=>d.data(i.labelSelector)&&i.showEdgeLabels?d.data(i.labelSelector):"","line-opacity":1,width:d=>d.data("width")?d.data("width"):i.edgeWidth,"text-valign":"center","text-rotation":"autorotate","text-background-opacity":1,"text-background-color":c,"text-background-padding":4,"font-size":i.edgeFontSize,"font-weight":"600"}},{selector:".triple",style:{"background-color":c,"border-color":d=>d.data("color")?d.data("color"):l}},{selector:".literal",style:{label:d=>d.data(i.labelSelector)?d.data(i.labelSelector):"","text-valign":"center","font-size":"6rem","border-color":a,"background-color":c,"text-outline-width":0,"border-width":0,"background-opacity":0,color:a}},{selector:".loading",style:{shape:"ellipse","pie-size":"100%","pie-1-background-color":l,"pie-1-background-size":d=>`${d.data("pct")}%`,"pie-2-background-color":o,"pie-2-background-size":d=>100-parseInt(d.data("pct"))+"%",label:d=>void 0!==d.data("pct")&&100!==d.data("pct")?`${parseInt(d.data("pct"))}%`:"","font-size":"5rem","border-width":1,"border-opacity":1,"border-color":e}},{selector:".dropzone",style:{"border-color":l,"border-width":6,"border-opacity":1}},{selector:".collapser",style:{"background-color":s,"text-outline-color":s,"text-outline-width":0,"text-valign":"center",color:e,"border-width":0,"border-opacity":0,opacity:1}},{selector:".collapser-expanded",style:{opacity:.65}},{selector:".class",style:{"background-color":o,"text-outline-color":o,color:n}},{selector:".faded",style:{opacity:.12}},{selector:"node.focused",style:{"outline-color":d=>d.data("color")||l,"outline-width":"2px","outline-offset":"3px","outline-opacity":.5,"outline-style":"solid"}},{selector:"node.selected",style:{"outline-color":o,"outline-width":"3px","outline-offset":"2px","outline-opacity":1,"outline-style":"solid"}},{selector:"edge.selected",style:{"line-color":o,"target-arrow-color":o,"line-opacity":1,width:d=>d.data("width")?Number(d.data("width"))+1.5:3}}]};let A;class pe{_requestId;_animationRunning=!1;constructor(l,e=!0,o=1e-4,n=.02){this._build(l,e,o,n)}stop(){void 0!==this._requestId&&(cancelAnimationFrame(this._requestId),this._requestId=void 0,this._animationRunning=!1)}_build(l,e=!0,o=1e-4,n=.02){const s=()=>{this._animationRunning&&(l.nodes().forEach((a,c)=>{const d=a.position(),p=Math.sin(performance.now()*o+c)*n,u=Math.cos(performance.now()*o+c)*n;a.position({x:d.x+p,y:d.y+u})}),this._requestId=requestAnimationFrame(s))};this._animationRunning=!0,this._requestId=requestAnimationFrame(s),e&&l.on("mouseover","node",()=>{this.stop()})}}var ge=y(25970),t=y(35547);const _e=["graphContainer"],fe=(i,l)=>l.key,ne=(i,l)=>l.id;function me(i,l){if(1&i&&(t.j41(0,"div",5)(1,"span",6),t.EFF(2),t.k0s(),t.j41(3,"span",7),t.EFF(4),t.k0s()()),2&i){const e=l.$implicit;t.R7$(2),t.JRh(e.key),t.R7$(2),t.JRh(e.value)}}function be(i,l){if(1&i&&(t.j41(0,"div",4),t.Z7z(1,me,5,2,"div",5,fe),t.k0s()),2&i){const e=l;t.xc7("left",e.x,"px")("top",e.y,"px"),t.R7$(),t.Dyx(e.entries)}}function ye(i,l){if(1&i){const e=t.RV6();t.j41(0,"button",10),t.bIt("mousedown",function(n){return n.stopPropagation()})("click",function(){const n=r.eBV(e).$implicit,s=t.XpG(2);return r.Njj(s._onContextMenuAction(n.id))}),t.EFF(1),t.k0s()}if(2&i){const e=l.$implicit;t.R7$(),t.SpI(" ",e.label," ")}}function Ce(i,l){if(1&i&&(t.j41(0,"div",8),t.Z7z(1,ye,2,1,"button",9,ne),t.k0s()),2&i){const e=t.XpG();t.xc7("left",e.contextMenuPos().x,"px")("top",e.contextMenuPos().y,"px"),t.R7$(),t.Dyx(e.contextMenuItems())}}function ve(i,l){if(1&i){const e=t.RV6();t.j41(0,"button",10),t.bIt("mousedown",function(n){return n.stopPropagation()})("click",function(){const n=r.eBV(e).$implicit,s=t.XpG(2);return r.Njj(s._onEdgeContextMenuAction(n.id))}),t.EFF(1),t.k0s()}if(2&i){const e=l.$implicit;t.R7$(),t.SpI(" ",e.label," ")}}function xe(i,l){if(1&i&&(t.j41(0,"div",8),t.Z7z(1,ve,2,1,"button",9,ne),t.k0s()),2&i){const e=t.XpG();t.xc7("left",e.edgeContextMenuPos().x,"px")("top",e.edgeContextMenuPos().y,"px"),t.R7$(),t.Dyx(e.edgeContextMenuItems())}}let q=(()=>{class i{elements=b.hFB.required();animate=(0,b.hFB)(!1);stopAnimationAfterFirstNodeHover=(0,b.hFB)(!0);layout=(0,b.hFB)("cose-bilkent");highlightNeighborsOnHover=(0,b.hFB)(!0);userZoomingEnabled=(0,b.hFB)(!0);userPanningEnabled=(0,b.hFB)(!0);appendHTMLLabels=(0,b.hFB)(!0);directed=(0,b.hFB)(!0);labelPropsSettings=(0,b.hFB)(new V);contextMenuItems=(0,b.hFB)([]);edgeContextMenuItems=(0,b.hFB)([]);selectableNodes=(0,b.hFB)(!1);selectableEdges=(0,b.hFB)(!1);selectedNodeIds=(0,b.geq)([]);selectedEdgeIds=(0,b.geq)([]);nodeHover=(0,b.CGW)();nodeClick=(0,b.CGW)();canvasClick=(0,b.CGW)();contextMenuAction=(0,b.CGW)();edgeContextMenuAction=(0,b.CGW)();_cy=(0,r.vPA)(void 0);_container=(0,r.vPA)(void 0);_animate;_positionCache=new Map;hoverNodeOverlay=(0,r.vPA)(null);contextMenuVisible=(0,r.vPA)(!1);contextMenuPos=(0,r.vPA)({x:0,y:0});_contextMenuNode=null;edgeContextMenuVisible=(0,r.vPA)(!1);edgeContextMenuPos=(0,r.vPA)({x:0,y:0});_edgeContextMenuLabel="";_edgeContextMenuEdge={source:"",target:""};graphContainer;static _edgeKey(e,o){return`${e}|${o}`}_styledElements=(0,x.EW)(()=>{const e=this.elements(),o=new Set(this.selectedNodeIds()),n=new Set(this.selectedEdgeIds());return 0===o.size&&0===n.size?e:{nodes:e.nodes.map(s=>o.has(s.data.id)?{...s,classes:`${s.classes??""} selected`.trim()}:s),edges:e.edges.map(s=>n.has(i._edgeKey(s.data.source,s.data.target))?{...s,classes:`${s.classes??""} selected`.trim()}:s)}});_cyLib=(0,r.vPA)(void 0);handleElements=(0,r.QZP)(()=>{const e=this._styledElements();if(void 0===this._container())return;const o=this._cyLib();if(void 0===o)return;const n=this._cy();n?this._patch(n,e):this._build(o),this._setupClickHoverEvents()});handleAnimate=(0,r.QZP)(()=>{const e=this._cy();void 0!==e&&(this.animate()?this._setAnimation(e):this._stopAnimation())});handleHTMLLabels=(0,r.QZP)(()=>{const e=this._cy(),o=this._container();if(void 0===e||void 0===o)return;const n=this.labelPropsSettings(),s=new V;s.boxLabels={...n.boxLabels},s.props={display:!1,displayOnlyOnHover:n.props.displayOnlyOnHover},Q(e,o,s)});_bodyObserver;_resizeDebounce;_startBodyObserver(){this._bodyObserver=new MutationObserver(()=>{this._reapplyStyles()}),this._bodyObserver.observe(document.body,{attributes:!0,attributeFilter:["class"]})}_reapplyStyles(){const e=this._cy(),o=this._container();if(!e||!o)return;const n=this._resolveParentBg(o),s={...D,directed:this.directed(),backgroundColor:n};e.style(J(s)).update()}_resolveParentBg(e){let o=e.parentElement;for(;o;){const n=window.getComputedStyle(o).backgroundColor;if(n&&"rgba(0, 0, 0, 0)"!==n&&"transparent"!==n)return n;o=o.parentElement}return"#ffffff"}ngAfterViewInit(){const e=this.graphContainer.nativeElement;void 0!==e&&this._container.update(()=>e),function K(){return A??=Promise.all([y.e(9516).then(y.bind(y,89516)),y.e(6894).then(y.t.bind(y,36894,23))]).then(([{default:i},{default:l}])=>{try{i.use(l)}catch{}return i}),A}().then(o=>this._cyLib.set(o))}ngOnDestroy(){this._bodyObserver?.disconnect(),clearTimeout(this._resizeDebounce),this._cy()?.destroy()}onResize(){const e=this._cy();e&&(e.resize(),clearTimeout(this._resizeDebounce),this._resizeDebounce=setTimeout(()=>{e.resize(),this._nodesHavePosition()||e.fit(void 0,60),e.center()},250))}_setAnimation(e){this._stopAnimation(),this._animate=new pe(e,this.stopAnimationAfterFirstNodeHover(),1e-4,.02)}_stopAnimation(){this._animate?.stop()}_patch(e,o){const n=new Set(o.nodes.map(f=>f.data.id)),s=new Set(o.edges.map(f=>f.data.id??""));e.nodes().filter(f=>!n.has(f.id())).forEach(f=>{this._positionCache.set(f.id(),{...f.position()})}),e.remove(e.nodes().filter(f=>!n.has(f.id()))),e.remove(e.edges().filter(f=>!s.has(f.id())));const a=new Set(e.nodes().map(f=>f.id())),c=new Set(e.edges().map(f=>f.id()));for(const f of o.nodes)if(a.has(f.data.id)){const L=e.getElementById(f.data.id);L.data(f.data),L.classes(f.classes??"")}for(const f of o.edges)if(c.has(f.data.id??"")){const L=e.getElementById(f.data.id??"");L.data(f.data),L.classes(f.classes??"")}const d=o.nodes.filter(f=>!a.has(f.data.id)),p=o.edges.filter(f=>!c.has(f.data.id??""));if(0===d.length&&0===p.length)return;e.nodes().lock();const u=new Set(d.map(f=>f.data.id)),g=e.nodes();e.add([...d.map(f=>({group:"nodes",data:f.data,classes:f.classes??""})),...p.map(f=>({group:"edges",data:f.data,classes:f.classes??""}))]);const m=new Map;for(const f of p){const L=u.has(f.data.source),F=u.has(f.data.target??"");if(L&&!F){const P=e.getElementById(f.data.target??"");P.length>0&&!m.has(f.data.source)&&m.set(f.data.source,{...P.position()})}if(F&&!L){const P=e.getElementById(f.data.source);P.length>0&&!m.has(f.data.target)&&m.set(f.data.target,{...P.position()})}}const h=[];let C=0;if(e.nodes().filter(f=>u.has(f.id())).forEach(f=>{const L=this._positionCache.get(f.id());if(L)f.position(L),f.lock(),this._positionCache.delete(f.id());else{const F=m.get(f.id());if(F){const P=C++*(2*Math.PI/Math.max(d.length,1)),z=100+60*Math.random();f.position({x:F.x+z*Math.cos(P),y:F.y+z*Math.sin(P)})}else h.push(f)}}),h.length>0&&g.length>0){const f=g.boundingBox({}),L=(f.x1+f.x2)/2,F=(f.y1+f.y2)/2,P=Math.max(f.x2-f.x1,f.y2-f.y1)/2+180,z=2*Math.PI/Math.max(h.length,1);h.forEach((W,$)=>{W.position({x:L+P*Math.cos(z*$),y:F+P*Math.sin(z*$)})})}const _=this._container();if(_&&this.appendHTMLLabels()){const f=new V,L=this.labelPropsSettings();f.boxLabels={...L.boxLabels},f.props={display:!1,displayOnlyOnHover:L.props.displayOnlyOnHover},Q(e,_,f)}const N=e.layout({...this._layoutOptions(),randomize:!1,fit:!1,animate:!0});N.on("layoutstop",()=>e.nodes().unlock()),N.run()}_build(e){this._bodyObserver?.disconnect(),this._bodyObserver=void 0;const o=this._container(),n=o?this._resolveParentBg(o):D.backgroundColor,s={...D,directed:this.directed(),backgroundColor:n},a=J(s),c=this._nodesHavePosition()?{name:"preset",padding:100,animate:!1}:{...this._layoutOptions(),padding:80,animate:!1},d=e({container:this._container(),style:a,layout:c,elements:this._styledElements(),userZoomingEnabled:this.userZoomingEnabled(),userPanningEnabled:this.userPanningEnabled(),minZoom:.2,maxZoom:3});d.one("layoutstop",()=>{d.resize(),this._nodesHavePosition()||d.fit(void 0,60),d.center()}),this._cy.update(()=>d),this._startBodyObserver()}_setupClickHoverEvents(){const e=this._cy();if(null==e)return;let o=e.collection();e.nodes().unbind("tapstart"),e.nodes().bind("tapstart",n=>{const s=n.target.data();!s.isCollapser&&!s.isChainExpander&&this.contextMenuItems().length>0&&(n.originalEvent?.preventDefault(),n.originalEvent?.stopPropagation())}),e.nodes().unbind("click"),e.nodes().bind("click",n=>{const s=n.target,a=s.data();if(a.isCollapser||a.isChainExpander)return this.contextMenuVisible.set(!1),this.nodeClick.emit(a),void(o=o.union(s));if(this.selectableNodes()){const c=a.id;this.selectedNodeIds.update(d=>d.includes(c)?d.filter(p=>p!==c):[...d,c])}this.nodeClick.emit(a),o=o.union(s)}),e.nodes().unbind("cxttap"),e.nodes().bind("cxttap",n=>{if(!this.contextMenuItems().length)return;const s=n.target,a=s.data(),c=s.renderedPosition();this._contextMenuNode=a,this.contextMenuPos.set({x:c.x,y:c.y}),this.contextMenuVisible.set(!0),this.edgeContextMenuVisible.set(!1),this.nodeHover.emit(a)}),e.nodes().unbind("mouseover"),e.nodes().bind("mouseover",n=>{this._dimAllButNeighbors(n.target);const s=n.target.data();this.nodeHover.emit(s);const a=s.properties;if(this.labelPropsSettings().props.display&&a){const c=Object.entries(a).map(([d,p])=>({key:d,value:String(p)}));if(c.length>0){const d=n.target.renderedBoundingBox();this.hoverNodeOverlay.set({x:(d.x1+d.x2)/2,y:d.y2,entries:c})}}}),e.nodes().unbind("mouseout"),e.nodes().bind("mouseout",()=>{this._unDimAll(),this.nodeHover.emit(void 0),this.hoverNodeOverlay.set(null)}),e.nodes().unbind("drag"),e.nodes().bind("drag",n=>{if(null===this.hoverNodeOverlay())return;const s=n.target.renderedBoundingBox(),a=this.hoverNodeOverlay();this.hoverNodeOverlay.set({...a,x:(s.x1+s.x2)/2,y:s.y2})}),e.nodes().unbind("dragfree"),e.nodes().bind("dragfree",()=>{this.hoverNodeOverlay.set(null)}),e.edges().unbind("mouseover"),e.edges().bind("mouseover",n=>{n.target.addClass("edge-hover")}),e.edges().unbind("mouseout"),e.edges().bind("mouseout",n=>{n.target.removeClass("edge-hover")}),e.edges().unbind("tap"),e.edges().bind("tap",n=>{const s=n.target;if(this.selectableEdges()){const a=i._edgeKey(s.data("source"),s.data("target"));this.selectedEdgeIds.update(c=>c.includes(a)?c.filter(d=>d!==a):[...c,a])}}),e.edges().unbind("cxttap"),e.edges().bind("cxttap",n=>{if(!this.edgeContextMenuItems().length)return;const s=n.target,a=s.renderedMidpoint();this._edgeContextMenuLabel=s.data("label")??"",this._edgeContextMenuEdge={id:s.data("id"),iri:s.data("iri"),label:s.data("label"),source:s.data("source"),target:s.data("target"),color:s.data("color"),width:s.data("width")},this.edgeContextMenuPos.set({x:a.x,y:a.y}),this.edgeContextMenuVisible.set(!0),this.contextMenuVisible.set(!1)}),e.off("click"),e.on("click",n=>{0===Object.keys(n.target.data()).length&&(this.contextMenuVisible.set(!1),this.edgeContextMenuVisible.set(!1),this.canvasClick.emit())}),e.off("viewport"),e.on("viewport",()=>{this.contextMenuVisible.set(!1),this.edgeContextMenuVisible.set(!1)})}_onContextMenuAction(e){this.contextMenuVisible.set(!1),this._contextMenuNode&&this.contextMenuAction.emit({actionId:e,node:this._contextMenuNode})}_onEdgeContextMenuAction(e){this.edgeContextMenuVisible.set(!1),this.edgeContextMenuAction.emit({actionId:e,edgeLabel:this._edgeContextMenuLabel,edge:this._edgeContextMenuEdge})}_layoutOptions(){const e=this.layout();if("cose-bilkent"!==e)return{name:e};const o=this.elements().nodes,n=this.elements().edges,s=o.length>0?2*n.length/o.length:1,a=o.map(_=>{const L=[_.data.label||"",..._.data.boxLabels||[]].filter(Boolean);return Math.max(...L.map(F=>F.length),0)}),c=a.length>0?a.reduce((_,N)=>_+N,0)/a.length:0,d=a.length>0?Math.max(...a):0,u=1.5*c,g=.8*Math.max(0,d-20),m=7.2*s;return{name:"cose-bilkent",nodeDimensionsIncludeLabels:!0,randomize:!0,nodeRepulsion:Math.round(4500+500*s),idealEdgeLength:Math.round(48+u+g+m),edgeElasticity:.45,gravity:.25,gravityRange:3.8,numIter:2500}}_nodesHavePosition(){return void 0!==this.elements().nodes.find(o=>void 0!==o.position)}fitTo(e,o=80){const n=this._cy();if(!n||0===e.length)return;let s=n.collection();for(const a of e){const c=n.getElementById(a);c.length>0&&(s=s.union(c))}0!==s.length&&n.animate({fit:{eles:s,padding:o},duration:400,easing:"ease-in-out-cubic"})}_unDimAll(){const e=this._cy();null!=e&&(e.elements().forEach(o=>{o.removeClass("faded")}),e.edges().removeClass("neighbor-hover"))}_dimAllButNeighbors(e){const o=this._cy();if(null==o)return;const n=e.neighborhood().map(s=>s.id());o.elements().forEach(s=>{n.includes(s.id())||s.id()===e.id()?s.removeClass("faded"):s.addClass("faded")}),e.connectedEdges().addClass("neighbor-hover")}static \u0275fac=function(o){return new(o||i)};static \u0275cmp=t.VBU({type:i,selectors:[["cue-simple-graph"]],viewQuery:function(o,n){if(1&o&&t.GBs(_e,5),2&o){let s;t.mGM(s=t.lsd())&&(n.graphContainer=s.first)}},inputs:{elements:[1,"elements"],animate:[1,"animate"],stopAnimationAfterFirstNodeHover:[1,"stopAnimationAfterFirstNodeHover"],layout:[1,"layout"],highlightNeighborsOnHover:[1,"highlightNeighborsOnHover"],userZoomingEnabled:[1,"userZoomingEnabled"],userPanningEnabled:[1,"userPanningEnabled"],appendHTMLLabels:[1,"appendHTMLLabels"],directed:[1,"directed"],labelPropsSettings:[1,"labelPropsSettings"],contextMenuItems:[1,"contextMenuItems"],edgeContextMenuItems:[1,"edgeContextMenuItems"],selectableNodes:[1,"selectableNodes"],selectableEdges:[1,"selectableEdges"],selectedNodeIds:[1,"selectedNodeIds"],selectedEdgeIds:[1,"selectedEdgeIds"]},outputs:{selectedNodeIds:"selectedNodeIdsChange",selectedEdgeIds:"selectedEdgeIdsChange",nodeHover:"nodeHover",nodeClick:"nodeClick",canvasClick:"canvasClick",contextMenuAction:"contextMenuAction",edgeContextMenuAction:"edgeContextMenuAction"},decls:5,vars:3,consts:[["graphContainer",""],["id","graph","cueResized","",3,"resized"],[1,"node-props-overlay",3,"left","top"],[1,"cy-context-menu",3,"left","top"],[1,"node-props-overlay"],[1,"prop-row"],[1,"prop-key"],[1,"prop-value"],[1,"cy-context-menu"],[1,"cy-context-item"],[1,"cy-context-item",3,"mousedown","click"]],template:function(o,n){if(1&o&&(t.j41(0,"div",1,0),t.bIt("resized",function(){return n.onResize()}),t.nVh(2,be,3,4,"div",2),t.nVh(3,Ce,3,4,"div",3),t.nVh(4,xe,3,4,"div",3),t.k0s()),2&o){let s;t.R7$(2),t.vxM((s=n.hoverNodeOverlay())?2:-1,s),t.R7$(),t.vxM(n.contextMenuVisible()&&n.contextMenuItems().length>0?3:-1),t.R7$(),t.vxM(n.edgeContextMenuVisible()&&n.edgeContextMenuItems().length>0?4:-1)}},dependencies:[ge.C],styles:["[_nghost-%COMP%]{display:contents}#graph[_ngcontent-%COMP%]{display:block!important;text-align:left!important;margin:0!important;min-height:100px;flex:1 1;width:100%;position:relative;overflow:hidden} .box-label{position:absolute;pointer-events:none;display:flex;flex-direction:column;align-items:flex-start;gap:4px}.node-props-overlay[_ngcontent-%COMP%]{position:absolute;transform:translate(-50%,8px);z-index:20;pointer-events:none;background:var(--cue-menu-background-color);color:var(--cue-menu-foreground-color);border:1px solid var(--cue-menu-border-color);border-radius:var(--cue-menu-border-radius);box-shadow:var(--cue-menu-box-shadow);padding:var(--cue-menu-padding-y) var(--cue-menu-padding-x);display:flex;flex-direction:column;gap:8px;min-width:140px;max-width:260px}.prop-row[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2px}.prop-key[_ngcontent-%COMP%]{font-family:Poppins,sans-serif;font-size:.6rem;font-weight:600;color:var(--cue-neutral);text-transform:uppercase;letter-spacing:.05em}.prop-value[_ngcontent-%COMP%]{font-family:Poppins,sans-serif;font-size:.72rem;color:var(--cue-menu-foreground-color);overflow:hidden;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical}.cy-context-menu[_ngcontent-%COMP%]{position:absolute;z-index:30;background:var(--cue-menu-background-color);color:var(--cue-menu-foreground-color);border:1px solid var(--cue-menu-border-color);border-radius:var(--cue-menu-border-radius);box-shadow:var(--cue-menu-box-shadow);padding:4px 0;min-width:160px;display:flex;flex-direction:column}.cy-context-item[_ngcontent-%COMP%]{background:none;border:none;padding:8px 16px;text-align:left;font-family:Poppins,sans-serif;font-size:.8rem;color:var(--cue-menu-foreground-color);cursor:pointer}.cy-context-item[_ngcontent-%COMP%]:hover{background:var(--cue-menu-hover-color, rgba(0, 0, 0, .06))}"],changeDetection:0})}return i})();const oe=["#2859e1","#4caf50","#fc2626","#f59e0b","#8b5cf6","#06b6d4","#f97316","#14b8a6","#ec4899","#6366f1"],ee="__collapser__",Z="__chain__";var Le=y(29134),ke=y(56034),we=y(57517),De=y(16455),Te=y(68334),j=y(59352),de=y(85971),Pe=y(75448),le=y(13319),Re=y(65187),re=y(42245),Ae=y(35381),Fe=y(21359),Ge=y(58957);const Be=(i,l)=>({$implicit:i,depth:0,siblingsHaveChildren:l}),Oe=(i,l,e)=>({$implicit:i,depth:l,siblingsHaveChildren:e}),ce=(i,l)=>l.id;function je(i,l){if(1&i){const e=t.RV6();t.j41(0,"cue-input",5),t.mxI("valueChange",function(n){r.eBV(e);const s=t.XpG();return t.DH7(s.searchTerm,n)||(s.searchTerm=n),r.Njj(n)}),t.k0s()}if(2&i){const e=t.XpG();t.R50("value",e.searchTerm)}}function Se(i,l){1&i&&t.nrm(0,"span",6)}function He(i,l){if(1&i){const e=t.RV6();t.j41(0,"cue-flexcontainer",3),t.nVh(1,Se,1,0,"span",6),t.j41(2,"cue-checkbox",7),t.bIt("checkedChange",function(){r.eBV(e);const n=t.XpG();return r.Njj(n.toggleAll())}),t.k0s(),t.j41(3,"cue-typography",8),t.bIt("click",function(){r.eBV(e);const n=t.XpG();return r.Njj(n.toggleAll())}),t.EFF(4),t.k0s()()}if(2&i){const e=t.XpG();t.R7$(),t.vxM(e._rootHasChildren()?1:-1),t.R7$(),t.Y8G("checked",e._allChecked())("indeterminate",e._allIndeterminate()),t.R7$(2),t.JRh(e.selectAllLabel())}}function Ve(i,l){if(1&i&&t.eu8(0,4),2&i){const e=l.$implicit,o=t.XpG(),n=t.sdS(6);t.Y8G("ngTemplateOutlet",n)("ngTemplateOutletContext",t.l_i(2,Be,e,o._rootHasChildren()))}}function ze(i,l){if(1&i){const e=t.RV6();t.j41(0,"cue-button",13),t.bIt("click",function(){r.eBV(e);const n=t.XpG().$implicit,s=t.XpG();return r.Njj(s.toggleExpand(n.id))}),t.j41(1,"span",14),t.nrm(2,"cue-button-icon",15),t.k0s()()}if(2&i){const e=t.XpG().$implicit,o=t.XpG();t.R7$(),t.AVh("rotate-180",o.isExpanded(e.id))}}function $e(i,l){1&i&&t.nrm(0,"span",6)}function Xe(i,l){if(1&i&&t.eu8(0,4),2&i){const e=l.$implicit,o=t.XpG(2),n=o.$implicit,s=o.depth,a=t.XpG(),c=t.sdS(6);t.Y8G("ngTemplateOutlet",c)("ngTemplateOutletContext",t.sMw(2,Oe,e,s+1,a._listHasChildren(n.children)))}}function We(i,l){if(1&i&&t.Z7z(0,Xe,1,6,"ng-container",4,ce),2&i){const e=t.XpG().$implicit,o=t.XpG();t.Dyx(o._sortChildren(e.children))}}function Ue(i,l){if(1&i){const e=t.RV6();t.j41(0,"cue-flexcontainer",9),t.nVh(1,ze,3,2,"cue-button",10)(2,$e,1,0,"span",6),t.j41(3,"cue-checkbox",11),t.bIt("checkedChange",function(){const n=r.eBV(e).$implicit,s=t.XpG();return r.Njj(s.toggle(n))}),t.k0s(),t.j41(4,"cue-typography",12),t.bIt("click",function(){const n=r.eBV(e).$implicit,s=t.XpG();return r.Njj(s.toggle(n))}),t.EFF(5),t.k0s()(),t.nVh(6,We,2,0)}if(2&i){const e=l.$implicit,o=l.depth,n=l.siblingsHaveChildren,s=t.XpG();t.xc7("padding-left",16*o,"px"),t.R7$(),t.vxM(null!=e.children&&e.children.length?1:n?2:-1),t.R7$(2),t.Y8G("checked",s.isChecked(e))("indeterminate",s.isIndeterminate(e))("color",e.color),t.R7$(2),t.JRh(e.label),t.R7$(),t.vxM(null!=e.children&&e.children.length&&s.isExpanded(e.id)?6:-1)}}let Ze=(()=>{class i{nodes=(0,b.hFB)([]);uncheckedIds=(0,b.geq)(new Set);selectAllLabel=(0,b.hFB)("All");searchThreshold=(0,b.hFB)(10);searchTerm=(0,r.vPA)("");_expandedIds=(0,r.vPA)(new Set);_seenBranchIds=new Set;_initExpanded=(0,r.QZP)(()=>{const e=new Set,o=n=>{for(const s of n)s.children?.length&&(e.add(s.id),o(s.children))};o(this.nodes()),this._expandedIds.update(n=>{const s=new Set;return e.forEach(a=>{(n.has(a)||!this._seenBranchIds.has(a))&&s.add(a)}),s}),this._seenBranchIds=e});_countAll(e){return e.reduce((o,n)=>o+1+(n.children?this._countAll(n.children):0),0)}_showSearch=(0,x.EW)(()=>this._countAll(this.nodes())>this.searchThreshold());_matches(e,o){return!!e.label.toLowerCase().includes(o)||!!e.children?.some(n=>this._matches(n,o))}_filterTree(e,o){return e.filter(n=>this._matches(n,o)).map(n=>n.children?{...n,children:this._filterTree(n.children,o)}:n)}_filteredNodes=(0,x.EW)(()=>{const e=this.searchTerm().trim().toLowerCase();return e?this._filterTree(this.nodes(),e):this.nodes()});_sortedNodes=(0,x.EW)(()=>this._sortChildren(this._filteredNodes()));_listHasChildren(e){return!!e?.some(o=>o.children?.length)}_rootHasChildren=(0,x.EW)(()=>this._listHasChildren(this.nodes()));_sortChildren(e){return e?[...e].sort((o,n)=>n.weight-o.weight):[]}isExpanded(e){return!!this.searchTerm().trim()||this._expandedIds().has(e)}toggleExpand(e){this._expandedIds.update(o=>{const n=new Set(o);return n.has(e)?n.delete(e):n.add(e),n})}_descendantIds(e){const o=[e.id];return e.children?.forEach(n=>o.push(...this._descendantIds(n))),o}_allIds(e){return e.flatMap(o=>this._descendantIds(o))}_allChecked=(0,x.EW)(()=>{const e=this._allIds(this.nodes());if(0===e.length)return!0;const o=this.uncheckedIds();return e.every(n=>!o.has(n))});_allIndeterminate=(0,x.EW)(()=>{const e=this._allIds(this.nodes());if(0===e.length)return!1;const o=this.uncheckedIds(),n=e.filter(s=>o.has(s)).length;return n>0&&n<e.length});toggleAll(){const e=this._allIds(this.nodes()),o=this._allChecked();this.uncheckedIds.update(n=>{const s=new Set(n);return e.forEach(a=>o?s.add(a):s.delete(a)),s})}isChecked(e){const o=this.uncheckedIds();return this._descendantIds(e).every(n=>!o.has(n))}isIndeterminate(e){if(!e.children?.length)return!1;const o=this._descendantIds(e),n=this.uncheckedIds(),s=o.filter(a=>n.has(a)).length;return s>0&&s<o.length}toggle(e){const o=this._descendantIds(e),n=this.isChecked(e);this.uncheckedIds.update(s=>{const a=new Set(s);return o.forEach(c=>n?a.add(c):a.delete(c)),a})}static \u0275fac=function(o){return new(o||i)};static \u0275cmp=t.VBU({type:i,selectors:[["cue-tree-checklist"]],inputs:{nodes:[1,"nodes"],uncheckedIds:[1,"uncheckedIds"],selectAllLabel:[1,"selectAllLabel"],searchThreshold:[1,"searchThreshold"]},outputs:{uncheckedIds:"uncheckedIdsChange"},decls:7,vars:2,consts:[["row",""],["direction","column","gap","xs",2,"width","100%"],["icon","search","placeholder","Search\u2026","size","xs",1,"tc-search",3,"value"],["align","center","justify","start","gap","xs",1,"tc-select-all",2,"width","100%"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],["icon","search","placeholder","Search\u2026","size","xs",1,"tc-search",3,"valueChange","value"],[1,"tc-spacer"],["size","s",3,"checkedChange","checked","indeterminate"],["weight","semibold",2,"cursor","pointer",3,"click"],["align","center","justify","start","gap","xs",2,"width","100%"],["variant","ghost","size","xs"],["size","s",3,"checkedChange","checked","indeterminate","color"],[2,"cursor","pointer",3,"click"],["variant","ghost","size","xs",3,"click"],[1,"tc-caret"],["icon","arrow-dropdown"]],template:function(o,n){1&o&&(t.j41(0,"cue-flexcontainer",1),t.nVh(1,je,1,1,"cue-input",2),t.nVh(2,He,5,4,"cue-flexcontainer",3),t.Z7z(3,Ve,1,5,"ng-container",4,ce),t.k0s(),t.DNE(5,Ue,7,8,"ng-template",null,0,t.C5r)),2&o&&(t.R7$(),t.vxM(n._showSearch()?1:-1),t.R7$(),t.vxM(n._sortedNodes().length>0?2:-1),t.R7$(),t.Dyx(n._sortedNodes()))},dependencies:[Ae.FlexContainer,re.Typography,Fe.Checkbox,Ge.Input,de.Button,le.ButtonIcon,S.T3],styles:["[_nghost-%COMP%]{display:block;width:100%}.tc-spacer[_ngcontent-%COMP%]{display:inline-block;width:24px;flex:0 0 auto}.tc-caret[_ngcontent-%COMP%]{display:inline-flex;transition:transform .15s ease}.tc-caret.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.tc-select-all[_ngcontent-%COMP%]{padding-bottom:4px;margin-bottom:2px;border-bottom:1px solid var(--cue-border-color)}.tc-search[_ngcontent-%COMP%]{margin-bottom:4px}"],changeDetection:0})}return i})();function Ye(i,l){if(1&i){const e=t.RV6();t.j41(0,"cue-button",6),t.bIt("click",function(){r.eBV(e);const n=t.XpG(2);return r.Njj(n._fullscreenOpen.set(!n._fullscreenOpen()))}),t.nrm(1,"cue-button-icon",7),t.j41(2,"cue-button-label"),t.EFF(3),t.nI1(4,"transloco"),t.k0s()()}if(2&i){const e=t.XpG(2);t.xc7("position","absolute")("top","0.5rem")("left","0.5rem")("z-index",41),t.R7$(),t.Y8G("icon",e._fullscreenOpen()?"close":"fullscreen"),t.R7$(2),t.JRh(t.bMT(4,10,e._fullscreenOpen()?"components.graph.rdf.labelExitFullscreen":"components.graph.rdf.labelFullscreen"))}}function Qe(i,l){if(1&i){const e=t.RV6();t.j41(0,"cue-simple-graph",8),t.mxI("selectedNodeIdsChange",function(n){r.eBV(e);const s=t.XpG(2);return t.DH7(s.selectedNodeIds,n)||(s.selectedNodeIds=n),r.Njj(n)})("selectedEdgeIdsChange",function(n){r.eBV(e);const s=t.XpG(2);return t.DH7(s.selectedEdgeIds,n)||(s.selectedEdgeIds=n),r.Njj(n)}),t.bIt("nodeHover",function(n){r.eBV(e);const s=t.XpG(2);return r.Njj(s._onNodeHover(n))})("nodeClick",function(n){r.eBV(e);const s=t.XpG(2);return r.Njj(s._onNodeClick(n))})("canvasClick",function(){r.eBV(e);const n=t.XpG(2);return r.Njj(n._onCanvasClick())})("contextMenuAction",function(n){r.eBV(e);const s=t.XpG(2);return r.Njj(s._onContextMenuAction(n))})("edgeContextMenuAction",function(n){r.eBV(e);const s=t.XpG(2);return r.Njj(s._onEdgeContextMenuAction(n))}),t.k0s()}if(2&i){const e=t.XpG(2);t.Y8G("elements",l)("labelPropsSettings",e.labelPropsSettings())("contextMenuItems",e._nodeMenuItems())("edgeContextMenuItems",e._edgeMenuItems())("selectableNodes",e.selectableNodes())("selectableEdges",e.selectableEdges()),t.R50("selectedNodeIds",e.selectedNodeIds)("selectedEdgeIds",e.selectedEdgeIds)}}function Je(i,l){1&i&&t.EFF(0," No elements ")}function Ke(i,l){if(1&i){const e=t.RV6();t.j41(0,"button",21),t.bIt("click",function(){r.eBV(e);const n=t.XpG(4);return r.Njj(n._entitiesPanelExpanded.set(!n._entitiesPanelExpanded()))}),t.EFF(1),t.nI1(2,"transloco"),t.k0s()}if(2&i){const e=t.XpG(4);t.AVh("active",e._entitiesPanelExpanded()),t.R7$(),t.SpI(" ",t.bMT(2,3,"components.graph.rdf.legendEntities")," ")}}function qe(i,l){if(1&i){const e=t.RV6();t.j41(0,"button",21),t.bIt("click",function(){r.eBV(e);const n=t.XpG(4);return r.Njj(n._relationsPanelExpanded.set(!n._relationsPanelExpanded()))}),t.EFF(1),t.nI1(2,"transloco"),t.k0s()}if(2&i){const e=t.XpG(4);t.AVh("active",e._relationsPanelExpanded()),t.R7$(),t.SpI(" ",t.bMT(2,3,"components.graph.rdf.legendRelationships")," ")}}function et(i,l){if(1&i){const e=t.RV6();t.j41(0,"cue-card",19)(1,"div",22)(2,"cue-typography",23),t.EFF(3),t.nI1(4,"transloco"),t.k0s(),t.j41(5,"button",24),t.nI1(6,"transloco"),t.nI1(7,"transloco"),t.bIt("click",function(){r.eBV(e);const n=t.XpG(4);return r.Njj(n._invertCategorySelection())}),t.nrm(8,"cue-button-icon",25),t.k0s()(),t.j41(9,"cue-tree-checklist",26),t.nI1(10,"transloco"),t.bIt("uncheckedIdsChange",function(n){r.eBV(e);const s=t.XpG(4);return r.Njj(s._onCategoryTreeChange(n))}),t.k0s()()}if(2&i){const e=t.XpG(4);t.Y8G("shadow",!1),t.R7$(3),t.JRh(t.bMT(4,7,"components.graph.rdf.legendEntities")),t.R7$(2),t.BMQ("aria-label",t.bMT(6,9,"components.graph.rdf.labelInvertSelection"))("title",t.bMT(7,11,"components.graph.rdf.labelInvertSelection")),t.R7$(4),t.Y8G("nodes",e._categoryTree())("uncheckedIds",e._categoryUncheckedIds())("selectAllLabel",t.bMT(10,13,"components.graph.rdf.legendSelectAll"))}}function tt(i,l){if(1&i){const e=t.RV6();t.j41(0,"cue-card",19)(1,"div",22)(2,"cue-typography",23),t.EFF(3),t.nI1(4,"transloco"),t.k0s(),t.j41(5,"button",24),t.nI1(6,"transloco"),t.nI1(7,"transloco"),t.bIt("click",function(){r.eBV(e);const n=t.XpG(4);return r.Njj(n._invertPredicateSelection())}),t.nrm(8,"cue-button-icon",25),t.k0s()(),t.j41(9,"cue-tree-checklist",26),t.nI1(10,"transloco"),t.bIt("uncheckedIdsChange",function(n){r.eBV(e);const s=t.XpG(4);return r.Njj(s._onPredicateTreeChange(n))}),t.k0s()()}if(2&i){const e=t.XpG(4);t.Y8G("shadow",!1),t.R7$(3),t.JRh(t.bMT(4,7,"components.graph.rdf.legendRelationships")),t.R7$(2),t.BMQ("aria-label",t.bMT(6,9,"components.graph.rdf.labelInvertSelection"))("title",t.bMT(7,11,"components.graph.rdf.labelInvertSelection")),t.R7$(4),t.Y8G("nodes",e._relationshipTree())("uncheckedIds",e._predicateUncheckedIds())("selectAllLabel",t.bMT(10,13,"components.graph.rdf.legendSelectAll"))}}function nt(i,l){if(1&i){const e=t.RV6();t.j41(0,"cue-button",27),t.bIt("click",function(){r.eBV(e);const n=t.XpG(4);return r.Njj(n._resetAllFilters())}),t.j41(1,"cue-button-label"),t.EFF(2),t.nI1(3,"transloco"),t.k0s()()}2&i&&(t.R7$(2),t.JRh(t.bMT(3,1,"components.graph.rdf.labelResetFilters")))}function ot(i,l){if(1&i){const e=t.RV6();t.j41(0,"div",9)(1,"div",11)(2,"button",12),t.nI1(3,"transloco"),t.bIt("click",function(){r.eBV(e);const n=t.XpG(3);return r.Njj(n._hierarchyPanelOpen.set(!n._hierarchyPanelOpen()))}),t.j41(4,"span",13),t.nrm(5,"cue-button-icon",14),t.k0s()(),t.j41(6,"div",15)(7,"div",16),t.nVh(8,Ke,3,5,"button",17),t.nVh(9,qe,3,5,"button",17),t.k0s(),t.j41(10,"div",18),t.nVh(11,et,11,15,"cue-card",19),t.nVh(12,tt,11,15,"cue-card",19),t.k0s(),t.nVh(13,nt,4,3,"cue-button",20),t.k0s()()()}if(2&i){const e=t.XpG(3);t.R7$(),t.AVh("collapsed",!e._hierarchyPanelOpen()),t.R7$(),t.BMQ("aria-label",t.bMT(3,10,"components.graph.rdf.legendTitle")),t.R7$(2),t.AVh("rotate-180",e._hierarchyPanelOpen()),t.R7$(4),t.vxM(e._categoryTree().length>0?8:-1),t.R7$(),t.vxM(e._relationshipTree().length>0?9:-1),t.R7$(2),t.vxM(e._categoryTree().length>0&&e._entitiesPanelExpanded()?11:-1),t.R7$(),t.vxM(e._relationshipTree().length>0&&e._relationsPanelExpanded()?12:-1),t.R7$(),t.vxM(e._hasActiveFilters()?13:-1)}}function st(i,l){if(1&i){const e=t.RV6();t.j41(0,"cue-draggable-card",28),t.nI1(1,"transloco"),t.bIt("clickedClose",function(){r.eBV(e);const n=t.XpG(3);return r.Njj(n._tabbedLegendClosed.set(!0))}),t.j41(2,"cue-tabs",29)(3,"cue-tab",30),t.nI1(4,"transloco"),t.j41(5,"div",31)(6,"cue-layer-legend",32),t.bIt("visibilityAll",function(n){r.eBV(e);const s=t.XpG(3);return r.Njj(s._onCategoryVisibilityAll(n))})("layerChange",function(n){r.eBV(e);const s=t.XpG(3);return r.Njj(s._onCategoryLayerChange(n))}),t.k0s()()(),t.j41(7,"cue-tab",30),t.nI1(8,"transloco"),t.j41(9,"div",31)(10,"cue-layer-legend",32),t.bIt("visibilityAll",function(n){r.eBV(e);const s=t.XpG(3);return r.Njj(s._onPredicateVisibilityAll(n))})("layerChange",function(n){r.eBV(e);const s=t.XpG(3);return r.Njj(s._onPredicateLayerChange(n))}),t.k0s()()()()()}if(2&i){const e=t.XpG(3);t.Y8G("label",t.bMT(1,7,"components.graph.rdf.legendTitle"))("padded",!1)("position",e.legendPosition()),t.R7$(3),t.Y8G("label",t.bMT(4,9,"components.graph.rdf.legendEntities")),t.R7$(3),t.Y8G("layers",e._categoryLayers()),t.R7$(),t.Y8G("label",t.bMT(8,11,"components.graph.rdf.legendRelationships")),t.R7$(3),t.Y8G("layers",e._predicateLayers())}}function it(i,l){if(1&i){const e=t.RV6();t.j41(0,"cue-color-legend-panel",34),t.nI1(1,"transloco"),t.bIt("close",function(){r.eBV(e);const n=t.XpG(4);return r.Njj(n._legendClosed.set(!0))})("layerChange",function(n){r.eBV(e);const s=t.XpG(4);return r.Njj(s._onCategoryLayerChange(n))})("visibilityAll",function(n){r.eBV(e);const s=t.XpG(4);return r.Njj(s._onCategoryVisibilityAll(n))}),t.k0s()}if(2&i){const e=t.XpG(4);t.Y8G("title",t.bMT(1,2,"components.graph.rdf.legendCategories"))("layers",e._categoryLayers())}}function at(i,l){if(1&i){const e=t.RV6();t.j41(0,"cue-button",37),t.bIt("click",function(){r.eBV(e);const n=t.XpG(5);return r.Njj(n._unhideAllPredicates())}),t.j41(1,"cue-button-label"),t.EFF(2),t.nI1(3,"transloco"),t.k0s()()}2&i&&(t.xc7("position","absolute")("top","2.5rem")("right","0.5rem"),t.R7$(2),t.JRh(t.bMT(3,7,"components.graph.rdf.labelUnhideEdges")))}function dt(i,l){if(1&i){const e=t.RV6();t.j41(0,"cue-color-legend-panel",35),t.nI1(1,"transloco"),t.bIt("close",function(){r.eBV(e);const n=t.XpG(4);return r.Njj(n._predicateLegendClosed.set(!0))})("layerChange",function(n){r.eBV(e);const s=t.XpG(4);return r.Njj(s._onPredicateLayerChange(n))})("visibilityAll",function(n){r.eBV(e);const s=t.XpG(4);return r.Njj(s._onPredicateVisibilityAll(n))}),t.k0s(),t.nVh(2,at,4,9,"cue-button",36)}if(2&i){const e=t.XpG(4);t.Y8G("title",t.bMT(1,4,"components.graph.rdf.legendRelationships"))("layers",e._predicateLayers())("position",e.legendPosition()),t.R7$(2),t.vxM(e._anyPredicateHidden()?2:-1)}}function lt(i,l){if(1&i&&(t.nVh(0,it,2,4,"cue-color-legend-panel",33),t.nVh(1,dt,3,6)),2&i){const e=t.XpG(3);t.vxM(e.colorByCategory()&&e._categoryLayers().length>0&&!e._legendClosed()?0:-1),t.R7$(),t.vxM(e.showRelationshipLegend()&&e._predicateLayers().length>0&&!e._predicateLegendClosed()?1:-1)}}function rt(i,l){if(1&i&&t.nVh(0,ot,14,12,"div",9)(1,st,11,13,"cue-draggable-card",10)(2,lt,2,2),2&i){const e=t.XpG(2);t.vxM(e._hasHierarchyData()?0:e.tabbedLegend()&&!e._tabbedLegendClosed()?1:2)}}function ct(i,l){if(1&i){const e=t.RV6();t.j41(0,"cue-button",38),t.bIt("click",function(){r.eBV(e);const n=t.XpG(2);return r.Njj(n._resetIsolation())}),t.j41(1,"cue-button-label"),t.EFF(2),t.nI1(3,"transloco"),t.k0s()()}2&i&&(t.xc7("position","absolute")("bottom","0.5rem")("right","0.5rem"),t.R7$(2),t.JRh(t.bMT(3,7,"components.graph.rdf.labelResetIsolation")))}function ut(i,l){if(1&i&&(t.j41(0,"div",2),t.nVh(1,Ye,5,12,"cue-button",3),t.nVh(2,Qe,1,8,"cue-simple-graph",4)(3,Je,1,0),t.nVh(4,rt,3,1),t.nVh(5,ct,4,9,"cue-button",5),t.k0s()),2&i){let e,o;const n=t.XpG();t.R7$(),t.vxM(n.fullscreenEnabled()?1:-1),t.R7$(),t.vxM((e=n.elements())?2:3,e),t.R7$(2),t.vxM(n._legendVisible()?4:-1),t.R7$(),t.vxM((o=n._isolatedNodeId())?5:-1,o)}}function ht(i,l){1&i&&t.eu8(0)}function pt(i,l){if(1&i){const e=t.RV6();t.j41(0,"cue-modal",39),t.bIt("close",function(){r.eBV(e);const n=t.XpG();return r.Njj(n._fullscreenOpen.set(!1))}),t.DNE(1,ht,1,0,"ng-container",40),t.k0s()}if(2&i){t.XpG();const e=t.sdS(1);t.Y8G("visible",!0)("displayCloseBtn",!1),t.R7$(),t.Y8G("ngTemplateOutlet",e)}}function gt(i,l){1&i&&t.eu8(0)}function _t(i,l){if(1&i&&t.DNE(0,gt,1,0,"ng-container",40),2&i){t.XpG();const e=t.sdS(1);t.Y8G("ngTemplateOutlet",e)}}let ft=(()=>{class i{_graph=(0,b.ebz)(q);doc=(0,b.hFB)();collapseClasses=(0,b.hFB)(!0);collapseAttributes=(0,b.hFB)(!0);collapseRelationships=(0,b.hFB)(!0);classPredicates=(0,b.hFB)([]);focusNodes=(0,b.hFB)([]);focusNodeColor=(0,b.hFB)("red");zoomToFocusNodes=(0,b.hFB)(!1);colorByCategory=(0,b.hFB)(!1);showRelationshipLegend=(0,b.hFB)(!1);legendPosition=(0,b.hFB)("top-left");tabbedLegend=(0,b.hFB)(!1);categoryLabelsOnHover=(0,b.hFB)(!0);showFocusMenuItem=(0,b.hFB)(!0);nodeMenuItems=(0,b.hFB)(void 0);edgeMenuItems=(0,b.hFB)(void 0);edgeWidths=(0,b.hFB)({});nodeSizes=(0,b.hFB)({});nodeColors=(0,b.hFB)({});categoryHierarchy=(0,b.hFB)([]);relationshipHierarchy=(0,b.hFB)([]);fullscreenEnabled=(0,b.hFB)(!1);legendAlwaysVisible=(0,b.hFB)(!1);selectableNodes=(0,b.hFB)(!1);selectableEdges=(0,b.hFB)(!1);selectedNodeIds=(0,b.geq)([]);selectedEdgeIds=(0,b.geq)([]);_fullscreenOpen=(0,r.vPA)(!1);_legendVisible=(0,x.EW)(()=>this.legendAlwaysVisible()||!this.fullscreenEnabled()||this._fullscreenOpen());nodeHover=(0,b.CGW)();nodeClick=(0,b.CGW)();canvasClick=(0,b.CGW)();_fullElements=null;_collapserGroups=[];_chainGroups=[];_focusedNodeId=void 0;_hiddenNodeIds=new Set;_categoryColors=new Map;_labelFocusOnNeighbours=(0,j.Xx)("components.graph.rdf.labelFocusOnNeighbours");_labelIsolateNode=(0,j.Xx)("components.graph.rdf.labelIsolateNode");_labelUnhideEdges=(0,j.Xx)("components.graph.rdf.labelUnhideEdges");_labelHideEdgeType=(0,j.Xx)("components.graph.rdf.labelHideEdgeType");_labelCollapseRelationship=(0,j.Xx)("components.graph.rdf.labelCollapseRelationship");_labelExpandMore=(0,j.Xx)("components.graph.rdf.labelExpandMore");_labelCollapseExpanded=(0,j.Xx)("components.graph.rdf.labelCollapseExpanded");_hoveredNode=(0,r.vPA)(null);_isolatedNodeId=(0,r.vPA)(void 0);_nodeMenuItems=(0,x.EW)(()=>{const e=this.nodeMenuItems();if(void 0!==e)return e;const o=this._hoveredNode()?.id,n=!!o&&this._collapserGroups.some(g=>g.allTargetNodeIds.includes(o)),s=o?this._collapserGroups.find(g=>g.id===o):void 0,a=!!s&&s.visibleCount>0,c=!!s&&s.visibleCount<s.allTargetNodeIds.length,d=o?this._chainGroups.find(g=>g.id===o):void 0,p=!!d&&d.visibleCount>0,u=!!d&&d.visibleCount<d.hiddenNodeIds.length;return[...this.showFocusMenuItem()?[{id:"focus",label:this._labelFocusOnNeighbours()}]:[],{id:"isolate",label:this._labelIsolateNode()},...this._anyPredicateHidden()?[{id:"unhide-edges",label:this._labelUnhideEdges()}]:[],...c||u?[{id:"expand-more",label:this._labelExpandMore()}]:[],...a||p?[{id:"collapse-expanded",label:this._labelCollapseExpanded()}]:[],...n?[{id:"collapse-relationship",label:this._labelCollapseRelationship()}]:[]]});_edgeMenuItems=(0,x.EW)(()=>{const e=this.edgeMenuItems();return void 0!==e?e:[{id:"hide-edge-type",label:this._labelHideEdgeType()}]});elements=(0,r.vPA)(void 0);_survivingCategoryLabels=(0,r.vPA)(new Set);_survivingPredicateLabels=(0,r.vPA)(new Set);_categoryLayers=(0,r.vPA)([]);_legendClosed=(0,r.vPA)(!1);_predicateLayers=(0,r.vPA)([]);_predicateLegendClosed=(0,r.vPA)(!1);_nodeLayers=(0,r.vPA)([]);_tabbedLegendClosed=(0,r.vPA)(!1);_entitiesPanelExpanded=(0,r.vPA)(!0);_relationsPanelExpanded=(0,r.vPA)(!0);_hierarchyPanelOpen=(0,r.vPA)(!0);_anyPredicateHidden=(0,x.EW)(()=>this._predicateLayers().some(e=>!e.visible));_hasHierarchyData=(0,x.EW)(()=>this.categoryHierarchy().length>0||this.relationshipHierarchy().length>0);_categoryLayersActive=(0,x.EW)(()=>this._categoryLayers().length>0);_effectiveCategoryLayers=(0,x.EW)(()=>this._categoryLayersActive()?this._categoryLayers():this._nodeLayers());_categoryTree=(0,x.EW)(()=>this._buildHierarchyTree(this._effectiveCategoryLayers(),this.categoryHierarchy()));_relationshipTree=(0,x.EW)(()=>this._buildHierarchyTree(this._predicateLayers(),this.relationshipHierarchy()));_categoryUncheckedIds=(0,x.EW)(()=>this._uncheckedGroupIds(this._effectiveCategoryLayers(),this._survivingCategoryLabels()));_predicateUncheckedIds=(0,x.EW)(()=>this._uncheckedGroupIds(this._predicateLayers(),this._survivingPredicateLabels()));_hasActiveFilters=(0,x.EW)(()=>void 0!==this._isolatedNodeId()||this._categoryUncheckedIds().size>0||this._predicateUncheckedIds().size>0);_layerIdentity(e){return e.iri?e.iri.replace(/~\d+$/,""):e.label}_groupLayersByIdentity(e){const o=new Map;return e.forEach(n=>{const s=this._layerIdentity(n),a=o.get(s);a?a.push(n):o.set(s,[n])}),o}_uncheckedGroupIds(e,o){const n=new Set;return this._groupLayersByIdentity(e).forEach((s,a)=>{const c=s.every(p=>!p.visible),d=!s.some(p=>o.has(p.label));(c||d)&&n.add(a)}),n}_buildHierarchyTree(e,o){if(0===o.length)return[];const n=new Map(o.map(m=>[m.matchIri??m.label,m])),s=this._groupLayersByIdentity(e),a=new Map,c=[],d=new Set,u=m=>{if(d.has(m))return;d.add(m);const h=(m=>{let h=a.get(m);if(!h){const C=n.get(m),_=s.get(m);h={id:m,label:C?.label??_?.[0]?.label??m,weight:C?.weight??0,children:[]},a.set(m,h)}return h})(m),C=n.get(m)?.parentLabel,_=C?o.find(N=>N.label===C)?.matchIri??C:void 0;if(_&&_!==m){u(_);const N=a.get(_);N.children.includes(h)||N.children.push(h)}else c.push(h)};s.forEach((m,h)=>u(h));const g=m=>{const h=(m.children??[]).reduce((C,_)=>C+g(_),0);return m.children?.length||delete m.children,m.weight+=h,m.weight};return c.forEach(g),c}_onCategoryTreeChange(e){this._categoryLayersActive()?this._categoryLayers.update(o=>o.map(n=>({...n,visible:!e.has(this._layerIdentity(n))}))):(this._nodeLayers.update(o=>o.map(n=>({...n,visible:!e.has(this._layerIdentity(n))}))),this._syncHiddenNodeIds()),this._recomputeElements()}_invertCategorySelection(){const e=this._categoryUncheckedIds();this._categoryLayersActive()?this._categoryLayers.update(o=>o.map(n=>({...n,visible:e.has(this._layerIdentity(n))}))):(this._nodeLayers.update(o=>o.map(n=>({...n,visible:e.has(this._layerIdentity(n))}))),this._syncHiddenNodeIds()),this._recomputeElements()}_invertPredicateSelection(){const e=this._predicateUncheckedIds();this._predicateLayers.update(o=>o.map(n=>({...n,visible:e.has(this._layerIdentity(n))}))),this._recomputeElements()}_onPredicateTreeChange(e){this._predicateLayers.update(o=>o.map(n=>({...n,visible:!e.has(this._layerIdentity(n))}))),this._recomputeElements()}_unhideAllPredicates(){this._predicateLayers.update(e=>e.map(o=>({...o,visible:!0}))),this._recomputeElements()}_resetIsolation(){this._isolatedNodeId.set(void 0),this._recomputeElements()}_resetAllFilters(){this._isolatedNodeId.set(void 0),this._categoryLayers.update(e=>e.map(o=>({...o,visible:!0}))),this._nodeLayers.update(e=>e.map(o=>({...o,visible:!0}))),this._predicateLayers.update(e=>e.map(o=>({...o,visible:!0}))),this._hiddenNodeIds.clear(),this._recomputeElements()}onDoc=(0,r.QZP)((()=>{var e=this;return(0,I.A)(function*(){const o=e.doc();if(void 0===o)return;const n=new w;n.hideClassAssignmentTriples=e.collapseClasses(),n.hideDatatypePropertyTriples=e.collapseAttributes(),n.collapseIntoClassificationLabels=e.classPredicates(),n.edgeWidths=e.edgeWidths(),n.nodeSizes=e.nodeSizes(),n.nodeColors=e.nodeColors();const s=new H(o,n);let a;try{a=yield s.init(),console.log("[rdf-graph onDoc] elements:",a.nodes.length,"nodes,",a.edges.length,"edges")}catch(d){return void console.error("[rdf-graph onDoc] CytoscapeJSONLD.init() threw:",d)}e._fullElements=a,e._collapserGroups=e.collapseRelationships()?function Ne(i){const l=new Map,e=new Map;for(const s of i.edges)s.data.target&&l.set(s.data.target,(l.get(s.data.target)??0)+1),s.data.source&&e.set(s.data.source,(e.get(s.data.source)??0)+1);const o=new Map;for(const s of i.edges){const a=`${s.data.source}\0${s.data.label}`;o.has(a)||o.set(a,[]),o.get(a).push(s)}const n=[];for(const[s,a]of o){if(a.length<4)continue;const c=s.indexOf("\0"),d=s.slice(0,c),p=s.slice(c+1),u=a.map(g=>g.data.target).filter(g=>g&&1===(l.get(g)??0)&&0===(e.get(g)??0));u.length<4||n.push({id:`${ee}${d}\0${p}`,sourceId:d,predicateLabel:p,allTargetNodeIds:u,visibleCount:0})}return n}(a):[],e._chainGroups=function Me(i){const l=new Map,e=new Map;for(const p of i.nodes)l.set(p.data.id,[]),e.set(p.data.id,[]);for(const p of i.edges)l.get(p.data.source)?.push(p),p.data.target&&e.get(p.data.target)?.push(p);const o=new Map,n=(p,u=new Set)=>{if(o.has(p))return o.get(p);if(u.has(p))return 0;u.add(p);const h=1+(l.get(p)??[]).reduce((C,_)=>Math.max(C,_.data.target?n(_.data.target,u):0),0);return o.set(p,h),h};for(const p of i.nodes)n(p.data.id);const s=new Set,a=[...i.nodes].sort((p,u)=>(o.get(u.data.id)??0)-(o.get(p.data.id)??0));for(const p of a){if(s.size>=20)break;let u=p.data.id;for(;u&&!s.has(u)&&s.size<20;)s.add(u),u=(l.get(u)??[]).filter(m=>m.data.target&&!s.has(m.data.target)).sort((m,h)=>(o.get(h.data.target)??0)-(o.get(m.data.target)??0))[0]?.data.target}const c=new Set(i.nodes.map(p=>p.data.id).filter(p=>!s.has(p)));if(0===c.size)return[];const d=new Map;for(const p of s)for(const u of l.get(p)??[]){if(!u.data.target||!c.has(u.data.target))continue;const g=`${p}\0${u.data.label??""}`;d.has(g)||d.set(g,{id:`${Z}${p}\0${u.data.label??""}`,sourceId:p,predicateLabel:u.data.label??"",hiddenNodeIds:[],visibleCount:0});const m=d.get(g);let h=u.data.target;for(;h&&c.has(h)&&!m.hiddenNodeIds.includes(h);)m.hiddenNodeIds.push(h),c.delete(h),h=(l.get(h)??[]).filter(_=>_.data.target&&c.has(_.data.target)).sort((_,N)=>(o.get(N.data.target)??0)-(o.get(_.data.target)??0))[0]?.data.target}return c.size>0&&d.set("__orphan__",{id:`${Z}__orphan__`,sourceId:a[0]?.data.id??"",predicateLabel:"",hiddenNodeIds:[...c],visibleCount:0}),[...d.values()].filter(p=>p.hiddenNodeIds.length>0)}(a),e._categoryLayers.set(e._buildCategoryLayers(a)),e._predicateLayers.set(e._buildPredicateLayers(a)),e._nodeLayers.set(e._buildNodeLayers(a)),e._hiddenNodeIds.clear(),e._legendClosed.set(!1),e._predicateLegendClosed.set(!1),e._tabbedLegendClosed.set(!1),e._isolatedNodeId.set(void 0),e._recomputeElements();const c=e.focusNodes();c.length>0&&e.zoomToFocusNodes()&&setTimeout(()=>e._graph()?.fitTo(c),450)})})());focusEffect=(0,r.QZP)(()=>{const e=this.focusNodes();this._fullElements&&(this._recomputeElements(),e.length>0&&this.zoomToFocusNodes()&&setTimeout(()=>this._graph()?.fitTo(e),200))});fullscreenResizeEffect=(0,r.QZP)(()=>{this._fullscreenOpen()&&setTimeout(()=>this.triggerResize(),0)});closeFullscreen(){this._fullscreenOpen.set(!1)}triggerResize(){const e=this._graph();if(e){const o=e._cy();o.resize(),setTimeout(()=>{const n=o.container(),s=n?.offsetWidth||0,a=n?.offsetHeight||0;if(s>=100&&a>=100){o.resize();const c=o.elements();if(c.length>0){const d=c.nodes();if(!(d.length>0&&d.every(Y=>{const he=Y.position();return 0!==he.x||0!==he.y}))){const Y=this._graph();return void(Y&&Y._build?.())}const u=Math.min(s,a),g=Math.min(Math.max(.15*u,40),120),m=c.boundingBox(),F=Math.min((s-2*g)/(m.w||1),(a-2*g)/(m.h||1)),P=c.nodes().length,z=c.edges().length,W=P>0?2*z/P:1;let $=2.5;W>10?$=1:W>6?$=1.5:W>3&&($=2);const ue=Math.min(Math.max(F,.2),$);o.animate(ue!==F?{zoom:ue,center:{eles:c},duration:300}:{fit:{eles:c,padding:g},duration:300})}}else console.warn("\u{1f3af} RDFGraph: container too small or invalid dimensions, skipping fit")},150)}}colorByCategoryEffect=(0,r.QZP)(()=>{this.colorByCategory()&&this._legendClosed.set(!1),this._fullElements&&this._recomputeElements()});showRelationshipLegendEffect=(0,r.QZP)(()=>{this.showRelationshipLegend()&&this._predicateLegendClosed.set(!1)});labelPropsSettings=(0,x.EW)(()=>{const e=new V;return e.boxLabels.display=this.collapseClasses(),e.props.display=this.collapseAttributes(),e.boxLabels.displayOnlyOnHover=this.colorByCategory()||this.categoryLabelsOnHover(),e});_onNodeHover(e){e&&this._hoveredNode.set(e),this.nodeHover.emit(e)}_onNodeClick(e){const o=e;if(o.isCollapser&&o.collapserGroupId){const n=this._collapserGroups.find(s=>s.id===o.collapserGroupId);if(n){const s=Math.min(n.visibleCount+5,n.allTargetNodeIds.length);return void(s!==n.visibleCount&&(n.visibleCount=s,this._recomputeElements()))}}if(o.isChainExpander&&o.chainGroupId){const n=this._chainGroups.find(s=>s.id===o.chainGroupId);if(n){const s=Math.min(n.visibleCount+5,n.hiddenNodeIds.length);return void(s!==n.visibleCount&&(n.visibleCount=s,this._recomputeElements()))}}this.nodeClick.emit(e)}_onCanvasClick(){this.canvasClick.emit(),this._focusedNodeId&&(this._focusedNodeId=void 0,this._recomputeElements())}_onContextMenuAction(e){const o=this.nodeMenuItems();if(void 0===o){if("focus"===e.actionId){const n=e.node.id;this._focusedNodeId=this._focusedNodeId===n?void 0:n,this._recomputeElements()}else if("isolate"===e.actionId)this._isolatedNodeId.set(e.node.id),this._recomputeElements();else if("unhide-edges"===e.actionId)this._unhideAllPredicates();else if("expand-more"===e.actionId){const n=e.node.id,s=this._collapserGroups.find(c=>c.id===n);s&&(s.visibleCount=Math.min(s.visibleCount+5,s.allTargetNodeIds.length));const a=this._chainGroups.find(c=>c.id===n);a&&(a.visibleCount=Math.min(a.visibleCount+5,a.hiddenNodeIds.length)),this._recomputeElements()}else if("collapse-expanded"===e.actionId){const n=e.node.id,s=this._collapserGroups.find(c=>c.id===n);s&&(s.visibleCount=0);const a=this._chainGroups.find(c=>c.id===n);a&&(a.visibleCount=0),this._recomputeElements()}else if("collapse-relationship"===e.actionId){const n=e.node.id;for(const s of this._collapserGroups)s.allTargetNodeIds.includes(n)&&(s.visibleCount=0);this._recomputeElements()}}else o.find(n=>n.id===e.actionId)?.action(e.node)}_onEdgeContextMenuAction(e){const o=this.edgeMenuItems();void 0===o?"hide-edge-type"===e.actionId&&(this._predicateLayers.update(n=>n.map(s=>s.label===e.edgeLabel?{...s,visible:!1}:s)),this._recomputeElements()):o.find(n=>n.id===e.actionId)?.action(e.edge)}_onCategoryLayerChange(e){this._categoryLayers.update(o=>[...o]),this._recomputeElements()}_onCategoryVisibilityAll(e){this._categoryLayers.update(o=>[...o]),this._recomputeElements()}_onPredicateLayerChange(e){this._predicateLayers.update(o=>[...o]),this._recomputeElements()}_onPredicateVisibilityAll(e){this._predicateLayers.update(o=>[...o]),this._recomputeElements()}_onNodeLayerChange(e){this._syncHiddenNodeIds(),this._nodeLayers.update(o=>[...o]),this._recomputeElements()}_onNodeVisibilityAll(e){this._syncHiddenNodeIds(),this._nodeLayers.update(o=>[...o]),this._recomputeElements()}_syncHiddenNodeIds(){this._hiddenNodeIds.clear();for(const e of this._nodeLayers())e.visible||this._hiddenNodeIds.add(e.label)}static _PREDICATE_COLOR="#4a90d9";_buildPredicateLayers(e){const o=new Map,n=[];for(const s of e.edges){const a=s.data.label??"";a&&!o.has(a)&&(o.set(a,s.data.iri),n.push(a))}return n.map(s=>({label:s,color:i._PREDICATE_COLOR,visible:!0,iri:o.get(s)}))}_buildCategoryLayers(e){const o=new Set,n=[];for(const s of e.nodes){if(s.data.id.startsWith(ee)||s.data.id.startsWith(Z))continue;const a=s.data.boxLabels?.[0];a&&!o.has(a)&&(o.add(a),n.push(a))}return this._categoryColors=function Ie(i){const l=new Map;return i.forEach((e,o)=>{l.set(e,oe[o%oe.length])}),l}(n),n.map(s=>({label:s,color:this._categoryColors.get(s),visible:!0}))}_buildNodeLayers(e){const o=new Set,n=[];for(const s of e.nodes){if(s.data.id.startsWith(ee)||s.data.id.startsWith(Z))continue;const a=s.data.label||s.data.id,c=s.data.boxLabels?.[0],d=c?this._categoryColors.get(c):void 0;a&&!o.has(a)&&(o.add(a),n.push({label:a,color:d,visible:!0}))}return n.sort((s,a)=>s.label.localeCompare(a.label))}_recomputeElements(){this.elements.set(this._display());const e=this._computeSurvivingLabels();this._survivingCategoryLabels.set(e.categories),this._survivingPredicateLabels.set(e.predicates)}_computeSurvivingLabels(){const e=this._fullElements;if(!e)return{categories:new Set,predicates:new Set};let o=e.nodes,n=e.edges;const s=new Set(this._predicateLayers().filter(u=>!u.visible).map(u=>u.label));if(s.size>0){n=n.filter(g=>!s.has(g.data.label??""));const u=new Set;n.forEach(g=>{u.add(g.data.source),u.add(g.data.target)}),o=o.filter(g=>u.has(g.data.id))}if(this._hiddenNodeIds.size>0){o=o.filter(g=>!this._hiddenNodeIds.has(g.data.label||g.data.id));const u=new Set(o.map(g=>g.data.id));n=n.filter(g=>u.has(g.data.source)&&u.has(g.data.target))}const a=new Set(this._categoryLayers().filter(u=>!u.visible).map(u=>u.label));if(a.size>0){o=o.filter(g=>{const m=g.data.boxLabels?.[0];return void 0===m||!a.has(m)});const u=new Set(o.map(g=>g.data.id));n=n.filter(g=>u.has(g.data.source)&&u.has(g.data.target))}const c=this._isolatedNodeId();if(c){const u=new Set([c]);n.forEach(g=>{g.data.source===c&&u.add(g.data.target??""),g.data.target===c&&u.add(g.data.source)}),o=o.filter(g=>u.has(g.data.id)),n=n.filter(g=>u.has(g.data.source)&&u.has(g.data.target??""))}const d=new Set;this._categoryLayersActive()?o.forEach(u=>{const g=u.data.boxLabels?.[0];g&&d.add(g)}):o.forEach(u=>{const g=u.data.label||u.data.id;g&&d.add(g)});const p=new Set;return n.forEach(u=>{u.data.label&&p.add(u.data.label)}),{categories:d,predicates:p}}_display(){if(!this._fullElements)return{nodes:[],edges:[]};const e=new Set(this._categoryLayers().filter(h=>!h.visible).map(h=>h.label)),o=new Map(this._fullElements.nodes.map(h=>[h.data.id,h.data.boxLabels?.[0]])),n=new Map(this._fullElements.nodes.map(h=>[h.data.id,h.data.label||h.data.id])),s=h=>{const C=o.get(h);return!(void 0===C||!e.has(C))||this._hiddenNodeIds.has(n.get(h)??"")},a=this._collapserGroups.map(h=>{const C=[],_=[];for(const N of h.allTargetNodeIds)(s(N)?_:C).push(N);return{...h,allTargetNodeIds:[...C,..._],visibleCount:Math.max(h.visibleCount,C.length)}}),c=this._chainGroups.map(h=>{let C=-1;return h.hiddenNodeIds.forEach((_,N)=>{s(_)||(C=N)}),{...h,visibleCount:Math.max(h.visibleCount,C+1)}});let d=function Ee(i,l,e){const o=new Set,n=new Set,s=[],a=[];for(const d of e){const p=d.hiddenNodeIds.length-d.visibleCount;if(p<2)continue;for(const m of d.hiddenNodeIds.slice(d.visibleCount))o.add(m);const u=d.visibleCount>0,g=u?d.hiddenNodeIds[d.visibleCount-1]:d.sourceId;s.push({data:{id:d.id,label:`+${p}`,size:28,isChainExpander:!0,isExpanded:u,chainGroupId:d.id},classes:u?"collapser collapser-expanded":"collapser"}),a.push({data:{id:`edge_${d.id}`,source:g,target:d.id,label:d.predicateLabel}})}for(const d of l){const p=d.allTargetNodeIds.length-d.visibleCount;if(p<2)continue;for(const m of d.allTargetNodeIds.slice(d.visibleCount))o.add(m);const u=i.edges.filter(m=>m.data.source===d.sourceId&&m.data.label===d.predicateLabel&&d.allTargetNodeIds.includes(m.data.target));for(const m of u)n.add(m.data.id??"");for(const m of u)d.allTargetNodeIds.indexOf(m.data.target)<d.visibleCount&&a.push(m);const g=d.visibleCount>0;s.push({data:{id:d.id,label:`+${p}`,size:28,isCollapser:!0,isExpanded:g,collapserGroupId:d.id},classes:g?"collapser collapser-expanded":"collapser"}),a.push({data:{id:`edge_${d.id}`,source:d.sourceId,target:d.id,label:d.predicateLabel}})}const c=new Set(s.map(d=>d.data.id));return{nodes:[...i.nodes.filter(d=>!o.has(d.data.id)),...s],edges:[...i.edges.filter(d=>!(n.has(d.data.id??"")||o.has(d.data.source)||o.has(d.data.target??"")||c.has(d.data.source)||c.has(d.data.target??""))),...a]}}(this._fullElements,a,c);const p=new Set(this._predicateLayers().filter(h=>!h.visible).map(h=>h.label));if(p.size>0){const h=d.edges.filter(_=>!p.has(_.data.label??"")),C=new Set;for(const _ of h)C.add(_.data.source),C.add(_.data.target);d={nodes:d.nodes.filter(_=>C.has(_.data.id)),edges:h}}if(this._hiddenNodeIds.size>0){const h=_=>this._hiddenNodeIds.has(n.get(_)??""),C=new Set(d.nodes.filter(_=>this._hiddenNodeIds.has(_.data.label||_.data.id)).map(_=>_.data.id));for(const _ of this._collapserGroups)_.allTargetNodeIds.every(h)&&C.add(_.id);for(const _ of this._chainGroups){const N=_.hiddenNodeIds.slice(_.visibleCount);N.length>0&&N.every(h)&&C.add(_.id)}C.size>0&&(d={nodes:d.nodes.filter(_=>!C.has(_.data.id)),edges:d.edges.filter(_=>!C.has(_.data.source)&&!C.has(_.data.target))})}if(e.size>0){const h=_=>{const N=o.get(_);return void 0!==N&&e.has(N)},C=new Set(d.nodes.filter(_=>{const N=_.data.boxLabels?.[0];return void 0!==N&&e.has(N)}).map(_=>_.data.id));for(const _ of this._collapserGroups)_.allTargetNodeIds.every(h)&&C.add(_.id);for(const _ of this._chainGroups){const N=_.hiddenNodeIds.slice(_.visibleCount);N.length>0&&N.every(h)&&C.add(_.id)}d={nodes:d.nodes.filter(_=>!C.has(_.data.id)),edges:d.edges.filter(_=>!C.has(_.data.source)&&!C.has(_.data.target))}}this.colorByCategory()&&(d={...d,nodes:d.nodes.map(h=>{const C=h.data.boxLabels?.[0],_=C?this._categoryColors.get(C):void 0;return _?{...h,data:{...h.data,color:_}}:h})});const u=this._isolatedNodeId();u&&(d=this._applyIsolation(d,u)),this._focusedNodeId&&(d=this._applyFocus(d,this._focusedNodeId));const g=new Set(this.focusNodes()),m=this.focusNodeColor();return g.size>0&&(d={...d,nodes:d.nodes.map(h=>{if(!g.has(h.data.id))return h;const C=h.classes?h.classes.trim():"";return{...h,data:{...h.data,color:m},classes:C?`${C} focused`:"focused"}})}),d}_applyIsolation(e,o){const n=new Set([o]);for(const s of e.edges)s.data.source===o&&n.add(s.data.target??""),s.data.target===o&&n.add(s.data.source);return{nodes:e.nodes.filter(s=>n.has(s.data.id)),edges:e.edges.filter(s=>n.has(s.data.source)&&n.has(s.data.target??""))}}_applyFocus(e,o){const n=new Set([o]);for(const a of e.edges)a.data.source===o&&n.add(a.data.target??""),a.data.target===o&&n.add(a.data.source);const s=(a,c)=>{const d=a?a.trim():"";return d?`${d} ${c}`:c};return{nodes:e.nodes.map(a=>n.has(a.data.id)?{...a,classes:s(a.classes,"focused")}:{...a,classes:s(a.classes,"faded")}),edges:e.edges.map(a=>n.has(a.data.source)&&n.has(a.data.target??"")?a:{...a,classes:s(a.classes,"faded")})}}static \u0275fac=function(o){return new(o||i)};static \u0275cmp=t.VBU({type:i,selectors:[["cue-rdf-graph"]],viewQuery:function(o,n){1&o&&t.wEZ(n._graph,q,5),2&o&&t.NyB()},inputs:{doc:[1,"doc"],collapseClasses:[1,"collapseClasses"],collapseAttributes:[1,"collapseAttributes"],collapseRelationships:[1,"collapseRelationships"],classPredicates:[1,"classPredicates"],focusNodes:[1,"focusNodes"],focusNodeColor:[1,"focusNodeColor"],zoomToFocusNodes:[1,"zoomToFocusNodes"],colorByCategory:[1,"colorByCategory"],showRelationshipLegend:[1,"showRelationshipLegend"],legendPosition:[1,"legendPosition"],tabbedLegend:[1,"tabbedLegend"],categoryLabelsOnHover:[1,"categoryLabelsOnHover"],showFocusMenuItem:[1,"showFocusMenuItem"],nodeMenuItems:[1,"nodeMenuItems"],edgeMenuItems:[1,"edgeMenuItems"],edgeWidths:[1,"edgeWidths"],nodeSizes:[1,"nodeSizes"],nodeColors:[1,"nodeColors"],categoryHierarchy:[1,"categoryHierarchy"],relationshipHierarchy:[1,"relationshipHierarchy"],fullscreenEnabled:[1,"fullscreenEnabled"],legendAlwaysVisible:[1,"legendAlwaysVisible"],selectableNodes:[1,"selectableNodes"],selectableEdges:[1,"selectableEdges"],selectedNodeIds:[1,"selectedNodeIds"],selectedEdgeIds:[1,"selectedEdgeIds"]},outputs:{selectedNodeIds:"selectedNodeIdsChange",selectedEdgeIds:"selectedEdgeIdsChange",nodeHover:"nodeHover",nodeClick:"nodeClick",canvasClick:"canvasClick"},decls:4,vars:1,consts:[["graphBody",""],["size","fullscreen",3,"visible","displayCloseBtn"],[2,"display","flex","flex-direction","column","position","relative","width","100%","flex","1","min-height","0"],["variant","ghost","size","s",1,"fullscreen-toggle",3,"position","top","left","zIndex"],[3,"elements","labelPropsSettings","contextMenuItems","edgeContextMenuItems","selectableNodes","selectableEdges","selectedNodeIds","selectedEdgeIds"],["variant","ghost","size","s",1,"isolation-reset-btn",3,"position","bottom","right"],["variant","ghost","size","s",1,"fullscreen-toggle",3,"click"],[3,"icon"],[3,"selectedNodeIdsChange","selectedEdgeIdsChange","nodeHover","nodeClick","canvasClick","contextMenuAction","edgeContextMenuAction","elements","labelPropsSettings","contextMenuItems","edgeContextMenuItems","selectableNodes","selectableEdges","selectedNodeIds","selectedEdgeIds"],[1,"hierarchy-panel"],[3,"label","padded","position"],[1,"hp-panel-row"],["type","button",1,"hp-edge-toggle",3,"click"],[1,"hp-edge-arrow"],["icon","arrow-back"],[1,"hp-panel-inner"],[1,"hp-pill-row"],["type","button",1,"hp-pill",3,"active"],[1,"hp-panel-body"],["variant","secondary",1,"hp-subcard",3,"shadow"],["variant","secondary","size","s",1,"hp-reset-btn"],["type","button",1,"hp-pill",3,"click"],[1,"hp-section-label"],["size","xs","weight","semibold"],["type","button",1,"hp-invert-btn",3,"click"],["icon","arrow-up-down"],[3,"uncheckedIdsChange","nodes","uncheckedIds","selectAllLabel"],["variant","secondary","size","s",1,"hp-reset-btn",3,"click"],[3,"clickedClose","label","padded","position"],[1,"legend-tabs"],[3,"label"],[1,"legend-content"],[3,"visibilityAll","layerChange","layers"],["position","top-right",3,"title","layers"],["position","top-right",3,"close","layerChange","visibilityAll","title","layers"],[3,"close","layerChange","visibilityAll","title","layers","position"],["variant","ghost","size","s",1,"unhide-btn",3,"position","top","right"],["variant","ghost","size","s",1,"unhide-btn",3,"click"],["variant","ghost","size","s",1,"isolation-reset-btn",3,"click"],["size","fullscreen",3,"close","visible","displayCloseBtn"],[4,"ngTemplateOutlet"]],template:function(o,n){1&o&&(t.DNE(0,ut,6,4,"ng-template",null,0,t.C5r),t.nVh(2,pt,2,3,"cue-modal",1)(3,_t,1,1,"ng-container")),2&o&&(t.R7$(2),t.vxM(n._fullscreenOpen()?2:3))},dependencies:[q,Le.v,ke.y,we.P,De.t,Te.o,de.Button,Pe.ButtonLabel,le.ButtonIcon,Ze,Re.Card,re.Typography,k.a,S.T3,j.Kj],styles:["[_nghost-%COMP%]{display:contents}.legend-tabs[_ngcontent-%COMP%]{width:180px}.legend-content[_ngcontent-%COMP%]{padding:4px 10px 24px;font-size:.8em;max-height:200px;overflow:auto}.hierarchy-panel[_ngcontent-%COMP%]{position:absolute;top:0;right:0;height:100%;width:288px;max-width:100%;z-index:40;overflow:hidden;pointer-events:none}.hp-panel-row[_ngcontent-%COMP%]{display:flex;align-items:stretch;height:100%;width:288px;transition:transform .22s cubic-bezier(.4,0,.2,1)}.hp-panel-row.collapsed[_ngcontent-%COMP%]{transform:translate(260px)}.hp-edge-toggle[_ngcontent-%COMP%]{flex:0 0 28px;width:28px;align-self:center;height:48px;border:1px solid var(--cue-card-border-color);border-right:none;border-radius:6px 0 0 6px;background:var(--cue-primary);color:var(--cue-primaryContrast);display:flex;align-items:center;justify-content:center;cursor:pointer;pointer-events:auto;box-shadow:-2px 0 8px #00000026}.hp-edge-arrow[_ngcontent-%COMP%]{display:inline-flex;transition:transform .2s ease}.hp-edge-arrow.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.hp-panel-inner[_ngcontent-%COMP%]{position:relative;flex:0 0 260px;width:260px;height:100%;background:var(--cue-primary);color:var(--cue-primaryContrast);border-radius:var(--cue-card-border-radius);border-left:1px solid rgba(255,255,255,.15);display:flex;flex-direction:column;overflow:hidden;box-shadow:-6px 0 24px #00000026;pointer-events:auto}.hp-pill-row[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:8px;padding:16px 16px 0;flex-shrink:0}.hp-pill[_ngcontent-%COMP%]{font-family:var(--cue-font-family);font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.05em;padding:5px 12px;border-radius:999px;background:#ffffff1f;color:#ffffffbf;border:1px solid rgba(255,255,255,.2);cursor:pointer;transition:background .15s,color .15s,border-color .15s}.hp-pill[_ngcontent-%COMP%]:hover{border-color:#fff6}.hp-pill.active[_ngcontent-%COMP%]{background:#ffffffe6;color:var(--cue-primary);border-color:#ffffffe6}.hp-panel-body[_ngcontent-%COMP%]{flex:1;overflow-y:auto;padding:12px;display:flex;flex-direction:column;gap:12px;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.2) transparent}.hp-reset-btn[_ngcontent-%COMP%]{flex-shrink:0;margin:8px 12px 12px;justify-content:center;box-shadow:0 -2px 12px #0003}.hp-subcard[_ngcontent-%COMP%]{flex-shrink:0}cue-card.hp-subcard[_ngcontent-%COMP%]{--cue-input-value-color: rgba(255, 255, 255, .75);--cue-input-border-bottom-color: rgba(255, 255, 255, .25);--cue-input-placeholder-color: rgba(255, 255, 255, .45)}.hp-section-label[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px}.hp-section-label[_ngcontent-%COMP%] cue-typography[_ngcontent-%COMP%]{opacity:.75}.hp-invert-btn[_ngcontent-%COMP%]{background:none;border:none;color:inherit;opacity:.55;cursor:pointer;padding:2px;display:flex;align-items:center;flex-shrink:0}.hp-invert-btn[_ngcontent-%COMP%]:hover{opacity:1}"],changeDetection:0})}return i})()},2065(X,G,y){function r(k,w,M="text/plain"){return function I(k,w="data.zip"){const M=document.createElement("a"),v=URL.createObjectURL(k);M.href=v,M.download=w,document.body.appendChild(M),M.click(),document.body.removeChild(M),URL.revokeObjectURL(v)}(new Blob([k],{type:M}),w)}function x(k,w){const M=document.createElement("a");M.style.display="hidden",M.setAttribute("href",window.URL.createObjectURL(k)),M.setAttribute("download",w),document.body.appendChild(M),M.click(),M.remove()}y.d(G,{KE:()=>x,YN:()=>r})},35401(X,G,y){y.d(G,{Q:()=>I});const I={foaf:"http://xmlns.com/foaf/0.1/",rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",skos:"http://www.w3.org/2004/02/skos/core#",geo:"http://www.opengis.net/ont/geosparql#",schema:"http://schema.org/"}},77573(X,G,y){y.d(G,{E:()=>I});const I={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/6947.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[6947],{86947(E,p,r){r.d(p,{CueDocumentFilter:()=>b});var u=r(10467),_=r(17705),g=r(32271),m=r(
|
|
1
|
+
"use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[6947],{86947(E,p,r){r.d(p,{CueDocumentFilter:()=>b});var u=r(10467),_=r(17705),g=r(32271),m=r(42996),f=r(69822),i=r(35547);let b=(()=>{class o{projectId=_.hFB.required();sdkState=_.hFB.required();filtersChange=(0,_.CGW)();_handlers=(0,g.EW)(()=>{var n=this;const t=this.sdkState(),e=this.projectId(),a=new m.NV(t.cue.api,e,t.graphType);let l=null;const C=()=>(l||(l=this._loadSchemaLabels(t,e)),l);return{requestAvailableFilters:(d=(0,u.A)(function*(s){const[c,h]=yield Promise.all([a.availableFilters(s),C()]);return n._withSchemaLabels(c,h)}),function(c){return d.apply(this,arguments)}),requestAvailableEntities:function(){var d=(0,u.A)(function*(s,c){return yield a.availableEntities(s,c)});return function(c,h){return d.apply(this,arguments)}}()};var d});_loadSchemaLabels(n,t){return(0,u.A)(function*(){try{const e=new m.Ug(n.cue.api,t,n.cue.api.language,n.graphType);return yield e.ready,{content:new Map(e.availableContentCategories.get().map(a=>[a.iri,a.label])),entity:new Map(e.availableEntityCategories.get().map(a=>[a.iri,a.label]))}}catch(e){return console.error("[document-filter] Failed to load schema labels",e),{content:new Map,entity:new Map}}})()}_withSchemaLabels(n,t){return{mimes:n.mimes.map(e=>({iri:e.iri,label:e.label.replace(/FileContent$/,"")})),contents:n.contents.map(e=>({iri:e.iri,label:t.content.get(e.iri)??e.label})),entityCategories:n.entityCategories.map(e=>({iri:e.iri,label:t.entity.get(e.iri)??e.label}))}}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=i.VBU({type:o,selectors:[["cue-document-filter"]],inputs:{projectId:[1,"projectId"],sdkState:[1,"sdkState"]},outputs:{filtersChange:"filtersChange"},decls:1,vars:1,consts:[[3,"filtersChange","handlers"]],template:function(t,e){1&t&&(i.j41(0,"cue-doc-filter",0),i.bIt("filtersChange",function(l){return e.filtersChange.emit(l)}),i.k0s()),2&t&&i.Y8G("handlers",e._handlers())},dependencies:[f.y],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}return o})()}}]);
|
package/7003.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[7003],{31513(X,$,T){T.d($,{U:()=>L});var M=T(13725);const P=new TextDecoder;function L(o,t){const e=function O(o){const t=Math.min(65536,o.length),e=P.decode(o.subarray(0,t)),n=e.search(/^DATA\s+(\S+)/m);if(n<0)throw new Error("PCD: missing DATA line in header (scanned first "+t+" bytes)");const f=e.slice(0,n),s=e.slice(n).match(/^DATA\s+(\S+)\s*\n/);if(!s)throw new Error("PCD: malformed DATA line");const c=s[1].toLowerCase();if("ascii"!==c&&"binary"!==c&&"binary_compressed"!==c)throw new Error(`PCD: unsupported DATA kind "${c}"`);const u=n+s[0].length,p=new Map;for(const U of f.split("\n")){const D=U.replace(/#.*$/,"").trim();if(!D)continue;const A=D.split(/\s+/),b=A[0].toUpperCase();p.set(b,A.slice(1))}const w=p.get("FIELDS")??[],l=(p.get("SIZE")??[]).map(Number),r=p.get("TYPE")??[],C=(p.get("COUNT")??[]).map(Number),I=p.get("WIDTH")?.[0],_=p.get("HEIGHT")?.[0],S=p.get("POINTS")?.[0];if(0===w.length)throw new Error("PCD: missing FIELDS");if(l.length!==w.length)throw new Error("PCD: SIZE/FIELDS length mismatch");if(r.length!==w.length)throw new Error("PCD: TYPE/FIELDS length mismatch");const h=[];let z=0;for(let U=0;U<w.length;U++){const D=C[U]??1,A=l[U],b=r[U];if("F"!==b&&"I"!==b&&"U"!==b)throw new Error(`PCD: unsupported field TYPE "${b}"`);if(!Number.isSafeInteger(A)||A<=0||!Number.isSafeInteger(D)||D<=0||!Number.isSafeInteger(A*D))throw new Error(`PCD: invalid field SIZE or COUNT (size=${A}, count=${D})`);if(h.push({name:w[U],size:A,type:b,count:D,offset:z}),z+=A*D,!Number.isSafeInteger(z))throw new Error("PCD: field stride overflow")}const R=void 0!==I?parseInt(I,10):0,v=void 0!==_?parseInt(_,10):1,Z=void 0!==S?parseInt(S,10):R*v;if(!Number.isFinite(Z)||Z<=0)throw new Error("PCD: invalid point count");return{version:p.get("VERSION")?.[0]??"0.7",fields:h,width:R,height:v,pointCount:Z,pointStride:z,data:c,bodyOffset:u}}(o);if("binary_compressed"!==e.data){const s=o.length-e.bodyOffset,c=e.fields.reduce((w,l)=>w+Math.max(1,l.count),0),u="ascii"===e.data?Math.max(1,2*c):e.pointStride,p="ascii"===e.data&&e.pointCount>0?e.pointCount*u-1:e.pointCount*u;if(u>0&&p>s)throw new Error(`PCD: declared ${e.pointCount} points need at least ${p} body bytes but only ${s} are available`)}let n,f;return({positions:n,colors:f}="ascii"===e.data?function i(o,t,e){const n=y(t),f=P.decode(o.subarray(t.bodyOffset)),s=new Float32Array(3*t.pointCount),c=n.rgbField?new Float32Array(3*t.pointCount):void 0,u=e?.[0]??0,p=e?.[1]??0,w=e?.[2]??0,l=function g(o,t){let e=0,n=-1,f=-1,s=-1,c=-1;for(const u of o.fields)u===t.xField&&(n=e),u===t.yField&&(f=e),u===t.zField&&(s=e),u===t.rgbField&&(c=e),e+=u.count;return{xCol:n,yCol:f,zCol:s,rgbCol:c}}(t,n);let r=0,C=0,I=0;for(;I<t.pointCount&&C<f.length;){let _=f.indexOf("\n",C);_<0&&(_=f.length);const S=f.slice(C,_).trim();if(C=_+1,!S)continue;const h=S.split(/\s+/);if(s[3*r]=Number(h[l.xCol])-u,s[3*r+1]=Number(h[l.yCol])-p,s[3*r+2]=Number(h[l.zCol])-w,c&&l.rgbCol>=0){const z=x(h[l.rgbCol],n.rgbField);c[3*r]=(z>>16&255)/255,c[3*r+1]=(z>>8&255)/255,c[3*r+2]=(255&z)/255}r++,I++}if(I!==t.pointCount)throw new Error(`PCD ascii: expected ${t.pointCount} points, got ${I}`);return{positions:s,colors:c}}(o,e,t):"binary"===e.data?function a(o,t,e){const n=y(t),f=new DataView(o.buffer,o.byteOffset+t.bodyOffset,t.pointCount*t.pointStride),s=new Float32Array(3*t.pointCount),c=n.rgbField?new Float32Array(3*t.pointCount):void 0,u=e?.[0]??0,p=e?.[1]??0,w=e?.[2]??0;for(let l=0;l<t.pointCount;l++){const r=l*t.pointStride;if(s[3*l]=m(f,r+n.xField.offset,n.xField)-u,s[3*l+1]=m(f,r+n.yField.offset,n.yField)-p,s[3*l+2]=m(f,r+n.zField.offset,n.zField)-w,c&&n.rgbField){const C=f.getUint32(r+n.rgbField.offset,!0);c[3*l]=(C>>16&255)/255,c[3*l+1]=(C>>8&255)/255,c[3*l+2]=(255&C)/255}}return{positions:s,colors:c}}(o,e,t):function d(o,t,e){if(o.length<t.bodyOffset+8)throw new Error("PCD binary_compressed: truncated size header");const n=new DataView(o.buffer,o.byteOffset+t.bodyOffset,8),f=n.getUint32(0,!0),s=n.getUint32(4,!0),c=t.pointCount*t.pointStride;if(s!==c)throw new Error(`PCD binary_compressed: declared uncompressed=${s} does not match fields*points=${c}`);const u=o.subarray(t.bodyOffset+8,t.bodyOffset+8+f),p=1<<30;if(s>p)throw new Error(`PCD binary_compressed: declared uncompressed=${s} exceeds the ${p}-byte decode ceiling`);if(s>90*u.length)throw new Error(`PCD binary_compressed: declared uncompressed=${s} exceeds 90x the ${u.length}-byte compressed body`);const l=(0,M.c)(u,s),r=y(t),C=new Map;let I=0;for(const b of t.fields)C.set(b,I),I+=t.pointCount*b.size*b.count;const _=new DataView(l.buffer,l.byteOffset,l.byteLength),S=new Float32Array(3*t.pointCount),h=r.rgbField?new Float32Array(3*t.pointCount):void 0,z=C.get(r.xField),R=C.get(r.yField),v=C.get(r.zField),Z=r.rgbField?C.get(r.rgbField):0,U=e?.[0]??0,D=e?.[1]??0,A=e?.[2]??0;for(let b=0;b<t.pointCount;b++)if(S[3*b]=m(_,z+b*r.xField.size,r.xField)-U,S[3*b+1]=m(_,R+b*r.yField.size,r.yField)-D,S[3*b+2]=m(_,v+b*r.zField.size,r.zField)-A,h&&r.rgbField){const Y=_.getUint32(Z+b*r.rgbField.size,!0);h[3*b]=(Y>>16&255)/255,h[3*b+1]=(Y>>8&255)/255,h[3*b+2]=(255&Y)/255}return{positions:S,colors:h}}(o,e,t)),{positions:n,colors:f,pointCount:e.pointCount,bbox:E(n)}}function y(o){const t={};for(const e of o.fields){const n=e.name.toLowerCase();"x"===n?t.xField=e:"y"===n?t.yField=e:"z"===n?t.zField=e:("rgb"===n||"rgba"===n)&&(t.rgbField=e)}if(!t.xField||!t.yField||!t.zField)throw new Error("PCD: x/y/z fields are required");return t}function m(o,t,e){if("F"===e.type)return 8===e.size?o.getFloat64(t,!0):o.getFloat32(t,!0);if("U"===e.type){if(1===e.size)return o.getUint8(t);if(2===e.size)return o.getUint16(t,!0);if(4===e.size)return o.getUint32(t,!0)}else{if(1===e.size)return o.getInt8(t);if(2===e.size)return o.getInt16(t,!0);if(4===e.size)return o.getInt32(t,!0)}throw new Error(`PCD: unsupported field width ${e.size} for type ${e.type}`)}const F=new ArrayBuffer(4),B=new Float32Array(F),N=new Uint32Array(F);function x(o,t){return"F"===t.type?(B[0]=Number(o),N[0]):Number(o)>>>0}function E(o){let t=1/0,e=1/0,n=1/0,f=-1/0,s=-1/0,c=-1/0;for(let u=0;u<o.length;u+=3){const p=o[u],w=o[u+1],l=o[u+2];p<t&&(t=p),p>f&&(f=p),w<e&&(e=w),w>s&&(s=w),l<n&&(n=l),l>c&&(c=l)}return{min:[t,e,n],max:[f,s,c]}}},13725(X,$,T){function M(P,L){const O=new Uint8Array(L);let y=0,i=0;const g=P.length;for(;y<g;){let a=P[y++];if(a<32){const d=a+1;if(y+d>g)throw new Error("LZF: literal run exceeds input bounds");if(i+d>L)throw new Error("LZF: literal run exceeds output bounds");O.set(P.subarray(y,y+d),i),y+=d,i+=d}else{let d=a>>5;if(7===d){if(y>=g)throw new Error("LZF: truncated extended length");d+=P[y++]}if(d+=2,y>=g)throw new Error("LZF: truncated back-reference offset");const m=i-((31&a)<<8)-P[y++]-1;if(m<0)throw new Error("LZF: back-reference points before output start");if(i+d>L)throw new Error("LZF: back-reference exceeds output bounds");for(let F=0;F<d;F++)O[i+F]=O[m+F];i+=d}}if(i!==L)throw new Error(`LZF: decompressed ${i} bytes, expected ${L}`);return O}T.d($,{c:()=>M})},57003(X,$,T){T.r($),T.d($,{PcdStreamingSource:()=>L});var M=T(10467),P=T(31513);class L{blob;downsample;label;chunk=null;served=!1;originOffset;constructor(g,a={}){this.blob=g,this.downsample=a.downsample??{stride:1},this.label=a.label,this.originOffset=a.originOffset}open(g){var a=this;return(0,M.A)(function*(){y(g);const d=yield a.blob.arrayBuffer();y(g);const m=(0,P.U)(new Uint8Array(d),a.originOffset);return a.chunk=function O(i,g){const a=Math.max(1,0|g);if(1===a)return i;const d=Math.ceil(i.pointCount/a),m=new Float32Array(3*d),F=i.colors?new Float32Array(3*d):void 0,B=i.classifications?new Uint8Array(d):void 0,N=i.intensities?new Uint16Array(d):void 0;let x=0;for(let E=0;E<i.pointCount;E+=a)m[3*x]=i.positions[3*E],m[3*x+1]=i.positions[3*E+1],m[3*x+2]=i.positions[3*E+2],F&&i.colors&&(F[3*x]=i.colors[3*E],F[3*x+1]=i.colors[3*E+1],F[3*x+2]=i.colors[3*E+2]),B&&i.classifications&&(B[x]=i.classifications[E]),N&&i.intensities&&(N[x]=i.intensities[E]),x++;return{positions:m,colors:F,classifications:B,intensities:N,pointCount:d,bbox:i.bbox}}(m,a.downsample.stride),{totalPointCount:a.chunk.pointCount,bbox:a.chunk.bbox,hasColor:!!a.chunk.colors,hasClassification:!!a.chunk.classifications,hasIntensity:!!a.chunk.intensities,label:a.label}})()}next(g,a){var d=this;return(0,M.A)(function*(){return y(a),!d.chunk||d.served?null:(d.served=!0,d.chunk)})()}close(){this.chunk=null,this.served=!1}}function y(i){if(i?.aborted)throw new DOMException("Aborted","AbortError")}}}]);
|
package/7108.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[7108],{17108(Yt,_e,E){E.r(_e),E.d(_e,{StreamableHTTPClientTransport:()=>Ut,StreamableHTTPError:()=>O});var p=E(10467);function b(e){return e?e instanceof Headers?Object.fromEntries(e.entries()):Array.isArray(e)?Object.fromEntries(e):{...e}:{}}var A=E(46442);let I;function He(e){return S.apply(this,arguments)}function S(){return(S=(0,p.A)(function*(e){return(yield I).getRandomValues(new Uint8Array(e))})).apply(this,arguments)}function M(){return(M=(0,p.A)(function*(e){const r=Math.pow(2,8)-Math.pow(2,8)%66;let n="";for(;n.length<e;){const s=yield He(e-n.length);for(const i of s)i<r&&(n+="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~"[i%66])}return n})).apply(this,arguments)}function P(){return P=(0,p.A)(function*(e){return yield function ze(e){return M.apply(this,arguments)}(e)}),P.apply(this,arguments)}function he(e){return L.apply(this,arguments)}function L(){return(L=(0,p.A)(function*(e){const t=yield(yield I).subtle.digest("SHA-256",(new TextEncoder).encode(e));return btoa(String.fromCharCode(...new Uint8Array(t))).replace(/\//g,"_").replace(/\+/g,"-").replace(/=/g,"")})).apply(this,arguments)}function $(){return $=(0,p.A)(function*(e){if(e||(e=43),e<43||e>128)throw`Expected a length between 43 and 128. Received ${e}.`;const t=yield function De(e){return P.apply(this,arguments)}(e);return{code_verifier:t,code_challenge:yield he(t)}}),$.apply(this,arguments)}I=globalThis.crypto;var o=E(80428);var Fe=E(80688),Ve=E(21779);const m=o.OZ().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:"custom",message:"URL must be parseable",fatal:!0}),Fe.tm}).refine(e=>{const t=new URL(e);return"javascript:"!==t.protocol&&"data:"!==t.protocol&&"vbscript:"!==t.protocol},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),Be=o._H({resource:o.Yj().url(),authorization_servers:o.YO(m).optional(),jwks_uri:o.Yj().url().optional(),scopes_supported:o.YO(o.Yj()).optional(),bearer_methods_supported:o.YO(o.Yj()).optional(),resource_signing_alg_values_supported:o.YO(o.Yj()).optional(),resource_name:o.Yj().optional(),resource_documentation:o.Yj().optional(),resource_policy_uri:o.Yj().url().optional(),resource_tos_uri:o.Yj().url().optional(),tls_client_certificate_bound_access_tokens:o.zM().optional(),authorization_details_types_supported:o.YO(o.Yj()).optional(),dpop_signing_alg_values_supported:o.YO(o.Yj()).optional(),dpop_bound_access_tokens_required:o.zM().optional()}),ye=o._H({issuer:o.Yj(),authorization_endpoint:m,token_endpoint:m,registration_endpoint:m.optional(),scopes_supported:o.YO(o.Yj()).optional(),response_types_supported:o.YO(o.Yj()),response_modes_supported:o.YO(o.Yj()).optional(),grant_types_supported:o.YO(o.Yj()).optional(),token_endpoint_auth_methods_supported:o.YO(o.Yj()).optional(),token_endpoint_auth_signing_alg_values_supported:o.YO(o.Yj()).optional(),service_documentation:m.optional(),revocation_endpoint:m.optional(),revocation_endpoint_auth_methods_supported:o.YO(o.Yj()).optional(),revocation_endpoint_auth_signing_alg_values_supported:o.YO(o.Yj()).optional(),introspection_endpoint:o.Yj().optional(),introspection_endpoint_auth_methods_supported:o.YO(o.Yj()).optional(),introspection_endpoint_auth_signing_alg_values_supported:o.YO(o.Yj()).optional(),code_challenge_methods_supported:o.YO(o.Yj()).optional(),client_id_metadata_document_supported:o.zM().optional()}),Ze=o._H({issuer:o.Yj(),authorization_endpoint:m,token_endpoint:m,userinfo_endpoint:m.optional(),jwks_uri:m,registration_endpoint:m.optional(),scopes_supported:o.YO(o.Yj()).optional(),response_types_supported:o.YO(o.Yj()),response_modes_supported:o.YO(o.Yj()).optional(),grant_types_supported:o.YO(o.Yj()).optional(),acr_values_supported:o.YO(o.Yj()).optional(),subject_types_supported:o.YO(o.Yj()),id_token_signing_alg_values_supported:o.YO(o.Yj()),id_token_encryption_alg_values_supported:o.YO(o.Yj()).optional(),id_token_encryption_enc_values_supported:o.YO(o.Yj()).optional(),userinfo_signing_alg_values_supported:o.YO(o.Yj()).optional(),userinfo_encryption_alg_values_supported:o.YO(o.Yj()).optional(),userinfo_encryption_enc_values_supported:o.YO(o.Yj()).optional(),request_object_signing_alg_values_supported:o.YO(o.Yj()).optional(),request_object_encryption_alg_values_supported:o.YO(o.Yj()).optional(),request_object_encryption_enc_values_supported:o.YO(o.Yj()).optional(),token_endpoint_auth_methods_supported:o.YO(o.Yj()).optional(),token_endpoint_auth_signing_alg_values_supported:o.YO(o.Yj()).optional(),display_values_supported:o.YO(o.Yj()).optional(),claim_types_supported:o.YO(o.Yj()).optional(),claims_supported:o.YO(o.Yj()).optional(),service_documentation:o.Yj().optional(),claims_locales_supported:o.YO(o.Yj()).optional(),ui_locales_supported:o.YO(o.Yj()).optional(),claims_parameter_supported:o.zM().optional(),request_parameter_supported:o.zM().optional(),request_uri_parameter_supported:o.zM().optional(),require_request_uri_registration:o.zM().optional(),op_policy_uri:m.optional(),op_tos_uri:m.optional(),client_id_metadata_document_supported:o.zM().optional()}),Ge=o.Ik({...Ze.shape,...ye.pick({code_challenge_methods_supported:!0}).shape}),Je=o.Ik({access_token:o.Yj(),id_token:o.Yj().optional(),token_type:o.Yj(),expires_in:function Ne(e){return Ve.qG(o.rS,e)}().optional(),scope:o.Yj().optional(),refresh_token:o.Yj().optional()}).strip(),Ke=o.Ik({error:o.Yj(),error_description:o.Yj().optional(),error_uri:o.Yj().optional()}),me=m.optional().or(o.eu("").transform(()=>{})),Qe=o.Ik({redirect_uris:o.YO(m),token_endpoint_auth_method:o.Yj().optional(),grant_types:o.YO(o.Yj()).optional(),response_types:o.YO(o.Yj()).optional(),client_name:o.Yj().optional(),client_uri:m.optional(),logo_uri:me,scope:o.Yj().optional(),contacts:o.YO(o.Yj()).optional(),tos_uri:me,policy_uri:o.Yj().optional(),jwks_uri:m.optional(),jwks:o.bz().optional(),software_id:o.Yj().optional(),software_version:o.Yj().optional(),software_statement:o.Yj().optional()}).strip(),Xe=o.Ik({client_id:o.Yj(),client_secret:o.Yj().optional(),client_id_issued_at:o.ai().optional(),client_secret_expires_at:o.ai().optional()}).strip(),et=Qe.merge(Xe);o.Ik({error:o.Yj(),error_description:o.Yj().optional()}).strip(),o.Ik({token:o.Yj(),token_type_hint:o.Yj().optional()}).strip();class f extends Error{constructor(t,r){super(t),this.errorUri=r,this.name=this.constructor.name}toResponseObject(){const t={error:this.errorCode,error_description:this.message};return this.errorUri&&(t.error_uri=this.errorUri),t}get errorCode(){return this.constructor.errorCode}}let ge=(()=>{class e extends f{}return e.errorCode="invalid_request",e})(),z=(()=>{class e extends f{}return e.errorCode="invalid_client",e})(),D=(()=>{class e extends f{}return e.errorCode="invalid_grant",e})(),W=(()=>{class e extends f{}return e.errorCode="unauthorized_client",e})(),we=(()=>{class e extends f{}return e.errorCode="unsupported_grant_type",e})(),ve=(()=>{class e extends f{}return e.errorCode="invalid_scope",e})(),Re=(()=>{class e extends f{}return e.errorCode="access_denied",e})(),U=(()=>{class e extends f{}return e.errorCode="server_error",e})(),Ae=(()=>{class e extends f{}return e.errorCode="temporarily_unavailable",e})(),Ee=(()=>{class e extends f{}return e.errorCode="unsupported_response_type",e})(),Oe=(()=>{class e extends f{}return e.errorCode="unsupported_token_type",e})(),Ce=(()=>{class e extends f{}return e.errorCode="invalid_token",e})(),Te=(()=>{class e extends f{}return e.errorCode="method_not_allowed",e})(),Ue=(()=>{class e extends f{}return e.errorCode="too_many_requests",e})(),q=(()=>{class e extends f{}return e.errorCode="invalid_client_metadata",e})(),Ye=(()=>{class e extends f{}return e.errorCode="insufficient_scope",e})(),ke=(()=>{class e extends f{}return e.errorCode="invalid_target",e})();const nt={[ge.errorCode]:ge,[z.errorCode]:z,[D.errorCode]:D,[W.errorCode]:W,[we.errorCode]:we,[ve.errorCode]:ve,[Re.errorCode]:Re,[U.errorCode]:U,[Ae.errorCode]:Ae,[Ee.errorCode]:Ee,[Oe.errorCode]:Oe,[Ce.errorCode]:Ce,[Te.errorCode]:Te,[Ue.errorCode]:Ue,[q.errorCode]:q,[Ye.errorCode]:Ye,[ke.errorCode]:ke};class C extends Error{constructor(t){super(t??"Unauthorized")}}const F="code",V="S256";function je(e){return N.apply(this,arguments)}function N(){return(N=(0,p.A)(function*(e){const t=e instanceof Response?e.status:void 0,r=e instanceof Response?yield e.text():e;try{const n=Ke.parse(JSON.parse(r)),{error:s,error_description:i,error_uri:c}=n;return new(nt[s]||U)(i||"",c)}catch(n){return new U(`${t?`HTTP ${t}: `:""}Invalid OAuth error response: ${n}. Raw body: ${r}`)}})).apply(this,arguments)}function j(e,t){return B.apply(this,arguments)}function B(){return(B=(0,p.A)(function*(e,t){try{return yield Z(e,t)}catch(r){if(r instanceof z||r instanceof W)return yield e.invalidateCredentials?.("all"),yield Z(e,t);if(r instanceof D)return yield e.invalidateCredentials?.("tokens"),yield Z(e,t);throw r}})).apply(this,arguments)}function Z(e,t){return G.apply(this,arguments)}function G(){return G=(0,p.A)(function*(e,{serverUrl:t,authorizationCode:r,scope:n,resourceMetadataUrl:s,fetchFn:i}){let c,a;try{c=yield function ht(e,t){return Q.apply(this,arguments)}(t,{resourceMetadataUrl:s},i),c.authorization_servers&&c.authorization_servers.length>0&&(a=c.authorization_servers[0])}catch{}a||(a=new URL("/",t));const u=yield function _t(e,t,r){return J.apply(this,arguments)}(t,e,c),_=yield function gt(e){return oe.apply(this,arguments)}(a,{fetchFn:i});let g=yield Promise.resolve(e.clientInformation());if(!g){if(void 0!==r)throw new Error("Existing OAuth client information is required when exchanging an authorization code");const d=!0===_?.client_id_metadata_document_supported,h=e.clientMetadataUrl;if(h&&!function pt(e){if(!e)return!1;try{const t=new URL(e);return"https:"===t.protocol&&"/"!==t.pathname}catch{return!1}}(h))throw new q(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${h}`);if(d&&h)g={client_id:h},yield e.saveClientInformation?.(g);else{if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");const T=yield function At(e,t){return de.apply(this,arguments)}(a,{metadata:_,clientMetadata:e.clientMetadata,fetchFn:i});yield e.saveClientInformation(T),g=T}}if(void 0!==r||!e.redirectUrl){const d=yield function Rt(e,t){return le.apply(this,arguments)}(e,a,{metadata:_,resource:u,authorizationCode:r,fetchFn:i});return yield e.saveTokens(d),"AUTHORIZED"}const w=yield e.tokens();if(w?.refresh_token)try{const d=yield function vt(e,t){return ue.apply(this,arguments)}(a,{metadata:_,clientInformation:g,refreshToken:w.refresh_token,resource:u,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return yield e.saveTokens(d),"AUTHORIZED"}catch(d){if(d instanceof f&&!(d instanceof U))throw d}const y=e.state?yield e.state():void 0,{authorizationUrl:v,codeVerifier:l}=yield function wt(e,t){return se.apply(this,arguments)}(a,{metadata:_,clientInformation:g,state:y,redirectUrl:e.redirectUrl,scope:n||c?.scopes_supported?.join(" ")||e.clientMetadata.scope,resource:u});return yield e.saveCodeVerifier(l),yield e.redirectToAuthorization(v),"REDIRECT"}),G.apply(this,arguments)}function J(){return(J=(0,p.A)(function*(e,t,r){const n=function tt(e){const t="string"==typeof e?new URL(e):new URL(e.href);return t.hash="",t}(e);if(t.validateResourceURL)return yield t.validateResourceURL(n,r?.resource);if(r){if(!function rt({requestedResource:e,configuredResource:t}){const r="string"==typeof e?new URL(e):new URL(e.href),n="string"==typeof t?new URL(t):new URL(t.href);if(r.origin!==n.origin||r.pathname.length<n.pathname.length)return!1;const s=r.pathname.endsWith("/")?r.pathname:r.pathname+"/",i=n.pathname.endsWith("/")?n.pathname:n.pathname+"/";return s.startsWith(i)}({requestedResource:n,configuredResource:r.resource}))throw new Error(`Protected resource ${r.resource} does not match expected ${n} (or origin)`);return new URL(r.resource)}})).apply(this,arguments)}function be(e){const t=e.headers.get("WWW-Authenticate");if(!t)return{};const[r,n]=t.split(" ");if("bearer"!==r.toLowerCase()||!n)return{};const s=K(e,"resource_metadata")||void 0;let i;if(s)try{i=new URL(s)}catch{}return{resourceMetadataUrl:i,scope:K(e,"scope")||void 0,error:K(e,"error")||void 0}}function K(e,t){const r=e.headers.get("WWW-Authenticate");if(!r)return null;const n=new RegExp(`${t}=(?:"([^"]+)"|([^\\s,]+))`),s=r.match(n);return s?s[1]||s[2]:null}function Q(){return(Q=(0,p.A)(function*(e,t,r=fetch){const n=yield function Se(e,t,r,n){return re.apply(this,arguments)}(e,"oauth-protected-resource",r,{protocolVersion:t?.protocolVersion,metadataUrl:t?.resourceMetadataUrl});if(!n||404===n.status)throw yield n?.body?.cancel(),new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!n.ok)throw yield n.body?.cancel(),new Error(`HTTP ${n.status} trying to load well-known OAuth protected resource metadata.`);return Be.parse(yield n.json())})).apply(this,arguments)}function X(e,t){return ee.apply(this,arguments)}function ee(){return(ee=(0,p.A)(function*(e,t,r=fetch){try{return yield r(e,{headers:t})}catch(n){if(n instanceof TypeError)return t?X(e,void 0,r):void 0;throw n}})).apply(this,arguments)}function Ie(e,t){return te.apply(this,arguments)}function te(){return(te=(0,p.A)(function*(e,t,r=fetch){return yield X(e,{"MCP-Protocol-Version":t},r)})).apply(this,arguments)}function re(){return(re=(0,p.A)(function*(e,t,r,n){const s=new URL(e),i=n?.protocolVersion??A.aE;let c;if(n?.metadataUrl)c=new URL(n.metadataUrl);else{const u=function ft(e,t="",r={}){return t.endsWith("/")&&(t=t.slice(0,-1)),r.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}(t,s.pathname);c=new URL(u,n?.metadataServerUrl??s),c.search=s.search}let a=yield Ie(c,i,r);if(!n?.metadataUrl&&function yt(e,t){return!e||e.status>=400&&e.status<500&&"/"!==t}(a,s.pathname)){const u=new URL(`/.well-known/${t}`,s);a=yield Ie(u,i,r)}return a})).apply(this,arguments)}function oe(){return(oe=(0,p.A)(function*(e,{fetchFn:t=fetch,protocolVersion:r=A.aE}={}){const n={"MCP-Protocol-Version":r,Accept:"application/json"},s=function mt(e){const t="string"==typeof e?new URL(e):e,n=[];if("/"===t.pathname)return n.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"}),n.push({url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),n;let s=t.pathname;return s.endsWith("/")&&(s=s.slice(0,-1)),n.push({url:new URL(`/.well-known/oauth-authorization-server${s}`,t.origin),type:"oauth"}),n.push({url:new URL(`/.well-known/openid-configuration${s}`,t.origin),type:"oidc"}),n.push({url:new URL(`${s}/.well-known/openid-configuration`,t.origin),type:"oidc"}),n}(e);for(const{url:i,type:c}of s){const a=yield X(i,n,t);if(a){if(!a.ok){if(yield a.body?.cancel(),a.status>=400&&a.status<500)continue;throw new Error(`HTTP ${a.status} trying to load ${"oauth"===c?"OAuth":"OpenID provider"} metadata from ${i}`)}return"oauth"===c?ye.parse(yield a.json()):Ge.parse(yield a.json())}}})).apply(this,arguments)}function se(){return se=(0,p.A)(function*(e,{metadata:t,clientInformation:r,redirectUrl:n,scope:s,state:i,resource:c}){let a;if(t){if(a=new URL(t.authorization_endpoint),!t.response_types_supported.includes(F))throw new Error(`Incompatible auth server: does not support response type ${F}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(V))throw new Error(`Incompatible auth server: does not support code challenge method ${V}`)}else a=new URL("/authorize",e);const u=yield function We(e){return $.apply(this,arguments)}(),_=u.code_verifier,g=u.code_challenge;return a.searchParams.set("response_type",F),a.searchParams.set("client_id",r.client_id),a.searchParams.set("code_challenge",g),a.searchParams.set("code_challenge_method",V),a.searchParams.set("redirect_uri",String(n)),i&&a.searchParams.set("state",i),s&&a.searchParams.set("scope",s),s?.includes("offline_access")&&a.searchParams.append("prompt","consent"),c&&a.searchParams.set("resource",c.href),{authorizationUrl:a,codeVerifier:_}}),se.apply(this,arguments)}function ie(e,t){return ae.apply(this,arguments)}function ae(){return(ae=(0,p.A)(function*(e,{metadata:t,tokenRequestParams:r,clientInformation:n,addClientAuthentication:s,resource:i,fetchFn:c}){const a=t?.token_endpoint?new URL(t.token_endpoint):new URL("/token",e),u=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(i&&r.set("resource",i.href),s)yield s(u,r,a,t);else if(n){const R=function at(e,t){const r=void 0!==e.client_secret;return 0===t.length?r?"client_secret_post":"none":"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&function it(e){return["client_secret_basic","client_secret_post","none"].includes(e)}(e.token_endpoint_auth_method)&&t.includes(e.token_endpoint_auth_method)?e.token_endpoint_auth_method:r&&t.includes("client_secret_basic")?"client_secret_basic":r&&t.includes("client_secret_post")?"client_secret_post":t.includes("none")?"none":r?"client_secret_post":"none"}(n,t?.token_endpoint_auth_methods_supported??[]);!function ct(e,t,r,n){const{client_id:s,client_secret:i}=t;switch(e){case"client_secret_basic":return void function ut(e,t,r){if(!t)throw new Error("client_secret_basic authentication requires a client_secret");const n=btoa(`${e}:${t}`);r.set("Authorization",`Basic ${n}`)}(s,i,r);case"client_secret_post":return void function lt(e,t,r){r.set("client_id",e),t&&r.set("client_secret",t)}(s,i,n);case"none":return void function dt(e,t){t.set("client_id",e)}(s,n);default:throw new Error(`Unsupported client authentication method: ${e}`)}}(R,n,u,r)}const _=yield(c??fetch)(a,{method:"POST",headers:u,body:r});if(!_.ok)throw yield je(_);return Je.parse(yield _.json())})).apply(this,arguments)}function ue(){return(ue=(0,p.A)(function*(e,{metadata:t,clientInformation:r,refreshToken:n,resource:s,addClientAuthentication:i,fetchFn:c}){const a=new URLSearchParams({grant_type:"refresh_token",refresh_token:n});return{refresh_token:n,...yield ie(e,{metadata:t,tokenRequestParams:a,clientInformation:r,addClientAuthentication:i,resource:s,fetchFn:c})}})).apply(this,arguments)}function le(){return(le=(0,p.A)(function*(e,t,{metadata:r,resource:n,authorizationCode:s,fetchFn:i}={}){const c=e.clientMetadata.scope;let a;if(e.prepareTokenRequest&&(a=yield e.prepareTokenRequest(c)),!a){if(!s)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!e.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");a=function Me(e,t,r){return new URLSearchParams({grant_type:"authorization_code",code:e,code_verifier:t,redirect_uri:String(r)})}(s,yield e.codeVerifier(),e.redirectUrl)}return ie(t,{metadata:r,tokenRequestParams:a,clientInformation:(yield e.clientInformation())??void 0,addClientAuthentication:e.addClientAuthentication,resource:n,fetchFn:i})})).apply(this,arguments)}function de(){return(de=(0,p.A)(function*(e,{metadata:t,clientMetadata:r,fetchFn:n}){let s;if(t){if(!t.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");s=new URL(t.registration_endpoint)}else s=new URL("/register",e);const i=yield(n??fetch)(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(!i.ok)throw yield je(i);return et.parse(yield i.json())})).apply(this,arguments)}class Pe extends Error{constructor(t,r){super(t),this.name="ParseError",this.type=r.type,this.field=r.field,this.value=r.value,this.line=r.line}}function pe(e){}class Ct extends TransformStream{constructor({onError:t,onRetry:r,onComment:n}={}){let s;super({start(i){s=function Et(e){if("function"==typeof e)throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:t=pe,onError:r=pe,onRetry:n=pe,onComment:s}=e;let a,i="",c=!0,u="",_="";function R(l){if(""===l)return void function y(){u.length>0&&t({id:a,event:_||void 0,data:u.endsWith("\n")?u.slice(0,-1):u}),a=void 0,u="",_=""}();if(l.startsWith(":"))return void(s&&s(l.slice(l.startsWith(": ")?2:1)));const d=l.indexOf(":");-1===d?w(l,"",l):w(l.slice(0,d),l.slice(d+(" "===l[d+1]?2:1)),l)}function w(l,d,h){switch(l){case"event":_=d;break;case"data":u=`${u}${d}\n`;break;case"id":a=d.includes("\0")?void 0:d;break;case"retry":/^\d+$/.test(d)?n(parseInt(d,10)):r(new Pe(`Invalid \`retry\` value: "${d}"`,{type:"invalid-retry",value:d,line:h}));break;default:r(new Pe(`Unknown field "${l.length>20?`${l.slice(0,20)}\u2026`:l}"`,{type:"unknown-field",field:l,value:d,line:h}))}}return{feed:function g(l){const d=c?l.replace(/^\xEF\xBB\xBF/,""):l,[h,Y]=function Ot(e){const t=[];let r="",n=0;for(;n<e.length;){const s=e.indexOf("\r",n),i=e.indexOf("\n",n);let c=-1;if(-1!==s&&-1!==i?c=Math.min(s,i):-1!==s?c=s===e.length-1?-1:s:-1!==i&&(c=i),-1===c){r=e.slice(n);break}{const a=e.slice(n,c);t.push(a),n=c+1,"\r"===e[n-1]&&"\n"===e[n]&&n++}}return[t,r]}(`${i}${d}`);for(const T of h)R(T);i=Y,c=!1},reset:function v(l={}){i&&l.consume&&R(i),c=!0,a=void 0,u="",_="",i=""}}}({onEvent:c=>{i.enqueue(c)},onError(c){"terminate"===t?i.error(c):"function"==typeof t&&t(c)},onRetry:r,onComment:n})},transform(i){s.feed(i)}})}}const Tt={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2};class O extends Error{constructor(t,r){super(`Streamable HTTP error: ${r}`),this.code=t}}class Ut{constructor(t,r){this._hasCompletedAuthFlow=!1,this._url=t,this._resourceMetadataUrl=void 0,this._scope=void 0,this._requestInit=r?.requestInit,this._authProvider=r?.authProvider,this._fetch=r?.fetch,this._fetchWithInit=function Le(e=fetch,t){return t?function(){var r=(0,p.A)(function*(n,s){const i={...t,...s,headers:s?.headers?{...b(t.headers),...b(s.headers)}:t.headers};return e(n,i)});return function(n,s){return r.apply(this,arguments)}}():e}(r?.fetch,r?.requestInit),this._sessionId=r?.sessionId,this._reconnectionOptions=r?.reconnectionOptions??Tt}_authThenStart(){var t=this;return(0,p.A)(function*(){if(!t._authProvider)throw new C("No auth provider");let r;try{r=yield j(t._authProvider,{serverUrl:t._url,resourceMetadataUrl:t._resourceMetadataUrl,scope:t._scope,fetchFn:t._fetchWithInit})}catch(n){throw t.onerror?.(n),n}if("AUTHORIZED"!==r)throw new C;return yield t._startOrAuthSse({resumptionToken:void 0})})()}_commonHeaders(){var t=this;return(0,p.A)(function*(){const r={};if(t._authProvider){const s=yield t._authProvider.tokens();s&&(r.Authorization=`Bearer ${s.access_token}`)}t._sessionId&&(r["mcp-session-id"]=t._sessionId),t._protocolVersion&&(r["mcp-protocol-version"]=t._protocolVersion);const n=b(t._requestInit?.headers);return new Headers({...r,...n})})()}_startOrAuthSse(t){var r=this;return(0,p.A)(function*(){const{resumptionToken:n}=t;try{const s=yield r._commonHeaders();s.set("Accept","text/event-stream"),n&&s.set("last-event-id",n);const i=yield(r._fetch??fetch)(r._url,{method:"GET",headers:s,signal:r._abortController?.signal});if(!i.ok){if(yield i.body?.cancel(),401===i.status&&r._authProvider)return yield r._authThenStart();if(405===i.status)return;throw new O(i.status,`Failed to open SSE stream: ${i.statusText}`)}r._handleSseStream(i.body,t,!0)}catch(s){throw r.onerror?.(s),s}})()}_getNextReconnectionDelay(t){if(void 0!==this._serverRetryMs)return this._serverRetryMs;const s=this._reconnectionOptions.maxReconnectionDelay;return Math.min(this._reconnectionOptions.initialReconnectionDelay*Math.pow(this._reconnectionOptions.reconnectionDelayGrowFactor,t),s)}_scheduleReconnection(t,r=0){const n=this._reconnectionOptions.maxRetries;if(r>=n)return void this.onerror?.(new Error(`Maximum reconnection attempts (${n}) exceeded.`));const s=this._getNextReconnectionDelay(r);this._reconnectionTimeout=setTimeout(()=>{this._startOrAuthSse(t).catch(i=>{this.onerror?.(new Error(`Failed to reconnect SSE stream: ${i instanceof Error?i.message:String(i)}`)),this._scheduleReconnection(t,r+1)})},s)}_handleSseStream(t,r,n){var s=this;if(!t)return;const{onresumptiontoken:i,replayMessageId:c}=r;let a,u=!1,_=!1;!function(){var R=(0,p.A)(function*(){try{const w=t.pipeThrough(new TextDecoderStream).pipeThrough(new Ct({onRetry:l=>{s._serverRetryMs=l}})).getReader();for(;;){const{value:l,done:d}=yield w.read();if(d)break;if(l.id&&(a=l.id,u=!0,i?.(l.id)),l.data&&(!l.event||"message"===l.event))try{const h=A.OR.parse(JSON.parse(l.data));(0,A.ig)(h)&&(_=!0,void 0!==c&&(h.id=c)),s.onmessage?.(h)}catch(h){s.onerror?.(h)}}(n||u)&&!_&&s._abortController&&!s._abortController.signal.aborted&&s._scheduleReconnection({resumptionToken:a,onresumptiontoken:i,replayMessageId:c},0)}catch(w){if(s.onerror?.(new Error(`SSE stream disconnected: ${w}`)),(n||u)&&!_&&s._abortController&&!s._abortController.signal.aborted)try{s._scheduleReconnection({resumptionToken:a,onresumptiontoken:i,replayMessageId:c},0)}catch(l){s.onerror?.(new Error(`Failed to reconnect: ${l instanceof Error?l.message:String(l)}`))}}});return function(){return R.apply(this,arguments)}}()()}start(){var t=this;return(0,p.A)(function*(){if(t._abortController)throw new Error("StreamableHTTPClientTransport already started! If using Client class, note that connect() calls start() automatically.");t._abortController=new AbortController})()}finishAuth(t){var r=this;return(0,p.A)(function*(){if(!r._authProvider)throw new C("No auth provider");if("AUTHORIZED"!==(yield j(r._authProvider,{serverUrl:r._url,authorizationCode:t,resourceMetadataUrl:r._resourceMetadataUrl,scope:r._scope,fetchFn:r._fetchWithInit})))throw new C("Failed to authorize")})()}close(){var t=this;return(0,p.A)(function*(){t._reconnectionTimeout&&(clearTimeout(t._reconnectionTimeout),t._reconnectionTimeout=void 0),t._abortController?.abort(),t.onclose?.()})()}send(t,r){var n=this;return(0,p.A)(function*(){try{const{resumptionToken:s,onresumptiontoken:i}=r||{};if(s)return void n._startOrAuthSse({resumptionToken:s,replayMessageId:(0,A.vo)(t)?t.id:void 0}).catch(y=>n.onerror?.(y));const c=yield n._commonHeaders();c.set("content-type","application/json"),c.set("accept","application/json, text/event-stream");const a={...n._requestInit,method:"POST",headers:c,body:JSON.stringify(t),signal:n._abortController?.signal},u=yield(n._fetch??fetch)(n._url,a),_=u.headers.get("mcp-session-id");if(_&&(n._sessionId=_),!u.ok){const y=yield u.text().catch(()=>null);if(401===u.status&&n._authProvider){if(n._hasCompletedAuthFlow)throw new O(401,"Server returned 401 after successful authentication");const{resourceMetadataUrl:v,scope:l}=be(u);if(n._resourceMetadataUrl=v,n._scope=l,"AUTHORIZED"!==(yield j(n._authProvider,{serverUrl:n._url,resourceMetadataUrl:n._resourceMetadataUrl,scope:n._scope,fetchFn:n._fetchWithInit})))throw new C;return n._hasCompletedAuthFlow=!0,n.send(t)}if(403===u.status&&n._authProvider){const{resourceMetadataUrl:v,scope:l,error:d}=be(u);if("insufficient_scope"===d){const h=u.headers.get("WWW-Authenticate");if(n._lastUpscopingHeader===h)throw new O(403,"Server returned 403 after trying upscoping");if(l&&(n._scope=l),v&&(n._resourceMetadataUrl=v),n._lastUpscopingHeader=h??void 0,"AUTHORIZED"!==(yield j(n._authProvider,{serverUrl:n._url,resourceMetadataUrl:n._resourceMetadataUrl,scope:n._scope,fetchFn:n._fetch})))throw new C;return n.send(t)}}throw new O(u.status,`Error POSTing to endpoint: ${y}`)}if(n._hasCompletedAuthFlow=!1,n._lastUpscopingHeader=void 0,202===u.status)return yield u.body?.cancel(),void((0,A.wU)(t)&&n._startOrAuthSse({resumptionToken:void 0}).catch(y=>n.onerror?.(y)));const R=(Array.isArray(t)?t:[t]).filter(y=>"method"in y&&"id"in y&&void 0!==y.id).length>0,w=u.headers.get("content-type");if(R)if(w?.includes("text/event-stream"))n._handleSseStream(u.body,{onresumptiontoken:i},!1);else{if(!w?.includes("application/json"))throw yield u.body?.cancel(),new O(-1,`Unexpected content type: ${w}`);{const y=yield u.json(),v=Array.isArray(y)?y.map(l=>A.OR.parse(l)):[A.OR.parse(y)];for(const l of v)n.onmessage?.(l)}}else yield u.body?.cancel()}catch(s){throw n.onerror?.(s),s}})()}get sessionId(){return this._sessionId}terminateSession(){var t=this;return(0,p.A)(function*(){if(t._sessionId)try{const r=yield t._commonHeaders(),n={...t._requestInit,method:"DELETE",headers:r,signal:t._abortController?.signal},s=yield(t._fetch??fetch)(t._url,n);if(yield s.body?.cancel(),!s.ok&&405!==s.status)throw new O(s.status,`Failed to terminate session: ${s.statusText}`);t._sessionId=void 0}catch(r){throw t.onerror?.(r),r}})()}setProtocolVersion(t){this._protocolVersion=t}get protocolVersion(){return this._protocolVersion}resumeStream(t,r){var n=this;return(0,p.A)(function*(){yield n._startOrAuthSse({resumptionToken:t,onresumptiontoken:r?.onresumptiontoken})})()}}}}]);
|