@wayke-se/components-react 5.0.1 → 5.0.2

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/dist/index.mjs CHANGED
@@ -5446,7 +5446,7 @@ and ensure you are accounting for this risk.
5446
5446
  `}
5447
5447
  `,pb=Fs.div``,hb=Fs.div.attrs(()=>({className:"wayke__theme wayke__font--bold"}))`
5448
5448
  text-decoration: var(--price-text-decoration);
5449
- `;var K5=({prices:e})=>Rs.createElement(db,null,e?.map((t,r)=>Rs.createElement(mb,{key:`${t.label}-${r}`,$oldPrice:t.oldPrice},Rs.createElement(pb,null,t.label),Rs.createElement(hb,null,t.price)))),Ab=K5;import{useTranslation as z5}from"react-i18next";var Z5=({accessory:e,onClose:t})=>{let{t:r}=z5(),i=[{label:r("item.accessories.price"),price:`${$(e.price)} ${r("currency.default")}`,oldPrice:!1}];return e.salePrice&&i.push({label:r("item.accessories.oldPrice"),price:`${$(e.salePrice)} ${r("currency.default")}`,oldPrice:!0}),e.assemblyPrice&&i.push({label:r("item.accessories.installationCost"),price:`${$(e.assemblyPrice)} ${r("currency.default")}`,oldPrice:!1}),gt.createElement(Oe,{title:e.name,onClose:t},e.images?.[0]&&gt.createElement(S,null,gt.createElement(ub,{src:`${e.images[0]}?w=632`,alt:`${e.name}`})),e.logotype&&gt.createElement(S,null,gt.createElement(qe,{logo:`${e.logotype}?w=160`,logo2x:`${e.logotype}?w=320`,alt:e.manufacturer||r("common.logotype")||"",wide:!0})),gt.createElement(S,null,gt.createElement(Ab,{prices:i})),gt.createElement(S,null,gt.createElement(le,{dangerouslySetInnerHTML:{__html:q5(e.description)}})),e.articleNumber&&gt.createElement(S,null,gt.createElement(Ei,{as:"div"},r("item.accessories.articleNumberShort")),gt.createElement("div",null,e.articleNumber)),e.productPage&&e.productPage.url&&gt.createElement(S,null,gt.createElement(ls,{href:e.productPage.url,title:r("item.accessories.moreInformationAboutAccessory",{accessory:e.name})||"",target:"_blank",rel:"noopener noreferrer nofollow"},e.productPage.title||r("common.readMore")," (",r("common.opensInNewTab"),")")))},fb=Z5;var tN=({accessories:e})=>{let{t}=eN(),[r,i]=X5(),n=a=>i(a),o=()=>i(void 0);return e?.length?Ht.createElement(Ht.Fragment,null,r&&Ht.createElement(fb,{accessory:r,onClose:o}),Ht.createElement(It,null,Ht.createElement(S,null,Ht.createElement(Ve,{noMargin:!0},t("item.accessories.accessories"))),Ht.createElement(S,null,Ht.createElement(le,null,Ht.createElement("p",null,t("item.accessories.accessoriesDescription")))),Ht.createElement(S,null,Ht.createElement(Cs,{columns:1.05,columnsSm:2.1,columnsMd:2,spacing:2,items:e.map(a=>Ht.createElement(cb,{key:a.id,title:a.name,image:a.images?.[0]?{src:`${a.images?.[0]}?w=539&h=303`,alt:a.name}:void 0,price:`${$(a.price)} ${t("currency.default")}`,preamble:a.excerpt,readMoreCta:()=>n(a)}))})))):null},gb=tN;import{useEffect as N_,useRef as lI}from"react";function T_(e,t,r){let i=lI(void 0),n=lI(r);n.current=r;let o=async()=>{if(t)try{let a=await Promise.resolve().then(()=>(sI(),aI));a&&(i.current=new a.default({id:e,ecomSdkConfig:{api:{address:t.url},bankIdThumbprint:t?.bankIdThumbprint},logo:t.serviceLogotypeUrl,logoX2:t.serviceLogotypeUrl,onEvent:(s,l,m,u)=>{V.publish("Ecom",{id:e,branchId:n.current?.id,branchName:n.current?.name,view:s,event:l,currentStep:m,data:u})}}))}catch{}};return N_(()=>(o(),()=>{i.current&&i.current.destroy()}),[]),i}var cI=T_;import{marked as P_}from"marked";var O_=({marketCode:e="SE",id:t,hashRoute:r,pathRoute:i,disableResetScrollOnInit:n,placeholderImage:o,modifyDocumentTitleItem:a,displayBranchName:s,onClickSearchItem:l})=>{let m=dn(e),{ecomSettings:u}=Ts(),{loading:h,data:p}=p0(t),{vehicle:f,loading:w}=vy(p?.vehicle),k=f?.contact,A=f?.branch,y=cI(t,u,A),[g,E]=B_(!1),B=uI(()=>E(!g),[g]);dI(()=>{n||window.scrollTo(0,0)},[]),dI(()=>{if(p?.vehicle?.data&&a){let{vehicle:Bt}=p,{registrationNumber:ua}=Bt.data;document.title=`${ua} | ${Bt.title} | ${Bt.shortDescription}`}},[p]);let j=M_(()=>p?.vehicle?.data?.options?.filter(zn).map(Bt=>({title:Bt})),[p?.vehicle?.data?.options]),J=uI(()=>V.publish("OptionsClick",{id:t,branchId:A?.id,branchName:A?.name}),[A]);if(!m)return null;if(h)return F.createElement(xy,null);if(!p?.vehicle?.data)return F.createElement(wy,null);let{vehicle:ie}=p,{title:Y,accessories:O,shortDescription:_,media:U,description:P,price:T,discount:M,financialOptions:b,manufacturer:v,ecommerce:x,packageOptions:N,publishedAt:K,documents:ae,availableFrom:Te,flags:Me}=ie,W=f?.insuranceOptions?f.insuranceOptions:ie.insuranceOptions,{fuelType:z,mileage:je,gearboxType:se,odometerReading:te,modelYear:De,propertySet:He}=ie.data,Be=[{title:De}];return Me?.demoVersion&&Be.push({title:fe.t("item.demoCar"),onClick:B}),Be.push({title:`${$(te?.value||je)} ${fe.t(`odometer.${te?.unit||"ScandinavianMile"}`)}`}),se&&Be.push({title:se}),z&&Be.push({title:z}),F.createElement(F.Fragment,null,F.createElement(Yr,null,F.createElement(vt,{large:!0},F.createElement(kt,null,F.createElement(c0,null,F.createElement(u0,null,F.createElement(yn,{mobileOrder:1},!i&&r?F.createElement(S,null,F.createElement(Aa,null,F.createElement(Dp,{as:"a",href:"#",title:fe.t("navigation.backToSearch")},F.createElement(ue,null,F.createElement(on,{block:!0})),F.createElement(ue,null,fe.t("navigation.backToSearch"))))):null,v?.logotype&&F.createElement(S,null,F.createElement(qe,{logo:v.logotype,alt:v.name})),F.createElement(S,null,F.createElement(Je,null,F.createElement(Pt,{noMargin:!0},Y)),_&&F.createElement(Je,null,F.createElement("div",null,_)),F.createElement(Je,null,F.createElement(lo,{small:!0,items:Be})))),F.createElement(yn,{mobileOrder:2},F.createElement(KA,{price:T,discount:M||void 0})),(b.length>0||W.length>0)&&F.createElement(yn,{mobileOrder:4},b.length>0&&F.createElement(R0,{id:t,branch:A,financialOptions:b,marketCode:e}),W.length>0&&F.createElement(kg,{id:t,branch:f?.branch,insuranceOptions:W})),F.createElement(yn,{mobileOrder:5},F.createElement(jg,{id:t,marketCode:e,manufacturer:v,packageOptions:N,ecommerce:x,branch:A,contact:f?.contact,loadingCentralStorageVehicle:w,availableFrom:Te,toggleEcomModal:()=>y.current?.start()}))),F.createElement(Xa,null,F.createElement(yn,{mobileOrder:3},F.createElement(l0,{id:t,branch:A,media:U,placeholderImage:o})),F.createElement(It,null,F.createElement(S,null,F.createElement(Ve,{noMargin:!0},fe.t("item.carData"))),F.createElement(S,null,F.createElement(le,null,F.createElement("p",null,fe.t("item.carDataDescription")))),F.createElement(S,null,F.createElement(Qy,{propertySet:He,vehicleData:ie.data}))),P&&F.createElement(It,null,F.createElement(cf,{author:k&&k.name?k.name:null,date:K?qn.format(K,qn.DayMonth,e):void 0,avatar:k?.avatar||void 0},!!P&&F.createElement("div",{dangerouslySetInnerHTML:{__html:P_(P)}}))),(j?.length||0)>0&&F.createElement(It,null,F.createElement(S,null,F.createElement(Ve,{noMargin:!0},fe.t("item.equipment"))),F.createElement(S,null,F.createElement(le,null,F.createElement("p",null,fe.t("item.equipmentDescription")))),F.createElement(S,null,F.createElement(Ga,{actionTitle:fe.t("common.showMore"),onClick:J},F.createElement(lo,{items:j})))),F.createElement(zy,{documents:ae}),F.createElement(gb,{accessories:O}),F.createElement(It,null,F.createElement(gy,{branch:A,displayBranchName:s,loading:w}),x&&x.enabled&&F.createElement(S,null,F.createElement(nr,{disabled:!!x.reserved,title:"K\xF6p bilen online",onClick:()=>y.current?.start()},"K\xF6p bilen online"))),F.createElement(ny,{packageOptions:N}),F.createElement(vg,{packageOption:v?.packageOption}))))),F.createElement(iy,{id:t,hashRoute:r,pathRoute:i,authorizedReseller:!!A?.flags?.authorizedReseller,displayBranchName:s,onClickSearchItem:l})),F.createElement(eo,{id:sr.DefaultPortal}),g&&F.createElement(jy,{onClose:B}))},np=O_;import wi from"react";var Vl={name:"@wayke-se/components-react",version:"5.0.1",description:"",module:"dist/index.mjs",main:"dist/index.js",types:"dist/index.d.ts",type:"module",files:["dist"],scripts:{prebuild:"npm run clean",test:"npm run lint",lint:"eslint 'src/**/*.{ts,tsx}' 'example/**/*.{ts,tsx}'","lint:fix":"eslint 'src/**/*.{ts,tsx}' 'example/**/*.{ts,tsx}' --fix",typecheck:"tsc --noEmit --skipLibCheck",prettify:"prettier --write 'src/**/*.{ts,tsx}'",gen:"graphql-codegen --config ./codegen.yml","generate-libphonenumber-metadata":"libphonenumber-metadata-generator src/utils/metadata.min.json --countries SE,NO --extended",prepare:"husky",start:"node ./esbuild/start.js",build:"npm run clean && node ./esbuild/lib.js",clean:"rimraf build && rimraf dist && rimraf dist-cdn","build:types":"tsc --emitDeclarationOnly --declaration --project tsconfig.build.json"},repository:{type:"git",url:"git+https://github.com/wayke-se/components-react.git"},author:"Ourstudio",license:"MIT",peerDependencies:{react:"^18 || ^19","react-dom":"^18 || ^19","styled-components":"^6"},devDependencies:{"@eslint/js":"^9.39.0","@graphql-codegen/cli":"^7.1.2","@graphql-codegen/typescript":"^6.0.2","@types/googlemaps":"^3.43.3","@types/node":"^25.9.2","@types/react":"^19.2.17","@types/react-dom":"^19.2.3","@types/react-slick":"^0.23.13","@typescript-eslint/eslint-plugin":"^8.61.0","@typescript-eslint/parser":"^8.61.0","@wayke-se/ecom-web":"^2.1.0",dotenv:"^17.4.2",esbuild:"^0.28.0","esbuild-plugin-copy":"^2.1.1",eslint:"^9.39.4","eslint-config-prettier":"^10.1.8","eslint-plugin-import":"^2.32.0","eslint-plugin-prettier":"^5.5.6","eslint-plugin-react":"^7.37.5",globals:"^16.5.0",husky:"^9.1.7","libphonenumber-metadata-generator":"^2.0.6","lint-staged":"^17.0.7","npm-dts":"^1.3.13",prettier:"^3.8.4",react:"^19.2.7","react-dom":"^19.2.7","react-router-dom":"^7.17.0",rimraf:"^6.1.3","styled-components":"^6.4.2",typescript:"^6.0.3"},dependencies:{"@apollo/client":"^4.2.3","@emotion/is-prop-valid":"^1.4.0","@photo-sphere-viewer/core":"^5.14.1","date-fns":"^4.4.0",graphql:"^16.14.2",i18next:"^26.3.1","libphonenumber-js":"^1.13.6",marked:"^18.0.5","react-compound-slider":"^3.4.0","react-i18next":"^17.0.8","react-slick":"^0.31.0","scroll-into-view-if-needed":"^3.1.0"}};import F_ from"react";import{ApolloClient as R_,InMemoryCache as __,HttpLink as H_}from"@apollo/client";import{ApolloProvider as G_}from"@apollo/client/react";var U_=({uri:e,children:t})=>{let r=new R_({link:new H_({uri:e}),cache:new __});return F_.createElement(G_,{client:r},t)},Jl=U_;import mI from"react";import Q_ from"@emotion/is-prop-valid";import{StyleSheetManager as j_,ThemeProvider as Y_}from"styled-components";var W_=(e,t)=>typeof t=="string"?Q_(e):!0,$_=({children:e})=>mI.createElement(j_,{shouldForwardProp:W_},mI.createElement(Y_,{theme:lt},e)),la=$_;import V_,{useState as Kl,useEffect as ql,useCallback as op}from"react";var pI=()=>new URLSearchParams(window.location.search);var ap=new URLSearchParams;ap.set("hits","30");ap.set("sort","published-desc");var J_=({url:e,apiKey:t,useQueryParamsFromUrl:r,pathRoute:i,children:n})=>{let{replaceState:o,pushState:a}=cn(),[s,l]=Kl({searchParams:ap}),[m,u]=Kl(),[h,p]=Kl(),[f,w]=Kl(!1),{data:k}=Ni(`${e}?hits=0`,{headers:t?{"x-api-key":t}:{}},!!m),A=s.searchParams.toString(),{loading:y,data:g,error:E}=Ni(`${e}${A?`?${A}`:""}`,{headers:t?{"x-api-key":t}:{}},!f||!!s?.block),B=O=>{let{currentTarget:_}=O;if(_){let U=new URLSearchParams(_.location.search);U.has("sort")||U.set("sort","published-desc"),l({searchParams:U})}};ql(()=>{r&&window.addEventListener("popstate",B);let O={actionName:"onFilterUpdate",callback:j};return V.subscribeAction(O),()=>{window.removeEventListener("popstate",B),V.unsubscribeAction(O)}},[]),ql(()=>{k&&u(k.facets)},[k]),ql(()=>{if(r){let O=new URLSearchParams(s.searchParams);O.delete("hits"),O.delete("offset"),O.get("sort")==="published-desc"&&O.delete("sort");let _=O.toString()?`?${O}`:"";if(f&&window.location.search.localeCompare(_)!==0){let U=i?.replace(/^\/|\/$/g,""),P=U?`/${U}/`:"/",T=U?window.location.pathname.indexOf(P):-1,M=window.location.pathname;T>-1&&(M=M.substr(0,T)),a(`${M}${_}`)}}},[s,f,r]),ql(()=>{if(g){if(!m&&!r&&u(g.facets),r&&g.query?.parameters){let O=new URLSearchParams(g.query.parameters);O.delete("hits"),O.delete("offset");let _=O.toString()?`?${O}`:"";window.location.search.localeCompare(_)!==0&&(o(`${window.location.pathname}${_}`),l({searchParams:new URLSearchParams(_),block:!0}))}s?.concatResult?p([...h||[],...g.documentList.documents||[]]):p(g.documentList.documents||[])}},[g,r]);let j=op(O=>{{f||w(!0);let _=new URLSearchParams(O);_.delete("offset"),l({searchParams:_})}},[f]),J=op(()=>{g&&l({searchParams:new URLSearchParams(g?.documentList.pagination.nextPage?.query),concatResult:!0})},[g]),ie=op(O=>{if(!f){let _=pI(),U=r?_:O;if(r&&O&&O.forEach((P,T)=>{U?.getAll(T)?.some(M=>M===P)||U?.append(T,P)}),U){let P=new URLSearchParams(U);P.delete("hits"),P.delete("offset"),U.has("hits")||U.set("hits","30"),U.has("sort")||U.set("sort","published-desc");let T=P.toString()?`?${P}`:"";l({searchParams:U}),r&&o(`${window.location.pathname}${T}`)}w(!0)}},[f]),Y={loading:y,error:E,response:g,documents:h,initialFacets:m,queryFilter:s,onFilterUpdate:j,onLoadMore:J,onInitialize:ie};return V_.createElement(ga.Provider,{value:Y},n)},hI=J_;import K_ from"styled-components";var q_=K_.div.attrs(()=>({className:"wayke__theme wayke__font--regular"}))`
5449
+ `;var K5=({prices:e})=>Rs.createElement(db,null,e?.map((t,r)=>Rs.createElement(mb,{key:`${t.label}-${r}`,$oldPrice:t.oldPrice},Rs.createElement(pb,null,t.label),Rs.createElement(hb,null,t.price)))),Ab=K5;import{useTranslation as z5}from"react-i18next";var Z5=({accessory:e,onClose:t})=>{let{t:r}=z5(),i=[{label:r("item.accessories.price"),price:`${$(e.price)} ${r("currency.default")}`,oldPrice:!1}];return e.salePrice&&i.push({label:r("item.accessories.oldPrice"),price:`${$(e.salePrice)} ${r("currency.default")}`,oldPrice:!0}),e.assemblyPrice&&i.push({label:r("item.accessories.installationCost"),price:`${$(e.assemblyPrice)} ${r("currency.default")}`,oldPrice:!1}),gt.createElement(Oe,{title:e.name,onClose:t},e.images?.[0]&&gt.createElement(S,null,gt.createElement(ub,{src:`${e.images[0]}?w=632`,alt:`${e.name}`})),e.logotype&&gt.createElement(S,null,gt.createElement(qe,{logo:`${e.logotype}?w=160`,logo2x:`${e.logotype}?w=320`,alt:e.manufacturer||r("common.logotype")||"",wide:!0})),gt.createElement(S,null,gt.createElement(Ab,{prices:i})),gt.createElement(S,null,gt.createElement(le,{dangerouslySetInnerHTML:{__html:q5(e.description)}})),e.articleNumber&&gt.createElement(S,null,gt.createElement(Ei,{as:"div"},r("item.accessories.articleNumberShort")),gt.createElement("div",null,e.articleNumber)),e.productPage&&e.productPage.url&&gt.createElement(S,null,gt.createElement(ls,{href:e.productPage.url,title:r("item.accessories.moreInformationAboutAccessory",{accessory:e.name})||"",target:"_blank",rel:"noopener noreferrer nofollow"},e.productPage.title||r("common.readMore")," (",r("common.opensInNewTab"),")")))},fb=Z5;var tN=({accessories:e})=>{let{t}=eN(),[r,i]=X5(),n=a=>i(a),o=()=>i(void 0);return e?.length?Ht.createElement(Ht.Fragment,null,r&&Ht.createElement(fb,{accessory:r,onClose:o}),Ht.createElement(It,null,Ht.createElement(S,null,Ht.createElement(Ve,{noMargin:!0},t("item.accessories.accessories"))),Ht.createElement(S,null,Ht.createElement(le,null,Ht.createElement("p",null,t("item.accessories.accessoriesDescription")))),Ht.createElement(S,null,Ht.createElement(Cs,{columns:1.05,columnsSm:2.1,columnsMd:2,spacing:2,items:e.map(a=>Ht.createElement(cb,{key:a.id,title:a.name,image:a.images?.[0]?{src:`${a.images?.[0]}?w=539&h=303`,alt:a.name}:void 0,price:`${$(a.price)} ${t("currency.default")}`,preamble:a.excerpt,readMoreCta:()=>n(a)}))})))):null},gb=tN;import{useEffect as N_,useRef as lI}from"react";function T_(e,t,r){let i=lI(void 0),n=lI(r);n.current=r;let o=async()=>{if(t)try{let a=await Promise.resolve().then(()=>(sI(),aI));a&&(i.current=new a.default({id:e,ecomSdkConfig:{api:{address:t.url},bankIdThumbprint:t?.bankIdThumbprint},logo:t.serviceLogotypeUrl,logoX2:t.serviceLogotypeUrl,onEvent:(s,l,m,u)=>{V.publish("Ecom",{id:e,branchId:n.current?.id,branchName:n.current?.name,view:s,event:l,currentStep:m,data:u})}}))}catch{}};return N_(()=>(o(),()=>{i.current&&i.current.destroy()}),[]),i}var cI=T_;import{marked as P_}from"marked";var O_=({marketCode:e="SE",id:t,hashRoute:r,pathRoute:i,disableResetScrollOnInit:n,placeholderImage:o,modifyDocumentTitleItem:a,displayBranchName:s,onClickSearchItem:l})=>{let m=dn(e),{ecomSettings:u}=Ts(),{loading:h,data:p}=p0(t),{vehicle:f,loading:w}=vy(p?.vehicle),k=f?.contact,A=f?.branch,y=cI(t,u,A),[g,E]=B_(!1),B=uI(()=>E(!g),[g]);dI(()=>{n||window.scrollTo(0,0)},[]),dI(()=>{if(p?.vehicle?.data&&a){let{vehicle:Bt}=p,{registrationNumber:ua}=Bt.data;document.title=`${ua} | ${Bt.title} | ${Bt.shortDescription}`}},[p]);let j=M_(()=>p?.vehicle?.data?.options?.filter(zn).map(Bt=>({title:Bt})),[p?.vehicle?.data?.options]),J=uI(()=>V.publish("OptionsClick",{id:t,branchId:A?.id,branchName:A?.name}),[A]);if(!m)return null;if(h)return F.createElement(xy,null);if(!p?.vehicle?.data)return F.createElement(wy,null);let{vehicle:ie}=p,{title:Y,accessories:O,shortDescription:_,media:U,description:P,price:T,discount:M,financialOptions:b,manufacturer:v,ecommerce:x,packageOptions:N,publishedAt:K,documents:ae,availableFrom:Te,flags:Me}=ie,W=f?.insuranceOptions?f.insuranceOptions:ie.insuranceOptions,{fuelType:z,mileage:je,gearboxType:se,odometerReading:te,modelYear:De,propertySet:He}=ie.data,Be=[{title:De}];return Me?.demoVersion&&Be.push({title:fe.t("item.demoCar"),onClick:B}),Be.push({title:`${$(te?.value||je)} ${fe.t(`odometer.${te?.unit||"ScandinavianMile"}`)}`}),se&&Be.push({title:se}),z&&Be.push({title:z}),F.createElement(F.Fragment,null,F.createElement(Yr,null,F.createElement(vt,{large:!0},F.createElement(kt,null,F.createElement(c0,null,F.createElement(u0,null,F.createElement(yn,{mobileOrder:1},!i&&r?F.createElement(S,null,F.createElement(Aa,null,F.createElement(Dp,{as:"a",href:"#",title:fe.t("navigation.backToSearch")},F.createElement(ue,null,F.createElement(on,{block:!0})),F.createElement(ue,null,fe.t("navigation.backToSearch"))))):null,v?.logotype&&F.createElement(S,null,F.createElement(qe,{logo:v.logotype,alt:v.name})),F.createElement(S,null,F.createElement(Je,null,F.createElement(Pt,{noMargin:!0},Y)),_&&F.createElement(Je,null,F.createElement("div",null,_)),F.createElement(Je,null,F.createElement(lo,{small:!0,items:Be})))),F.createElement(yn,{mobileOrder:2},F.createElement(KA,{price:T,discount:M||void 0})),(b.length>0||W.length>0)&&F.createElement(yn,{mobileOrder:4},b.length>0&&F.createElement(R0,{id:t,branch:A,financialOptions:b,marketCode:e}),W.length>0&&F.createElement(kg,{id:t,branch:f?.branch,insuranceOptions:W})),F.createElement(yn,{mobileOrder:5},F.createElement(jg,{id:t,marketCode:e,manufacturer:v,packageOptions:N,ecommerce:x,branch:A,contact:f?.contact,loadingCentralStorageVehicle:w,availableFrom:Te,toggleEcomModal:()=>y.current?.start()}))),F.createElement(Xa,null,F.createElement(yn,{mobileOrder:3},F.createElement(l0,{id:t,branch:A,media:U,placeholderImage:o})),F.createElement(It,null,F.createElement(S,null,F.createElement(Ve,{noMargin:!0},fe.t("item.carData"))),F.createElement(S,null,F.createElement(le,null,F.createElement("p",null,fe.t("item.carDataDescription")))),F.createElement(S,null,F.createElement(Qy,{propertySet:He,vehicleData:ie.data}))),P&&F.createElement(It,null,F.createElement(cf,{author:k&&k.name?k.name:null,date:K?qn.format(K,qn.DayMonth,e):void 0,avatar:k?.avatar||void 0},!!P&&F.createElement("div",{dangerouslySetInnerHTML:{__html:P_(P)}}))),(j?.length||0)>0&&F.createElement(It,null,F.createElement(S,null,F.createElement(Ve,{noMargin:!0},fe.t("item.equipment"))),F.createElement(S,null,F.createElement(le,null,F.createElement("p",null,fe.t("item.equipmentDescription")))),F.createElement(S,null,F.createElement(Ga,{actionTitle:fe.t("common.showMore"),onClick:J},F.createElement(lo,{items:j})))),F.createElement(zy,{documents:ae}),F.createElement(gb,{accessories:O}),F.createElement(It,null,F.createElement(gy,{branch:A,displayBranchName:s,loading:w}),x&&x.enabled&&F.createElement(S,null,F.createElement(nr,{disabled:!!x.reserved,title:"K\xF6p bilen online",onClick:()=>y.current?.start()},"K\xF6p bilen online"))),F.createElement(ny,{packageOptions:N}),F.createElement(vg,{packageOption:v?.packageOption}))))),F.createElement(iy,{id:t,hashRoute:r,pathRoute:i,authorizedReseller:!!A?.flags?.authorizedReseller,displayBranchName:s,onClickSearchItem:l})),F.createElement(eo,{id:sr.DefaultPortal}),g&&F.createElement(jy,{onClose:B}))},np=O_;import wi from"react";var Vl={name:"@wayke-se/components-react",version:"5.0.2",description:"",module:"dist/index.mjs",main:"dist/index.js",types:"dist/index.d.ts",type:"module",files:["dist"],scripts:{prebuild:"npm run clean",test:"npm run lint",lint:"eslint 'src/**/*.{ts,tsx}' 'example/**/*.{ts,tsx}'","lint:fix":"eslint 'src/**/*.{ts,tsx}' 'example/**/*.{ts,tsx}' --fix",typecheck:"tsc --noEmit --skipLibCheck",prettify:"prettier --write 'src/**/*.{ts,tsx}'",gen:"graphql-codegen --config ./codegen.yml","generate-libphonenumber-metadata":"libphonenumber-metadata-generator src/utils/metadata.min.json --countries SE,NO --extended",prepare:"husky",start:"node ./esbuild/start.js",build:"npm run clean && node ./esbuild/lib.js",clean:"rimraf build && rimraf dist && rimraf dist-cdn","build:types":"tsc --emitDeclarationOnly --declaration --project tsconfig.build.json"},repository:{type:"git",url:"git+https://github.com/wayke-se/components-react.git"},author:"Ourstudio",license:"MIT",peerDependencies:{react:"^18 || ^19","react-dom":"^18 || ^19","styled-components":"^6"},devDependencies:{"@eslint/js":"^9.39.0","@graphql-codegen/cli":"^7.1.2","@graphql-codegen/typescript":"^6.0.2","@types/googlemaps":"^3.43.3","@types/node":"^25.9.2","@types/react":"^19.2.17","@types/react-dom":"^19.2.3","@types/react-slick":"^0.23.13","@typescript-eslint/eslint-plugin":"^8.61.0","@typescript-eslint/parser":"^8.61.0","@wayke-se/ecom-web":"^2.1.0",dotenv:"^17.4.2",esbuild:"^0.28.0","esbuild-plugin-copy":"^2.1.1",eslint:"^9.39.4","eslint-config-prettier":"^10.1.8","eslint-plugin-import":"^2.32.0","eslint-plugin-prettier":"^5.5.6","eslint-plugin-react":"^7.37.5",globals:"^16.5.0",husky:"^9.1.7","libphonenumber-metadata-generator":"^2.0.6","lint-staged":"^17.0.7","npm-dts":"^1.3.13",prettier:"^3.8.4",react:"^19.2.7","react-dom":"^19.2.7","react-router-dom":"^7.17.0",rimraf:"^6.1.3","styled-components":"^6.4.2",typescript:"^6.0.3"},dependencies:{"@apollo/client":"^4.2.3","@emotion/is-prop-valid":"^1.4.0","@photo-sphere-viewer/core":"^5.14.1","date-fns":"^4.4.0",graphql:"^16.14.2",i18next:"^26.3.1","libphonenumber-js":"^1.13.6",marked:"^18.0.5","react-compound-slider":"^3.4.0","react-i18next":"^17.0.8","react-slick":"^0.31.0","scroll-into-view-if-needed":"^3.1.0"}};import F_ from"react";import{ApolloClient as R_,InMemoryCache as __,HttpLink as H_}from"@apollo/client";import{ApolloProvider as G_}from"@apollo/client/react";var U_=({uri:e,children:t})=>{let r=new R_({link:new H_({uri:e}),cache:new __});return F_.createElement(G_,{client:r},t)},Jl=U_;import mI from"react";import Q_ from"@emotion/is-prop-valid";import{StyleSheetManager as j_,ThemeProvider as Y_}from"styled-components";var W_=(e,t)=>typeof t=="string"?Q_(e):!0,$_=({children:e})=>mI.createElement(j_,{shouldForwardProp:W_},mI.createElement(Y_,{theme:lt},e)),la=$_;import V_,{useState as Kl,useEffect as ql,useCallback as op}from"react";var pI=()=>new URLSearchParams(window.location.search);var ap=new URLSearchParams;ap.set("hits","30");ap.set("sort","published-desc");var J_=({url:e,apiKey:t,useQueryParamsFromUrl:r,pathRoute:i,children:n})=>{let{replaceState:o,pushState:a}=cn(),[s,l]=Kl({searchParams:ap}),[m,u]=Kl(),[h,p]=Kl(),[f,w]=Kl(!1),{data:k}=Ni(`${e}?hits=0`,{headers:t?{"x-api-key":t}:{}},!!m),A=s.searchParams.toString(),{loading:y,data:g,error:E}=Ni(`${e}${A?`?${A}`:""}`,{headers:t?{"x-api-key":t}:{}},!f||!!s?.block),B=O=>{let{currentTarget:_}=O;if(_){let U=new URLSearchParams(_.location.search);U.has("sort")||U.set("sort","published-desc"),l({searchParams:U})}};ql(()=>{r&&window.addEventListener("popstate",B);let O={actionName:"onFilterUpdate",callback:j};return V.subscribeAction(O),()=>{window.removeEventListener("popstate",B),V.unsubscribeAction(O)}},[]),ql(()=>{k&&u(k.facets)},[k]),ql(()=>{if(r){let O=new URLSearchParams(s.searchParams);O.delete("hits"),O.delete("offset"),O.get("sort")==="published-desc"&&O.delete("sort");let _=O.toString()?`?${O}`:"";if(f&&window.location.search.localeCompare(_)!==0){let U=i?.replace(/^\/|\/$/g,""),P=U?`/${U}/`:"/",T=U?window.location.pathname.indexOf(P):-1,M=window.location.pathname;T>-1&&(M=M.substr(0,T)),a(`${M}${_}`)}}},[s,f,r]),ql(()=>{if(g){if(!m&&!r&&u(g.facets),r&&g.query?.parameters){let O=new URLSearchParams(g.query.parameters);O.delete("hits"),O.delete("offset");let _=O.toString()?`?${O}`:"";window.location.search.localeCompare(_)!==0&&(o(`${window.location.pathname}${_}`),l({searchParams:new URLSearchParams(_),block:!0}))}s?.concatResult?p([...h||[],...g.documentList.documents||[]]):p(g.documentList.documents||[])}},[g,r]);let j=op(O=>{{f||w(!0);let _=new URLSearchParams(O);_.delete("offset"),l({searchParams:_})}},[f]),J=op(()=>{g&&l({searchParams:new URLSearchParams(g?.documentList.pagination.nextPage?.query),concatResult:!0})},[g]),ie=op(O=>{if(!f){let _=pI(),U=r?_:O;if(r&&O&&O.forEach((P,T)=>{U?.getAll(T)?.some(M=>M===P)||U?.append(T,P)}),U){let P=new URLSearchParams(U);P.delete("hits"),P.delete("offset"),U.has("hits")||U.set("hits","30"),U.has("sort")||U.set("sort","published-desc");let T=P.toString()?`?${P}`:"";l({searchParams:U}),r&&o(`${window.location.pathname}${T}`)}w(!0)}},[f]),Y={loading:y,error:E,response:g,documents:h,initialFacets:m,queryFilter:s,onFilterUpdate:j,onLoadMore:J,onInitialize:ie};return V_.createElement(ga.Provider,{value:Y},n)},hI=J_;import K_ from"styled-components";var q_=K_.div.attrs(()=>({className:"wayke__theme wayke__font--regular"}))`
5450
5450
  background-color: ${e=>e.theme.color.bg};
5451
5451
  color: ${e=>e.theme.color.textDark};
5452
5452
  font-size: 1rem;