PageSourceSearch

https://3dportal.ljubljana.si/portal/apps/instant/_astro/customElement.AUFQI7QM.js

js ljubljana.si collected 2026-09-24 17:14:33 UTC 4,326 bytes, 19 lines download raw bytes

1import{R as O,K as N,O as v,V as o,P as z,a3 as m,T as Y}from"./signal.CNCfU7Hw.js";import{g as Z}from"./guid.LcV_DAvu.js";import{c as j}from"./observers.CL7pjy4z.js";function H(t,s,n){const a=s[0]-t[0],h=n[0]-s[0],l=s[1]-t[1],c=n[1]-s[1],r=l/(a||h<0&&0),i=c/(h||a<0&&0),e=(r*h+i*a)/(a+h);return(Math.sign(r)+Math.sign(i))*Math.min(Math.abs(r),Math.abs(i),.5*Math.abs(e))||0}function C(t,s,n){const a=s[0]-t[0],h=s[1]-t[1];return a?(3*h/a-n)/2:n}function X(t,s,n,a,h){const[l,c]=t,[r,i]=s,e=(r-l)/3,$=h([l+e,c+e*n]).join(","),d=h([r-e,i-e*a]).join(","),g=h([r,i]).join(",");return`C ${$} ${d} ${g}`}function I({width:t,height:s,min:n,max:a}){const h=a[0]-n[0],l=a[1]-n[1];return c=>{const r=(c[0]-n[0])/h*t,i=s-(c[1]-n[1])/l*s;return[r,i]}}function R(t){const[s,n]=t[0],a=[s,n],h=[s,n];return t.reduce(({min:l,max:c},[r,i])=>({min:[Math.min(l[0],r),Math.min(l[1],i)],max:[Math.max(c[0],r),Math.max(c[1],i)]}),{min:a,max:h})}function A({data:t,min:s,max:n,t:a}){if(t.length===0)return"";const[h,l]=a(t[0]),[c,r]=a(s),[i]=a(n);let e,$,d;const g=t.reduce((b,k,p)=>{if($=t[p-2],d=t[p-1],p>1){const u=H($,d,k),M=e===void 0?C($,d,u):e,w=X($,d,M,u,a);return e=u,`${b} ${w}`}return b},`M ${c},${r} L ${c},${l} L ${h},${l}`),L=t[t.length-1],x=X(d,L,e,C(d,L,e),a);return`${g} ${x} L ${i},${r} Z`}const B=O`:host{display:block;block-size:100%}.svg{fill:currentColor;stroke:transparent;margin:0;display:block;block-size:100%;inline-size:100%;padding:0}.svg .graph-path--highlight{fill:var(--calcite-graph-highlight-fill-color, var(--calcite-color-brand));opacity:.5}:host([hidden]){display:none}[hidden]{display:none}`,y={svg:"svg",graphPath:"graph-path",graphPathHighlight:"graph-path--highlight"},P="calcite-graph",f={host:t=>`${P}-${t}`,linearGradient:t=>`linear-gradient-${P}-${t}`,mask:(t,s)=>`${P}-${t}${s}`};class E extends N{constructor(){super(...arguments),this.graphId=Z(),this.resizeObserver=j("resize",()=>this.requestUpdate()),this.data=[]}static{this.properties={colorStops:[0,{},{attribute:!1}],data:[0,{},{attribute:!1}],highlightMax:[9,{},{type:Number}],highlightMin:[9,{},{type:Number}],max:[11,{},{reflect:!0,type:Number}],min:[11,{},{reflect:!0,type:Number}]}}static{this.styles=B}connectedCallback(){super.connectedCallback(),this.resizeObserver?.observe(this.el)}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver?.disconnect()}render(){const{data:s,colorStops:n,el:a,highlightMax:h,highlightMin:l,min:c,max:r}=this,i=this.graphId,{clientHeight:e,clientWidth:$}=a;if(!s||s.length===0)return z`<svg aria-hidden=true class=${v(y.svg)} height=${e??o} preserveAspectRatio=none viewBox=${`0 0 ${$} ${e}`} width=${$??o}></svg>`;const{min:d,max:g}=R(s);let L=d,x=g;(c<d[0]||c>d[0])&&(L=[c,0]),(r>g[0]||r<g[0])&&(x=[r,g[1]]);const b=I({min:L,max:x,width:$,height:e}),[k]=b([l,x[1]]),[p]=b([h,x[1]]),u=A({data:s,min:d,max:g,t:b}),M=n?`url(#${f.linearGradient(i)})`:void 0;return z`<svg aria-hidden=true class=${v(y.svg)} height=${e??o} preserveAspectRatio=none viewBox=${`0 0 ${$} ${e}`} width=${$??o}>${n?m`<defs><linearGradient id=${f.linearGradient(i)??o} x1=0 x2=1 y1=0 y2=0>${n.map(({offset:w,color:G,opacity:S})=>m`<stop offset=${`${w*100}%`} stop-color=${G??o} stop-opacity=${S??o} />`)}</linearGradient></defs>`:null}${l!==void 0?[m`<mask height=100% id=${f.mask(i,1)??o} width=100% x=0% y=0%><path d=${`
2            M 0,0
3            L ${k-1},0
4            L ${k-1},${e}
5            L 0,${e}
6            Z
7          `} fill=white /></mask>`,m`<mask height=100% id=${f.mask(i,2)??o} width=100% x=0% y=0%><path d=${`
8            M ${k+1},0
9            L ${p-1},0
10            L ${p-1},${e}
11            L ${k+1}, ${e}
12            Z
13          `} fill=white /></mask>`,m`<mask height=100% id=${f.mask(i,3)??o} width=100% x=0% y=0%><path d=${`
14                M ${p+1},0
15                L ${$},0
16                L ${$},${e}
17                L ${p+1}, ${e}
18                Z
19              `} fill=white /></mask>`,m`<path class=${v(y.graphPath)} d=${u??o} fill=${M??o} mask=${`url(#${f.mask(i,1)})`} />`,m`<path class=${v(y.graphPathHighlight)} d=${u??o} fill=${M??o} mask=${`url(#${f.mask(i,2)})`} />`,m`<path class=${v(y.graphPath)} d=${u??o} fill=${M??o} mask=${`url(#${f.mask(i,3)})`} />`]:m`<path class=${v(y.graphPath)} d=${u??o} fill=${M??o} />`}</svg>`}}
19Y("calcite-graph",E);export{E as Graph};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.