@geops/rvf-mobility-web-component 0.1.92 → 0.1.93
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/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [0.1.93](https://github.com/geops/rvf-mobility-web-component/compare/v0.1.92...v0.1.93) (2025-11-27)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* avoid js error when info links have empry values ([7447aee](https://github.com/geops/rvf-mobility-web-component/commit/7447aee5d32ddb25b5a9f03c15cd90f5fba2cfc6))
|
|
11
|
+
* avoid js error when info links have null values ([913f583](https://github.com/geops/rvf-mobility-web-component/commit/913f58382ab2bd9bbc92c8326d3415503ee3d412))
|
|
12
|
+
|
|
5
13
|
### [0.1.92](https://github.com/geops/rvf-mobility-web-component/compare/v0.1.91...v0.1.92) (2025-11-20)
|
|
6
14
|
|
|
7
15
|
|
package/index.js
CHANGED
|
@@ -1281,7 +1281,7 @@ end`};t.events.push(["putFont",function(n){(function(l){var h=l.font,d=l.out,p=l
|
|
|
1281
1281
|
/* transform: rotate(-45deg); */
|
|
1282
1282
|
`,children:j("path",{d:"M13.2928932,5.29289322 C13.6834175,4.90236893 14.3165825,4.90236893 14.7071068,5.29289322 L20.7071068,11.2928932 C20.7355731,11.3213595 20.7623312,11.3515341 20.787214,11.3832499 C20.7927155,11.3901576 20.7982466,11.397397 20.8036654,11.4046934 C20.8215099,11.4288693 20.8382813,11.453725 20.8539326,11.4793398 C20.8613931,11.4913869 20.8685012,11.5036056 20.8753288,11.5159379 C20.8862061,11.5357061 20.8966234,11.5561086 20.9063462,11.5769009 C20.914321,11.5939015 20.9218036,11.6112044 20.9287745,11.628664 C20.9366843,11.6484208 20.9438775,11.6682023 20.9504533,11.6882636 C20.9552713,11.7031487 20.9599023,11.7185367 20.9641549,11.734007 C20.9701664,11.7555635 20.9753602,11.7772539 20.9798348,11.7992059 C20.9832978,11.8166247 20.9863719,11.834051 20.9889822,11.8515331 C20.9962388,11.8996379 21,11.9493797 21,12 L20.9962979,11.9137692 C20.9978436,11.9317345 20.9989053,11.9497336 20.9994829,11.9677454 L21,12 C21,12.0112225 20.9998151,12.0224019 20.9994483,12.0335352 C20.9988772,12.050591 20.997855,12.0679231 20.996384,12.0852242 C20.994564,12.1070574 20.9920941,12.1281144 20.9889807,12.1489612 C20.9863719,12.165949 20.9832978,12.1833753 20.9797599,12.2007258 C20.9753602,12.2227461 20.9701664,12.2444365 20.964279,12.2658396 C20.9599023,12.2814633 20.9552713,12.2968513 20.9502619,12.3121425 C20.9438775,12.3317977 20.9366843,12.3515792 20.928896,12.3710585 C20.9218036,12.3887956 20.914321,12.4060985 20.9063266,12.4232215 C20.8966234,12.4438914 20.8862061,12.4642939 20.8751242,12.484277 C20.8685012,12.4963944 20.8613931,12.5086131 20.8540045,12.5207088 C20.8382813,12.546275 20.8215099,12.5711307 20.8036865,12.5951593 C20.774687,12.6343256 20.7425008,12.6717127 20.7071068,12.7071068 L20.787214,12.6167501 C20.7849289,12.6196628 20.7826279,12.6225624 20.7803112,12.625449 L20.7071068,12.7071068 L14.7071068,18.7071068 C14.3165825,19.0976311 13.6834175,19.0976311 13.2928932,18.7071068 C12.9023689,18.3165825 12.9023689,17.6834175 13.2928932,17.2928932 L17.585,13 L4,13 C3.48716416,13 3.06449284,12.6139598 3.00672773,12.1166211 L3,12 C3,11.4477153 3.44771525,11 4,11 L17.585,11 L13.2928932,6.70710678 C12.9324093,6.34662282 12.9046797,5.77939176 13.2097046,5.38710056 Z",fill:"currentColor",fillRule:"nonzero",id:"Combined-Shape",style:`
|
|
1283
1283
|
/* transform: rotate(-45deg); */
|
|
1284
|
-
`})})]})}var rF=Ud1;var Qd1="my-1 flex items-center leading-[1.1] underline text-base items-center justify-left font-semibold gap-1",Hd1={primary:{classes:"bg-red text-white disabled:bg-lightgrey hover:bg-darkred hover:border-darkred active:bg-lightred active:border-lightred ",selectedClasses:"bg-darkred border-darkred"},secondary:{classes:"bg-white text-black hover:text-red active:text-lightred",selectedClasses:"text-red"}};function Vd1({children:r,className:t,theme:e="secondary",...i}){let o=It(()=>ie(`${Qd1} ${Hd1[e].classes} ${t||""}`),[t,e]);return j("a",{className:o,rel:"noreferrer",target:"_blank",...i,children:[(!i.href?.includes(window.location.hostname)||!i.href?.startsWith("(https?|ftp)"))&&j(rF,{height:"20",width:"20"}),r]})}var ds=et(Vd1);var uX=(r,t,e,i=!0)=>{let o=r.toLocaleTimeString(["de"],{hour:"2-digit",minute:"2-digit"});return`${r.toLocaleDateString(["de"],{day:"2-digit",month:i?"short":"long",year:e?"numeric":void 0})}${t&&o?` ${o}`:""}`.replace(",","")};function Gd1({canToggle:r=!1,headerClassName:t,iconClassName:e,publicationClassName:i,reasonClassName:o,situation:n,timeIntervalClassName:l,useShortMonth:h=!0}){let{locale:d,t:p}=j5(),[C,M]=ft(!r);if(!n)return null;let B={},y={},O=[],Q=[],H=[];return Q=(n?.publications||[])?.filter(({publicationWindows:t1})=>(!t1?.length&&n?.publicationWindows?.length&&(t1=n?.publicationWindows),t1.find(({endTime:e1,startTime:J})=>{let g1=new Date,b1=new Date(J),T1=new Date(e1);return b1<=g1&&g1<=T1})))||[],O=(n?.affectedTimeIntervals||[]).filter(({endTime:t1,startTime:e1})=>{let J=new Date,g1=new Date(e1),b1=new Date(t1);return g1<=J&&J<=b1||J<g1})||[],H=(n?.reasons||[]).map(({name:t1})=>t1),j(We,{children:Q?.map(({id:t1,publicationLines:e1,publicationStops:J,textualContentLarge:g1,textualContentMedium:b1,textualContentSmall:T1})=>{B=g1||b1||T1,y=B?.[d()],y?.summary||(y=B?.de);let x1=e1?.flatMap(D1=>D1.lines?.map(({name:a1})=>a1)||[])||[],C1=J.map(D1=>D1?.name||"");return j("div",{className:ie("text-base",i),children:[j("div",{className:ie("text-xs uppercase",o),children:H}),j("h3",{className:ie("space-x-2 text-xl leading-[1.3] font-bold text-balance",t),children:[j("span",{className:"inline-block align-middle",children:j(eF,{className:ie(e)})}),j("span",{className:"align-middle *:inline",dangerouslySetInnerHTML:{__html:y?.summary}})]}),j("hr",{className:"my-1"}),O?.map(({dailyEndTime:D1,dailyStartTime:a1,endTime:w1,startTime:Q1},j1)=>{let c2=D1&&a1,C2=w1.includes("2500"),Y1=uX(new Date(Q1),!1,!0,h),H1=C2?void 0:uX(new Date(w1),!1,!0,h);return j("button",{className:ie("flex w-full items-center",r&&"cursor-pointer"),onClick:()=>{M(!C)},tabIndex:r?0:-1,children:[j("div",{className:ie("flex-1 text-left text-sm font-bold text-balance",l),children:[j("span",{children:[Y1&&H1?`${Y1} \u2013 ${H1}`:null,Y1&&!H1?p("from",{from:Y1}):null]}),c2&&j("span",{children:` (${p("daily_from_to",{from:a1,to:D1})})`})]},Q1),r&&j1==0&&j(We,{children:C?j(sL,{className:"text-red"}):j(_c,{className:"text-red"})})]},Q1)}),j("div",{className:C?"my-4 flex flex-col gap-4":"hidden",children:[y?.description&&j("div",{dangerouslySetInnerHTML:{__html:y?.description}}),!!B?.images?.length&&j("div",{className:"flex flex-wrap gap-2",children:B.images.map(({image:{absoluteUrl:D1,label:a1}})=>j("img",{alt:a1,className:"h-fit",src:D1,title:a1},D1+a1))}),!!B?.infoLinks?.length&&j("div",{children:B.infoLinks.map(({label:D1,uri:a1})=>{let w1=D1[d()]||D1.de||a1;return j(ds,{href:a1,title:w1,children:w1},a1)})}),!!x1?.length&&j("div",{children:[j("div",{className:"font-bold",children:[p("affected_lines"),":"]}),j("div",{className:"flex flex-wrap gap-1 text-sm",children:x1?.map(D1=>j("div",{className:"bg-red rounded-sm px-[2px] py-[0px] font-semibold text-white",children:D1},D1))})]}),!!C1?.length&&j("div",{children:[j("div",{className:"font-bold",children:[p("affected_stops"),":"]}),j("div",{className:"flex flex-wrap gap-1 text-sm",children:C1.map(D1=>j("div",{className:"bg-red rounded-sm px-[2px] py-[0px] font-semibold text-white",children:D1},D1))})]})]}),r&&j("hr",{className:"my-1"})]},t1)})})}var lL=et(Gd1);function jd1(r,t){let{lang:e,notificationsLayer:i,previewNotifications:o}=Ct(),[n,l]=ft(),h=It(()=>i?.api,[i]);return G2(()=>{let d=o?.find(C=>C.id===r);if(d){l(d);return}let p=new AbortController;return h?.exportById(r,{contentLarge:!0,contentMedium:!0,contentSmall:!0,includeGeoms:!1,includeLines:!0,includeStops:!0,[e]:!0,limit:1,...t||{}}).then(C=>{l(C)}).catch(C=>{if(C.code!==20){l(void 0),console.error("Failed to fetch situation",C);return}}),()=>{p.abort()}},[h,r,t,e,o]),n}var hX=jd1;function qd1({className:r,feature:t,...e}){let{situationId:i}=t.getProperties(),o=hX(i);return console.log("situationParsed",t.getProperties()),j(Bn,{...e,className:ie("px-4 text-base",r),children:j(lL,{situation:o})})}var Fy=qd1;var iF=(r,t)=>t?j("a",{className:"whitespace-normal underline",href:t,rel:"noreferrer",target:"_blank",children:r}):r;function Kd1({stopSequence:r}){return!r.operator&&!r.publisher?null:j(We,{children:j("div",{className:"m-4 mb-0 flex flex-wrap text-[10px] text-gray-500",children:[r.operator&&iF(r.operator,r.operatorUrl),r.operator&&r.publisher&&j("span",{children:" - "}),r.publisher&&iF(r.publisher,r.publisherUrl),r.license&&j("span",{children:"\xA0("}),r.license&&iF(r.license,r.licenseUrl),r.license&&")"]})})}var nF=et(Kd1);function Wd1({...r}){return j("svg",{fill:"none",height:"24",part:"svg",viewBox:"0 0 14 14",width:"24",xmlns:"http://www.w3.org/2000/svg",...r,children:[j("path",{clipRule:"evenodd",d:"M7 0.333344C7.375 0.333344 7.66667 0.62501 7.66667 0.97921V2.35414C9.7292 2.66668 11.3333 4.27081 11.625 6.33334H13C13.375 6.33334 13.6667 6.62501 13.6667 7.00001C13.6667 7.37501 13.375 7.66668 13 7.66668H11.625C11.3333 9.70834 9.70833 11.3333 7.66667 11.625V13C7.66667 13.375 7.375 13.6667 7 13.6667C6.64587 13.6667 6.33333 13.375 6.33333 13V11.625C4.29167 11.3333 2.68747 9.70834 2.39587 7.66668H1C0.625 7.66668 0.333333 7.37501 0.333333 7.00001C0.333333 6.62501 0.625 6.33334 1 6.33334H2.39587C2.68747 4.27081 4.29167 2.66668 6.33333 2.35414V0.97921C6.33333 0.62501 6.64587 0.333344 7 0.333344ZM7 3.66668C5.16667 3.66668 3.66667 5.16668 3.66667 7.00001C3.66667 8.79168 5.08333 10.3125 7 10.3125C8.89587 10.3125 10.3333 8.81254 10.3333 7.00001C10.3333 5.16668 8.83333 3.66668 7 3.66668Z",fill:"currentColor",fillRule:"evenodd"}),j("path",{clipRule:"evenodd",d:"M5.66667 7.00001C5.66667 6.27081 6.2708 5.66668 7 5.66668C7.7292 5.66668 8.33333 6.27081 8.33333 7.00001C8.33333 7.72921 7.7292 8.33334 7 8.33334C6.2708 8.33334 5.66667 7.72921 5.66667 7.00001Z",fill:"currentColor",fillRule:"evenodd",part:"circle"})]})}var oF=Wd1;function $d1({stopSequence:r,...t}){let{destination:e}=r||{};return j("span",{...t,children:e})}var aF=et($d1);function Xd1({stopSequence:r,...t}){let{longName:e,routeIdentifier:i}=r||{},o=e;if(i){let n=i;i.includes(".")?[n]=i.split("."):i.includes("_")?[n]=i.split("_"):i.includes(":")&&([n]=i.split(":")),/^\d*$/.test(n)&&(n=`${parseInt(n,10)}`),e.includes(n)||(o=`${e} (${n})`)}return j("span",{...t,children:o})}var sF=et(Xd1);function Yd1({stopSequence:r,...t}){return j("div",{...t,children:[j(aF,{className:"text-base font-bold",stopSequence:r}),j(sF,{className:"text-sm",stopSequence:r})]})}var lF=et(Yd1);function Jd1({stopSequence:r}){let{isFollowing:t,setIsFollowing:e}=Ct();return j("div",{className:"flex items-center gap-x-4 bg-slate-100 p-4 py-2",children:[j(n4,{stopSequence:r}),j(lF,{className:"flex grow flex-col",stopSequence:r}),j(p0,{className:`${t?"animate-pulse":""}`,onClick:()=>{e(!t)},selected:t,children:j(oF,{})})]})}var cF=et(Jd1);var tf1=()=>It(()=>{let t=new URLSearchParams(window.location.search).get("debug");return!t||t==="false"?!1:t},[]),Py=tf1;var uF=L8({index:null,invertColor:null,station:null,status:null,stop:null,stopSequence:null}),ef1=()=>{let r=C6(uF);if(!r)throw new Error("useRouteStop must be used within a ContextProvider");return r},F9=ef1;function rf1(r){let{status:t,stop:e}=F9();return Py()?j("div",{className:"p-4 text-left text-xs",...r,children:[j("div",{children:["State: ",j("b",{children:e.state})," (isPassed: ",`${t.isPassed}`,") (cancelled: ",`${e.cancelled}`,")"]}),j("div",{children:["Arrival time: ",e.arrivalTime," (delay: ",j("b",{children:`${e.arrivalDelay}`}),") (aimed: ",e.aimedArrivalTime,")"]}),j("div",{children:["Departure time: ",e.arrivalTime," (delay:"," ",j("b",{children:`${e.departureDelay}`}),") (aimed: ",e.aimedArrivalTime,")"]}),j("div",{children:Object.entries(t).map(([o,n])=>n===!1?null:j("div",{children:[o,": ",`${n}`]},o))})]}):null}var AX=rf1;var if1=(r,t=!1)=>{let e=Math.round(r/1e3/60);return e>5?"#dc2626":e>=3?"#ea580c":t?"#16a34a":"transparent"},cL=if1;var nf1=r=>{let t=r;t<0&&(t=0);let e=Math.floor(t/36e5),i=Math.round(t%36e5/6e4),o="";return e>0&&(o+=`${e}h`),i>0&&(o+=`${i}m`),o||"0"},uL=nf1;function of1(r){let{status:t,stop:e}=F9(),{arrivalDelay:i,departureDelay:o}=e,n=t.isNotRealtime||t.isCancelled||t.isNotStop||t.isPassed;return j("div",{...r,children:[n||i===null||t.isFirst?null:j("span",{style:{color:cL(i)},children:`+${uL(i)}`}),n||o===null||t.isLast?null:j("span",{style:{color:cL(i)},children:`+${uL(o)}`})]})}var hF=et(of1);function af1({svgProps:r,...t}){let{invertColor:e,status:i,stopSequence:o}=F9(),{isBoarding:n,isFirst:l,isLast:h,isLeft:d,isPassed:p,progress:C}=i,M=l?"50%":"-100%",B=h?"50%":"100%",y=`${C}%`,O="rgb(156, 163, 175)",Q=_A(o),H=p?O:Q,G=p?Q:O,t1=O;e&&(H=p?Q:O,G=p?O:Q,t1=Q);let e1=!p&&(d||n)?G:H;return j("div",{...t,children:j("svg",{fill:"none",height:"100%",stroke:H,width:"16",xmlns:"http://www.w3.org/2000/svg",...r,children:[j("circle",{cx:"50%",cy:"50%",r:"5",stroke:"black",strokeWidth:"6"}),j("line",{stroke:"black",strokeWidth:"6",x1:"50%",x2:"50%",y1:M,y2:B}),j("line",{stroke:t1,strokeWidth:"4",x1:"50%",x2:"50%",y1:M,y2:y}),j("line",{strokeWidth:"4",x1:"50%",x2:"50%",y1:`${C-2}%`,y2:B}),j("circle",{cx:"50%",cy:"50%",r:"5",strokeWidth:"4"}),j("circle",{className:n?"animate-pulse":"",cx:"50%",cy:"50%",r:"5",stroke:e1,strokeWidth:"4"}),j("circle",{cx:"50%",cy:"50%",fill:"white",r:"3",stroke:"black",strokeWidth:"1"})]})})}var AF=et(af1);function sf1({...r}){let{stop:t,stopSequence:e}=F9(),{type:i}=e,{t:o}=j5(),{platform:n}=t||{};if(!n)return null;let l=o(`platform_${i||"rail"}`);return j("span",{...r,children:[l||o("platform_rail")," ",n]})}var dF=et(sf1);function lf1({children:r,...t}){let{stop:e}=F9(),{stationName:i}=e||{};return j("div",{...t,children:[i,j("br",{}),j(dF,{className:"rounded-sm bg-slate-100 px-0.5 py-px text-xs group-hover:bg-slate-50"}),r]})}var fF=et(lf1);function cf1({...r}){return j("svg",{fill:"currentColor",height:"24",version:"1.1",viewBox:"0 0 14 14",width:"24",xmlns:"http://www.w3.org/2000/svg",...r,children:j("path",{d:"m 14,8 0,1 -6,-1 0,3 2,2 0,1 L 7,13 4,14 4,13 6,11 6,8 0,9 0,8 6,5 6,2 C 6,1 6.22222,0 7,0 7.77777,0 8,1 8,2 l 0,3 z"})})}var pF=cf1;function uf1({...r}){return j("svg",{fill:"currentColor",height:"24px",version:"1.1",viewBox:"0 -3.84 122.88 122.88",width:"24px",xmlns:"http://www.w3.org/2000/svg",...r,children:j("path",{d:"M29.03,100.46l20.79-25.21l9.51,12.13L41,110.69C33.98,119.61,20.99,110.21,29.03,100.46L29.03,100.46z M53.31,43.05 c1.98-6.46,1.07-11.98-6.37-20.18L28.76,1c-2.58-3.03-8.66,1.42-6.12,5.09L37.18,24c2.75,3.34-2.36,7.76-5.2,4.32L16.94,9.8 c-2.8-3.21-8.59,1.03-5.66,4.7c4.24,5.1,10.8,13.43,15.04,18.53c2.94,2.99-1.53,7.42-4.43,3.69L6.96,18.32 c-2.19-2.38-5.77-0.9-6.72,1.88c-1.02,2.97,1.49,5.14,3.2,7.34L20.1,49.06c5.17,5.99,10.95,9.54,17.67,7.53 c1.03-0.31,2.29-0.94,3.64-1.77l44.76,57.78c2.41,3.11,7.06,3.44,10.08,0.93l0.69-0.57c3.4-2.83,3.95-8,1.04-11.34L50.58,47.16 C51.96,45.62,52.97,44.16,53.31,43.05L53.31,43.05z M65.98,55.65l7.37-8.94C63.87,23.21,99-8.11,116.03,6.29 C136.72,23.8,105.97,66,84.36,55.57l-8.73,11.09L65.98,55.65L65.98,55.65z"})})}var LF=uf1;function hf1({...r}){return j("svg",{fill:"currentColor",height:"24px",version:"1.1",viewBox:"0 0 512 512",width:"24px",xmlns:"http://www.w3.org/2000/svg",...r,children:[j("g",{children:j("g",{children:j("path",{d:`M256,0c-9.217,0-16.696,7.473-16.696,16.696v478.609c0,9.223,7.479,16.696,16.696,16.696
|
|
1284
|
+
`})})]})}var rF=Ud1;var Qd1="my-1 flex items-center leading-[1.1] underline text-base items-center justify-left font-semibold gap-1",Hd1={primary:{classes:"bg-red text-white disabled:bg-lightgrey hover:bg-darkred hover:border-darkred active:bg-lightred active:border-lightred ",selectedClasses:"bg-darkred border-darkred"},secondary:{classes:"bg-white text-black hover:text-red active:text-lightred",selectedClasses:"text-red"}};function Vd1({children:r,className:t,theme:e="secondary",...i}){let o=It(()=>ie(`${Qd1} ${Hd1[e].classes} ${t||""}`),[t,e]);return j("a",{className:o,rel:"noreferrer",target:"_blank",...i,children:[(!i.href?.includes(window.location.hostname)||!i.href?.startsWith("(https?|ftp)"))&&j(rF,{height:"20",width:"20"}),r]})}var ds=et(Vd1);var uX=(r,t,e,i=!0)=>{let o=r.toLocaleTimeString(["de"],{hour:"2-digit",minute:"2-digit"});return`${r.toLocaleDateString(["de"],{day:"2-digit",month:i?"short":"long",year:e?"numeric":void 0})}${t&&o?` ${o}`:""}`.replace(",","")};function Gd1({canToggle:r=!1,headerClassName:t,iconClassName:e,publicationClassName:i,reasonClassName:o,situation:n,timeIntervalClassName:l,useShortMonth:h=!0}){let{locale:d,t:p}=j5(),[C,M]=ft(!r);if(!n)return null;let B={},y={},O=[],Q=[],H=[];return Q=(n?.publications||[])?.filter(({publicationWindows:t1})=>(!t1?.length&&n?.publicationWindows?.length&&(t1=n?.publicationWindows),t1.find(({endTime:e1,startTime:J})=>{let g1=new Date,b1=new Date(J),T1=new Date(e1);return b1<=g1&&g1<=T1})))||[],O=(n?.affectedTimeIntervals||[]).filter(({endTime:t1,startTime:e1})=>{let J=new Date,g1=new Date(e1),b1=new Date(t1);return g1<=J&&J<=b1||J<g1})||[],H=(n?.reasons||[]).map(({name:t1})=>t1),j(We,{children:Q?.map(({id:t1,publicationLines:e1,publicationStops:J,textualContentLarge:g1,textualContentMedium:b1,textualContentSmall:T1})=>{B=g1||b1||T1,y=B?.[d()],y?.summary||(y=B?.de);let x1=e1?.flatMap(D1=>D1.lines?.map(({name:a1})=>a1)||[])||[],C1=J.map(D1=>D1?.name||"");return j("div",{className:ie("text-base",i),children:[j("div",{className:ie("text-xs uppercase",o),children:H}),j("h3",{className:ie("space-x-2 text-xl leading-[1.3] font-bold text-balance",t),children:[j("span",{className:"inline-block align-middle",children:j(eF,{className:ie(e)})}),j("span",{className:"align-middle *:inline",dangerouslySetInnerHTML:{__html:y?.summary}})]}),j("hr",{className:"my-1"}),O?.map(({dailyEndTime:D1,dailyStartTime:a1,endTime:w1,startTime:Q1},j1)=>{let c2=D1&&a1,C2=w1.includes("2500"),Y1=uX(new Date(Q1),!1,!0,h),H1=C2?void 0:uX(new Date(w1),!1,!0,h);return j("button",{className:ie("flex w-full items-center",r&&"cursor-pointer"),onClick:()=>{M(!C)},tabIndex:r?0:-1,children:[j("div",{className:ie("flex-1 text-left text-sm font-bold text-balance",l),children:[j("span",{children:[Y1&&H1?`${Y1} \u2013 ${H1}`:null,Y1&&!H1?p("from",{from:Y1}):null]}),c2&&j("span",{children:` (${p("daily_from_to",{from:a1,to:D1})})`})]},Q1),r&&j1==0&&j(We,{children:C?j(sL,{className:"text-red"}):j(_c,{className:"text-red"})})]},Q1)}),j("div",{className:C?"my-4 flex flex-col gap-4":"hidden",children:[y?.description&&j("div",{dangerouslySetInnerHTML:{__html:y?.description}}),!!B?.images?.length&&j("div",{className:"flex flex-wrap gap-2",children:B.images.map(({image:{absoluteUrl:D1,label:a1}})=>j("img",{alt:a1,className:"h-fit",src:D1,title:a1},D1+a1))}),!!B?.infoLinks?.length&&j("div",{children:B.infoLinks.map(({label:D1,uri:a1})=>{let w1=D1?.[d()]||D1?.de||a1||"";return j(ds,{href:a1,title:w1,children:w1},a1)})}),!!x1?.length&&j("div",{children:[j("div",{className:"font-bold",children:[p("affected_lines"),":"]}),j("div",{className:"flex flex-wrap gap-1 text-sm",children:x1?.map(D1=>j("div",{className:"bg-red rounded-sm px-[2px] py-[0px] font-semibold text-white",children:D1},D1))})]}),!!C1?.length&&j("div",{children:[j("div",{className:"font-bold",children:[p("affected_stops"),":"]}),j("div",{className:"flex flex-wrap gap-1 text-sm",children:C1.map(D1=>j("div",{className:"bg-red rounded-sm px-[2px] py-[0px] font-semibold text-white",children:D1},D1))})]})]}),r&&j("hr",{className:"my-1"})]},t1)})})}var lL=et(Gd1);function jd1(r,t){let{lang:e,notificationsLayer:i,previewNotifications:o}=Ct(),[n,l]=ft(),h=It(()=>i?.api,[i]);return G2(()=>{let d=o?.find(C=>C.id===r);if(d){l(d);return}let p=new AbortController;return h?.exportById(r,{contentLarge:!0,contentMedium:!0,contentSmall:!0,includeGeoms:!1,includeLines:!0,includeStops:!0,[e]:!0,limit:1,...t||{}}).then(C=>{l(C)}).catch(C=>{if(C.code!==20){l(void 0),console.error("Failed to fetch situation",C);return}}),()=>{p.abort()}},[h,r,t,e,o]),n}var hX=jd1;function qd1({className:r,feature:t,...e}){let{situationId:i}=t.getProperties(),o=hX(i);return console.log("situationParsed",t.getProperties()),j(Bn,{...e,className:ie("px-4 text-base",r),children:j(lL,{situation:o})})}var Fy=qd1;var iF=(r,t)=>t?j("a",{className:"whitespace-normal underline",href:t,rel:"noreferrer",target:"_blank",children:r}):r;function Kd1({stopSequence:r}){return!r.operator&&!r.publisher?null:j(We,{children:j("div",{className:"m-4 mb-0 flex flex-wrap text-[10px] text-gray-500",children:[r.operator&&iF(r.operator,r.operatorUrl),r.operator&&r.publisher&&j("span",{children:" - "}),r.publisher&&iF(r.publisher,r.publisherUrl),r.license&&j("span",{children:"\xA0("}),r.license&&iF(r.license,r.licenseUrl),r.license&&")"]})})}var nF=et(Kd1);function Wd1({...r}){return j("svg",{fill:"none",height:"24",part:"svg",viewBox:"0 0 14 14",width:"24",xmlns:"http://www.w3.org/2000/svg",...r,children:[j("path",{clipRule:"evenodd",d:"M7 0.333344C7.375 0.333344 7.66667 0.62501 7.66667 0.97921V2.35414C9.7292 2.66668 11.3333 4.27081 11.625 6.33334H13C13.375 6.33334 13.6667 6.62501 13.6667 7.00001C13.6667 7.37501 13.375 7.66668 13 7.66668H11.625C11.3333 9.70834 9.70833 11.3333 7.66667 11.625V13C7.66667 13.375 7.375 13.6667 7 13.6667C6.64587 13.6667 6.33333 13.375 6.33333 13V11.625C4.29167 11.3333 2.68747 9.70834 2.39587 7.66668H1C0.625 7.66668 0.333333 7.37501 0.333333 7.00001C0.333333 6.62501 0.625 6.33334 1 6.33334H2.39587C2.68747 4.27081 4.29167 2.66668 6.33333 2.35414V0.97921C6.33333 0.62501 6.64587 0.333344 7 0.333344ZM7 3.66668C5.16667 3.66668 3.66667 5.16668 3.66667 7.00001C3.66667 8.79168 5.08333 10.3125 7 10.3125C8.89587 10.3125 10.3333 8.81254 10.3333 7.00001C10.3333 5.16668 8.83333 3.66668 7 3.66668Z",fill:"currentColor",fillRule:"evenodd"}),j("path",{clipRule:"evenodd",d:"M5.66667 7.00001C5.66667 6.27081 6.2708 5.66668 7 5.66668C7.7292 5.66668 8.33333 6.27081 8.33333 7.00001C8.33333 7.72921 7.7292 8.33334 7 8.33334C6.2708 8.33334 5.66667 7.72921 5.66667 7.00001Z",fill:"currentColor",fillRule:"evenodd",part:"circle"})]})}var oF=Wd1;function $d1({stopSequence:r,...t}){let{destination:e}=r||{};return j("span",{...t,children:e})}var aF=et($d1);function Xd1({stopSequence:r,...t}){let{longName:e,routeIdentifier:i}=r||{},o=e;if(i){let n=i;i.includes(".")?[n]=i.split("."):i.includes("_")?[n]=i.split("_"):i.includes(":")&&([n]=i.split(":")),/^\d*$/.test(n)&&(n=`${parseInt(n,10)}`),e.includes(n)||(o=`${e} (${n})`)}return j("span",{...t,children:o})}var sF=et(Xd1);function Yd1({stopSequence:r,...t}){return j("div",{...t,children:[j(aF,{className:"text-base font-bold",stopSequence:r}),j(sF,{className:"text-sm",stopSequence:r})]})}var lF=et(Yd1);function Jd1({stopSequence:r}){let{isFollowing:t,setIsFollowing:e}=Ct();return j("div",{className:"flex items-center gap-x-4 bg-slate-100 p-4 py-2",children:[j(n4,{stopSequence:r}),j(lF,{className:"flex grow flex-col",stopSequence:r}),j(p0,{className:`${t?"animate-pulse":""}`,onClick:()=>{e(!t)},selected:t,children:j(oF,{})})]})}var cF=et(Jd1);var tf1=()=>It(()=>{let t=new URLSearchParams(window.location.search).get("debug");return!t||t==="false"?!1:t},[]),Py=tf1;var uF=L8({index:null,invertColor:null,station:null,status:null,stop:null,stopSequence:null}),ef1=()=>{let r=C6(uF);if(!r)throw new Error("useRouteStop must be used within a ContextProvider");return r},F9=ef1;function rf1(r){let{status:t,stop:e}=F9();return Py()?j("div",{className:"p-4 text-left text-xs",...r,children:[j("div",{children:["State: ",j("b",{children:e.state})," (isPassed: ",`${t.isPassed}`,") (cancelled: ",`${e.cancelled}`,")"]}),j("div",{children:["Arrival time: ",e.arrivalTime," (delay: ",j("b",{children:`${e.arrivalDelay}`}),") (aimed: ",e.aimedArrivalTime,")"]}),j("div",{children:["Departure time: ",e.arrivalTime," (delay:"," ",j("b",{children:`${e.departureDelay}`}),") (aimed: ",e.aimedArrivalTime,")"]}),j("div",{children:Object.entries(t).map(([o,n])=>n===!1?null:j("div",{children:[o,": ",`${n}`]},o))})]}):null}var AX=rf1;var if1=(r,t=!1)=>{let e=Math.round(r/1e3/60);return e>5?"#dc2626":e>=3?"#ea580c":t?"#16a34a":"transparent"},cL=if1;var nf1=r=>{let t=r;t<0&&(t=0);let e=Math.floor(t/36e5),i=Math.round(t%36e5/6e4),o="";return e>0&&(o+=`${e}h`),i>0&&(o+=`${i}m`),o||"0"},uL=nf1;function of1(r){let{status:t,stop:e}=F9(),{arrivalDelay:i,departureDelay:o}=e,n=t.isNotRealtime||t.isCancelled||t.isNotStop||t.isPassed;return j("div",{...r,children:[n||i===null||t.isFirst?null:j("span",{style:{color:cL(i)},children:`+${uL(i)}`}),n||o===null||t.isLast?null:j("span",{style:{color:cL(i)},children:`+${uL(o)}`})]})}var hF=et(of1);function af1({svgProps:r,...t}){let{invertColor:e,status:i,stopSequence:o}=F9(),{isBoarding:n,isFirst:l,isLast:h,isLeft:d,isPassed:p,progress:C}=i,M=l?"50%":"-100%",B=h?"50%":"100%",y=`${C}%`,O="rgb(156, 163, 175)",Q=_A(o),H=p?O:Q,G=p?Q:O,t1=O;e&&(H=p?Q:O,G=p?O:Q,t1=Q);let e1=!p&&(d||n)?G:H;return j("div",{...t,children:j("svg",{fill:"none",height:"100%",stroke:H,width:"16",xmlns:"http://www.w3.org/2000/svg",...r,children:[j("circle",{cx:"50%",cy:"50%",r:"5",stroke:"black",strokeWidth:"6"}),j("line",{stroke:"black",strokeWidth:"6",x1:"50%",x2:"50%",y1:M,y2:B}),j("line",{stroke:t1,strokeWidth:"4",x1:"50%",x2:"50%",y1:M,y2:y}),j("line",{strokeWidth:"4",x1:"50%",x2:"50%",y1:`${C-2}%`,y2:B}),j("circle",{cx:"50%",cy:"50%",r:"5",strokeWidth:"4"}),j("circle",{className:n?"animate-pulse":"",cx:"50%",cy:"50%",r:"5",stroke:e1,strokeWidth:"4"}),j("circle",{cx:"50%",cy:"50%",fill:"white",r:"3",stroke:"black",strokeWidth:"1"})]})})}var AF=et(af1);function sf1({...r}){let{stop:t,stopSequence:e}=F9(),{type:i}=e,{t:o}=j5(),{platform:n}=t||{};if(!n)return null;let l=o(`platform_${i||"rail"}`);return j("span",{...r,children:[l||o("platform_rail")," ",n]})}var dF=et(sf1);function lf1({children:r,...t}){let{stop:e}=F9(),{stationName:i}=e||{};return j("div",{...t,children:[i,j("br",{}),j(dF,{className:"rounded-sm bg-slate-100 px-0.5 py-px text-xs group-hover:bg-slate-50"}),r]})}var fF=et(lf1);function cf1({...r}){return j("svg",{fill:"currentColor",height:"24",version:"1.1",viewBox:"0 0 14 14",width:"24",xmlns:"http://www.w3.org/2000/svg",...r,children:j("path",{d:"m 14,8 0,1 -6,-1 0,3 2,2 0,1 L 7,13 4,14 4,13 6,11 6,8 0,9 0,8 6,5 6,2 C 6,1 6.22222,0 7,0 7.77777,0 8,1 8,2 l 0,3 z"})})}var pF=cf1;function uf1({...r}){return j("svg",{fill:"currentColor",height:"24px",version:"1.1",viewBox:"0 -3.84 122.88 122.88",width:"24px",xmlns:"http://www.w3.org/2000/svg",...r,children:j("path",{d:"M29.03,100.46l20.79-25.21l9.51,12.13L41,110.69C33.98,119.61,20.99,110.21,29.03,100.46L29.03,100.46z M53.31,43.05 c1.98-6.46,1.07-11.98-6.37-20.18L28.76,1c-2.58-3.03-8.66,1.42-6.12,5.09L37.18,24c2.75,3.34-2.36,7.76-5.2,4.32L16.94,9.8 c-2.8-3.21-8.59,1.03-5.66,4.7c4.24,5.1,10.8,13.43,15.04,18.53c2.94,2.99-1.53,7.42-4.43,3.69L6.96,18.32 c-2.19-2.38-5.77-0.9-6.72,1.88c-1.02,2.97,1.49,5.14,3.2,7.34L20.1,49.06c5.17,5.99,10.95,9.54,17.67,7.53 c1.03-0.31,2.29-0.94,3.64-1.77l44.76,57.78c2.41,3.11,7.06,3.44,10.08,0.93l0.69-0.57c3.4-2.83,3.95-8,1.04-11.34L50.58,47.16 C51.96,45.62,52.97,44.16,53.31,43.05L53.31,43.05z M65.98,55.65l7.37-8.94C63.87,23.21,99-8.11,116.03,6.29 C136.72,23.8,105.97,66,84.36,55.57l-8.73,11.09L65.98,55.65L65.98,55.65z"})})}var LF=uf1;function hf1({...r}){return j("svg",{fill:"currentColor",height:"24px",version:"1.1",viewBox:"0 0 512 512",width:"24px",xmlns:"http://www.w3.org/2000/svg",...r,children:[j("g",{children:j("g",{children:j("path",{d:`M256,0c-9.217,0-16.696,7.473-16.696,16.696v478.609c0,9.223,7.479,16.696,16.696,16.696
|
|
1285
1285
|
c9.217,0,16.696-7.473,16.696-16.696V16.696C272.696,7.473,265.217,0,256,0z`})})}),j("g",{children:j("g",{children:j("path",{d:`M105.739,44.522c-36.826,0-66.783,29.956-66.783,66.783c0,36.826,29.956,66.783,66.783,66.783
|
|
1286
1286
|
s66.783-29.956,66.783-66.783C172.522,74.478,142.565,44.522,105.739,44.522z`})})}),j("g",{children:j("g",{children:j("path",{d:`M406.261,44.522c-36.826,0-66.783,29.956-66.783,66.783c0,36.826,29.956,66.783,66.783,66.783
|
|
1287
1287
|
s66.783-29.956,66.783-66.783C473.043,74.478,443.087,44.522,406.261,44.522z`})})}),j("g",{children:j("g",{children:j("path",{d:`M202.935,218.664c-3.109-4.501-8.239-7.186-13.717-7.186H22.261c-5.478,0-10.608,2.685-13.717,7.185
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@geops/rvf-mobility-web-component",
|
|
3
3
|
"license": "UNLICENSED",
|
|
4
4
|
"description": "Web components for rvf in the domains of mobility and logistics.",
|
|
5
|
-
"version": "0.1.
|
|
5
|
+
"version": "0.1.93",
|
|
6
6
|
"homepage": "https://rvf-mobility-web-component-geops.vercel.app/",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "index.js",
|
|
@@ -233,7 +233,8 @@ function NotificationDetails({
|
|
|
233
233
|
<div>
|
|
234
234
|
{textualContentMultilingual.infoLinks.map(
|
|
235
235
|
({ label, uri }) => {
|
|
236
|
-
const title =
|
|
236
|
+
const title =
|
|
237
|
+
label?.[locale()] || label?.de || uri || "";
|
|
237
238
|
return (
|
|
238
239
|
<Link href={uri} key={uri} title={title}>
|
|
239
240
|
{title}
|
|
@@ -273,7 +273,8 @@ function SituationDetails({
|
|
|
273
273
|
<div>
|
|
274
274
|
{textualContentMultilingual.infoLinks.map(
|
|
275
275
|
({ label, uri }) => {
|
|
276
|
-
const title =
|
|
276
|
+
const title =
|
|
277
|
+
label?.[locale()] || label?.de || uri || "";
|
|
277
278
|
return (
|
|
278
279
|
<Link href={uri} key={uri} title={title}>
|
|
279
280
|
{title}
|