(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4242],{99376:function(e,t,r){"use strict";var s=r(35475);r.o(s,"notFound")&&r.d(t,{notFound:function(){return s.notFound}}),r.o(s,"usePathname")&&r.d(t,{usePathname:function(){return s.usePathname}}),r.o(s,"useSearchParams")&&r.d(t,{useSearchParams:function(){return s.useSearchParams}})},40257:function(e,t,r){"use strict";var s,n;e.exports=(null==(s=r.g.process)?void 0:s.env)&&"object"==typeof(null==(n=r.g.process)?void 0:n.env)?r.g.process:r(44227)},44227:function(e){!function(){var t={229:function(e){var t,r,s,n=e.exports={};function o(){throw Error("setTimeout has not been defined")}function a(){throw Error("clearTimeout has not been defined")}function i(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:o}catch(e){t=o}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var l=[],c=!1,p=-1;function u(){c&&s&&(c=!1,s.length?l=s.concat(l):p=-1,l.length&&d())}function d(){if(!c){var e=i(u);c=!0;for(var t=l.length;t;){for(s=l,l=[];++p<t;)s&&s[p].run();p=-1,t=l.length}s=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function m(){}n.nextTick=function(e){var t=Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];l.push(new h(e,t)),1!==l.length||c||i(d)},h.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=m,n.addListener=m,n.once=m,n.off=m,n.removeListener=m,n.removeAllListeners=m,n.emit=m,n.prependListener=m,n.prependOnceListener=m,n.listeners=function(e){return[]},n.binding=function(e){throw Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw Error("process.chdir is not supported")},n.umask=function(){return 0}}},r={};function s(e){var n=r[e];if(void 0!==n)return n.exports;var o=r[e]={exports:{}},a=!0;try{t[e](o,o.exports,s),a=!1}finally{a&&delete r[e]}return o.exports}s.ab="//";var n=s(229);e.exports=n}()},10855:function(e,t,r){"use strict";r.d(t,{C:function(){return c}});var s=r(57437),n=r(80684),o=r(75461),a=r(61994);let i=(0,r(52074).g)("check-all","sc"),l=Object.freeze({wrapper:`${i}__wrapper`,link:`${i}__link`,icon:`${i}__icon`,iconGray:`${i}__icon--gray`}),c=({children:e,className:t,linkClassName:r,iconGrayBackground:i,Link:c,event:p,href:u,dataLayerPush:d})=>{let h=c??o.rU;return(0,s.jsx)("div",{className:(0,a.Z)(l.wrapper,t),onClick:()=>{p&&d(p)},children:(0,s.jsxs)(h,{className:(0,a.Z)(l.link,r),href:u,children:[e,(0,s.jsx)("span",{className:(0,a.Z)(l.icon,{[l.iconGray]:i}),children:(0,s.jsx)(n.IconFdsArrowUpRightSmallO,{size:24})})]})})}},20777:function(e,t,r){"use strict";let s;r.d(t,{MJ:function(){return U}});var n=r(57437),o=r(35563),a=r(75461),i=r(61994),l=r(2265),c=r(10855),p=r(59535),u=r(80684),d=r(52074),h=r(31620),m=r(77337),f=((s=f||{}).light="light",s.gray="gray",s);let g=e=>"kasko"===e||"osago"===e,_=(0,d.g)("best-offers-banner","sc"),y=Object.freeze({bestOffersBaner:_,wrapper:`${_}__wrapper`,wideWrapper:`${_}__wrapper--wide`,whiteWrapper:`${_}__wrapper--white`,content:`${_}__content`,header:`${_}__header`,title:`${_}__title`,subtitle:`${_}__subtitle`,icon:`${_}__icon`,iconBlack:`${_}__icon--black`,iconWhite:`${_}__icon--white`,image:`${_}__image`}),b=({title:e,image:t,url:r,description:s,backgroundColor:a,textColor:l,wide:c,theme:p,handleBannerDataLayerPush:d,className:h})=>{let m=p===f.gray,g={"--bg-base":(null==a?void 0:a.base)??(m?"var(--color-white)":"var(--color-gray-400)"),"--bg-hover":(null==a?void 0:a.hover)??"var(--color-gray-500)"};return(0,n.jsxs)("div",{className:(0,i.Z)(y.wrapper,h,{[y.wideWrapper]:c}),style:g,onClick:()=>{d(),window.open(r,"_blank")},children:[(0,n.jsxs)("div",{className:y.content,children:[(0,n.jsxs)("div",{className:y.header,children:[(0,n.jsx)(o.xv,{weight:"medium",size:"24",className:y.title,style:{color:l},children:e}),(0,n.jsx)("div",{className:(0,i.Z)(y.icon,{[y.iconBlack]:m&&!(null!=l&&l.includes("color-white")),[y.iconWhite]:m&&!!(null!=l&&l.includes("color-white"))}),children:(0,n.jsx)(u.IconFdsArrowUpRightSmallO,{size:32})})]}),s&&(0,n.jsx)(o.xv,{size:"16",style:{color:l},children:s})]}),(null==t?void 0:t.url)&&(0,n.jsx)("picture",{className:y.image,children:(0,n.jsx)("img",{src:t.url,width:t.width??150,height:t.height??"auto",alt:`Баннер ${e}`,loading:"lazy"})})]})},v=(0,d.g)("offer-card","sc"),x=Object.freeze({offerCard:v,wrapper:`${v}__wrapper`,whiteWrapper:`${v}__wrapper--white`,bankInfo:`${v}__bankInfo`,units:`${v}__units`,unitsColumn:`${v}__units--column`,unit:`${v}__unit`,unitRow:`${v}__unit--row`,unitTitleWrapper:`${v}__unitTitleWrapper`,unitTitle:`${v}__unitTitle`,tooltipIcon:`${v}__tooltipIcon`,unitValue:`${v}__unitValue`,bottomBlock:`${v}__bottomBlock`,tags:`${v}__tags`,tag:`${v}__tag`,button:`${v}__button`,buttonRounded:`${v}__button--rounded`,buttonAdditional:`${v}__button--additional`}),w=e=>{let t=e.split("₽");return t.map((e,r)=>(0,n.jsxs)(l.Fragment,{children:[e,r<t.length-1&&(0,n.jsx)(o.xv,{fontFamily:"primary",weight:"regular",children:"₽"})]},`${e}-${r}`))},j=({title:e,value:t,tooltip:r,textColor:s,unitsAsColumn:l,isTitleUnit:c})=>(0,n.jsxs)("div",{className:(0,i.Z)(x.unit,{[x.unitRow]:l}),children:[(0,n.jsxs)("div",{className:x.unitTitleWrapper,children:[(0,n.jsx)(o.xv,{size:"14",className:x.unitTitle,children:e}),r&&(0,n.jsx)(a.u,{text:r,children:(0,n.jsx)(u.IconFdsQuestionCircleO,{className:x.tooltipIcon})})]}),(0,n.jsx)(o.xv,{weight:"medium",size:c?"18":l?"16":"24",className:x.unitValue,style:{color:s},children:e.includes("Рейтинг")?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(u.IconFdsStarF,{size:16,style:{color:"var(--color-orange-400)"}}),t]}):w(t)})]}),$=({tags:e,isGrayTheme:t})=>{let r=t?"secondary":"primary";return(0,n.jsx)("div",{className:x.tags,children:e.sort((e,t)=>e.order-t.order).map(e=>(0,n.jsx)(a.Vp,{className:x.tag,label:e.label,variant:e.variant?e.variant:r,rounded:!0},e.label))})},k=({companyName:e,name:t,url:r,logo:s,units:o,tags:l,additionalButton:c,unitsAsColumn:p,dataLayerPush:u,eventCategory:d,productType:m,theme:g,buttonClassName:_,eventValueByUnitTitle:y})=>{let b=g===f.gray,v=r=>{let s={event:"data-event",eventCategory:d,eventAction:`click_button_${(0,h.t)(r)}_${m}`,eventLabel:(0,h.t)(`${e}_${t}`)};if(y){let e=o.find(e=>e.title.toLowerCase()===y.toLowerCase());e&&(s.eventValue=(0,h.t)(e.value))}u(s)};return(0,n.jsxs)("div",{className:(0,i.Z)(x.wrapper,{[x.whiteWrapper]:b}),children:[(0,n.jsxs)("div",{className:x.bankInfo,children:[s&&(0,n.jsx)("img",{src:s,width:56,height:56,alt:`${e} logo`}),(0,n.jsx)(j,{title:t,value:e,isTitleUnit:!0})]}),(0,n.jsx)("div",{className:(0,i.Z)(x.units,{[x.unitsColumn]:p}),children:o.map(e=>(0,n.jsx)(j,{title:e.title,value:e.value,tooltip:e.tooltip,textColor:e.textColor,unitsAsColumn:p},`${e.title}-${e.value}`))}),(0,n.jsxs)("div",{className:x.bottomBlock,children:[l&&(0,n.jsx)($,{tags:l,isGrayTheme:b}),c&&c.text.trim().length>0&&(0,n.jsx)(a.zx,{as:"a",className:(0,i.Z)(x.button,x.buttonRounded,x.buttonAdditional),size:"xs",label:c.text,href:null==c?void 0:c.url,variant:b?"secondary":"white",onClick:()=>v(c.text)}),(0,n.jsx)(a.zx,{as:"a",className:(0,i.Z)(x.button,_),size:"xs",label:"Подробнее",href:r,onClick:()=>v("podrobnee_o_kartochke_iz")})]})]})},N=(0,d.g)("offers-list","sc"),T=Object.freeze({offersList:N,wrapper:`${N}__wrapper`,sliderWrapper:`${N}__sliderWrapper`,offerItem:`${N}__offerItem`,compact:`${N}__offerItem--compact`,bannerItem:`${N}__bannerItem`}),C=({offers:e,banner:t,dataLayerPush:r,eventCategory:s,productType:o,theme:l,singleProduct:c})=>{let p=e.length<=2;return(0,n.jsxs)(a.iR,{options:{slidesPerView:"auto",spaceBetween:0,autoplay:{delay:3e3,disableOnInteraction:!1}},breakpoints:{xl:{autoplay:!1}},className:T.sliderWrapper,pagination:!0,children:[e.slice(0,3).map(e=>(0,n.jsx)(a.wI,{className:(0,i.Z)(T.offerItem,{[T.compact]:c}),children:(0,n.jsx)(k,{...e,dataLayerPush:r,eventCategory:s,productType:o,theme:l})},e.id)),t&&(0,n.jsx)(a.wI,{className:T.bannerItem,children:(0,n.jsx)(b,{...t,handleBannerDataLayerPush:()=>{r({event:"data-event",eventCategory:s,eventAction:"click_bnr_banner_top_predlozheniy",eventLabel:o})},wide:p,theme:l})})]},o)},A=(0,d.g)("osago-tab","sc"),S=Object.freeze({osagoTab:A,wrapper:`${A}__wrapper`,card:`${A}__card`,whiteCard:`${A}__card--white`,image:`${A}__image`,content:`${A}__content`,inputWrapper:`${A}__inputWrapper`,select:`${A}__select`,input:`${A}__input`,buttonLinkWrapper:`${A}__buttonLinkWrapper`,button:`${A}__button`,banner:`${A}__banner`}),L={kasko:{title:"Рассчет Каско за минуту",description:"Выберите лучшие условия для оформления полиса",backgroundColor:{base:"#f1f5ff",hover:"#a3ceec"}},osago:{title:"ОСАГО с экономией до 78%",description:"Предварительная цена после ввода номера ТС",backgroundColor:{base:"#f1f5ff",hover:"#a3ceec"}}},P=[{label:"Мотоцикл",value:"moto"},{label:"Автомобиль",value:"auto"}],O=Object.fromEntries(P.map(e=>[e.value,e])),E={auto:{mask:"a 000 aa 00",placeholder:"A 000 AA 00"},moto:{mask:"0000 aa 00",placeholder:"0000 AA 00"}},z="АВЕКМНОРСТУХ",I=RegExp(`[${z}]`,"i"),W=RegExp(`[^0-9${z}]`,"gi"),q=({type:e,baseUrl:t,s3Assets:r,banner:s,dataLayerPush:c,eventCategory:p,theme:u})=>{let d="osago"===e,g=(0,m.xn)(t,"osago"),_=(0,m.xn)(g,"step-car"),y=(0,m.xn)(t,"kasko"),v=(0,m.xn)(y,"vehicle"),x=d?_:v,[w,j]=(0,l.useState)(""),[$,k]=(0,l.useState)("auto"),{mask:N,placeholder:T}=E[$],C=u===f.gray,A=`?${new URLSearchParams({type:d?$:"auto",license:w})}`,z=(0,m.xn)(x,A),q=s??{...L[e],url:d?g:y,image:r?{url:(0,m.xn)(r,`pl-common-blocks-renderer/topOffers/${d?"icon_osago":"icons_car"}.png`),width:204,height:160}:void 0},R=O[$].label,B=(t,r)=>{c({event:"data-event",eventCategory:p,eventAction:t,eventLabel:r??e})};return(0,n.jsxs)("div",{className:S.wrapper,children:[(0,n.jsxs)("div",{className:(0,i.Z)(S.card,{[S.whiteCard]:C}),children:[r&&(0,n.jsx)("picture",{children:(0,n.jsx)("img",{src:`${r}/pl-common-blocks-renderer/topOffers/auto_bg.png`,alt:"Автомобиль",loading:"lazy",className:S.image})}),(0,n.jsxs)("div",{className:S.content,children:[(0,n.jsxs)(o.X6,{as:"h3",type:"h3",children:["Онлайн калькулятор ",d?"ОСАГО":"Каско"]}),(0,n.jsxs)("div",{className:S.inputWrapper,children:[d&&(0,n.jsx)(a.Ph,{options:P,value:O[$],label:"Тип транспорта",variant:C?"primary":"secondary",className:S.select,onChange:e=>{j(""),k(e.value),B(`selector_item_${(0,h.t)(e.label)}`)}}),(0,n.jsx)(a.An,{label:"Госномер",variant:C?"primary":"secondary",maskOpts:{mask:N,definitions:{a:I}},maskPlaceholder:T,value:w,className:S.input,onChange:(e,t)=>{j(t.replace(W,"").toUpperCase())},onClick:()=>B(`message_field_${(0,h.t)(R)}`),onBlur:()=>B(`on_message_field_${(0,h.t)(R)}`)}),(0,n.jsxs)(o.xv,{children:["У меня"," ",(0,n.jsx)(a.rU,{href:x,onClick:()=>{B("click_link_net_nomera",x)},children:"нет номера"})]})]}),(0,n.jsx)(a.zx,{as:"a",href:z,size:"s",className:S.button,onClick:()=>{B(`click_button_rasschitat_${(0,h.t)(R)}`,z)},children:"Рассчитать"})]})]}),(0,n.jsx)("div",{className:S.banner,children:(0,n.jsx)(b,{...q,theme:u,handleBannerDataLayerPush:()=>{B("click_bnr_banner_top_predlozheniy")}})})]})},R=(0,d.g)("best-offers","sc"),B=Object.freeze({bestOffers:R,graySection:`${R}--gray`,singleProduct:`${R}--singleProduct`,title:`${R}__title`,singleProductTitle:`${R}__title--singleProduct`,chips:`${R}__chips`,warning:`${R}__warning`,allOffersLink:`${R}__allOffersLink`}),F={вклады:"вкладам",облигации:"облигациям",кредиты:"кредитам",займы:"займам","Кредитные карты":"кредитным картам",каско:"каско",осаго:"ОСАГО","дебетовые карты":"дебетовым картам",ипотека:"ипотеке",автокредиты:"автокредитам"},U=({tabs:e,baseUrl:t,s3Assets:r,eventCategory:s="best-offers",dataLayerPush:u,singleProduct:d=!1,theme:h=f.light,className:m})=>{let _=h===f.gray,y=e.map(e=>({url:e.productType,title:e.name})),[b,v]=(0,l.useState)(y[0].url),x=e.find(e=>e.productType===b)??e[0],w=(0,a._m)("xl"),j=F[x.name.toLowerCase()],$=j?`по ${j}`:x.name,k=g(null==x?void 0:x.productType)&&t?(0,n.jsx)(q,{type:x.productType,banner:x.banner,baseUrl:t,s3Assets:r,dataLayerPush:u,eventCategory:s,theme:h}):null;return(0,n.jsx)("section",{className:(0,i.Z)(B.bestOffers,m,{[B.singleProduct]:d,[B.graySection]:_}),children:(0,n.jsxs)(o.W2,{children:[(0,n.jsxs)(o.X6,{as:"h2",type:d?"h2":"display",className:(0,i.Z)(B.title,!d&&(w?"mb-8":"mb-6"),d&&(0,i.Z)("mb-0",B.singleProductTitle)),children:["Лучшие предложения ",d?$:"сегодня"]}),!d&&(0,n.jsx)(p.N,{items:y,maxNumberOfLines:2,activeChipId:b,variant:_?"white":"gray",className:B.chips,onClick:t=>{v(t);let r=e.find(e=>e.productType===t);u({event:"data-event",eventCategory:s,eventAction:"click_chip_top_predlozheniy_vybor",eventLabel:null==r?void 0:r.productType})}}),(0,n.jsxs)("div",{children:[k??(0,n.jsx)(C,{offers:x.offers,banner:x.banner,dataLayerPush:u,eventCategory:s,productType:x.productType,theme:h,singleProduct:d}),x.hasWarning&&(0,n.jsx)(o.xv,{as:"p",size:"16",className:B.warning,children:x.warningCustomText??"Оценивайте свои финансовые возможности и риски. Изучите все условия кредита (займа)"})]}),x.checkAllUrl&&(0,n.jsx)(c.C,{href:x.checkAllUrl,event:{event:"data-event",eventCategory:s,eventAction:"link",eventLabel:`Показать все предложения ${x.productType}`},dataLayerPush:u,iconGrayBackground:!_,className:B.allOffersLink,linkClassName:x.checkAllLinkClassName,children:"Показать все предложения"})]})})}},17730:function(e,t,r){"use strict";r.d(t,{B:function(){return v}});var s=r(57437),n=r(35563),o=r(61994),a=r(80684),i=r(75461),l=r(10992),c=r(52074),p=r(2265);let u=(0,c.g)("support","sc"),d=Object.freeze({support:u,title:`${u}__title`,cardsContainer:`${u}__cards-container`}),h="cb-support",m=(0,c.g)("support-app-card","sc"),f=Object.freeze({supportAppCard:m,textWrapper:`${m}__text-wrapper`,imageContainer:`${m}__image-container`,title:`${m}__title`,description:`${m}__description`,icon:`${m}__icon`,imageWrapper:`${m}__image-wrapper`,image:`${m}__image`}),g=({title:e,linkUrl:t,s3Assets:r,description:n})=>{let o=(0,i.aF)("s");return(0,s.jsxs)("div",{className:f.supportAppCard,onClick:()=>{o&&((0,l.h)({eventCategory:h,eventActionType:l.D.banner,eventActionText:e,eventLabel:t}),window.open(t,"_blank","noreferrer"))},children:[(0,s.jsx)(a.IconFdsArrowUpRightSmallO,{className:f.icon,size:32}),(0,s.jsxs)("div",{className:f.textWrapper,children:[(0,s.jsx)("div",{className:f.title,children:e}),!!n&&(0,s.jsx)("div",{className:f.description,children:n})]}),(0,s.jsx)("div",{className:f.imageContainer,children:(0,s.jsxs)("picture",{className:f.imageWrapper,children:[(0,s.jsx)("source",{media:"(max-width: 767px)",srcSet:`${r}/mp-assets/widgets/SupportBlock/mobile-app.png 1x, ${r}/mp-assets/widgets/SupportBlock/mobile-app@2x.png 2x`}),(0,s.jsx)("img",{className:f.image,loading:"lazy",src:`${r}/mp-assets/widgets/SupportBlock/qr-code-mobile-app.jpg`,srcSet:`${r}/mp-assets/widgets/SupportBlock/qr-code-mobile-app.jpg 1x, ${r}/mp-assets/widgets/SupportBlock/qr-code-mobile-app@2x.jpg 2x`})]})})]})},_=(0,c.g)("support-phone-card","sc"),y=Object.freeze({supportPhoneCard:_,contacts:`${_}__contacts`,phone:`${_}__phone`,chat:`${_}__chat`,info:`${_}__info`,image:`${_}__image`}),b=({phones:e,description:t,s3Assets:r})=>{let n=(0,p.useCallback)(()=>{var e,t,r;null==(r=null==(t=null==(e=null==window?void 0:window.supportWidget)?void 0:e.craftTalk)?void 0:t.open)||r.call(t),(0,l.h)({eventCategory:h,eventActionType:l.D.button,eventActionText:"messenger",eventLabel:"chat"})},[]),o=e=>{let t=e.replace(/[\s-]/g,"");(0,l.h)({eventCategory:h,eventActionType:l.D.link,eventActionText:"phone",eventLabel:t})};return(0,s.jsxs)("div",{className:y.supportPhoneCard,children:[(0,s.jsxs)("div",{className:y.contacts,children:[e.map(e=>(0,s.jsx)("a",{className:y.phone,href:e.href,onClick:()=>o(e.label),children:e.label},e.label)),(0,s.jsx)("span",{className:y.chat,onClick:n,children:"Онлайн чат"})]}),(0,s.jsx)("div",{className:y.info,children:t}),(0,s.jsx)("img",{className:y.image,src:`${r}/mp-assets/widgets/SupportBlock/bannerSupportGirl.png`})]})},v=({className:e,phoneCard:t,appCard:r,s3Assets:a})=>(0,s.jsx)("section",{className:(0,o.Z)(d.support,e),children:(0,s.jsxs)(n.W2,{children:[(0,s.jsx)(n.X6,{as:"h2",type:"display",weight:"bold",className:(0,o.Z)(d.title,"mb-6"),children:"Поддержка"}),(0,s.jsxs)("div",{className:d.cardsContainer,children:[(0,s.jsx)(b,{s3Assets:a,...t}),(0,s.jsx)(g,{s3Assets:a,...r})]})]})});v.displayName="Support"},98645:function(e,t,r){"use strict";r.d(t,{Wg:function(){return y}});let s=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,n=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,o=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function a(e,t){if("__proto__"===e||"constructor"===e&&t&&"object"==typeof t&&"prototype"in t){console.warn(`[destr] Dropping "${e}" key to prevent prototype pollution.`);return}return t}function i(e,t={}){if("string"!=typeof e)return e;let r=e.trim();if('"'===e[0]&&e.endsWith('"')&&!e.includes("\\"))return r.slice(1,-1);if(r.length<=9){let e=r.toLowerCase();if("true"===e)return!0;if("false"===e)return!1;if("undefined"===e)return;if("null"===e)return null;if("nan"===e)return Number.NaN;if("infinity"===e)return Number.POSITIVE_INFINITY;if("-infinity"===e)return Number.NEGATIVE_INFINITY}if(!o.test(e)){if(t.strict)throw SyntaxError("[destr] Invalid JSON");return e}try{if(s.test(e)||n.test(e)){if(t.strict)throw Error("[destr] Possible prototype pollution");return JSON.parse(e,a)}return JSON.parse(e)}catch(r){if(t.strict)throw r;return e}}var l=r(77337);class c extends Error{constructor(e,t){super(e,t),this.name="FetchError",t?.cause&&!this.cause&&(this.cause=t.cause)}}let p=new Set(Object.freeze(["PATCH","POST","PUT","DELETE"]));function u(e="GET"){return p.has(e.toUpperCase())}let d=new Set(["image/svg","application/xml","application/xhtml","application/html"]),h=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;async function m(e,t){if(t){if(Array.isArray(t))for(let r of t)await r(e);else await t(e)}}let f=new Set([408,409,425,429,500,502,503,504]),g=new Set([101,204,205,304]),_=function(){if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw Error("unable to locate global object")}(),y=function e(t={}){let{fetch:r=globalThis.fetch,Headers:s=globalThis.Headers,AbortController:n=globalThis.AbortController}=t;async function o(e){let t=e.error&&"AbortError"===e.error.name&&!e.options.timeout||!1;if(!1!==e.options.retry&&!t){let t;t="number"==typeof e.options.retry?e.options.retry:u(e.options.method)?0:1;let r=e.response&&e.response.status||500;if(t>0&&(Array.isArray(e.options.retryStatusCodes)?e.options.retryStatusCodes.includes(r):f.has(r))){let r="function"==typeof e.options.retryDelay?e.options.retryDelay(e):e.options.retryDelay||0;return r>0&&await new Promise(e=>setTimeout(e,r)),a(e.request,{...e.options,retry:t-1})}}let r=function(e){let t=e.error?.message||e.error?.toString()||"",r=e.request?.method||e.options?.method||"GET",s=e.request?.url||String(e.request)||"/",n=`[${r}] ${JSON.stringify(s)}`,o=e.response?`${e.response.status} ${e.response.statusText}`:"<no response>",a=new c(`${n}: ${o}${t?` ${t}`:""}`,e.error?{cause:e.error}:void 0);for(let t of["request","options","response"])Object.defineProperty(a,t,{get:()=>e[t]});for(let[t,r]of[["data","_data"],["status","status"],["statusCode","status"],["statusText","statusText"],["statusMessage","statusText"]])Object.defineProperty(a,t,{get:()=>e.response&&e.response[r]});return a}(e);throw Error.captureStackTrace&&Error.captureStackTrace(r,a),r}let a=async function(e,a={}){let c;let p={request:e,options:function(e,t,r,s){let n;let o=function(e,t,r){if(!t)return new r(e);let s=new r(t);if(e)for(let[t,n]of Symbol.iterator in e||Array.isArray(e)?e:new r(e))s.set(t,n);return s}(t?.headers??e?.headers,r?.headers,s);return(r?.query||r?.params||t?.params||t?.query)&&(n={...r?.params,...r?.query,...t?.params,...t?.query}),{...r,...t,query:n,params:n,headers:o}}(e,a,t.defaults,s),response:void 0,error:void 0};if(p.options.method=p.options.method?.toUpperCase(),p.options.onRequest&&await m(p,p.options.onRequest),"string"==typeof p.request&&(p.options.baseURL&&(p.request=(0,l.pJ)(p.request,p.options.baseURL)),p.options.query&&(p.request=(0,l.jb)(p.request,p.options.query))),p.options.body&&u(p.options.method)&&(function(e){if(void 0===e)return!1;let t=typeof e;return"string"===t||"number"===t||"boolean"===t||null===t||"object"===t&&(!!Array.isArray(e)||!e.buffer&&(e.constructor&&"Object"===e.constructor.name||"function"==typeof e.toJSON))}(p.options.body)?(p.options.body="string"==typeof p.options.body?p.options.body:JSON.stringify(p.options.body),p.options.headers=new s(p.options.headers||{}),p.options.headers.has("content-type")||p.options.headers.set("content-type","application/json"),p.options.headers.has("accept")||p.options.headers.set("accept","application/json")):("pipeTo"in p.options.body&&"function"==typeof p.options.body.pipeTo||"function"==typeof p.options.body.pipe)&&!("duplex"in p.options)&&(p.options.duplex="half")),!p.options.signal&&p.options.timeout){let e=new n;c=setTimeout(()=>{let t=Error("[TimeoutError]: The operation was aborted due to timeout");t.name="TimeoutError",t.code=23,e.abort(t)},p.options.timeout),p.options.signal=e.signal}try{p.response=await r(p.request,p.options)}catch(e){return p.error=e,p.options.onRequestError&&await m(p,p.options.onRequestError),await o(p)}finally{c&&clearTimeout(c)}if(p.response.body&&!g.has(p.response.status)&&"HEAD"!==p.options.method){let e=(p.options.parseResponse?"json":p.options.responseType)||function(e=""){if(!e)return"json";let t=e.split(";").shift()||"";return h.test(t)?"json":d.has(t)||t.startsWith("text/")?"text":"blob"}(p.response.headers.get("content-type")||"");switch(e){case"json":{let e=await p.response.text(),t=p.options.parseResponse||i;p.response._data=t(e);break}case"stream":p.response._data=p.response.body;break;default:p.response._data=await p.response[e]()}}return(p.options.onResponse&&await m(p,p.options.onResponse),!p.options.ignoreResponseError&&p.response.status>=400&&p.response.status<600)?(p.options.onResponseError&&await m(p,p.options.onResponseError),await o(p)):p.response},p=async function(e,t){return(await a(e,t))._data};return p.raw=a,p.native=(...e)=>r(...e),p.create=(r={},s={})=>e({...t,...s,defaults:{...t.defaults,...s.defaults,...r}}),p}({fetch:_.fetch?(...e)=>_.fetch(...e):()=>Promise.reject(Error("[ofetch] global.fetch is not supported!")),Headers:_.Headers,AbortController:_.AbortController})}}]);