bukazu-portal-react 4.0.3 → 4.1.0

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.
@@ -1,4 +1,4 @@
1
- import e,{Component as t,createContext as n,useCallback as r,useContext as o,useEffect as s,useMemo as i,useReducer as a,useRef as c,useState as u}from"react";import{Fragment as l,jsx as d,jsxs as h}from"react/jsx-runtime";var p=()=>/* @__PURE__ */h("svg",{version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",width:"24px",height:"30px",viewBox:"0 0 24 30",enableBackground:"new 0 0 50 50",xmlSpace:"preserve",children:[
1
+ import e,{Component as t,createContext as n,useCallback as r,useContext as o,useEffect as i,useMemo as s,useReducer as a,useRef as c,useState as u}from"react";import{Fragment as l,jsx as d,jsxs as h}from"react/jsx-runtime";var p=()=>/* @__PURE__ */h("svg",{version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",width:"24px",height:"30px",viewBox:"0 0 24 30",enableBackground:"new 0 0 50 50",xmlSpace:"preserve",children:[
2
2
  /* @__PURE__ */h("rect",{x:"0",y:"10",width:"4",height:"10",fill:"#333",opacity:"0.2",children:[
3
3
  /* @__PURE__ */d("animate",{attributeName:"opacity",attributeType:"XML",values:"0.2; 1; .2",begin:"0s",dur:"0.6s",repeatCount:"indefinite"}),
4
4
  /* @__PURE__ */d("animate",{attributeName:"height",attributeType:"XML",values:"10; 20; 10",begin:"0s",dur:"0.6s",repeatCount:"indefinite"}),
@@ -10,156 +10,170 @@ import e,{Component as t,createContext as n,useCallback as r,useContext as o,use
10
10
  /* @__PURE__ */h("rect",{x:"16",y:"10",width:"4",height:"10",fill:"#333",opacity:"0.2",children:[
11
11
  /* @__PURE__ */d("animate",{attributeName:"opacity",attributeType:"XML",values:"0.2; 1; .2",begin:"0.3s",dur:"0.6s",repeatCount:"indefinite"}),
12
12
  /* @__PURE__ */d("animate",{attributeName:"height",attributeType:"XML",values:"10; 20; 10",begin:"0.3s",dur:"0.6s",repeatCount:"indefinite"}),
13
- /* @__PURE__ */d("animate",{attributeName:"y",attributeType:"XML",values:"10; 5; 10",begin:"0.3s",dur:"0.6s",repeatCount:"indefinite"})]})]});function f({filters:e,field:t,options:n,onChange:r,value:o}){const s=e.countries,i=e=>{o===e.target.value?a(null):a(e.target.value)},a=e=>{r(t.id,e)};return["cities","regions"].includes(t.id)?/* @__PURE__ */d("ul",{className:"radioList",children:n.map(e=>/* @__PURE__ */h("li",{className:"bu-list-item "+(s&&!s.includes(e.country_id)?"bu-disabled":"bu-open"),children:[/* @__PURE__ */d("input",{name:t.id,type:"checkbox",id:e.id,value:e.id,disabled:!!s&&!s.includes(e.country_id),checked:o===e.id,onBlur:e=>a(e.target.value),onChange:e=>a(e.target.value)}),/* @__PURE__ */d("label",{htmlFor:e.id,children:e.name})]},e.id))}):/* @__PURE__ */d("ul",{className:"radioList",children:n.map(e=>/* @__PURE__ */h("li",{className:"bu-list-item bu-open",children:[/* @__PURE__ */d("input",{name:t.id,type:"checkbox",id:String(e.id),value:e.id,checked:o===String(e.id),onBlur:e=>a(e.target.value),onChange:i}),/* @__PURE__ */d("label",{htmlFor:String(e.id),children:e.name})]},e.id))})}function m({options:e,field:t,filters:n,value:r,onChange:o}){const s=e=>{o(t.id,e.currentTarget.value)},i=n.countries,a=Array.isArray(n.regions)?n.regions:[n.regions].filter(e=>String(e).trim());if(e&&["countries","cities","regions"].includes(t.id)){const n=e;/* @__PURE__ */
14
- return h("select",{name:t.id,onBlur:s,onChange:s,value:r,children:[/* @__PURE__ */d("option",{value:""}),n.map(e=>{let n=!1;return["cities","regions"].includes(t.id)&&(i&&!i.includes(e.country_id)&&(n=!0),"cities"===t.id&&(!1!=!a.length||a.includes(e.region)||(n=!0))),/* @__PURE__ */d("option",{value:e.id,id:e.region,disabled:n,hidden:n,children:e.name},e.id)})]})}/* @__PURE__ */return h("select",{name:t.id,onBlur:s,onChange:s,value:r,children:[/* @__PURE__ */d("option",{value:""}),e.map(e=>"object"==typeof e?/* @__PURE__ */d("option",{value:e.id,children:e.name},e.id):/* @__PURE__ */d("option",{value:e,children:e},e))]})}function g({options:e,filters:t,onChange:n,field:r}){const o=t.countries,s=e=>{n(r.id,e.currentTarget.value)};/* @__PURE__ */
15
- return d("ul",{className:"radioList",children:e.map(e=>{const t="string"==typeof e?e:e.id,n="string"==typeof e?e:e.name,i="string"==typeof e?void 0:e.country_id,a=!(!o||!i)&&!o.includes(i);/* @__PURE__ */
13
+ /* @__PURE__ */d("animate",{attributeName:"y",attributeType:"XML",values:"10; 5; 10",begin:"0.3s",dur:"0.6s",repeatCount:"indefinite"})]})]});function f({filters:e,field:t,options:n,onChange:r,value:o,labelledBy:i}){const s=e.countries,a=["cities","regions"].includes(t.id);/* @__PURE__ */
14
+ return d("div",{className:"bu-chips",role:"group","aria-labelledby":i,"aria-label":i?void 0:t.label??t.id,children:n.map(e=>{const n=String(e.id),i=!(!a||!s)&&!s.includes(e.country_id);/* @__PURE__ */
15
+ return d("button",{type:"button",className:"bu-chip "+(i?"bu-disabled":""),"data-value":n,"aria-pressed":o===n,disabled:i,onClick:()=>(e=>{r(t.id,o===e?null:e)})(n),children:e.name},n)})})}function m({options:e,field:t,filters:n,value:r,onChange:o}){const i=e=>{o(t.id,e.currentTarget.value)},s=n.countries,a=Array.isArray(n.regions)?n.regions:[n.regions].filter(e=>String(e).trim());if(e&&["countries","cities","regions"].includes(t.id)){const n=e;/* @__PURE__ */
16
+ return h("select",{id:t.id,name:t.id,onBlur:i,onChange:i,value:r,children:[/* @__PURE__ */d("option",{value:""}),n.map(e=>{let n=!1;return["cities","regions"].includes(t.id)&&(s&&!s.includes(e.country_id)&&(n=!0),"cities"===t.id&&(!1!=!a.length||a.includes(e.region)||(n=!0))),/* @__PURE__ */d("option",{value:e.id,id:e.region,disabled:n,hidden:n,children:e.name},e.id)})]})}/* @__PURE__ */return h("select",{id:t.id,name:t.id,onBlur:i,onChange:i,value:r,children:[/* @__PURE__ */d("option",{value:""}),e.map(e=>"object"==typeof e?/* @__PURE__ */d("option",{value:e.id,children:e.name},e.id):/* @__PURE__ */d("option",{value:e,children:e},e))]})}function g({options:e,filters:t,onChange:n,field:r,labelledBy:o}){const i=t.countries,s=e=>{n(r.id,e.currentTarget.value)};/* @__PURE__ */
17
+ return d("ul",{className:"radioList",role:"radiogroup","aria-labelledby":o,"aria-label":o?void 0:r.label??r.id,children:e.map(e=>{const t="string"==typeof e?e:e.id,n="string"==typeof e?e:e.name,o="string"==typeof e?void 0:e.country_id,a=!(!i||!o)&&!i.includes(o);/* @__PURE__ */
16
18
  return h("li",{className:"bu-list-item "+(a?"bu-disabled":""),children:[/* @__PURE__ */d("input",{name:r.id,type:"radio",id:t,value:t,disabled:a,onBlur:s,onChange:s}),/* @__PURE__ */d("label",{htmlFor:t,children:n})]},t)})})}function _({value:e,onChange:t,field:n}){const r=e&&""!==e?e:"";/* @__PURE__ */
17
19
  return d("input",{type:"date",id:n.id,name:n.id,value:r,onChange:e=>{t(n.id,e.target.value)}})}function y({PortalSite:e,field:t,value:n,onChange:r}){/* @__PURE__ */
18
- return d("input",{value:n,type:"number",min:"0",max:"persons_min"===t.id?e.max_persons:e[t.id],onBlur:e=>{r(t.id,e.currentTarget.value)}})}var v=["persons_min","persons_max","bedrooms_min","bathrooms_min","weekprice_max"],b=["select","list","radio","number","date"];function w({PortalSite:e,field:t,filters:n,value:r,onFilterChange:o}){let s=[];var i;t.options?s=t.options:void 0!==t.max?s="weekprice_max"===t.id?function(e){let t=Math.ceil(e/100);return Array.from({length:t+1},(e,t)=>100*t)}(t.max):(i=t.max,Array.from({length:i+1},(e,t)=>t)):["countries","cities","regions"].includes(t.id)&&(s=e[t.id]||[]);const a=!b.includes(t.type)&&v.includes(t.id)?"select":t.type;return"select"===a?/* @__PURE__ */d(m,{options:s,field:t,filters:n,value:r,onChange:o}):"list"===a?/* @__PURE__ */d(f,{options:s,field:t,filters:n,value:r,onChange:o}):"radio"===a?/* @__PURE__ */d(g,{options:s,field:t,filters:n,onChange:o}):"number"===a?/* @__PURE__ */d(y,{PortalSite:e,field:t,value:r,onChange:o}):"date"===a?/* @__PURE__ */d(_,{field:t,value:r,onChange:o}):/* @__PURE__ */d("input",{value:r,onBlur:e=>{o(t.id,e.target.value)}})}var x=()=>/* @__PURE__ */d("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",version:"1.1",x:"0px",y:"0px",viewBox:"0 0 100 100",enableBackground:"new 0 0 100 100",xmlSpace:"preserve",height:"16px",children:/* @__PURE__ */d("path",{fill:"#000000",stroke:"2",d:"M77,53.752c0,0.012,0,0.022,0,0.034c0,14.92-12.019,27.058-26.938,27.058 c-14.92,0-26.948-12.138-26.948-27.058C23.114,38.961,35,26.889,50,26.738v4.942c0,2.84,2.54,2.913,3.947,1.647l10.354-7.714 c0,0,1.128-0.942,1.128-1.979c0-1.089-1.147-1.979-1.147-1.979L53.95,13.941C52.543,12.675,50,12.749,50,15.588v5.149 c-18,0.151-32.826,14.915-32.826,33.048c0,18.229,14.686,33.058,32.914,33.058C68.314,86.844,83,72.015,83,53.786 c0-0.012,0-0.022,0-0.034c0,0,0-3.375-3.037-3.375C77.109,50.376,77,53.752,77,53.752z"})}),k={next:"Next",previous:"Previous",view_details:"View details",price:"Price",calculate:"Next",currency:"Currency",book:"Book",booked:"Booked",booking:"Booking",last_minute_discount:"Last minute discount",discount:"Discount",option:"Option",choose_for_option:"Make a short reservation for this period ",included_in_price:"including",rent_price:"Rental price",extra_costs_included:"Extra costs included",optional_costs:"Extra options",price_after_discount:"Rental price incl. discount",booking_from_til:"Booking dates",total:"Total",stay_details:"Travel group",babies:"Babies",babies_from:"(up to the age of {babies})",adults:"Adults",adults_from:"(from the age of {age})","camper_spot.arrival_date":"Arrival date","camper_spot.departure_date":"Departure date","camper_spot.arrival":"Arrival","camper_spot.departure":"Departure","camping_place.arrival_date":"Arrival date","camping_place.departure_date":"Departure date","camping_place.arrival":"Arrival","camping_place.departure":"Departure","bnb.arrival_date":"Arrival date","bnb.departure_date":"Departure date","bnb.arrival":"Arrival","bnb.departure":"Departure","hotelroom.arrival_date":"Arrival date","hotelroom.departure_date":"Departure date","hotelroom.arrival":"Arrival","hotelroom.departure":"Departure",children:"Children",children_from:"(from {from} to {til} years inclusive)","house.arrival_date":"Arrival date","house.departure_date":"Departure date","house.arrival":"Arrival","house.departure":"Departure","group_accommodation.arrival_date":"Arrival date","group_accommodation.departure_date":"Departure date","group_accommodation.arrival":"Arrival","group_accommodation.departure":"Departure","tent.arrival_date":"Arrival date","tent.departure_date":"Departure date","tent.arrival":"Arrival","tent.departure":"Departure",extra_costs_bookable:"Extra options",costs_on_site:"Additional costs on the spot:",insurances:"Insurances",at_least_1_adult:"Choose at least 1 adult.",max_persons_reached:"Too many people have been selected.",personal_details:"Your information",required:"This field is required.",cancel_insurance_all_risk:"All Risk",cancel_insurance_normal:"Standard",none:"None",cancel_insurance:"Cancellation insurance",insurance_costs:"Insurance Costs",choose:"Choose",yes:"Yes",booking_details:"Booking details",based_on_one_person:"Based on {persons} persons",return_to_calendar:"Back to calendar",close:"Close",cancel_insurance_normal_long:"Short-term Cancellation Insurance ",cancel_insurance_normal_desc:"If you booked a wonderful holiday, cancellation insurance should not be missing! Your booked holiday cannot continue, or you have to go home unexpectedly halfway through the holiday due to, for example, a severe illness. The cancellation insurance of RecreatieVerzekeringen is ideal because it applies before departure and during your holiday.",cancel_insurance_more_insured:"More are insured than you think.",cancel_insurance_more_insured_desc:"Did you know that you can rely on cancellation insurance during pregnancy, a new job, or divorce? Many people expect cancellation insurance to be valid only in the event of illness or death.",cancel_insurance_important:"Important",cancel_insurance_important_message:"For optimal cancellation insurance coverage, you must take it out within seven days after booking the holiday.",cancel_insurance_for_whom:"For whom?",cancel_insurance_for_whom_explain:"This insurance is for a maximum of 4 families or 9 travel companions (no family members).",cancel_insurance_questions:"Frequently Asked Questions",cancel_insurance_questions_explain_1:"Click ",cancel_insurance_questions_explain_link:"here",cancel_insurance_questions_explain_2:" to find the Frequently Asked Questions.",show_terms:"Show conditions",terms:"Terms",remark:"Remark","9persons_9addresses":"The Insurance will pay for up to 9 persons, who live at 9 different addresses,",or:"or","9persons_4addresses":"The insurance pays out for an unlimited number of people who live at a maximum of 4 different addresses.",poliscosts:"Policy fee",poliscosts_are:"The cost for an insurance policy is a one-time charge of € 6,95. No matter if you have one or two insuran",youwillrecieve:"You will receive the insurance terms separate from you booking confirmation per email. The insurance starts as soon as the (first) payment has been made.",thank_you_for_your_request:"Thank you very much for your request.",we_sent_confirmation_check_email:"A copy of your request has been sent to your e-mail address. If you have not received any mail from us, it may be that it is in your spam box.",something_went_wrong_please_try_again:"Oops, something went wrong, please try again later.",no_prices_available_for_period:"No prices are available for the selected period.",persons:"persons",bedrooms:"bedrooms",minimum_week_price:"min. weekly price",no_results:"No results",agree_with:"Clicking 'Book' creates a payment obligation when my booking is accepted. I agree to the ",option_is_free:"An option is free of charge and without obligation.",discount_reason:"Reason discount.",results:"results",bathrooms:"bathrooms",you_need_to_give_reason:"You must indicate a valid discount reason","camper.arrival_date":"Start date","camper.departure_date":"End date","camper.arrival":"Start date","camper.departure":"End date","boat.arrival_date":"Start date","boat.departure_date":"End date","boat.arrival":"Start date","boat.departure":"End date","caravan.arrival_date":"Arrival date","caravan.departure_date":"Departure date","caravan.arrival":"Arrival","caravan.departure":"Departure",filters:"Filters",comply_insurance_card:"I agree that the cancellation insurance insurance card will be digitally issued to me. I receive this card with my booking confirmation.","house.you_picked_arrival_date":"Your arrival date is","house.pick_your_departure_in_the_calendar":"Select a departure date","house.you_picked_departure_date":"Your departure date is","house.pick_your_arrivaldate_in_the_calendar":"Choose an arrival date","group_accommodation.you_picked_arrival_date":"Your arrival date is","group_accommodation.pick_your_departure_in_the_calendar":"Select a departure date","group_accommodation.you_picked_departure_date":"Your departure date is","group_accommodation.pick_your_arrivaldate_in_the_calendar":"Choose an arrival date","tent.you_picked_arrival_date":"Your arrival date is","tent.pick_your_departure_in_the_calendar":"Select a departure date","tent.you_picked_departure_date":"Your departure date is","tent.pick_your_arrivaldate_in_the_calendar":"Choose an arrival date","camper.you_picked_arrival_date":"Your pickup date is","camper.pick_your_departure_in_the_calendar":"Select a return date","camper.you_picked_departure_date":"Your return date is","camper.pick_your_arrivaldate_in_the_calendar":"Choose a pickup date","boat.you_picked_arrival_date":"Your pickup date is","boat.pick_your_departure_in_the_calendar":"Select a return date","boat.you_picked_departure_date":"Your return date is","boat.pick_your_arrivaldate_in_the_calendar":"Choose a pickup date","bnb.you_picked_arrival_date":"Your arrival date is","bnb.pick_your_departure_in_the_calendar":"Select a departure date","bnb.you_picked_departure_date":"Your departure date is","bnb.pick_your_arrivaldate_in_the_calendar":"Choose an arrival date","caravan.you_picked_arrival_date":"Your pickup date is","caravan.pick_your_departure_in_the_calendar":"Select a return date","caravan.you_picked_departure_date":"Your return date is","caravan.pick_your_arrivaldate_in_the_calendar":"Choose a pickup date","camper_spot.you_picked_arrival_date":"Your arrival date is","camper_spot.pick_your_departure_in_the_calendar":"Select a departure date","camper_spot.you_picked_departure_date":"Your departure date is","camper_spot.pick_your_arrivaldate_in_the_calendar":"Choose an arrival date","camping_place.you_picked_arrival_date":"Your arrival date is","camping_place.pick_your_departure_in_the_calendar":"Select a departure date","camping_place.you_picked_departure_date":"Your departure date is","camping_place.pick_your_arrivaldate_in_the_calendar":"Choose an arrival date","hotelroom.you_picked_arrival_date":"Your arrival date is","hotelroom.pick_your_departure_in_the_calendar":"Select a departure date","hotelroom.you_picked_departure_date":"Your departure date is","hotelroom.pick_your_arrivaldate_in_the_calendar":"Choose an arrival date","house_boat.you_picked_arrival_date":"Your pickup date is","house_boat.pick_your_departure_in_the_calendar":"Select a return date","house_boat.you_picked_departure_date":"Your return date is","house_boat.pick_your_arrivaldate_in_the_calendar":"Choose a pickup date",no:"No",no_house_found:"No object found for this combination of PortalCode and ObjectCode",insurance_company_needs_date_of_birth:"A date of birth is required for taking out insurance","extra_fields.date_of_birth":"Date of birth",no_discount_code_found:"No discount found with entered code",discount_code:"Discount code",minimum_nights:"At least {minimum} nights",can_only_take_insurance_in_de_be_nl:"You can only take out insurance if you live in the Netherlands, Germany or Belgium.",price_from:"Price from",reviews:"Reviews",load_more_reviews:"Load more reviews",review_response_label:"Response from host",reviews_note_link:"BUKAZU Booking System maintains independent reviews. These reviews are collected after guests stay in the accommodation. There is verification of the combination of booking number and email address."},S=["en","nl","de","fr","es","it"];function C(e){return function(e){return S.includes(e)}(e)?e:"en"}new TextEncoder;function E(e,t,n){let r=t;const o=r+n,s=[];let i="";for(;r<o;){const t=e[r++];if(128&t)if(192==(224&t)){const n=63&e[r++];s.push((31&t)<<6|n)}else if(224==(240&t)){const n=63&e[r++],o=63&e[r++];s.push((31&t)<<12|n<<6|o)}else if(240==(248&t)){let n=(7&t)<<18|(63&e[r++])<<12|(63&e[r++])<<6|63&e[r++];n>65535&&(n-=65536,s.push(n>>>10&1023|55296),n=56320|1023&n),s.push(n)}else s.push(t);else s.push(t);s.length>=4096&&(i+=String.fromCharCode(...s),s.length=0)}return s.length>0&&(i+=String.fromCharCode(...s)),i}var T=new TextDecoder;function N(e,t,n){return n>200?function(e,t,n){const r=e.subarray(t,t+n);return T.decode(r)}(e,t,n):E(e,t,n)}var R=class{type;data;constructor(e,t){this.type=e,this.data=t}},A=class e extends Error{constructor(t){super(t);const n=Object.create(e.prototype);Object.setPrototypeOf(this,n),Object.defineProperty(this,"name",{configurable:!0,enumerable:!1,value:e.name})}};function D(e,t){return 4294967296*e.getInt32(t)+e.getUint32(t+4)}function P({sec:e,nsec:t}){if(e>=0&&t>=0&&e<=17179869183){if(0===t&&e<=4294967295){const t=/* @__PURE__ */new Uint8Array(4);return new DataView(t.buffer).setUint32(0,e),t}{const n=e/4294967296,r=4294967295&e,o=/* @__PURE__ */new Uint8Array(8),s=new DataView(o.buffer);return s.setUint32(0,t<<2|3&n),s.setUint32(4,r),o}}{const n=/* @__PURE__ */new Uint8Array(12),r=new DataView(n.buffer);return r.setUint32(0,t),function(e,t,n){const r=Math.floor(n/4294967296),o=n;e.setUint32(t,r),e.setUint32(t+4,o)}(r,4,e),n}}var $={type:-1,encode:function(e){return e instanceof Date?P(function(e){const t=e.getTime(),n=Math.floor(t/1e3),r=1e6*(t-1e3*n),o=Math.floor(r/1e9);return{sec:n+o,nsec:r-1e9*o}}(e)):null},decode:function(e){const t=function(e){const t=new DataView(e.buffer,e.byteOffset,e.byteLength);switch(e.byteLength){case 4:return{sec:t.getUint32(0),nsec:0};case 8:{const e=t.getUint32(0);return{sec:4294967296*(3&e)+t.getUint32(4),nsec:e>>>2}}case 12:return{sec:D(t,4),nsec:t.getUint32(0)};default:throw new A(`Unrecognized data size for timestamp (expected 4, 8, or 12): ${e.length}`)}}(e);/* @__PURE__ */
19
- return new Date(1e3*t.sec+t.nsec/1e6)}},L=class e{static defaultCodec=new e;__brand;builtInEncoders=[];builtInDecoders=[];encoders=[];decoders=[];constructor(){this.register($)}register({type:e,encode:t,decode:n}){if(e>=0)this.encoders[e]=t,this.decoders[e]=n;else{const r=-1-e;this.builtInEncoders[r]=t,this.builtInDecoders[r]=n}}tryToEncode(e,t){for(let n=0;n<this.builtInEncoders.length;n++){const r=this.builtInEncoders[n];if(null!=r){const o=r(e,t);if(null!=o){return new R(-1-n,o)}}}for(let n=0;n<this.encoders.length;n++){const r=this.encoders[n];if(null!=r){const o=r(e,t);if(null!=o)return new R(n,o)}}return e instanceof R?e:null}decode(e,t,n){const r=t<0?this.builtInDecoders[-1-t]:this.decoders[t];return r?r(e,t,n):new R(t,e)}};function U(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):function(e){return e instanceof ArrayBuffer||"undefined"!=typeof SharedArrayBuffer&&e instanceof SharedArrayBuffer}(e)?new Uint8Array(e):Uint8Array.from(e)}function j(e){return`${e<0?"-":""}0x${Math.abs(e).toString(16).padStart(2,"0")}`}var O="array",I="map_key",M="map_value",q=e=>{if("string"==typeof e||"number"==typeof e)return e;throw new A("The type of key must be string or number but "+typeof e)},B=class{stack=[];stackHeadPosition=-1;get length(){return this.stackHeadPosition+1}top(){return this.stack[this.stackHeadPosition]}pushArrayState(e){const t=this.getUninitializedStateFromPool();t.type=O,t.position=0,t.size=e,t.array=new Array(e)}pushMapState(e){const t=this.getUninitializedStateFromPool();t.type=I,t.readCount=0,t.size=e,t.map={}}getUninitializedStateFromPool(){return this.stackHeadPosition++,this.stackHeadPosition===this.stack.length&&this.stack.push({type:void 0,size:0,array:void 0,position:0,readCount:0,map:void 0,key:null}),this.stack[this.stackHeadPosition]}release(e){if(this.stack[this.stackHeadPosition]!==e)throw new Error("Invalid stack state. Released state is not on top of the stack.");if(e.type===O){const t=e;t.size=0,t.array=void 0,t.position=0,t.type=void 0}if(e.type===I||e.type===M){const t=e;t.size=0,t.map=void 0,t.readCount=0,t.type=void 0}this.stackHeadPosition--}reset(){this.stack.length=0,this.stackHeadPosition=-1}},F=/* @__PURE__ */new DataView(/* @__PURE__ */new ArrayBuffer(0)),z=new Uint8Array(F.buffer);try{F.getInt8(0)}catch(tl){if(!(tl instanceof RangeError))throw new Error("This module is not supported in the current JavaScript engine because DataView does not throw RangeError on out-of-bounds access")}var H=/* @__PURE__ */new RangeError("Insufficient data"),Y=new class{hit=0;miss=0;caches;maxKeyLength;maxLengthPerKey;constructor(e=16,t=16){this.maxKeyLength=e,this.maxLengthPerKey=t,this.caches=[];for(let n=0;n<this.maxKeyLength;n++)this.caches.push([])}canBeCached(e){return e>0&&e<=this.maxKeyLength}find(e,t,n){const r=this.caches[n-1];e:for(const o of r){const r=o.bytes;for(let o=0;o<n;o++)if(r[o]!==e[t+o])continue e;return o.str}return null}store(e,t){const n=this.caches[e.length-1],r={bytes:e,str:t};n.length>=this.maxLengthPerKey?n[Math.random()*n.length|0]=r:n.push(r)}decode(e,t,n){const r=this.find(e,t,n);if(null!=r)return this.hit++,r;this.miss++;const o=E(e,t,n),s=Uint8Array.prototype.slice.call(e,t,t+n);return this.store(s,o),o}},W=class e{extensionCodec;context;useBigInt64;rawStrings;maxStrLength;maxBinLength;maxArrayLength;maxMapLength;maxExtLength;keyDecoder;mapKeyConverter;totalPos=0;pos=0;view=F;bytes=z;headByte=-1;stack=new B;entered=!1;constructor(e){this.extensionCodec=e?.extensionCodec??L.defaultCodec,this.context=e?.context,this.useBigInt64=e?.useBigInt64??!1,this.rawStrings=e?.rawStrings??!1,this.maxStrLength=e?.maxStrLength??4294967295,this.maxBinLength=e?.maxBinLength??4294967295,this.maxArrayLength=e?.maxArrayLength??4294967295,this.maxMapLength=e?.maxMapLength??4294967295,this.maxExtLength=e?.maxExtLength??4294967295,this.keyDecoder=void 0!==e?.keyDecoder?e.keyDecoder:Y,this.mapKeyConverter=e?.mapKeyConverter??q}clone(){return new e({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,rawStrings:this.rawStrings,maxStrLength:this.maxStrLength,maxBinLength:this.maxBinLength,maxArrayLength:this.maxArrayLength,maxMapLength:this.maxMapLength,maxExtLength:this.maxExtLength,keyDecoder:this.keyDecoder})}reinitializeState(){this.totalPos=0,this.headByte=-1,this.stack.reset()}setBuffer(e){const t=U(e);this.bytes=t,this.view=new DataView(t.buffer,t.byteOffset,t.byteLength),this.pos=0}appendBuffer(e){if(-1!==this.headByte||this.hasRemaining(1)){const t=this.bytes.subarray(this.pos),n=U(e),r=new Uint8Array(t.length+n.length);r.set(t),r.set(n,t.length),this.setBuffer(r)}else this.setBuffer(e)}hasRemaining(e){return this.view.byteLength-this.pos>=e}createExtraByteError(e){const{view:t,pos:n}=this;/* @__PURE__ */
20
- return new RangeError(`Extra ${t.byteLength-n} of ${t.byteLength} byte(s) found at buffer[${e}]`)}decode(e){if(this.entered)return this.clone().decode(e);try{this.entered=!0,this.reinitializeState(),this.setBuffer(e);const t=this.doDecodeSync();if(this.hasRemaining(1))throw this.createExtraByteError(this.pos);return t}finally{this.entered=!1}}*decodeMulti(e){if(this.entered)yield*this.clone().decodeMulti(e);else try{for(this.entered=!0,this.reinitializeState(),this.setBuffer(e);this.hasRemaining(1);)yield this.doDecodeSync()}finally{this.entered=!1}}async decodeAsync(e){if(this.entered)return this.clone().decodeAsync(e);try{this.entered=!0;let t,n=!1;for await(const i of e){if(n)throw this.entered=!1,this.createExtraByteError(this.totalPos);this.appendBuffer(i);try{t=this.doDecodeSync(),n=!0}catch(tl){if(!(tl instanceof RangeError))throw tl}this.totalPos+=this.pos}if(n){if(this.hasRemaining(1))throw this.createExtraByteError(this.totalPos);return t}const{headByte:r,pos:o,totalPos:s}=this;throw new RangeError(`Insufficient data in parsing ${j(r)} at ${s} (${o} in the current buffer)`)}finally{this.entered=!1}}decodeArrayStream(e){return this.decodeMultiAsync(e,!0)}decodeStream(e){return this.decodeMultiAsync(e,!1)}async*decodeMultiAsync(e,t){if(this.entered)yield*this.clone().decodeMultiAsync(e,t);else try{this.entered=!0;let n=t,r=-1;for await(const o of e){if(t&&0===r)throw this.createExtraByteError(this.totalPos);this.appendBuffer(o),n&&(r=this.readArraySize(),n=!1,this.complete());try{for(;yield this.doDecodeSync(),0!==--r;);}catch(tl){if(!(tl instanceof RangeError))throw tl}this.totalPos+=this.pos}}finally{this.entered=!1}}doDecodeSync(){e:for(;;){const e=this.readHeadByte();let t;if(e>=224)t=e-256;else if(e<192)if(e<128)t=e;else if(e<144){const n=e-128;if(0!==n){this.pushMapState(n),this.complete();continue e}t={}}else if(e<160){const n=e-144;if(0!==n){this.pushArrayState(n),this.complete();continue e}t=[]}else{const n=e-160;t=this.decodeString(n,0)}else if(192===e)t=null;else if(194===e)t=!1;else if(195===e)t=!0;else if(202===e)t=this.readF32();else if(203===e)t=this.readF64();else if(204===e)t=this.readU8();else if(205===e)t=this.readU16();else if(206===e)t=this.readU32();else if(207===e)t=this.useBigInt64?this.readU64AsBigInt():this.readU64();else if(208===e)t=this.readI8();else if(209===e)t=this.readI16();else if(210===e)t=this.readI32();else if(211===e)t=this.useBigInt64?this.readI64AsBigInt():this.readI64();else if(217===e){const e=this.lookU8();t=this.decodeString(e,1)}else if(218===e){const e=this.lookU16();t=this.decodeString(e,2)}else if(219===e){const e=this.lookU32();t=this.decodeString(e,4)}else if(220===e){const e=this.readU16();if(0!==e){this.pushArrayState(e),this.complete();continue e}t=[]}else if(221===e){const e=this.readU32();if(0!==e){this.pushArrayState(e),this.complete();continue e}t=[]}else if(222===e){const e=this.readU16();if(0!==e){this.pushMapState(e),this.complete();continue e}t={}}else if(223===e){const e=this.readU32();if(0!==e){this.pushMapState(e),this.complete();continue e}t={}}else if(196===e){const e=this.lookU8();t=this.decodeBinary(e,1)}else if(197===e){const e=this.lookU16();t=this.decodeBinary(e,2)}else if(198===e){const e=this.lookU32();t=this.decodeBinary(e,4)}else if(212===e)t=this.decodeExtension(1,0);else if(213===e)t=this.decodeExtension(2,0);else if(214===e)t=this.decodeExtension(4,0);else if(215===e)t=this.decodeExtension(8,0);else if(216===e)t=this.decodeExtension(16,0);else if(199===e){const e=this.lookU8();t=this.decodeExtension(e,1)}else if(200===e){const e=this.lookU16();t=this.decodeExtension(e,2)}else{if(201!==e)throw new A(`Unrecognized type byte: ${j(e)}`);{const e=this.lookU32();t=this.decodeExtension(e,4)}}this.complete();const n=this.stack;for(;n.length>0;){const e=n.top();if(e.type===O){if(e.array[e.position]=t,e.position++,e.position!==e.size)continue e;t=e.array,n.release(e)}else{if(e.type===I){if("__proto__"===t)throw new A("The key __proto__ is not allowed");e.key=this.mapKeyConverter(t),e.type=M;continue e}if(e.map[e.key]=t,e.readCount++,e.readCount!==e.size){e.key=null,e.type=I;continue e}t=e.map,n.release(e)}}return t}}readHeadByte(){return-1===this.headByte&&(this.headByte=this.readU8()),this.headByte}complete(){this.headByte=-1}readArraySize(){const e=this.readHeadByte();switch(e){case 220:return this.readU16();case 221:return this.readU32();default:if(e<160)return e-144;throw new A(`Unrecognized array type byte: ${j(e)}`)}}pushMapState(e){if(e>this.maxMapLength)throw new A(`Max length exceeded: map length (${e}) > maxMapLengthLength (${this.maxMapLength})`);this.stack.pushMapState(e)}pushArrayState(e){if(e>this.maxArrayLength)throw new A(`Max length exceeded: array length (${e}) > maxArrayLength (${this.maxArrayLength})`);this.stack.pushArrayState(e)}decodeString(e,t){return!this.rawStrings||this.stateIsMapKey()?this.decodeUtf8String(e,t):this.decodeBinary(e,t)}decodeUtf8String(e,t){if(e>this.maxStrLength)throw new A(`Max length exceeded: UTF-8 byte length (${e}) > maxStrLength (${this.maxStrLength})`);if(this.bytes.byteLength<this.pos+t+e)throw H;const n=this.pos+t;let r;return r=this.stateIsMapKey()&&this.keyDecoder?.canBeCached(e)?this.keyDecoder.decode(this.bytes,n,e):N(this.bytes,n,e),this.pos+=t+e,r}stateIsMapKey(){return this.stack.length>0&&this.stack.top().type===I}decodeBinary(e,t){if(e>this.maxBinLength)throw new A(`Max length exceeded: bin length (${e}) > maxBinLength (${this.maxBinLength})`);if(!this.hasRemaining(e+t))throw H;const n=this.pos+t,r=this.bytes.subarray(n,n+e);return this.pos+=t+e,r}decodeExtension(e,t){if(e>this.maxExtLength)throw new A(`Max length exceeded: ext length (${e}) > maxExtLength (${this.maxExtLength})`);const n=this.view.getInt8(this.pos+t),r=this.decodeBinary(e,t+1);return this.extensionCodec.decode(r,n,this.context)}lookU8(){return this.view.getUint8(this.pos)}lookU16(){return this.view.getUint16(this.pos)}lookU32(){return this.view.getUint32(this.pos)}readU8(){const e=this.view.getUint8(this.pos);return this.pos++,e}readI8(){const e=this.view.getInt8(this.pos);return this.pos++,e}readU16(){const e=this.view.getUint16(this.pos);return this.pos+=2,e}readI16(){const e=this.view.getInt16(this.pos);return this.pos+=2,e}readU32(){const e=this.view.getUint32(this.pos);return this.pos+=4,e}readI32(){const e=this.view.getInt32(this.pos);return this.pos+=4,e}readU64(){const e=(t=this.view,n=this.pos,4294967296*t.getUint32(n)+t.getUint32(n+4));var t,n;return this.pos+=8,e}readI64(){const e=D(this.view,this.pos);return this.pos+=8,e}readU64AsBigInt(){const e=this.view.getBigUint64(this.pos);return this.pos+=8,e}readI64AsBigInt(){const e=this.view.getBigInt64(this.pos);return this.pos+=8,e}readF32(){const e=this.view.getFloat32(this.pos);return this.pos+=4,e}readF64(){const e=this.view.getFloat64(this.pos);return this.pos+=8,e}};async function J(e,t){let n;try{n=await fetch(e)}catch{throw new Error(t)}if(!n.ok)throw new Error(t);const r=new Uint8Array(await n.arrayBuffer());return o=r,new W(s).decode(o);var o,s}var K=/* @__PURE__ */new Map([["en",k]]),V=/* @__PURE__ */new Map,X={en:async()=>(await(import("./en-DGqijK5a.js"))).default,nl:async()=>(await(import("./nl-CUA331lL.js"))).default,de:async()=>(await(import("./de-Dazac7Jo.js"))).default,fr:async()=>(await(import("./fr-DZA60Wnw.js"))).default,es:async()=>(await(import("./es-DWeoSd-h.js"))).default,it:async()=>(await(import("./it-yOg_re5a.js"))).default};async function G(e){const t=C(e),n=K.get(t);if(n)return n;const r=V.get(t);if(r)return r;const o=async function(e){return J(await X[e](),`Failed to load translations for locale "${e}"`)}(t).then(e=>(K.set(t,e),e)).catch(()=>K.get("en")??{}).finally(()=>{V.delete(t)});return V.set(t,o),o}function Q(e,t){const n=C("undefined"!=typeof window&&window.__localeId__||"en"),r=K.get(n)??K.get("en")??{};K.has(n)||G(n);let o=r[e]||e;return t&&Object.entries(t).forEach(([e,t])=>{o=o.replace(new RegExp(`\\{${e}\\}`,"g"),String(t))}),o}function Z(e,t){const n="undefined"!=typeof window&&window.__localeId__||"en";return new Intl.NumberFormat(n,t).format(e)}function ee({filters:e,onFilterChange:t,PortalSite:n,options:r}){function o(n,r){const o={...e};o[n]=r,t(o)}const[s,i]=u(!1),a=r.searchFields??[];let c=r.filtersForm.fixed_mobile?"fixed-mobile":null,p=r.filtersForm.show??1?`filters filters-${r.filtersForm.location}`:"filters-hidden",f=s&&"showOnMobile";/* @__PURE__ */
21
- return h(l,{children:[/* @__PURE__ */d("button",{className:`filters-button ${c}`,onClick:()=>i(!s),children:Q("filters")}),/* @__PURE__ */h("div",{className:`${p} ${c} ${f}`,children:[/* @__PURE__ */d("button",{onClick:()=>{t({})},className:"filters-reload",children:/* @__PURE__ */d(x,{})}),a.map(t=>/* @__PURE__ */h("div",{className:"bu-field",id:t.id,children:[/* @__PURE__ */d("label",{style:{width:"100%",display:"block"},htmlFor:t.id,children:t.label}),/* @__PURE__ */d(w,{field:t,PortalSite:n,filters:e,value:e[t.id]??"",onFilterChange:o})]},t.id))]})]})}function te(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function ne(e){return"number"==typeof e?Number.isInteger(e):"string"==typeof e&&/^-?\d+$/.test(e)}function re({result:e,options:t,currency:n}){const r=[t.show_city&&`<span>${te(e.city)}, </span>`,t.show_region&&`<span>${te(e.province)}, </span>`,t.show_country&&`<span>${te(e.country_name)}</span>`].filter(Boolean).join(""),o=[t.show_persons&&`<div>${te(e.persons)} ${te(Q("persons"))}</div>`,t.show_bedrooms&&`<div>${te(e.bedrooms)} ${te(Q("bedrooms"))}</div>`,t.show_bathrooms&&`<div>${te(e.bathrooms)} ${te(Q("bathrooms"))}</div>`].filter(Boolean).join(""),s=t.show_rating&&e.rating?`<div class="result-rating bu_card"><div class="result-rating-inner">${te(e.rating.toFixed(1))}</div></div>`:"",i=t.show_price?e.booking_price?`<div class="result-price">${te(Q("price_from"))}<span class="price">${te(Z(e.booking_price.total_price,{style:"currency",currency:e.booking_price.currency,minimumFractionDigits:0,maximumFractionDigits:0}))}</span></div>`:`<div class="result-price">${te(Q("minimum_week_price"))}<span class="price">${te(Z(e.minimum_week_price,{style:"currency",currency:n??"EUR",minimumFractionDigits:0,maximumFractionDigits:0}))}</span></div>`:"";return`\n <a class="bukazu-result bu_card"${e.house_url?` href="${te(e.house_url)}"`:""}>\n <div class="bukazu-result-inner">\n <div class="image-holder">\n <img${e.image_url?` src="${te(e.image_url)}"`:""} alt="${te(e.name)}" />\n </div>\n <div class="result">\n <div class="result-title">${te(e.name)}</div>\n <div class="result-place">${r}</div>\n <div class="result-description">${e.description}</div>\n <div class="result-details">${o}</div>\n ${s}\n ${i}\n <div class="result-button">${te(Q("view_details"))}</div>\n </div>\n </div>\n </a>\n `}G("en");function oe({onPageChange:e,totalCount:t,activePage:n,limit:r}){const o=r>0?Math.ceil(t/r):0,s=function(e,t){if(t<=7)return Array.from({length:t},(e,t)=>t);let n=Math.max(1,e-Math.floor(2.5)),r=n+5-1;r>=t-1&&(r=t-2,n=r-5+1);const o=[0];n>1&&o.push("...");for(let s=n;s<=r;s++)o.push(s);return r<t-2&&o.push("..."),o.push(t-1),o}(n,o);/* @__PURE__ */
22
- return h("div",{className:"bu-paginator",children:[/* @__PURE__ */h("div",{children:[t," ",Q("results")]}),o>1&&/* @__PURE__ */h("ul",{className:"bu-pagination",children:[
23
- /* @__PURE__ */d("li",{className:0===n?"disabled":"",children:/* @__PURE__ */d("button",{disabled:0===n,onClick:()=>e(n-1),"aria-label":Q("previous"),children:"<"})}),s.map((t,r)=>"..."===t?/* @__PURE__ */d("li",{children:/* @__PURE__ */d("span",{"aria-label":"More pages",children:"..."})},`break-${r}`):/* @__PURE__ */d("li",{className:t===n?"selected":"",children:/* @__PURE__ */d("button",{"data-page-button":!0,onClick:()=>e(t),"aria-current":t===n?"page":void 0,children:t+1})},t)),
24
- /* @__PURE__ */d("li",{className:n===o-1?"disabled":"",children:/* @__PURE__ */d("button",{disabled:n===o-1,onClick:()=>e(n+1),"aria-label":Q("next"),children:">"})})]})]})}var se="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,ie=globalThis,ae="10.72.0";function ce(){return ue(ie),ie}function ue(e){const t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||"10.72.0",t[ae]=t["10.72.0"]||{}}function le(e,t,n=ie){const r=n.__SENTRY__=n.__SENTRY__||{},o=r[ae]=r["10.72.0"]||{};return o[e]||(o[e]=t())}var de=["debug","info","warn","error","log","assert","trace"],he={};function pe(e){if(!("console"in ie))return e();const t=ie.console,n={},r=Object.keys(he);r.forEach(e=>{const r=he[e];n[e]=t[e],t[e]=r});try{return e()}finally{r.forEach(e=>{t[e]=n[e]})}}function fe(){return ge().enabled}function me(e,...t){se&&fe()&&pe(()=>{ie.console[e](`Sentry Logger [${e}]:`,...t)})}function ge(){return se?le("loggerSettings",()=>({enabled:!1})):{enabled:!1}}var _e={enable:function(){ge().enabled=!0},disable:function(){ge().enabled=!1},isEnabled:fe,log:function(...e){me("log",...e)},warn:function(...e){me("warn",...e)},error:function(...e){me("error",...e)}},ye=/\(error: (.*)\)/,ve=/captureMessage|captureException/;function be(...e){const t=e.sort((e,t)=>e[0]-t[0]).map(e=>e[1]);return(e,n=0,r=0)=>{const o=[],s=e.split("\n");for(let i=n;i<s.length;i++){let e=s[i];e.length>1024&&(e=e.slice(0,1024));const n=ye.test(e)?e.replace(ye,"$1"):e;if(!n.includes("Error: ")){for(const e of t){const t=e(n);if(t){o.push(t);break}}if(o.length>=50+r)break}}return function(e){if(!e.length)return[];const t=Array.from(e);/sentryWrapped/.test(we(t).function||"")&&t.pop();t.reverse(),ve.test(we(t).function||"")&&(t.pop(),ve.test(we(t).function||"")&&t.pop());return t.slice(0,50).map(e=>({...e,filename:e.filename||we(t).filename,function:e.function||"?"}))}(o.slice(r))}}function we(e){return e[e.length-1]||{}}var xe="<anonymous>";function ke(e){try{return e&&"function"==typeof e&&e.name||xe}catch{return xe}}function Se(e){const t=e.exception;if(t){const e=[];try{return t.values.forEach(t=>{t.stacktrace.frames&&e.push(...t.stacktrace.frames)}),e}catch{return}}}var Ce={},Ee={};function Te(e,t){return Ce[e]=Ce[e]||[],Ce[e].push(t),()=>{const n=Ce[e];if(n){const e=n.indexOf(t);-1!==e&&n.splice(e,1)}}}function Ne(e,t){if(!Ee[e]){Ee[e]=!0;try{t()}catch(tl){se&&_e.error(`Error while instrumenting ${e}`,tl)}}}function Re(e,t){const n=e&&Ce[e];if(n)for(const r of n)try{r(t)}catch(tl){se&&_e.error(`Error while triggering instrumentation handler.\nType: ${e}\nName: ${ke(r)}\nError:`,tl)}}var Ae=null;function De(){Ae=ie.onerror,ie.onerror=function(e,t,n,r,o){return Re("error",{column:r,error:o,line:n,msg:e,url:t}),!!Ae&&Ae.apply(this,arguments)},ie.onerror.__SENTRY_INSTRUMENTED__=!0}var Pe=null;function $e(){Pe=ie.onunhandledrejection,ie.onunhandledrejection=function(e){return Re("unhandledrejection",e),!Pe||Pe.apply(this,arguments)},ie.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}var Le,Ue=Object.prototype.toString;function je(e){switch(Ue.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return Je(e,Error)}}function Oe(e,t){return Ue.call(e)===`[object ${t}]`}function Ie(e){return Oe(e,"ErrorEvent")}function Me(e){return Oe(e,"DOMError")}function qe(e){return Oe(e,"String")}function Be(e){return"object"==typeof e&&null!==e&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function Fe(e){return null===e||Be(e)||"object"!=typeof e&&"function"!=typeof e}function ze(e){return Oe(e,"Object")}function He(e){return"object"==typeof e&&null!==e}function Ye(e){return"undefined"!=typeof Event&&Je(e,Event)}function We(e){return Boolean(e?.then&&"function"==typeof e.then)}function Je(e,t){try{return e instanceof t}catch{return!1}}function Ke(e){return"undefined"!=typeof Request&&Je(e,Request)}function Ve(e,t,n){if(!(t in e))return;const r=e[t];if("function"!=typeof r)return;const o=n(r);"function"==typeof o&&Ge(o,r);try{e[t]=o}catch{se&&_e.log(`Failed to replace method "${t}" in object`,e)}}function Xe(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{se&&_e.log(`Failed to add non-enumerable property "${String(t)}" to object`,e)}}function Ge(e,t){try{e.prototype=t.prototype=t.prototype||{},Xe(e,"__sentry_original__",t)}catch{}}function Qe(e){return e.__sentry_original__}function Ze(e){if(je(e))return{message:e.message,name:e.name,stack:e.stack,...et(e)};if(Ye(e)){const{type:t,target:n,currentTarget:r,detail:o}=e;return{type:t,target:n,currentTarget:r,...o?{detail:o}:{},...et(e)}}return e}function et(e){return He(e)?Object.fromEntries(Object.entries(e)):{}}function tt(e){if(void 0!==Le)return Le?Le(e):e();const t=/* @__PURE__ */Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),n=ie;return t in n&&"function"==typeof n[t]?(Le=n[t])(e):(Le=null,e())}function nt(){return tt(()=>Math.random())}function rt(){return tt(()=>Date.now())}var ot,st,it=/* @__PURE__ */Symbol.for("sentry.skipNormalization"),at=/* @__PURE__ */Symbol.for("sentry.overrideNormalizationDepth");function ct(e,t=100,n=1/0){try{return lt("",e,t,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function ut(e,t=3,n=102400){const r=ct(e,t);return o=r,function(e){return~-encodeURI(e).split(/%..|./).length}(JSON.stringify(o))>n?ut(e,t-1,n):r;var o}function lt(e,t,n=1/0,r=1/0,o=function(){const e=/* @__PURE__ */new WeakSet;function t(t){return!!e.has(t)||(e.add(t),!1)}function n(t){e.delete(t)}return[t,n]}()){const[s,i]=o;if(null==t||["boolean","string"].includes(typeof t)||"number"==typeof t&&Number.isFinite(t))return t;const a=dt(e,t);if(!a.startsWith("[object "))return a;if(function(e){return Boolean(e[it])}(t))return t;const c=function(e){const t=e[at];return"number"==typeof t?t:void 0}(t),u=void 0!==c?c:n;if(0===u)return a.replace("object ","");if(s(t))return"[Circular ~]";const l=t;if(l&&"function"==typeof l.toJSON)try{return lt("",l.toJSON(),u-1,r,o)}catch{}const d=Array.isArray(t)?[]:{};let h=0;const p=Ze(t);for(const f in p){if(!Object.prototype.hasOwnProperty.call(p,f))continue;if(h>=r){d[f]="[MaxProperties ~]";break}const e=p[f];d[f]=lt(f,e,u-1,r,o),h++}return i(t),d}function dt(e,t){try{if(ot){const e=ot(t);if(e)return e}return"undefined"!=typeof global&&t===global?"[Global]":"number"!=typeof t||Number.isFinite(t)?"function"==typeof t?`[Function: ${ke(t)}]`:"symbol"==typeof t?`[${String(t)}]`:"bigint"==typeof t?`[BigInt: ${String(t)}]`:`[object ${function(e){const t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:"null prototype"}(t)}]`:`[${t}]`}catch(n){return`**non-serializable** (${n})`}}function ht(e,t=0){return"string"!=typeof e||0===t||e.length<=t?e:`${e.slice(0,t)}...`}function pt(e,t){if(!Array.isArray(e))return"";const n=[];for(let r=0;r<e.length;r++){const t=e[r];Fe(t)?n.push(String(t)):t instanceof Error?n.push(t.message?`${t.name}: ${t.message}`:t.name):n.push(dt(0,t))}return n.join(t)}function ft(e,t,n=!1){return!!qe(e)&&(Oe(t,"RegExp")?t.test(e):qe(t)?n?e===t:e.includes(t):"function"==typeof t&&t(e))}function mt(e,t=[],n=!1){for(const r of t)if(ft(e,r,n))return!0;return!1}function gt(e=function(){const e=ie;return e.crypto||e.msCrypto}()){try{if(e?.randomUUID)return tt(()=>e.randomUUID()).replace(/-/g,"")}catch{}return st||(st="10000000100040008000100000000000"),st.replace(/[018]/g,e=>(e^(16*nt()&15)>>e/4).toString(16))}function _t(e){return e.exception?.values?.[0]}function yt(e){const{message:t,event_id:n}=e;if(t)return t;const r=_t(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function vt(e,t,n){const r=e.exception=e.exception||{},o=r.values=r.values||[],s=o[0]=o[0]||{};s.value||(s.value=t||""),s.type||(s.type=n||"Error")}function bt(e,t){const n=_t(e);if(!n)return;const r=n.mechanism;if(n.mechanism={type:"generic",handled:!0,...r,...t},t&&"data"in t){const e={...r?.data,...t.data};n.mechanism.data=e}}function wt(e){if(function(e){try{return e.__sentry_captured__}catch{}}(e))return!0;try{Xe(e,"__sentry_captured__",!0)}catch{}return!1}var xt;function kt(){return rt()/1e3}function St(){return(xt??(xt=function(){const{performance:e}=ie;if(!e?.now||!e.timeOrigin)return kt;const t=e.timeOrigin;return()=>(t+tt(()=>e.now()))/1e3}()))()}function Ct(e){const t=St(),n={sid:gt(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(e){return{sid:`${e.sid}`,init:e.init,started:/* @__PURE__ */new Date(1e3*e.started).toISOString(),timestamp:/* @__PURE__ */new Date(1e3*e.timestamp).toISOString(),status:e.status,errors:e.errors,did:"number"==typeof e.did||"string"==typeof e.did?`${e.did}`:void 0,duration:e.duration,abnormal_mechanism:e.abnormal_mechanism,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}}}(n)};return e&&Et(n,e),n}function Et(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),e.did||t.did||(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||St(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=32===t.sid.length?t.sid:gt()),void 0!==t.init&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),"number"==typeof t.started&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if("number"==typeof t.duration)e.duration=t.duration;else{const t=e.timestamp-e.started;e.duration=t>=0?t:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),"number"==typeof t.errors&&(e.errors=t.errors),t.status&&(e.status=t.status)}function Tt(e,t,n=2){if(!t||"object"!=typeof t||n<=0)return t;if(e&&0===Object.keys(t).length)return e;const r={...e};for(const o in t)Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=Tt(r[o],t[o],n-1));return r}function Nt(){return gt()}function Rt(){return gt().substring(16)}function At(e){if(e){if("object"==typeof e&&"deref"in e&&"function"==typeof e.deref)try{return e.deref()}catch{return}return e}}var Dt="_sentrySpan";function Pt(e,t){t?Xe(e,Dt,function(e){try{const t=ie.WeakRef;if("function"==typeof t)return new t(e)}catch{}return e}(t)):delete e[Dt]}function $t(e){return At(e[Dt])}var Lt=class e{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._attributes={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:Nt(),sampleRand:nt()}}clone(){const t=new e;return t._breadcrumbs=[...this._breadcrumbs],t._tags={...this._tags},t._attributes={...this._attributes},t._extra={...this._extra},t._contexts={...this._contexts},this._contexts.flags&&(t._contexts.flags={values:[...this._contexts.flags.values]}),t._user=this._user,t._level=this._level,t._session=this._session,t._transactionName=this._transactionName,t._fingerprint=this._fingerprint,t._eventProcessors=[...this._eventProcessors],t._attachments=[...this._attachments],t._sdkProcessingMetadata={...this._sdkProcessingMetadata},t._propagationContext={...this._propagationContext},t._client=this._client,t._lastEventId=this._lastEventId,t._conversationId=this._conversationId,Pt(t,$t(this)),t}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&Et(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}setConversationId(e){return this._conversationId=e||void 0,this._notifyScopeListeners(),this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this.setTags({[e]:t})}setAttributes(e){return this._attributes={...this._attributes,...e},this._notifyScopeListeners(),this}setAttribute(e,t){return this.setAttributes({[e]:t})}removeAttribute(e){return e in this._attributes&&(delete this._attributes[e],this._notifyScopeListeners()),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return null===t?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;const n="function"==typeof t?t(this):t,{tags:r,attributes:o,extra:s,user:i,contexts:a,level:c,fingerprint:u=[],propagationContext:l,conversationId:d}=(n instanceof e?n.getScopeData():ze(n)?t:void 0)||{};return this._tags={...this._tags,...r},this._attributes={...this._attributes,...o},this._extra={...this._extra,...s},this._contexts={...this._contexts,...a},i&&Object.keys(i).length&&(this._user=i),c&&(this._level=c),u.length&&(this._fingerprint=u),l&&(this._propagationContext=l),d&&(this._conversationId=d),this}clear(){return this._breadcrumbs=[],this._tags={},this._attributes={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,this._conversationId=void 0,Pt(this,void 0),this._attachments=[],this.setPropagationContext({traceId:Nt(),sampleRand:nt()}),this._notifyScopeListeners(),this}addBreadcrumb(e,t){const n="number"==typeof t?t:100;if(n<=0)return this;const r={timestamp:kt(),...e,message:e.message?ht(e.message,2048):e.message};return this._breadcrumbs.push(r),this._breadcrumbs.length>n&&(this._breadcrumbs=this._breadcrumbs.slice(-n),this._client?.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,attributes:this._attributes,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:$t(this),conversationId:this._conversationId}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=Tt(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,t){const n=t?.event_id||gt();if(!this._client)return se&&_e.warn("No client configured on scope - will not capture exception!"),n;const r=/* @__PURE__ */new Error("Sentry syntheticException");return this._client.captureException(e,{originalException:e,syntheticException:r,...t,event_id:n},this),n}captureMessage(e,t,n){const r=n?.event_id||gt();if(!this._client)return se&&_e.warn("No client configured on scope - will not capture message!"),r;const o=n?.syntheticException??new Error(e);return this._client.captureMessage(e,t,{originalException:e,syntheticException:o,...n,event_id:r},this),r}captureEvent(e,t){const n=e.event_id||t?.event_id||gt();return this._client?(this._client.captureEvent(e,{...t,event_id:n},this),n):(se&&_e.warn("No client configured on scope - will not capture event!"),n)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}};var Ut=e=>e instanceof Promise&&!e[jt],jt=/* @__PURE__ */Symbol("chained PromiseLike"),Ot=(e,t)=>{if(!t)return e;let n=!1;for(const r in e){if(r in t)continue;n=!0;const o=e[r];"function"==typeof o?Object.defineProperty(t,r,{value:(...t)=>o.apply(e,t),enumerable:!0,configurable:!0,writable:!0}):t[r]=o}return n&&Object.assign(t,{[jt]:!0}),t},It=class{constructor(e,t){let n,r;n=e||new Lt,r=t||new Lt,this._stack=[{scope:n}],this._isolationScope=r}withScope(e){const t=this._pushScope();let n;try{n=e(t)}catch(tl){throw this._popScope(),tl}return We(n)?((e,t,n)=>{const r=e.then(e=>(t(e),e),e=>{throw n(e),e});return Ut(r)&&Ut(e)?r:Ot(e,r)})(n,()=>this._popScope(),()=>this._popScope()):(this._popScope(),n)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return!(this._stack.length<=1)&&!!this._stack.pop()}};function Mt(){const e=ue(ce());return e.stack=e.stack||new It(le("defaultCurrentScope",()=>new Lt),le("defaultIsolationScope",()=>new Lt))}function qt(e){return Mt().withScope(e)}function Bt(e,t){const n=Mt();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function Ft(e){return Mt().withScope(()=>e(Mt().getIsolationScope()))}function zt(e){const t=ue(e);return t.acs?t.acs:{withIsolationScope:Ft,withScope:qt,withSetScope:Bt,withSetIsolationScope:(e,t)=>Ft(t),getCurrentScope:()=>Mt().getScope(),getIsolationScope:()=>Mt().getIsolationScope()}}function Ht(e,t){const{value:n,unit:r}="object"==typeof(o=e)&&null!=o&&!Array.isArray(o)&&Object.keys(o).includes("value")?e:{value:e,unit:void 0};var o;const s=function(e){if(Array.isArray(e))return{value:e,type:"array"};const t="string"==typeof e?"string":"boolean"==typeof e?"boolean":"number"!=typeof e||Number.isNaN(e)?null:Number.isInteger(e)?"integer":"double";if(t)return{value:e,type:t}}(n),i=r&&"string"==typeof r?{unit:r}:{};if(s)return{...s,...i};if(!t||"skip-undefined"===t&&void 0===n)return;let a="";try{a=JSON.stringify(n)??""}catch{}return{value:a,type:"string",...i}}function Yt(e,t=!1){const n={};for(const[r,o]of Object.entries(e??{})){const e=Ht(o,t);e&&(n[r]=e)}return n}function Wt(){return zt(ce()).getCurrentScope()}function Jt(){return zt(ce()).getIsolationScope()}function Kt(){return Wt().getClient()}function Vt(e){const t=void 0;const{traceId:n,parentSpanId:r,propagationSpanId:o}=e.getPropagationContext(),s={trace_id:n,span_id:o||Rt()};return r&&(s.parent_span_id=r),s}var Xt="sentry.op";function Gt(e){const t=e;return{scope:t._sentryScope,isolationScope:At(t._sentryIsolationScope)}}function Qt(e){const t=function(e){if(!e||!qe(e)&&!Array.isArray(e))return;return Array.isArray(e)?e.reduce((e,t)=>{const n=Zt(t);return Object.entries(n).forEach(([t,n])=>{e[t]=n}),e},{}):Zt(e)}(e);if(!t)return;const n=Object.entries(t).reduce((e,[t,n])=>{if(t.startsWith("sentry-")){e[t.slice(7)]=n}return e},{});return Object.keys(n).length>0?n:void 0}function Zt(e){return e.split(",").map(e=>{const t=e.indexOf("=");return-1===t?[]:[e.slice(0,t),e.slice(t+1)].map(e=>{try{return decodeURIComponent(e.trim())}catch{return}})}).reduce((e,[t,n])=>(t&&n&&(e[t]=n),e),{})}var en=/^o(\d+)\./,tn=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function nn(e,t=!1){const{host:n,path:r,pass:o,port:s,projectId:i,protocol:a,publicKey:c}=e;return`${a}://${c}${t&&o?`:${o}`:""}@${n}${s?`:${s}`:""}/${r?`${r}/`:r}${i}`}function rn(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function on(e){const t=e.getOptions(),{host:n}=e.getDsn()||{};let r;return t.orgId?r=String(t.orgId):n&&(r=function(e){return e.match(en)?.[1]}(n)),r}function sn(e){const t="string"==typeof e?function(e){const t=tn.exec(e);if(!t)return void pe(()=>{});const[n,r,o="",s="",i="",a=""]=t.slice(1);let c="",u=a;const l=u.split("/");if(l.length>1&&(c=l.slice(0,-1).join("/"),u=l.pop()),u){const e=u.match(/^\d+/);e&&(u=e[0])}return rn({host:s,pass:o,path:c,projectId:u,port:i,protocol:n,publicKey:r})}(e):rn(e);if(t&&function(e){if(!se)return!0;const{port:t,projectId:n,protocol:r}=e;return!(["protocol","publicKey","host","projectId"].find(t=>!e[t]&&(_e.error(`Invalid Sentry Dsn: ${t} missing`),!0))||(n.match(/^\d+$/)?function(e){return"http"===e||"https"===e}(r)?t&&isNaN(parseInt(t,10))&&(_e.error(`Invalid Sentry Dsn: Invalid port ${t}`),1):(_e.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),1):(_e.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),1)))}(t))return t}var an=!1;function cn(e){const{spanId:t,traceId:n,isRemote:r}=e.spanContext(),o=r?t:hn(e).parent_span_id,s=Gt(e).scope;return{parent_span_id:o,span_id:r?s?.getPropagationContext().propagationSpanId||Rt():t,trace_id:n}}function un(e){return e&&e.length>0?e.map(({context:{spanId:e,traceId:t,traceFlags:n,...r},attributes:o})=>({span_id:e,trace_id:t,sampled:1===n,attributes:o,...r})):void 0}function ln(e){return"number"==typeof e?dn(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?dn(e.getTime()):St()}function dn(e){return e>9999999999?e/1e3:e}function hn(e){if(function(e){return"function"==typeof e.getSpanJSON}(e))return e.getSpanJSON();const{spanId:t,traceId:n}=e.spanContext();if(function(e){const t=e;return!!(t.attributes&&t.startTime&&t.name&&t.endTime&&t.status)}(e)){const{attributes:r,startTime:o,name:s,endTime:i,status:a,links:c}=e;return{span_id:t,trace_id:n,data:r,description:s,parent_span_id:pn(e),start_timestamp:ln(o),timestamp:ln(i)||void 0,status:fn(a),op:r[Xt],origin:r["sentry.origin"],links:un(c)}}return{span_id:t,trace_id:n,start_timestamp:0,data:{}}}function pn(e){return"parentSpanId"in e?e.parentSpanId:"parentSpanContext"in e?e.parentSpanContext?.spanId:void 0}function fn(e){if(e&&0!==e.code)return 1===e.code?"ok":e.message||"internal_error"}var mn=function(e){return e._sentryRootSpan||e};function gn(){an||(pe(()=>{}),an=!0)}function _n(e){if("boolean"==typeof __SENTRY_TRACING__&&!__SENTRY_TRACING__)return!1;const t=e||Kt()?.getOptions();return!(!t||null==t.tracesSampleRate&&!t.tracesSampler)}function yn(e){_e.log(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function vn(e,t){if(!t?.length)return!1;for(const n of t){if(xn(n)){if(e.description&&ft(e.description,n))return se&&yn(e),!0;continue}const t=!!n.attributes&&Object.keys(n.attributes).length>0;if(!n.name&&!n.op&&!t)continue;const r=!n.name||e.description&&ft(e.description,n.name),o=!n.op||e.op&&ft(e.op,n.op),s=!n.attributes||Object.entries(n.attributes).every(([t,n])=>bn(e.attributes?.[t],n));if(r&&o&&s)return se&&yn(e),!0}return!1}function bn(e,t){return"string"==typeof e&&("string"==typeof t||t instanceof RegExp)?ft(e,t):Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((e,n)=>e===t[n]):e===t}function wn(e,t){const n=t.parent_span_id,r=t.span_id;if(n)for(const o of e)o.parent_span_id===r&&(o.parent_span_id=n)}function xn(e){return"string"==typeof e||e instanceof RegExp}var kn=/* @__PURE__ */Symbol.for("sentry.nonRecordingSpan");var Sn="production";function Cn(e,t){const n=t.getOptions(),{publicKey:r}=t.getDsn()||{},o={environment:n.environment||"production",release:n.release,public_key:r,trace_id:e,org_id:on(t)};return t.emit("createDsc",o),o}function En(e,t){const n=t.getPropagationContext();return n.dsc||Cn(n.traceId,e)}function Tn(e){const t=Kt();if(!t)return{};const n=mn(e),r=hn(n),o=r.data,s=n.spanContext().traceState,i=s?.get("sentry.sample_rate")??o["sentry.sample_rate"]??o["sentry.previous_trace_sample_rate"];function a(e){return"number"!=typeof i&&"string"!=typeof i||(e.sample_rate=`${i}`),e}const c=n._frozenDsc;if(c)return a(c);const u=function(e){return!!e&&!0===e[kn]}(n),l=u&&"ignored"===n.dropReason;if(u&&(!_n(t.getOptions())||l)){const e=Gt(n).scope;if(e){const n={...En(t,e)};return l&&(n.sampled="false"),a(n)}}const d=s?.get("sentry.dsc"),h=d&&Qt(d);if(h)return a(h);const p=Cn(e.spanContext().traceId,t),f=o["sentry.source"]??o["sentry.segment.name.source"],m=r.description;return"url"!==f&&m&&(p.transaction=m),_n()&&(p.sampled=String(function(e){const{traceFlags:t}=e.spanContext();return 1===t}(n)),p.sample_rand=s?.get("sentry.sample_rand")??Gt(n).scope?.getPropagationContext().sampleRand.toString()),a(p),t.emit("createDsc",p,n),p}function Nn(e,t=[]){return[e,t]}function Rn(e,t){const[n,r]=e;return[n,[...r,t]]}function An(e,t){const n=e[1];for(const r of n){if(t(r,r[0].type))return!0}return!1}function Dn(e){const t=ue(ie);return t.encodePolyfill?t.encodePolyfill(e):(new TextEncoder).encode(e)}function Pn(e){const[t,n]=e;let r=JSON.stringify(t);function o(e){"string"==typeof r?r="string"==typeof e?r+e:[Dn(r),e]:r.push("string"==typeof e?Dn(e):e)}for(const s of n){const[e,t]=s;if(o(`\n${JSON.stringify(e)}\n`),"string"==typeof t||t instanceof Uint8Array)o(t);else{let e;try{e=JSON.stringify(t)}catch{e=JSON.stringify(ct(t))}o(e)}}return"string"==typeof r?r:function(e){const t=e.reduce((e,t)=>e+t.length,0),n=new Uint8Array(t);let r=0;for(const o of e)n.set(o,r),r+=o.length;return n}(r)}function $n(e){const t="string"==typeof e.data?Dn(e.data):e.data;return[{type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}var Ln={sessions:"session",event:"error",client_report:"internal",user_report:"default",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",raw_security:"security",log:"log_item",trace_metric:"metric"};function Un(e){return function(e){return e in Ln}(e)?Ln[e]:e}function jn(e){if(!e?.sdk)return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}function On(e,t,n,r){const o=jn(n),s=e.type&&"replay_event"!==e.type?e.type:"event";!function(e,t){if(!t)return e;const n=e.sdk||{};e.sdk={...n,name:n.name||t.name,version:n.version||t.version,integrations:[...e.sdk?.integrations||[],...t.integrations||[]],packages:[...e.sdk?.packages||[],...t.packages||[]],settings:e.sdk?.settings||t.settings?{...e.sdk?.settings,...t.settings}:void 0}}(e,n?.sdk);const i=function(e,t,n,r){const o=e.sdkProcessingMetadata?.dynamicSamplingContext;return{event_id:e.event_id,sent_at:new Date(rt()).toISOString(),...t&&{sdk:t},...!!n&&r&&{dsn:nn(r)},...o&&{trace:o}}}(e,o,r,t);return delete e.sdkProcessingMetadata,Nn(i,[[{type:s},e]])}function In(e,t){const{fingerprint:n,span:r,breadcrumbs:o,sdkProcessingMetadata:s}=t;!function(e,t){const{extra:n,tags:r,user:o,contexts:s,level:i,transactionName:a}=t;Object.keys(n).length&&(e.extra={...n,...e.extra});Object.keys(r).length&&(e.tags={...r,...e.tags});Object.keys(o).length&&(e.user={...o,...e.user});Object.keys(s).length&&(e.contexts={...s,...e.contexts});i&&(e.level=i);a&&"transaction"!==e.type&&(e.transaction=a)}(e,t),r&&function(e,t){e.contexts={trace:cn(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:Tn(t),...e.sdkProcessingMetadata};const n=mn(t),r=hn(n).description;r&&!e.transaction&&"transaction"===e.type&&(e.transaction=r)}(e,r),function(e,t){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],t&&(e.fingerprint=e.fingerprint.concat(t));e.fingerprint.length||delete e.fingerprint}(e,n),function(e,t){const n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}(e,o),function(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}(e,s)}function Mn(e,t){const{extra:n,tags:r,attributes:o,user:s,contexts:i,level:a,sdkProcessingMetadata:c,breadcrumbs:u,fingerprint:l,eventProcessors:d,attachments:h,propagationContext:p,transactionName:f,span:m}=t;qn(e,"extra",n),qn(e,"tags",r),qn(e,"attributes",o),qn(e,"user",s),qn(e,"contexts",i),e.sdkProcessingMetadata=Tt(e.sdkProcessingMetadata,c,2),a&&(e.level=a),f&&(e.transactionName=f),m&&(e.span=m),u.length&&(e.breadcrumbs=[...e.breadcrumbs,...u]),l.length&&(e.fingerprint=[...e.fingerprint,...l]),d.length&&(e.eventProcessors=[...e.eventProcessors,...d]),h.length&&(e.attachments=[...e.attachments,...h]),e.propagationContext={...e.propagationContext,...p}}function qn(e,t,n){e[t]=Tt(e[t],n,1)}function Bn(e,t){const n=le("globalScope",()=>new Lt).getScopeData();return e&&Mn(n,e.getScopeData()),t&&Mn(n,t.getScopeData()),n}var Fn="url.full";function zn(e,t){const n=e.attributes??(e.attributes={});Object.entries(t).forEach(([e,t])=>{null==t||e in n||(n[e]=t)})}function Hn(e){return new Xn(t=>{t(e)})}function Yn(e){return new Xn((t,n)=>{n(e)})}var Wn,Jn,Kn,Vn,Xn=class e{constructor(e){this._state=0,this._handlers=[],this._runExecutor(e)}then(t,n){return new e((e,r)=>{this._handlers.push([!1,n=>{if(t)try{e(t(n))}catch(tl){r(tl)}else e(n)},t=>{if(n)try{e(n(t))}catch(tl){r(tl)}else r(t)}]),this._executeHandlers()})}catch(e){return this.then(e=>e,e)}finally(t){return new e((e,n)=>{let r,o;return this.then(e=>{o=!1,r=e,t&&t()},e=>{o=!0,r=e,t&&t()}).then(()=>{o?n(r):e(r)})})}_executeHandlers(){if(0===this._state)return;const e=this._handlers.slice();this._handlers=[],e.forEach(e=>{e[0]||(1===this._state&&e[1](this._value),2===this._state&&e[2](this._value),e[0]=!0)})}_runExecutor(e){const t=(e,t)=>{0===this._state&&(We(t)?t.then(n,r):(this._state=e,this._value=t,this._executeHandlers()))},n=e=>{t(1,e)},r=e=>{t(2,e)};try{e(n,r)}catch(tl){r(tl)}}};function Gn(e,t,n,r=0){try{const o=Qn(t,n,e,r);return We(o)?o:Hn(o)}catch(o){return Yn(o)}}function Qn(e,t,n,r){const o=n[r];if(!e||!o)return e;const s=o({...e},t);return se&&null===s&&_e.log(`Event processor "${o.id||"?"}" dropped event`),We(s)?s.then(e=>Qn(e,t,n,r+1)):Qn(s,t,n,r+1)}function Zn(e,t,n,r,o,s){const{normalizeDepth:i=3,normalizeMaxBreadth:a=1e3}=e,c={...t,event_id:t.event_id||n.event_id||gt(),timestamp:t.timestamp||kt()},u=n.integrations||e.integrations.map(e=>e.name);!function(e,t){const{environment:n,release:r,dist:o,maxValueLength:s}=t;e.environment=e.environment||n||"production",!e.release&&r&&(e.release=r);!e.dist&&o&&(e.dist=o);const i=e.request;i?.url&&s&&(i.url=ht(i.url,s));s&&e.exception?.values?.forEach(e=>{e.value&&(e.value=ht(e.value,s))})}(c,e),function(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}(c,u),o&&o.emit("applyFrameMetadata",t),void 0===t.type&&function(e,t){const n=function(e){const t=ie._sentryDebugIds,n=ie._debugIds;if(!t&&!n)return{};const r=t?Object.keys(t):[],o=n?Object.keys(n):[];if(Vn&&r.length===Jn&&o.length===Kn)return Vn;Jn=r.length,Kn=o.length,Vn={},Wn||(Wn={});const s=(t,n)=>{for(const r of t){const t=n[r],o=Wn?.[r];if(o&&Vn&&t)Vn[o[0]]=t,Wn&&(Wn[r]=[o[0],t]);else if(t){const n=e(r);for(let e=n.length-1;e>=0;e--){const o=n[e]?.filename;if(o&&Vn&&Wn){Vn[o]=t,Wn[r]=[o,t];break}}}}};return t&&s(r,t),n&&s(o,n),Vn}(t);e.exception?.values?.forEach(e=>{e.stacktrace?.frames?.forEach(e=>{e.filename&&(e.debug_id=n[e.filename])})})}(c,e.stackParser);const l=function(e,t){if(!t)return e;const n=e?e.clone():new Lt;return n.update(t),n}(r,n.captureContext);n.mechanism&&bt(c,n.mechanism);const d=o?o.getEventProcessors():[],h=Bn(s,l),p=[...n.attachments||[],...h.attachments];p.length&&(n.attachments=p),In(c,h);const f=[...d,...h.eventProcessors];return(n.data&&!0===n.data.__sentry__?Hn(c):Gn(f,c,n)).then(e=>(e&&function(e){const t={};if(e.exception?.values?.forEach(e=>{e.stacktrace?.frames?.forEach(e=>{e.debug_id&&(e.abs_path?t[e.abs_path]=e.debug_id:e.filename&&(t[e.filename]=e.debug_id),delete e.debug_id)})}),0===Object.keys(t).length)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];const n=e.debug_meta.images;Object.entries(t).forEach(([e,t])=>{n.push({type:"sourcemap",code_file:e,debug_id:t})})}(e),"number"==typeof i&&i>0?function(e,t,n){if(!e)return null;const r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(e=>({...e,...e.data&&{data:ct(e.data,t,n)}}))},...e.user&&{user:ct(e.user,t,n)},...e.contexts&&{contexts:ct(e.contexts,t,n)},...e.extra&&{extra:ct(e.extra,t,n)}};e.contexts?.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=ct(e.contexts.trace.data,t,n)));e.spans&&(r.spans=e.spans.map(e=>({...e,...e.data&&{data:ct(e.data,t,n)}})));e.contexts?.flags&&r.contexts&&(r.contexts.flags=ct(e.contexts.flags,3,n));return r}(e,i,a):e))}function er(e){if(e)return function(e){return e instanceof Lt||"function"==typeof e}(e)||function(e){return Object.keys(e).some(e=>tr.includes(e))}(e)?{captureContext:e}:e}var tr=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function nr(e,t){return Wt().captureException(e,er(t))}function rr(e,t){return Wt().captureEvent(e,t)}function or(e,t){Jt().setTag(e,t)}function sr(e){const t=Jt(),{user:n}=Bn(t,Wt()),{userAgent:r}=ie.navigator||{},o=Ct({user:n,...r&&{userAgent:r},...e}),s=t.getSession();return"ok"===s?.status&&Et(s,{status:"exited"}),ir(),t.setSession(o),o}function ir(){const e=Jt(),t=Wt().getSession()||e.getSession();t&&function(e,t){let n={};t?n={status:t}:"ok"===e.status&&(n={status:"exited"}),Et(e,n)}(t),ar(),e.setSession()}function ar(){const e=Jt(),t=Kt(),n=e.getSession();n&&t&&t.captureSession(n)}function cr(e=!1){e?ir():ar()}function ur(e){return"object"==typeof e&&"function"==typeof e.unref&&e.unref(),e}function lr(e,t,n){return t||`${function(e){return`${function(e){const t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}(e)}${e.projectId}/envelope/`}(e)}?${function(e,t){const n={sentry_version:"7"};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}(e,n)}`}var dr=[];function hr(e){const t=e.defaultIntegrations||[],n=e.integrations;let r;if(t.forEach(e=>{e.isDefaultInstance=!0}),Array.isArray(n))r=[...t,...n];else if("function"==typeof n){const e=n(t);r=Array.isArray(e)?e:[e]}else r=t;return function(e){const t={};return e.forEach(e=>{const{name:n}=e,r=t[n];r&&!r.isDefaultInstance&&e.isDefaultInstance||(t[n]=e)}),Object.values(t)}(r)}function pr(e,t){for(const n of t)n?.afterAllSetup&&n.afterAllSetup(e)}function fr(e,t,n){if(n[t.name])se&&_e.log(`Integration skipped because it was already installed: ${t.name}`);else{if(n[t.name]=t,dr.includes(t.name)||"function"!=typeof t.setupOnce||(t.setupOnce(),dr.push(t.name)),t.setup&&"function"==typeof t.setup&&t.setup(e),"function"==typeof t.preprocessEvent){const n=t.preprocessEvent.bind(t);e.on("preprocessEvent",(t,r)=>n(t,r,e))}if("function"==typeof t.processEvent){const n=t.processEvent.bind(t),r=Object.assign((t,r)=>n(t,r,e),{id:t.name});e.addEventProcessor(r)}["processSpan","processSegmentSpan"].forEach(n=>{const r=t[n];"function"==typeof r&&e.on(n,n=>r.call(t,n,e))}),se&&_e.log(`Integration installed: ${t.name}`)}}function mr(){return!("undefined"!=typeof __SENTRY_BROWSER_BUNDLE__&&__SENTRY_BROWSER_BUNDLE__)&&"[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0)}function gr(){return"undefined"!=typeof window&&(!mr()||"renderer"===ie.process?.type)}function _r(e,t){const n=t?"auto":"never";return[{type:"log",item_count:e.length,content_type:"application/vnd.sentry.items.log+json"},{version:2,...gr()&&{ingest_settings:{infer_ip:n,infer_user_agent:n}},items:e}]}function yr(e,t){const n=t??function(e){return vr().get(e)}(e)??[];if(0===n.length)return;const r=e.getOptions(),o=function(e,t,n,r,o){const s={};return t?.sdk&&(s.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(s.dsn=nn(r)),Nn(s,[_r(e,o)])}(n,r._metadata,r.tunnel,e.getDsn(),e.getDataCollectionOptions().userInfo);vr().set(e,[]),e.emit("flushLogs"),e.sendEnvelope(o)}function vr(){return le("clientToLogBufferMap",()=>/* @__PURE__ */new WeakMap)}function br(e,t){const n=t?"auto":"never";return[{type:"trace_metric",item_count:e.length,content_type:"application/vnd.sentry.items.trace-metric+json"},{version:2,...gr()&&{ingest_settings:{infer_ip:n,infer_user_agent:n}},items:e}]}function wr(e,t){const n=t??function(e){return xr().get(e)}(e)??[];if(0===n.length)return;const r=e.getOptions(),o=function(e,t,n,r,o){const s={};return t?.sdk&&(s.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(s.dsn=nn(r)),Nn(s,[br(e,o)])}(n,r._metadata,r.tunnel,e.getDsn(),e.getDataCollectionOptions().userInfo);xr().set(e,[]),e.emit("flushMetrics"),e.sendEnvelope(o)}function xr(){return le("clientToMetricBufferMap",()=>/* @__PURE__ */new WeakMap)}function kr(e){const t={trace_id:e.trace_id,span_id:e.span_id,parent_span_id:e.parent_span_id,name:e.description||"",start_timestamp:e.start_timestamp,end_timestamp:e.timestamp||e.start_timestamp,status:e.status&&"ok"!==e.status&&"cancelled"!==e.status?"error":"ok",is_segment:!1,attributes:{...e.data},links:e.links};return n=t,{...n,attributes:Yt(n.attributes),links:n.links?.map(e=>({...e,attributes:Yt(e.attributes)}))};var n}var Sr=/* @__PURE__ */Symbol.for("SentryBufferFullError");function Cr(e=100){const t=/* @__PURE__ */new Set;function n(e){t.delete(e)}return{get $(){return Array.from(t)},add:function(r){if(!(t.size<e))return Yn(Sr);const o=r();return t.add(o),o.then(()=>n(o),()=>n(o)),o},drain:function(e){if(!t.size)return Hn(!0);const n=Promise.allSettled(Array.from(t)).then(()=>!0);if(!e)return n;const r=[n,new Promise(t=>ur(setTimeout(()=>t(!1),e)))];return Promise.race(r)}}}function Er(e,{statusCode:t,headers:n},r=rt()){const o={...e},s=n?.["x-sentry-rate-limits"],i=n?.["retry-after"];if(s)for(const a of s.trim().split(",")){const[e,t,,,n]=a.split(":",5),s=parseInt(e,10),i=1e3*(isNaN(s)?60:s);if(t)for(const a of t.split(";"))"metric_bucket"===a&&n&&!n.split(";").includes("custom")||(o[a]=r+i);else o.all=r+i}else i?o.all=r+function(e,t=rt()){const n=parseInt(`${e}`,10);if(!isNaN(n))return 1e3*n;const r=Date.parse(`${e}`);return isNaN(r)?6e4:r-t}(i,r):429===t&&(o.all=r+6e4);return o}function Tr(e,t,n=Cr(e.bufferSize||64)){let r={};return{send:function(o){const s=[];if(An(o,(t,n)=>{const o=Un(n);!function(e,t,n=rt()){return function(e,t){return e[t]||e.all||0}(e,t)>n}(r,o)?s.push(t):e.recordDroppedEvent("ratelimit_backoff",o)}),0===s.length)return Promise.resolve({});const i=Nn(o[0],s),a=t=>{!function(e,t){return An(e,(e,n)=>t.includes(n))}(i,["client_report"])?An(i,(n,r)=>{e.recordDroppedEvent(t,Un(r))}):se&&_e.warn(`Dropping client report. Will not send outcomes (reason: ${t}).`)};return n.add(()=>t({body:Pn(i)}).then(e=>413===e.statusCode?(se&&_e.error("Sentry responded with status code 413. Envelope was discarded due to exceeding size limits."),a("send_error"),e):(se&&void 0!==e.statusCode&&(e.statusCode<200||e.statusCode>=300)&&_e.warn(`Sentry responded with status code ${e.statusCode} to sent event.`),r=Er(r,e),e),e=>{throw a("network_error"),se&&_e.error("Encountered error running transport request:",e),e})).then(e=>e,e=>{if(e===Sr)return se&&_e.error("Skipped sending event because buffer is full."),a("queue_overflow"),Promise.resolve({});throw e})},flush:e=>n.drain(e)}}function Nr(e){const t=[];e.message&&t.push(e.message);try{const n=e.exception.values[e.exception.values.length-1];n?.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`))}catch{}return t}var Rr=["forwarded","-ip","remote-","via","-user"];var Ar={userInfo:!0,cookies:!0,httpHeaders:{request:!0,response:!0},httpBodies:["incomingRequest","outgoingRequest","incomingResponse","outgoingResponse"],urlQueryParams:!0,graphQL:{document:!0,variables:!0},genAI:{inputs:!0,outputs:!0},databaseQueryData:!0,stackFrameVariables:!0,frameContextLines:5};function Dr(e){const t=null!=e.dataCollection?Ar:!0===e.sendDefaultPii?{userInfo:!0,cookies:!0,httpHeaders:{request:!0,response:!0},httpBodies:["incomingRequest","outgoingRequest","incomingResponse","outgoingResponse"],urlQueryParams:!0,graphQL:{document:!0,variables:!0},genAI:{inputs:!0,outputs:!0},databaseQueryData:!0,stackFrameVariables:!0,frameContextLines:7}:{userInfo:!1,cookies:{deny:Rr},httpHeaders:{request:{deny:Rr},response:{deny:Rr}},httpBodies:[],urlQueryParams:{deny:Rr},graphQL:{document:!0,variables:!0},genAI:{inputs:!1,outputs:!1},databaseQueryData:!1,stackFrameVariables:!0,frameContextLines:7};const n=e.dataCollection??{};return{userInfo:n.userInfo??t.userInfo,cookies:n.cookies??t.cookies,httpHeaders:{request:n.httpHeaders?.request??t.httpHeaders.request,response:n.httpHeaders?.response??t.httpHeaders.response},httpBodies:n.httpBodies??t.httpBodies,urlQueryParams:n.urlQueryParams??n.queryParams??t.urlQueryParams,graphQL:{document:n.graphQL?.document??t.graphQL.document,variables:n.graphQL?.variables??t.graphQL.variables},genAI:{inputs:n.genAI?.inputs??t.genAI.inputs,outputs:n.genAI?.outputs??t.genAI.outputs},databaseQueryData:n.databaseQueryData??t.databaseQueryData,stackFrameVariables:n.stackFrameVariables??t.stackFrameVariables,frameContextLines:n.frameContextLines??t.frameContextLines}}var Pr="Not capturing exception because it's already been captured.",$r="Discarded session because of missing or non-string release",Lr=/* @__PURE__ */Symbol.for("SentryInternalError"),Ur=/* @__PURE__ */Symbol.for("SentryDoNotSendEventError");function jr(e){return{message:e,[Lr]:!0}}function Or(e){return{message:e,[Ur]:!0}}function Ir(e){return He(e)&&Lr in e}function Mr(e){return He(e)&&Ur in e}function qr(e,t,n,r,o){let s,i=0,a=!1;e.on(n,()=>{i=0,clearTimeout(s),a=!1}),e.on(t,t=>{if(i+=r(t),i>=8e5)o(e);else if(!a){const t=e.getOptions()._flushInterval??5e3;t>0&&(a=!0,s=ur(setTimeout(()=>{o(e)},t)))}}),e.on("flush",()=>{o(e)})}var Br=class{constructor(e){if(this._options=e,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=Cr(e.transportOptions?.bufferSize??64),this._dataCollection=Dr(e),e.dsn?this._dsn=sn(e.dsn):se&&_e.warn("No DSN provided, client will not send events."),this._dsn){const t=lr(this._dsn,e.tunnel,e._metadata?e._metadata.sdk:void 0);this._transport=e.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:t})}this._options.enableLogs=this._options.enableLogs??this._options._experiments?.enableLogs??!0,this._options.enableLogs&&qr(this,"afterCaptureLog","flushLogs",Wr,yr),(this._options.enableMetrics??this._options._experiments?.enableMetrics??1)&&qr(this,"afterCaptureMetric","flushMetrics",Yr,wr)}captureException(e,t,n){const r=gt();if(wt(e))return se&&_e.log(Pr),r;const o={event_id:r,...t};return this._process(()=>this.eventFromException(e,o).then(e=>this._captureEvent(e,o,n)).then(e=>e),"error"),o.event_id}captureMessage(e,t,n,r){const o={event_id:gt(),...n},s=Be(e)?e:String(e),i=Fe(e),a=i?this.eventFromMessage(s,t,o):this.eventFromException(e,o);return this._process(()=>a.then(e=>this._captureEvent(e,o,r)),i?"unknown":"error"),o.event_id}captureEvent(e,t,n){const r=gt();if(t?.originalException&&wt(t.originalException))return se&&_e.log(Pr),r;const o={event_id:r,...t},s=e.sdkProcessingMetadata||{},i=s.capturedSpanScope,a=s.capturedSpanIsolationScope,c=Fr(e.type);return this._process(()=>this._captureEvent(e,o,i||n,a),c),o.event_id}captureSession(e){this.sendSession(e),Et(e,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getDataCollectionOptions(){return this._dataCollection}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}async flush(e){const t=this._transport;if(this.emit("flush"),!t)return!0;const n=await this._isClientDoneProcessing(e),r=await t.flush(e);return n&&r}async close(e){const t=await this.flush(e);return this.getOptions().enabled=!1,this.emit("close"),t}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}init(){(this._isEnabled()||this._options.integrations.some(({name:e})=>e.startsWith("Spotlight")))&&this._setupIntegrations()}getIntegrationByName(e){return this._integrations[e]}getIntegrationNames(){return Object.keys(this._integrations)}addIntegration(e){const t=this._integrations[e.name];!t&&e.beforeSetup&&e.beforeSetup(this),fr(this,e,this._integrations),t||pr(this,[e])}sendEvent(e,t={}){this.emit("beforeSendEvent",e,t);const n=function(e,t){if("transaction"!==e.type||!e.spans?.length||!e.sdkProcessingMetadata?.hasGenAiSpans||!1===t.getOptions().streamGenAiSpans||function(e){return"stream"===e.getOptions().traceLifecycle}(t))return;const n=[],r=[];for(const s of e.spans)s.op?.startsWith("gen_ai.")?n.push(kr(s)):r.push(s);if(0===n.length)return;e.spans=r;const o=t.getDataCollectionOptions().userInfo?"auto":"never";return[{type:"span",item_count:n.length,content_type:"application/vnd.sentry.items.span.v2+json"},{version:2,...gr()&&{ingest_settings:{infer_ip:o,infer_user_agent:o}},items:n}]}(e,this);let r=On(e,this._dsn,this._options._metadata,this._options.tunnel);for(const o of t.attachments||[])r=Rn(r,$n(o));n&&(r=Rn(r,n)),this.sendEnvelope(r).then(t=>this.emit("afterSendEvent",e,t))}sendSession(e){const{release:t,environment:n=Sn}=this._options;if("aggregates"in e){const r=e.attrs||{};if(!r.release&&!t)return void(se&&_e.warn($r));r.release=r.release||t,r.environment=r.environment||n,e.attrs=r}else{if(!e.release&&!t)return void(se&&_e.warn($r));e.release=e.release||t,e.environment=e.environment||n}this.emit("beforeSendSession",e);const r=function(e,t,n,r){const o=jn(n);return Nn({sent_at:new Date(rt()).toISOString(),...o&&{sdk:o},...!!r&&t&&{dsn:nn(t)}},["aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()]])}(e,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(r)}recordDroppedEvent(e,t,n=1){if(this._options.sendClientReports){const r=`${e}:${t}`;se&&_e.log(`Recording outcome: "${r}"${n>1?` (${n} times)`:""}`),this._outcomes[r]=(this._outcomes[r]||0)+n}}on(e,t){const n=this._hooks[e]=this._hooks[e]||/* @__PURE__ */new Set,r=(...e)=>t(...e);return n.add(r),()=>{n.delete(r)}}emit(e,...t){const n=this._hooks[e];n&&n.forEach(e=>e(...t))}async sendEnvelope(e){if(this.emit("beforeEnvelope",e),this._isEnabled()&&this._transport)try{return await this._transport.send(e)}catch(t){return se&&_e.error("Error while sending envelope:",t),{}}return se&&_e.error("Transport disabled"),{}}registerCleanup(e){}dispose(){}_setupIntegrations(){const{integrations:e}=this._options;this._integrations=function(e,t){const n={};return t.forEach(t=>{t?.beforeSetup&&t.beforeSetup(e)}),t.forEach(t=>{t&&fr(e,t,n)}),n}(this,e),pr(this,e)}_updateSessionFromEvent(e,t){let n="fatal"===t.level,r=!1;const o=t.exception?.values;if(o){r=!0,n=!1;for(const e of o)if(!1===e.mechanism?.handled){n=!0;break}}const s="ok"===e.status;(s&&0===e.errors||s&&n)&&(Et(e,{...n&&{status:"crashed"},errors:e.errors||Number(r||n)}),this.captureSession(e))}async _isClientDoneProcessing(e){let t=0;for(;!e||t<e;){if(await new Promise(e=>setTimeout(e,1)),!this._numProcessing)return!0;t++}return!1}_isEnabled(){return!1!==this.getOptions().enabled&&void 0!==this._transport}_prepareEvent(e,t,n,r){const o=this.getOptions(),s=this.getIntegrationNames();return!t.integrations&&s.length&&(t.integrations=s),this.emit("preprocessEvent",e,t),e.type||r.setLastEventId(e.event_id||t.event_id),Zn(o,e,t,n,this,r).then(e=>(null===e||(this.emit("postprocessEvent",e,t),e.contexts={trace:{...e.contexts?.trace,...Vt(n)},...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:En(this,n),...e.sdkProcessingMetadata}),e))}_captureEvent(e,t={},n=Wt(),r=Jt()){return se&&zr(e)&&_e.log(`Captured error event \`${Nr(e)[0]||"<unknown>"}\``),this._processEvent(e,t,n,r).then(e=>e.event_id,e=>{se&&(Mr(e)?_e.log(e.message):Ir(e)?_e.warn(e.message):_e.warn(e))})}_processEvent(e,t,n,r){const o=this.getOptions(),{sampleRate:s}=o,i=Hr(e),a=zr(e),c=`before send for type \`${e.type||"error"}\``,u=void 0===s?void 0:function(e){if("boolean"==typeof e)return Number(e);const t="string"==typeof e?parseFloat(e):e;return"number"!=typeof t||isNaN(t)||t<0||t>1?void 0:t}(s),l=Fr(e.type);return this._prepareEvent(e,t,n,r).then(e=>{if(null===e)throw this.recordDroppedEvent("event_processor",l),Or("An event processor returned `null`, will not send event.");return!0===t.data?.__sentry__?e:function(e,t){const n=`${t} must return \`null\` or a valid event.`;if(We(e))return e.then(e=>{if(!ze(e)&&null!==e)throw jr(n);return e},e=>{throw jr(`${t} rejected with ${e}`)});if(!ze(e)&&null!==e)throw jr(n);return e}(function(e,t,n,r){const{beforeSend:o,beforeSendTransaction:s,ignoreSpans:i}=t,a=(c=t.beforeSendSpan,!(c&&"function"==typeof c&&"_streamed"in c&&c._streamed)&&t.beforeSendSpan);var c;let u=n;if(zr(u)&&o)return o(u,r);if(Hr(u)){if(a||i){const t=function(e){const{trace_id:t,parent_span_id:n,span_id:r,status:o,origin:s,data:i,op:a}=e.contexts?.trace??{};return{data:i??{},description:e.transaction,op:a,parent_span_id:n,span_id:r??"",start_timestamp:e.start_timestamp??0,status:o,timestamp:e.timestamp,trace_id:t??"",origin:s,profile_id:i?.["sentry.profile_id"],exclusive_time:i?.["sentry.exclusive_time"],measurements:e.measurements,is_segment:!0}}(u);if(i?.length&&vn({description:t.description,op:t.op,attributes:t.data},i))return null;if(a){const e=a(t);e?u=Tt(n,{type:"transaction",timestamp:(l=e).timestamp,start_timestamp:l.start_timestamp,transaction:l.description,contexts:{trace:{trace_id:l.trace_id,span_id:l.span_id,parent_span_id:l.parent_span_id,op:l.op,status:l.status,origin:l.origin,data:{...l.data,...l.profile_id&&{"sentry.profile_id":l.profile_id},...l.exclusive_time&&{"sentry.exclusive_time":l.exclusive_time}}}},measurements:l.measurements}):gn()}if(u.spans){const t=[],n=u.spans;for(const e of n)if(i?.length&&vn({description:e.description,op:e.op,attributes:e.data},i))wn(n,e);else if(a){const n=a(e);n?t.push(n):(gn(),t.push(e))}else t.push(e);const r=u.spans.length-t.length;r&&e.recordDroppedEvent("before_send","span",r),u.spans=t}}if(s){if(u.spans){const e=u.spans.length;u.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:e}}return s(u,r)}}var l;return u}(this,o,e,t),c)}).then(o=>{if(null===o){if(this.recordDroppedEvent("before_send",l),i){const t=1+(e.spans||[]).length;this.recordDroppedEvent("before_send","span",t)}throw Or(`${c} returned \`null\`, will not send event.`)}const d=n.getSession()||r.getSession();if(a&&d&&this._updateSessionFromEvent(d,o),a&&"number"==typeof u&&nt()>u)throw this.recordDroppedEvent("sample_rate","error"),Or(`Discarding event because it's not included in the random sample (sampling rate = ${s})`);if(i){const e=(o.sdkProcessingMetadata?.spanCountBeforeProcessing||0)-(o.spans?o.spans.length:0);e>0&&this.recordDroppedEvent("before_send","span",e)}const h=o.transaction_info;if(i&&h&&o.transaction!==e.transaction){const e="custom";o.transaction_info={...h,source:e}}return this.sendEvent(o,t),o}).then(null,e=>{if(Mr(e)||Ir(e))throw e;throw this.captureException(e,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:e}),jr(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${e}`)})}_process(e,t){this._numProcessing++,this._promiseBuffer.add(e).then(e=>(this._numProcessing--,e),e=>(this._numProcessing--,e===Sr&&this.recordDroppedEvent("queue_overflow",t),e))}_clearOutcomes(){const e=this._outcomes;return this._outcomes={},Object.entries(e).map(([e,t])=>{const[n,r]=e.split(":");return{reason:n,category:r,quantity:t}})}_flushOutcomes(){se&&_e.log("Flushing outcomes...");const e=this._clearOutcomes();if(0===e.length)return void(se&&_e.log("No outcomes to send"));if(!this._dsn)return void(se&&_e.log("No dsn provided, will not send outcomes"));se&&_e.log("Sending outcomes:",e);const t=(n=e,Nn((r=this._options.tunnel&&nn(this._dsn))?{dsn:r}:{},[[{type:"client_report"},{timestamp:o||kt(),discarded_events:n}]]));var n,r,o;this.sendEnvelope(t)}};function Fr(e){return"replay_event"===e?"replay":e||"error"}function zr(e){return void 0===e.type}function Hr(e){return"transaction"===e.type}function Yr(e){let t=0;return e.name&&(t+=2*e.name.length),t+=8,t+Jr(e.attributes)}function Wr(e){let t=0;return e.message&&(t+=2*e.message.length),t+Jr(e.attributes)}function Jr(e){if(!e)return 0;let t=0;return Object.values(e).forEach(e=>{Array.isArray(e)?t+=e.length*Kr(e[0]):Fe(e)?t+=Kr(e):t+=100}),t}function Kr(e){return"string"==typeof e?2*e.length:"number"==typeof e?8:"boolean"==typeof e?4:0}function Vr(e,t){!0===t.debug&&(se?_e.enable():pe(()=>{})),Wt().update(t.initialScope);const n=new e(t);return function(e){Wt().setClient(e)}(n),n.init(),n}function Xr(e){if(!e)return{};const t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};const n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}}function Gr(e){"aggregates"in e?void 0===e.attrs?.ip_address&&(e.attrs={...e.attrs,ip_address:"{{auto}}"}):void 0===e.ipAddress&&(e.ipAddress="{{auto}}")}var Qr=100;function Zr(e,t){const n=Kt(),r=Jt();if(!n)return;const{beforeBreadcrumb:o=null,maxBreadcrumbs:s=Qr}=n.getOptions();if(s<=0)return;const i={timestamp:kt(),...e},a=o?pe(()=>o(i,t)):i;null!==a&&(n.emit&&n.emit("beforeAddBreadcrumb",a,t),r.addBreadcrumb(a,s))}var eo=/* @__PURE__ */new WeakMap,to=()=>({name:"FunctionToString",setupOnce(){const e=Function.prototype.toString;try{Function.prototype.toString=function(...t){const n=Qe(this);let r;try{eo.has(Kt())&&void 0!==n&&(r=n)}catch{}return e.apply(r??this,t)}}catch{}},setup(e){eo.set(e,!0)}}),no=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,/^Can't find variable: gmo$/,/^undefined is not an object \(evaluating 'a\.[A-Z]'\)$/,/can't redefine non-configurable property "solana"/,/vv\(\)\.getRestrictions is not a function/,/Can't find variable: _AutofillCallbackHandler/,/Object Not Found Matching Id:\d+, MethodName:simulateEvent/,/^Java exception was raised during method invocation$/],ro=(e={})=>{let t;return{name:"EventFilters",setup(n){t=so(e,n.getOptions())},processEvent:(n,r,o)=>(t||(t=so(e,o.getOptions())),function(e,t){if(e.type){if("transaction"===e.type&&function(e,t){if(!t?.length)return!1;const n=e.transaction;return!!n&&mt(n,t)}(e,t.ignoreTransactions))return se&&_e.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.\nEvent: ${yt(e)}`),!0}else{if(function(e,t){return!!t?.length&&Nr(e).some(e=>mt(e,t))}(e,t.ignoreErrors))return se&&_e.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${yt(e)}`),!0;if(function(e){return!!e.exception?.values?.length&&(!e.message&&!e.exception.values.some(e=>e.stacktrace||e.type&&"Error"!==e.type||e.value))}(e))return se&&_e.warn(`Event dropped due to not having an error message, error type or stacktrace.\nEvent: ${yt(e)}`),!0;if(function(e,t){if(!t?.length)return!1;const n=io(e);return!!n&&mt(n,t)}(e,t.denyUrls))return se&&_e.warn(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${yt(e)}.\nUrl: ${io(e)}`),!0;if(!function(e,t){if(!t?.length)return!0;const n=io(e);return!n||mt(n,t)}(e,t.allowUrls))return se&&_e.warn(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${yt(e)}.\nUrl: ${io(e)}`),!0}return!1}(n,t)?null:n)}},oo=(e={})=>({...ro(e),name:"InboundFilters"});function so(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:no],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function io(e){try{const t=[...e.exception?.values??[]].reverse().find(e=>void 0===e.mechanism?.parent_id&&e.stacktrace?.frames?.length)?.stacktrace?.frames;return t?function(e=[]){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n&&"<anonymous>"!==n.filename&&"[native code]"!==n.filename)return n.filename||null}return null}(t):null}catch{return se&&_e.error(`Cannot extract url for event ${yt(e)}`),null}}function ao(e,t,n,r,o,s){if(!o.exception?.values||!s||!je(s.originalException))return;const i=o.exception.values.length>0?o.exception.values[o.exception.values.length-1]:void 0;i&&(o.exception.values=co(e,t,r,s.originalException,n,o.exception.values,i,0))}function co(e,t,n,r,o,s,i,a){if(s.length>=n+1)return s;let c=[...s];if(je(r[o])){lo(i,a,r);const s=e(t,r[o]),u=c.length;ho(s,o,u,a),c=co(e,t,n,r[o],o,[s,...c],s,u)}return uo(r)&&r.errors.forEach((s,u)=>{if(je(s)){lo(i,a,r);const l=e(t,s),d=c.length;ho(l,`errors[${u}]`,d,a),c=co(e,t,n,s,o,[l,...c],l,d)}}),c}function uo(e){return Array.isArray(e.errors)}function lo(e,t,n){e.mechanism={handled:!0,type:"auto.core.linked_errors",...uo(n)&&{is_exception_group:!0},...e.mechanism,exception_id:t}}function ho(e,t,n,r){e.mechanism={handled:!0,...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:r}}function po(e){return function(e){return je(e)&&"__sentry_fetch_url_host__"in e&&"string"==typeof e.__sentry_fetch_url_host__}(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}var fo=/* @__PURE__ */new Set([]);var mo=/* @__PURE__ */new Set;function go(){"console"in ie&&de.forEach(function(e){!mo.has(e)&&e in ie.console&&(mo.add(e),Ve(ie.console,e,function(t){return he[e]=t,function(...t){const n=t[0],r=he[e],o=fo.size&&"string"==typeof n&&mt(n,fo);o||Re("console",{args:t,level:e}),(!o||se&&_e.isEnabled())&&r?.apply(ie.console,t)}}))})}function _o(e){return"warn"===e?"warning":["fatal","error","warning","log","info","debug"].includes(e)?e:"log"}var yo=()=>{let e;return{name:"Dedupe",processEvent(t){if(t.type)return t;try{if(function(e,t){return!!t&&(!!function(e,t){const n=e.message,r=t.message;return!(!n&&!r)&&(!(n&&!r||!n&&r)&&(n===r&&(!!bo(e,t)&&!!vo(e,t))))}(e,t)||!!function(e,t){const n=wo(t),r=wo(e);return!(!n||!r)&&(n.type===r.type&&n.value===r.value&&(!!bo(e,t)&&!!vo(e,t)))}(e,t))}(t,e))return se&&_e.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}};function vo(e,t){let n=Se(e),r=Se(t);if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;if(r.length!==n.length)return!1;for(let o=0;o<r.length;o++){const e=r[o],t=n[o];if(e.filename!==t.filename||e.lineno!==t.lineno||e.colno!==t.colno||e.function!==t.function)return!1}return!0}function bo(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;try{return!(n.join("")!==r.join(""))}catch{return!1}}function wo(e){return e.exception?.values?.[0]}var xo=()=>({name:"ConversationId",setup(e){e.on("spanStart",e=>{const t=Wt().getScopeData(),n=Jt().getScopeData(),r=t.conversationId||n.conversationId;if(r){const{op:t,data:n,description:o}=hn(e);if(!t?.startsWith("gen_ai.")&&!n["ai.operationId"]&&!o?.startsWith("ai."))return;e.setAttribute("gen_ai.conversation.id",r)}})}});function ko(e){return void 0===e?void 0:e>=400&&e<500?"warning":e>=500?"error":void 0}var So=ie;function Co(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function Eo(){if("string"==typeof EdgeRuntime)return!0;if(!function(){if(!("fetch"in So))return!1;try{return new Headers,new Request("data:,"),new Response,!0}catch{return!1}}())return!1;if(Co(So.fetch))return!0;let e=!1;const t=So.document;if(t&&"function"==typeof t.createElement)try{const n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n),n.contentWindow?.fetch&&(e=Co(n.contentWindow.fetch)),t.head.removeChild(n)}catch(n){se&&_e.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return e}function To(e,t){const n="fetch",r=Te(n,e);return Ne(n,()=>function(e,t=!1){if(t&&!Eo())return;Ve(ie,"fetch",function(t){return function(...n){const r=/* @__PURE__ */new Error,{method:o,url:s}=function(e){if(0===e.length)return{method:"GET",url:""};if(2===e.length){const[t,n]=e;return{url:Ro(t),method:No(n,"method")?String(n.method).toUpperCase():Ke(t)&&No(t,"method")?String(t.method).toUpperCase():"GET"}}const t=e[0];return{url:Ro(t),method:No(t,"method")?String(t.method).toUpperCase():"GET"}}(n),i={args:n,fetchData:{method:o,url:s},startTimestamp:1e3*St(),virtualError:r,headers:Ao(n)};return e||Re("fetch",{...i}),t.apply(ie,n).then(async t=>(e?e(t):Re("fetch",{...i,endTimestamp:1e3*St(),response:t}),t),e=>{Re("fetch",{...i,endTimestamp:1e3*St(),error:e}),je(e)&&void 0===e.stack&&(e.stack=r.stack,Xe(e,"framesToPop",1));const t=Kt()?.getOptions().enhanceFetchErrorMessages??"always";if(!1!==t&&je(e)&&"TypeError"===e.name&&("Failed to fetch"===e.message||"Load failed"===e.message||"NetworkError when attempting to fetch resource."===e.message))try{const n=new URL(i.fetchData.url).host;"always"===t?e.message=`${e.message} (${n})`:Xe(e,"__sentry_fetch_url_host__",n)}catch{}throw e})}})}(void 0,t)),r}function No(e,t){return He(e)&&!!e[t]}function Ro(e){return"string"==typeof e?e:e?No(e,"url")?e.url:e.toString?e.toString():"":""}function Ao(e){const[t,n]=e;try{if("object"==typeof n&&null!==n&&"headers"in n&&n.headers)return new Headers(n.headers);if(Ke(t))return new Headers(t.headers)}catch{}}var Do=ie;function Po(){try{return Do.document.location.href}catch{return""}}var $o=ie,Lo=0;function Uo(){return Lo>0}function jo(e,t={}){if("function"!=typeof e)return e;try{if(Object.prototype.hasOwnProperty.call(e,"__sentry_wrapped__")){const t=e.__sentry_wrapped__;return"function"==typeof t?t:e}if(Qe(e))return e}catch{return e}const n=function(...n){ie._sentryWrappedDepth=(ie._sentryWrappedDepth||0)+1;try{const r=n.map(e=>jo(e,t));return e.apply(this,r)}catch(r){throw Lo++,setTimeout(()=>{Lo--}),function(...e){const t=zt(ce());if(2===e.length){const[n,r]=e;return n?t.withSetScope(n,r):t.withScope(r)}t.withScope(e[0])}(e=>{e.addEventProcessor(e=>(t.mechanism&&(vt(e,void 0,void 0),bt(e,t.mechanism)),e.extra={...e.extra,arguments:n},e)),nr(r)}),r}finally{ie._sentryWrappedDepth=(ie._sentryWrappedDepth||0)-1}};try{for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t])}catch{}Ge(n,e),Xe(e,"__sentry_wrapped__",n);try{Object.getOwnPropertyDescriptor(n,"name").configurable&&Object.defineProperty(n,"name",{get:()=>e.name})}catch{}return n}function Oo(){const e=Po(),{referrer:t}=$o.document||{},{userAgent:n}=$o.navigator||{};return{url:e,headers:{...t&&{Referer:t},...n&&{"User-Agent":n}}}}function Io(e,t){const n=Bo(e,t),r={type:Ho(t),value:Yo(t)};return n.length&&(r.stacktrace={frames:n}),void 0===r.type&&""===r.value&&(r.value="Unrecoverable error caught"),r}function Mo(e,t,n,r){const o=Kt()?.getOptions().normalizeDepth,s=(i=t,Object.values(i).find(je));var i;const a={__serialized__:ut(t,o)};if(s)return{exception:{values:[Io(e,s)]},extra:a};const c={exception:{values:[{type:Ye(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:Ko(t,{isUnhandledRejection:r})}]},extra:a};if(n){const t=Bo(e,n);t.length&&(c.exception.values[0].stacktrace={frames:t})}return c}function qo(e,t){return{exception:{values:[Io(e,t)]}}}function Bo(e,t){const n=t.stacktrace||t.stack||"",r=function(e){return e&&Fo.test(e.message)?1:0}(t),o=function(e){return"number"==typeof e.framesToPop?e.framesToPop:0}(t);try{return e(n,r,o)}catch{}return[]}var Fo=/Minified React error #\d+;/i;function zo(e){return"undefined"!=typeof WebAssembly&&void 0!==WebAssembly.Exception&&e instanceof WebAssembly.Exception}function Ho(e){const t=e?.name;return!t&&zo(e)?e.message&&Array.isArray(e.message)&&2==e.message.length?e.message[0]:"WebAssembly.Exception":t}function Yo(e){const t=e?.message;return zo(e)?Array.isArray(e.message)&&2==e.message.length?e.message[1]:"wasm exception":t?t.error&&"string"==typeof t.error.message?po(t.error):po(e):"No error message"}function Wo(e,t,n,r,o){let s;if(Ie(t)&&t.error)return qo(e,t.error);if(Me(t)||Oe(t,"DOMException")){const o=t;if("stack"in t){s=qo(e,t);const o=s.exception?.values?.[0];if(r&&n&&o&&!o.stacktrace){const t=Bo(e,n);t.length&&(o.stacktrace={frames:t},bt(s,{synthetic:!0}))}}else{const t=o.name||(Me(o)?"DOMError":"DOMException"),i=o.message?`${t}: ${o.message}`:t;s=Jo(e,i,n,r),vt(s,i)}return"code"in o&&(s.tags={...s.tags,"DOMException.code":`${o.code}`}),s}return je(t)?qo(e,t):ze(t)||Ye(t)?(s=Mo(e,t,n,o),bt(s,{synthetic:!0}),s):(s=Jo(e,t,n,r),vt(s,`${t}`,void 0),bt(s,{synthetic:!0}),s)}function Jo(e,t,n,r){const o={};if(r&&n){const r=Bo(e,n);r.length&&(o.exception={values:[{value:t,stacktrace:{frames:r}}]}),bt(o,{synthetic:!0})}if(Be(t)){const{__sentry_template_string__:e,__sentry_template_values__:n}=t;return o.logentry={message:e,params:n},o}return o.message=t,o}function Ko(e,{isUnhandledRejection:t}){const n=function(e){const t=Object.keys(Ze(e));return t.sort(),t[0]?t.join(", "):"[object has no keys]"}(e),r=t?"promise rejection":"exception";return Ie(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:Ye(e)?`Event \`${function(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}var Vo=class extends Br{constructor(e){const t=(n=e,{release:"string"==typeof __SENTRY_RELEASE__?__SENTRY_RELEASE__:$o.SENTRY_RELEASE?.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...n});var n;!function(e,t,n=[t],r="npm"){const o=(e._metadata=e._metadata||{}).sdk=e._metadata.sdk||{};o.name||(o.name=`sentry.javascript.${t}`,o.packages=n.map(e=>({name:`${r}:@sentry/${e}`,version:ae})),o.version=ae)}(t,"browser",["browser"],$o.SENTRY_SDK_SOURCE||"npm"),super(t);const{userInfo:r}=this.getDataCollectionOptions();t._metadata?.sdk&&(t._metadata.sdk.settings={infer_ip:r?"auto":"never",...t._metadata.sdk.settings});const{sendClientReports:o}=this._options;$o.document&&$o.document.addEventListener("visibilitychange",()=>{"hidden"===$o.document.visibilityState&&(o&&this._flushOutcomes(),queueMicrotask(()=>{this.flush()}))}),r&&this.on("beforeSendSession",Gr)}eventFromException(e,t){return function(e,t,n,r){const o=Wo(e,t,n?.syntheticException||void 0,r);return bt(o),o.level="error",n?.event_id&&(o.event_id=n.event_id),Hn(o)}(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t="info",n){return function(e,t,n="info",r,o){const s=Jo(e,t,r?.syntheticException||void 0,o);return s.level=n,r?.event_id&&(s.event_id=r.event_id),Hn(s)}(this._options.stackParser,e,t,n,this._options.attachStacktrace)}_prepareEvent(e,t,n,r){return e.platform=e.platform||"javascript",super._prepareEvent(e,t,n,r)}};var Xo="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,Go=ie;function Qo(e,t,n){Go.document&&Go.addEventListener(e,t,n)}function Zo(e,t,n){Go.document&&Go.removeEventListener(e,t,n)}var es={};try{"undefined"!=typeof Node&&(es.parentNode=Object.getOwnPropertyDescriptor(Node.prototype,"parentNode").get),"undefined"!=typeof Element&&(es.tagName=Object.getOwnPropertyDescriptor(Element.prototype,"tagName").get,es.id=Object.getOwnPropertyDescriptor(Element.prototype,"id").get,es.className=Object.getOwnPropertyDescriptor(Element.prototype,"className").get,es.getAttribute=Element.prototype.getAttribute),"undefined"!=typeof HTMLElement&&(es.dataset=Object.getOwnPropertyDescriptor(HTMLElement.prototype,"dataset").get)}catch{}function ts(e,t,n){const r=es[t];if(r)try{return r.call(e,n)}catch{}const o=e[t];return"function"==typeof o?o.call(e,n):o}function ns(e,t={}){if(!e)return"<unknown>";try{let n=e;const r=5,o=[];let s=0,i=0;const a=" > ",c=3;let u;const l=Array.isArray(t)?t:t.keyAttrs,d=!Array.isArray(t)&&t.maxStringLength||80;for(;n&&s++<r&&(u=rs(n,l),!("html"===u||s>1&&i+o.length*c+u.length>=d));)o.push(u),i+=u.length,n=ts(n,"parentNode");return o.reverse().join(a)}catch{return"<unknown>"}}function rs(e,t){const n=[],r=ts(e,"tagName");if(!r)return"";if("undefined"!=typeof HTMLElement&&e instanceof HTMLElement){const t=ts(e,"dataset");if(t){if(t.sentryComponent)return t.sentryComponent;if(t.sentryElement)return t.sentryElement}}n.push(r.toLowerCase());const o=t?.length?t.filter(t=>ts(e,"getAttribute",t)).map(t=>[t,ts(e,"getAttribute",t)]):null;if(o?.length)o.forEach(e=>{n.push(`[${e[0]}="${e[1]}"]`)});else{const t=ts(e,"id");t&&n.push(`#${t}`);const r=ts(e,"className");if(r&&qe(r)){const e=r.split(/\s+/);for(const t of e)n.push(`.${t}`)}}for(const s of["aria-label","type","name","title","alt"]){const t=ts(e,"getAttribute",s);t&&n.push(`[${s}="${t}"]`)}return n.join("")}var os,ss,is,as;function cs(){if(!Go.document)return;const e=Re.bind(null,"dom"),t=us(e,!0);Go.document.addEventListener("click",t,!1),Go.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(t=>{const n=Go[t]?.prototype;n?.hasOwnProperty?.("addEventListener")&&(Ve(n,"addEventListener",function(t){return function(n,r,o){if("click"===n||"keypress"==n)try{const r=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},s=r[n]=r[n]||{refCount:0};if(!s.handler){const r=us(e);s.handler=r,t.call(this,n,r,o)}s.refCount++}catch{}return t.call(this,n,r,o)}}),Ve(n,"removeEventListener",function(e){return function(t,n,r){if("click"===t||"keypress"==t)try{const n=this.__sentry_instrumentation_handlers__||{},o=n[t];o&&(o.refCount--,o.refCount<=0&&(e.call(this,t,o.handler,r),o.handler=void 0,delete n[t]),0===Object.keys(n).length&&delete this.__sentry_instrumentation_handlers__)}catch{}return e.call(this,t,n,r)}}))})}function us(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;const r=function(e){try{return e.target}catch{return null}}(n);if(function(e,t){return"keypress"===e&&(!t?.tagName||"INPUT"!==t.tagName&&"TEXTAREA"!==t.tagName&&!t.isContentEditable)}(n.type,r))return;Xe(n,"_sentryCaptured",!0),r&&!r._sentryId&&Xe(r,"_sentryId",gt());const o="keypress"===n.type?"input":n.type;(function(e){if(e.type!==ss)return!1;try{if(!e.target||e.target._sentryId!==is)return!1}catch{}return!0})(n)||(e({event:n,name:o,global:t}),ss=n.type,is=r?r._sentryId:void 0),clearTimeout(os),os=Go.setTimeout(()=>{is=void 0,ss=void 0},1e3)}}function ls(e){const t="history";Te(t,e),Ne(t,ds)}function ds(){function e(e){return function(...t){const n=t.length>2?t[2]:void 0;if(n){const r=as,o=function(e){try{return new URL(e,Go.location.origin).toString()}catch{return e}}(String(n));if(as=o,r===o)return e.apply(this,t);Re("history",{from:r,to:o})}return e.apply(this,t)}}Go.addEventListener("popstate",()=>{const e=Go.location.href,t=as;as=e,t!==e&&Re("history",{from:t,to:e})}),"history"in So&&So.history&&(Ve(Go.history,"pushState",e),Ve(Go.history,"replaceState",e))}var hs={};var ps="__sentry_xhr_v3__";function fs(){if(!Go.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(e,t,n){const r=/* @__PURE__ */new Error,o=1e3*St(),s=qe(n[0])?n[0].toUpperCase():void 0,i=function(e){if(qe(e))return e;try{return e.toString()}catch{}}(n[1]);if(!s||!i)return e.apply(t,n);t[ps]={method:s,url:i,request_headers:{}},"POST"===s&&i.match(/sentry_key/)&&(t.__sentry_own_request__=!0);const a=()=>{const e=t[ps];if(e&&4===t.readyState){try{e.status_code=t.status}catch{}Re("xhr",{endTimestamp:1e3*St(),startTimestamp:o,xhr:t,virtualError:r}),t.removeEventListener("readystatechange",a)}};return"onreadystatechange"in t&&"function"==typeof t.onreadystatechange?t.onreadystatechange=new Proxy(t.onreadystatechange,{apply:(e,t,n)=>(a(),e.apply(t,n))}):t.addEventListener("readystatechange",a),t.setRequestHeader=new Proxy(t.setRequestHeader,{apply(e,t,n){const[r,o]=n,s=t[ps];return s&&qe(r)&&qe(o)&&(s.request_headers[r.toLowerCase()]=o),e.apply(t,n)}}),e.apply(t,n)}}),e.send=new Proxy(e.send,{apply(e,t,n){const r=t[ps];if(!r)return e.apply(t,n);void 0!==n[0]&&(r.body=n[0]);return Re("xhr",{startTimestamp:1e3*St(),xhr:t}),e.apply(t,n)}})}function ms(e,t=function(e){const t=hs[e];if(t)return t;let n=Go[e];if(Co(n))return hs[e]=n.bind(Go);const r=Go.document;if(r&&"function"==typeof r.createElement)try{const t=r.createElement("iframe");t.hidden=!0,r.head.appendChild(t);const o=t.contentWindow;o?.[e]&&(n=o[e]),r.head.removeChild(t)}catch(tl){Xo&&_e.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,tl)}return n?hs[e]=n.bind(Go):n}("fetch")){let n=0,r=0;return Tr(e,async function(o){const s=o.body.length;n+=s,r++;const i={body:o.body,method:"POST",referrerPolicy:"strict-origin",headers:e.headers,keepalive:n<=6e4&&r<15,...e.fetchOptions};try{const n=await t(e.url,i);return{statusCode:n.status,headers:{"x-sentry-rate-limits":n.headers.get("X-Sentry-Rate-Limits"),"retry-after":n.headers.get("Retry-After")}}}catch(tl){throw hs["fetch"]=void 0,tl}finally{n-=s,r--}},Cr(e.bufferSize||40))}var gs="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__;function _s(e,t,n,r){const o={filename:e,function:"<anonymous>"===t?"?":t,in_app:!0};return void 0!==n&&(o.lineno=n),void 0!==r&&(o.colno=r),o}var ys=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,vs=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,bs=/\((\S*)(?::(\d+))(?::(\d+))\)/,ws=/at (.+?) ?\(data:(.+?),/,xs=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,ks=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Ss=be(...[[30,e=>{const t=e.match(ws);if(t)return{filename:`<data:${t[2]}>`,function:t[1]};const n=ys.exec(e);if(n){const[,e,t,r]=n;return _s(e,"?",+t,+r)}const r=vs.exec(e);if(r){if(0===r[2]?.indexOf("eval")){const e=bs.exec(r[2]);e&&(r[2]=e[1],r[3]=e[2],r[4]=e[3])}const[e,t]=Cs(r[1]||"?",r[2]);return _s(t,e,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}}],[50,e=>{const t=xs.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const e=ks.exec(t[3]);e&&(t[1]=t[1]||"eval",t[3]=e[1],t[4]=e[2],t[5]="")}let e=t[3],n=t[1]||"?";return[n,e]=Cs(n,e),_s(e,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}]]),Cs=(e,t)=>{const n=-1!==e.indexOf("safari-extension"),r=-1!==e.indexOf("safari-web-extension");return n||r?[-1!==e.indexOf("@")?e.split("@")[0]:"?",n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},Es=1024,Ts=(e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:"Breadcrumbs",setup(e){var n;t.console&&function(e){const t="console",n=Te(t,e);Ne(t,go)}(function(e){return function(t){if(Kt()!==e)return;const n={category:"console",data:{arguments:t.args,logger:"console"},level:_o(t.level),message:pt(t.args," ")};if("assert"===t.level){if(!1!==t.args[0])return;n.message=`Assertion failed: ${pt(t.args.slice(1)," ")||"console.assert"}`,n.data.arguments=t.args.slice(1)}Zr(n,{input:t.args,level:t.level})}}(e)),t.dom&&(n=function(e,t){return function(n){if(Kt()!==e)return;let r,o,s="object"==typeof t?t.serializeAttribute:void 0,i="object"==typeof t&&"number"==typeof t.maxStringLength?t.maxStringLength:void 0;i&&i>Es&&(gs&&_e.warn(`\`dom.maxStringLength\` cannot exceed 1024, but a value of ${i} was configured. Sentry will use 1024 instead.`),i=Es),"string"==typeof s&&(s=[s]);try{const e=n.event,t=function(e){return!!e&&!!e.target}(e)?e.target:e;r=ns(t,{keyAttrs:s,maxStringLength:i}),o=function(e,t=5){if(!Do.HTMLElement)return null;let n=e;for(let r=0;r<t;r++){if(!n)return null;if(n instanceof HTMLElement){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}n=n.parentNode}return null}(t)}catch{r="<unknown>"}if(0===r.length)return;const a={category:`ui.${n.name}`,message:r};o&&(a.data={"ui.component_name":o}),Zr(a,{event:n.event,name:n.name,global:n.global})}}(e,t.dom),Te("dom",n),Ne("dom",cs)),t.xhr&&function(e){Te("xhr",e),Ne("xhr",fs)}(function(e){return function(t){if(Kt()!==e)return;const{startTimestamp:n,endTimestamp:r}=t,o=t.xhr[ps];if(!n||!r||!o)return;const{method:s,url:i,status_code:a,body:c}=o,u={method:s,url:i,status_code:a},l={xhr:t.xhr,input:c,startTimestamp:n,endTimestamp:r},d={category:"xhr",data:u,type:"http",level:ko(a)};e.emit("beforeOutgoingRequestBreadcrumb",d,l),Zr(d,l)}}(e)),t.fetch&&To(function(e){return function(t){if(Kt()!==e)return;const{startTimestamp:n,endTimestamp:r}=t;if(r&&(!t.fetchData.url.match(/sentry_key/)||"POST"!==t.fetchData.method))if(t.error){const o={data:t.error,input:t.args,startTimestamp:n,endTimestamp:r},s={category:"fetch",data:t.fetchData,level:"error",type:"http"};e.emit("beforeOutgoingRequestBreadcrumb",s,o),Zr(s,o)}else{const o=t.response,s={...t.fetchData,status_code:o?.status},i={input:t.args,response:o,startTimestamp:n,endTimestamp:r},a={category:"fetch",data:s,type:"http",level:ko(s.status_code)};e.emit("beforeOutgoingRequestBreadcrumb",a,i),Zr(a,i)}}}(e)),t.history&&ls(function(e){return function(t){if(Kt()!==e)return;let n=t.from,r=t.to;const o=Xr($o.location.href);let s=n?Xr(n):void 0;const i=Xr(r);s?.path||(s=o),o.protocol===i.protocol&&o.host===i.host&&(r=i.relative),o.protocol===s.protocol&&o.host===s.host&&(n=s.relative),Zr({category:"navigation",data:{from:n,to:r}})}}(e)),t.sentry&&e.on("beforeSendEvent",function(e){return function(t){Kt()===e&&Zr({category:"sentry."+("transaction"===t.type?"transaction":"event"),event_id:t.event_id,level:t.level,message:yt(t)},{event:t})}}(e))}}};var Ns="EventTarget,Window,Node,ApplicationCache,AudioTrackList,BroadcastChannel,ChannelMergerNode,CryptoOperation,EventSource,FileReader,HTMLUnknownElement,IDBDatabase,IDBRequest,IDBTransaction,KeyOperation,MediaController,MessagePort,ModalWindow,Notification,SVGElementInstance,Screen,SharedWorker,TextTrack,TextTrackCue,TextTrackList,WebSocket,WebSocketWorker,Worker,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload".split(","),Rs=(e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:"BrowserApiErrors",setupOnce(){t.setTimeout&&Ve($o,"setTimeout",As),t.setInterval&&Ve($o,"setInterval",As),t.requestAnimationFrame&&Ve($o,"requestAnimationFrame",Ds),t.XMLHttpRequest&&"XMLHttpRequest"in $o&&Ve(XMLHttpRequest.prototype,"send",Ps);const e=t.eventTarget;e&&(Array.isArray(e)?e:Ns).forEach(e=>function(e,t){const n=$o[e]?.prototype;if(!n?.hasOwnProperty?.("addEventListener"))return;Ve(n,"addEventListener",function(n){return function(r,o,s){try{"function"==typeof o.handleEvent&&(o.handleEvent=jo(o.handleEvent,{mechanism:{data:{handler:ke(o),target:e},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return t.unregisterOriginalCallbacks&&function(e,t,n){e&&"object"==typeof e&&"removeEventListener"in e&&"function"==typeof e.removeEventListener&&e.removeEventListener(t,n)}(this,r,o),n.apply(this,[r,jo(o,{mechanism:{data:{handler:ke(o),target:e},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),s])}}),Ve(n,"removeEventListener",function(e){return function(t,n,r){try{if(Object.prototype.hasOwnProperty.call(n,"__sentry_wrapped__")){const o=n.__sentry_wrapped__;o&&e.call(this,t,o,r)}}catch{}return e.call(this,t,n,r)}})}(e,t))}}};function As(e){return function(...t){const n=t[0];return t[0]=jo(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${ke(e)}`}}),e.apply(this,t)}}function Ds(e){return function(t){return e.apply(this,[jo(t,{mechanism:{data:{handler:ke(e)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function Ps(e){return function(...t){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(e=>{e in n&&"function"==typeof n[e]&&Ve(n,e,function(t){const n={mechanism:{data:{handler:ke(t)},handled:!1,type:`auto.browser.browserapierrors.xhr.${e}`}},r=Qe(t);return r&&(n.mechanism.data.handler=ke(r)),jo(t,n)})}),e.apply(this,t)}}var $s=(e={})=>{const t=e.lifecycle??"route";return{name:"BrowserSession",setupOnce(){if(void 0===$o.document)return void(gs&&_e.warn("Using the `browserSessionIntegration` in non-browser environments is not supported."));sr({ignoreDuration:!0});let e=!1;(e=>{const t=Go.requestIdleCallback||Go.setTimeout;"hidden"===Go.document?.visibilityState?e():(Qo("visibilitychange",e=(e=>{let t=!1;return()=>{t||(e(),t=!0)}})(e),{once:!0,capture:!0}),Qo("pagehide",e,{once:!0,capture:!0}),t(()=>{e(),Zo("visibilitychange",e,{capture:!0}),Zo("pagehide",e,{capture:!0})}))})(()=>{e||(cr(),e=!0)});const n=Jt();let r=n.getUser();n.addScopeListener(t=>{const n=t.getUser();r?.id===n?.id&&r?.ip_address===n?.ip_address||(r=n,e&&cr())}),"route"===t&&ls(({from:t,to:n})=>{t!==n&&(sr({ignoreDuration:!0}),cr(),e=!0)})}}},Ls=()=>({name:"CultureContext",preprocessEvent(e){const t=Us();t&&(e.contexts={...e.contexts,culture:{...t,...e.contexts?.culture}})},processSegmentSpan(e){const t=Us();t&&zn(e,{"culture.locale":t.locale,"culture.timezone":t.timezone,"culture.calendar":t.calendar})}});function Us(){try{const e=$o.Intl;if(!e)return;const t=e.DateTimeFormat().resolvedOptions();return{locale:t.locale,timezone:t.timeZone,calendar:t.calendar}}catch{return}}var js=(e={})=>{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:"GlobalHandlers",setupOnce(){Error.stackTraceLimit=50},setup(e){t.onerror&&(!function(e){!function(e){const t="error";Te(t,e),Ne(t,De)}(t=>{const{stackParser:n,attachStacktrace:r}=Is();if(Kt()!==e||Uo())return;const{msg:o,url:s,line:i,column:a,error:c}=t,u=function(e,t,n,r){const o=e.exception=e.exception||{},s=o.values=o.values||[],i=s[0]=s[0]||{},a=i.stacktrace=i.stacktrace||{},c=a.frames=a.frames||[];0===c.length&&c.push({colno:r,lineno:n,filename:Ms(t)??Po(),function:"?",in_app:!0});return e}(Wo(n,c||o,void 0,r,!1),s,i,a);u.level="error",rr(u,{originalException:c,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})})}(e),Os("onerror")),t.onunhandledrejection&&(!function(e){!function(e){const t="unhandledrejection";Te(t,e),Ne(t,$e)}(t=>{const{stackParser:n,attachStacktrace:r}=Is();if(Kt()!==e||Uo())return;const o=function(e){if(Fe(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}(t),s=Fe(o)?{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(o)}`}]}}:Wo(n,o,void 0,r,!0);s.level="error",rr(s,{originalException:o,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}(e),Os("onunhandledrejection"))}}};function Os(e){gs&&_e.log(`Global Handler attached: ${e}`)}function Is(){return Kt()?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}function Ms(e){if(qe(e)&&0!==e.length)return e.startsWith("data:")?`<${function(e,t=!0){if(e.startsWith("data:")){const n=e.match(/^data:([^;,]+)/),r=n?n[1]:"text/plain",o=e.includes(";base64,"),s=e.indexOf(",");let i="";if(t&&-1!==s){const t=e.slice(s+1);i=t.length>10?`${t.slice(0,10)}... [truncated]`:t}return`data:${r}${o?",base64":""}${i?`,${i}`:""}`}return e}(e,!1)}>`:e}var qs=()=>({name:"HttpContext",preprocessEvent(e){if(!$o.navigator&&!$o.location&&!$o.document)return;const t=Oo(),n={...t.headers,...e.request?.headers};e.request={...t,...e.request,headers:n}},processSegmentSpan(e){const t=e.attributes?.[Xt];if(!$o.navigator&&!$o.location&&!$o.document)return;const n=Oo();zn(e,{[Fn]:"http.client"!==t?n.url:void 0,"http.request.header.user_agent":n.headers["User-Agent"],"http.request.header.referer":n.headers.Referer})}}),Bs=(e={})=>{const t=e.limit||5,n=e.key||"cause";return{name:"LinkedErrors",preprocessEvent(e,r,o){ao(Io,o.getOptions().stackParser,n,t,e,r)}}},Fs=/^HTML(\w*)Element$/;function zs(e){if("undefined"!=typeof window&&e===window)return"[Window]";if("undefined"!=typeof document&&e===document)return"[Document]";if(function(e){if("undefined"==typeof Element)return!1;try{return e instanceof Element}catch{return!1}}(e)){const t=function(e){const t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:"null prototype"}(e);if(Fs.test(t))return`[HTMLElement: ${ns(e)}]`}}function Hs(){return!!function(){if(void 0===$o.window)return!1;const e=$o;if(e.nw)return!1;if(!(e.chrome||e.browser)?.runtime?.id)return!1;const t=Po();return!($o===$o.top&&/^(?:chrome-extension|moz-extension|ms-browser-extension|safari-web-extension):\/\//.test(t))}()&&(gs&&pe(()=>{}),!0)}function Ys(e={}){const t=!e.skipBrowserExtensionCheck&&Hs();let n=null==e.defaultIntegrations?[oo(),to(),xo(),Rs(),Ts(),js(),Bs(),yo(),qs(),Ls(),$s()]:e.defaultIntegrations;const r={...e,enabled:!t&&e.enabled,stackParser:(o=e.stackParser||Ss,Array.isArray(o)?be(...o):o),integrations:hr({integrations:e.integrations,defaultIntegrations:n}),transport:e.transport||ms};var o;return ot=zs,Vr(Vo,r)}function Ws(e){const t="undefined"!=typeof window?window.location.href:void 0;or("portal_code",e.portalCode),or("object_code",e.objectCode??""),or("locale",e.locale??""),function(e,t){Jt().setContext(e,t)}("bukazu",{portal_code:e.portalCode,object_code:e.objectCode??null,locale:e.locale??null,url:t??null})}function Js(e){nr(e)}function Ks(e){!function(e,t){const n="string"==typeof t?t:void 0,r="string"!=typeof t?{captureContext:t}:void 0;Wt().captureMessage(e,n,r)}(e,"error")}var Vs=/* @__PURE__ */new WeakSet;function Xs(e){return function(e){return"messages"in e&&Array.isArray(e.messages)&&e.messages.every(e=>"string"==typeof e)}(e)?e.messages:[e.message]}function Gs(e){const t=Xs(e.errors);return"object"!=typeof e.errors||null===e.errors||Vs.has(e.errors)||(Vs.add(e.errors),Js(new Error(t.join("\n")))),/* @__PURE__ */h("div",{className:"bukazu-error-message",children:[/* @__PURE__ */d("h2",{children:Q("something_went_wrong_please_try_again")}),/* @__PURE__ */d("ul",{children:t.map(e=>/* @__PURE__ */d("li",{children:e},e))})]})}var Qs=["en","nl","de","fr","es","it"];function Zs(e){if(!e)return"en";const t=e.split(/[-_]/)[0].toLowerCase();return function(e){return Qs.includes(e)}(t)?t:"en"}var ei=e=>"[object Object]"===Object.prototype.toString.call(e),ti=n({locale:"nl",portalCode:"",objectCode:"",apiUrl:"https://api.bukazu.com"}),ni="bukazuCurrency";function ri(e){const t="string"==typeof e?.default&&""!==e.default?e.default:"EUR",n=Array.isArray(e?.allowed)?e.allowed.filter(e=>"string"==typeof e&&""!==e):[];return{multi_currency:e?.multi_currency??!1,default:t,allowed:[.../* @__PURE__ */new Set([...n,t])]}}var oi=n({currency:void 0,setCurrency:()=>{},allowed:[],multiCurrency:!1});function si({currencies:e,children:t}){const n=i(()=>ri(e),[e]),[o,s]=u(()=>{const e=function(){try{return window.localStorage.getItem(ni)}catch{return null}}();return e&&n.allowed.includes(e)?e:n.default}),a=r(e=>{n.allowed.includes(e)&&(!function(e){try{window.localStorage.setItem(ni,e)}catch{}}(e),s(e))},[n]),c=n.multi_currency&&n.allowed.length>1,l=i(()=>({currency:c?o:void 0,setCurrency:a,allowed:n.allowed,multiCurrency:c}),[c,n.allowed,o,a]);/* @__PURE__ */
25
- return d(oi.Provider,{value:l,children:t})}function ii(){return o(oi)}function ai(){const{currency:e,setCurrency:t,allowed:n,multiCurrency:r}=ii();return!r||n.length<=1?null:/* @__PURE__ */h("div",{className:"bu-currency-selector",children:[/* @__PURE__ */d("label",{htmlFor:"bu-currency",children:Q("currency")}),/* @__PURE__ */d("select",{id:"bu-currency",value:e,onChange:e=>{t(e.target.value)},children:n.map(e=>/* @__PURE__ */d("option",{value:e,children:e},e))})]})}var ci=class extends Error{name="KyError";get isKyError(){return!0}},ui=class extends ci{name="HTTPError";response;request;options;data;constructor(e,t,n){const r=`${e.status||0===e.status?e.status:""} ${e.statusText??""}`.trim();super(`Request failed with ${r?`status code ${r}`:"an unknown error"}: ${t.method} ${t.url}`),this.response=e,this.request=t,this.options=n}},li=class extends ci{name="NetworkError";request;constructor(e,t){super(`Request failed due to a network error: ${e.method} ${e.url}`,t),this.request=e}},di=class extends Error{name="NonError";value;constructor(e){let t="Non-error value was thrown";try{"string"==typeof e?t=e:e&&"object"==typeof e&&"message"in e&&"string"==typeof e.message&&(t=e.message)}catch{}super(t),this.value=e}},hi=class extends ci{name="ForceRetryError";customDelay;code;customRequest;constructor(e){const t=e?.cause?e.cause instanceof Error?e.cause:new di(e.cause):void 0;super(e?.code?`Forced retry: ${e.code}`:"Forced retry",t?{cause:t}:void 0),this.customDelay=e?.delay,this.code=e?.code,this.customRequest=e?.request}},pi=class extends Error{name="SchemaValidationError";issues;constructor(e){super("Response schema validation failed"),this.issues=e}},fi=class extends ci{name="TimeoutError";request;constructor(e){super(`Request timed out: ${e.method} ${e.url}`),this.request=e}},mi=(()=>{let e=!1,t=!1;const n="function"==typeof globalThis.ReadableStream,r="function"==typeof globalThis.Request;if(n&&r)try{t=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type")}catch(o){if(o instanceof Error&&"unsupported BodyInit type"===o.message)return!1;throw o}return e&&!t})(),gi="function"==typeof globalThis.AbortController,_i="function"==typeof globalThis.AbortSignal&&"function"==typeof globalThis.AbortSignal.any,yi="function"==typeof globalThis.ReadableStream,vi="function"==typeof globalThis.FormData,bi=["get","post","put","patch","head","delete","query"],wi={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},xi=2147483647,ki=Symbol("stop"),Si=class{options;constructor(e){this.options=e}},Ci=e=>new Si(e),Ei={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,baseUrl:!0,prefix:!0,retry:!0,timeout:!0,totalTimeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},Ti={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,duplex:!0},Ni=new TextEncoder,Ri=(e,t,n)=>{let r,o=0;return e.pipeThrough(new TransformStream({transform(e,s){if(s.enqueue(e),r){o+=r.byteLength;let e=0===t?0:o/t;e>=1&&(e=1-Number.EPSILON),n?.({percent:e,totalBytes:Math.max(t,o),transferredBytes:o},r)}r=e},flush(){const e=r??/* @__PURE__ */new Uint8Array;o+=e.byteLength,n?.({percent:1,totalBytes:Math.max(t,o),transferredBytes:o},e)}}))},Ai=(e,t,n)=>{if(!e.body)return e;const r=(e=>{if(!e)return 0;if(e instanceof FormData){let t=0;for(const[n,r]of e)t+=40,t+=Ni.encode(`Content-Disposition: form-data; name="${n}"`).byteLength,t+="string"==typeof r?Ni.encode(r).byteLength:r.size;return t}return e instanceof Blob?e.size:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:"string"==typeof e?Ni.encode(e).byteLength:e instanceof URLSearchParams?Ni.encode(e.toString()).byteLength:0})(n??e.body);return new Request(e,{duplex:"half",body:Ri(e.body,r,t)})},Di=e=>null!==e&&"object"==typeof e,Pi=Symbol("replaceOption"),$i=e=>Di(e)&&!0===e[Pi]?{isReplace:!0,value:e.value}:{isReplace:!1,value:e},Li=(...e)=>{for(const t of e)if((!Di(t)||Array.isArray(t))&&void 0!==t)throw new TypeError("The `options` argument must be an object");return Hi({},...e)},Ui=(e={},t={})=>{const n=new globalThis.Headers(e),r=t instanceof globalThis.Headers,o=new globalThis.Headers(t);for(const[s,i]of o.entries())r&&"undefined"===i||void 0===i?n.delete(s):n.set(s,i);return n},ji=e=>{if(!Di(e)||Array.isArray(e))return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||null===t},Oi=e=>{if(e instanceof URLSearchParams){const t=new URLSearchParams(e),n=e[Bi];return n&&(t[Bi]=new Set(n)),t}return e instanceof globalThis.Headers?new globalThis.Headers(e):Array.isArray(e)?[...e]:ji(e)?{...e}:e},Ii=(e,t)=>{return ji(e)&&ji(t)?(n={...e,...t},Object.fromEntries(Object.entries(n).filter(e=>void 0!==e[1]))):Ui(e,t);var n};function Mi(e,t,n){return Object.hasOwn(t,n)&&void 0===t[n]?[]:Hi(e[n]??[],t[n]??[])}var qi=(e={},t={})=>({init:Mi(e,t,"init"),beforeRequest:Mi(e,t,"beforeRequest"),beforeRetry:Mi(e,t,"beforeRetry"),beforeError:Mi(e,t,"beforeError"),afterResponse:Mi(e,t,"afterResponse")}),Bi=Symbol("deletedParameters"),Fi=(e,t)=>{const n=new URLSearchParams,r=/* @__PURE__ */new Set;for(const o of[e,t])if(void 0!==o)if(o instanceof URLSearchParams){for(const[t,s]of o.entries())n.append(t,s),r.delete(t);const e=o[Bi];if(e)for(const t of e)n.delete(t),r.add(t)}else if(Array.isArray(o))for(const e of o){if(!Array.isArray(e)||2!==e.length)throw new TypeError("Array search parameters must be provided in [[key, value], ...] format");n.append(String(e[0]),String(e[1])),r.delete(String(e[0]))}else if(Di(o))for(const[e,t]of Object.entries(o))void 0===t?(n.delete(e),r.add(e)):(n.append(e,String(t)),r.delete(e));else{const e=new URLSearchParams(o);for(const[t,o]of e.entries())n.append(t,o),r.delete(t)}return r.size>0&&(n[Bi]=r),n},zi=(e,...t)=>{let n,r={},o={},s={};const i=[];for(const a of t)if(Array.isArray(a))Array.isArray(r)||(r=[]),r=[...r,...a];else if(Di(a)){for(let[t,o]of Object.entries(a)){const s=$i(o),{isReplace:a}=s;o=s.value;const c=e&&"signal"===t;if(c&&(a||void 0===o)&&(i.length=0),c&&o instanceof globalThis.AbortSignal)i.push(o);else if("context"!==t)"searchParams"!==t?(e&&"retry"===t&&Di(o)&&!a&&"number"==typeof r[t]&&(r={...r,[t]:{limit:r[t]}}),Di(o)&&!a&&t in r&&(o=zi(!1,r[t],o)),r={...r,[t]:o}):n=null==o?void 0:a||void 0===n?o:Fi(n,o);else{if(null!=o&&(!Di(o)||Array.isArray(o)))throw new TypeError("The `context` option must be an object");r={...r,context:null==o?{}:a?{...o}:{...r.context,...o}}}}if(Di(a.hooks)){const{value:e,isReplace:t}=$i(a.hooks);s=qi(t?{}:s,e),r.hooks=s}if(Di(a.headers)){const{value:e,isReplace:t}=$i(a.headers);o=t?Oi(e):Ii(o,e),r.headers=o}}return void 0!==n&&(r.searchParams=n),i.length>0&&(1===i.length?r.signal=i[0]:r.signal=_i?AbortSignal.any(i):i.at(-1)),r},Hi=(...e)=>zi(!0,...e),Yi=e=>bi.includes(e)?e.toUpperCase():e,Wi={limit:2,methods:["get","put","head","delete","options","trace","query"],statusCodes:[408,413,429,500,502,503,504],afterStatusCodes:[413,429,503],maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:e=>.3*2**(e-1)*1e3,jitter:void 0,retryOnTimeout:!1},Ji=()=>({...Wi,methods:[...Wi.methods],statusCodes:[...Wi.statusCodes],afterStatusCodes:[...Wi.afterStatusCodes]}),Ki=e=>{if(void 0===e)return Wi.limit;if("number"!=typeof e||!Number.isInteger(e)||e<0)throw new TypeError("`retry.limit` must be a finite, non-negative integer");return e},Vi=(e={})=>{if("number"==typeof e)return{...Ji(),limit:Ki(e)};if(null===e||"object"!=typeof e||Array.isArray(e))throw new TypeError("`retry` must be a number or an object");const t=Object.fromEntries(Object.entries(e).filter(([,e])=>void 0!==e)),n=Ki(t.limit);if(void 0!==t.methods&&!Array.isArray(t.methods))throw new Error("retry.methods must be an array");if(void 0!==t.statusCodes&&!Array.isArray(t.statusCodes))throw new Error("retry.statusCodes must be an array");if(void 0!==t.afterStatusCodes&&!Array.isArray(t.afterStatusCodes))throw new Error("retry.afterStatusCodes must be an array");return void 0!==t.methods&&(t.methods=t.methods.map(e=>e.toLowerCase())),void 0!==t.statusCodes&&(t.statusCodes=[...t.statusCodes]),void 0!==t.afterStatusCodes&&(t.afterStatusCodes=[...t.afterStatusCodes]),{...Ji(),...t,limit:n}};async function Xi(e,{signal:t}){return new Promise((n,r)=>{function o(){clearTimeout(s),r(t.reason)}t&&(t.throwIfAborted(),t.addEventListener("abort",o,{once:!0}));const s=setTimeout(()=>{t?.removeEventListener("abort",o),n()},e)})}var Gi=Object.prototype.toString,Qi=/* @__PURE__ */new Set(["network error","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed","fetch failed","terminated"," A network error occurred.","Network connection lost"]);function Zi(e){if(!e||(t=e,"[object Error]"!==Gi.call(t))||"TypeError"!==e.name||"string"!=typeof e.message)return!1;var t;const{message:n,stack:r}=e;return"Load failed"===n||n.startsWith("Load failed (")&&n.endsWith(")")?void 0===r||"__sentry_captured__"in e:!!n.startsWith("error sending request for url")||(!!("Failed to fetch"===n||n.startsWith("Failed to fetch (")&&n.endsWith(")"))||Qi.has(n))}var ea=(e,t)=>e instanceof t||e?.name===t.name;var ta=Date.parse("2024-01-01"),na=/^\d+$/,ra=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],oa=/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{2}):(\d{2}):(\d{2}) GMT$/,sa=/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{2}):(\d{2}):(\d{2}) GMT$/,ia=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{2}| \d) (\d{2}:\d{2}:\d{2}) (\d{4})$/,aa=({year:e,month:t,day:n,hours:r,minutes:o,seconds:s})=>{const i=ra.indexOf(t),a=Number(n),c=Number(r),u=Number(o),l=Number(s);if(-1===i||c>23||u>59||l>60)return;const d=Math.min(l,59),h=new Date(Date.UTC(e,i,a,c,u,d));h.setUTCFullYear(e);const p=h.getTime();return h.getUTCFullYear()===e&&h.getUTCMonth()===i&&h.getUTCDate()===a&&h.getUTCHours()===c&&h.getUTCMinutes()===u&&h.getUTCSeconds()===d?60===l?p+1e3:p:void 0},ca=(e,t)=>e[t],ua=({value:e,allowTimestamp:t})=>{if(na.test(e)){let n=1e3*Number(e);return t&&n>=ta&&(n-=Date.now()),Math.max(0,n)}const n=(e=>{const t=oa.exec(e);if(t)return aa({year:Number(ca(t,3)),month:ca(t,2),day:ca(t,1),hours:ca(t,4),minutes:ca(t,5),seconds:ca(t,6)});const n=sa.exec(e);if(n){const e=/* @__PURE__ */new Date,t=Number(ca(n,3)),r=100*Math.floor(e.getUTCFullYear()/100)+t,o=Date.UTC(e.getUTCFullYear()+50,e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());let s;for(const i of[r-100,r,r+100]){const e=aa({year:i,month:ca(n,2),day:ca(n,1),hours:ca(n,4),minutes:ca(n,5),seconds:ca(n,6)});void 0!==e&&e<=o&&(s=e)}return s}const r=ia.exec(e);if(r){const[e,t,n]=ca(r,4).split(":");return aa({year:Number(ca(r,5)),month:ca(r,2),day:ca(r,3).trim(),hours:e,minutes:t,seconds:n})}})(e);if(void 0===n)return;const r=n-Date.now();return Number.isFinite(r)?Math.max(0,r):void 0},la=Symbol("timedOutResponseData"),da=Symbol("timedOutOperation"),ha="The `schema` argument must follow the Standard Schema specification",pa=Object.prototype.toString,fa=/^[\0-\u0020]+/g,ma=/[\t\n\r]/g,ga=/^[a-z][\d+.a-z-]*:/i,_a=/^https?:(?!\/\/)/i,ya=e=>e instanceof globalThis.Request||"[object Request]"===pa.call(e),va=e=>e instanceof globalThis.Response||"[object Response]"===pa.call(e);function ba(e){const t={...e,json:Oi(e.json),context:Oi(e.context),headers:Oi(e.headers),searchParams:(n=e.searchParams,Array.isArray(n)?n.map(e=>[...e]):Oi(n))};var n;return void 0!==e.retry&&(t.retry=(e=>{if(null===e||"object"!=typeof e||Array.isArray(e))return e;const t={...e};return Array.isArray(t.methods)&&(t.methods=[...t.methods]),Array.isArray(t.statusCodes)&&(t.statusCodes=[...t.statusCodes]),Array.isArray(t.afterStatusCodes)&&(t.afterStatusCodes=[...t.afterStatusCodes]),t})(e.retry)),t}var wa=async(e,t)=>{if("object"!=typeof t&&"function"!=typeof t||null===t)throw new TypeError(ha);const n=t["~standard"];if("object"!=typeof n||null===n||"function"!=typeof n.validate)throw new TypeError(ha);const r=await n.validate(e);if(r.issues)throw new pi(r.issues);return r.value},xa=class e{static create(t,n){const r=n.hooks?.init??[],o=r.length>0?ba(n):n;for(const e of r)e(o);const s=new e(t,o),i=async()=>{if("number"==typeof s.#e.timeout&&s.#e.timeout>2147483647)throw new RangeError("The `timeout` option cannot be greater than 2147483647");if("number"==typeof s.#e.totalTimeout&&s.#e.totalTimeout>2147483647)throw new RangeError("The `totalTimeout` option cannot be greater than 2147483647");await Promise.resolve();const e=await s.#t();void 0!==e&&(s.#n=Vi(s.#e.retry).limit);let t=e??await s.#r(async()=>s.#o()),n=void 0!==e||s.#s();for(;;){if(void 0===t)return t;if(va(t))try{t=await s.#i(t)}catch(r){if(!(r instanceof hi))throw r;const e=await s.#a(r,async()=>s.#o());if(void 0===e)return e;t=e,n=s.#s();continue}const e=t;if(!e.ok&&"opaque"!==e.type&&("function"==typeof s.#e.throwHttpErrors?s.#e.throwHttpErrors(e.status):s.#e.throwHttpErrors)){const r=new ui(e,s.#c(e),s.#u()),o=r;if(r.data=await s.#l(e),n)throw o;const i=await s.#a(r,async()=>s.#o());if(void 0===i)return i;t=i,n=s.#s();continue}break}if(!va(t))return t;if(s.#d(t),s.#e.onDownloadProgress){if("function"!=typeof s.#e.onDownloadProgress)throw new TypeError("The `onDownloadProgress` option must be a function");if(!yi)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");const e=t.clone();return s.#h(t),((e,t)=>{if(!e.body)return e;const n={status:e.status,statusText:e.statusText,headers:e.headers};if(204===e.status)return new Response(null,n);const r=Math.max(0,Number(e.headers.get("content-length"))||0);return new Response(Ri(e.body,r,t),n)})(e,s.#e.onDownloadProgress)}return t},a=(async()=>{try{return await i()}catch(e){await s.#p(e)}finally{const e=s.#f;s.#m(e?.body??void 0),s.request!==e&&s.#m(s.request.body??void 0)}})();for(const[e,c]of Object.entries(wi))"bytes"===e&&"function"!=typeof globalThis.Response?.prototype?.bytes||(a[e]=async t=>{s.request.headers.set("accept",s.request.headers.get("accept")||c);const n=await a;if("json"!==e)return s.#g(async()=>n[e](),n);const r=await s.#g(async()=>n.text(),n),i=s.#c(n),u=await s.#_(async()=>{const e=o.parseJson?await o.parseJson(r,{request:i,response:n}):""===r&&void 0!==t?void 0:JSON.parse(r);return void 0===t?e:wa(e,t)});return u===da&&await s.#p(new fi(i)),u});return a}static#y(e){return!e||"object"!=typeof e||Array.isArray(e)||e instanceof URLSearchParams?e:Object.fromEntries(Object.entries(e).filter(([,e])=>void 0!==e))}request;#v;#b=0;#n;#w;#e;#f;#x;#k=/* @__PURE__ */new WeakSet;#S;#C;#E=!1;#T=/* @__PURE__ */new WeakMap;constructor(t,n={}){if(this.#w=t,Object.hasOwn(n,"prefixUrl"))throw new Error("The `prefixUrl` option has been renamed `prefix` in v2 and enhanced to allow slashes in input. See also the new `baseUrl` option for improved flexibility with standard URL resolution: https://github.com/sindresorhus/ky#baseurl");if(this.#e={...n,headers:Ui(this.#w.headers,n.headers),hooks:qi({},n.hooks),method:Yi(n.method??this.#w.method??"GET"),prefix:String(n.prefix||""),retry:Vi(n.retry),throwHttpErrors:n.throwHttpErrors??!0,timeout:n.timeout??1e4,totalTimeout:n.totalTimeout??!1,fetch:n.fetch??globalThis.fetch.bind(globalThis),context:n.context??{}},this.#n=this.#e.retry.limit,"string"!=typeof this.#w&&!(this.#w instanceof URL||this.#w instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if("string"==typeof this.#w){if(this.#e.prefix){const e=this.#e.prefix.replace(/\/+$/,""),t=this.#w.replace(/^\/+/,"");this.#w=`${e}/${t}`}if(this.#e.baseUrl){const e=(e=>e.replaceAll(fa,"").replaceAll(ma,""))(this.#w);if(_a.test(e))throw new TypeError("`input` url protocol must be followed by `//` when using `baseUrl`");(e=>ga.test(e))(e)||(this.#w=new URL(this.#w,new Request(this.#e.baseUrl).url))}}gi&&_i&&(this.#x=this.#e.signal??this.#w.signal,this.#v=new globalThis.AbortController,this.#e.signal=this.#N()),mi&&(this.#e.duplex="half"),void 0!==this.#e.json&&(this.#e.body=this.#e.stringifyJson?.(this.#e.json)??JSON.stringify(this.#e.json),this.#e.headers.set("content-type",this.#e.headers.get("content-type")??"application/json"));const r=n.headers&&new globalThis.Headers(n.headers).has("content-type");if(this.#w instanceof globalThis.Request&&(vi&&this.#e.body instanceof globalThis.FormData||this.#e.body instanceof URLSearchParams)&&!r&&this.#e.headers.delete("content-type"),this.request=new globalThis.Request(this.#w,this.#e),void 0!==(o=this.#e.searchParams)&&(Array.isArray(o)?o.length>0:o instanceof URLSearchParams?o.size>0||Boolean(o[Bi]?.size):"object"==typeof o?Object.keys(o).length>0:"string"==typeof o?o.trim().length>0:Boolean(o))){const t=new URL(this.request.url),n=this.#e.searchParams?.[Bi];if(n)for(const e of n)t.searchParams.delete(e);if("string"==typeof this.#e.searchParams){const e=this.#e.searchParams.replace(/^\?/,"");""!==e&&(t.search=t.search?`${t.search}&${e}`:`?${e}`)}else{const n=new URLSearchParams(e.#y(this.#e.searchParams));for(const[e,r]of n.entries())t.searchParams.append(e,r)}if(this.#e.searchParams&&"object"==typeof this.#e.searchParams&&!Array.isArray(this.#e.searchParams)&&!(this.#e.searchParams instanceof URLSearchParams))for(const[e,r]of Object.entries(this.#e.searchParams))void 0===r&&t.searchParams.delete(e);this.request=new globalThis.Request(t,this.#e)}var o;if(this.#e.onUploadProgress&&"function"!=typeof this.#e.onUploadProgress)throw new TypeError("The `onUploadProgress` option must be a function");this.#C="number"==typeof this.#e.totalTimeout?this.#R():void 0}#A(e){const t=e.delay(this.#b+1);let n=t;return!0===e.jitter?n=Math.random()*t:"function"==typeof e.jitter&&(n=e.jitter(t),(!Number.isFinite(n)||n<0)&&(n=t)),Math.min(e.backoffLimit,n)}async#D(e){const t=Vi(this.#e.retry);if(this.#b>=Math.min(t.limit,this.#n))throw e;const n=e instanceof Error?e:new di(e);if(n instanceof hi)return n.customDelay??this.#A(t);if(!t.methods.includes(this.request.method.toLowerCase()))throw e;const{shouldRetry:r}=t;if(void 0!==r){const o=await this.#_(async()=>r({error:n,retryCount:this.#b+1}));if(o===da)throw new fi(this.request);if(!1===o)throw e;if(!0===o)return this.#A(t)}if(function(e){return ea(e,fi)}(e)){if(!t.retryOnTimeout)throw e;return this.#A(t)}if(function(e){return ea(e,ui)}(e)){if(!t.statusCodes.includes(e.response.status))throw e;const n=(e=>{const t=e.get("Retry-After");if(null!==t)return{value:t,allowTimestamp:!1};const n=e.get("RateLimit-Reset");if(null!==n)return{value:n,allowTimestamp:!0};const r=e.get("X-RateLimit-Retry-After");if(null!==r)return{value:r,allowTimestamp:!1};const o=e.get("X-RateLimit-Reset")??e.get("X-Rate-Limit-Reset");return null!==o?{value:o,allowTimestamp:!0}:void 0})(e.response.headers);if(n&&t.afterStatusCodes.includes(e.response.status)){const e=ua(n);return void 0===e?this.#A(t):Math.min(t.maxRetryAfter,e)}if(413===e.response.status)throw e;return this.#A(t)}if(!function(e){return ea(e,li)}(e))throw e;return this.#A(t)}#d(e){const t=this.#c(e);return this.#e.parseJson&&(e.json=async()=>{const n=await e.text();return this.#e.parseJson(n,{request:t,response:e})}),e}async#p(e){if(!(e instanceof Error))throw e;if(this.#k.has(e))throw e;let t=e;for(const n of this.#e.hooks.beforeError){const e=await n({request:this.request,options:this.#u(),error:t,retryCount:this.#b});e instanceof Error&&(t=e)}throw t}async#l(e){const t=this.#P(),n=await this.#$(e,t.milliseconds);if(n===la){if(t.fromTotalTimeout)throw new fi(this.request);return void this.#L()}if(!n)return;if(!this.#U(e.headers.get("content-type")??""))return n;const r=this.#P(),o=await this.#j(n,e,r.milliseconds,this.#c(e));if(o!==la)return o;if(r.fromTotalTimeout)throw new fi(this.request);this.#L()}#P(){const e=!1===this.#e.timeout?1e4:this.#e.timeout,t=this.#O();if(void 0===t)return{milliseconds:e,fromTotalTimeout:!1};if(t<=0)throw new fi(this.request);return{milliseconds:Math.min(e,t),fromTotalTimeout:t<=e}}#I(){const e=this.#O();if(void 0!==e){if(e<=0)throw new fi(this.request);return!1===this.#e.timeout?e:Math.min(this.#e.timeout,e)}return!1===this.#e.timeout?void 0:this.#e.timeout}async#g(e,t){let n;try{n=this.#I()}catch(s){await this.#p(s)}const r=e();if(void 0===n)return r;const o=await Promise.race([r,new Promise(e=>{const t=setTimeout(()=>{e(la)},n);r.finally(()=>{clearTimeout(t)}).catch(()=>{})})]);return o===la&&(this.#v?.abort(),await this.#p(new fi(this.#c(t)))),o}async#_(e){const t=this.#O();if(void 0===t)return e();if(t<=0)return this.#v?.abort(),da;let n;try{const r=new Promise(e=>{n=setTimeout(()=>{e(da)},t)}),o=Promise.resolve().then(e).then(e=>({status:"fulfilled",value:e})).catch(e=>({status:"rejected",error:e})),s=await Promise.race([o,r]),i=this.#O();if(s===da||void 0!==i&&i<=0)return this.#v?.abort(),s===da?o.then(e=>{"fulfilled"===e.status&&this.#M(e.value)}):"fulfilled"===s.status&&this.#M(s.value),da;if("rejected"===s.status)throw s.error;return s.value}finally{clearTimeout(n)}}#U(e){const t=(e.split(";",1)[0]??"").trim().toLowerCase();return/\/(?:.*[.+-])?json$/.test(t)}async#$(e,t){const{body:n}=e;if(!n)try{return await e.text()}catch{return}let r;try{r=n.getReader()}catch{return}const o=(e=>{const t=/;\s*charset\s*=\s*(?:"([^"]+)"|([^;,\s]+))/i.exec(e),n=t?.[1]??t?.[2];if(n)try{return new TextDecoder(n)}catch{}return new TextDecoder})(e.headers.get("content-type")??""),s=[];let i=0;const a=(async()=>{try{for(;;){const{done:e,value:t}=await r.read();if(e)break;if(i+=t.byteLength,i>10485760)return void r.cancel().catch(()=>{});s.push(o.decode(t,{stream:!0}))}}catch{return}return s.push(o.decode()),s.join("")})(),c=new Promise(e=>{const n=setTimeout(()=>{e(la)},t);a.finally(()=>{clearTimeout(n)})}),u=await Promise.race([a,c]);return u===la&&r.cancel().catch(()=>{}),u}async#j(e,t,n,r){let o;try{return await Promise.race([Promise.resolve().then(()=>this.#e.parseJson?this.#e.parseJson(e,{request:r,response:t}):JSON.parse(e)),new Promise(e=>{o=setTimeout(()=>{e(la)},n)})])}catch{return}finally{clearTimeout(o)}}#m(e){e&&e.cancel().catch(()=>{})}#h(e){this.#m(e.body??void 0)}#M(e){va(e)?this.#h(e):ya(e)&&this.#m(e.body??void 0)}#N(){return this.#x?AbortSignal.any([this.#x,this.#v.signal]):this.#v.signal}#L(){const e=this.#O();if(void 0!==e&&e<=0)throw new fi(this.request)}async#t(){for(const e of this.#e.hooks.beforeRequest){const t=await this.#_(async()=>e({request:this.request,options:this.#u(),retryCount:0}));if(t===da)throw new fi(this.request);if(ya(t))this.#q(t);else if(va(t))return t}}async#i(e){const t=this.#c(e);for(const r of this.#e.hooks.afterResponse){const o=this.#B(e.clone(),t);let s;this.#d(o);try{if(s=await this.#_(async()=>r({request:this.request,options:this.#u(),response:o,retryCount:this.#b})),s===da)throw new fi(this.request)}catch(n){throw o!==e&&this.#h(o),this.#h(e),n}if(s instanceof Si)throw o!==e&&this.#h(o),this.#h(e),new hi(s.options);const i=va(s)?this.#B(s,t):e;o!==e&&o!==i&&o.body!==i.body&&this.#h(o),e!==i&&e.body!==i.body&&this.#h(e),e=i}return e}async#r(e){try{return await e()}catch(t){return this.#a(t,e)}}async#a(e,t){this.#E=!1;const n=Math.min(await this.#D(e),xi),r={signal:this.#x},o=this.#O();if(void 0!==o){if(o<=0)throw new fi(this.request);if(n>=o)throw await Xi(o,r),new fi(this.request)}if(await Xi(n,r),this.#L(),e instanceof hi&&e.customRequest){const t=new globalThis.Request(e.customRequest,this.#e.signal?{signal:this.#e.signal}:void 0);this.#q(t)}for(const i of this.#e.hooks.beforeRetry){let t;try{t=await this.#_(async()=>i({request:this.request,options:this.#u(),error:e,retryCount:this.#b+1}))}catch(s){throw s instanceof Error&&s!==e&&this.#k.add(s),s}if(t===da)throw new fi(this.request);if(ya(t)){this.#q(t);break}if(va(t))return this.#E=!0,this.#b++,t;if(t===ki)return}return this.#L(),this.#b++,this.#r(t)}#s(){const e=this.#E;return this.#E=!1,e}async#o(){this.#v?.signal.aborted&&(this.#v=new globalThis.AbortController,this.#e.signal=this.#N(),this.request=new globalThis.Request(this.request,{signal:this.#e.signal}));const e=(e=>{const t={};for(const n in e)Object.hasOwn(e,n)&&(n in Ti||n in Ei||(t[n]=e[n]));return t})(this.#e);this.#n=Vi(this.#e.retry).limit;const t=this.#n>0?this.request.clone():void 0,n=this.#F(this.request,this.#e.body??void 0);this.#f=n,t&&(this.request=t);try{const t=this.#O();if(void 0!==t&&t<=0)throw new fi(this.request);const r=!1===this.#e.timeout?t:void 0===t?this.#e.timeout:Math.min(this.#e.timeout,t),o=void 0===r?await this.#e.fetch(n,e):await async function(e,t,n,r){return new Promise((o,s)=>{const i=setTimeout(()=>{n&&n.abort(),s(new fi(e))},r.timeout);r.fetch(e,t).then(o).catch(s).then(()=>{clearTimeout(i)})})}(n,e,this.#v,{timeout:r,fetch:this.#e.fetch});return this.#B(o,n)}catch(r){if(Zi(r))throw new li(this.request,{cause:r});throw r}}#O(){if(void 0===this.#C)return;const e=this.#R()-this.#C;return Math.max(0,this.#e.totalTimeout-e)}#R(){return globalThis.performance?.now()??Date.now()}#u(){if(!this.#S){const{hooks:e,json:t,parseJson:n,stringifyJson:r,searchParams:o,timeout:s,totalTimeout:i,throwHttpErrors:a,fetch:c,...u}=this.#e;this.#S=Object.freeze(u)}return this.#S}#q(e){this.#S=void 0,this.request=e}#c(e){return this.#T.get(e)??this.request}#B(e,t){return this.#T.set(e,t),e}#F(e,t){return this.#e.onUploadProgress&&e.body&&mi?Ai(e,this.#e.onUploadProgress,t??this.#e.body??void 0):e}},ka=e=>{const t=(t,n)=>xa.create(t,Li(e,n));for(const n of bi)t[n]=(t,r)=>xa.create(t,Li(e,r,{method:n}));return t.create=e=>ka(Li(e)),t.extend=t=>("function"==typeof t&&(t=t(e??{})),ka(Li(e,t))),t.stop=ki,t.retry=Ci,t},Sa=ka(),Ca=/* @__PURE__ */new Map,Ea=Sa.create({retry:{limit:3,methods:["get","put","head","delete","options","trace"],statusCodes:[408,429,500,502,503,504]},headers:{Accept:"application/json"},hooks:{beforeRequest:[({request:e})=>{if("GET"!==e.method)return;const t=Ca.get(e.url);t&&(t.etag&&e.headers.set("If-None-Match",t.etag),t.lastModified&&e.headers.set("If-Modified-Since",t.lastModified))}],afterResponse:[async({request:e,response:t})=>{if("GET"!==e.method)return t;if(304===t.status){const t=Ca.get(e.url);if(t)return new Response(t.body,{status:200,headers:{"Content-Type":"application/json"}})}if(t.ok){const n=t.headers.get("ETag")??void 0,r=t.headers.get("Last-Modified")??void 0;if(void 0!==n||void 0!==r){const o=await t.clone().text();Ca.set(e.url,{etag:n,lastModified:r,body:o})}}return t}]}});async function Ta({apiUrl:e,locale:t,portalCode:n,params:r,signal:o}){const s=function({apiUrl:e,portalCode:t,params:n}){const r=new URL("/portal_api/v1/accommodations",new URL(e).origin);return r.search=new URLSearchParams({portal_code:t,...n}).toString(),r.toString()}({apiUrl:e,portalCode:n,params:r});try{return await Ea.get(s,{headers:{locale:t},signal:o}).json()}catch(i){if(i instanceof ui)throw new Error(`Search request failed (${i.response.status})`);throw i}}var Na={en:"en-GB",nl:"nl-NL",de:"de-DE",fr:"fr-FR",it:"it-IT",es:"es-ES"};var Ra=/* @__PURE__ */new Map;function Aa(e,t){const n=function(){const e="undefined"!=typeof window?window.__localeId__:void 0;return(e&&Na[e])??"en-GB"}(),r=`${n}:${JSON.stringify(t)}`;let o=Ra.get(r);return o||(o=new Intl.DateTimeFormat(n,t),Ra.set(r,o)),o.format(e)}function Da(e){const[t,n,r]=e.split("-").map(Number);return new Date(t,n-1,r)}function Pa(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function $a(e,t){const n=new Date(e);return n.setDate(n.getDate()+t),n}function La(e,t){return $a(e,-t)}function Ua(e,t){const n=new Date(e),r=n.getDate();n.setDate(1),n.setMonth(n.getMonth()+t);const o=new Date(n.getFullYear(),n.getMonth()+1,0).getDate();return n.setDate(Math.min(r,o)),n}function ja(e,t){return function(e,t){const n=new Date(e),r=n.getMonth(),o=n.getDate();n.setDate(1),n.setFullYear(n.getFullYear()+t),n.setMonth(r);const s=new Date(n.getFullYear(),n.getMonth()+1,0).getDate();return n.setDate(Math.min(o,s)),n}(e,-t)}function Oa(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function Ia(e){return new Date(e.getFullYear(),e.getMonth(),1)}function Ma(e){return new Date(e.getFullYear(),e.getMonth()+1,0)}function qa(e){const t=Oa(e);return t.setDate(t.getDate()-t.getDay()),t}function Ba(e){const t=Oa(e);return t.setDate(t.getDate()+(6-t.getDay())),t}function Fa(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function za(e,t){return e.getTime()>t.getTime()}function Ha(e,t){return e.getTime()<t.getTime()}function Ya(e,t){const n=Oa(e).getTime(),r=Oa(t).getTime();return Math.round((n-r)/864e5)}var Wa={month:"long",year:"numeric"},Ja={weekday:"long",day:"2-digit",month:"long",year:"numeric"},Ka={year:"numeric",month:"long",day:"numeric"};function Va(e){return Aa(Da(e.slice(0,10)),Ka)}function Xa(e,t,n){const r=Number(n);r&&(e[t]=String(r))}function Ga(e,{limit:t,skip:n,currency:r}){const o={limit:String(t),skip:String(n)};r&&(o.currency=r),e.countries&&(o.country_id=String(e.countries)),e.regions&&(o.region_id=String(e.regions)),e.cities&&(o.city_id=String(e.cities)),e.extra_search&&(o.extra_search=e.extra_search),Xa(o,"persons_min",e.persons_min),Xa(o,"persons_max",e.persons_max),Xa(o,"bedrooms_min",e.bedrooms_min),Xa(o,"bathrooms_min",e.bathrooms_min),Xa(o,"weekprice_max",e.weekprice_max);const s=function(e){const t=Object.entries(e).filter(([e,t])=>/^category_\d+$/.test(e)&&t).map(([,e])=>Number(e));return[...new Set([...e.properties||[],...t].map(Number).filter(Number.isFinite))].sort((e,t)=>e-t)}(e);return s.length>0&&(o.properties=s.join(",")),e.arrival_date&&(o.arrival_date=e.arrival_date,e.departure_date?(o.starts_at=e.arrival_date,o.ends_at=e.departure_date,Xa(o,"no_nights_min",Ya(Da(e.departure_date),Da(e.arrival_date)))):o.no_nights_min="1"),o}function Qa({filters:e,PortalSite:t,limit:n,skip:r,onPageChange:a,activePage:c}){const{portalCode:l,apiUrl:f,locale:m}=o(ti),{currency:g}=ii(),[_,y]=u({status:"loading"}),v=JSON.stringify(Ga(e,{limit:n,skip:r,currency:g})),b=i(()=>JSON.parse(v),[v]);if(s(()=>{const e=new AbortController;return y({status:"loading"}),Ta({apiUrl:f,locale:m,portalCode:l,params:b,signal:e.signal}).then(t=>{e.signal.aborted||y({status:"ready",response:t})}).catch(t=>{e.signal.aborted||y({status:"error",error:t instanceof Error?t:/* @__PURE__ */new Error("A search request failed")})}),()=>{e.abort()}},[f,m,l,b]),"loading"===_.status)/* @__PURE__ */return d("div",{children:/* @__PURE__ */d(p,{})});if("error"===_.status)/* @__PURE__ */return d("div",{children:/* @__PURE__ */d(Gs,{errors:_.error})});const{items:w,meta:x}=_.response,k=/* @__PURE__ */d(oe,{totalCount:x.total_count,activePage:c,limit:n,onPageChange:a});/* @__PURE__ */
26
- return h("div",{id:"results",className:t.options.filtersForm.mode,children:[
27
- /* @__PURE__ */d(ai,{}),k,0===w.length?/* @__PURE__ */d("div",{className:"bu-noresults",children:Q("no_results")}):null,w.map(e=>/* @__PURE__ */d("div",{style:{display:"contents"},dangerouslySetInnerHTML:{__html:re({result:e,options:t.options.filtersForm,currency:x.currency??g})}},e.id)),k]})}var Za=["countries","regions","cities","arrival_date","departure_date","persons_min","persons_max","bedrooms_min","bathrooms_min","weekprice_max","extra_search"];async function ec(e){const t=tc("bu_portal_session"),n={...e,url:window.location.href,session_identifier:t};!function(e,t,n){const r=/* @__PURE__ */new Date;r.setTime(r.getTime()+24*n*60*60*1e3);let o="expires="+r.toUTCString();document.cookie=e+"="+t+";"+o+";path=/"}("bu_portal_session",await Ea.post("https://api.bukazu.com/tracking",{json:n}).text(),14)}function tc(e){let t=e+"=",n=decodeURIComponent(document.cookie).split(";");for(let r=0;r<n.length;r++){let e=n[r];for(;" "==e.charAt(0);)e=e.substring(1);if(0==e.indexOf(t))return e.substring(t.length,e.length)}return""}var nc=class extends t{constructor(e){super(e);let t=Number(this.props.options.filtersForm.no_results);const n=(this.props.options.filtersForm.prefill_filters_from_url??1)&&"undefined"!=typeof window?function(e){const t=new URLSearchParams(e),n={};return t.forEach((e,t)=>{if(e){if("properties"===t){const t=e.split(",").map(e=>e.trim()).filter(Boolean);return void(t.length>0&&(n.properties=t))}(Za.includes(t)||/^category_\d+$/.test(t))&&(n[t]=e)}}),n}(window.location.search):{};this.hasUrlFilters=Object.keys(n).length>0,this.state={filters:{...this.props.filters||{},...n},activePage:1,limit:t,skip:0},this.onFilterChange=this.onFilterChange.bind(this),this.pageChange=this.pageChange.bind(this)}componentDidMount(){if(this.hasUrlFilters)return;let e=localStorage.getItem("bukazuFilters"),t=localStorage.getItem("bukazuActivePage");e&&this.setState({filters:JSON.parse(e)}),t&&this.pageChange(parseInt(t)||0)}onFilterChange(e){let t=e;this.setState({filters:t}),localStorage.setItem("bukazuFilters",JSON.stringify(t)),this.pageChange(0)}pageChange(e){const{limit:t}=this.state;let n=e*t;localStorage.setItem("bukazuActivePage",e.toString()),this.setState({activePage:e,skip:n})}render(){const{filters:e,activePage:t,limit:n,skip:r}=this.state,{options:o,PortalSite:s,locale:i}=this.props;return ec({portal_code:s.portal_code,interaction_type:"search_view",locale:i}),/* @__PURE__ */h("div",{id:"search-page",className:"right"===o.filtersForm.location?"bu-reverse":"top"===o.filtersForm.location?"bu-column":"",children:[/* @__PURE__ */d(ee,{PortalSite:s,filters:e,onFilterChange:this.onFilterChange,options:o}),/* @__PURE__ */d(Qa,{PortalSite:s,filters:e,activePage:t,onPageChange:this.pageChange,skip:r,limit:n})]})}},rc=class extends Error{constructor(e,t,n){super(t.join("\n")||`Booking request failed (${e})`),this.name="CreateBookingError",this.status=e,this.messages=t.length>0?t:[this.message],n&&(this.fieldErrors=n)}};async function oc({apiUrl:e,locale:t,payload:n}){const r=function({apiUrl:e}){return new URL("/portal_api/v1/accommodations/bookings",new URL(e).origin).toString()}({apiUrl:e});try{return await Ea.post(r,{json:n,headers:{locale:t}}).json()}catch(o){if(o instanceof ui)throw await async function(e){const t=e.response.status;let n={};try{n=await e.response.json()}catch{return new rc(t,[])}const r=n.error?[n.error]:[];return new rc(t,r,n.errors)}(o);throw o}}var sc=["first_name","preposition","last_name","company_name","email","phone","phone_mobile","address","house_number","zipcode","city","iban","bic","holder","comment","discount_code","discount_reason","currency"];function ic(e){if("string"!=typeof e)return;const t=e.trim();return""===t?void 0:t}function ac(e){const t={};for(const[n,r]of Object.entries(e??{})){const e=Number(r);Number.isFinite(e)&&e>0&&(t[n]=e)}return t}function cc({values:e,objectCode:t,portalCode:n,locale:r,sessionIdentifier:o}){const s={portal_code:n,object_code:t,starts_at:e.arrivalDate.date,ends_at:e.departureDate.date,is_option:"true"===e.is_option,language:r,country:e.country.toUpperCase(),adults:Number(e.adults)||0,children:Number(e.children)||0,babies:Number(e.babies)||0,discount:Number(e.discount)||0,cancel_insurance:Number(e.cancel_insurance)||0,costs:ac(e.costs)},i=function(e){const t={};for(const[n,r]of Object.entries(e??{})){const e=ic(r);void 0!==e&&(t[n]=e)}return Object.keys(t).length>0?t:void 0}(e.extra_fields);i&&(s.extra_fields=i),o&&(s.session_identifier=o);for(const a of sc){const t=ic(e[a]);void 0!==t&&(s[a]=t)}return s}function uc({children:e,buttonText:t,show:n=!1,onClose:r}){const[o,i]=u(n),a=c(null);s(()=>{const e=a.current;e&&(o?e.showModal():e.close())},[o]);const p=()=>{i(!1),r?.()};/* @__PURE__ */
28
- return h(l,{children:[!o&&t&&/* @__PURE__ */d("button",{type:"button",className:"info-button",onClick:()=>i(!0),children:t}),/* @__PURE__ */h("dialog",{ref:a,className:"bukazu-modal",onCancel:p,onClick:e=>{e.target===a.current&&p()},children:[/* @__PURE__ */d("div",{className:"bukazu-modal-content",children:e}),/* @__PURE__ */d("div",{className:"bukazu-modal-footer",children:/* @__PURE__ */d("button",{type:"button",onClick:p,children:Q("close")})})]})]})}function lc(e){return Array.from({length:e+1},(e,t)=>t)}function dc(e){const t={};return e.forEach(e=>{t[e.id]=""}),t}function hc(e){return e.replace(/\[(\w+)\]/g,".$1").replace(/^\./,"").split(".")}function pc(e,t){const n=hc(t);let r=e;for(const o of n){if(null===r||"object"!=typeof r||!(o in r))return;r=r[o]}return r}function fc(e,t,n){const r=hc(t),o={...e};let s=o,i=e;return r.forEach((e,t)=>{if(t===r.length-1)return void(s[e]=n);const o=null!==i&&"object"==typeof i?i[e]:void 0,a=null===o||"object"!=typeof o||Array.isArray(o)?{}:{...o};s[e]=a,s=a,i=o}),o}function mc(e,t){let n=Number(t.babies)-Number(e.babies_extra);return n<0&&(n=0),Number(t.children)+Number(t.adults)+n}function gc(e,t){/* @__PURE__ */
29
- return d("option",{value:t,children:Q(e)})}var _c=n({values:{arrivalDate:{},departureDate:{},is_option:"false",costs:{},adults:0,children:0,babies:0,persons:0,discount:0,country:"",cancel_insurance:"0",discount_code:"",extra_fields:{}},errors:{},touched:{},isSubmitting:!1,setFieldValue:()=>{},setFieldTouched:()=>{}});function yc(e){const{values:t,errors:n,touched:r,setFieldValue:s}=o(_c),i=n[e],a=pc(n,e),c="string"==typeof i?i:"string"==typeof a?a:void 0,u=r[e],l=pc(r,e);return{error:c,touched:"boolean"==typeof u?u:"boolean"==typeof l&&l,value:pc(t,e)??"",onBlur:()=>{},onChange:t=>{s(e,t.target.value)}}}var vc={selectedDate:null,arrivalDate:null,departureDate:null,bookingStarted:!1,persons:0},bc=n(vc),wc=n(kc);function xc({children:e}){const[t,n]=a(kc,vc);/* @__PURE__ */
30
- return d(bc.Provider,{value:t,children:/* @__PURE__ */d(wc.Provider,{value:n,children:e})})}function kc(e,t){switch(t.type){case"clicked":{const{day:n,house:r}=t,{selectedDate:o,arrivalDate:s}=e,i=Da(n.date),a=r.persons>2?2:r.persons;return n.departure&&o&&s&&za(i,o)&&Ya(i,o)<=r.max_nights&&Ya(i,o)>=s.min_nights&&Ya(i,o)<=s.max_nights?{...e,departureDate:n}:n.arrival?{bookingStarted:!1,selectedDate:i,arrivalDate:n,departureDate:null,persons:a}:e}case"reset":return vc;case"start":return{...e,bookingStarted:!0,persons:t.persons};case"return":return{...e,bookingStarted:!1};default:throw Error("Unknown action: "+t.type)}}var Sc=({error:e})=>e?/* @__PURE__ */d("div",{className:"input-feedback",children:e}):null,Cc=({name:e,value:t,currentValue:n,onChange:r,onBlur:o,id:s,label:i,...a})=>/* @__PURE__ */h("div",{children:[/* @__PURE__ */d("input",{name:e,id:s,type:"radio",value:t,checked:t===n,onChange:r,onBlur:o,className:"radio-button",...a}),/* @__PURE__ */d("label",{htmlFor:s,children:i})]}),Ec=({error:e,touched:t,label:n,className:r,children:o})=>/* @__PURE__ */h("div",{className:r,children:[
31
- /* @__PURE__ */d("div",{className:"legend",children:n}),o,t&&/* @__PURE__ */d(Sc,{error:e})]});function Tc({house:e}){const t=yc("is_option");/* @__PURE__ */
32
- return d(l,{children:e.allow_option&&/* @__PURE__ */d("div",{children:/* @__PURE__ */h(Ec,{id:"is_option",className:"booking_option",children:[/* @__PURE__ */d(Cc,{name:"is_option",value:"true",currentValue:String(t.value),onChange:t.onChange,onBlur:t.onBlur,id:"true",disabled:!e.allow_option,label:Q("option")}),/* @__PURE__ */d(Cc,{name:"is_option",value:"false",currentValue:String(t.value),onChange:t.onChange,onBlur:t.onBlur,id:"false",label:Q("booking")})]})})})}var Nc=({height:e="16px",width:t="16px"})=>/* @__PURE__ */h("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",version:"1.1",x:"0px",y:"0px",viewBox:"0 0 100 100",enableBackground:"new 0 0 100 100",xmlSpace:"preserve",style:{height:e,width:t},children:[
20
+ return d("input",{id:t.id,name:t.id,value:n,type:"number",min:"0",max:"persons_min"===t.id?e.max_persons:e[t.id],onBlur:e=>{r(t.id,e.currentTarget.value)}})}var v=["persons_min","persons_max","bedrooms_min","bathrooms_min","weekprice_max"],b=["select","list","radio","number","date"],w=["select","number","date","text"];function x(e){return b.includes(e.type)?e.type:v.includes(e.id)?"select":"text"}function k(e){return w.includes(x(e))}var S=["countries","cities","regions"];function C(e,t){if(e.options)return e.options;if(void 0!==e.max)return"weekprice_max"===e.id?function(e){let t=Math.ceil(e/100);return Array.from({length:t+1},(e,t)=>100*t)}(e.max):(n=e.max,Array.from({length:n+1},(e,t)=>t));var n;if(S.includes(e.id)){const n=t[e.id];return Array.isArray(n)?n:[]}return[]}function E({PortalSite:e,field:t,filters:n,value:r,onFilterChange:o,options:i,labelId:s}){const a=i??C(t,e),c=x(t);return"select"===c?/* @__PURE__ */d(m,{options:a,field:t,filters:n,value:r,onChange:o}):"list"===c?/* @__PURE__ */d(f,{options:a,field:t,filters:n,value:r,onChange:o,labelledBy:s}):"radio"===c?/* @__PURE__ */d(g,{options:a,field:t,filters:n,onChange:o,labelledBy:s}):"number"===c?/* @__PURE__ */d(y,{PortalSite:e,field:t,value:r,onChange:o}):"date"===c?/* @__PURE__ */d(_,{field:t,value:r,onChange:o}):/* @__PURE__ */d("input",{id:t.id,name:t.id,type:"text",defaultValue:r,onBlur:e=>{o(t.id,e.target.value)}})}var N={next:"Next",previous:"Previous",view_details:"View details",price:"Price",calculate:"Next",currency:"Currency",book:"Book",booked:"Booked",booking:"Booking",last_minute_discount:"Last minute discount",discount:"Discount",option:"Option",choose_for_option:"Make a short reservation for this period ",included_in_price:"including",rent_price:"Rental price",extra_costs_included:"Extra costs included",optional_costs:"Extra options",price_after_discount:"Rental price incl. discount",booking_from_til:"Booking dates",total:"Total",stay_details:"Travel group",babies:"Babies",babies_from:"(up to the age of {babies})",adults:"Adults",adults_from:"(from the age of {age})","camper_spot.arrival_date":"Arrival date","camper_spot.departure_date":"Departure date","camper_spot.arrival":"Arrival","camper_spot.departure":"Departure","camping_place.arrival_date":"Arrival date","camping_place.departure_date":"Departure date","camping_place.arrival":"Arrival","camping_place.departure":"Departure","bnb.arrival_date":"Arrival date","bnb.departure_date":"Departure date","bnb.arrival":"Arrival","bnb.departure":"Departure","hotelroom.arrival_date":"Arrival date","hotelroom.departure_date":"Departure date","hotelroom.arrival":"Arrival","hotelroom.departure":"Departure",children:"Children",children_from:"(from {from} to {til} years inclusive)","house.arrival_date":"Arrival date","house.departure_date":"Departure date","house.arrival":"Arrival","house.departure":"Departure","group_accommodation.arrival_date":"Arrival date","group_accommodation.departure_date":"Departure date","group_accommodation.arrival":"Arrival","group_accommodation.departure":"Departure","tent.arrival_date":"Arrival date","tent.departure_date":"Departure date","tent.arrival":"Arrival","tent.departure":"Departure",extra_costs_bookable:"Extra options",costs_on_site:"Additional costs on the spot:",insurances:"Insurances",at_least_1_adult:"Choose at least 1 adult.",max_persons_reached:"Too many people have been selected.",personal_details:"Your information",required:"This field is required.",cancel_insurance_all_risk:"All Risk",cancel_insurance_normal:"Standard",none:"None",cancel_insurance:"Cancellation insurance",insurance_costs:"Insurance Costs",choose:"Choose",yes:"Yes",booking_details:"Booking details",based_on_one_person:"Based on {persons} persons",return_to_calendar:"Back to calendar",close:"Close",cancel_insurance_normal_long:"Short-term Cancellation Insurance ",cancel_insurance_normal_desc:"If you booked a wonderful holiday, cancellation insurance should not be missing! Your booked holiday cannot continue, or you have to go home unexpectedly halfway through the holiday due to, for example, a severe illness. The cancellation insurance of RecreatieVerzekeringen is ideal because it applies before departure and during your holiday.",cancel_insurance_more_insured:"More are insured than you think.",cancel_insurance_more_insured_desc:"Did you know that you can rely on cancellation insurance during pregnancy, a new job, or divorce? Many people expect cancellation insurance to be valid only in the event of illness or death.",cancel_insurance_important:"Important",cancel_insurance_important_message:"For optimal cancellation insurance coverage, you must take it out within seven days after booking the holiday.",cancel_insurance_for_whom:"For whom?",cancel_insurance_for_whom_explain:"This insurance is for a maximum of 4 families or 9 travel companions (no family members).",cancel_insurance_questions:"Frequently Asked Questions",cancel_insurance_questions_explain_1:"Click ",cancel_insurance_questions_explain_link:"here",cancel_insurance_questions_explain_2:" to find the Frequently Asked Questions.",show_terms:"Show conditions",terms:"Terms",remark:"Remark","9persons_9addresses":"The Insurance will pay for up to 9 persons, who live at 9 different addresses,",or:"or","9persons_4addresses":"The insurance pays out for an unlimited number of people who live at a maximum of 4 different addresses.",poliscosts:"Policy fee",poliscosts_are:"The cost for an insurance policy is a one-time charge of € 6,95. No matter if you have one or two insuran",youwillrecieve:"You will receive the insurance terms separate from you booking confirmation per email. The insurance starts as soon as the (first) payment has been made.",thank_you_for_your_request:"Thank you very much for your request.",we_sent_confirmation_check_email:"A copy of your request has been sent to your e-mail address. If you have not received any mail from us, it may be that it is in your spam box.",something_went_wrong_please_try_again:"Oops, something went wrong, please try again later.",no_prices_available_for_period:"No prices are available for the selected period.",persons:"persons",bedrooms:"bedrooms",minimum_week_price:"min. weekly price",no_results:"No results",agree_with:"Clicking 'Book' creates a payment obligation when my booking is accepted. I agree to the ",option_is_free:"An option is free of charge and without obligation.",discount_reason:"Reason discount.",results:"results",bathrooms:"bathrooms",you_need_to_give_reason:"You must indicate a valid discount reason","camper.arrival_date":"Start date","camper.departure_date":"End date","camper.arrival":"Start date","camper.departure":"End date","boat.arrival_date":"Start date","boat.departure_date":"End date","boat.arrival":"Start date","boat.departure":"End date","caravan.arrival_date":"Arrival date","caravan.departure_date":"Departure date","caravan.arrival":"Arrival","caravan.departure":"Departure",filters:"Filters",comply_insurance_card:"I agree that the cancellation insurance insurance card will be digitally issued to me. I receive this card with my booking confirmation.","house.you_picked_arrival_date":"Your arrival date is","house.pick_your_departure_in_the_calendar":"Select a departure date","house.you_picked_departure_date":"Your departure date is","house.pick_your_arrivaldate_in_the_calendar":"Choose an arrival date","group_accommodation.you_picked_arrival_date":"Your arrival date is","group_accommodation.pick_your_departure_in_the_calendar":"Select a departure date","group_accommodation.you_picked_departure_date":"Your departure date is","group_accommodation.pick_your_arrivaldate_in_the_calendar":"Choose an arrival date","tent.you_picked_arrival_date":"Your arrival date is","tent.pick_your_departure_in_the_calendar":"Select a departure date","tent.you_picked_departure_date":"Your departure date is","tent.pick_your_arrivaldate_in_the_calendar":"Choose an arrival date","camper.you_picked_arrival_date":"Your pickup date is","camper.pick_your_departure_in_the_calendar":"Select a return date","camper.you_picked_departure_date":"Your return date is","camper.pick_your_arrivaldate_in_the_calendar":"Choose a pickup date","boat.you_picked_arrival_date":"Your pickup date is","boat.pick_your_departure_in_the_calendar":"Select a return date","boat.you_picked_departure_date":"Your return date is","boat.pick_your_arrivaldate_in_the_calendar":"Choose a pickup date","bnb.you_picked_arrival_date":"Your arrival date is","bnb.pick_your_departure_in_the_calendar":"Select a departure date","bnb.you_picked_departure_date":"Your departure date is","bnb.pick_your_arrivaldate_in_the_calendar":"Choose an arrival date","caravan.you_picked_arrival_date":"Your pickup date is","caravan.pick_your_departure_in_the_calendar":"Select a return date","caravan.you_picked_departure_date":"Your return date is","caravan.pick_your_arrivaldate_in_the_calendar":"Choose a pickup date","camper_spot.you_picked_arrival_date":"Your arrival date is","camper_spot.pick_your_departure_in_the_calendar":"Select a departure date","camper_spot.you_picked_departure_date":"Your departure date is","camper_spot.pick_your_arrivaldate_in_the_calendar":"Choose an arrival date","camping_place.you_picked_arrival_date":"Your arrival date is","camping_place.pick_your_departure_in_the_calendar":"Select a departure date","camping_place.you_picked_departure_date":"Your departure date is","camping_place.pick_your_arrivaldate_in_the_calendar":"Choose an arrival date","hotelroom.you_picked_arrival_date":"Your arrival date is","hotelroom.pick_your_departure_in_the_calendar":"Select a departure date","hotelroom.you_picked_departure_date":"Your departure date is","hotelroom.pick_your_arrivaldate_in_the_calendar":"Choose an arrival date","house_boat.you_picked_arrival_date":"Your pickup date is","house_boat.pick_your_departure_in_the_calendar":"Select a return date","house_boat.you_picked_departure_date":"Your return date is","house_boat.pick_your_arrivaldate_in_the_calendar":"Choose a pickup date",no:"No",no_house_found:"No object found for this combination of PortalCode and ObjectCode",insurance_company_needs_date_of_birth:"A date of birth is required for taking out insurance","extra_fields.date_of_birth":"Date of birth",no_discount_code_found:"No discount found with entered code",discount_code:"Discount code",minimum_nights:"At least {minimum} nights",can_only_take_insurance_in_de_be_nl:"You can only take out insurance if you live in the Netherlands, Germany or Belgium.",price_from:"Price from",reviews:"Reviews",load_more_reviews:"Load more reviews",review_response_label:"Response from host",reviews_note_link:"BUKAZU Booking System maintains independent reviews. These reviews are collected after guests stay in the accommodation. There is verification of the combination of booking number and email address.",active_filters:"Active filters ({count})",clear_all:"Clear all",remove_filter:"Remove {filter}",view_mode:"View",grid_view:"Grid view",list_view:"List view",show_results:"Show results"},T=["en","nl","de","fr","es","it"];function R(e){return function(e){return T.includes(e)}(e)?e:"en"}new TextEncoder;function A(e,t,n){let r=t;const o=r+n,i=[];let s="";for(;r<o;){const t=e[r++];if(128&t)if(192==(224&t)){const n=63&e[r++];i.push((31&t)<<6|n)}else if(224==(240&t)){const n=63&e[r++],o=63&e[r++];i.push((31&t)<<12|n<<6|o)}else if(240==(248&t)){let n=(7&t)<<18|(63&e[r++])<<12|(63&e[r++])<<6|63&e[r++];n>65535&&(n-=65536,i.push(n>>>10&1023|55296),n=56320|1023&n),i.push(n)}else i.push(t);else i.push(t);i.length>=4096&&(s+=String.fromCharCode(...i),i.length=0)}return i.length>0&&(s+=String.fromCharCode(...i)),s}var $=new TextDecoder;function P(e,t,n){return n>200?function(e,t,n){const r=e.subarray(t,t+n);return $.decode(r)}(e,t,n):A(e,t,n)}var D=class{type;data;constructor(e,t){this.type=e,this.data=t}},L=class e extends Error{constructor(t){super(t);const n=Object.create(e.prototype);Object.setPrototypeOf(this,n),Object.defineProperty(this,"name",{configurable:!0,enumerable:!1,value:e.name})}};function j(e,t){return 4294967296*e.getInt32(t)+e.getUint32(t+4)}function U({sec:e,nsec:t}){if(e>=0&&t>=0&&e<=17179869183){if(0===t&&e<=4294967295){const t=/* @__PURE__ */new Uint8Array(4);return new DataView(t.buffer).setUint32(0,e),t}{const n=e/4294967296,r=4294967295&e,o=/* @__PURE__ */new Uint8Array(8),i=new DataView(o.buffer);return i.setUint32(0,t<<2|3&n),i.setUint32(4,r),o}}{const n=/* @__PURE__ */new Uint8Array(12),r=new DataView(n.buffer);return r.setUint32(0,t),function(e,t,n){const r=Math.floor(n/4294967296),o=n;e.setUint32(t,r),e.setUint32(t+4,o)}(r,4,e),n}}var M={type:-1,encode:function(e){return e instanceof Date?U(function(e){const t=e.getTime(),n=Math.floor(t/1e3),r=1e6*(t-1e3*n),o=Math.floor(r/1e9);return{sec:n+o,nsec:r-1e9*o}}(e)):null},decode:function(e){const t=function(e){const t=new DataView(e.buffer,e.byteOffset,e.byteLength);switch(e.byteLength){case 4:return{sec:t.getUint32(0),nsec:0};case 8:{const e=t.getUint32(0);return{sec:4294967296*(3&e)+t.getUint32(4),nsec:e>>>2}}case 12:return{sec:j(t,4),nsec:t.getUint32(0)};default:throw new L(`Unrecognized data size for timestamp (expected 4, 8, or 12): ${e.length}`)}}(e);/* @__PURE__ */
21
+ return new Date(1e3*t.sec+t.nsec/1e6)}},O=class e{static defaultCodec=new e;__brand;builtInEncoders=[];builtInDecoders=[];encoders=[];decoders=[];constructor(){this.register(M)}register({type:e,encode:t,decode:n}){if(e>=0)this.encoders[e]=t,this.decoders[e]=n;else{const r=-1-e;this.builtInEncoders[r]=t,this.builtInDecoders[r]=n}}tryToEncode(e,t){for(let n=0;n<this.builtInEncoders.length;n++){const r=this.builtInEncoders[n];if(null!=r){const o=r(e,t);if(null!=o){return new D(-1-n,o)}}}for(let n=0;n<this.encoders.length;n++){const r=this.encoders[n];if(null!=r){const o=r(e,t);if(null!=o)return new D(n,o)}}return e instanceof D?e:null}decode(e,t,n){const r=t<0?this.builtInDecoders[-1-t]:this.decoders[t];return r?r(e,t,n):new D(t,e)}};function I(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):function(e){return e instanceof ArrayBuffer||"undefined"!=typeof SharedArrayBuffer&&e instanceof SharedArrayBuffer}(e)?new Uint8Array(e):Uint8Array.from(e)}function q(e){return`${e<0?"-":""}0x${Math.abs(e).toString(16).padStart(2,"0")}`}var B="array",F="map_key",z="map_value",H=e=>{if("string"==typeof e||"number"==typeof e)return e;throw new L("The type of key must be string or number but "+typeof e)},Y=class{stack=[];stackHeadPosition=-1;get length(){return this.stackHeadPosition+1}top(){return this.stack[this.stackHeadPosition]}pushArrayState(e){const t=this.getUninitializedStateFromPool();t.type=B,t.position=0,t.size=e,t.array=new Array(e)}pushMapState(e){const t=this.getUninitializedStateFromPool();t.type=F,t.readCount=0,t.size=e,t.map={}}getUninitializedStateFromPool(){return this.stackHeadPosition++,this.stackHeadPosition===this.stack.length&&this.stack.push({type:void 0,size:0,array:void 0,position:0,readCount:0,map:void 0,key:null}),this.stack[this.stackHeadPosition]}release(e){if(this.stack[this.stackHeadPosition]!==e)throw new Error("Invalid stack state. Released state is not on top of the stack.");if(e.type===B){const t=e;t.size=0,t.array=void 0,t.position=0,t.type=void 0}if(e.type===F||e.type===z){const t=e;t.size=0,t.map=void 0,t.readCount=0,t.type=void 0}this.stackHeadPosition--}reset(){this.stack.length=0,this.stackHeadPosition=-1}},W=/* @__PURE__ */new DataView(/* @__PURE__ */new ArrayBuffer(0)),J=new Uint8Array(W.buffer);try{W.getInt8(0)}catch(ed){if(!(ed instanceof RangeError))throw new Error("This module is not supported in the current JavaScript engine because DataView does not throw RangeError on out-of-bounds access")}var V=/* @__PURE__ */new RangeError("Insufficient data"),K=new class{hit=0;miss=0;caches;maxKeyLength;maxLengthPerKey;constructor(e=16,t=16){this.maxKeyLength=e,this.maxLengthPerKey=t,this.caches=[];for(let n=0;n<this.maxKeyLength;n++)this.caches.push([])}canBeCached(e){return e>0&&e<=this.maxKeyLength}find(e,t,n){const r=this.caches[n-1];e:for(const o of r){const r=o.bytes;for(let o=0;o<n;o++)if(r[o]!==e[t+o])continue e;return o.str}return null}store(e,t){const n=this.caches[e.length-1],r={bytes:e,str:t};n.length>=this.maxLengthPerKey?n[Math.random()*n.length|0]=r:n.push(r)}decode(e,t,n){const r=this.find(e,t,n);if(null!=r)return this.hit++,r;this.miss++;const o=A(e,t,n),i=Uint8Array.prototype.slice.call(e,t,t+n);return this.store(i,o),o}},G=class e{extensionCodec;context;useBigInt64;rawStrings;maxStrLength;maxBinLength;maxArrayLength;maxMapLength;maxExtLength;keyDecoder;mapKeyConverter;totalPos=0;pos=0;view=W;bytes=J;headByte=-1;stack=new Y;entered=!1;constructor(e){this.extensionCodec=e?.extensionCodec??O.defaultCodec,this.context=e?.context,this.useBigInt64=e?.useBigInt64??!1,this.rawStrings=e?.rawStrings??!1,this.maxStrLength=e?.maxStrLength??4294967295,this.maxBinLength=e?.maxBinLength??4294967295,this.maxArrayLength=e?.maxArrayLength??4294967295,this.maxMapLength=e?.maxMapLength??4294967295,this.maxExtLength=e?.maxExtLength??4294967295,this.keyDecoder=void 0!==e?.keyDecoder?e.keyDecoder:K,this.mapKeyConverter=e?.mapKeyConverter??H}clone(){return new e({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,rawStrings:this.rawStrings,maxStrLength:this.maxStrLength,maxBinLength:this.maxBinLength,maxArrayLength:this.maxArrayLength,maxMapLength:this.maxMapLength,maxExtLength:this.maxExtLength,keyDecoder:this.keyDecoder})}reinitializeState(){this.totalPos=0,this.headByte=-1,this.stack.reset()}setBuffer(e){const t=I(e);this.bytes=t,this.view=new DataView(t.buffer,t.byteOffset,t.byteLength),this.pos=0}appendBuffer(e){if(-1!==this.headByte||this.hasRemaining(1)){const t=this.bytes.subarray(this.pos),n=I(e),r=new Uint8Array(t.length+n.length);r.set(t),r.set(n,t.length),this.setBuffer(r)}else this.setBuffer(e)}hasRemaining(e){return this.view.byteLength-this.pos>=e}createExtraByteError(e){const{view:t,pos:n}=this;/* @__PURE__ */
22
+ return new RangeError(`Extra ${t.byteLength-n} of ${t.byteLength} byte(s) found at buffer[${e}]`)}decode(e){if(this.entered)return this.clone().decode(e);try{this.entered=!0,this.reinitializeState(),this.setBuffer(e);const t=this.doDecodeSync();if(this.hasRemaining(1))throw this.createExtraByteError(this.pos);return t}finally{this.entered=!1}}*decodeMulti(e){if(this.entered)yield*this.clone().decodeMulti(e);else try{for(this.entered=!0,this.reinitializeState(),this.setBuffer(e);this.hasRemaining(1);)yield this.doDecodeSync()}finally{this.entered=!1}}async decodeAsync(e){if(this.entered)return this.clone().decodeAsync(e);try{this.entered=!0;let t,n=!1;for await(const s of e){if(n)throw this.entered=!1,this.createExtraByteError(this.totalPos);this.appendBuffer(s);try{t=this.doDecodeSync(),n=!0}catch(ed){if(!(ed instanceof RangeError))throw ed}this.totalPos+=this.pos}if(n){if(this.hasRemaining(1))throw this.createExtraByteError(this.totalPos);return t}const{headByte:r,pos:o,totalPos:i}=this;throw new RangeError(`Insufficient data in parsing ${q(r)} at ${i} (${o} in the current buffer)`)}finally{this.entered=!1}}decodeArrayStream(e){return this.decodeMultiAsync(e,!0)}decodeStream(e){return this.decodeMultiAsync(e,!1)}async*decodeMultiAsync(e,t){if(this.entered)yield*this.clone().decodeMultiAsync(e,t);else try{this.entered=!0;let n=t,r=-1;for await(const o of e){if(t&&0===r)throw this.createExtraByteError(this.totalPos);this.appendBuffer(o),n&&(r=this.readArraySize(),n=!1,this.complete());try{for(;yield this.doDecodeSync(),0!==--r;);}catch(ed){if(!(ed instanceof RangeError))throw ed}this.totalPos+=this.pos}}finally{this.entered=!1}}doDecodeSync(){e:for(;;){const e=this.readHeadByte();let t;if(e>=224)t=e-256;else if(e<192)if(e<128)t=e;else if(e<144){const n=e-128;if(0!==n){this.pushMapState(n),this.complete();continue e}t={}}else if(e<160){const n=e-144;if(0!==n){this.pushArrayState(n),this.complete();continue e}t=[]}else{const n=e-160;t=this.decodeString(n,0)}else if(192===e)t=null;else if(194===e)t=!1;else if(195===e)t=!0;else if(202===e)t=this.readF32();else if(203===e)t=this.readF64();else if(204===e)t=this.readU8();else if(205===e)t=this.readU16();else if(206===e)t=this.readU32();else if(207===e)t=this.useBigInt64?this.readU64AsBigInt():this.readU64();else if(208===e)t=this.readI8();else if(209===e)t=this.readI16();else if(210===e)t=this.readI32();else if(211===e)t=this.useBigInt64?this.readI64AsBigInt():this.readI64();else if(217===e){const e=this.lookU8();t=this.decodeString(e,1)}else if(218===e){const e=this.lookU16();t=this.decodeString(e,2)}else if(219===e){const e=this.lookU32();t=this.decodeString(e,4)}else if(220===e){const e=this.readU16();if(0!==e){this.pushArrayState(e),this.complete();continue e}t=[]}else if(221===e){const e=this.readU32();if(0!==e){this.pushArrayState(e),this.complete();continue e}t=[]}else if(222===e){const e=this.readU16();if(0!==e){this.pushMapState(e),this.complete();continue e}t={}}else if(223===e){const e=this.readU32();if(0!==e){this.pushMapState(e),this.complete();continue e}t={}}else if(196===e){const e=this.lookU8();t=this.decodeBinary(e,1)}else if(197===e){const e=this.lookU16();t=this.decodeBinary(e,2)}else if(198===e){const e=this.lookU32();t=this.decodeBinary(e,4)}else if(212===e)t=this.decodeExtension(1,0);else if(213===e)t=this.decodeExtension(2,0);else if(214===e)t=this.decodeExtension(4,0);else if(215===e)t=this.decodeExtension(8,0);else if(216===e)t=this.decodeExtension(16,0);else if(199===e){const e=this.lookU8();t=this.decodeExtension(e,1)}else if(200===e){const e=this.lookU16();t=this.decodeExtension(e,2)}else{if(201!==e)throw new L(`Unrecognized type byte: ${q(e)}`);{const e=this.lookU32();t=this.decodeExtension(e,4)}}this.complete();const n=this.stack;for(;n.length>0;){const e=n.top();if(e.type===B){if(e.array[e.position]=t,e.position++,e.position!==e.size)continue e;t=e.array,n.release(e)}else{if(e.type===F){if("__proto__"===t)throw new L("The key __proto__ is not allowed");e.key=this.mapKeyConverter(t),e.type=z;continue e}if(e.map[e.key]=t,e.readCount++,e.readCount!==e.size){e.key=null,e.type=F;continue e}t=e.map,n.release(e)}}return t}}readHeadByte(){return-1===this.headByte&&(this.headByte=this.readU8()),this.headByte}complete(){this.headByte=-1}readArraySize(){const e=this.readHeadByte();switch(e){case 220:return this.readU16();case 221:return this.readU32();default:if(e<160)return e-144;throw new L(`Unrecognized array type byte: ${q(e)}`)}}pushMapState(e){if(e>this.maxMapLength)throw new L(`Max length exceeded: map length (${e}) > maxMapLengthLength (${this.maxMapLength})`);this.stack.pushMapState(e)}pushArrayState(e){if(e>this.maxArrayLength)throw new L(`Max length exceeded: array length (${e}) > maxArrayLength (${this.maxArrayLength})`);this.stack.pushArrayState(e)}decodeString(e,t){return!this.rawStrings||this.stateIsMapKey()?this.decodeUtf8String(e,t):this.decodeBinary(e,t)}decodeUtf8String(e,t){if(e>this.maxStrLength)throw new L(`Max length exceeded: UTF-8 byte length (${e}) > maxStrLength (${this.maxStrLength})`);if(this.bytes.byteLength<this.pos+t+e)throw V;const n=this.pos+t;let r;return r=this.stateIsMapKey()&&this.keyDecoder?.canBeCached(e)?this.keyDecoder.decode(this.bytes,n,e):P(this.bytes,n,e),this.pos+=t+e,r}stateIsMapKey(){return this.stack.length>0&&this.stack.top().type===F}decodeBinary(e,t){if(e>this.maxBinLength)throw new L(`Max length exceeded: bin length (${e}) > maxBinLength (${this.maxBinLength})`);if(!this.hasRemaining(e+t))throw V;const n=this.pos+t,r=this.bytes.subarray(n,n+e);return this.pos+=t+e,r}decodeExtension(e,t){if(e>this.maxExtLength)throw new L(`Max length exceeded: ext length (${e}) > maxExtLength (${this.maxExtLength})`);const n=this.view.getInt8(this.pos+t),r=this.decodeBinary(e,t+1);return this.extensionCodec.decode(r,n,this.context)}lookU8(){return this.view.getUint8(this.pos)}lookU16(){return this.view.getUint16(this.pos)}lookU32(){return this.view.getUint32(this.pos)}readU8(){const e=this.view.getUint8(this.pos);return this.pos++,e}readI8(){const e=this.view.getInt8(this.pos);return this.pos++,e}readU16(){const e=this.view.getUint16(this.pos);return this.pos+=2,e}readI16(){const e=this.view.getInt16(this.pos);return this.pos+=2,e}readU32(){const e=this.view.getUint32(this.pos);return this.pos+=4,e}readI32(){const e=this.view.getInt32(this.pos);return this.pos+=4,e}readU64(){const e=(t=this.view,n=this.pos,4294967296*t.getUint32(n)+t.getUint32(n+4));var t,n;return this.pos+=8,e}readI64(){const e=j(this.view,this.pos);return this.pos+=8,e}readU64AsBigInt(){const e=this.view.getBigUint64(this.pos);return this.pos+=8,e}readI64AsBigInt(){const e=this.view.getBigInt64(this.pos);return this.pos+=8,e}readF32(){const e=this.view.getFloat32(this.pos);return this.pos+=4,e}readF64(){const e=this.view.getFloat64(this.pos);return this.pos+=8,e}};async function X(e,t){let n;try{n=await fetch(e)}catch{throw new Error(t)}if(!n.ok)throw new Error(t);const r=new Uint8Array(await n.arrayBuffer());return o=r,new G(i).decode(o);var o,i}var Q=/* @__PURE__ */new Map([["en",N]]),Z=/* @__PURE__ */new Map,ee={en:async()=>(await(import("./en-OC6xPyPa.js"))).default,nl:async()=>(await(import("./nl-CHsVPRQk.js"))).default,de:async()=>(await(import("./de-DFLve7VR.js"))).default,fr:async()=>(await(import("./fr-D7NJkc7d.js"))).default,es:async()=>(await(import("./es-CSWz839L.js"))).default,it:async()=>(await(import("./it-BRZbP3bC.js"))).default};async function te(e){const t=R(e),n=Q.get(t);if(n)return n;const r=Z.get(t);if(r)return r;const o=async function(e){return X(await ee[e](),`Failed to load translations for locale "${e}"`)}(t).then(e=>(Q.set(t,e),e)).catch(()=>Q.get("en")??{}).finally(()=>{Z.delete(t)});return Z.set(t,o),o}function ne(e,t){const n=R("undefined"!=typeof window&&window.__localeId__||"en"),r=Q.get(n)??Q.get("en")??{};Q.has(n)||te(n);let o=r[e]||e;return t&&Object.entries(t).forEach(([e,t])=>{o=o.replace(new RegExp(`\\{${e}\\}`,"g"),String(t))}),o}function re(e,t){const n="undefined"!=typeof window&&window.__localeId__||"en";return new Intl.NumberFormat(n,t).format(e)}te("en");var oe=({size:e=14})=>/* @__PURE__ */d("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:/* @__PURE__ */d("path",{d:"M5 5l10 10M15 5L5 15"})});function ie({items:e,onRemove:t,onClear:n}){return 0===e.length?null:/* @__PURE__ */h("div",{className:"bu-active-filters",children:[/* @__PURE__ */h("div",{className:"bu-active-filters-header",children:[/* @__PURE__ */d("span",{children:ne("active_filters",{count:e.length})}),/* @__PURE__ */d("button",{type:"button",className:"bu-link-button",onClick:n,children:ne("clear_all")})]}),/* @__PURE__ */d("div",{className:"bu-pills",children:e.map(e=>/* @__PURE__ */h("button",{type:"button",className:"bu-pill","data-filter-key":e.key,"aria-label":ne("remove_filter",{filter:e.text}),onClick:()=>t(e.key),children:[/* @__PURE__ */d("span",{children:e.text}),/* @__PURE__ */d("span",{className:"bu-pill-remove",children:/* @__PURE__ */d(oe,{})})]},e.key))})]})}var se=({size:e=20})=>/* @__PURE__ */h("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:[
23
+ /* @__PURE__ */d("path",{d:"M3 6h9M15 6h2M3 14h3M9 14h8"}),
24
+ /* @__PURE__ */d("circle",{cx:"13",cy:"6",r:"2"}),
25
+ /* @__PURE__ */d("circle",{cx:"7",cy:"14",r:"2"})]}),ae={en:"en-GB",nl:"nl-NL",de:"de-DE",fr:"fr-FR",it:"it-IT",es:"es-ES"};var ce=/* @__PURE__ */new Map;function ue(e,t){const n=function(){const e="undefined"!=typeof window?window.__localeId__:void 0;return(e&&ae[e])??"en-GB"}(),r=`${n}:${JSON.stringify(t)}`;let o=ce.get(r);return o||(o=new Intl.DateTimeFormat(n,t),ce.set(r,o)),o.format(e)}function le(e){const[t,n,r]=e.split("-").map(Number);return new Date(t,n-1,r)}function de(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function he(e,t){const n=new Date(e);return n.setDate(n.getDate()+t),n}function pe(e,t){return he(e,-t)}function fe(e,t){const n=new Date(e),r=n.getDate();n.setDate(1),n.setMonth(n.getMonth()+t);const o=new Date(n.getFullYear(),n.getMonth()+1,0).getDate();return n.setDate(Math.min(r,o)),n}function me(e,t){return function(e,t){const n=new Date(e),r=n.getMonth(),o=n.getDate();n.setDate(1),n.setFullYear(n.getFullYear()+t),n.setMonth(r);const i=new Date(n.getFullYear(),n.getMonth()+1,0).getDate();return n.setDate(Math.min(o,i)),n}(e,-t)}function ge(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function _e(e){return new Date(e.getFullYear(),e.getMonth(),1)}function ye(e){return new Date(e.getFullYear(),e.getMonth()+1,0)}function ve(e){const t=ge(e);return t.setDate(t.getDate()-t.getDay()),t}function be(e){const t=ge(e);return t.setDate(t.getDate()+(6-t.getDay())),t}function we(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function xe(e,t){return e.getTime()>t.getTime()}function ke(e,t){return e.getTime()<t.getTime()}function Se(e,t){const n=ge(e).getTime(),r=ge(t).getTime();return Math.round((n-r)/864e5)}var Ce={month:"long",year:"numeric"},Ee={weekday:"long",day:"2-digit",month:"long",year:"numeric"},Ne={year:"numeric",month:"long",day:"numeric"};function Te(e){return ue(le(e.slice(0,10)),Ne)}var Re={day:"numeric",month:"short",year:"numeric"};function Ae(e){return null!=e&&("string"==typeof e?""!==e.trim():!Array.isArray(e)||e.length>0)}function $e(e,t){const n={...e};return delete n[t],n}function Pe(e,t){return(Array.isArray(t)?t:[t]).map(t=>function(e){return"date"===e.type||e.id.endsWith("_date")}(e)&&"string"==typeof t?function(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)?ue(le(e),Re):e}(t):function(e,t){const n=String(t);for(const r of e.options)if("object"==typeof r){if(String(r.id)===n)return r.name}else if(String(r)===n)return String(r);return null}(e,t)??String(t)).join(", ")}var De=["countries","regions","cities"];function Le(e,t){return String(e)===String(t)}function je(e,t){return Array.isArray(e)?e.some(e=>Le(e,t)):Le(e,t)}function Ue(e,t){for(const n of e??[])if("object"==typeof n&&Le(n.id,t))return n;return null}function Me(e,t,n,r){let o=Ae(n)?{...e,[t]:n}:$e(e,t);if(!function(e){return De.includes(e)}(t))return o;const i=De.indexOf(t);if(!Ae(n)){for(const e of De.slice(i+1))o=$e(o,e);return o}const s=o;if("cities"===t){const e=Ue(r.get("cities"),n);void 0!==e?.region&&null!==e.region&&(s.regions=String(e.region)),void 0!==e?.country_id&&null!==e.country_id&&(s.countries=String(e.country_id))}else if("regions"===t){const e=Ue(r.get("regions"),n);void 0!==e?.country_id&&null!==e.country_id&&(s.countries=String(e.country_id))}const a=Ue(r.get("regions"),s.regions);Ae(s.regions)&&void 0!==a?.country_id&&Ae(s.countries)&&!je(s.countries,a.country_id)&&(o=$e(o,"regions"));const c=Ue(r.get("cities"),s.cities),u=o;if(Ae(u.cities)&&c){const e=void 0!==c.country_id&&Ae(u.countries)&&!je(u.countries,c.country_id),t=void 0!==c.region&&Ae(u.regions)&&!je(u.regions,c.region);(e||t)&&(o=$e(o,"cities"))}return o}var Oe="bu-filters-panel";function Ie({filters:e,onFilterChange:t,PortalSite:n,options:r}){const[o,i]=u(!1),s=r.searchFields??[],a=s.map(e=>({...e,options:C(e,n)})),c=new Map(a.map(e=>[e.id,e.options])),p=function(e,t){const n=e;return t.filter(e=>Ae(n[e.id])).map(e=>{const t=e.label??e.id,r=Pe(e,n[e.id]);return{key:e.id,label:t,value:r,text:`${t}: ${r}`}})}(e,a),f=e,m=s.filter(e=>!Ae(f[e.id]));function g(n,r){t(Me(e,n,r,c))}const _=Boolean(r.filtersForm.fixed_mobile),y=[r.filtersForm.show??!0?`filters filters-${r.filtersForm.location}`:"filters-hidden",_?"bu-filters-sheet":"",o?"showOnMobile":""].filter(Boolean).join(" "),v=p.length>0?/* @__PURE__ */d("span",{className:"bu-badge",children:p.length}):null;/* @__PURE__ */
26
+ return h(l,{children:[
27
+ /* @__PURE__ */h("button",{type:"button",className:_?"bu-filters-fab":"filters-button","aria-expanded":o,"aria-controls":Oe,onClick:()=>i(!o),children:[_&&/* @__PURE__ */d(se,{}),ne("filters"),v]}),_&&o&&/* @__PURE__ */d("div",{className:"bu-filters-backdrop","data-testid":"filters-backdrop",onClick:()=>i(!1)}),
28
+ /* @__PURE__ */h("div",{id:Oe,className:y,onKeyDown:e=>{"Escape"===e.key&&i(!1)},children:[
29
+ /* @__PURE__ */h("div",{className:"filters-header",children:[/* @__PURE__ */d("span",{className:"filters-title",children:ne("filters")}),/* @__PURE__ */d("button",{type:"button",className:"filters-close","aria-label":ne("close"),onClick:()=>i(!1),children:/* @__PURE__ */d(oe,{size:18})})]}),
30
+ /* @__PURE__ */d(ie,{items:p,onRemove:e=>g(e,null),onClear:()=>t({})}),m.map(t=>/* @__PURE__ */h("div",{className:"bu-field",id:`field-${t.id}`,children:[/* @__PURE__ */d("label",{id:`${t.id}-label`,htmlFor:k(t)?t.id:void 0,children:t.label}),/* @__PURE__ */d(E,{field:t,labelId:`${t.id}-label`,options:c.get(t.id),PortalSite:n,filters:e,value:String(f[t.id]??""),onFilterChange:g})]},t.id)),_&&/* @__PURE__ */d("button",{type:"button",className:"bu-filters-apply",onClick:()=>i(!1),children:ne("show_results")})]})]})}function qe(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function Be(e){return"number"==typeof e?Number.isInteger(e):"string"==typeof e&&/^-?\d+$/.test(e)}function Fe({result:e,options:t,currency:n}){const r=[t.show_city&&`<span>${qe(e.city)}, </span>`,t.show_region&&`<span>${qe(e.province)}, </span>`,t.show_country&&`<span>${qe(e.country_name)}</span>`].filter(Boolean).join(""),o=[t.show_persons&&`<div>${qe(e.persons)} ${qe(ne("persons"))}</div>`,t.show_bedrooms&&`<div>${qe(e.bedrooms)} ${qe(ne("bedrooms"))}</div>`,t.show_bathrooms&&`<div>${qe(e.bathrooms)} ${qe(ne("bathrooms"))}</div>`].filter(Boolean).join(""),i=t.show_rating&&e.rating?`<div class="result-rating bu_card"><div class="result-rating-inner">${qe(e.rating.toFixed(1))}</div></div>`:"",s=t.show_price?e.booking_price?`<div class="result-price">${qe(ne("price_from"))}<span class="price">${qe(re(e.booking_price.total_price,{style:"currency",currency:e.booking_price.currency,minimumFractionDigits:0,maximumFractionDigits:0}))}</span></div>`:`<div class="result-price">${qe(ne("minimum_week_price"))}<span class="price">${qe(re(e.minimum_week_price,{style:"currency",currency:n??"EUR",minimumFractionDigits:0,maximumFractionDigits:0}))}</span></div>`:"";return`\n <a class="bukazu-result bu_card"${e.house_url?` href="${qe(e.house_url)}"`:""}>\n <div class="bukazu-result-inner">\n <div class="image-holder">\n <img${e.image_url?` src="${qe(e.image_url)}"`:""} alt="${qe(e.name)}" />\n </div>\n <div class="result">\n <div class="result-title">${qe(e.name)}</div>\n <div class="result-place">${r}</div>\n <div class="result-description">${e.description}</div>\n <div class="result-details">${o}</div>\n ${i}\n ${s}\n <div class="result-button">${qe(ne("view_details"))}</div>\n </div>\n </div>\n </a>\n `}function ze({onPageChange:e,totalCount:t,activePage:n,limit:r}){const o=r>0?Math.ceil(t/r):0,i=function(e,t){if(t<=7)return Array.from({length:t},(e,t)=>t);let n=Math.max(1,e-Math.floor(2.5)),r=n+5-1;r>=t-1&&(r=t-2,n=r-5+1);const o=[0];n>1&&o.push("...");for(let i=n;i<=r;i++)o.push(i);return r<t-2&&o.push("..."),o.push(t-1),o}(n,o);/* @__PURE__ */
31
+ return h("div",{className:"bu-paginator",children:[/* @__PURE__ */h("div",{children:[t," ",ne("results")]}),o>1&&/* @__PURE__ */h("ul",{className:"bu-pagination",children:[
32
+ /* @__PURE__ */d("li",{className:0===n?"disabled":"",children:/* @__PURE__ */d("button",{disabled:0===n,onClick:()=>e(n-1),"aria-label":ne("previous"),children:"<"})}),i.map((t,r)=>"..."===t?/* @__PURE__ */d("li",{children:/* @__PURE__ */d("span",{"aria-label":"More pages",children:"..."})},`break-${r}`):/* @__PURE__ */d("li",{className:t===n?"selected":"",children:/* @__PURE__ */d("button",{"data-page-button":!0,onClick:()=>e(t),"aria-current":t===n?"page":void 0,children:t+1})},t)),
33
+ /* @__PURE__ */d("li",{className:n===o-1?"disabled":"",children:/* @__PURE__ */d("button",{disabled:n===o-1,onClick:()=>e(n+1),"aria-label":ne("next"),children:">"})})]})]})}var He=({size:e=18})=>/* @__PURE__ */h("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:[
34
+ /* @__PURE__ */d("rect",{x:"3",y:"3",width:"6",height:"6",rx:"1"}),
35
+ /* @__PURE__ */d("rect",{x:"11",y:"3",width:"6",height:"6",rx:"1"}),
36
+ /* @__PURE__ */d("rect",{x:"3",y:"11",width:"6",height:"6",rx:"1"}),
37
+ /* @__PURE__ */d("rect",{x:"11",y:"11",width:"6",height:"6",rx:"1"})]}),Ye=({size:e=18})=>/* @__PURE__ */d("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:/* @__PURE__ */d("path",{d:"M3 5h14M3 10h14M3 15h14"})});function We({mode:e,onChange:t}){/* @__PURE__ */
38
+ return h("div",{className:"bu-view-toggle",role:"group","aria-label":ne("view_mode"),children:[/* @__PURE__ */d("button",{type:"button","aria-pressed":"grid"===e,"aria-label":ne("grid_view"),onClick:()=>t("grid"),children:/* @__PURE__ */d(He,{})}),/* @__PURE__ */d("button",{type:"button","aria-pressed":"list"===e,"aria-label":ne("list_view"),onClick:()=>t("list"),children:/* @__PURE__ */d(Ye,{})})]})}var Je="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,Ve=globalThis,Ke="10.75.0";function Ge(){return Xe(Ve),Ve}function Xe(e){const t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||"10.75.0",t[Ke]=t["10.75.0"]||{}}function Qe(e,t,n=Ve){const r=n.__SENTRY__=n.__SENTRY__||{},o=r[Ke]=r["10.75.0"]||{};return o[e]||(o[e]=t())}var Ze=["debug","info","warn","error","log","assert","trace"],et={};function tt(e){if(!("console"in Ve))return e();const t=Ve.console,n={},r=Object.keys(et);r.forEach(e=>{const r=et[e];n[e]=t[e],t[e]=r});try{return e()}finally{r.forEach(e=>{t[e]=n[e]})}}function nt(){return ot().enabled}function rt(e,...t){Je&&nt()&&tt(()=>{Ve.console[e](`Sentry Logger [${e}]:`,...t)})}function ot(){return Je?Qe("loggerSettings",()=>({enabled:!1})):{enabled:!1}}var it={enable:function(){ot().enabled=!0},disable:function(){ot().enabled=!1},isEnabled:nt,log:function(...e){rt("log",...e)},warn:function(...e){rt("warn",...e)},error:function(...e){rt("error",...e)}},st=/\(error: (.*)\)/,at=/captureMessage|captureException/;function ct(...e){const t=e.sort((e,t)=>e[0]-t[0]).map(e=>e[1]);return(e,n=0,r=0)=>{const o=[],i=e.split("\n");for(let s=n;s<i.length;s++){let e=i[s];e.length>1024&&(e=e.slice(0,1024));const n=st.test(e)?e.replace(st,"$1"):e;if(!n.includes("Error: ")){for(const e of t){const t=e(n);if(t){o.push(t);break}}if(o.length>=50+r)break}}return function(e){if(!e.length)return[];const t=Array.from(e);/sentryWrapped/.test(ut(t).function||"")&&t.pop();t.reverse(),at.test(ut(t).function||"")&&(t.pop(),at.test(ut(t).function||"")&&t.pop());return t.slice(0,50).map(e=>({...e,filename:e.filename||ut(t).filename,function:e.function||"?"}))}(o.slice(r))}}function ut(e){return e[e.length-1]||{}}var lt="<anonymous>";function dt(e){try{return e&&"function"==typeof e&&e.name||lt}catch{return lt}}function ht(e){const t=e.exception;if(t){const e=[];try{return t.values.forEach(t=>{t.stacktrace.frames&&e.push(...t.stacktrace.frames)}),e}catch{return}}}var pt={},ft={};function mt(e,t){return pt[e]=pt[e]||[],pt[e].push(t),()=>{const n=pt[e];if(n){const e=n.indexOf(t);-1!==e&&n.splice(e,1)}}}function gt(e,t){if(!ft[e]){ft[e]=!0;try{t()}catch(ed){Je&&it.error(`Error while instrumenting ${e}`,ed)}}}function _t(e,t){const n=e&&pt[e];if(n)for(const r of n)try{r(t)}catch(ed){Je&&it.error(`Error while triggering instrumentation handler.\nType: ${e}\nName: ${dt(r)}\nError:`,ed)}}var yt=null;function vt(){yt=Ve.onerror,Ve.onerror=function(e,t,n,r,o){return _t("error",{column:r,error:o,line:n,msg:e,url:t}),!!yt&&yt.apply(this,arguments)},Ve.onerror.__SENTRY_INSTRUMENTED__=!0}var bt=null;function wt(){bt=Ve.onunhandledrejection,Ve.onunhandledrejection=function(e){return _t("unhandledrejection",e),!bt||bt.apply(this,arguments)},Ve.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}var xt,kt=Object.prototype.toString;function St(e){switch(kt.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return jt(e,Error)}}function Ct(e,t){return kt.call(e)===`[object ${t}]`}function Et(e){return Ct(e,"ErrorEvent")}function Nt(e){return Ct(e,"DOMError")}function Tt(e){return Ct(e,"String")}function Rt(e){return"object"==typeof e&&null!==e&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function At(e){return null===e||Rt(e)||"object"!=typeof e&&"function"!=typeof e}function $t(e){return Ct(e,"Object")}function Pt(e){return"object"==typeof e&&null!==e}function Dt(e){return"undefined"!=typeof Event&&jt(e,Event)}function Lt(e){return Boolean(e?.then&&"function"==typeof e.then)}function jt(e,t){try{return e instanceof t}catch{return!1}}function Ut(e){return"undefined"!=typeof Request&&jt(e,Request)}function Mt(e,t,n){if(!(t in e))return;const r=e[t];if("function"!=typeof r)return;const o=n(r);"function"==typeof o&&It(o,r);try{e[t]=o}catch{Je&&it.log(`Failed to replace method "${t}" in object`,e)}}function Ot(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{Je&&it.log(`Failed to add non-enumerable property "${String(t)}" to object`,e)}}function It(e,t){try{e.prototype=t.prototype=t.prototype||{},Ot(e,"__sentry_original__",t)}catch{}}function qt(e){return e.__sentry_original__}function Bt(e){if(St(e))return{message:e.message,name:e.name,stack:e.stack,...Ft(e)};if(Dt(e)){const{type:t,target:n,currentTarget:r,detail:o}=e;return{type:t,target:n,currentTarget:r,...o?{detail:o}:{},...Ft(e)}}return e}function Ft(e){return Pt(e)?Object.fromEntries(Object.entries(e)):{}}function zt(e){if(void 0!==xt)return xt?xt(e):e();const t=/* @__PURE__ */Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),n=Ve;return t in n&&"function"==typeof n[t]?(xt=n[t])(e):(xt=null,e())}function Ht(){return zt(()=>Math.random())}function Yt(){return zt(()=>Date.now())}var Wt,Jt,Vt=/* @__PURE__ */Symbol.for("sentry.skipNormalization"),Kt=/* @__PURE__ */Symbol.for("sentry.overrideNormalizationDepth");function Gt(e,t=100,n=1/0){try{return Qt("",e,t,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function Xt(e,t=3,n=102400){const r=Gt(e,t);return o=r,function(e){return~-encodeURI(e).split(/%..|./).length}(JSON.stringify(o))>n?Xt(e,t-1,n):r;var o}function Qt(e,t,n=1/0,r=1/0,o=function(){const e=/* @__PURE__ */new WeakSet;function t(t){return!!e.has(t)||(e.add(t),!1)}function n(t){e.delete(t)}return[t,n]}()){const[i,s]=o;if(null==t||["boolean","string"].includes(typeof t)||"number"==typeof t&&Number.isFinite(t))return t;const a=Zt(e,t);if(!a.startsWith("[object "))return a;if(function(e){return Boolean(e[Vt])}(t))return t;const c=function(e){const t=e[Kt];return"number"==typeof t?t:void 0}(t),u=void 0!==c?c:n;if(0===u)return a.replace("object ","");if(i(t))return"[Circular ~]";const l=t;if(l&&"function"==typeof l.toJSON)try{return Qt("",l.toJSON(),u-1,r,o)}catch{}const d=Array.isArray(t)?[]:{};let h=0;const p=Bt(t);for(const f in p){if(!Object.prototype.hasOwnProperty.call(p,f))continue;if(h>=r){d[f]="[MaxProperties ~]";break}const e=p[f];d[f]=Qt(f,e,u-1,r,o),h++}return s(t),d}function Zt(e,t){try{if(Wt){const e=Wt(t);if(e)return e}return"undefined"!=typeof global&&t===global?"[Global]":"number"!=typeof t||Number.isFinite(t)?"function"==typeof t?`[Function: ${dt(t)}]`:"symbol"==typeof t?`[${String(t)}]`:"bigint"==typeof t?`[BigInt: ${String(t)}]`:`[object ${function(e){const t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:"null prototype"}(t)}]`:`[${t}]`}catch(n){return`**non-serializable** (${n})`}}function en(e,t=0){return"string"!=typeof e||0===t||e.length<=t?e:`${e.slice(0,t)}...`}function tn(e,t){if(!Array.isArray(e))return"";const n=[];for(let r=0;r<e.length;r++){const t=e[r];At(t)?n.push(String(t)):t instanceof Error?n.push(t.message?`${t.name}: ${t.message}`:t.name):n.push(Zt(0,t))}return n.join(t)}function nn(e,t,n=!1){return!!Tt(e)&&(Ct(t,"RegExp")?t.test(e):Tt(t)?n?e===t:e.includes(t):"function"==typeof t&&t(e))}function rn(e,t=[],n=!1){for(const r of t)if(nn(e,r,n))return!0;return!1}function on(e=function(){const e=Ve;return e.crypto||e.msCrypto}()){try{if(e?.randomUUID)return zt(()=>e.randomUUID()).replace(/-/g,"")}catch{}return Jt||(Jt="10000000100040008000100000000000"),Jt.replace(/[018]/g,e=>(e^(16*Ht()&15)>>e/4).toString(16))}function sn(e){return e.exception?.values?.[0]}function an(e){const{message:t,event_id:n}=e;if(t)return t;const r=sn(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function cn(e,t,n){const r=e.exception=e.exception||{},o=r.values=r.values||[],i=o[0]=o[0]||{};i.value||(i.value=t||""),i.type||(i.type=n||"Error")}function un(e,t){const n=sn(e);if(!n)return;const r=n.mechanism;if(n.mechanism={type:"generic",handled:!0,...r,...t},t&&"data"in t){const e={...r?.data,...t.data};n.mechanism.data=e}}function ln(e){if(function(e){try{return e.__sentry_captured__}catch{}}(e))return!0;try{Ot(e,"__sentry_captured__",!0)}catch{}return!1}var dn;function hn(){return Yt()/1e3}function pn(){return(dn??(dn=function(){const{performance:e}=Ve;if(!e?.now||!e.timeOrigin)return hn;const t=e.timeOrigin;return()=>(t+zt(()=>e.now()))/1e3}()))()}function fn(e){const t=pn(),n={sid:on(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(e){return{sid:`${e.sid}`,init:e.init,started:/* @__PURE__ */new Date(1e3*e.started).toISOString(),timestamp:/* @__PURE__ */new Date(1e3*e.timestamp).toISOString(),status:e.status,errors:e.errors,did:"number"==typeof e.did||"string"==typeof e.did?`${e.did}`:void 0,duration:e.duration,abnormal_mechanism:e.abnormal_mechanism,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}}}(n)};return e&&mn(n,e),n}function mn(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),e.did||t.did||(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||pn(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=32===t.sid.length?t.sid:on()),void 0!==t.init&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),"number"==typeof t.started&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if("number"==typeof t.duration)e.duration=t.duration;else{const t=e.timestamp-e.started;e.duration=t>=0?t:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),"number"==typeof t.errors&&(e.errors=t.errors),t.status&&(e.status=t.status)}function gn(e,t,n=2){if(!t||"object"!=typeof t||n<=0)return t;if(e&&0===Object.keys(t).length)return e;const r={...e};for(const o in t)Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=gn(r[o],t[o],n-1));return r}function _n(){return on()}function yn(){return on().substring(16)}function vn(e){if(e){if("object"==typeof e&&"deref"in e&&"function"==typeof e.deref)try{return e.deref()}catch{return}return e}}var bn="_sentrySpan";function wn(e,t){t?Ot(e,bn,function(e){try{const t=Ve.WeakRef;if("function"==typeof t)return new t(e)}catch{}return e}(t)):delete e[bn]}function xn(e){return vn(e[bn])}var kn=class e{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._attributes={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:_n(),sampleRand:Ht()}}clone(){const t=new e;return t._breadcrumbs=[...this._breadcrumbs],t._tags={...this._tags},t._attributes={...this._attributes},t._extra={...this._extra},t._contexts={...this._contexts},this._contexts.flags&&(t._contexts.flags={values:[...this._contexts.flags.values]}),t._user=this._user,t._level=this._level,t._session=this._session,t._transactionName=this._transactionName,t._fingerprint=this._fingerprint,t._eventProcessors=[...this._eventProcessors],t._attachments=[...this._attachments],t._sdkProcessingMetadata={...this._sdkProcessingMetadata},t._propagationContext={...this._propagationContext},t._client=this._client,t._lastEventId=this._lastEventId,t._conversationId=this._conversationId,wn(t,xn(this)),t}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&mn(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}setConversationId(e){return this._conversationId=e||void 0,this._notifyScopeListeners(),this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this.setTags({[e]:t})}setAttributes(e){return this._attributes={...this._attributes,...e},this._notifyScopeListeners(),this}setAttribute(e,t){return this.setAttributes({[e]:t})}removeAttribute(e){return e in this._attributes&&(delete this._attributes[e],this._notifyScopeListeners()),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return null===t?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;const n="function"==typeof t?t(this):t,{tags:r,attributes:o,extra:i,user:s,contexts:a,level:c,fingerprint:u=[],propagationContext:l,conversationId:d}=(n instanceof e?n.getScopeData():$t(n)?t:void 0)||{};return this._tags={...this._tags,...r},this._attributes={...this._attributes,...o},this._extra={...this._extra,...i},this._contexts={...this._contexts,...a},s&&Object.keys(s).length&&(this._user=s),c&&(this._level=c),u.length&&(this._fingerprint=u),l&&(this._propagationContext=l),d&&(this._conversationId=d),this}clear(){return this._breadcrumbs=[],this._tags={},this._attributes={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,this._conversationId=void 0,wn(this,void 0),this._attachments=[],this.setPropagationContext({traceId:_n(),sampleRand:Ht()}),this._notifyScopeListeners(),this}addBreadcrumb(e,t){const n="number"==typeof t?t:100;if(n<=0)return this;const r={timestamp:hn(),...e,message:e.message?en(e.message,2048):e.message};return this._breadcrumbs.push(r),this._breadcrumbs.length>n&&(this._breadcrumbs=this._breadcrumbs.slice(-n),this._client?.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,attributes:this._attributes,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:xn(this),conversationId:this._conversationId}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=gn(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,t){const n=t?.event_id||on();if(!this._client)return Je&&it.warn("No client configured on scope - will not capture exception!"),n;const r=/* @__PURE__ */new Error("Sentry syntheticException");return this._client.captureException(e,{originalException:e,syntheticException:r,...t,event_id:n},this),n}captureMessage(e,t,n){const r=n?.event_id||on();if(!this._client)return Je&&it.warn("No client configured on scope - will not capture message!"),r;const o=n?.syntheticException??new Error(e);return this._client.captureMessage(e,t,{originalException:e,syntheticException:o,...n,event_id:r},this),r}captureEvent(e,t){const n=e.event_id||t?.event_id||on();return this._client?(this._client.captureEvent(e,{...t,event_id:n},this),n):(Je&&it.warn("No client configured on scope - will not capture event!"),n)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}};var Sn=e=>e instanceof Promise&&!e[Cn],Cn=/* @__PURE__ */Symbol("chained PromiseLike"),En=(e,t)=>{if(!t)return e;let n=!1;for(const r in e){if(r in t)continue;n=!0;const o=e[r];"function"==typeof o?Object.defineProperty(t,r,{value:(...t)=>o.apply(e,t),enumerable:!0,configurable:!0,writable:!0}):t[r]=o}return n&&Object.assign(t,{[Cn]:!0}),t},Nn=class{constructor(e,t){let n,r;n=e||new kn,r=t||new kn,this._stack=[{scope:n}],this._isolationScope=r}withScope(e){const t=this._pushScope();let n;try{n=e(t)}catch(ed){throw this._popScope(),ed}return Lt(n)?((e,t,n)=>{const r=e.then(e=>(t(e),e),e=>{throw n(e),e});return Sn(r)&&Sn(e)?r:En(e,r)})(n,()=>this._popScope(),()=>this._popScope()):(this._popScope(),n)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return!(this._stack.length<=1)&&!!this._stack.pop()}};function Tn(){const e=Xe(Ge());return e.stack=e.stack||new Nn(Qe("defaultCurrentScope",()=>new kn),Qe("defaultIsolationScope",()=>new kn))}function Rn(e){return Tn().withScope(e)}function An(e,t){const n=Tn();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function $n(e){return Tn().withScope(()=>e(Tn().getIsolationScope()))}function Pn(e){const t=Xe(e);return t.acs?t.acs:{withIsolationScope:$n,withScope:Rn,withSetScope:An,withSetIsolationScope:(e,t)=>$n(t),getCurrentScope:()=>Tn().getScope(),getIsolationScope:()=>Tn().getIsolationScope()}}function Dn(e,t){const{value:n,unit:r}="object"==typeof(o=e)&&null!=o&&!Array.isArray(o)&&Object.keys(o).includes("value")?e:{value:e,unit:void 0};var o;const i=function(e){if(Array.isArray(e))return{value:e,type:"array"};const t="string"==typeof e?"string":"boolean"==typeof e?"boolean":"number"!=typeof e||Number.isNaN(e)?null:Number.isInteger(e)?"integer":"double";if(t)return{value:e,type:t}}(n),s=r&&"string"==typeof r?{unit:r}:{};if(i)return{...i,...s};if(!t||"skip-undefined"===t&&void 0===n)return;let a="";try{a=JSON.stringify(n)??""}catch{}return{value:a,type:"string",...s}}function Ln(e,t=!1){const n={};for(const[r,o]of Object.entries(e??{})){const e=Dn(o,t);e&&(n[r]=e)}return n}function jn(){return Pn(Ge()).getCurrentScope()}function Un(){return Pn(Ge()).getIsolationScope()}function Mn(){return jn().getClient()}function On(e){const t=void 0;const{traceId:n,parentSpanId:r,propagationSpanId:o}=e.getPropagationContext(),i={trace_id:n,span_id:o||yn()};return r&&(i.parent_span_id=r),i}function In(e){const t=e;return{scope:t._sentryScope,isolationScope:vn(t._sentryIsolationScope)}}function qn(e){const t=function(e){if(!e||!Tt(e)&&!Array.isArray(e))return;return Array.isArray(e)?e.reduce((e,t)=>{const n=Bn(t);return Object.entries(n).forEach(([t,n])=>{e[t]=n}),e},{}):Bn(e)}(e);if(!t)return;const n=Object.entries(t).reduce((e,[t,n])=>{if(t.startsWith("sentry-")){e[t.slice(7)]=n}return e},{});return Object.keys(n).length>0?n:void 0}function Bn(e){return e.split(",").map(e=>{const t=e.indexOf("=");return-1===t?[]:[e.slice(0,t),e.slice(t+1)].map(e=>{try{return decodeURIComponent(e.trim())}catch{return}})}).reduce((e,[t,n])=>(t&&n&&(e[t]=n),e),{})}var Fn=/^o(\d+)\./,zn=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function Hn(e,t=!1){const{host:n,path:r,pass:o,port:i,projectId:s,protocol:a,publicKey:c}=e;return`${a}://${c}${t&&o?`:${o}`:""}@${n}${i?`:${i}`:""}/${r?`${r}/`:r}${s}`}function Yn(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function Wn(e){const t=e.getOptions(),{host:n}=e.getDsn()||{};let r;return t.orgId?r=String(t.orgId):n&&(r=function(e){return e.match(Fn)?.[1]}(n)),r}function Jn(e){const t="string"==typeof e?function(e){const t=zn.exec(e);if(!t)return void tt(()=>{});const[n,r,o="",i="",s="",a=""]=t.slice(1);let c="",u=a;const l=u.split("/");if(l.length>1&&(c=l.slice(0,-1).join("/"),u=l.pop()),u){const e=u.match(/^\d+/);e&&(u=e[0])}return Yn({host:i,pass:o,path:c,projectId:u,port:s,protocol:n,publicKey:r})}(e):Yn(e);if(t&&function(e){if(!Je)return!0;const{port:t,projectId:n,protocol:r}=e;return!(["protocol","publicKey","host","projectId"].find(t=>!e[t]&&(it.error(`Invalid Sentry Dsn: ${t} missing`),!0))||(n.match(/^\d+$/)?function(e){return"http"===e||"https"===e}(r)?t&&isNaN(parseInt(t,10))&&(it.error(`Invalid Sentry Dsn: Invalid port ${t}`),1):(it.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),1):(it.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),1)))}(t))return t}var Vn=!1;function Kn(e){const{spanId:t,traceId:n,isRemote:r}=e.spanContext(),o=r?t:Zn(e).parent_span_id,i=In(e).scope;return{parent_span_id:o,span_id:r?i?.getPropagationContext().propagationSpanId||yn():t,trace_id:n}}function Gn(e){return e&&e.length>0?e.map(({context:{spanId:e,traceId:t,traceFlags:n,...r},attributes:o})=>({span_id:e,trace_id:t,sampled:1===n,attributes:o,...r})):void 0}function Xn(e){return"number"==typeof e?Qn(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?Qn(e.getTime()):pn()}function Qn(e){return e>9999999999?e/1e3:e}function Zn(e){if(function(e){return"function"==typeof e.getSpanJSON}(e))return e.getSpanJSON();const{spanId:t,traceId:n}=e.spanContext();if(function(e){const t=e;return!!(t.attributes&&t.startTime&&t.name&&t.endTime&&t.status)}(e)){const{attributes:r,startTime:o,name:i,endTime:s,status:a,links:c}=e;return{span_id:t,trace_id:n,data:r,description:i,parent_span_id:er(e),start_timestamp:Xn(o),timestamp:Xn(s)||void 0,status:tr(a),op:r["sentry.op"],origin:r["sentry.origin"],links:Gn(c)}}return{span_id:t,trace_id:n,start_timestamp:0,data:{}}}function er(e){return"parentSpanId"in e?e.parentSpanId:"parentSpanContext"in e?e.parentSpanContext?.spanId:void 0}function tr(e){if(e&&0!==e.code)return 1===e.code?"ok":e.message||"internal_error"}var nr=function(e){return e._sentryRootSpan||e};function rr(){Vn||(tt(()=>{}),Vn=!0)}function or(e){if("boolean"==typeof __SENTRY_TRACING__&&!__SENTRY_TRACING__)return!1;const t=e||Mn()?.getOptions();return!(!t||null==t.tracesSampleRate&&!t.tracesSampler)}function ir(e){it.log(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function sr(e,t){if(!t?.length)return!1;for(const n of t){if(ur(n)){if(e.description&&nn(e.description,n))return Je&&ir(e),!0;continue}const t=!!n.attributes&&Object.keys(n.attributes).length>0;if(!n.name&&!n.op&&!t)continue;const r=!n.name||e.description&&nn(e.description,n.name),o=!n.op||e.op&&nn(e.op,n.op),i=!n.attributes||Object.entries(n.attributes).every(([t,n])=>ar(e.attributes?.[t],n));if(r&&o&&i)return Je&&ir(e),!0}return!1}function ar(e,t){return"string"==typeof e&&("string"==typeof t||t instanceof RegExp)?nn(e,t):Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((e,n)=>e===t[n]):e===t}function cr(e,t){const n=t.parent_span_id,r=t.span_id;if(n)for(const o of e)o.parent_span_id===r&&(o.parent_span_id=n)}function ur(e){return"string"==typeof e||e instanceof RegExp}var lr=/* @__PURE__ */Symbol.for("sentry.nonRecordingSpan");var dr="production";function hr(e,t){const n=t.getOptions(),{publicKey:r}=t.getDsn()||{},o={environment:n.environment||"production",release:n.release,public_key:r,trace_id:e,org_id:Wn(t)};return t.emit("createDsc",o),o}function pr(e,t){const n=t.getPropagationContext();return n.dsc||hr(n.traceId,e)}function fr(e){const t=Mn();if(!t)return{};const n=nr(e),r=Zn(n),o=r.data,i=n.spanContext().traceState,s=i?.get("sentry.sample_rate")??o["sentry.sample_rate"]??o["sentry.previous_trace_sample_rate"];function a(e){return"number"!=typeof s&&"string"!=typeof s||(e.sample_rate=`${s}`),e}const c=n._frozenDsc;if(c)return a(c);const u=function(e){return!!e&&!0===e[lr]}(n),l=u&&"ignored"===n.dropReason;if(u&&(!or(t.getOptions())||l)){const e=In(n).scope;if(e){const n={...pr(t,e)};return l&&(n.sampled="false"),a(n)}}const d=i?.get("sentry.dsc"),h=d&&qn(d);if(h)return a(h);const p=hr(e.spanContext().traceId,t),f=o["sentry.source"]??o["sentry.segment.name.source"],m=r.description;return"url"!==f&&m&&(p.transaction=m),or()&&(p.sampled=String(function(e){const{traceFlags:t}=e.spanContext();return 1===t}(n)),p.sample_rand=i?.get("sentry.sample_rand")??In(n).scope?.getPropagationContext().sampleRand.toString()),a(p),t.emit("createDsc",p,n),p}function mr(e,t=[]){return[e,t]}function gr(e,t){const[n,r]=e;return[n,[...r,t]]}function _r(e,t){const n=e[1];for(const r of n){if(t(r,r[0].type))return!0}return!1}function yr(e){const t=Xe(Ve);return t.encodePolyfill?t.encodePolyfill(e):(new TextEncoder).encode(e)}function vr(e){const[t,n]=e;let r=JSON.stringify(t);function o(e){"string"==typeof r?r="string"==typeof e?r+e:[yr(r),e]:r.push("string"==typeof e?yr(e):e)}for(const i of n){const[e,t]=i;if(o(`\n${JSON.stringify(e)}\n`),"string"==typeof t||t instanceof Uint8Array)o(t);else{let e;try{e=JSON.stringify(t)}catch{e=JSON.stringify(Gt(t))}o(e)}}return"string"==typeof r?r:function(e){const t=e.reduce((e,t)=>e+t.length,0),n=new Uint8Array(t);let r=0;for(const o of e)n.set(o,r),r+=o.length;return n}(r)}function br(e){const t="string"==typeof e.data?yr(e.data):e.data;return[{type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}var wr={sessions:"session",event:"error",client_report:"internal",user_report:"default",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",raw_security:"security",log:"log_item",trace_metric:"metric"};function xr(e){return function(e){return e in wr}(e)?wr[e]:e}function kr(e){if(!e?.sdk)return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}function Sr(e,t,n,r){const o=kr(n),i=e.type&&"replay_event"!==e.type?e.type:"event";!function(e,t){if(!t)return e;const n=e.sdk||{};e.sdk={...n,name:n.name||t.name,version:n.version||t.version,integrations:[...e.sdk?.integrations||[],...t.integrations||[]],packages:[...e.sdk?.packages||[],...t.packages||[]],settings:e.sdk?.settings||t.settings?{...e.sdk?.settings,...t.settings}:void 0}}(e,n?.sdk);const s=function(e,t,n,r){const o=e.sdkProcessingMetadata?.dynamicSamplingContext;return{event_id:e.event_id,sent_at:new Date(Yt()).toISOString(),...t&&{sdk:t},...!!n&&r&&{dsn:Hn(r)},...o&&{trace:o}}}(e,o,r,t);return delete e.sdkProcessingMetadata,mr(s,[[{type:i},e]])}function Cr(e,t){const{fingerprint:n,span:r,breadcrumbs:o,sdkProcessingMetadata:i}=t;!function(e,t){const{extra:n,tags:r,user:o,contexts:i,level:s,transactionName:a}=t;Object.keys(n).length&&(e.extra={...n,...e.extra});Object.keys(r).length&&(e.tags={...r,...e.tags});Object.keys(o).length&&(e.user={...o,...e.user});Object.keys(i).length&&(e.contexts={...i,...e.contexts});s&&(e.level=s);a&&"transaction"!==e.type&&(e.transaction=a)}(e,t),r&&function(e,t){e.contexts={trace:Kn(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:fr(t),...e.sdkProcessingMetadata};const n=nr(t),r=Zn(n).description;r&&!e.transaction&&"transaction"===e.type&&(e.transaction=r)}(e,r),function(e,t){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],t&&(e.fingerprint=e.fingerprint.concat(t));e.fingerprint.length||delete e.fingerprint}(e,n),function(e,t){const n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}(e,o),function(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}(e,i)}function Er(e,t){const{extra:n,tags:r,attributes:o,user:i,contexts:s,level:a,sdkProcessingMetadata:c,breadcrumbs:u,fingerprint:l,eventProcessors:d,attachments:h,propagationContext:p,transactionName:f,span:m}=t;Nr(e,"extra",n),Nr(e,"tags",r),Nr(e,"attributes",o),Nr(e,"user",i),Nr(e,"contexts",s),e.sdkProcessingMetadata=gn(e.sdkProcessingMetadata,c,2),a&&(e.level=a),f&&(e.transactionName=f),m&&(e.span=m),u.length&&(e.breadcrumbs=[...e.breadcrumbs,...u]),l.length&&(e.fingerprint=[...e.fingerprint,...l]),d.length&&(e.eventProcessors=[...e.eventProcessors,...d]),h.length&&(e.attachments=[...e.attachments,...h]),e.propagationContext={...e.propagationContext,...p}}function Nr(e,t,n){e[t]=gn(e[t],n,1)}function Tr(e,t){const n=Qe("globalScope",()=>new kn).getScopeData();return e&&Er(n,e.getScopeData()),t&&Er(n,t.getScopeData()),n}var Rr="user_agent.original";function Ar(e,t){const n=e.attributes??(e.attributes={});Object.entries(t).forEach(([e,t])=>{null==t||e in n||(n[e]=t)})}function $r(e){return new Mr(t=>{t(e)})}function Pr(e){return new Mr((t,n)=>{n(e)})}var Dr,Lr,jr,Ur,Mr=class e{constructor(e){this._state=0,this._handlers=[],this._runExecutor(e)}then(t,n){return new e((e,r)=>{this._handlers.push([!1,n=>{if(t)try{e(t(n))}catch(ed){r(ed)}else e(n)},t=>{if(n)try{e(n(t))}catch(ed){r(ed)}else r(t)}]),this._executeHandlers()})}catch(e){return this.then(e=>e,e)}finally(t){return new e((e,n)=>{let r,o;return this.then(e=>{o=!1,r=e,t&&t()},e=>{o=!0,r=e,t&&t()}).then(()=>{o?n(r):e(r)})})}_executeHandlers(){if(0===this._state)return;const e=this._handlers.slice();this._handlers=[],e.forEach(e=>{e[0]||(1===this._state&&e[1](this._value),2===this._state&&e[2](this._value),e[0]=!0)})}_runExecutor(e){const t=(e,t)=>{0===this._state&&(Lt(t)?t.then(n,r):(this._state=e,this._value=t,this._executeHandlers()))},n=e=>{t(1,e)},r=e=>{t(2,e)};try{e(n,r)}catch(ed){r(ed)}}};function Or(e,t,n,r=0){try{const o=Ir(t,n,e,r);return Lt(o)?o:$r(o)}catch(o){return Pr(o)}}function Ir(e,t,n,r){const o=n[r];if(!e||!o)return e;const i=o({...e},t);return Je&&null===i&&it.log(`Event processor "${o.id||"?"}" dropped event`),Lt(i)?i.then(e=>Ir(e,t,n,r+1)):Ir(i,t,n,r+1)}function qr(e,t,n,r,o,i){const{normalizeDepth:s=3,normalizeMaxBreadth:a=1e3}=e,c={...t,event_id:t.event_id||n.event_id||on(),timestamp:t.timestamp||hn()},u=n.integrations||e.integrations.map(e=>e.name);!function(e,t){const{environment:n,release:r,dist:o,maxValueLength:i}=t;e.environment=e.environment||n||"production",!e.release&&r&&(e.release=r);!e.dist&&o&&(e.dist=o);const s=e.request;s?.url&&i&&(s.url=en(s.url,i));i&&e.exception?.values?.forEach(e=>{e.value&&(e.value=en(e.value,i))})}(c,e),function(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}(c,u),o&&o.emit("applyFrameMetadata",t),void 0===t.type&&function(e,t){const n=function(e){const t=Ve._sentryDebugIds,n=Ve._debugIds;if(!t&&!n)return{};const r=t?Object.keys(t):[],o=n?Object.keys(n):[];if(Ur&&r.length===Lr&&o.length===jr)return Ur;Lr=r.length,jr=o.length,Ur={},Dr||(Dr={});const i=(t,n)=>{for(const r of t){const t=n[r],o=Dr?.[r];if(o&&Ur&&t)Ur[o[0]]=t,Dr&&(Dr[r]=[o[0],t]);else if(t){const n=e(r);for(let e=n.length-1;e>=0;e--){const o=n[e]?.filename;if(o&&Ur&&Dr){Ur[o]=t,Dr[r]=[o,t];break}}}}};return t&&i(r,t),n&&i(o,n),Ur}(t);e.exception?.values?.forEach(e=>{e.stacktrace?.frames?.forEach(e=>{e.filename&&(e.debug_id=n[e.filename])})})}(c,e.stackParser);const l=function(e,t){if(!t)return e;const n=e?e.clone():new kn;return n.update(t),n}(r,n.captureContext);n.mechanism&&un(c,n.mechanism);const d=o?o.getEventProcessors():[],h=Tr(i,l),p=[...n.attachments||[],...h.attachments];p.length&&(n.attachments=p),Cr(c,h);const f=[...d,...h.eventProcessors];return(n.data&&!0===n.data.__sentry__?$r(c):Or(f,c,n)).then(e=>(e&&function(e){const t={};if(e.exception?.values?.forEach(e=>{e.stacktrace?.frames?.forEach(e=>{e.debug_id&&(e.abs_path?t[e.abs_path]=e.debug_id:e.filename&&(t[e.filename]=e.debug_id),delete e.debug_id)})}),0===Object.keys(t).length)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];const n=e.debug_meta.images;Object.entries(t).forEach(([e,t])=>{n.push({type:"sourcemap",code_file:e,debug_id:t})})}(e),"number"==typeof s&&s>0?function(e,t,n){if(!e)return null;const r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(e=>({...e,...e.data&&{data:Gt(e.data,t,n)}}))},...e.user&&{user:Gt(e.user,t,n)},...e.contexts&&{contexts:Gt(e.contexts,t,n)},...e.extra&&{extra:Gt(e.extra,t,n)}};e.contexts?.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=Gt(e.contexts.trace.data,t,n)));e.spans&&(r.spans=e.spans.map(e=>({...e,...e.data&&{data:Gt(e.data,t,n)}})));e.contexts?.flags&&r.contexts&&(r.contexts.flags=Gt(e.contexts.flags,3,n));return r}(e,s,a):e))}function Br(e){if(e)return function(e){return e instanceof kn||"function"==typeof e}(e)||function(e){return Object.keys(e).some(e=>Fr.includes(e))}(e)?{captureContext:e}:e}var Fr=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function zr(e,t){return jn().captureException(e,Br(t))}function Hr(e,t){return jn().captureEvent(e,t)}function Yr(e,t){Un().setTag(e,t)}function Wr(e){const t=Un(),{user:n}=Tr(t,jn()),{userAgent:r}=Ve.navigator||{},o=fn({user:n,...r&&{userAgent:r},...e}),i=t.getSession();return"ok"===i?.status&&mn(i,{status:"exited"}),Jr(),t.setSession(o),o}function Jr(){const e=Un(),t=jn().getSession()||e.getSession();t&&function(e,t){let n={};t?n={status:t}:"ok"===e.status&&(n={status:"exited"}),mn(e,n)}(t),Vr(),e.setSession()}function Vr(){const e=Un(),t=Mn(),n=e.getSession();n&&t&&t.captureSession(n)}function Kr(e=!1){e?Jr():Vr()}function Gr(e){return"object"==typeof e&&"function"==typeof e.unref&&e.unref(),e}function Xr(e,t,n){return t||`${function(e){return`${function(e){const t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}(e)}${e.projectId}/envelope/`}(e)}?${function(e,t){const n={sentry_version:"7"};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}(e,n)}`}var Qr=[];function Zr(e){const t=e.defaultIntegrations||[],n=e.integrations;let r;if(t.forEach(e=>{e.isDefaultInstance=!0}),Array.isArray(n))r=[...t,...n];else if("function"==typeof n){const e=n(t);r=Array.isArray(e)?e:[e]}else r=t;return function(e){const t={};return e.forEach(e=>{const{name:n}=e,r=t[n];r&&!r.isDefaultInstance&&e.isDefaultInstance||(t[n]=e)}),Object.values(t)}(r)}function eo(e,t){for(const n of t)n?.afterAllSetup&&n.afterAllSetup(e)}function to(e,t,n){if(n[t.name])Je&&it.log(`Integration skipped because it was already installed: ${t.name}`);else{if(n[t.name]=t,Qr.includes(t.name)||"function"!=typeof t.setupOnce||(t.setupOnce(),Qr.push(t.name)),t.setup&&"function"==typeof t.setup&&t.setup(e),"function"==typeof t.preprocessEvent){const n=t.preprocessEvent.bind(t);e.on("preprocessEvent",(t,r)=>n(t,r,e))}if("function"==typeof t.processEvent){const n=t.processEvent.bind(t),r=Object.assign((t,r)=>n(t,r,e),{id:t.name});e.addEventProcessor(r)}["processSpan","processSegmentSpan"].forEach(n=>{const r=t[n];"function"==typeof r&&e.on(n,n=>r.call(t,n,e))}),Je&&it.log(`Integration installed: ${t.name}`)}}function no(){return!("undefined"!=typeof __SENTRY_BROWSER_BUNDLE__&&__SENTRY_BROWSER_BUNDLE__)&&"[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0)}function ro(){return"undefined"!=typeof window&&(!no()||"renderer"===Ve.process?.type)}function oo(e,t){const n=t?"auto":"never";return[{type:"log",item_count:e.length,content_type:"application/vnd.sentry.items.log+json"},{version:2,...ro()&&{ingest_settings:{infer_ip:n,infer_user_agent:n}},items:e}]}function io(e,t){const n=t??function(e){return so().get(e)}(e)??[];if(0===n.length)return;const r=e.getOptions(),o=function(e,t,n,r,o){const i={};return t?.sdk&&(i.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(i.dsn=Hn(r)),mr(i,[oo(e,o)])}(n,r._metadata,r.tunnel,e.getDsn(),e.getDataCollectionOptions().userInfo);so().set(e,[]),e.emit("flushLogs"),e.sendEnvelope(o)}function so(){return Qe("clientToLogBufferMap",()=>/* @__PURE__ */new WeakMap)}function ao(e,t){const n=t?"auto":"never";return[{type:"trace_metric",item_count:e.length,content_type:"application/vnd.sentry.items.trace-metric+json"},{version:2,...ro()&&{ingest_settings:{infer_ip:n,infer_user_agent:n}},items:e}]}function co(e,t){const n=t??function(e){return uo().get(e)}(e)??[];if(0===n.length)return;const r=e.getOptions(),o=function(e,t,n,r,o){const i={};return t?.sdk&&(i.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(i.dsn=Hn(r)),mr(i,[ao(e,o)])}(n,r._metadata,r.tunnel,e.getDsn(),e.getDataCollectionOptions().userInfo);uo().set(e,[]),e.emit("flushMetrics"),e.sendEnvelope(o)}function uo(){return Qe("clientToMetricBufferMap",()=>/* @__PURE__ */new WeakMap)}function lo(e){const t={trace_id:e.trace_id,span_id:e.span_id,parent_span_id:e.parent_span_id,name:e.description||"",start_timestamp:e.start_timestamp,end_timestamp:e.timestamp||e.start_timestamp,status:e.status&&"ok"!==e.status&&"cancelled"!==e.status?"error":"ok",is_segment:!1,attributes:{...e.data},links:e.links};return n=t,{...n,attributes:Ln(n.attributes),links:n.links?.map(e=>({...e,attributes:Ln(e.attributes)}))};var n}var ho=/* @__PURE__ */Symbol.for("SentryBufferFullError");function po(e=100){const t=/* @__PURE__ */new Set;function n(e){t.delete(e)}return{get $(){return Array.from(t)},add:function(r){if(!(t.size<e))return Pr(ho);const o=r();return t.add(o),o.then(()=>n(o),()=>n(o)),o},drain:function(e){if(!t.size)return $r(!0);const n=Promise.allSettled(Array.from(t)).then(()=>!0);if(!e)return n;const r=[n,new Promise(t=>Gr(setTimeout(()=>t(!1),e)))];return Promise.race(r)}}}function fo(e,{statusCode:t,headers:n},r=Yt()){const o={...e},i=n?.["x-sentry-rate-limits"],s=n?.["retry-after"];if(i)for(const a of i.trim().split(",")){const[e,t,,,n]=a.split(":",5),i=parseInt(e,10),s=1e3*(isNaN(i)?60:i);if(t)for(const a of t.split(";"))"metric_bucket"===a&&n&&!n.split(";").includes("custom")||(o[a]=r+s);else o.all=r+s}else s?o.all=r+function(e,t=Yt()){const n=parseInt(`${e}`,10);if(!isNaN(n))return 1e3*n;const r=Date.parse(`${e}`);return isNaN(r)?6e4:r-t}(s,r):429===t&&(o.all=r+6e4);return o}function mo(e,t,n=po(e.bufferSize||64)){let r={};return{send:function(o){const i=[];if(_r(o,(t,n)=>{const o=xr(n);!function(e,t,n=Yt()){return function(e,t){return e[t]||e.all||0}(e,t)>n}(r,o)?i.push(t):e.recordDroppedEvent("ratelimit_backoff",o)}),0===i.length)return Promise.resolve({});const s=mr(o[0],i),a=t=>{!function(e,t){return _r(e,(e,n)=>t.includes(n))}(s,["client_report"])?_r(s,(n,r)=>{e.recordDroppedEvent(t,xr(r))}):Je&&it.warn(`Dropping client report. Will not send outcomes (reason: ${t}).`)};return n.add(()=>t({body:vr(s)}).then(e=>413===e.statusCode?(Je&&it.error("Sentry responded with status code 413. Envelope was discarded due to exceeding size limits."),a("send_error"),e):(Je&&void 0!==e.statusCode&&(e.statusCode<200||e.statusCode>=300)&&it.warn(`Sentry responded with status code ${e.statusCode} to sent event.`),r=fo(r,e),e),e=>{throw a("network_error"),Je&&it.error("Encountered error running transport request:",e),e})).then(e=>e,e=>{if(e===ho)return Je&&it.error("Skipped sending event because buffer is full."),a("queue_overflow"),Promise.resolve({});throw e})},flush:e=>n.drain(e)}}function go(e){const t=[];e.message&&t.push(e.message);try{const n=e.exception.values[e.exception.values.length-1];n?.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`))}catch{}return t}var _o=["forwarded","-ip","remote-","via","-user"];var yo={userInfo:!0,cookies:!0,httpHeaders:{request:!0,response:!0},httpBodies:["incomingRequest","outgoingRequest","incomingResponse","outgoingResponse"],urlQueryParams:!0,graphQL:{document:!0,variables:!0},genAI:{inputs:!0,outputs:!0},databaseQueryData:!0,stackFrameVariables:!0,frameContextLines:5};function vo(e,t){return void 0===e?{...t.httpHeaders}:"boolean"==typeof(n=e)||"allow"in n||"deny"in n?{request:e,response:e}:{request:e.request??t.httpHeaders.request,response:e.response??t.httpHeaders.response};var n}function bo(e){const t=null!=e.dataCollection?yo:!0===e.sendDefaultPii?{userInfo:!0,cookies:!0,httpHeaders:{request:!0,response:!0},httpBodies:["incomingRequest","outgoingRequest","incomingResponse","outgoingResponse"],urlQueryParams:!0,graphQL:{document:!0,variables:!0},genAI:{inputs:!0,outputs:!0},databaseQueryData:!0,stackFrameVariables:!0,frameContextLines:7}:{userInfo:!1,cookies:{deny:_o},httpHeaders:{request:{deny:_o},response:{deny:_o}},httpBodies:[],urlQueryParams:{deny:_o},graphQL:{document:!0,variables:!0},genAI:{inputs:!1,outputs:!1},databaseQueryData:!1,stackFrameVariables:!0,frameContextLines:7};const n=e.dataCollection??{};return{userInfo:n.userInfo??t.userInfo,cookies:n.cookies??t.cookies,httpHeaders:vo(n.httpHeaders,t),httpBodies:n.httpBodies??t.httpBodies,urlQueryParams:n.urlQueryParams??n.queryParams??t.urlQueryParams,graphQL:{document:n.graphQL?.document??t.graphQL.document,variables:n.graphQL?.variables??t.graphQL.variables},genAI:{inputs:n.genAI?.inputs??t.genAI.inputs,outputs:n.genAI?.outputs??t.genAI.outputs},databaseQueryData:n.databaseQueryData??t.databaseQueryData,stackFrameVariables:n.stackFrameVariables??t.stackFrameVariables,frameContextLines:n.frameContextLines??t.frameContextLines}}var wo="Not capturing exception because it's already been captured.",xo="Discarded session because of missing or non-string release",ko=/* @__PURE__ */Symbol.for("SentryInternalError"),So=/* @__PURE__ */Symbol.for("SentryDoNotSendEventError");function Co(e){return{message:e,[ko]:!0}}function Eo(e){return{message:e,[So]:!0}}function No(e){return Pt(e)&&ko in e}function To(e){return Pt(e)&&So in e}function Ro(e,t,n,r,o){let i,s=0,a=!1;e.on(n,()=>{s=0,clearTimeout(i),a=!1}),e.on(t,t=>{if(s+=r(t),s>=8e5)o(e);else if(!a){const t=e.getOptions()._flushInterval??5e3;t>0&&(a=!0,i=Gr(setTimeout(()=>{o(e)},t)))}}),e.on("flush",()=>{o(e)})}var Ao=class{constructor(e){if(this._options=e,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=po(e.transportOptions?.bufferSize??64),this._dataCollection=bo(e),e.dsn?this._dsn=Jn(e.dsn):Je&&it.warn("No DSN provided, client will not send events."),this._dsn){const t=Xr(this._dsn,e.tunnel,e._metadata?e._metadata.sdk:void 0);this._transport=e.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:t})}this._options.enableLogs=this._options.enableLogs??this._options._experiments?.enableLogs??!0,this._options.enableLogs&&Ro(this,"afterCaptureLog","flushLogs",jo,io),(this._options.enableMetrics??this._options._experiments?.enableMetrics??!0)&&Ro(this,"afterCaptureMetric","flushMetrics",Lo,co)}captureException(e,t,n){const r=on();if(ln(e))return Je&&it.log(wo),r;const o={event_id:r,...t};return this._process(()=>this.eventFromException(e,o).then(e=>this._captureEvent(e,o,n)).then(e=>e),"error"),o.event_id}captureMessage(e,t,n,r){const o={event_id:on(),...n},i=Rt(e)?e:String(e),s=At(e),a=s?this.eventFromMessage(i,t,o):this.eventFromException(e,o);return this._process(()=>a.then(e=>this._captureEvent(e,o,r)),s?"unknown":"error"),o.event_id}captureEvent(e,t,n){const r=on();if(t?.originalException&&ln(t.originalException))return Je&&it.log(wo),r;const o={event_id:r,...t},i=e.sdkProcessingMetadata||{},s=i.capturedSpanScope,a=i.capturedSpanIsolationScope,c=$o(e.type);return this._process(()=>this._captureEvent(e,o,s||n,a),c),o.event_id}captureSession(e){this.sendSession(e),mn(e,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getDataCollectionOptions(){return this._dataCollection}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}async flush(e){const t=this._transport;if(this.emit("flush"),!t)return!0;const n=await this._isClientDoneProcessing(e),r=await t.flush(e);return n&&r}async close(e){const t=await this.flush(e);return this.getOptions().enabled=!1,this.emit("close"),t}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}init(){(this._isEnabled()||this._options.integrations.some(({name:e})=>e.startsWith("Spotlight")))&&this._setupIntegrations()}getIntegrationByName(e){return this._integrations[e]}getIntegrationNames(){return Object.keys(this._integrations)}addIntegration(e){const t=this._integrations[e.name];!t&&e.beforeSetup&&e.beforeSetup(this),to(this,e,this._integrations),t||eo(this,[e])}sendEvent(e,t={}){this.emit("beforeSendEvent",e,t);const n=function(e,t){if("transaction"!==e.type||!e.spans?.length||!e.sdkProcessingMetadata?.hasGenAiSpans||!1===t.getOptions().streamGenAiSpans||function(e){return"stream"===e.getOptions().traceLifecycle}(t))return;const n=[],r=[];for(const i of e.spans)i.op?.startsWith("gen_ai.")?n.push(lo(i)):r.push(i);if(0===n.length)return;e.spans=r;const o=t.getDataCollectionOptions().userInfo?"auto":"never";return[{type:"span",item_count:n.length,content_type:"application/vnd.sentry.items.span.v2+json"},{version:2,...ro()&&{ingest_settings:{infer_ip:o,infer_user_agent:o}},items:n}]}(e,this);let r=Sr(e,this._dsn,this._options._metadata,this._options.tunnel);for(const o of t.attachments||[])r=gr(r,br(o));n&&(r=gr(r,n)),this.sendEnvelope(r).then(t=>this.emit("afterSendEvent",e,t))}sendSession(e){const{release:t,environment:n=dr}=this._options;if("aggregates"in e){const r=e.attrs||{};if(!r.release&&!t)return void(Je&&it.warn(xo));r.release=r.release||t,r.environment=r.environment||n,e.attrs=r}else{if(!e.release&&!t)return void(Je&&it.warn(xo));e.release=e.release||t,e.environment=e.environment||n}this.emit("beforeSendSession",e);const r=function(e,t,n,r){const o=kr(n);return mr({sent_at:new Date(Yt()).toISOString(),...o&&{sdk:o},...!!r&&t&&{dsn:Hn(t)}},["aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()]])}(e,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(r)}recordDroppedEvent(e,t,n=1){if(this._options.sendClientReports){const r=`${e}:${t}`;Je&&it.log(`Recording outcome: "${r}"${n>1?` (${n} times)`:""}`),this._outcomes[r]=(this._outcomes[r]||0)+n}}on(e,t){const n=this._hooks[e]=this._hooks[e]||/* @__PURE__ */new Set,r=(...e)=>t(...e);return n.add(r),()=>{n.delete(r)}}emit(e,...t){const n=this._hooks[e];n&&n.forEach(e=>e(...t))}async sendEnvelope(e){if(this.emit("beforeEnvelope",e),this._isEnabled()&&this._transport)try{return await this._transport.send(e)}catch(t){return Je&&it.error("Error while sending envelope:",t),{}}return Je&&it.error("Transport disabled"),{}}registerCleanup(e){}dispose(){}_setupIntegrations(){const{integrations:e}=this._options;this._integrations=function(e,t){const n={};return t.forEach(t=>{t?.beforeSetup&&t.beforeSetup(e)}),t.forEach(t=>{t&&to(e,t,n)}),n}(this,e),eo(this,e)}_updateSessionFromEvent(e,t){let n="fatal"===t.level,r=!1;const o=t.exception?.values;if(o){r=!0,n=!1;for(const e of o)if(!1===e.mechanism?.handled){n=!0;break}}const i="ok"===e.status;(i&&0===e.errors||i&&n)&&(mn(e,{...n&&{status:"crashed"},errors:e.errors||Number(r||n)}),this.captureSession(e))}async _isClientDoneProcessing(e){let t=0;for(;!e||t<e;){if(await new Promise(e=>setTimeout(e,1)),!this._numProcessing)return!0;t++}return!1}_isEnabled(){return!1!==this.getOptions().enabled&&void 0!==this._transport}_prepareEvent(e,t,n,r){const o=this.getOptions(),i=this.getIntegrationNames();return!t.integrations&&i.length&&(t.integrations=i),this.emit("preprocessEvent",e,t),e.type||r.setLastEventId(e.event_id||t.event_id),qr(o,e,t,n,this,r).then(e=>(null===e||(this.emit("postprocessEvent",e,t),e.contexts={trace:{...e.contexts?.trace,...On(n)},...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:pr(this,n),...e.sdkProcessingMetadata}),e))}_captureEvent(e,t={},n=jn(),r=Un()){return Je&&Po(e)&&it.log(`Captured error event \`${go(e)[0]||"<unknown>"}\``),this._processEvent(e,t,n,r).then(e=>e.event_id,e=>{Je&&(To(e)?it.log(e.message):No(e)?it.warn(e.message):it.warn(e))})}_processEvent(e,t,n,r){const o=this.getOptions(),{sampleRate:i}=o,s=Do(e),a=Po(e),c=`before send for type \`${e.type||"error"}\``,u=void 0===i?void 0:function(e){if("boolean"==typeof e)return Number(e);const t="string"==typeof e?parseFloat(e):e;return"number"!=typeof t||isNaN(t)||t<0||t>1?void 0:t}(i),l=$o(e.type);return this._prepareEvent(e,t,n,r).then(e=>{if(null===e)throw this.recordDroppedEvent("event_processor",l),Eo("An event processor returned `null`, will not send event.");return!0===t.data?.__sentry__?e:function(e,t){const n=`${t} must return \`null\` or a valid event.`;if(Lt(e))return e.then(e=>{if(!$t(e)&&null!==e)throw Co(n);return e},e=>{throw Co(`${t} rejected with ${e}`)});if(!$t(e)&&null!==e)throw Co(n);return e}(function(e,t,n,r){const{beforeSend:o,beforeSendTransaction:i,ignoreSpans:s}=t,a=(c=t.beforeSendSpan,!(c&&"function"==typeof c&&"_streamed"in c&&c._streamed)&&t.beforeSendSpan);var c;let u=n;if(Po(u)&&o)return o(u,r);if(Do(u)){if(a||s){const t=function(e){const{trace_id:t,parent_span_id:n,span_id:r,status:o,origin:i,data:s,op:a}=e.contexts?.trace??{};return{data:s??{},description:e.transaction,op:a,parent_span_id:n,span_id:r??"",start_timestamp:e.start_timestamp??0,status:o,timestamp:e.timestamp,trace_id:t??"",origin:i,profile_id:s?.["sentry.profile_id"],exclusive_time:s?.["sentry.exclusive_time"],measurements:e.measurements,is_segment:!0}}(u);if(s?.length&&sr({description:t.description,op:t.op,attributes:t.data},s))return null;if(a){const e=a(t);e?u=gn(n,{type:"transaction",timestamp:(l=e).timestamp,start_timestamp:l.start_timestamp,transaction:l.description,contexts:{trace:{trace_id:l.trace_id,span_id:l.span_id,parent_span_id:l.parent_span_id,op:l.op,status:l.status,origin:l.origin,data:{...l.data,...l.profile_id&&{"sentry.profile_id":l.profile_id},...l.exclusive_time&&{"sentry.exclusive_time":l.exclusive_time}}}},measurements:l.measurements}):rr()}if(u.spans){const t=[],n=u.spans;for(const e of n)if(s?.length&&sr({description:e.description,op:e.op,attributes:e.data},s))cr(n,e);else if(a){const n=a(e);n?t.push(n):(rr(),t.push(e))}else t.push(e);const r=u.spans.length-t.length;r&&e.recordDroppedEvent("before_send","span",r),u.spans=t}}if(i){if(u.spans){const e=u.spans.length;u.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:e}}return i(u,r)}}var l;return u}(this,o,e,t),c)}).then(o=>{if(null===o){if(this.recordDroppedEvent("before_send",l),s){const t=1+(e.spans||[]).length;this.recordDroppedEvent("before_send","span",t)}throw Eo(`${c} returned \`null\`, will not send event.`)}const d=n.getSession()||r.getSession();if(a&&d&&this._updateSessionFromEvent(d,o),a&&"number"==typeof u&&Ht()>u)throw this.recordDroppedEvent("sample_rate","error"),Eo(`Discarding event because it's not included in the random sample (sampling rate = ${i})`);if(s){const e=(o.sdkProcessingMetadata?.spanCountBeforeProcessing||0)-(o.spans?o.spans.length:0);e>0&&this.recordDroppedEvent("before_send","span",e)}const h=o.transaction_info;if(s&&h&&o.transaction!==e.transaction){const e="custom";o.transaction_info={...h,source:e}}return this.sendEvent(o,t),o}).then(null,e=>{if(To(e)||No(e))throw e;throw this.captureException(e,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:e}),Co(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${e}`)})}_process(e,t){this._numProcessing++,this._promiseBuffer.add(e).then(e=>(this._numProcessing--,e),e=>(this._numProcessing--,e===ho&&this.recordDroppedEvent("queue_overflow",t),e))}_clearOutcomes(){const e=this._outcomes;return this._outcomes={},Object.entries(e).map(([e,t])=>{const[n,r]=e.split(":");return{reason:n,category:r,quantity:t}})}_flushOutcomes(){Je&&it.log("Flushing outcomes...");const e=this._clearOutcomes();if(0===e.length)return void(Je&&it.log("No outcomes to send"));if(!this._dsn)return void(Je&&it.log("No dsn provided, will not send outcomes"));Je&&it.log("Sending outcomes:",e);const t=(n=e,mr((r=this._options.tunnel&&Hn(this._dsn))?{dsn:r}:{},[[{type:"client_report"},{timestamp:o||hn(),discarded_events:n}]]));var n,r,o;this.sendEnvelope(t)}};function $o(e){return"replay_event"===e?"replay":e||"error"}function Po(e){return void 0===e.type}function Do(e){return"transaction"===e.type}function Lo(e){let t=0;return e.name&&(t+=2*e.name.length),t+=8,t+Uo(e.attributes)}function jo(e){let t=0;return e.message&&(t+=2*e.message.length),t+Uo(e.attributes)}function Uo(e){if(!e)return 0;let t=0;return Object.values(e).forEach(e=>{Array.isArray(e)?t+=e.length*Mo(e[0]):At(e)?t+=Mo(e):t+=100}),t}function Mo(e){return"string"==typeof e?2*e.length:"number"==typeof e?8:"boolean"==typeof e?4:0}function Oo(e,t){!0===t.debug&&(Je?it.enable():tt(()=>{})),jn().update(t.initialScope);const n=new e(t);return function(e){jn().setClient(e)}(n),n.init(),n}function Io(e){if(!e)return{};const t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};const n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}}function qo(e){"aggregates"in e?void 0===e.attrs?.ip_address&&(e.attrs={...e.attrs,ip_address:"{{auto}}"}):void 0===e.ipAddress&&(e.ipAddress="{{auto}}")}var Bo=100;function Fo(e,t){const n=Mn(),r=Un();if(!n)return;const{beforeBreadcrumb:o=null,maxBreadcrumbs:i=Bo}=n.getOptions();if(i<=0)return;const s={timestamp:hn(),...e},a=o?tt(()=>o(s,t)):s;null!==a&&(n.emit&&n.emit("beforeAddBreadcrumb",a,t),r.addBreadcrumb(a,i))}var zo=/* @__PURE__ */new WeakMap,Ho=()=>({name:"FunctionToString",setupOnce(){const e=Function.prototype.toString;try{Function.prototype.toString=function(...t){const n=qt(this);let r;try{zo.has(Mn())&&void 0!==n&&(r=n)}catch{}return e.apply(r??this,t)}}catch{}},setup(e){zo.set(e,!0)}}),Yo=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,/^Can't find variable: gmo$/,/^undefined is not an object \(evaluating 'a\.[A-Z]'\)$/,/can't redefine non-configurable property "solana"/,/vv\(\)\.getRestrictions is not a function/,/Can't find variable: _AutofillCallbackHandler/,/Object Not Found Matching Id:\d+, MethodName:simulateEvent/,/Java exception was raised during method invocation$/,/Java object is gone$/],Wo=(e={})=>{let t;return{name:"EventFilters",setup(n){t=Vo(e,n.getOptions())},processEvent:(n,r,o)=>(t||(t=Vo(e,o.getOptions())),function(e,t){if(e.type){if("transaction"===e.type&&function(e,t){if(!t?.length)return!1;const n=e.transaction;return!!n&&rn(n,t)}(e,t.ignoreTransactions))return Je&&it.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.\nEvent: ${an(e)}`),!0}else{if(function(e,t){return!!t?.length&&go(e).some(e=>rn(e,t))}(e,t.ignoreErrors))return Je&&it.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${an(e)}`),!0;if(function(e){return!!e.exception?.values?.length&&(!e.message&&!e.exception.values.some(e=>e.stacktrace||e.type&&"Error"!==e.type||e.value))}(e))return Je&&it.warn(`Event dropped due to not having an error message, error type or stacktrace.\nEvent: ${an(e)}`),!0;if(function(e,t){if(!t?.length)return!1;const n=Ko(e);return!!n&&rn(n,t)}(e,t.denyUrls))return Je&&it.warn(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${an(e)}.\nUrl: ${Ko(e)}`),!0;if(!function(e,t){if(!t?.length)return!0;const n=Ko(e);return!n||rn(n,t)}(e,t.allowUrls))return Je&&it.warn(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${an(e)}.\nUrl: ${Ko(e)}`),!0}return!1}(n,t)?null:n)}},Jo=(e={})=>({...Wo(e),name:"InboundFilters"});function Vo(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:Yo],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function Ko(e){try{const t=[...e.exception?.values??[]].reverse().find(e=>void 0===e.mechanism?.parent_id&&e.stacktrace?.frames?.length)?.stacktrace?.frames;return t?function(e=[]){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n&&"<anonymous>"!==n.filename&&"[native code]"!==n.filename)return n.filename||null}return null}(t):null}catch{return Je&&it.error(`Cannot extract url for event ${an(e)}`),null}}function Go(e,t,n,r,o,i){if(!o.exception?.values||!i||!St(i.originalException))return;const s=o.exception.values.length>0?o.exception.values[o.exception.values.length-1]:void 0;s&&(o.exception.values=Xo(e,t,r,i.originalException,n,o.exception.values,s,0))}function Xo(e,t,n,r,o,i,s,a){if(i.length>=n+1)return i;let c=[...i];if(St(r[o])){Zo(s,a,r);const i=e(t,r[o]),u=c.length;ei(i,o,u,a),c=Xo(e,t,n,r[o],o,[i,...c],i,u)}return Qo(r)&&r.errors.forEach((i,u)=>{if(St(i)){Zo(s,a,r);const l=e(t,i),d=c.length;ei(l,`errors[${u}]`,d,a),c=Xo(e,t,n,i,o,[l,...c],l,d)}}),c}function Qo(e){return Array.isArray(e.errors)}function Zo(e,t,n){e.mechanism={handled:!0,type:"auto.core.linked_errors",...Qo(n)&&{is_exception_group:!0},...e.mechanism,exception_id:t}}function ei(e,t,n,r){e.mechanism={handled:!0,...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:r}}function ti(e){return function(e){return St(e)&&"__sentry_fetch_url_host__"in e&&"string"==typeof e.__sentry_fetch_url_host__}(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}var ni=/* @__PURE__ */new Set([]);var ri=/* @__PURE__ */new Set;function oi(){"console"in Ve&&Ze.forEach(function(e){!ri.has(e)&&e in Ve.console&&(ri.add(e),Mt(Ve.console,e,function(t){return et[e]=t,function(...t){const n=t[0],r=et[e],o=ni.size&&"string"==typeof n&&rn(n,ni);o||_t("console",{args:t,level:e}),(!o||Je&&it.isEnabled())&&r?.apply(Ve.console,t)}}))})}function ii(e){return"warn"===e?"warning":["fatal","error","warning","log","info","debug"].includes(e)?e:"log"}var si=()=>{let e;return{name:"Dedupe",processEvent(t){if(t.type)return t;try{if(function(e,t){return!!t&&(!!function(e,t){const n=e.message,r=t.message;return!(!n&&!r)&&(!(n&&!r||!n&&r)&&(n===r&&(!!ci(e,t)&&!!ai(e,t))))}(e,t)||!!function(e,t){const n=ui(t),r=ui(e);return!(!n||!r)&&(n.type===r.type&&n.value===r.value&&(!!ci(e,t)&&!!ai(e,t)))}(e,t))}(t,e))return Je&&it.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}};function ai(e,t){let n=ht(e),r=ht(t);if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;if(r.length!==n.length)return!1;for(let o=0;o<r.length;o++){const e=r[o],t=n[o];if(e.filename!==t.filename||e.lineno!==t.lineno||e.colno!==t.colno||e.function!==t.function)return!1}return!0}function ci(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;try{return!(n.join("")!==r.join(""))}catch{return!1}}function ui(e){return e.exception?.values?.[0]}var li=()=>({name:"ConversationId",setup(e){e.on("spanStart",e=>{const t=jn().getScopeData(),n=Un().getScopeData(),r=t.conversationId||n.conversationId;if(r){const{op:t,data:n,description:o}=Zn(e);if(!t?.startsWith("gen_ai.")&&!n["ai.operationId"]&&!o?.startsWith("ai."))return;e.setAttribute("gen_ai.conversation.id",r)}})}});function di(e){return void 0===e?void 0:e>=400&&e<500?"warning":e>=500?"error":void 0}var hi=Ve;function pi(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function fi(){if("string"==typeof EdgeRuntime)return!0;if(!function(){if(!("fetch"in hi))return!1;try{return new Headers,new Request("data:,"),new Response,!0}catch{return!1}}())return!1;if(pi(hi.fetch))return!0;let e=!1;const t=hi.document;if(t&&"function"==typeof t.createElement)try{const n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n),n.contentWindow?.fetch&&(e=pi(n.contentWindow.fetch)),t.head.removeChild(n)}catch(n){Je&&it.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return e}function mi(e,t){const n="fetch",r=mt(n,e);return gt(n,()=>function(e,t=!1){if(t&&!fi())return;Mt(Ve,"fetch",function(t){return function(...n){const r=/* @__PURE__ */new Error,{method:o,url:i}=function(e){if(0===e.length)return{method:"GET",url:""};if(2===e.length){const[t,n]=e;return{url:_i(t),method:gi(n,"method")?String(n.method).toUpperCase():Ut(t)&&gi(t,"method")?String(t.method).toUpperCase():"GET"}}const t=e[0];return{url:_i(t),method:gi(t,"method")?String(t.method).toUpperCase():"GET"}}(n),s={args:n,fetchData:{method:o,url:i},startTimestamp:1e3*pn(),virtualError:r,headers:yi(n)};return e||_t("fetch",{...s}),t.apply(Ve,n).then(async t=>(e?e(t):_t("fetch",{...s,endTimestamp:1e3*pn(),response:t}),t),e=>{_t("fetch",{...s,endTimestamp:1e3*pn(),error:e}),St(e)&&void 0===e.stack&&(e.stack=r.stack,Ot(e,"framesToPop",1));const t=Mn()?.getOptions().enhanceFetchErrorMessages??"always";if(!1!==t&&St(e)&&"TypeError"===e.name&&("Failed to fetch"===e.message||"Load failed"===e.message||"NetworkError when attempting to fetch resource."===e.message))try{const n=new URL(s.fetchData.url).host;"always"===t?e.message=`${e.message} (${n})`:Ot(e,"__sentry_fetch_url_host__",n)}catch{}throw e})}})}(void 0,t)),r}function gi(e,t){return Pt(e)&&!!e[t]}function _i(e){return"string"==typeof e?e:e?gi(e,"url")?e.url:e.toString?e.toString():"":""}function yi(e){const[t,n]=e;try{if("object"==typeof n&&null!==n&&"headers"in n&&n.headers)return new Headers(n.headers);if(Ut(t))return new Headers(t.headers)}catch{}}var vi=Ve;function bi(){try{return vi.document.location.href}catch{return""}}var wi=Ve,xi=0;function ki(){return xi>0}function Si(e,t={}){if("function"!=typeof e)return e;try{if(Object.prototype.hasOwnProperty.call(e,"__sentry_wrapped__")){const t=e.__sentry_wrapped__;return"function"==typeof t?t:e}if(qt(e))return e}catch{return e}const n=function(...n){Ve._sentryWrappedDepth=(Ve._sentryWrappedDepth||0)+1;try{const r=n.map(e=>Si(e,t));return e.apply(this,r)}catch(r){throw xi++,setTimeout(()=>{xi--}),function(...e){const t=Pn(Ge());if(2===e.length){const[n,r]=e;return n?t.withSetScope(n,r):t.withScope(r)}t.withScope(e[0])}(e=>{e.addEventProcessor(e=>(t.mechanism&&(cn(e,void 0,void 0),un(e,t.mechanism)),e.extra={...e.extra,arguments:n},e)),zr(r)}),r}finally{Ve._sentryWrappedDepth=(Ve._sentryWrappedDepth||0)-1}};try{for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t])}catch{}It(n,e),Ot(e,"__sentry_wrapped__",n);try{Object.getOwnPropertyDescriptor(n,"name").configurable&&Object.defineProperty(n,"name",{get:()=>e.name})}catch{}return n}function Ci(){const e=bi(),{referrer:t}=wi.document||{},{userAgent:n}=wi.navigator||{};return{url:e,headers:{...t&&{Referer:t},...n&&{"User-Agent":n}}}}function Ei(e,t){const n=Ri(e,t),r={type:Pi(t),value:Di(t)};return n.length&&(r.stacktrace={frames:n}),void 0===r.type&&""===r.value&&(r.value="Unrecoverable error caught"),r}function Ni(e,t,n,r){const o=Mn()?.getOptions().normalizeDepth,i=(s=t,Object.values(s).find(St));var s;const a={__serialized__:Xt(t,o)};if(i)return{exception:{values:[Ei(e,i)]},extra:a};const c={exception:{values:[{type:Dt(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:Ui(t,{isUnhandledRejection:r})}]},extra:a};if(n){const t=Ri(e,n);t.length&&(c.exception.values[0].stacktrace={frames:t})}return c}function Ti(e,t){return{exception:{values:[Ei(e,t)]}}}function Ri(e,t){const n=t.stacktrace||t.stack||"",r=function(e){return e&&Ai.test(e.message)?1:0}(t),o=function(e){return"number"==typeof e.framesToPop?e.framesToPop:0}(t);try{return e(n,r,o)}catch{}return[]}var Ai=/Minified React error #\d+;/i;function $i(e){return"undefined"!=typeof WebAssembly&&void 0!==WebAssembly.Exception&&e instanceof WebAssembly.Exception}function Pi(e){const t=e?.name;return!t&&$i(e)?e.message&&Array.isArray(e.message)&&2==e.message.length?e.message[0]:"WebAssembly.Exception":t}function Di(e){const t=e?.message;return $i(e)?Array.isArray(e.message)&&2==e.message.length?e.message[1]:"wasm exception":t?t.error&&"string"==typeof t.error.message?ti(t.error):ti(e):"No error message"}function Li(e,t,n,r,o){let i;if(Et(t)&&t.error)return Ti(e,t.error);if(Nt(t)||Ct(t,"DOMException")){const o=t;if("stack"in t){i=Ti(e,t);const o=i.exception?.values?.[0];if(r&&n&&o&&!o.stacktrace){const t=Ri(e,n);t.length&&(o.stacktrace={frames:t},un(i,{synthetic:!0}))}}else{const t=o.name||(Nt(o)?"DOMError":"DOMException"),s=o.message?`${t}: ${o.message}`:t;i=ji(e,s,n,r),cn(i,s)}return"code"in o&&(i.tags={...i.tags,"DOMException.code":`${o.code}`}),i}return St(t)?Ti(e,t):$t(t)||Dt(t)?(i=Ni(e,t,n,o),un(i,{synthetic:!0}),i):(i=ji(e,t,n,r),cn(i,`${t}`,void 0),un(i,{synthetic:!0}),i)}function ji(e,t,n,r){const o={};if(r&&n){const r=Ri(e,n);r.length&&(o.exception={values:[{value:t,stacktrace:{frames:r}}]}),un(o,{synthetic:!0})}if(Rt(t)){const{__sentry_template_string__:e,__sentry_template_values__:n}=t;return o.logentry={message:e,params:n},o}return o.message=t,o}function Ui(e,{isUnhandledRejection:t}){const n=function(e){const t=Object.keys(Bt(e));return t.sort(),t[0]?t.join(", "):"[object has no keys]"}(e),r=t?"promise rejection":"exception";return Et(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:Dt(e)?`Event \`${function(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}var Mi=class extends Ao{constructor(e){const t=(n=e,{release:"string"==typeof __SENTRY_RELEASE__?__SENTRY_RELEASE__:wi.SENTRY_RELEASE?.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...n});var n;!function(e,t,n=[t],r="npm"){const o=(e._metadata=e._metadata||{}).sdk=e._metadata.sdk||{};o.name||(o.name=`sentry.javascript.${t}`,o.packages=n.map(e=>({name:`${r}:@sentry/${e}`,version:Ke})),o.version=Ke)}(t,"browser",["browser"],wi.SENTRY_SDK_SOURCE||"npm"),super(t);const{userInfo:r}=this.getDataCollectionOptions();t._metadata?.sdk&&(t._metadata.sdk.settings={infer_ip:r?"auto":"never",...t._metadata.sdk.settings});const{sendClientReports:o}=this._options;wi.document&&wi.document.addEventListener("visibilitychange",()=>{"hidden"===wi.document.visibilityState&&(o&&this._flushOutcomes(),queueMicrotask(()=>{this.flush()}))}),r&&this.on("beforeSendSession",qo)}eventFromException(e,t){return function(e,t,n,r){const o=Li(e,t,n?.syntheticException||void 0,r);return un(o),o.level="error",n?.event_id&&(o.event_id=n.event_id),$r(o)}(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t="info",n){return function(e,t,n="info",r,o){const i=ji(e,t,r?.syntheticException||void 0,o);return i.level=n,r?.event_id&&(i.event_id=r.event_id),$r(i)}(this._options.stackParser,e,t,n,this._options.attachStacktrace)}_prepareEvent(e,t,n,r){return e.platform=e.platform||"javascript",super._prepareEvent(e,t,n,r)}};var Oi="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,Ii=Ve;function qi(e,t,n){Ii.document&&Ii.addEventListener(e,t,n)}function Bi(e,t,n){Ii.document&&Ii.removeEventListener(e,t,n)}var Fi={};try{"undefined"!=typeof Node&&(Fi.parentNode=Object.getOwnPropertyDescriptor(Node.prototype,"parentNode").get),"undefined"!=typeof Element&&(Fi.tagName=Object.getOwnPropertyDescriptor(Element.prototype,"tagName").get,Fi.id=Object.getOwnPropertyDescriptor(Element.prototype,"id").get,Fi.className=Object.getOwnPropertyDescriptor(Element.prototype,"className").get,Fi.getAttribute=Element.prototype.getAttribute),"undefined"!=typeof HTMLElement&&(Fi.dataset=Object.getOwnPropertyDescriptor(HTMLElement.prototype,"dataset").get)}catch{}function zi(e,t,n){const r=Fi[t];if(r)try{return r.call(e,n)}catch{}const o=e[t];return"function"==typeof o?o.call(e,n):o}function Hi(e,t={}){if(!e)return"<unknown>";try{let n=e;const r=5,o=[];let i=0,s=0;const a=" > ",c=3;let u;const l=Array.isArray(t)?t:t.keyAttrs,d=!Array.isArray(t)&&t.maxStringLength||80;for(;n&&i++<r&&(u=Yi(n,l),!("html"===u||i>1&&s+o.length*c+u.length>=d));)o.push(u),s+=u.length,n=zi(n,"parentNode");return o.reverse().join(a)}catch{return"<unknown>"}}function Yi(e,t){const n=[],r=zi(e,"tagName");if(!r)return"";if("undefined"!=typeof HTMLElement&&e instanceof HTMLElement){const t=zi(e,"dataset");if(t){if(t.sentryComponent)return t.sentryComponent;if(t.sentryElement)return t.sentryElement}}n.push(r.toLowerCase());const o=t?.length?t.filter(t=>zi(e,"getAttribute",t)).map(t=>[t,zi(e,"getAttribute",t)]):null;if(o?.length)o.forEach(e=>{n.push(`[${e[0]}="${e[1]}"]`)});else{const t=zi(e,"id");t&&n.push(`#${t}`);const r=zi(e,"className");if(r&&Tt(r)){const e=r.split(/\s+/);for(const t of e)n.push(`.${t}`)}}for(const i of["aria-label","type","name","title","alt"]){const t=zi(e,"getAttribute",i);t&&n.push(`[${i}="${t}"]`)}return n.join("")}var Wi,Ji,Vi,Ki;function Gi(){if(!Ii.document)return;const e=_t.bind(null,"dom"),t=Xi(e,!0);Ii.document.addEventListener("click",t,!1),Ii.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(t=>{const n=Ii[t]?.prototype;n?.hasOwnProperty?.("addEventListener")&&(Mt(n,"addEventListener",function(t){return function(n,r,o){if("click"===n||"keypress"==n)try{const r=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},i=r[n]=r[n]||{refCount:0};if(!i.handler){const r=Xi(e);i.handler=r,t.call(this,n,r,o)}i.refCount++}catch{}return t.call(this,n,r,o)}}),Mt(n,"removeEventListener",function(e){return function(t,n,r){if("click"===t||"keypress"==t)try{const n=this.__sentry_instrumentation_handlers__||{},o=n[t];o&&(o.refCount--,o.refCount<=0&&(e.call(this,t,o.handler,r),o.handler=void 0,delete n[t]),0===Object.keys(n).length&&delete this.__sentry_instrumentation_handlers__)}catch{}return e.call(this,t,n,r)}}))})}function Xi(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;const r=function(e){try{return e.target}catch{return null}}(n);if(function(e,t){return"keypress"===e&&(!t?.tagName||"INPUT"!==t.tagName&&"TEXTAREA"!==t.tagName&&!t.isContentEditable)}(n.type,r))return;Ot(n,"_sentryCaptured",!0),r&&!r._sentryId&&Ot(r,"_sentryId",on());const o="keypress"===n.type?"input":n.type;(function(e){if(e.type!==Ji)return!1;try{if(!e.target||e.target._sentryId!==Vi)return!1}catch{}return!0})(n)||(e({event:n,name:o,global:t}),Ji=n.type,Vi=r?r._sentryId:void 0),clearTimeout(Wi),Wi=Ii.setTimeout(()=>{Vi=void 0,Ji=void 0},1e3)}}function Qi(e){const t="history";mt(t,e),gt(t,Zi)}function Zi(){function e(e){return function(...t){const n=t.length>2?t[2]:void 0;if(n){const r=Ki,o=function(e){try{return new URL(e,Ii.location.origin).toString()}catch{return e}}(String(n));if(Ki=o,r===o)return e.apply(this,t);_t("history",{from:r,to:o})}return e.apply(this,t)}}Ii.addEventListener("popstate",()=>{const e=Ii.location.href,t=Ki;Ki=e,t!==e&&_t("history",{from:t,to:e})}),"history"in hi&&hi.history&&(Mt(Ii.history,"pushState",e),Mt(Ii.history,"replaceState",e))}var es={};var ts="__sentry_xhr_v3__";function ns(){if(!Ii.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(e,t,n){let r=/* @__PURE__ */new Error;const o=1e3*pn(),i=Tt(n[0])?n[0].toUpperCase():void 0,s=function(e){if(Tt(e))return e;try{return e.toString()}catch{}}(n[1]);if(!i||!s)return e.apply(t,n);t[ts]={method:i,url:s,request_headers:{}},"POST"===i&&s.match(/sentry_key/)&&(t.__sentry_own_request__=!0);const a=()=>{const e=t[ts];if(e&&4===t.readyState){try{e.status_code=t.status}catch{}_t("xhr",{endTimestamp:1e3*pn(),startTimestamp:o,xhr:t,virtualError:r}),r=void 0,t.removeEventListener("readystatechange",a)}};return"onreadystatechange"in t&&"function"==typeof t.onreadystatechange?t.onreadystatechange=new Proxy(t.onreadystatechange,{apply:(e,t,n)=>(a(),e.apply(t,n))}):t.addEventListener("readystatechange",a),t.setRequestHeader=new Proxy(t.setRequestHeader,{apply(e,t,n){const[r,o]=n,i=t[ts];return i&&Tt(r)&&Tt(o)&&(i.request_headers[r.toLowerCase()]=o),e.apply(t,n)}}),e.apply(t,n)}}),e.send=new Proxy(e.send,{apply(e,t,n){const r=t[ts];if(!r)return e.apply(t,n);void 0!==n[0]&&(r.body=n[0]);return _t("xhr",{startTimestamp:1e3*pn(),xhr:t}),e.apply(t,n)}})}function rs(e,t=function(e){const t=es[e];if(t)return t;let n=Ii[e];if(pi(n))return es[e]=n.bind(Ii);const r=Ii.document;if(r&&"function"==typeof r.createElement)try{const t=r.createElement("iframe");t.hidden=!0,r.head.appendChild(t);const o=t.contentWindow;o?.[e]&&(n=o[e]),r.head.removeChild(t)}catch(ed){Oi&&it.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,ed)}return n?es[e]=n.bind(Ii):n}("fetch")){let n=0,r=0;return mo(e,async function(o){const i=o.body.length;n+=i,r++;const s={body:o.body,method:"POST",referrerPolicy:"strict-origin",headers:e.headers,keepalive:n<=6e4&&r<15,...e.fetchOptions};try{const n=await t(e.url,s);return{statusCode:n.status,headers:{"x-sentry-rate-limits":n.headers.get("X-Sentry-Rate-Limits"),"retry-after":n.headers.get("Retry-After")}}}catch(ed){throw es["fetch"]=void 0,ed}finally{n-=i,r--}},po(e.bufferSize||40))}var os="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__;function is(e,t,n,r){const o={filename:e,function:"<anonymous>"===t?"?":t,in_app:!0};return void 0!==n&&(o.lineno=n),void 0!==r&&(o.colno=r),o}var ss=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,as=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,cs=/\((\S*)(?::(\d+))(?::(\d+))\)/,us=/at (.+?) ?\(data:(.+?),/,ls=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,ds=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,hs=ct(...[[30,e=>{const t=e.match(us);if(t)return{filename:`<data:${t[2]}>`,function:t[1]};const n=ss.exec(e);if(n){const[,e,t,r]=n;return is(e,"?",+t,+r)}const r=as.exec(e);if(r){if(0===r[2]?.indexOf("eval")){const e=cs.exec(r[2]);e&&(r[2]=e[1],r[3]=e[2],r[4]=e[3])}const[e,t]=ps(r[1]||"?",r[2]);return is(t,e,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}}],[50,e=>{const t=ls.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const e=ds.exec(t[3]);e&&(t[1]=t[1]||"eval",t[3]=e[1],t[4]=e[2],t[5]="")}let e=t[3],n=t[1]||"?";return[n,e]=ps(n,e),is(e,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}]]),ps=(e,t)=>{const n=-1!==e.indexOf("safari-extension"),r=-1!==e.indexOf("safari-web-extension");return n||r?[-1!==e.indexOf("@")?e.split("@")[0]:"?",n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},fs=1024,ms=(e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:"Breadcrumbs",setup(e){var n;t.console&&function(e){const t="console",n=mt(t,e);gt(t,oi)}(function(e){return function(t){if(Mn()!==e)return;const n={category:"console",data:{arguments:t.args,logger:"console"},level:ii(t.level),message:tn(t.args," ")};if("assert"===t.level){if(!1!==t.args[0])return;n.message=`Assertion failed: ${tn(t.args.slice(1)," ")||"console.assert"}`,n.data.arguments=t.args.slice(1)}Fo(n,{input:t.args,level:t.level})}}(e)),t.dom&&(n=function(e,t){return function(n){if(Mn()!==e)return;let r,o,i="object"==typeof t?t.serializeAttribute:void 0,s="object"==typeof t&&"number"==typeof t.maxStringLength?t.maxStringLength:void 0;s&&s>fs&&(os&&it.warn(`\`dom.maxStringLength\` cannot exceed 1024, but a value of ${s} was configured. Sentry will use 1024 instead.`),s=fs),"string"==typeof i&&(i=[i]);try{const e=n.event,t=function(e){return!!e&&!!e.target}(e)?e.target:e;r=Hi(t,{keyAttrs:i,maxStringLength:s}),o=function(e,t=5){if(!vi.HTMLElement)return null;let n=e;for(let r=0;r<t;r++){if(!n)return null;if(n instanceof HTMLElement){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}n=n.parentNode}return null}(t)}catch{r="<unknown>"}if(0===r.length)return;const a={category:`ui.${n.name}`,message:r};o&&(a.data={"ui.component_name":o}),Fo(a,{event:n.event,name:n.name,global:n.global})}}(e,t.dom),mt("dom",n),gt("dom",Gi)),t.xhr&&function(e){mt("xhr",e),gt("xhr",ns)}(function(e){return function(t){if(Mn()!==e)return;const{startTimestamp:n,endTimestamp:r}=t,o=t.xhr[ts];if(!n||!r||!o)return;const{method:i,url:s,status_code:a,body:c}=o,u={method:i,url:s,status_code:a},l={xhr:t.xhr,input:c,startTimestamp:n,endTimestamp:r},d={category:"xhr",data:u,type:"http",level:di(a)};e.emit("beforeOutgoingRequestBreadcrumb",d,l),Fo(d,l)}}(e)),t.fetch&&mi(function(e){return function(t){if(Mn()!==e)return;const{startTimestamp:n,endTimestamp:r}=t;if(r&&(!t.fetchData.url.match(/sentry_key/)||"POST"!==t.fetchData.method))if(t.error){const o={data:t.error,input:t.args,startTimestamp:n,endTimestamp:r},i={category:"fetch",data:t.fetchData,level:"error",type:"http"};e.emit("beforeOutgoingRequestBreadcrumb",i,o),Fo(i,o)}else{const o=t.response,i={...t.fetchData,status_code:o?.status},s={input:t.args,response:o,startTimestamp:n,endTimestamp:r},a={category:"fetch",data:i,type:"http",level:di(i.status_code)};e.emit("beforeOutgoingRequestBreadcrumb",a,s),Fo(a,s)}}}(e)),t.history&&Qi(function(e){return function(t){if(Mn()!==e)return;let n=t.from,r=t.to;const o=Io(wi.location.href);let i=n?Io(n):void 0;const s=Io(r);i?.path||(i=o),o.protocol===s.protocol&&o.host===s.host&&(r=s.relative),o.protocol===i.protocol&&o.host===i.host&&(n=i.relative),Fo({category:"navigation",data:{from:n,to:r}})}}(e)),t.sentry&&e.on("beforeSendEvent",function(e){return function(t){Mn()===e&&Fo({category:"sentry."+("transaction"===t.type?"transaction":"event"),event_id:t.event_id,level:t.level,message:an(t)},{event:t})}}(e))}}};var gs="EventTarget,Window,Node,ApplicationCache,AudioTrackList,BroadcastChannel,ChannelMergerNode,CryptoOperation,EventSource,FileReader,HTMLUnknownElement,IDBDatabase,IDBRequest,IDBTransaction,KeyOperation,MediaController,MessagePort,ModalWindow,Notification,SVGElementInstance,Screen,SharedWorker,TextTrack,TextTrackCue,TextTrackList,WebSocket,WebSocketWorker,Worker,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload".split(","),_s=(e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:"BrowserApiErrors",setupOnce(){t.setTimeout&&Mt(wi,"setTimeout",ys),t.setInterval&&Mt(wi,"setInterval",ys),t.requestAnimationFrame&&Mt(wi,"requestAnimationFrame",vs),t.XMLHttpRequest&&"XMLHttpRequest"in wi&&Mt(XMLHttpRequest.prototype,"send",bs);const e=t.eventTarget;e&&(Array.isArray(e)?e:gs).forEach(e=>function(e,t){const n=wi[e]?.prototype;if(!n?.hasOwnProperty?.("addEventListener"))return;Mt(n,"addEventListener",function(n){return function(r,o,i){try{"function"==typeof o.handleEvent&&(o.handleEvent=Si(o.handleEvent,{mechanism:{data:{handler:dt(o),target:e},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return t.unregisterOriginalCallbacks&&function(e,t,n){e&&"object"==typeof e&&"removeEventListener"in e&&"function"==typeof e.removeEventListener&&e.removeEventListener(t,n)}(this,r,o),n.apply(this,[r,Si(o,{mechanism:{data:{handler:dt(o),target:e},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),i])}}),Mt(n,"removeEventListener",function(e){return function(t,n,r){try{if(Object.prototype.hasOwnProperty.call(n,"__sentry_wrapped__")){const o=n.__sentry_wrapped__;o&&e.call(this,t,o,r)}}catch{}return e.call(this,t,n,r)}})}(e,t))}}};function ys(e){return function(...t){const n=t[0];return t[0]=Si(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${dt(e)}`}}),e.apply(this,t)}}function vs(e){return function(t){return e.apply(this,[Si(t,{mechanism:{data:{handler:dt(e)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function bs(e){return function(...t){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(e=>{e in n&&"function"==typeof n[e]&&Mt(n,e,function(t){const n={mechanism:{data:{handler:dt(t)},handled:!1,type:`auto.browser.browserapierrors.xhr.${e}`}},r=qt(t);return r&&(n.mechanism.data.handler=dt(r)),Si(t,n)})}),e.apply(this,t)}}var ws=(e={})=>{const t=e.lifecycle??"route";return{name:"BrowserSession",setupOnce(){if(void 0===wi.document)return void(os&&it.warn("Using the `browserSessionIntegration` in non-browser environments is not supported."));Wr({ignoreDuration:!0});let e=!1;(e=>{const t=Ii.requestIdleCallback||Ii.setTimeout;"hidden"===Ii.document?.visibilityState?e():(qi("visibilitychange",e=(e=>{let t=!1;return()=>{t||(e(),t=!0)}})(e),{once:!0,capture:!0}),qi("pagehide",e,{once:!0,capture:!0}),t(()=>{e(),Bi("visibilitychange",e,{capture:!0}),Bi("pagehide",e,{capture:!0})}))})(()=>{e||(Kr(),e=!0)});const n=Un();let r=n.getUser();n.addScopeListener(t=>{const n=t.getUser();r?.id===n?.id&&r?.ip_address===n?.ip_address||(r=n,e&&Kr())}),"route"===t&&Qi(({from:t,to:n})=>{t!==n&&(Wr({ignoreDuration:!0}),Kr(),e=!0)})}}},xs=()=>({name:"CultureContext",preprocessEvent(e){const t=ks();t&&(e.contexts={...e.contexts,culture:{...t,...e.contexts?.culture}})},processSegmentSpan(e){const t=ks();t&&Ar(e,{"culture.locale":t.locale,"culture.timezone":t.timezone,"culture.calendar":t.calendar})}});function ks(){try{const e=wi.Intl;if(!e)return;const t=e.DateTimeFormat().resolvedOptions();return{locale:t.locale,timezone:t.timeZone,calendar:t.calendar}}catch{return}}var Ss=(e={})=>{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:"GlobalHandlers",setupOnce(){Error.stackTraceLimit=50},setup(e){t.onerror&&(!function(e){!function(e){const t="error";mt(t,e),gt(t,vt)}(t=>{const{stackParser:n,attachStacktrace:r}=Es();if(Mn()!==e||ki())return;const{msg:o,url:i,line:s,column:a,error:c}=t,u=function(e,t,n,r){const o=e.exception=e.exception||{},i=o.values=o.values||[],s=i[0]=i[0]||{},a=s.stacktrace=s.stacktrace||{},c=a.frames=a.frames||[];0===c.length&&c.push({colno:r,lineno:n,filename:Ns(t)??bi(),function:"?",in_app:!0});return e}(Li(n,c||o,void 0,r,!1),i,s,a);u.level="error",Hr(u,{originalException:c,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})})}(e),Cs("onerror")),t.onunhandledrejection&&(!function(e){!function(e){const t="unhandledrejection";mt(t,e),gt(t,wt)}(t=>{const{stackParser:n,attachStacktrace:r}=Es();if(Mn()!==e||ki())return;const o=function(e){if(At(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}(t),i=At(o)?{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(o)}`}]}}:Li(n,o,void 0,r,!0);i.level="error",Hr(i,{originalException:o,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}(e),Cs("onunhandledrejection"))}}};function Cs(e){os&&it.log(`Global Handler attached: ${e}`)}function Es(){return Mn()?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}function Ns(e){if(Tt(e)&&0!==e.length)return e.startsWith("data:")?`<${function(e,t=!0){if(e.startsWith("data:")){const n=e.match(/^data:([^;,]+)/),r=n?n[1]:"text/plain",o=e.includes(";base64,"),i=e.indexOf(",");let s="";if(t&&-1!==i){const t=e.slice(i+1);s=t.length>10?`${t.slice(0,10)}... [truncated]`:t}return`data:${r}${o?",base64":""}${s?`,${s}`:""}`}return e}(e,!1)}>`:e}var Ts=()=>({name:"HttpContext",preprocessEvent(e){if(!wi.navigator&&!wi.location&&!wi.document)return;const t=Ci(),n={...t.headers,...e.request?.headers};e.request={...t,...e.request,headers:n}},processSpan(e){if(!wi.navigator&&!wi.location&&!wi.document)return;const t=Ci();Ar(e,{[Rr]:t.headers["User-Agent"],...e.is_segment&&{"url.full":"http.client"!==e.attributes?.["sentry.op"]?t.url:void 0,"http.request.header.referer":t.headers.Referer}})}}),Rs=(e={})=>{const t=e.limit||5,n=e.key||"cause";return{name:"LinkedErrors",preprocessEvent(e,r,o){Go(Ei,o.getOptions().stackParser,n,t,e,r)}}},As=/^HTML(\w*)Element$/;function $s(e){if("undefined"!=typeof window&&e===window)return"[Window]";if("undefined"!=typeof document&&e===document)return"[Document]";if(function(e){if("undefined"==typeof Element)return!1;try{return e instanceof Element}catch{return!1}}(e)){const t=function(e){const t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:"null prototype"}(e);if(As.test(t))return`[HTMLElement: ${Hi(e)}]`}}function Ps(){return!!function(){if(void 0===wi.window)return!1;const e=wi;if(e.nw)return!1;if(!(e.chrome||e.browser)?.runtime?.id)return!1;const t=bi();return!(wi===wi.top&&/^(?:chrome-extension|moz-extension|ms-browser-extension|safari-web-extension):\/\//.test(t))}()&&(os&&tt(()=>{}),!0)}function Ds(e={}){const t=!e.skipBrowserExtensionCheck&&Ps();let n=null==e.defaultIntegrations?[Jo(),Ho(),li(),_s(),ms(),Ss(),Rs(),si(),Ts(),xs(),ws()]:e.defaultIntegrations;const r={...e,enabled:!t&&e.enabled,stackParser:(o=e.stackParser||hs,Array.isArray(o)?ct(...o):o),integrations:Zr({integrations:e.integrations,defaultIntegrations:n}),transport:e.transport||rs};var o;return Wt=$s,Oo(Mi,r)}function Ls(e){const t="undefined"!=typeof window?window.location.href:void 0;Yr("portal_code",e.portalCode),Yr("object_code",e.objectCode??""),Yr("locale",e.locale??""),function(e,t){Un().setContext(e,t)}("bukazu",{portal_code:e.portalCode,object_code:e.objectCode??null,locale:e.locale??null,url:t??null})}function js(e){zr(e)}function Us(e){!function(e,t){const n="string"==typeof t?t:void 0,r="string"!=typeof t?{captureContext:t}:void 0;jn().captureMessage(e,n,r)}(e,"error")}var Ms=/* @__PURE__ */new WeakSet;function Os(e){return function(e){return"messages"in e&&Array.isArray(e.messages)&&e.messages.every(e=>"string"==typeof e)}(e)?e.messages:[e.message]}function Is(e){const t=Os(e.errors);return"object"!=typeof e.errors||null===e.errors||Ms.has(e.errors)||(Ms.add(e.errors),js(new Error(t.join("\n")))),/* @__PURE__ */h("div",{className:"bukazu-error-message",children:[/* @__PURE__ */d("h2",{children:ne("something_went_wrong_please_try_again")}),/* @__PURE__ */d("ul",{children:t.map(e=>/* @__PURE__ */d("li",{children:e},e))})]})}var qs=["en","nl","de","fr","es","it"];function Bs(e){if(!e)return"en";const t=e.split(/[-_]/)[0].toLowerCase();return function(e){return qs.includes(e)}(t)?t:"en"}var Fs=e=>"[object Object]"===Object.prototype.toString.call(e),zs=n({locale:"nl",portalCode:"",objectCode:"",apiUrl:"https://api.bukazu.com"}),Hs="bukazuCurrency";function Ys(e){const t="string"==typeof e?.default&&""!==e.default?e.default:"EUR",n=Array.isArray(e?.allowed)?e.allowed.filter(e=>"string"==typeof e&&""!==e):[];return{multi_currency:e?.multi_currency??!1,default:t,allowed:[.../* @__PURE__ */new Set([...n,t])]}}var Ws=n({currency:void 0,setCurrency:()=>{},allowed:[],multiCurrency:!1});function Js({currencies:e,children:t}){const n=s(()=>Ys(e),[e]),[o,i]=u(()=>{const e=function(){try{return window.localStorage.getItem(Hs)}catch{return null}}();return e&&n.allowed.includes(e)?e:n.default}),a=r(e=>{n.allowed.includes(e)&&(!function(e){try{window.localStorage.setItem(Hs,e)}catch{}}(e),i(e))},[n]),c=n.multi_currency&&n.allowed.length>1,l=s(()=>({currency:c?o:void 0,setCurrency:a,allowed:n.allowed,multiCurrency:c}),[c,n.allowed,o,a]);/* @__PURE__ */
39
+ return d(Ws.Provider,{value:l,children:t})}function Vs(){return o(Ws)}function Ks(){const{currency:e,setCurrency:t,allowed:n,multiCurrency:r}=Vs();return!r||n.length<=1?null:/* @__PURE__ */h("div",{className:"bu-currency-selector",children:[/* @__PURE__ */d("label",{htmlFor:"bu-currency",children:ne("currency")}),/* @__PURE__ */d("select",{id:"bu-currency",value:e,onChange:e=>{t(e.target.value)},children:n.map(e=>/* @__PURE__ */d("option",{value:e,children:e},e))})]})}var Gs=class extends Error{name="KyError";get isKyError(){return!0}},Xs=class extends Gs{name="HTTPError";response;request;options;data;constructor(e,t,n){const r=`${e.status||0===e.status?e.status:""} ${e.statusText??""}`.trim();super(`Request failed with ${r?`status code ${r}`:"an unknown error"}: ${t.method} ${t.url}`),this.response=e,this.request=t,this.options=n}},Qs=class extends Gs{name="NetworkError";request;constructor(e,t){super(`Request failed due to a network error: ${e.method} ${e.url}`,t),this.request=e}},Zs=class extends Error{name="NonError";value;constructor(e){let t="Non-error value was thrown";try{"string"==typeof e?t=e:e&&"object"==typeof e&&"message"in e&&"string"==typeof e.message&&(t=e.message)}catch{}super(t),this.value=e}},ea=class extends Gs{name="ForceRetryError";customDelay;code;customRequest;constructor(e){const t=e?.cause?e.cause instanceof Error?e.cause:new Zs(e.cause):void 0;super(e?.code?`Forced retry: ${e.code}`:"Forced retry",t?{cause:t}:void 0),this.customDelay=e?.delay,this.code=e?.code,this.customRequest=e?.request}},ta=class extends Error{name="SchemaValidationError";issues;constructor(e){super("Response schema validation failed"),this.issues=e}},na=class extends Gs{name="TimeoutError";request;constructor(e){super(`Request timed out: ${e.method} ${e.url}`),this.request=e}},ra=(()=>{let e=!1,t=!1;const n="function"==typeof globalThis.ReadableStream,r="function"==typeof globalThis.Request;if(n&&r)try{t=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type")}catch(o){if(o instanceof Error&&"unsupported BodyInit type"===o.message)return!1;throw o}return e&&!t})(),oa="function"==typeof globalThis.AbortController,ia="function"==typeof globalThis.AbortSignal&&"function"==typeof globalThis.AbortSignal.any,sa="function"==typeof globalThis.ReadableStream,aa="function"==typeof globalThis.FormData,ca=["get","post","put","patch","head","delete","query"],ua={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},la=2147483647,da=Symbol("stop"),ha=class{options;constructor(e){this.options=e}},pa=e=>new ha(e),fa={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,baseUrl:!0,prefix:!0,retry:!0,timeout:!0,totalTimeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},ma={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,duplex:!0},ga=new TextEncoder,_a=(e,t,n)=>{let r,o=0;return e.pipeThrough(new TransformStream({transform(e,i){if(i.enqueue(e),r){o+=r.byteLength;let e=0===t?0:o/t;e>=1&&(e=1-Number.EPSILON),n?.({percent:e,totalBytes:Math.max(t,o),transferredBytes:o},r)}r=e},flush(){const e=r??/* @__PURE__ */new Uint8Array;o+=e.byteLength,n?.({percent:1,totalBytes:Math.max(t,o),transferredBytes:o},e)}}))},ya=(e,t,n)=>{if(!e.body)return e;const r=(e=>{if(!e)return 0;if(e instanceof FormData){let t=0;for(const[n,r]of e)t+=40,t+=ga.encode(`Content-Disposition: form-data; name="${n}"`).byteLength,t+="string"==typeof r?ga.encode(r).byteLength:r.size;return t}return e instanceof Blob?e.size:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:"string"==typeof e?ga.encode(e).byteLength:e instanceof URLSearchParams?ga.encode(e.toString()).byteLength:0})(n??e.body);return new Request(e,{duplex:"half",body:_a(e.body,r,t)})},va=e=>null!==e&&"object"==typeof e,ba=Symbol("replaceOption"),wa=e=>va(e)&&!0===e[ba]?{isReplace:!0,value:e.value}:{isReplace:!1,value:e},xa=(...e)=>{for(const t of e)if((!va(t)||Array.isArray(t))&&void 0!==t)throw new TypeError("The `options` argument must be an object");return Pa({},...e)},ka=(e={},t={})=>{const n=new globalThis.Headers(e),r=t instanceof globalThis.Headers,o=new globalThis.Headers(t);for(const[i,s]of o.entries())r&&"undefined"===s||void 0===s?n.delete(i):n.set(i,s);return n},Sa=e=>{if(!va(e)||Array.isArray(e))return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||null===t},Ca=e=>{if(e instanceof URLSearchParams){const t=new URLSearchParams(e),n=e[Ra];return n&&(t[Ra]=new Set(n)),t}return e instanceof globalThis.Headers?new globalThis.Headers(e):Array.isArray(e)?[...e]:Sa(e)?{...e}:e},Ea=(e,t)=>{return Sa(e)&&Sa(t)?(n={...e,...t},Object.fromEntries(Object.entries(n).filter(e=>void 0!==e[1]))):ka(e,t);var n};function Na(e,t,n){return Object.hasOwn(t,n)&&void 0===t[n]?[]:Pa(e[n]??[],t[n]??[])}var Ta=(e={},t={})=>({init:Na(e,t,"init"),beforeRequest:Na(e,t,"beforeRequest"),beforeRetry:Na(e,t,"beforeRetry"),beforeError:Na(e,t,"beforeError"),afterResponse:Na(e,t,"afterResponse")}),Ra=Symbol("deletedParameters"),Aa=(e,t)=>{const n=new URLSearchParams,r=/* @__PURE__ */new Set;for(const o of[e,t])if(void 0!==o)if(o instanceof URLSearchParams){for(const[t,i]of o.entries())n.append(t,i),r.delete(t);const e=o[Ra];if(e)for(const t of e)n.delete(t),r.add(t)}else if(Array.isArray(o))for(const e of o){if(!Array.isArray(e)||2!==e.length)throw new TypeError("Array search parameters must be provided in [[key, value], ...] format");n.append(String(e[0]),String(e[1])),r.delete(String(e[0]))}else if(va(o))for(const[e,t]of Object.entries(o))void 0===t?(n.delete(e),r.add(e)):(n.append(e,String(t)),r.delete(e));else{const e=new URLSearchParams(o);for(const[t,o]of e.entries())n.append(t,o),r.delete(t)}return r.size>0&&(n[Ra]=r),n},$a=(e,...t)=>{let n,r={},o={},i={};const s=[];for(const a of t)if(Array.isArray(a))Array.isArray(r)||(r=[]),r=[...r,...a];else if(va(a)){for(let[t,o]of Object.entries(a)){const i=wa(o),{isReplace:a}=i;o=i.value;const c=e&&"signal"===t;if(c&&(a||void 0===o)&&(s.length=0),c&&o instanceof globalThis.AbortSignal)s.push(o);else if("context"!==t)"searchParams"!==t?(e&&"retry"===t&&va(o)&&!a&&"number"==typeof r[t]&&(r={...r,[t]:{limit:r[t]}}),va(o)&&!a&&t in r&&(o=$a(!1,r[t],o)),r={...r,[t]:o}):n=null==o?void 0:a||void 0===n?o:Aa(n,o);else{if(null!=o&&(!va(o)||Array.isArray(o)))throw new TypeError("The `context` option must be an object");r={...r,context:null==o?{}:a?{...o}:{...r.context,...o}}}}if(va(a.hooks)){const{value:e,isReplace:t}=wa(a.hooks);i=Ta(t?{}:i,e),r.hooks=i}if(va(a.headers)){const{value:e,isReplace:t}=wa(a.headers);o=t?Ca(e):Ea(o,e),r.headers=o}}return void 0!==n&&(r.searchParams=n),s.length>0&&(1===s.length?r.signal=s[0]:r.signal=ia?AbortSignal.any(s):s.at(-1)),r},Pa=(...e)=>$a(!0,...e),Da=e=>ca.includes(e)?e.toUpperCase():e,La={limit:2,methods:["get","put","head","delete","options","trace","query"],statusCodes:[408,413,429,500,502,503,504],afterStatusCodes:[413,429,503],maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:e=>.3*2**(e-1)*1e3,jitter:void 0,retryOnTimeout:!1},ja=()=>({...La,methods:[...La.methods],statusCodes:[...La.statusCodes],afterStatusCodes:[...La.afterStatusCodes]}),Ua=e=>{if(void 0===e)return La.limit;if("number"!=typeof e||!Number.isInteger(e)||e<0)throw new TypeError("`retry.limit` must be a finite, non-negative integer");return e},Ma=(e={})=>{if("number"==typeof e)return{...ja(),limit:Ua(e)};if(null===e||"object"!=typeof e||Array.isArray(e))throw new TypeError("`retry` must be a number or an object");const t=Object.fromEntries(Object.entries(e).filter(([,e])=>void 0!==e)),n=Ua(t.limit);if(void 0!==t.methods&&!Array.isArray(t.methods))throw new Error("retry.methods must be an array");if(void 0!==t.statusCodes&&!Array.isArray(t.statusCodes))throw new Error("retry.statusCodes must be an array");if(void 0!==t.afterStatusCodes&&!Array.isArray(t.afterStatusCodes))throw new Error("retry.afterStatusCodes must be an array");return void 0!==t.methods&&(t.methods=t.methods.map(e=>e.toLowerCase())),void 0!==t.statusCodes&&(t.statusCodes=[...t.statusCodes]),void 0!==t.afterStatusCodes&&(t.afterStatusCodes=[...t.afterStatusCodes]),{...ja(),...t,limit:n}};async function Oa(e,{signal:t}){return new Promise((n,r)=>{function o(){clearTimeout(i),r(t.reason)}t&&(t.throwIfAborted(),t.addEventListener("abort",o,{once:!0}));const i=setTimeout(()=>{t?.removeEventListener("abort",o),n()},e)})}var Ia=Object.prototype.toString,qa=/* @__PURE__ */new Set(["network error","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed","fetch failed","terminated"," A network error occurred.","Network connection lost"]);function Ba(e){if(!e||(t=e,"[object Error]"!==Ia.call(t))||"TypeError"!==e.name||"string"!=typeof e.message)return!1;var t;const{message:n,stack:r}=e;return"Load failed"===n||n.startsWith("Load failed (")&&n.endsWith(")")?void 0===r||"__sentry_captured__"in e:!!n.startsWith("error sending request for url")||(!!("Failed to fetch"===n||n.startsWith("Failed to fetch (")&&n.endsWith(")"))||qa.has(n))}var Fa=(e,t)=>e instanceof t||e?.name===t.name;var za=Date.parse("2024-01-01"),Ha=/^\d+$/,Ya=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Wa=/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{2}):(\d{2}):(\d{2}) GMT$/,Ja=/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{2}):(\d{2}):(\d{2}) GMT$/,Va=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{2}| \d) (\d{2}:\d{2}:\d{2}) (\d{4})$/,Ka=({year:e,month:t,day:n,hours:r,minutes:o,seconds:i})=>{const s=Ya.indexOf(t),a=Number(n),c=Number(r),u=Number(o),l=Number(i);if(-1===s||c>23||u>59||l>60)return;const d=Math.min(l,59),h=new Date(Date.UTC(e,s,a,c,u,d));h.setUTCFullYear(e);const p=h.getTime();return h.getUTCFullYear()===e&&h.getUTCMonth()===s&&h.getUTCDate()===a&&h.getUTCHours()===c&&h.getUTCMinutes()===u&&h.getUTCSeconds()===d?60===l?p+1e3:p:void 0},Ga=(e,t)=>e[t],Xa=({value:e,allowTimestamp:t})=>{if(Ha.test(e)){let n=1e3*Number(e);return t&&n>=za&&(n-=Date.now()),Math.max(0,n)}const n=(e=>{const t=Wa.exec(e);if(t)return Ka({year:Number(Ga(t,3)),month:Ga(t,2),day:Ga(t,1),hours:Ga(t,4),minutes:Ga(t,5),seconds:Ga(t,6)});const n=Ja.exec(e);if(n){const e=/* @__PURE__ */new Date,t=Number(Ga(n,3)),r=100*Math.floor(e.getUTCFullYear()/100)+t,o=Date.UTC(e.getUTCFullYear()+50,e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());let i;for(const s of[r-100,r,r+100]){const e=Ka({year:s,month:Ga(n,2),day:Ga(n,1),hours:Ga(n,4),minutes:Ga(n,5),seconds:Ga(n,6)});void 0!==e&&e<=o&&(i=e)}return i}const r=Va.exec(e);if(r){const[e,t,n]=Ga(r,4).split(":");return Ka({year:Number(Ga(r,5)),month:Ga(r,2),day:Ga(r,3).trim(),hours:e,minutes:t,seconds:n})}})(e);if(void 0===n)return;const r=n-Date.now();return Number.isFinite(r)?Math.max(0,r):void 0},Qa=Symbol("timedOutResponseData"),Za=Symbol("timedOutOperation"),ec="The `schema` argument must follow the Standard Schema specification",tc=Object.prototype.toString,nc=/^[\0-\u0020]+/g,rc=/[\t\n\r]/g,oc=/^[a-z][\d+.a-z-]*:/i,ic=/^https?:(?!\/\/)/i,sc=e=>e instanceof globalThis.Request||"[object Request]"===tc.call(e),ac=e=>e instanceof globalThis.Response||"[object Response]"===tc.call(e);function cc(e){const t={...e,json:Ca(e.json),context:Ca(e.context),headers:Ca(e.headers),searchParams:(n=e.searchParams,Array.isArray(n)?n.map(e=>[...e]):Ca(n))};var n;return void 0!==e.retry&&(t.retry=(e=>{if(null===e||"object"!=typeof e||Array.isArray(e))return e;const t={...e};return Array.isArray(t.methods)&&(t.methods=[...t.methods]),Array.isArray(t.statusCodes)&&(t.statusCodes=[...t.statusCodes]),Array.isArray(t.afterStatusCodes)&&(t.afterStatusCodes=[...t.afterStatusCodes]),t})(e.retry)),t}var uc=async(e,t)=>{if("object"!=typeof t&&"function"!=typeof t||null===t)throw new TypeError(ec);const n=t["~standard"];if("object"!=typeof n||null===n||"function"!=typeof n.validate)throw new TypeError(ec);const r=await n.validate(e);if(r.issues)throw new ta(r.issues);return r.value},lc=class e{static create(t,n){const r=n.hooks?.init??[],o=r.length>0?cc(n):n;for(const e of r)e(o);const i=new e(t,o),s=async()=>{if("number"==typeof i.#e.timeout&&i.#e.timeout>2147483647)throw new RangeError("The `timeout` option cannot be greater than 2147483647");if("number"==typeof i.#e.totalTimeout&&i.#e.totalTimeout>2147483647)throw new RangeError("The `totalTimeout` option cannot be greater than 2147483647");await Promise.resolve();const e=await i.#t();void 0!==e&&(i.#n=Ma(i.#e.retry).limit);let t=e??await i.#r(async()=>i.#o()),n=void 0!==e||i.#i();for(;;){if(void 0===t)return t;if(ac(t))try{t=await i.#s(t)}catch(r){if(!(r instanceof ea))throw r;const e=await i.#a(r,async()=>i.#o());if(void 0===e)return e;t=e,n=i.#i();continue}const e=t;if(!e.ok&&"opaque"!==e.type&&("function"==typeof i.#e.throwHttpErrors?i.#e.throwHttpErrors(e.status):i.#e.throwHttpErrors)){const r=new Xs(e,i.#c(e),i.#u()),o=r;if(r.data=await i.#l(e),n)throw o;const s=await i.#a(r,async()=>i.#o());if(void 0===s)return s;t=s,n=i.#i();continue}break}if(!ac(t))return t;if(i.#d(t),i.#e.onDownloadProgress){if("function"!=typeof i.#e.onDownloadProgress)throw new TypeError("The `onDownloadProgress` option must be a function");if(!sa)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");const e=t.clone();return i.#h(t),((e,t)=>{if(!e.body)return e;const n={status:e.status,statusText:e.statusText,headers:e.headers};if(204===e.status)return new Response(null,n);const r=Math.max(0,Number(e.headers.get("content-length"))||0);return new Response(_a(e.body,r,t),n)})(e,i.#e.onDownloadProgress)}return t},a=(async()=>{try{return await s()}catch(e){await i.#p(e)}finally{const e=i.#f;i.#m(e?.body??void 0),i.request!==e&&i.#m(i.request.body??void 0)}})();for(const[e,c]of Object.entries(ua))"bytes"===e&&"function"!=typeof globalThis.Response?.prototype?.bytes||(a[e]=async t=>{i.request.headers.set("accept",i.request.headers.get("accept")||c);const n=await a;if("json"!==e)return i.#g(async()=>n[e](),n);const r=await i.#g(async()=>n.text(),n),s=i.#c(n),u=await i.#_(async()=>{const e=o.parseJson?await o.parseJson(r,{request:s,response:n}):""===r&&void 0!==t?void 0:JSON.parse(r);return void 0===t?e:uc(e,t)});return u===Za&&await i.#p(new na(s)),u});return a}static#y(e){return!e||"object"!=typeof e||Array.isArray(e)||e instanceof URLSearchParams?e:Object.fromEntries(Object.entries(e).filter(([,e])=>void 0!==e))}request;#v;#b=0;#n;#w;#e;#f;#x;#k=/* @__PURE__ */new WeakSet;#S;#C;#E=!1;#N=/* @__PURE__ */new WeakMap;constructor(t,n={}){if(this.#w=t,Object.hasOwn(n,"prefixUrl"))throw new Error("The `prefixUrl` option has been renamed `prefix` in v2 and enhanced to allow slashes in input. See also the new `baseUrl` option for improved flexibility with standard URL resolution: https://github.com/sindresorhus/ky#baseurl");if(this.#e={...n,headers:ka(this.#w.headers,n.headers),hooks:Ta({},n.hooks),method:Da(n.method??this.#w.method??"GET"),prefix:String(n.prefix||""),retry:Ma(n.retry),throwHttpErrors:n.throwHttpErrors??!0,timeout:n.timeout??1e4,totalTimeout:n.totalTimeout??!1,fetch:n.fetch??globalThis.fetch.bind(globalThis),context:n.context??{}},this.#n=this.#e.retry.limit,"string"!=typeof this.#w&&!(this.#w instanceof URL||this.#w instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if("string"==typeof this.#w){if(this.#e.prefix){const e=this.#e.prefix.replace(/\/+$/,""),t=this.#w.replace(/^\/+/,"");this.#w=`${e}/${t}`}if(this.#e.baseUrl){const e=(e=>e.replaceAll(nc,"").replaceAll(rc,""))(this.#w);if(ic.test(e))throw new TypeError("`input` url protocol must be followed by `//` when using `baseUrl`");(e=>oc.test(e))(e)||(this.#w=new URL(this.#w,new Request(this.#e.baseUrl).url))}}oa&&ia&&(this.#x=this.#e.signal??this.#w.signal,this.#v=new globalThis.AbortController,this.#e.signal=this.#T()),ra&&(this.#e.duplex="half"),void 0!==this.#e.json&&(this.#e.body=this.#e.stringifyJson?.(this.#e.json)??JSON.stringify(this.#e.json),this.#e.headers.set("content-type",this.#e.headers.get("content-type")??"application/json"));const r=n.headers&&new globalThis.Headers(n.headers).has("content-type");if(this.#w instanceof globalThis.Request&&(aa&&this.#e.body instanceof globalThis.FormData||this.#e.body instanceof URLSearchParams)&&!r&&this.#e.headers.delete("content-type"),this.request=new globalThis.Request(this.#w,this.#e),void 0!==(o=this.#e.searchParams)&&(Array.isArray(o)?o.length>0:o instanceof URLSearchParams?o.size>0||Boolean(o[Ra]?.size):"object"==typeof o?Object.keys(o).length>0:"string"==typeof o?o.trim().length>0:Boolean(o))){const t=new URL(this.request.url),n=this.#e.searchParams?.[Ra];if(n)for(const e of n)t.searchParams.delete(e);if("string"==typeof this.#e.searchParams){const e=this.#e.searchParams.replace(/^\?/,"");""!==e&&(t.search=t.search?`${t.search}&${e}`:`?${e}`)}else{const n=new URLSearchParams(e.#y(this.#e.searchParams));for(const[e,r]of n.entries())t.searchParams.append(e,r)}if(this.#e.searchParams&&"object"==typeof this.#e.searchParams&&!Array.isArray(this.#e.searchParams)&&!(this.#e.searchParams instanceof URLSearchParams))for(const[e,r]of Object.entries(this.#e.searchParams))void 0===r&&t.searchParams.delete(e);this.request=new globalThis.Request(t,this.#e)}var o;if(this.#e.onUploadProgress&&"function"!=typeof this.#e.onUploadProgress)throw new TypeError("The `onUploadProgress` option must be a function");this.#C="number"==typeof this.#e.totalTimeout?this.#R():void 0}#A(e){const t=e.delay(this.#b+1);let n=t;return!0===e.jitter?n=Math.random()*t:"function"==typeof e.jitter&&(n=e.jitter(t),(!Number.isFinite(n)||n<0)&&(n=t)),Math.min(e.backoffLimit,n)}async#$(e){const t=Ma(this.#e.retry);if(this.#b>=Math.min(t.limit,this.#n))throw e;const n=e instanceof Error?e:new Zs(e);if(n instanceof ea)return n.customDelay??this.#A(t);if(!t.methods.includes(this.request.method.toLowerCase()))throw e;const{shouldRetry:r}=t;if(void 0!==r){const o=await this.#_(async()=>r({error:n,retryCount:this.#b+1}));if(o===Za)throw new na(this.request);if(!1===o)throw e;if(!0===o)return this.#A(t)}if(function(e){return Fa(e,na)}(e)){if(!t.retryOnTimeout)throw e;return this.#A(t)}if(function(e){return Fa(e,Xs)}(e)){if(!t.statusCodes.includes(e.response.status))throw e;const n=(e=>{const t=e.get("Retry-After");if(null!==t)return{value:t,allowTimestamp:!1};const n=e.get("RateLimit-Reset");if(null!==n)return{value:n,allowTimestamp:!0};const r=e.get("X-RateLimit-Retry-After");if(null!==r)return{value:r,allowTimestamp:!1};const o=e.get("X-RateLimit-Reset")??e.get("X-Rate-Limit-Reset");return null!==o?{value:o,allowTimestamp:!0}:void 0})(e.response.headers);if(n&&t.afterStatusCodes.includes(e.response.status)){const e=Xa(n);return void 0===e?this.#A(t):Math.min(t.maxRetryAfter,e)}if(413===e.response.status)throw e;return this.#A(t)}if(!function(e){return Fa(e,Qs)}(e))throw e;return this.#A(t)}#d(e){const t=this.#c(e);return this.#e.parseJson&&(e.json=async()=>{const n=await e.text();return this.#e.parseJson(n,{request:t,response:e})}),e}async#p(e){if(!(e instanceof Error))throw e;if(this.#k.has(e))throw e;let t=e;for(const n of this.#e.hooks.beforeError){const e=await n({request:this.request,options:this.#u(),error:t,retryCount:this.#b});e instanceof Error&&(t=e)}throw t}async#l(e){const t=this.#P(),n=await this.#D(e,t.milliseconds);if(n===Qa){if(t.fromTotalTimeout)throw new na(this.request);return void this.#L()}if(!n)return;if(!this.#j(e.headers.get("content-type")??""))return n;const r=this.#P(),o=await this.#U(n,e,r.milliseconds,this.#c(e));if(o!==Qa)return o;if(r.fromTotalTimeout)throw new na(this.request);this.#L()}#P(){const e=!1===this.#e.timeout?1e4:this.#e.timeout,t=this.#M();if(void 0===t)return{milliseconds:e,fromTotalTimeout:!1};if(t<=0)throw new na(this.request);return{milliseconds:Math.min(e,t),fromTotalTimeout:t<=e}}#O(){const e=this.#M();if(void 0!==e){if(e<=0)throw new na(this.request);return!1===this.#e.timeout?e:Math.min(this.#e.timeout,e)}return!1===this.#e.timeout?void 0:this.#e.timeout}async#g(e,t){let n;try{n=this.#O()}catch(i){await this.#p(i)}const r=e();if(void 0===n)return r;const o=await Promise.race([r,new Promise(e=>{const t=setTimeout(()=>{e(Qa)},n);r.finally(()=>{clearTimeout(t)}).catch(()=>{})})]);return o===Qa&&(this.#v?.abort(),await this.#p(new na(this.#c(t)))),o}async#_(e){const t=this.#M();if(void 0===t)return e();if(t<=0)return this.#v?.abort(),Za;let n;try{const r=new Promise(e=>{n=setTimeout(()=>{e(Za)},t)}),o=Promise.resolve().then(e).then(e=>({status:"fulfilled",value:e})).catch(e=>({status:"rejected",error:e})),i=await Promise.race([o,r]),s=this.#M();if(i===Za||void 0!==s&&s<=0)return this.#v?.abort(),i===Za?o.then(e=>{"fulfilled"===e.status&&this.#I(e.value)}):"fulfilled"===i.status&&this.#I(i.value),Za;if("rejected"===i.status)throw i.error;return i.value}finally{clearTimeout(n)}}#j(e){const t=(e.split(";",1)[0]??"").trim().toLowerCase();return/\/(?:.*[.+-])?json$/.test(t)}async#D(e,t){const{body:n}=e;if(!n)try{return await e.text()}catch{return}let r;try{r=n.getReader()}catch{return}const o=(e=>{const t=/;\s*charset\s*=\s*(?:"([^"]+)"|([^;,\s]+))/i.exec(e),n=t?.[1]??t?.[2];if(n)try{return new TextDecoder(n)}catch{}return new TextDecoder})(e.headers.get("content-type")??""),i=[];let s=0;const a=(async()=>{try{for(;;){const{done:e,value:t}=await r.read();if(e)break;if(s+=t.byteLength,s>10485760)return void r.cancel().catch(()=>{});i.push(o.decode(t,{stream:!0}))}}catch{return}return i.push(o.decode()),i.join("")})(),c=new Promise(e=>{const n=setTimeout(()=>{e(Qa)},t);a.finally(()=>{clearTimeout(n)})}),u=await Promise.race([a,c]);return u===Qa&&r.cancel().catch(()=>{}),u}async#U(e,t,n,r){let o;try{return await Promise.race([Promise.resolve().then(()=>this.#e.parseJson?this.#e.parseJson(e,{request:r,response:t}):JSON.parse(e)),new Promise(e=>{o=setTimeout(()=>{e(Qa)},n)})])}catch{return}finally{clearTimeout(o)}}#m(e){e&&e.cancel().catch(()=>{})}#h(e){this.#m(e.body??void 0)}#I(e){ac(e)?this.#h(e):sc(e)&&this.#m(e.body??void 0)}#T(){return this.#x?AbortSignal.any([this.#x,this.#v.signal]):this.#v.signal}#L(){const e=this.#M();if(void 0!==e&&e<=0)throw new na(this.request)}async#t(){for(const e of this.#e.hooks.beforeRequest){const t=await this.#_(async()=>e({request:this.request,options:this.#u(),retryCount:0}));if(t===Za)throw new na(this.request);if(sc(t))this.#q(t);else if(ac(t))return t}}async#s(e){const t=this.#c(e);for(const r of this.#e.hooks.afterResponse){const o=this.#B(e.clone(),t);let i;this.#d(o);try{if(i=await this.#_(async()=>r({request:this.request,options:this.#u(),response:o,retryCount:this.#b})),i===Za)throw new na(this.request)}catch(n){throw o!==e&&this.#h(o),this.#h(e),n}if(i instanceof ha)throw o!==e&&this.#h(o),this.#h(e),new ea(i.options);const s=ac(i)?this.#B(i,t):e;o!==e&&o!==s&&o.body!==s.body&&this.#h(o),e!==s&&e.body!==s.body&&this.#h(e),e=s}return e}async#r(e){try{return await e()}catch(t){return this.#a(t,e)}}async#a(e,t){this.#E=!1;const n=Math.min(await this.#$(e),la),r={signal:this.#x},o=this.#M();if(void 0!==o){if(o<=0)throw new na(this.request);if(n>=o)throw await Oa(o,r),new na(this.request)}if(await Oa(n,r),this.#L(),e instanceof ea&&e.customRequest){const t=new globalThis.Request(e.customRequest,this.#e.signal?{signal:this.#e.signal}:void 0);this.#q(t)}for(const s of this.#e.hooks.beforeRetry){let t;try{t=await this.#_(async()=>s({request:this.request,options:this.#u(),error:e,retryCount:this.#b+1}))}catch(i){throw i instanceof Error&&i!==e&&this.#k.add(i),i}if(t===Za)throw new na(this.request);if(sc(t)){this.#q(t);break}if(ac(t))return this.#E=!0,this.#b++,t;if(t===da)return}return this.#L(),this.#b++,this.#r(t)}#i(){const e=this.#E;return this.#E=!1,e}async#o(){this.#v?.signal.aborted&&(this.#v=new globalThis.AbortController,this.#e.signal=this.#T(),this.request=new globalThis.Request(this.request,{signal:this.#e.signal}));const e=(e=>{const t={};for(const n in e)Object.hasOwn(e,n)&&(n in ma||n in fa||(t[n]=e[n]));return t})(this.#e);this.#n=Ma(this.#e.retry).limit;const t=this.#n>0?this.request.clone():void 0,n=this.#F(this.request,this.#e.body??void 0);this.#f=n,t&&(this.request=t);try{const t=this.#M();if(void 0!==t&&t<=0)throw new na(this.request);const r=!1===this.#e.timeout?t:void 0===t?this.#e.timeout:Math.min(this.#e.timeout,t),o=void 0===r?await this.#e.fetch(n,e):await async function(e,t,n,r){return new Promise((o,i)=>{const s=setTimeout(()=>{n&&n.abort(),i(new na(e))},r.timeout);r.fetch(e,t).then(o).catch(i).then(()=>{clearTimeout(s)})})}(n,e,this.#v,{timeout:r,fetch:this.#e.fetch});return this.#B(o,n)}catch(r){if(Ba(r))throw new Qs(this.request,{cause:r});throw r}}#M(){if(void 0===this.#C)return;const e=this.#R()-this.#C;return Math.max(0,this.#e.totalTimeout-e)}#R(){return globalThis.performance?.now()??Date.now()}#u(){if(!this.#S){const{hooks:e,json:t,parseJson:n,stringifyJson:r,searchParams:o,timeout:i,totalTimeout:s,throwHttpErrors:a,fetch:c,...u}=this.#e;this.#S=Object.freeze(u)}return this.#S}#q(e){this.#S=void 0,this.request=e}#c(e){return this.#N.get(e)??this.request}#B(e,t){return this.#N.set(e,t),e}#F(e,t){return this.#e.onUploadProgress&&e.body&&ra?ya(e,this.#e.onUploadProgress,t??this.#e.body??void 0):e}},dc=e=>{const t=(t,n)=>lc.create(t,xa(e,n));for(const n of ca)t[n]=(t,r)=>lc.create(t,xa(e,r,{method:n}));return t.create=e=>dc(xa(e)),t.extend=t=>("function"==typeof t&&(t=t(e??{})),dc(xa(e,t))),t.stop=da,t.retry=pa,t},hc=dc(),pc=/* @__PURE__ */new Map,fc=hc.create({retry:{limit:3,methods:["get","put","head","delete","options","trace"],statusCodes:[408,429,500,502,503,504]},headers:{Accept:"application/json"},hooks:{beforeRequest:[({request:e})=>{if("GET"!==e.method)return;const t=pc.get(e.url);t&&(t.etag&&e.headers.set("If-None-Match",t.etag),t.lastModified&&e.headers.set("If-Modified-Since",t.lastModified))}],afterResponse:[async({request:e,response:t})=>{if("GET"!==e.method)return t;if(304===t.status){const t=pc.get(e.url);if(t)return new Response(t.body,{status:200,headers:{"Content-Type":"application/json"}})}if(t.ok){const n=t.headers.get("ETag")??void 0,r=t.headers.get("Last-Modified")??void 0;if(void 0!==n||void 0!==r){const o=await t.clone().text();pc.set(e.url,{etag:n,lastModified:r,body:o})}}return t}]}});async function mc({apiUrl:e,locale:t,portalCode:n,params:r,signal:o}){const i=function({apiUrl:e,portalCode:t,params:n}){const r=new URL("/portal_api/v1/accommodations",new URL(e).origin);return r.search=new URLSearchParams({portal_code:t,...n}).toString(),r.toString()}({apiUrl:e,portalCode:n,params:r});try{return await fc.get(i,{headers:{locale:t},signal:o}).json()}catch(s){if(s instanceof Xs)throw new Error(`Search request failed (${s.response.status})`);throw s}}function gc(e){const t=Object.entries(e).filter(([e,t])=>/^category_\d+$/.test(e)&&t).map(([,e])=>Number(e));return[...new Set([...e.properties||[],...t].map(Number).filter(Number.isFinite))].sort((e,t)=>e-t)}function _c(e,t,n){const r=Number(n);r&&(e[t]=String(r))}var yc=/^\d{4}-\d{2}-\d{2}$/,vc=/^\d{1,10}$/,bc="\\|[\\p{L}\\p{M}\\d '’.()-]{1,100}",wc=new RegExp(`^\\d{1,10}${bc}$`,"u"),xc=new RegExp(`^\\d{1,10}${bc}${bc}$`,"u");function kc(e){return e&&yc.test(e)?e:void 0}function Sc(e){return"number"==typeof e?Number.isSafeInteger(e)&&e>=0:"string"==typeof e&&vc.test(e)}function Cc(e){return t=>"string"==typeof t&&e.test(t)}var Ec={countries:{format:Sc,list:!0},regions:{format:Cc(wc),list:!0},cities:{format:Cc(xc),list:!0},persons_max:{format:Sc,list:!1},bedrooms_min:{format:Sc,list:!1},bathrooms_min:{format:Sc,list:!1},weekprice_max:{format:Sc,list:!1}};function Nc(e,{format:t,list:n}){if(t(e))return e;if(!n||!Array.isArray(e)||e.length>50)return;const r=e.filter(t);return r.length>0?r:void 0}function Tc(e,t){const n=parseInt(String(e.persons_min??""),10),r=function(e){const t={};for(const[r,o]of Object.entries(Ec)){const n=Nc(e[r],o);void 0!==n&&(t[r]=n)}const n=gc(e).filter(Sc);return n.length>0&&n.length<=50&&(t.properties=n),t}(e);return{arrival:kc(e.arrival_date),departure:kc(e.departure_date),persons:n>0?n:void 0,filters:Object.keys(r).length>0?r:void 0,result_count:t}}var Rc=/* @__PURE__ */new Set;function Ac(e){return e.isConnected&&"true"===e.getAttribute("data-consent")}function $c(){return"undefined"!=typeof window&&!0===window.bukazuConsent||[...Rc,...document.querySelectorAll(".bukazu-app, #bukazu-app")].some(Ac)}var Pc="https://api.bukazu.com/tracking",Dc="bu_portal_session",Lc=/^[A-Za-z0-9_.-]{1,64}$/,jc="",Uc=null,Mc=!1,Oc=null;function Ic(){return $c()&&Wc(Dc)||jc}function qc(e){return"string"==typeof e&&Lc.test(e)}async function Bc(e){try{!Ic()&&Oc&&await Oc;const t=async function(e){const t=$c(),n=Ic(),r={...e,interaction_info:Fc(e.interaction_info),url:window.location.href,consented:t};n&&(r.session_identifier=n);const o=t&&!Mc&&!Wc(Dc);o&&(r.attribution=function(){if(Uc)return Uc;const e=new URLSearchParams(window.location.search),t={landing_path:window.location.pathname,device_class:zc(window.innerWidth)},n=function(){const e=Hc();return e===window.location.host?"":e}();n&&(t.referrer_host=n);for(const r of["utm_source","utm_medium","utm_campaign"]){const n=e.get(r);n&&(t[r]=n)}return Uc=t,t}(),Mc=!0);let i="";try{i=(await fc.post(Pc,{json:r}).text()).trim()}finally{!i&&o&&(Mc=!1)}if(!i)return;jc=i,$c()&&function(e,t,n){const r=/* @__PURE__ */new Date;r.setTime(r.getTime()+24*n*60*60*1e3),document.cookie=`${e}=${t};expires=${r.toUTCString()};path=/;SameSite=Lax;Secure`}(Dc,i,14)}(e);if(!Ic()&&!Oc){const e=()=>{Oc=null};Oc=t.then(e,e)}await t}catch{}}function Fc(e){const t={};for(const[n,r]of Object.entries(e))null!=r&&""!==r&&(t[n]=r);return t}function zc(e){return e<768?"mobile":e<1024?"tablet":"desktop"}function Hc(){try{return document.referrer?new URL(document.referrer).host:""}catch{return""}}function Yc(){const e=Hc();return e?e===window.location.host?"search":"external":"direct"}function Wc(e){let t=e+"=",n=decodeURIComponent(document.cookie).split(";");for(let r=0;r<n.length;r++){let e=n[r];for(;" "==e.charAt(0);)e=e.substring(1);if(0==e.indexOf(t))return e.substring(t.length,e.length)}return""}function Jc({filters:e,PortalSite:t,limit:n,skip:r,onPageChange:a,activePage:l,viewMode:f,onViewModeChange:m}){const{portalCode:g,apiUrl:_,locale:y}=o(zs),{currency:v}=Vs(),[b,w]=u({status:"loading"}),x=JSON.stringify(function(e,{limit:t,skip:n,currency:r}){const o={limit:String(t),skip:String(n)};r&&(o.currency=r),e.countries&&(o.country_id=String(e.countries)),e.regions&&(o.region_id=String(e.regions)),e.cities&&(o.city_id=String(e.cities)),e.extra_search&&(o.extra_search=e.extra_search),_c(o,"persons_min",e.persons_min),_c(o,"persons_max",e.persons_max),_c(o,"bedrooms_min",e.bedrooms_min),_c(o,"bathrooms_min",e.bathrooms_min),_c(o,"weekprice_max",e.weekprice_max);const i=gc(e);return i.length>0&&(o.properties=i.join(",")),e.arrival_date&&(o.arrival_date=e.arrival_date,e.departure_date?(o.starts_at=e.arrival_date,o.ends_at=e.departure_date,_c(o,"no_nights_min",Se(le(e.departure_date),le(e.arrival_date)))):o.no_nights_min="1"),o}(e,{limit:n,skip:r,currency:v})),k=s(()=>JSON.parse(x),[x]),S=JSON.stringify(e),C=c(e);C.current=e;const E=c(null),N=c(null),T=c(null),R=()=>{const e=N.current;null!==e&&null!==T.current&&(N.current=null,E.current=e,Bc({portal_code:g,locale:y,interaction_type:"search",interaction_info:Tc(C.current,T.current)}))};if(i(()=>{if(E.current===S)return;const e=setTimeout(()=>{N.current=S,R()},1e3);return()=>{clearTimeout(e),N.current=null}},[S,g,y]),i(()=>{const e=new AbortController;return T.current=null,w({status:"loading"}),mc({apiUrl:_,locale:y,portalCode:g,params:k,signal:e.signal}).then(t=>{e.signal.aborted||(w({status:"ready",response:t}),T.current=t.meta.total_count,R())}).catch(t=>{e.signal.aborted||w({status:"error",error:t instanceof Error?t:/* @__PURE__ */new Error("A search request failed")})}),()=>{e.abort()}},[_,y,g,k]),"loading"===b.status)/* @__PURE__ */return d("div",{children:/* @__PURE__ */d(p,{})});if("error"===b.status)/* @__PURE__ */return d("div",{children:/* @__PURE__ */d(Is,{errors:b.error})});const{items:A,meta:$}=b.response,P=f??t.options.filtersForm.mode,D=/* @__PURE__ */d(ze,{totalCount:$.total_count,activePage:l,limit:n,onPageChange:a});/* @__PURE__ */
40
+ return h("div",{id:"results",className:P,children:[
41
+ /* @__PURE__ */h("div",{className:"bu-results-toolbar",children:[/* @__PURE__ */d(Ks,{}),m&&/* @__PURE__ */d(We,{mode:P,onChange:m})]}),D,0===A.length?/* @__PURE__ */d("div",{className:"bu-noresults",children:ne("no_results")}):null,A.map(e=>/* @__PURE__ */d("div",{style:{display:"contents"},dangerouslySetInnerHTML:{__html:Fe({result:e,options:t.options.filtersForm,currency:$.currency??v})}},e.id)),D]})}var Vc=["countries","regions","cities","arrival_date","departure_date","persons_min","persons_max","bedrooms_min","bathrooms_min","weekprice_max","extra_search"];var Kc="bukazuViewMode";function Gc(){try{const t=window.localStorage.getItem(Kc);return"grid"===(e=t)||"list"===e?t:null}catch{return null}var e}var Xc=class extends t{constructor(e){super(e);let t=Number(this.props.options.filtersForm.no_results);const n=(this.props.options.filtersForm.prefill_filters_from_url??!0)&&"undefined"!=typeof window?function(e){const t=new URLSearchParams(e),n={};return t.forEach((e,t)=>{if(e){if("properties"===t){const t=e.split(",").map(e=>e.trim()).filter(Boolean);return void(t.length>0&&(n.properties=t))}(Vc.includes(t)||/^category_\d+$/.test(t))&&(n[t]=e)}}),n}(window.location.search):{};this.hasUrlFilters=Object.keys(n).length>0,this.state={filters:{...this.props.filters||{},...n},activePage:1,limit:t,skip:0,viewMode:Gc()??this.props.options.filtersForm.mode??"grid"},this.onFilterChange=this.onFilterChange.bind(this),this.onViewModeChange=this.onViewModeChange.bind(this),this.pageChange=this.pageChange.bind(this)}componentDidMount(){if(Bc({portal_code:this.props.PortalSite.portal_code,interaction_type:"search_view",locale:this.props.locale,interaction_info:{}}),this.hasUrlFilters)return;let e=localStorage.getItem("bukazuFilters"),t=localStorage.getItem("bukazuActivePage");e&&this.setState({filters:JSON.parse(e)}),t&&this.pageChange(parseInt(t)||0)}onFilterChange(e){let t=e;this.setState({filters:t}),localStorage.setItem("bukazuFilters",JSON.stringify(t)),this.pageChange(0)}onViewModeChange(e){this.setState({viewMode:e}),function(e){try{window.localStorage.setItem(Kc,e)}catch{}}(e)}pageChange(e){const{limit:t}=this.state;let n=e*t;localStorage.setItem("bukazuActivePage",e.toString()),this.setState({activePage:e,skip:n})}render(){const{filters:e,activePage:t,limit:n,skip:r,viewMode:o}=this.state,{options:i,PortalSite:s}=this.props;/* @__PURE__ */
42
+ return h("div",{id:"search-page",className:"right"===i.filtersForm.location?"bu-reverse":"top"===i.filtersForm.location?"bu-column":"",children:[/* @__PURE__ */d(Ie,{PortalSite:s,filters:e,onFilterChange:this.onFilterChange,options:i}),/* @__PURE__ */d(Jc,{PortalSite:s,filters:e,activePage:t,onPageChange:this.pageChange,skip:r,limit:n,viewMode:o,onViewModeChange:this.onViewModeChange})]})}},Qc=class extends Error{constructor(e,t,n){super(t.join("\n")||`Booking request failed (${e})`),this.name="CreateBookingError",this.status=e,this.messages=t.length>0?t:[this.message],n&&(this.fieldErrors=n)}};async function Zc({apiUrl:e,locale:t,payload:n}){const r=function({apiUrl:e}){return new URL("/portal_api/v1/accommodations/bookings",new URL(e).origin).toString()}({apiUrl:e});try{return await fc.post(r,{json:n,headers:{locale:t}}).json()}catch(o){if(o instanceof Xs)throw await async function(e){const t=e.response.status;let n={};try{n=await e.response.json()}catch{return new Qc(t,[])}const r=n.error?[n.error]:[];return new Qc(t,r,n.errors)}(o);throw o}}var eu=["first_name","preposition","last_name","company_name","email","phone","phone_mobile","address","house_number","zipcode","city","iban","bic","holder","comment","discount_code","discount_reason","currency"];function tu(e){if("string"!=typeof e)return;const t=e.trim();return""===t?void 0:t}function nu(e){const t={};for(const[n,r]of Object.entries(e??{})){const e=Number(r);Number.isFinite(e)&&e>0&&(t[n]=e)}return t}function ru({values:e,objectCode:t,portalCode:n,locale:r,sessionIdentifier:o}){const i={portal_code:n,object_code:t,starts_at:e.arrivalDate.date,ends_at:e.departureDate.date,is_option:"true"===e.is_option,language:r,country:e.country.toUpperCase(),adults:Number(e.adults)||0,children:Number(e.children)||0,babies:Number(e.babies)||0,discount:Number(e.discount)||0,cancel_insurance:Number(e.cancel_insurance)||0,costs:nu(e.costs)},s=function(e){const t={};for(const[n,r]of Object.entries(e??{})){const e=tu(r);void 0!==e&&(t[n]=e)}return Object.keys(t).length>0?t:void 0}(e.extra_fields);s&&(i.extra_fields=s),o&&(i.session_identifier=o);for(const a of eu){const t=tu(e[a]);void 0!==t&&(i[a]=t)}return i}function ou({children:e,buttonText:t,show:n=!1,onClose:r}){const[o,s]=u(n),a=c(null);i(()=>{const e=a.current;e&&(o?e.showModal():e.close())},[o]);const p=()=>{s(!1),r?.()};/* @__PURE__ */
43
+ return h(l,{children:[!o&&t&&/* @__PURE__ */d("button",{type:"button",className:"info-button",onClick:()=>s(!0),children:t}),/* @__PURE__ */h("dialog",{ref:a,className:"bukazu-modal",onCancel:p,onClick:e=>{e.target===a.current&&p()},children:[/* @__PURE__ */d("div",{className:"bukazu-modal-content",children:e}),/* @__PURE__ */d("div",{className:"bukazu-modal-footer",children:/* @__PURE__ */d("button",{type:"button",onClick:p,children:ne("close")})})]})]})}function iu(e){return Array.from({length:e+1},(e,t)=>t)}function su(e){const t={};return e.forEach(e=>{t[e.id]=""}),t}function au(e){return e.replace(/\[(\w+)\]/g,".$1").replace(/^\./,"").split(".")}function cu(e,t){const n=au(t);let r=e;for(const o of n){if(null===r||"object"!=typeof r||!(o in r))return;r=r[o]}return r}function uu(e,t,n){const r=au(t),o={...e};let i=o,s=e;return r.forEach((e,t)=>{if(t===r.length-1)return void(i[e]=n);const o=null!==s&&"object"==typeof s?s[e]:void 0,a=null===o||"object"!=typeof o||Array.isArray(o)?{}:{...o};i[e]=a,i=a,s=o}),o}function lu(e,t){let n=Number(t.babies)-Number(e.babies_extra);return n<0&&(n=0),Number(t.children)+Number(t.adults)+n}function du(e,t){/* @__PURE__ */
44
+ return d("option",{value:t,children:ne(e)})}var hu=n({values:{arrivalDate:{},departureDate:{},is_option:"false",costs:{},adults:0,children:0,babies:0,persons:0,discount:0,country:"",cancel_insurance:"0",discount_code:"",extra_fields:{}},errors:{},touched:{},isSubmitting:!1,setFieldValue:()=>{},setFieldTouched:()=>{}});function pu(e){const{values:t,errors:n,touched:r,setFieldValue:i}=o(hu),s=n[e],a=cu(n,e),c="string"==typeof s?s:"string"==typeof a?a:void 0,u=r[e],l=cu(r,e);return{error:c,touched:"boolean"==typeof u?u:"boolean"==typeof l&&l,value:cu(t,e)??"",onBlur:()=>{},onChange:t=>{i(e,t.target.value)}}}var fu={selectedDate:null,arrivalDate:null,departureDate:null,bookingStarted:!1,persons:0},mu=n(fu),gu=n(yu);function _u({children:e}){const[t,n]=a(yu,fu);/* @__PURE__ */
45
+ return d(mu.Provider,{value:t,children:/* @__PURE__ */d(gu.Provider,{value:n,children:e})})}function yu(e,t){switch(t.type){case"clicked":{const{day:n,house:r}=t,{selectedDate:o,arrivalDate:i}=e,s=le(n.date),a=r.persons>2?2:r.persons;return n.departure&&o&&i&&xe(s,o)&&Se(s,o)<=r.max_nights&&Se(s,o)>=i.min_nights&&Se(s,o)<=i.max_nights?{...e,departureDate:n}:n.arrival?{bookingStarted:!1,selectedDate:s,arrivalDate:n,departureDate:null,persons:a}:e}case"reset":return fu;case"start":return{...e,bookingStarted:!0,persons:t.persons};case"return":return{...e,bookingStarted:!1};default:throw Error("Unknown action: "+t.type)}}var vu=({error:e})=>e?/* @__PURE__ */d("div",{className:"input-feedback",children:e}):null,bu=({name:e,value:t,currentValue:n,onChange:r,onBlur:o,id:i,label:s,...a})=>/* @__PURE__ */h("div",{children:[/* @__PURE__ */d("input",{name:e,id:i,type:"radio",value:t,checked:t===n,onChange:r,onBlur:o,className:"radio-button",...a}),/* @__PURE__ */d("label",{htmlFor:i,children:s})]}),wu=({error:e,touched:t,label:n,className:r,children:o})=>/* @__PURE__ */h("div",{className:r,children:[
46
+ /* @__PURE__ */d("div",{className:"legend",children:n}),o,t&&/* @__PURE__ */d(vu,{error:e})]});function xu({house:e}){const t=pu("is_option");/* @__PURE__ */
47
+ return d(l,{children:e.allow_option&&/* @__PURE__ */d("div",{children:/* @__PURE__ */h(wu,{id:"is_option",className:"booking_option",children:[/* @__PURE__ */d(bu,{name:"is_option",value:"true",currentValue:String(t.value),onChange:t.onChange,onBlur:t.onBlur,id:"true",disabled:!e.allow_option,label:ne("option")}),/* @__PURE__ */d(bu,{name:"is_option",value:"false",currentValue:String(t.value),onChange:t.onChange,onBlur:t.onBlur,id:"false",label:ne("booking")})]})})})}var ku=({height:e="16px",width:t="16px"})=>/* @__PURE__ */h("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",version:"1.1",x:"0px",y:"0px",viewBox:"0 0 100 100",enableBackground:"new 0 0 100 100",xmlSpace:"preserve",style:{height:e,width:t},children:[
33
48
  /* @__PURE__ */d("path",{d:"M50,5c24.813,0,45,20.187,45,45c0,24.813-20.187,45-45,45C25.187,95,5,74.813,5,50C5,25.187,25.187,5,50,5 M50,0C22.386,0,0,22.386,0,50c0,27.614,22.386,50,50,50c27.614,0,50-22.386,50-50C100,22.386,77.614,0,50,0L50,0z"}),
34
49
  /* @__PURE__ */d("circle",{cx:"50",cy:"29.546",r:"4.934"}),
35
- /* @__PURE__ */d("rect",{x:"46.5",y:"41.21",width:"7",height:"34.179"})]});function Rc({description:e}){let t=/* @__PURE__ */d("span",{});return e&&(t=/* @__PURE__ */d("span",{style:{padding:"0 0 0 8px"},children:/* @__PURE__ */d(uc,{buttonText:/* @__PURE__ */d(Nc,{}),children:/* @__PURE__ */d("p",{children:e})})})),t}function Ac({name:e,amount:t,description:n,method_name:r,formatName:o,forceMethod:s,currency:i="EUR"}){/* @__PURE__ */
36
- return h("tr",{children:[/* @__PURE__ */h("td",{children:[o?Q(e):e,n&&/* @__PURE__ */d(l,{children:/* @__PURE__ */d(Rc,{description:n})})]}),/* @__PURE__ */d("td",{className:"price",children:t&&t>0?/* @__PURE__ */h(l,{children:[Z(t,{style:"currency",currency:i}),s&&/* @__PURE__ */h(l,{children:[" ",r]})]}):/* @__PURE__ */d(l,{children:r})})]})}function Dc({prices:e}){const{insurances:t,required_costs:n}=e.total_costs,{not_on_site:r}=n,{currency:o}=e;/* @__PURE__ */
37
- return d("div",{className:"costs-section",children:/* @__PURE__ */d("table",{children:/* @__PURE__ */h("tbody",{children:[t&&/* @__PURE__ */d(l,{children:Object.keys(t).map(e=>{const n=t[e];if(n>0)/* @__PURE__ */return d(Ac,{name:e,formatName:!0,amount:n,currency:o},e)})}),e.required_house_costs.map(e=>{if(!e.on_site&&"0120"!==e.gl)return"none"===e.method?/* @__PURE__ */d(Ac,{...e,currency:o},e.id):0===e.amount?null:/* @__PURE__ */d(Ac,{...e,amount:r?.find(t=>t.id==e.id)?.amount??0,currency:o},e.id)})]})})})}Ac.defaultValues={formatName:!1,forceMethod:!1};var Pc=class extends Error{constructor(e,t){super(`No prices available for ${e} - ${t}`),this.name="PriceUnavailableError"}};async function $c(e){const t=function({apiUrl:e,portalCode:t,objectCode:n,startsAt:r,endsAt:o,persons:s,currency:i,cancelInsurance:a,discount:c,discountCode:u,costs:l,includeAccommodation:d}){const h=new URL("/portal_api/v1/accommodations/price",new URL(e).origin),p=new URLSearchParams({portal_code:t,object_code:n,starts_at:r,ends_at:o});if(void 0!==s&&p.set("persons",String(s)),i&&p.set("currency",i),void 0!==a&&p.set("cancel_insurance",String(a)),void 0!==c&&p.set("discount",String(c)),u&&p.set("discount_code",u),l)for(const[f,m]of Object.entries(l))p.set(`costs[${f}]`,String(m));return d&&p.set("include_accommodation","true"),h.search=p.toString(),h.toString()}(e);let n;try{n=await Ea.get(t,{headers:{locale:e.locale}}).json()}catch(r){if(r instanceof ui){if(422===r.response.status)throw new Pc(e.startsAt,e.endsAt);throw new Error(`Price request failed (${r.response.status})`)}throw r}if(!n.currency)throw new Pc(e.startsAt,e.endsAt);return n}function Lc({prices:e}){const{rent_price:t,discount:n,discounted_price:r,currency:o}=e;/* @__PURE__ */
38
- return d("div",{className:"costs-section",children:/* @__PURE__ */d("table",{children:/* @__PURE__ */h("tbody",{children:[/* @__PURE__ */d(Ac,{name:"rent_price",formatName:!0,amount:t,currency:o}),n>0?/* @__PURE__ */h(l,{children:[/* @__PURE__ */d(Ac,{name:"discount",formatName:!0,amount:n,currency:o}),/* @__PURE__ */d(Ac,{name:"price_after_discount",formatName:!0,amount:r,currency:o})]}):null]})})})}function Uc({prices:e}){const{optional_costs:t}=e.total_costs,{not_on_site:n}=t;/* @__PURE__ */
39
- return d("div",{className:"costs-section",children:/* @__PURE__ */d("table",{children:/* @__PURE__ */d("tbody",{children:e.optional_house_costs.map(t=>{if(!t.on_site&&"0120"!==t.gl){if("none"===t.method)/* @__PURE__ */return d(Ac,{...t,currency:e.currency},t.id);if("on_site"===t.method){if((n.find(e=>e.id==t.id)?.nr_of_items??0)>0)/* @__PURE__ */return d(Ac,{...t,amount:t.amount,forceMethod:!0,currency:e.currency},t.id)}else{let r=n.find(e=>e.id==t.id)?.amount??0;if(r>0)/* @__PURE__ */return d(Ac,{...t,amount:r,currency:e.currency},t.id)}}})})})})}function jc({prices:e}){const{optional_costs:t}=e.total_costs,{on_site:n}=t;/* @__PURE__ */
40
- return d(l,{children:e.optional_house_costs.map(t=>{if(t.on_site&&"0120"!==t.gl){if("none"===t.method)/* @__PURE__ */return d(Ac,{...t,currency:e.currency},t.id);if("on_site"===t.method){if((n?.find(e=>e.id==t.id)?.nr_of_items??0)>0)/* @__PURE__ */return d(Ac,{...t,amount:t.amount,forceMethod:!0,currency:e.currency},t.id)}else{let r=n?.find(e=>e.id==t.id)?.amount??0;if(r>0)/* @__PURE__ */return d(Ac,{...t,amount:r,currency:e.currency},t.id)}}})})}function Oc({prices:e}){const{required_costs:t}=e.total_costs,{on_site:n}=t;/* @__PURE__ */
41
- return h("div",{className:"costs-section",children:[/* @__PURE__ */d("strong",{children:Q("costs_on_site")}),/* @__PURE__ */d("table",{children:/* @__PURE__ */h("tbody",{children:[e.required_house_costs.map(t=>{if(t.on_site&&"0120"!==t.gl){if("none"===t.method)/* @__PURE__ */return d(Ac,{...t,currency:e.currency},t.id);{let r=n.find(e=>e.id==t.id)?.amount??0;/* @__PURE__ */
42
- return d(Ac,{...t,amount:r,currency:e.currency},t.id)}}}),/* @__PURE__ */d(jc,{prices:e})]})})]})}function Ic({children:e}){/* @__PURE__ */
43
- return d("div",{className:"costs-section",children:/* @__PURE__ */d("table",{children:/* @__PURE__ */d("tbody",{children:e})})})}function Mc({prices:e}){const{currency:t}=e;/* @__PURE__ */
50
+ /* @__PURE__ */d("rect",{x:"46.5",y:"41.21",width:"7",height:"34.179"})]});function Su({description:e}){let t=/* @__PURE__ */d("span",{});return e&&(t=/* @__PURE__ */d("span",{style:{padding:"0 0 0 8px"},children:/* @__PURE__ */d(ou,{buttonText:/* @__PURE__ */d(ku,{}),children:/* @__PURE__ */d("p",{children:e})})})),t}function Cu({name:e,amount:t,description:n,method_name:r,formatName:o,forceMethod:i,currency:s="EUR"}){/* @__PURE__ */
51
+ return h("tr",{children:[/* @__PURE__ */h("td",{children:[o?ne(e):e,n&&/* @__PURE__ */d(l,{children:/* @__PURE__ */d(Su,{description:n})})]}),/* @__PURE__ */d("td",{className:"price",children:t&&t>0?/* @__PURE__ */h(l,{children:[re(t,{style:"currency",currency:s}),i&&/* @__PURE__ */h(l,{children:[" ",r]})]}):/* @__PURE__ */d(l,{children:r})})]})}function Eu({prices:e}){const{insurances:t,required_costs:n}=e.total_costs,{not_on_site:r}=n,{currency:o}=e;/* @__PURE__ */
52
+ return d("div",{className:"costs-section",children:/* @__PURE__ */d("table",{children:/* @__PURE__ */h("tbody",{children:[t&&/* @__PURE__ */d(l,{children:Object.keys(t).map(e=>{const n=t[e];if(n>0)/* @__PURE__ */return d(Cu,{name:e,formatName:!0,amount:n,currency:o},e)})}),e.required_house_costs.map(e=>{if(!e.on_site&&"0120"!==e.gl)return"none"===e.method?/* @__PURE__ */d(Cu,{...e,currency:o},e.id):0===e.amount?null:/* @__PURE__ */d(Cu,{...e,amount:r?.find(t=>t.id==e.id)?.amount??0,currency:o},e.id)})]})})})}Cu.defaultValues={formatName:!1,forceMethod:!1};var Nu=class extends Error{constructor(e,t){super(`No prices available for ${e} - ${t}`),this.name="PriceUnavailableError"}};async function Tu(e){const t=function({apiUrl:e,portalCode:t,objectCode:n,startsAt:r,endsAt:o,persons:i,currency:s,cancelInsurance:a,discount:c,discountCode:u,costs:l,includeAccommodation:d}){const h=new URL("/portal_api/v1/accommodations/price",new URL(e).origin),p=new URLSearchParams({portal_code:t,object_code:n,starts_at:r,ends_at:o});if(void 0!==i&&p.set("persons",String(i)),s&&p.set("currency",s),void 0!==a&&p.set("cancel_insurance",String(a)),void 0!==c&&p.set("discount",String(c)),u&&p.set("discount_code",u),l)for(const[f,m]of Object.entries(l))p.set(`costs[${f}]`,String(m));return d&&p.set("include_accommodation","true"),h.search=p.toString(),h.toString()}(e);let n;try{n=await fc.get(t,{headers:{locale:e.locale}}).json()}catch(r){if(r instanceof Xs){if(422===r.response.status)throw new Nu(e.startsAt,e.endsAt);throw new Error(`Price request failed (${r.response.status})`)}throw r}if(!n.currency)throw new Nu(e.startsAt,e.endsAt);return n}function Ru({prices:e}){const{rent_price:t,discount:n,discounted_price:r,currency:o}=e;/* @__PURE__ */
53
+ return d("div",{className:"costs-section",children:/* @__PURE__ */d("table",{children:/* @__PURE__ */h("tbody",{children:[/* @__PURE__ */d(Cu,{name:"rent_price",formatName:!0,amount:t,currency:o}),n>0?/* @__PURE__ */h(l,{children:[/* @__PURE__ */d(Cu,{name:"discount",formatName:!0,amount:n,currency:o}),/* @__PURE__ */d(Cu,{name:"price_after_discount",formatName:!0,amount:r,currency:o})]}):null]})})})}function Au({prices:e}){const{optional_costs:t}=e.total_costs,{not_on_site:n}=t;/* @__PURE__ */
54
+ return d("div",{className:"costs-section",children:/* @__PURE__ */d("table",{children:/* @__PURE__ */d("tbody",{children:e.optional_house_costs.map(t=>{if(!t.on_site&&"0120"!==t.gl){if("none"===t.method)/* @__PURE__ */return d(Cu,{...t,currency:e.currency},t.id);if("on_site"===t.method){if((n.find(e=>e.id==t.id)?.nr_of_items??0)>0)/* @__PURE__ */return d(Cu,{...t,amount:t.amount,forceMethod:!0,currency:e.currency},t.id)}else{let r=n.find(e=>e.id==t.id)?.amount??0;if(r>0)/* @__PURE__ */return d(Cu,{...t,amount:r,currency:e.currency},t.id)}}})})})})}function $u({prices:e}){const{optional_costs:t}=e.total_costs,{on_site:n}=t;/* @__PURE__ */
55
+ return d(l,{children:e.optional_house_costs.map(t=>{if(t.on_site&&"0120"!==t.gl){if("none"===t.method)/* @__PURE__ */return d(Cu,{...t,currency:e.currency},t.id);if("on_site"===t.method){if((n?.find(e=>e.id==t.id)?.nr_of_items??0)>0)/* @__PURE__ */return d(Cu,{...t,amount:t.amount,forceMethod:!0,currency:e.currency},t.id)}else{let r=n?.find(e=>e.id==t.id)?.amount??0;if(r>0)/* @__PURE__ */return d(Cu,{...t,amount:r,currency:e.currency},t.id)}}})})}function Pu({prices:e}){const{required_costs:t}=e.total_costs,{on_site:n}=t;/* @__PURE__ */
56
+ return h("div",{className:"costs-section",children:[/* @__PURE__ */d("strong",{children:ne("costs_on_site")}),/* @__PURE__ */d("table",{children:/* @__PURE__ */h("tbody",{children:[e.required_house_costs.map(t=>{if(t.on_site&&"0120"!==t.gl){if("none"===t.method)/* @__PURE__ */return d(Cu,{...t,currency:e.currency},t.id);{let r=n.find(e=>e.id==t.id)?.amount??0;/* @__PURE__ */
57
+ return d(Cu,{...t,amount:r,currency:e.currency},t.id)}}}),/* @__PURE__ */d($u,{prices:e})]})})]})}function Du({children:e}){/* @__PURE__ */
58
+ return d("div",{className:"costs-section",children:/* @__PURE__ */d("table",{children:/* @__PURE__ */d("tbody",{children:e})})})}function Lu({prices:e}){const{currency:t}=e;/* @__PURE__ */
44
59
  return h(l,{children:[
45
- /* @__PURE__ */d(Ic,{children:/* @__PURE__ */h("tr",{children:[/* @__PURE__ */d("th",{style:{textAlign:"left",textTransform:"capitalize"},children:Q("total")}),/* @__PURE__ */d("th",{className:"price",style:{fontSize:18},children:Z(e.total_costs.sub_total,{style:"currency",currency:t})})]})}),
46
- /* @__PURE__ */h(Ic,{children:[
47
- /* @__PURE__ */d(qc,{cost_array:e.required_house_costs,price_array:e.total_costs.required_costs.on_site,currency:t}),
48
- /* @__PURE__ */d(qc,{cost_array:e.required_house_costs,price_array:e.total_costs.required_costs.not_on_site,currency:t}),
49
- /* @__PURE__ */d(qc,{cost_array:e.optional_house_costs,price_array:e.total_costs.optional_costs.on_site,currency:t}),
50
- /* @__PURE__ */d(qc,{cost_array:e.optional_house_costs,price_array:e.total_costs.optional_costs.not_on_site,currency:t})]}),
51
- /* @__PURE__ */d(Ic,{children:/* @__PURE__ */h("tr",{children:[/* @__PURE__ */d("th",{style:{textAlign:"left",textTransform:"capitalize"},children:Q("total")}),/* @__PURE__ */d("td",{className:"price",children:Z(e.total_costs.total_price,{style:"currency",currency:t})})]})})]})}function qc({cost_array:e,price_array:t,currency:n}){/* @__PURE__ */
52
- return d(l,{children:e.map(e=>{let r=t.find(t=>t.id==e.id);if("0120"===e.gl&&r&&r.amount>0)/* @__PURE__ */return d(Ac,{...e,amount:r.amount,currency:n},e.id)})})}function Bc({values:e,house:t}){let n=Number(e.babies)-Number(t.babies_extra);n<0&&(n=0);const r=Number(e.children)+Number(e.adults)+n,{portalCode:i,objectCode:a,locale:c,apiUrl:p}=o(ti),{currency:f}=ii(),[m,g]=u(null),[_,y]=u(!0),[v,b]=u(null);return s(()=>{let t=!1;return y(!0),b(null),$c({apiUrl:p,locale:c,portalCode:i,objectCode:a,startsAt:e.arrivalDate.date,endsAt:e.departureDate.date,persons:r,currency:f,costs:e.costs,discount:Number(e.discount),discountCode:e.discount_code,cancelInsurance:Number(e.cancel_insurance)}).then(e=>{t||(g(e),y(!1))}).catch(e=>{t||(b(e),y(!1))}),()=>{t=!0}},[p,c,i,a,e.arrivalDate.date,e.departureDate.date,r,f,e.costs,e.discount,e.discount_code,e.cancel_insurance]),_?/* @__PURE__ */d("span",{children:"Loading..."}):v||!m?/* @__PURE__ */d("div",{children:String(v)}):/* @__PURE__ */h(l,{children:[
53
- /* @__PURE__ */d(Lc,{prices:m}),
54
- /* @__PURE__ */d(Dc,{prices:m}),
55
- /* @__PURE__ */d(Uc,{prices:m}),
56
- /* @__PURE__ */d(Oc,{prices:m}),
57
- /* @__PURE__ */d(Mc,{prices:m})]})}var Fc=class{constructor(e,t){this.house=e,this.values=t,this.t={formatMessage:(e,t)=>Q(e.id,t)}}updateValues(e){this.values=e}render(){const{arrivalDate:e,departureDate:t}=this.values,n=document.createDocumentFragment(),r=document.createElement("h2");r.textContent=this.t.formatMessage({id:"booking_details"}),n.appendChild(r);const o=document.createElement("div");o.className="house-details";const s=document.createElement("div");if(s.textContent=this.house.name,o.appendChild(s),this.house.image_url){const e=document.createElement("img");e.src=this.house.image_url,e.alt="",o.appendChild(e)}const i=document.createElement("table"),a=document.createElement("tbody"),c=document.createElement("tr"),u=document.createElement("th");u.textContent=this.t.formatMessage({id:`${this.house.house_type}.arrival`});const l=document.createElement("td");l.className="price",l.textContent=Aa(Da(e.date),Ja);const d=document.createElement("td");d.textContent=`${e.arrival_time_from} - ${e.arrival_time_to}`,c.append(u,l,d);const h=document.createElement("tr"),p=document.createElement("th");p.textContent=this.t.formatMessage({id:`${this.house.house_type}.departure`});const f=document.createElement("td");f.className="price",f.textContent=Aa(Da(t.date),Ja);const m=document.createElement("td");m.textContent=t.departure_time??"",h.append(p,f,m),a.append(c,h),i.appendChild(a),o.appendChild(i),n.appendChild(o);const g=document.createElement("div");return g.appendChild(n),g}};function zc({values:e,house:t}){const n=c(null),r=c(null);return n.current||(n.current=new Fc(t,e)),s(()=>{if(n.current&&(n.current.updateValues(e),r.current)){for(;r.current.firstChild;)r.current.removeChild(r.current.firstChild);r.current.appendChild(n.current.render())}},[e,t]),/* @__PURE__ */h("div",{children:[
60
+ /* @__PURE__ */d(Du,{children:/* @__PURE__ */h("tr",{children:[/* @__PURE__ */d("th",{style:{textAlign:"left",textTransform:"capitalize"},children:ne("total")}),/* @__PURE__ */d("th",{className:"price",style:{fontSize:18},children:re(e.total_costs.sub_total,{style:"currency",currency:t})})]})}),
61
+ /* @__PURE__ */h(Du,{children:[
62
+ /* @__PURE__ */d(ju,{cost_array:e.required_house_costs,price_array:e.total_costs.required_costs.on_site,currency:t}),
63
+ /* @__PURE__ */d(ju,{cost_array:e.required_house_costs,price_array:e.total_costs.required_costs.not_on_site,currency:t}),
64
+ /* @__PURE__ */d(ju,{cost_array:e.optional_house_costs,price_array:e.total_costs.optional_costs.on_site,currency:t}),
65
+ /* @__PURE__ */d(ju,{cost_array:e.optional_house_costs,price_array:e.total_costs.optional_costs.not_on_site,currency:t})]}),
66
+ /* @__PURE__ */d(Du,{children:/* @__PURE__ */h("tr",{children:[/* @__PURE__ */d("th",{style:{textAlign:"left",textTransform:"capitalize"},children:ne("total")}),/* @__PURE__ */d("td",{className:"price",children:re(e.total_costs.total_price,{style:"currency",currency:t})})]})})]})}function ju({cost_array:e,price_array:t,currency:n}){/* @__PURE__ */
67
+ return d(l,{children:e.map(e=>{let r=t.find(t=>t.id==e.id);if("0120"===e.gl&&r&&r.amount>0)/* @__PURE__ */return d(Cu,{...e,amount:r.amount,currency:n},e.id)})})}function Uu({values:e,house:t}){let n=Number(e.babies)-Number(t.babies_extra);n<0&&(n=0);const r=Number(e.children)+Number(e.adults)+n,{portalCode:s,objectCode:a,locale:c,apiUrl:p}=o(zs),{currency:f}=Vs(),[m,g]=u(null),[_,y]=u(!0),[v,b]=u(null);return i(()=>{let t=!1;return y(!0),b(null),Tu({apiUrl:p,locale:c,portalCode:s,objectCode:a,startsAt:e.arrivalDate.date,endsAt:e.departureDate.date,persons:r,currency:f,costs:e.costs,discount:Number(e.discount),discountCode:e.discount_code,cancelInsurance:Number(e.cancel_insurance)}).then(e=>{t||(g(e),y(!1))}).catch(e=>{t||(b(e),y(!1))}),()=>{t=!0}},[p,c,s,a,e.arrivalDate.date,e.departureDate.date,r,f,e.costs,e.discount,e.discount_code,e.cancel_insurance]),_?/* @__PURE__ */d("span",{children:"Loading..."}):v||!m?/* @__PURE__ */d("div",{children:String(v)}):/* @__PURE__ */h(l,{children:[
68
+ /* @__PURE__ */d(Ru,{prices:m}),
69
+ /* @__PURE__ */d(Eu,{prices:m}),
70
+ /* @__PURE__ */d(Au,{prices:m}),
71
+ /* @__PURE__ */d(Pu,{prices:m}),
72
+ /* @__PURE__ */d(Lu,{prices:m})]})}var Mu=class{constructor(e,t){this.house=e,this.values=t,this.t={formatMessage:(e,t)=>ne(e.id,t)}}updateValues(e){this.values=e}render(){const{arrivalDate:e,departureDate:t}=this.values,n=document.createDocumentFragment(),r=document.createElement("h2");r.textContent=this.t.formatMessage({id:"booking_details"}),n.appendChild(r);const o=document.createElement("div");o.className="house-details";const i=document.createElement("div");if(i.textContent=this.house.name,o.appendChild(i),this.house.image_url){const e=document.createElement("img");e.src=this.house.image_url,e.alt="",o.appendChild(e)}const s=document.createElement("table"),a=document.createElement("tbody"),c=document.createElement("tr"),u=document.createElement("th");u.textContent=this.t.formatMessage({id:`${this.house.house_type}.arrival`});const l=document.createElement("td");l.className="price",l.textContent=ue(le(e.date),Ee);const d=document.createElement("td");d.textContent=`${e.arrival_time_from} - ${e.arrival_time_to}`,c.append(u,l,d);const h=document.createElement("tr"),p=document.createElement("th");p.textContent=this.t.formatMessage({id:`${this.house.house_type}.departure`});const f=document.createElement("td");f.className="price",f.textContent=ue(le(t.date),Ee);const m=document.createElement("td");m.textContent=t.departure_time??"",h.append(p,f,m),a.append(c,h),s.appendChild(a),o.appendChild(s),n.appendChild(o);const g=document.createElement("div");return g.appendChild(n),g}};function Ou({values:e,house:t}){const n=c(null),r=c(null);return n.current||(n.current=new Mu(t,e)),i(()=>{if(n.current&&(n.current.updateValues(e),r.current)){for(;r.current.firstChild;)r.current.removeChild(r.current.firstChild);r.current.appendChild(n.current.render())}},[e,t]),/* @__PURE__ */h("div",{children:[
58
73
  /* @__PURE__ */d("div",{ref:r}),
59
- /* @__PURE__ */d(Tc,{house:t}),
60
- /* @__PURE__ */d(Bc,{values:e,house:t})]})}function Hc({label:e,description:t,count:n=0,name:r}){const o=lc(n),s=yc(r);/* @__PURE__ */
74
+ /* @__PURE__ */d(xu,{house:t}),
75
+ /* @__PURE__ */d(Uu,{values:e,house:t})]})}function Iu({label:e,description:t,count:n=0,name:r}){const o=iu(n),i=pu(r);/* @__PURE__ */
61
76
  return h("div",{className:"form-row inline",id:`bukazu_form_${r}`,children:[
62
- /* @__PURE__ */d("label",{htmlFor:r,children:Q(e)}),
63
- /* @__PURE__ */d("select",{id:r,name:r,value:String(s.value),onChange:s.onChange,onBlur:s.onBlur,children:o.map(e=>/* @__PURE__ */d("option",{value:e,children:e},e))}),t,s.touched&&s.error&&/* @__PURE__ */d("div",{className:"error-message bu-error-message",children:s.error})]})}function Yc({label:e,description:t,name:n,inline:r,required:o=!1}){const s=yc(n),i="string"==typeof s.value&&""!==s.value?s.value:"";/* @__PURE__ */
77
+ /* @__PURE__ */d("label",{htmlFor:r,children:ne(e)}),
78
+ /* @__PURE__ */d("select",{id:r,name:r,value:String(i.value),onChange:i.onChange,onBlur:i.onBlur,children:o.map(e=>/* @__PURE__ */d("option",{value:e,children:e},e))}),t,i.touched&&i.error&&/* @__PURE__ */d("div",{className:"error-message bu-error-message",children:i.error})]})}function qu({label:e,description:t,name:n,inline:r,required:o=!1}){const i=pu(n),s="string"==typeof i.value&&""!==i.value?i.value:"";/* @__PURE__ */
64
79
  return h("div",{className:`form-row ${r&&"inline"}`,id:`bukazu_form_${n}`,children:[
65
- /* @__PURE__ */d("label",{htmlFor:n,children:Q(e)}),
66
- /* @__PURE__ */d("input",{type:"date",className:"bukazu-date-picker",id:n,name:n,required:o,value:i,onChange:s.onChange,onBlur:s.onBlur}),
67
- /* @__PURE__ */d("span",{className:"bu-input-description",children:t}),s.touched&&s.error&&/* @__PURE__ */d("div",{className:"error-message bu-error-message",children:s.error})]})}Yc.defaultValues={inline:!0};var Wc=()=>{const{locale:e}=o(ti);/* @__PURE__ */
80
+ /* @__PURE__ */d("label",{htmlFor:n,children:ne(e)}),
81
+ /* @__PURE__ */d("input",{type:"date",className:"bukazu-date-picker",id:n,name:n,required:o,value:s,onChange:i.onChange,onBlur:i.onBlur}),
82
+ /* @__PURE__ */d("span",{className:"bu-input-description",children:t}),i.touched&&i.error&&/* @__PURE__ */d("div",{className:"error-message bu-error-message",children:i.error})]})}qu.defaultValues={inline:!0};var Bu=()=>{const{locale:e}=o(zs);/* @__PURE__ */
68
83
  return h(l,{children:[
69
- /* @__PURE__ */d("h2",{children:Q("cancel_insurance_normal_long")}),
70
- /* @__PURE__ */d("p",{children:Q("cancel_insurance_normal_desc")}),
71
- /* @__PURE__ */d("h3",{children:Q("cancel_insurance_more_insured")}),
72
- /* @__PURE__ */d("p",{children:Q("cancel_insurance_more_insured_desc")}),
73
- /* @__PURE__ */d("h3",{children:Q("cancel_insurance_important")}),
74
- /* @__PURE__ */d("p",{children:Q("cancel_insurance_important_message")}),
75
- /* @__PURE__ */d("h3",{children:Q("cancel_insurance_for_whom")}),
76
- /* @__PURE__ */d("p",{children:Q("cancel_insurance_for_whom_explain")}),
77
- /* @__PURE__ */d("h3",{children:Q("cancel_insurance_questions")}),
78
- /* @__PURE__ */h("p",{children:[Q("cancel_insurance_questions_explain_1"),
79
- /* @__PURE__ */d("a",{href:{nl:"https://recreatieverzekeringen.nl/veelgestelde-vragen",de:"https://recreatieverzekeringen.nl/de/haufig-gestellte-fragen",en:"https://recreatieverzekeringen.nl/en/frequently-asked-questions",fr:"https://recreatieverzekeringen.nl/en/frequently-asked-questions",es:"https://recreatieverzekeringen.nl/en/frequently-asked-questions",it:"https://recreatieverzekeringen.nl/en/frequently-asked-questions"}[e],target:"_blank",children:Q("cancel_insurance_questions_explain_link")}),Q("cancel_insurance_questions_explain_2")]}),
80
- /* @__PURE__ */d("h3",{children:Q("terms")}),
81
- /* @__PURE__ */d("a",{href:`https://api.bukazu.com/files/${e}/insurance.pdf`,target:"_blank",rel:"noopener noreferrer",children:Q("show_terms")})]})};function Jc({house:e}){const t=yc("cancel_insurance");return e.cancel_insurance?/* @__PURE__ */h("div",{className:"form-row inline",children:[
82
- /* @__PURE__ */d("label",{htmlFor:"cancel_insurance",children:Q("cancel_insurance")}),
83
- /* @__PURE__ */h("select",{id:"cancel_insurance",name:"cancel_insurance",value:String(t.value),onChange:t.onChange,onBlur:t.onBlur,required:!0,children:[gc("choose",""),gc("cancel_insurance_normal","1"),gc("none","0")]}),
84
- /* @__PURE__ */d(uc,{buttonText:/* @__PURE__ */d(Nc,{}),children:/* @__PURE__ */d(Wc,{})})]}):null}var Kc=({house:e,values:t})=>e.cancel_insurance?/* @__PURE__ */h("div",{className:"form-section bup-16",id:"insurances",children:[
85
- /* @__PURE__ */d("h2",{children:Q("insurances")}),
86
- /* @__PURE__ */d(Jc,{house:e}),t.cancel_insurance&&"0"!==t.cancel_insurance&&/* @__PURE__ */d(Yc,{label:"extra_fields.date_of_birth",name:"extra_fields.date_of_birth",required:!0,inline:!1,description:Q("insurance_company_needs_date_of_birth")})]}):/* @__PURE__ */d("div",{}),Vc=class extends Error{constructor(e){super(`Discount code request failed (${e})`),this.name="DiscountCodeError",this.status=e,this.notFound=404===e}};async function Xc(e){const t=function({apiUrl:e,portalCode:t,objectCode:n,code:r,currency:o}){const s=new URL("/portal_api/v1/accommodations/discount-code",new URL(e).origin),i=new URLSearchParams({portal_code:t,object_code:n,code:r});return o&&i.set("currency",o),s.search=i.toString(),s.toString()}(e);try{return await Ea.get(t,{headers:{locale:e.locale}}).json()}catch(n){if(n instanceof ui)throw new Vc(n.response.status);throw n}}function Gc({house:e}){const{apiUrl:t,locale:n,portalCode:r}=o(ti),{currency:s}=ii(),i=yc("discount_code"),[a,l]=u(null),[p,f]=u(!1),[m,g]=u(!1),[_,y]=u(!1),v=c(0);/* @__PURE__ */
84
+ /* @__PURE__ */d("h2",{children:ne("cancel_insurance_normal_long")}),
85
+ /* @__PURE__ */d("p",{children:ne("cancel_insurance_normal_desc")}),
86
+ /* @__PURE__ */d("h3",{children:ne("cancel_insurance_more_insured")}),
87
+ /* @__PURE__ */d("p",{children:ne("cancel_insurance_more_insured_desc")}),
88
+ /* @__PURE__ */d("h3",{children:ne("cancel_insurance_important")}),
89
+ /* @__PURE__ */d("p",{children:ne("cancel_insurance_important_message")}),
90
+ /* @__PURE__ */d("h3",{children:ne("cancel_insurance_for_whom")}),
91
+ /* @__PURE__ */d("p",{children:ne("cancel_insurance_for_whom_explain")}),
92
+ /* @__PURE__ */d("h3",{children:ne("cancel_insurance_questions")}),
93
+ /* @__PURE__ */h("p",{children:[ne("cancel_insurance_questions_explain_1"),
94
+ /* @__PURE__ */d("a",{href:{nl:"https://recreatieverzekeringen.nl/veelgestelde-vragen",de:"https://recreatieverzekeringen.nl/de/haufig-gestellte-fragen",en:"https://recreatieverzekeringen.nl/en/frequently-asked-questions",fr:"https://recreatieverzekeringen.nl/en/frequently-asked-questions",es:"https://recreatieverzekeringen.nl/en/frequently-asked-questions",it:"https://recreatieverzekeringen.nl/en/frequently-asked-questions"}[e],target:"_blank",children:ne("cancel_insurance_questions_explain_link")}),ne("cancel_insurance_questions_explain_2")]}),
95
+ /* @__PURE__ */d("h3",{children:ne("terms")}),
96
+ /* @__PURE__ */d("a",{href:`https://api.bukazu.com/files/${e}/insurance.pdf`,target:"_blank",rel:"noopener noreferrer",children:ne("show_terms")})]})};function Fu({house:e}){const t=pu("cancel_insurance");return e.cancel_insurance?/* @__PURE__ */h("div",{className:"form-row inline",children:[
97
+ /* @__PURE__ */d("label",{htmlFor:"cancel_insurance",children:ne("cancel_insurance")}),
98
+ /* @__PURE__ */h("select",{id:"cancel_insurance",name:"cancel_insurance",value:String(t.value),onChange:t.onChange,onBlur:t.onBlur,required:!0,children:[du("choose",""),du("cancel_insurance_normal","1"),du("none","0")]}),
99
+ /* @__PURE__ */d(ou,{buttonText:/* @__PURE__ */d(ku,{}),children:/* @__PURE__ */d(Bu,{})})]}):null}var zu=({house:e,values:t})=>e.cancel_insurance?/* @__PURE__ */h("div",{className:"form-section bup-16",id:"insurances",children:[
100
+ /* @__PURE__ */d("h2",{children:ne("insurances")}),
101
+ /* @__PURE__ */d(Fu,{house:e}),t.cancel_insurance&&"0"!==t.cancel_insurance&&/* @__PURE__ */d(qu,{label:"extra_fields.date_of_birth",name:"extra_fields.date_of_birth",required:!0,inline:!1,description:ne("insurance_company_needs_date_of_birth")})]}):/* @__PURE__ */d("div",{}),Hu=class extends Error{constructor(e){super(`Discount code request failed (${e})`),this.name="DiscountCodeError",this.status=e,this.notFound=404===e}};async function Yu(e){const t=function({apiUrl:e,portalCode:t,objectCode:n,code:r,currency:o}){const i=new URL("/portal_api/v1/accommodations/discount-code",new URL(e).origin),s=new URLSearchParams({portal_code:t,object_code:n,code:r});return o&&s.set("currency",o),i.search=s.toString(),i.toString()}(e);try{return await fc.get(t,{headers:{locale:e.locale}}).json()}catch(n){if(n instanceof Xs)throw new Hu(n.response.status);throw n}}function Wu({house:e}){const{apiUrl:t,locale:n,portalCode:r}=o(zs),{currency:i}=Vs(),s=pu("discount_code"),[a,l]=u(null),[p,f]=u(!1),[m,g]=u(!1),[_,y]=u(!1),v=c(0);/* @__PURE__ */
87
102
  return h("div",{className:"form-row inline",children:[
88
- /* @__PURE__ */d("label",{htmlFor:"discount_code",children:Q("discount_code")}),
89
- /* @__PURE__ */d("input",{id:"discount_code",name:"discount_code",value:String(i.value),onBlur:o=>{i.onBlur(),(o=>{const i=++v.current;if(""===o)return l(null),g(!1),y(!1),void f(!1);f(!0),Xc({apiUrl:t,locale:n,portalCode:r,objectCode:e.code,code:o,currency:s}).then(e=>{i===v.current&&(l(e),g(!1),y(!1),f(!1))}).catch(e=>{if(i!==v.current)return;const t=e instanceof Vc&&e.notFound;l(null),g(t),y(!t),f(!1)})})(o.target.value.trim())},onChange:i.onChange}),p&&/* @__PURE__ */d("div",{className:"bu_discount_code",children:"Loading..."}),!p&&m&&/* @__PURE__ */d("div",{className:"bu_discount_code",children:Q("no_discount_code_found")}),!p&&_&&/* @__PURE__ */d("div",{className:"bu_discount_code",children:Q("something_went_wrong_please_try_again")}),!p&&a&&/* @__PURE__ */h("div",{className:"bu_discount_code",children:[/* @__PURE__ */d("div",{children:a.name}),a.use_price?null!=a.price&&/* @__PURE__ */d("div",{children:Z(a.price,{style:"currency",currency:a.currency})}):null!=a.percentage&&/* @__PURE__ */h("div",{children:[a.percentage,"%"]})]})]})}var Qc=({errors:e,house:t,bookingFormConfiguration:n,values:r})=>{const o=yc("discount"),s=yc("discount_reason");if(t.discounts&&"0"!==t.discounts||n.show_discount_code){const r=t.discounts?t.discounts.split(","):[];/* @__PURE__ */
103
+ /* @__PURE__ */d("label",{htmlFor:"discount_code",children:ne("discount_code")}),
104
+ /* @__PURE__ */d("input",{id:"discount_code",name:"discount_code",value:String(s.value),onBlur:o=>{s.onBlur(),(o=>{const s=++v.current;if(""===o)return l(null),g(!1),y(!1),void f(!1);f(!0),Yu({apiUrl:t,locale:n,portalCode:r,objectCode:e.code,code:o,currency:i}).then(e=>{s===v.current&&(l(e),g(!1),y(!1),f(!1))}).catch(e=>{if(s!==v.current)return;const t=e instanceof Hu&&e.notFound;l(null),g(t),y(!t),f(!1)})})(o.target.value.trim())},onChange:s.onChange}),p&&/* @__PURE__ */d("div",{className:"bu_discount_code",children:"Loading..."}),!p&&m&&/* @__PURE__ */d("div",{className:"bu_discount_code",children:ne("no_discount_code_found")}),!p&&_&&/* @__PURE__ */d("div",{className:"bu_discount_code",children:ne("something_went_wrong_please_try_again")}),!p&&a&&/* @__PURE__ */h("div",{className:"bu_discount_code",children:[/* @__PURE__ */d("div",{children:a.name}),a.use_price?null!=a.price&&/* @__PURE__ */d("div",{children:re(a.price,{style:"currency",currency:a.currency})}):null!=a.percentage&&/* @__PURE__ */h("div",{children:[a.percentage,"%"]})]})]})}var Ju=({errors:e,house:t,bookingFormConfiguration:n,values:r})=>{const o=pu("discount"),i=pu("discount_reason");if(t.discounts&&"0"!==t.discounts||n.show_discount_code){const r=t.discounts?t.discounts.split(","):[];/* @__PURE__ */
90
105
  return h("div",{className:"form-section bup-16",children:[t.discounts&&"0"!==t.discounts&&/* @__PURE__ */h(l,{children:[
91
- /* @__PURE__ */h("div",{className:"form-row inline",children:[/* @__PURE__ */d("label",{htmlFor:"discount",children:Q("discount")}),/* @__PURE__ */d("select",{id:"discount",name:"discount",value:String(o.value),onChange:o.onChange,onBlur:o.onBlur,children:r.map(e=>/* @__PURE__ */h("option",{value:e,children:[e,"%"]},e))})]}),
106
+ /* @__PURE__ */h("div",{className:"form-row inline",children:[/* @__PURE__ */d("label",{htmlFor:"discount",children:ne("discount")}),/* @__PURE__ */d("select",{id:"discount",name:"discount",value:String(o.value),onChange:o.onChange,onBlur:o.onBlur,children:r.map(e=>/* @__PURE__ */h("option",{value:e,children:[e,"%"]},e))})]}),
92
107
  /* @__PURE__ */h("div",{className:"form-row inline",children:[
93
- /* @__PURE__ */d("label",{htmlFor:"discount_reason",children:Q("discount_reason")}),
94
- /* @__PURE__ */d("input",{id:"discount_reason",name:"discount_reason",value:String(s.value),onChange:s.onChange,onBlur:s.onBlur}),e.discount_reason&&/* @__PURE__ */d("div",{className:"error-message bu-error-message",children:e.discount_reason})]}),
95
- /* @__PURE__ */d("div",{children:/* @__PURE__ */d("i",{style:{fontSize:14},children:t.discounts_info})})]}),n.show_discount_code&&/* @__PURE__ */d(Gc,{house:t})]})}return null},Zc=()=>/* @__PURE__ */h("div",{className:"success-message",children:[
108
+ /* @__PURE__ */d("label",{htmlFor:"discount_reason",children:ne("discount_reason")}),
109
+ /* @__PURE__ */d("input",{id:"discount_reason",name:"discount_reason",value:String(i.value),onChange:i.onChange,onBlur:i.onBlur}),e.discount_reason&&/* @__PURE__ */d("div",{className:"error-message bu-error-message",children:e.discount_reason})]}),
110
+ /* @__PURE__ */d("div",{children:/* @__PURE__ */d("i",{style:{fontSize:14},children:t.discounts_info})})]}),n.show_discount_code&&/* @__PURE__ */d(Wu,{house:t})]})}return null},Vu=()=>/* @__PURE__ */h("div",{className:"success-message",children:[
96
111
  /* @__PURE__ */d("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",version:"1.1",x:"0px",y:"0px",viewBox:"0 0 100 125",style:{fill:"green",height:"150px"},xmlSpace:"preserve",children:/* @__PURE__ */d("path",{d:"M50,5C25.2,5,5,25.1,5,50c0,24.8,20.2,45,45,45s45-20.2,45-45C95,25.1,74.8,5,50,5z M72.7,38.2L44.2,66.7 c-0.4,0.4-0.9,0.6-1.4,0.6s-1-0.2-1.4-0.6l-14-14c-0.8-0.8-0.8-2,0-2.8c0.8-0.8,2-0.8,2.8,0l12.6,12.6l27.1-27.1 c0.8-0.8,2-0.8,2.8,0C73.5,36.1,73.5,37.4,72.7,38.2z"})}),
97
- /* @__PURE__ */d("h3",{children:Q("thank_you_for_your_request")}),
98
- /* @__PURE__ */d("p",{children:Q("we_sent_confirmation_check_email")})]}),eu=/* @__PURE__ */new Map,tu={en:async()=>(await(import("./en-Bv1I_37O.js"))).default,nl:async()=>(await(import("./nl-B6ga4Zc8.js"))).default,de:async()=>(await(import("./de-AbyP7SiX.js"))).default,fr:async()=>(await(import("./fr-DQXnO3jP.js"))).default,es:async()=>(await(import("./es-EcksbtWo.js"))).default,it:async()=>(await(import("./it-z_lt2h0g.js"))).default};async function nu(e){const t=C(e);if(eu.has(t))return eu.get(t);const n=await async function(e){return J(await tu[e](),`Failed to load country data for locale "${e}"`)}(t);return eu.set(t,n),n}var ru=[{id:"first_name",label:"Voornaam",type:"text",options:["text"],required:!0,placeholder:""},{id:"last_name",label:"Achternaam",type:"text",options:["text"],required:!0,mandatory:!0,placeholder:""},{id:"address",label:"Adres",type:"text",options:["text"],required:!0,placeholder:""},{id:"house_number",label:"Huisnummer",type:"text",options:["text"],required:!0,placeholder:""},{id:"zipcode",label:"Postcode",type:"text",options:["text"],required:!0,placeholder:""},{id:"city",label:"Plaats",type:"text",options:["text"],required:!0,placeholder:""},{id:"country",label:"Land",type:"select",options:["select"],required:!0,mandatory:!0,placeholder:""},{id:"email",label:"E-mail",type:"email",options:["email"],required:!0,mandatory:!0,placeholder:""},{id:"phone",label:"Telefoonnummer",type:"text",options:["text"],required:!0,placeholder:""}];function ou({name:e,type:t="text",required:n=!1,onKeyPress:r}){const o=yc(e);return"textarea"===t?/* @__PURE__ */d("textarea",{id:e,name:e,value:String(o.value),required:n,onChange:o.onChange,onBlur:o.onBlur,onKeyPress:r}):/* @__PURE__ */d("input",{id:e,type:t,name:e,value:String(o.value),required:n,onChange:o.onChange,onBlur:o.onBlur,onKeyPress:r})}function su({bookingField:e,required:t=!1}){const n=yc(`extra_fields.booking_field_${e.id}`);return"textarea"===e.field_type?/* @__PURE__ */d("textarea",{id:`extra_fields.booking_field_${e.id}`,name:`extra_fields.booking_field_${e.id}`,value:String(n.value),required:t,onChange:n.onChange,onBlur:n.onBlur,onKeyPress:e=>{13===e.which&&e.preventDefault()}}):/* @__PURE__ */d("input",{id:`extra_fields.booking_field_${e.id}`,type:"text"===e.field_type?"text":e.field_type,name:`extra_fields.booking_field_${e.id}`,value:String(n.value),required:t,onChange:n.onChange,onBlur:n.onBlur,onKeyPress:e=>{13===e.which&&e.preventDefault()}})}function iu({countries:e,disabled:t,required:n=!1}){const r=yc("country");/* @__PURE__ */
99
- return h("select",{name:"country",id:"country",disabled:t,required:n,value:String(r.value),onChange:r.onChange,onBlur:r.onBlur,children:[/* @__PURE__ */d("option",{value:"",children:"—"}),e.map(e=>/* @__PURE__ */d("option",{value:e.alpha2,children:e.name},e.alpha2))]})}function au({bookingFields:e,errors:t,touched:n,PortalSite:r,values:o}){const[a,c]=u([]),[l,p]=u(!0);s(()=>{let e=!0;const t="undefined"!=typeof window&&window.__localeId__||"en";return(async()=>{try{const n=await nu(t);e&&c(n)}catch{}finally{e&&p(!1)}})(),()=>{e=!1}},[]);const f=i(()=>{const t=[...e];return"1"!==o.cancel_insurance&&"2"!==o.cancel_insurance||["address","house_number","zipcode","city"].forEach(n=>{const r=ru.find(e=>e.id===n);if(!r)return;const o=e.findIndex(e=>e.id===n);-1!==o?t[o]=r:t.push(r)}),t},[e,o.cancel_insurance]);/* @__PURE__ */
100
- return h("div",{className:"form-section bup-16",children:[/* @__PURE__ */d("h2",{children:Q("personal_details")}),f.map(e=>function({input:e,PortalSite:t,countries:n,countriesLoading:r,errors:o,touched:s}){const i="telephone"===e.id?"phonenumber":e.id;if("booking_field"===e.type||ne(i)){const n=t.booking_fields?.find(e=>e.id===i);return n?/* @__PURE__ */h("div",{className:"form-row",children:[
112
+ /* @__PURE__ */d("h3",{children:ne("thank_you_for_your_request")}),
113
+ /* @__PURE__ */d("p",{children:ne("we_sent_confirmation_check_email")})]}),Ku=/* @__PURE__ */new Map,Gu={en:async()=>(await(import("./en-Bv1I_37O.js"))).default,nl:async()=>(await(import("./nl-B6ga4Zc8.js"))).default,de:async()=>(await(import("./de-AbyP7SiX.js"))).default,fr:async()=>(await(import("./fr-DQXnO3jP.js"))).default,es:async()=>(await(import("./es-EcksbtWo.js"))).default,it:async()=>(await(import("./it-z_lt2h0g.js"))).default};async function Xu(e){const t=R(e);if(Ku.has(t))return Ku.get(t);const n=await async function(e){return X(await Gu[e](),`Failed to load country data for locale "${e}"`)}(t);return Ku.set(t,n),n}var Qu=[{id:"first_name",label:"Voornaam",type:"text",options:["text"],required:!0,placeholder:""},{id:"last_name",label:"Achternaam",type:"text",options:["text"],required:!0,mandatory:!0,placeholder:""},{id:"address",label:"Adres",type:"text",options:["text"],required:!0,placeholder:""},{id:"house_number",label:"Huisnummer",type:"text",options:["text"],required:!0,placeholder:""},{id:"zipcode",label:"Postcode",type:"text",options:["text"],required:!0,placeholder:""},{id:"city",label:"Plaats",type:"text",options:["text"],required:!0,placeholder:""},{id:"country",label:"Land",type:"select",options:["select"],required:!0,mandatory:!0,placeholder:""},{id:"email",label:"E-mail",type:"email",options:["email"],required:!0,mandatory:!0,placeholder:""},{id:"phone",label:"Telefoonnummer",type:"text",options:["text"],required:!0,placeholder:""}];function Zu({name:e,type:t="text",required:n=!1,onKeyPress:r}){const o=pu(e);return"textarea"===t?/* @__PURE__ */d("textarea",{id:e,name:e,value:String(o.value),required:n,onChange:o.onChange,onBlur:o.onBlur,onKeyPress:r}):/* @__PURE__ */d("input",{id:e,type:t,name:e,value:String(o.value),required:n,onChange:o.onChange,onBlur:o.onBlur,onKeyPress:r})}function el({bookingField:e,required:t=!1}){const n=pu(`extra_fields.booking_field_${e.id}`);return"textarea"===e.field_type?/* @__PURE__ */d("textarea",{id:`extra_fields.booking_field_${e.id}`,name:`extra_fields.booking_field_${e.id}`,value:String(n.value),required:t,onChange:n.onChange,onBlur:n.onBlur,onKeyPress:e=>{13===e.which&&e.preventDefault()}}):/* @__PURE__ */d("input",{id:`extra_fields.booking_field_${e.id}`,type:"text"===e.field_type?"text":e.field_type,name:`extra_fields.booking_field_${e.id}`,value:String(n.value),required:t,onChange:n.onChange,onBlur:n.onBlur,onKeyPress:e=>{13===e.which&&e.preventDefault()}})}function tl({countries:e,disabled:t,required:n=!1}){const r=pu("country");/* @__PURE__ */
114
+ return h("select",{name:"country",id:"country",disabled:t,required:n,value:String(r.value),onChange:r.onChange,onBlur:r.onBlur,children:[/* @__PURE__ */d("option",{value:"",children:"—"}),e.map(e=>/* @__PURE__ */d("option",{value:e.alpha2,children:e.name},e.alpha2))]})}function nl({bookingFields:e,errors:t,touched:n,PortalSite:r,values:o}){const[a,c]=u([]),[l,p]=u(!0);i(()=>{let e=!0;const t="undefined"!=typeof window&&window.__localeId__||"en";return(async()=>{try{const n=await Xu(t);e&&c(n)}catch{}finally{e&&p(!1)}})(),()=>{e=!1}},[]);const f=s(()=>{const t=[...e];return"1"!==o.cancel_insurance&&"2"!==o.cancel_insurance||["address","house_number","zipcode","city"].forEach(n=>{const r=Qu.find(e=>e.id===n);if(!r)return;const o=e.findIndex(e=>e.id===n);-1!==o?t[o]=r:t.push(r)}),t},[e,o.cancel_insurance]);/* @__PURE__ */
115
+ return h("div",{className:"form-section bup-16",children:[/* @__PURE__ */d("h2",{children:ne("personal_details")}),f.map(e=>function({input:e,PortalSite:t,countries:n,countriesLoading:r,errors:o,touched:i}){const s="telephone"===e.id?"phonenumber":e.id;if("booking_field"===e.type||Be(s)){const n=t.booking_fields?.find(e=>e.id===s);return n?/* @__PURE__ */h("div",{className:"form-row",children:[
101
116
  /* @__PURE__ */h("label",{htmlFor:`extra_fields.booking_field_${n.id}`,children:[n.label," ",e.required&&/* @__PURE__ */d("span",{children:"*"})]}),
102
- /* @__PURE__ */d(su,{bookingField:n,required:e.required}),o[e.id]&&(s.extra_fields&&s.extra_fields[`booking_field_${n.id}`]||s[e.id])&&/* @__PURE__ */d("div",{className:"error-message bu-error-message",children:o[e.id]})]},n.id):null}return"country"===i?/* @__PURE__ */h("div",{className:"form-row",children:[
103
- /* @__PURE__ */h("label",{htmlFor:i,children:[t[`${i}_label`]," ",e.required&&/* @__PURE__ */d("span",{children:"*"})]}),
104
- /* @__PURE__ */d(iu,{countries:n,disabled:r,required:e.required}),o[i]&&/* @__PURE__ */d("div",{className:"error-message bu-error-message",children:o[i]})]},i):"date"===e.type?/* @__PURE__ */d("div",{className:"form-row",children:/* @__PURE__ */d(Yc,{name:i,label:i,inline:!1,required:e.required})},i):/* @__PURE__ */h("div",{className:"form-row",children:[
105
- /* @__PURE__ */h("label",{htmlFor:i,children:[t[`${i.replace(/\./g,"_")}_label`]," ",e.required&&/* @__PURE__ */d("span",{children:"*"})]}),
106
- /* @__PURE__ */d(ou,{type:e.type,name:i,required:e.required,onKeyPress:e=>{13===e.which&&e.preventDefault()}}),o[i]&&s[i]&&/* @__PURE__ */d("div",{className:"error-message bu-error-message",children:o[i]})]},i)}({input:e,PortalSite:r,countries:a,countriesLoading:l,errors:t,touched:n}))]})}function cu({cost:e}){const t=yc(`costs[${e.id}]`);return 1===e.max_available?/* @__PURE__ */h("select",{id:e.id,name:`costs[${e.id}]`,value:String(t.value),onChange:t.onChange,onBlur:t.onBlur,children:[/* @__PURE__ */d("option",{value:0,children:Q("no")}),/* @__PURE__ */d("option",{value:1,children:Q("yes")})]}):/* @__PURE__ */d("select",{id:e.id,name:`costs[${e.id}]`,value:String(t.value),onChange:t.onChange,onBlur:t.onBlur,children:lc(e.max_available).map(e=>/* @__PURE__ */d("option",{value:e,children:e},e))})}function uu({costs:e,currency:t}){return 0===e.length?null:/* @__PURE__ */h("div",{className:"form-section bup-16 optional_house_costs",children:[/* @__PURE__ */d("h2",{children:Q("extra_costs_bookable")}),/* @__PURE__ */d("div",{children:e.map(e=>!["none","total"].includes(e.method)&&e.max_available>0?/* @__PURE__ */h("div",{className:"form-row inline",children:[
117
+ /* @__PURE__ */d(el,{bookingField:n,required:e.required}),o[e.id]&&(i.extra_fields&&i.extra_fields[`booking_field_${n.id}`]||i[e.id])&&/* @__PURE__ */d("div",{className:"error-message bu-error-message",children:o[e.id]})]},n.id):null}return"country"===s?/* @__PURE__ */h("div",{className:"form-row",children:[
118
+ /* @__PURE__ */h("label",{htmlFor:s,children:[t[`${s}_label`]," ",e.required&&/* @__PURE__ */d("span",{children:"*"})]}),
119
+ /* @__PURE__ */d(tl,{countries:n,disabled:r,required:e.required}),o[s]&&/* @__PURE__ */d("div",{className:"error-message bu-error-message",children:o[s]})]},s):"date"===e.type?/* @__PURE__ */d("div",{className:"form-row",children:/* @__PURE__ */d(qu,{name:s,label:s,inline:!1,required:e.required})},s):/* @__PURE__ */h("div",{className:"form-row",children:[
120
+ /* @__PURE__ */h("label",{htmlFor:s,children:[t[`${s.replace(/\./g,"_")}_label`]," ",e.required&&/* @__PURE__ */d("span",{children:"*"})]}),
121
+ /* @__PURE__ */d(Zu,{type:e.type,name:s,required:e.required,onKeyPress:e=>{13===e.which&&e.preventDefault()}}),o[s]&&i[s]&&/* @__PURE__ */d("div",{className:"error-message bu-error-message",children:o[s]})]},s)}({input:e,PortalSite:r,countries:a,countriesLoading:l,errors:t,touched:n}))]})}function rl({cost:e}){const t=pu(`costs[${e.id}]`);return 1===e.max_available?/* @__PURE__ */h("select",{id:e.id,name:`costs[${e.id}]`,value:String(t.value),onChange:t.onChange,onBlur:t.onBlur,children:[/* @__PURE__ */d("option",{value:0,children:ne("no")}),/* @__PURE__ */d("option",{value:1,children:ne("yes")})]}):/* @__PURE__ */d("select",{id:e.id,name:`costs[${e.id}]`,value:String(t.value),onChange:t.onChange,onBlur:t.onBlur,children:iu(e.max_available).map(e=>/* @__PURE__ */d("option",{value:e,children:e},e))})}function ol({costs:e,currency:t}){return 0===e.length?null:/* @__PURE__ */h("div",{className:"form-section bup-16 optional_house_costs",children:[/* @__PURE__ */d("h2",{children:ne("extra_costs_bookable")}),/* @__PURE__ */d("div",{children:e.map(e=>!["none","total"].includes(e.method)&&e.max_available>0?/* @__PURE__ */h("div",{className:"form-row inline",children:[
107
122
  /* @__PURE__ */d("label",{htmlFor:e.id,children:e.name}),
108
- /* @__PURE__ */d(cu,{cost:e}),
109
- /* @__PURE__ */h("div",{className:"price_per",children:[Z(e.amount,{style:"currency",currency:t??"EUR"})," ",e.method_name]}),
110
- /* @__PURE__ */d("div",{children:e.description?/* @__PURE__ */d("div",{children:/* @__PURE__ */d(uc,{buttonText:/* @__PURE__ */d(Nc,{}),children:/* @__PURE__ */d("p",{children:e.description})})}):null})]},e.id):"")})]})}function lu({bookingFormConfiguration:e,house:t}){/* @__PURE__ */
123
+ /* @__PURE__ */d(rl,{cost:e}),
124
+ /* @__PURE__ */h("div",{className:"price_per",children:[re(e.amount,{style:"currency",currency:t??"EUR"})," ",e.method_name]}),
125
+ /* @__PURE__ */d("div",{children:e.description?/* @__PURE__ */d("div",{children:/* @__PURE__ */d(ou,{buttonText:/* @__PURE__ */d(ku,{}),children:/* @__PURE__ */d("p",{children:e.description})})}):null})]},e.id):"")})]})}function il({bookingFormConfiguration:e,house:t}){/* @__PURE__ */
111
126
  return h(l,{children:[
112
- /* @__PURE__ */d(Hc,{name:"adults",label:"adults",count:t.persons,description:/* @__PURE__ */d("div",{className:"age-description",children:Q("adults_from",{age:e.adults_from_age})})}),e.children_allowed?/* @__PURE__ */d(Hc,{name:"children",label:"children",count:t.persons-1,description:/* @__PURE__ */d("div",{className:"age-description",children:Q("children_from",{from:e.children_from_age,til:e.children_till_age})})}):null,e.babies_allowed?/* @__PURE__ */d(Hc,{name:"babies",label:"babies",count:t.persons-1,description:/* @__PURE__ */d("div",{className:"age-description",children:Q("babies_from",{babies:e.babies_till_age})})}):null]})}function du(e,t,n){const{persons:r}=t,o={},s=mc(t,e);for(const a of n){if(!a.required)continue;if(ne(a.id)){const t=pc(e,`extra_fields.booking_field_${a.id}`);t&&""!==t||(o[a.id]=Q("required"));continue}const t=pc(e,a.id);t&&""!==t||(o[a.id]=Q("required"))}e.adults<1&&r>0&&(o.adults=Q("at_least_1_adult")),Number(e.discount)>0&&!e.discount_reason&&(o.discount_reason=Q("you_need_to_give_reason")),s>r&&(o.max_persons=Q("max_persons_reached"));const i=e.extra_fields?.date_of_birth;return"0"!==e.cancel_insurance&&i&&za(new Date(i),ja(/* @__PURE__ */new Date,18))&&(o["extra_fields.date_of_birth"]=Q("at_least_18y_old"),o.insurances=Q("at_least_18y_old")),o}function hu({house:e,PortalSite:t}){const{persons:n,arrivalDate:s,departureDate:a}=o(bc),{locale:c,portalCode:l,objectCode:p,apiUrl:f}=o(ti),{currency:m}=ii(),g=o(wc),{options:_,bookingFormConfiguration:y}=t,v=_.bookingFields.map(e=>"telephone"===e.id?{...e,id:"phonenumber"}:e),b=e.booking_price,w=r(()=>{const t={};for(const e of b.optional_house_costs)t[e.id]="0";const r={...dc(v),arrivalDate:s,departureDate:a,is_option:"false",costs:t,adults:n,children:0,babies:0,persons:n,discount:0,country:"nl",cancel_insurance:"0",discount_code:"",currency:m??"",extra_fields:{}};return{...r,persons:mc(e,r)}},[s,v,b.optional_house_costs,a,e,n,m]),[x,k]=u(()=>w()),[S,C]=u({}),[E,T]=u(!1),[N,R]=u(null),[A,D]=u(null),[P,$]=u({}),L=r(()=>{R(null),$({})},[]),U=r((t,n)=>{$(e=>void 0===e[t]?e:{...e,[t]:void 0}),k(r=>{let o=fc(r,t,n);return["adults","children","babies"].includes(t)&&(o={...o,persons:mc(e,o)}),o})},[e]),j=r((e,t=!0)=>{C(n=>fc(n,e,t))},[]),O=function(){const e=tc("bu_portal_session");return""===e?null:e}(),I=i(()=>({...P,...du(x,e,v)}),[v,e,P,x]),M=r(async t=>{t.preventDefault();const n=du(x,e,v);if(C(function(e,t){let n={adults:!0,children:!0,babies:!0,cancel_insurance:!0};return e.forEach(e=>{n=fc(n,ne(e.id)?`extra_fields.booking_field_${e.id}`:e.id,!0)}),Number(t.discount)>0&&(n.discount_reason=!0),"1"!==t.cancel_insurance&&"2"!==t.cancel_insurance||(["address","house_number","zipcode","city"].forEach(e=>{n=fc(n,e,!0)}),n=fc(n,"extra_fields.date_of_birth",!0)),n}(v,x)),!(Object.keys(n).length>0)){T(!0),R(null),$({});try{const e=await oc({apiUrl:f,locale:c,payload:cc({values:x,objectCode:p,portalCode:l,locale:c,sessionIdentifier:O})});D(e);const t=y.redirect_urls??{},n=e.redirect_to_payment&&e.payment_url||e.redirect_url||t[c];n&&""!==n?(r=n,window.location.href=r):setTimeout(()=>{g({type:"return"})},15e3)}catch(o){if(R(o instanceof Error?o:/* @__PURE__ */new Error("The booking could not be created")),o instanceof rc&&o.fieldErrors){const e={};for(const[t,n]of Object.entries(o.fieldErrors))e[t]=n.join(" ");$(e)}}finally{T(!1)}var r}},[f,v,y,g,e,c,p,l,O,x]);/* @__PURE__ */
113
- return d(_c.Provider,{value:{values:x,errors:I,touched:S,isSubmitting:E,setFieldValue:U,setFieldTouched:j},children:/* @__PURE__ */h("form",{className:"form",onSubmit:M,children:[E&&/* @__PURE__ */d("div",{className:"return-message",children:"Creating booking..."}),N&&/* @__PURE__ */d(uc,{show:!0,onClose:L,children:/* @__PURE__ */d(Gs,{errors:N})}),A&&/* @__PURE__ */d(uc,{show:!0,children:/* @__PURE__ */d(Zc,{})}),
127
+ /* @__PURE__ */d(Iu,{name:"adults",label:"adults",count:t.persons,description:/* @__PURE__ */d("div",{className:"age-description",children:ne("adults_from",{age:e.adults_from_age})})}),e.children_allowed?/* @__PURE__ */d(Iu,{name:"children",label:"children",count:t.persons-1,description:/* @__PURE__ */d("div",{className:"age-description",children:ne("children_from",{from:e.children_from_age,til:e.children_till_age})})}):null,e.babies_allowed?/* @__PURE__ */d(Iu,{name:"babies",label:"babies",count:t.persons-1,description:/* @__PURE__ */d("div",{className:"age-description",children:ne("babies_from",{babies:e.babies_till_age})})}):null]})}function sl(e,t,n){const{persons:r}=t,o={},i=lu(t,e);for(const a of n){if(!a.required)continue;if(Be(a.id)){const t=cu(e,`extra_fields.booking_field_${a.id}`);t&&""!==t||(o[a.id]=ne("required"));continue}const t=cu(e,a.id);t&&""!==t||(o[a.id]=ne("required"))}e.adults<1&&r>0&&(o.adults=ne("at_least_1_adult")),Number(e.discount)>0&&!e.discount_reason&&(o.discount_reason=ne("you_need_to_give_reason")),i>r&&(o.max_persons=ne("max_persons_reached"));const s=e.extra_fields?.date_of_birth;return"0"!==e.cancel_insurance&&s&&xe(new Date(s),me(/* @__PURE__ */new Date,18))&&(o["extra_fields.date_of_birth"]=ne("at_least_18y_old"),o.insurances=ne("at_least_18y_old")),o}function al({house:e,PortalSite:t}){const{persons:n,arrivalDate:i,departureDate:a}=o(mu),{locale:c,portalCode:l,objectCode:p,apiUrl:f}=o(zs),{currency:m}=Vs(),g=o(gu),{options:_,bookingFormConfiguration:y}=t,v=_.bookingFields.map(e=>"telephone"===e.id?{...e,id:"phonenumber"}:e),b=e.booking_price,w=r(()=>{const t={};for(const e of b.optional_house_costs)t[e.id]="0";const r={...su(v),arrivalDate:i,departureDate:a,is_option:"false",costs:t,adults:n,children:0,babies:0,persons:n,discount:0,country:"nl",cancel_insurance:"0",discount_code:"",currency:m??"",extra_fields:{}};return{...r,persons:lu(e,r)}},[i,v,b.optional_house_costs,a,e,n,m]),[x,k]=u(()=>w()),[S,C]=u({}),[E,N]=u(!1),[T,R]=u(null),[A,$]=u(null),[P,D]=u({}),L=r(()=>{R(null),D({})},[]),j=r((t,n)=>{D(e=>void 0===e[t]?e:{...e,[t]:void 0}),k(r=>{let o=uu(r,t,n);return["adults","children","babies"].includes(t)&&(o={...o,persons:lu(e,o)}),o})},[e]),U=r((e,t=!0)=>{C(n=>uu(n,e,t))},[]),M=Ic()||null,O=s(()=>({...P,...sl(x,e,v)}),[v,e,P,x]),I=r(async t=>{t.preventDefault();const n={house_code:p,portal_code:l,locale:c},r=e=>{Bc({...n,interaction_type:"booking_form_error",interaction_info:{fields:e.filter(qc)}})},o=sl(x,e,v);if(C(function(e,t){let n={adults:!0,children:!0,babies:!0,cancel_insurance:!0};return e.forEach(e=>{n=uu(n,Be(e.id)?`extra_fields.booking_field_${e.id}`:e.id,!0)}),Number(t.discount)>0&&(n.discount_reason=!0),"1"!==t.cancel_insurance&&"2"!==t.cancel_insurance||(["address","house_number","zipcode","city"].forEach(e=>{n=uu(n,e,!0)}),n=uu(n,"extra_fields.date_of_birth",!0)),n}(v,x)),Object.keys(o).length>0)r(Object.keys(o));else{N(!0),R(null),D({});try{const e=await Zc({apiUrl:f,locale:c,payload:ru({values:x,objectCode:p,portalCode:l,locale:c,sessionIdentifier:M})});$(e);const t=y.redirect_urls??{},n=e.redirect_to_payment&&e.payment_url||e.redirect_url||t[c];n&&""!==n?(i=n,window.location.href=i):setTimeout(()=>{g({type:"return"})},15e3)}catch(s){if(Bc({...n,interaction_type:"booking_failed",interaction_info:{error_key:s instanceof Qc?`http_${s.status}`:"network"}}),R(s instanceof Error?s:/* @__PURE__ */new Error("The booking could not be created")),s instanceof Qc&&s.fieldErrors){const e={};for(const[t,n]of Object.entries(s.fieldErrors))e[t]=n.join(" ");D(e),r(Object.keys(s.fieldErrors))}}finally{N(!1)}var i}},[f,v,y,g,e,c,p,l,M,x]);/* @__PURE__ */
128
+ return d(hu.Provider,{value:{values:x,errors:O,touched:S,isSubmitting:E,setFieldValue:j,setFieldTouched:U},children:/* @__PURE__ */h("form",{className:"form",onSubmit:I,children:[E&&/* @__PURE__ */d("div",{className:"return-message",children:"Creating booking..."}),T&&/* @__PURE__ */d(ou,{show:!0,onClose:L,children:/* @__PURE__ */d(Is,{errors:T})}),A&&/* @__PURE__ */d(ou,{show:!0,children:/* @__PURE__ */d(Vu,{})}),
114
129
  /* @__PURE__ */h("div",{className:"form-content",children:[
115
130
  /* @__PURE__ */h("div",{className:"form-section bup-16",children:[
116
- /* @__PURE__ */d("a",{className:"return-link",role:"link",tabIndex:0,onClick:()=>{g({type:"return"})},children:Q("return_to_calendar")}),
117
- /* @__PURE__ */d("h2",{children:Q("stay_details")}),
118
- /* @__PURE__ */d(lu,{bookingFormConfiguration:y,house:e}),I.max_persons&&/* @__PURE__ */d("div",{className:"error-message bu-error-message persons",children:I.max_persons})]}),
119
- /* @__PURE__ */d(Qc,{errors:I,house:e,bookingFormConfiguration:y,values:x}),
120
- /* @__PURE__ */d(Kc,{house:e,values:x}),
121
- /* @__PURE__ */d(uu,{costs:b.optional_house_costs,currency:b.currency}),
122
- /* @__PURE__ */d(au,{bookingFields:v,errors:I,touched:S,PortalSite:t,values:x})]}),
131
+ /* @__PURE__ */d("a",{className:"return-link",role:"link",tabIndex:0,onClick:()=>{g({type:"return"})},children:ne("return_to_calendar")}),
132
+ /* @__PURE__ */d("h2",{children:ne("stay_details")}),
133
+ /* @__PURE__ */d(il,{bookingFormConfiguration:y,house:e}),O.max_persons&&/* @__PURE__ */d("div",{className:"error-message bu-error-message persons",children:O.max_persons})]}),
134
+ /* @__PURE__ */d(Ju,{errors:O,house:e,bookingFormConfiguration:y,values:x}),
135
+ /* @__PURE__ */d(zu,{house:e,values:x}),
136
+ /* @__PURE__ */d(ol,{costs:b.optional_house_costs,currency:b.currency}),
137
+ /* @__PURE__ */d(nl,{bookingFields:v,errors:O,touched:S,PortalSite:t,values:x})]}),
123
138
  /* @__PURE__ */h("div",{className:"form-sum bup-16",children:[
124
- /* @__PURE__ */d(zc,{house:e,values:x}),
139
+ /* @__PURE__ */d(Ou,{house:e,values:x}),
125
140
  /* @__PURE__ */h("div",{className:"terms",children:[t.form_submit_text," ",
126
- /* @__PURE__ */d(uc,{buttonText:Q("terms"),children:/* @__PURE__ */d("div",{style:{width:"90vh",height:"90vh"},children:/* @__PURE__ */d("iframe",{src:e.rental_terms??void 0,width:"100%",height:"100%",title:"Terms"})})}),e.allow_option&&/* @__PURE__ */h("span",{children:[", ",Q("option_is_free")]})]}),[1,2].includes(Number(x.cancel_insurance))?/* @__PURE__ */d("div",{className:"terms",children:Q("comply_insurance_card")}):null,
127
- /* @__PURE__ */d("button",{className:"bu-calendar-button",type:"submit",disabled:E,children:t.form_submit_button_text})]})]})})}function pu({portalSite:e}){const{portalCode:t,objectCode:n,locale:r,apiUrl:i}=o(ti),{currency:a}=ii(),{arrivalDate:c,departureDate:l}=o(bc),[h,f]=u(null),[m,g]=u(null);return s(()=>{let e=!1;return f(null),g(null),$c({apiUrl:i,locale:r,portalCode:t,objectCode:n,startsAt:c.date,endsAt:l.date,currency:a,includeAccommodation:!0}).then(t=>{e||(t.accommodation?f({...t.accommodation,booking_price:{total_price:t.total_price,currency:t.currency,optional_house_costs:t.optional_house_costs.map(e=>({id:String(e.id),name:e.name,method:e.method,max_available:e.max_available,amount:e.amount,method_name:e.method_name,description:e.description}))}}):g(/* @__PURE__ */new Error("Price response lacks the accommodation")))}).catch(t=>{e||g(t instanceof Error?t:new Error(String(t)))}),()=>{e=!0}},[i,r,t,n,c,l,a]),h||m?m||!h?/* @__PURE__ */d("div",{children:Q(m instanceof Pc?"no_prices_available_for_period":"something_went_wrong_please_try_again")}):(ec({house_code:n,portal_code:t,locale:r,interaction_type:"booking_started",interaction_data:{arrival_date:c.date,departure_date:l.date}}),/* @__PURE__ */d(hu,{house:h,PortalSite:e})):/* @__PURE__ */d("div",{children:/* @__PURE__ */d(p,{})})}var fu=class extends Error{constructor(e){super(`Accommodation detail request failed (${e})`),this.name="AccommodationDetailError",this.status=e,this.notFound=404===e}};async function mu(e){const t=function({apiUrl:e,portalCode:t,objectCode:n}){const r=new URL("/portal_api/v1/accommodations/detail",new URL(e).origin);return r.search=new URLSearchParams({portal_code:t,object_code:n}).toString(),r.toString()}(e);try{return await Ea.get(t,{headers:{locale:e.locale}}).json()}catch(n){if(n instanceof ui)throw new fu(n.response.status);throw n}}var gu=()=>/* @__PURE__ */h("svg",{xmlns:"http://www.w3.org/2000/svg","data-name":"Layer 1",viewBox:"0 0 100 100",x:"0px",y:"0px",children:[/* @__PURE__ */d("title",{children:"Forward"}),/* @__PURE__ */d("path",{d:"M97.64,44.1,64.72,11.18a8.06,8.06,0,1,0-11.4,11.39L72.78,42H8.06a8.06,8.06,0,0,0,0,16.12H72.6L53.32,77.43a8.06,8.06,0,0,0,11.4,11.39L97.64,55.9A8,8,0,0,0,100,50.2a1.27,1.27,0,0,0,0-.2,1.41,1.41,0,0,0,0-.2A8.07,8.07,0,0,0,97.64,44.1Z"})]});function _u({changeMonth:e,currentMonth:t,numberOfMonths:n}){const r=o(wc);/* @__PURE__ */
141
+ /* @__PURE__ */d(ou,{buttonText:ne("terms"),children:/* @__PURE__ */d("div",{style:{width:"90vh",height:"90vh"},children:/* @__PURE__ */d("iframe",{src:e.rental_terms??void 0,width:"100%",height:"100%",title:"Terms"})})}),e.allow_option&&/* @__PURE__ */h("span",{children:[", ",ne("option_is_free")]})]}),[1,2].includes(Number(x.cancel_insurance))?/* @__PURE__ */d("div",{className:"terms",children:ne("comply_insurance_card")}):null,
142
+ /* @__PURE__ */d("button",{className:"bu-calendar-button",type:"submit",disabled:E,children:t.form_submit_button_text})]})]})})}var cl=/* @__PURE__ */new Set;function ul(e){return!cl.has(e)&&(cl.add(e),!0)}function ll(e,t){return ul(`price_unavailable:${e}:${t.arrival}:${t.departure}`)}function dl({portalSite:e}){const{portalCode:t,objectCode:n,locale:r,apiUrl:s}=o(zs),{currency:a}=Vs(),{arrivalDate:l,departureDate:h,persons:f}=o(mu),[m,g]=u(null),[_,y]=u(null),v=c(/* @__PURE__ */new Set);return i(()=>{let e=!1;g(null),y(null);const o={arrival:l.date,departure:h.date},i={house_code:n,portal_code:t,locale:r};return Tu({apiUrl:s,locale:r,portalCode:t,objectCode:n,startsAt:l.date,endsAt:h.date,currency:a,includeAccommodation:!0}).then(t=>{e||(t.accommodation?((()=>{const e=`${n}:${o.arrival}:${o.departure}`;return!v.current.has(e)&&(v.current.add(e),!0)})()&&Bc({...i,interaction_type:"booking_started",interaction_info:{...o,persons:f}}),g({...t.accommodation,booking_price:{total_price:t.total_price,currency:t.currency,optional_house_costs:t.optional_house_costs.map(e=>({id:String(e.id),name:e.name,method:e.method,max_available:e.max_available,amount:e.amount,method_name:e.method_name,description:e.description}))}})):y(/* @__PURE__ */new Error("Price response lacks the accommodation")))}).catch(t=>{e||(y(t instanceof Error?t:new Error(String(t))),t instanceof Nu&&ll(n,o)&&Bc({...i,interaction_type:"price_unavailable",interaction_info:o}))}),()=>{e=!0}},[s,r,t,n,l,h,f,a]),m||_?_||!m?/* @__PURE__ */d("div",{children:ne(_ instanceof Nu?"no_prices_available_for_period":"something_went_wrong_please_try_again")}):/* @__PURE__ */d(al,{house:m,PortalSite:e}):/* @__PURE__ */d("div",{children:/* @__PURE__ */d(p,{})})}var hl=class extends Error{constructor(e){super(`Accommodation detail request failed (${e})`),this.name="AccommodationDetailError",this.status=e,this.notFound=404===e}};async function pl(e){const t=function({apiUrl:e,portalCode:t,objectCode:n}){const r=new URL("/portal_api/v1/accommodations/detail",new URL(e).origin);return r.search=new URLSearchParams({portal_code:t,object_code:n}).toString(),r.toString()}(e);try{return await fc.get(t,{headers:{locale:e.locale}}).json()}catch(n){if(n instanceof Xs)throw new hl(n.response.status);throw n}}var fl=()=>/* @__PURE__ */h("svg",{xmlns:"http://www.w3.org/2000/svg","data-name":"Layer 1",viewBox:"0 0 100 100",x:"0px",y:"0px",children:[/* @__PURE__ */d("title",{children:"Forward"}),/* @__PURE__ */d("path",{d:"M97.64,44.1,64.72,11.18a8.06,8.06,0,1,0-11.4,11.39L72.78,42H8.06a8.06,8.06,0,0,0,0,16.12H72.6L53.32,77.43a8.06,8.06,0,0,0,11.4,11.39L97.64,55.9A8,8,0,0,0,100,50.2a1.27,1.27,0,0,0,0-.2,1.41,1.41,0,0,0,0-.2A8.07,8.07,0,0,0,97.64,44.1Z"})]}),ml=()=>/* @__PURE__ */d("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",version:"1.1",x:"0px",y:"0px",viewBox:"0 0 100 100",enableBackground:"new 0 0 100 100",xmlSpace:"preserve",height:"16px",children:/* @__PURE__ */d("path",{fill:"#000000",stroke:"2",d:"M77,53.752c0,0.012,0,0.022,0,0.034c0,14.92-12.019,27.058-26.938,27.058 c-14.92,0-26.948-12.138-26.948-27.058C23.114,38.961,35,26.889,50,26.738v4.942c0,2.84,2.54,2.913,3.947,1.647l10.354-7.714 c0,0,1.128-0.942,1.128-1.979c0-1.089-1.147-1.979-1.147-1.979L53.95,13.941C52.543,12.675,50,12.749,50,15.588v5.149 c-18,0.151-32.826,14.915-32.826,33.048c0,18.229,14.686,33.058,32.914,33.058C68.314,86.844,83,72.015,83,53.786 c0-0.012,0-0.022,0-0.034c0,0,0-3.375-3.037-3.375C77.109,50.376,77,53.752,77,53.752z"})});function gl({changeMonth:e,currentMonth:t,numberOfMonths:n}){const r=o(gu);/* @__PURE__ */
128
143
  return h("div",{className:"calendars-header bu-grid bu-grid-cols-3",children:[
129
- /* @__PURE__ */d("div",{className:"bu-calendar-col bup-8",style:{textAlign:"center"},onClick:function(){e(Ua(t,-n))},tabIndex:0,role:"button",children:/* @__PURE__ */d("div",{className:"icon bu-rounded bu-hover-bright",children:/* @__PURE__ */d("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",version:"1.1",x:"0px",y:"0px",enableBackground:"new 0 0 100 100",viewBox:"0 0 100 125",xmlSpace:"preserve",children:/* @__PURE__ */d("path",{d:"M2.4,44.1l32.9-32.9c3.1-3.1,8.2-3.1,11.4,0c1.6,1.6,2.4,3.6,2.4,5.7c0,2.1-0.8,4.1-2.4,5.7L27.2,42h64.7 c2.2,0,4.2,0.9,5.7,2.4c1.5,1.5,2.4,3.5,2.4,5.7c0,4.4-3.6,8.1-8.1,8.1H27.4l19.3,19.3c1.6,1.6,2.4,3.6,2.4,5.7s-0.8,4.1-2.4,5.7 c-3.1,3.1-8.3,3.1-11.4,0L2.4,55.9C0.8,54.3,0,52.3,0,50.2c0-0.1,0-0.1,0-0.2c0-0.1,0-0.1,0-0.2C0,47.7,0.8,45.7,2.4,44.1z"})})})}),
130
- /* @__PURE__ */d("div",{className:"bu-calendar-col bup-8",onClick:()=>{r({type:"reset"})},style:{textAlign:"center"},tabIndex:0,role:"button",children:/* @__PURE__ */d("div",{className:"icon bu-rounded bu-hover-bright",children:/* @__PURE__ */d(x,{})})}),
131
- /* @__PURE__ */d("div",{className:"bu-calendar-col bup-8 bup-x16",onClick:function(){e(Ua(t,n))},style:{textAlign:"center"},tabIndex:0,role:"button",children:/* @__PURE__ */d("div",{className:"icon bu-rounded bu-hover-bright",children:/* @__PURE__ */d(gu,{})})})]})}function yu({house:e}){const{departureDate:t,arrivalDate:n}=o(bc);return t?.date?/* @__PURE__ */h("div",{className:"bup-16 bu-bold",children:[Q(`${e.house_type}.you_picked_arrival_date`),":"," ",Aa(Da(n.date),Ja),
132
- /* @__PURE__ */d("br",{}),Q(`${e.house_type}.you_picked_departure_date`),":"," ",Aa(Da(t.date),Ja)]}):n?.date?/* @__PURE__ */h("div",{className:"bup-16 bu-bold",children:[Q(`${e.house_type}.you_picked_arrival_date`),":"," ",Aa(Da(n.date),Ja),
133
- /* @__PURE__ */d("br",{}),Q(`${e.house_type}.pick_your_departure_in_the_calendar`),
134
- /* @__PURE__ */d("br",{}),Q("minimum_nights",{minimum:n.min_nights})]}):/* @__PURE__ */d("div",{className:"bup-16 bu-bold",children:Q(`${e.house_type}.pick_your_arrivaldate_in_the_calendar`)})}function vu({house:e}){/* @__PURE__ */
144
+ /* @__PURE__ */d("div",{className:"bu-calendar-col bup-8",style:{textAlign:"center"},onClick:function(){e(fe(t,-n))},tabIndex:0,role:"button",children:/* @__PURE__ */d("div",{className:"icon bu-rounded bu-hover-bright",children:/* @__PURE__ */d("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",version:"1.1",x:"0px",y:"0px",enableBackground:"new 0 0 100 100",viewBox:"0 0 100 125",xmlSpace:"preserve",children:/* @__PURE__ */d("path",{d:"M2.4,44.1l32.9-32.9c3.1-3.1,8.2-3.1,11.4,0c1.6,1.6,2.4,3.6,2.4,5.7c0,2.1-0.8,4.1-2.4,5.7L27.2,42h64.7 c2.2,0,4.2,0.9,5.7,2.4c1.5,1.5,2.4,3.5,2.4,5.7c0,4.4-3.6,8.1-8.1,8.1H27.4l19.3,19.3c1.6,1.6,2.4,3.6,2.4,5.7s-0.8,4.1-2.4,5.7 c-3.1,3.1-8.3,3.1-11.4,0L2.4,55.9C0.8,54.3,0,52.3,0,50.2c0-0.1,0-0.1,0-0.2c0-0.1,0-0.1,0-0.2C0,47.7,0.8,45.7,2.4,44.1z"})})})}),
145
+ /* @__PURE__ */d("div",{className:"bu-calendar-col bup-8",onClick:()=>{r({type:"reset"})},style:{textAlign:"center"},tabIndex:0,role:"button",children:/* @__PURE__ */d("div",{className:"icon bu-rounded bu-hover-bright",children:/* @__PURE__ */d(ml,{})})}),
146
+ /* @__PURE__ */d("div",{className:"bu-calendar-col bup-8 bup-x16",onClick:function(){e(fe(t,n))},style:{textAlign:"center"},tabIndex:0,role:"button",children:/* @__PURE__ */d("div",{className:"icon bu-rounded bu-hover-bright",children:/* @__PURE__ */d(fl,{})})})]})}function _l({house:e}){const{departureDate:t,arrivalDate:n}=o(mu);return t?.date?/* @__PURE__ */h("div",{className:"bup-16 bu-bold",children:[ne(`${e.house_type}.you_picked_arrival_date`),":"," ",ue(le(n.date),Ee),
147
+ /* @__PURE__ */d("br",{}),ne(`${e.house_type}.you_picked_departure_date`),":"," ",ue(le(t.date),Ee)]}):n?.date?/* @__PURE__ */h("div",{className:"bup-16 bu-bold",children:[ne(`${e.house_type}.you_picked_arrival_date`),":"," ",ue(le(n.date),Ee),
148
+ /* @__PURE__ */d("br",{}),ne(`${e.house_type}.pick_your_departure_in_the_calendar`),
149
+ /* @__PURE__ */d("br",{}),ne("minimum_nights",{minimum:n.min_nights})]}):/* @__PURE__ */d("div",{className:"bup-16 bu-bold",children:ne(`${e.house_type}.pick_your_arrivaldate_in_the_calendar`)})}function yl({house:e}){/* @__PURE__ */
135
150
  return h("div",{className:"legend",children:[
136
- /* @__PURE__ */h("div",{children:[/* @__PURE__ */d("span",{className:"legend-field arrival"}),Q(`${e.house_type}.arrival_date`)]}),
137
- /* @__PURE__ */h("div",{children:[/* @__PURE__ */d("span",{className:"legend-field booked"}),Q("booked")]}),
138
- /* @__PURE__ */h("div",{children:[/* @__PURE__ */d("span",{className:"legend-field departure"}),Q(`${e.house_type}.departure_date`)]}),
139
- /* @__PURE__ */h("div",{children:[/* @__PURE__ */d("span",{className:"legend-field last_minute_discount"}),Q("discount")]})]})}async function bu({apiUrl:e,locale:t,portalCode:n,objectCode:r,startsDate:o,endDate:s}){const i=function({apiUrl:e,portalCode:t,objectCode:n,startsDate:r,endDate:o}){const s=new URL("/portal_api/v1/accommodations/availability",new URL(e).origin);return s.search=new URLSearchParams({portal_code:t,object_code:n,starts_date:Pa(r),end_date:Pa(o)}).toString(),s.toString()}({apiUrl:e,portalCode:n,objectCode:r,startsDate:o,endDate:s});try{return await Ea.get(i,{headers:{locale:t}}).json()}catch(a){if(a instanceof ui)throw new Error(`Availability request failed (${a.response.status})`);throw a}}var wu=({month:e})=>/* @__PURE__ */d("div",{className:"bu-bold bup-4",children:/* @__PURE__ */d("div",{className:"bu-calendar-col bu-text-center",children:/* @__PURE__ */d("span",{children:Aa(e,Wa)})})});function xu({day:e,monthStart:t,buDate:n,prevBooked:r,dates:o,house:s,discounts:i}){const{selectedDate:a,departureDate:c,arrivalDate:u}=o,l=/* @__PURE__ */new Date,d=["bu-grid","bu-center","bu-rounded-half","bu-h-42","bu-w-42"];if(p=t,(h=e).getFullYear()!==p.getFullYear()||h.getMonth()!==p.getMonth())return d.push("disabled"),d.join(" ");var h,p;if(n&&(n.arrival&&za(e,La(l,1))&&0!==n.max_nights?0===r?.max_nights?d.push("departure-arrival","bu-hover-bright"):d.push("arrival","bu-hover-bright"):0===n.max_nights?void 0!==r&&0!==r.max_nights?d.push("booked-departure","bu-hover-bright"):d.push("booked"):n.max_nights>0&&(void 0===r||0===r.max_nights)&&!n.arrival&&d.push("booked")),a){Fa(e,a)&&d.push("selected");const t=Ya(e,a),o=t>=(u?.min_nights??0),i=t<=s.max_nights&&t<=(u?.max_nights??0);n.departure&&za(e,a)&&o&&i&&void 0!==r&&0!==r.max_nights&&d.push("departure")}if(c&&a){const t=Da(c.date);za(e,a)&&Ha(e,t)&&d.push("selected"),Fa(e,t)&&d.push("selected")}const f=Ya(e,l),m=f<=s.last_minute_days&&f>0,g=i.find(t=>Ha(La(Da(t.discount_starts_at),1),e)&&za($a(Da(t.discount_ends_at),1),e));return(m||g||n.special_offer>0)&&d.push("discount"),d.join(" ")}function ku({availabilities:e,month:t,discounts:n,house:r}){const s=o(wc),i=o(bc),a=Ia(t),c=Ma(a),u=qa(a),l=Ba(c),h=[];let p=[],f=u;for(;f<=l;){for(let t=0;t<7;t++){let t=Pa(f),o=Pa(La(f,1));const c=e.find(e=>e.date===t),u=e.find(e=>e.date===o);if(!c){p.push(/* @__PURE__ */d("div",{className:"bu-grid bu-center disabled",children:/* @__PURE__ */d("span",{children:Aa(f,{day:"numeric"})})},t)),f=$a(f,1);continue}const l=c;p.push(/* @__PURE__ */d("div",{className:xu({day:f,monthStart:a,discounts:n,buDate:c,prevBooked:u,house:r,dates:i}),role:"button",tabIndex:0,onClick:()=>{Ha(Da(l.date),/* @__PURE__ */new Date)||s({type:"clicked",day:l,house:r})},children:/* @__PURE__ */d("span",{children:Aa(f,{day:"numeric"})})},c.date)),f=$a(f,1)}h.push(p),p=[]}/* @__PURE__ */
140
- return d("div",{className:"bu-grid bu-grid-cols-7",children:h})}function Su({month:e}){const t={weekday:"short"};let n=[],r=qa(e);for(let o=0;o<7;o++)n.push(/* @__PURE__ */d("div",{className:"bu-calendar-col bu-text-center",children:Aa($a(r,o),t)},o));/* @__PURE__ */
141
- return d("div",{className:"bu-grid bu-grid-cols-7",children:n})}function Cu({count:e,currentMonth:t,house:n,availabilities:r,discounts:o}){const s=Ua(t,e);/* @__PURE__ */
151
+ /* @__PURE__ */h("div",{children:[/* @__PURE__ */d("span",{className:"legend-field arrival"}),ne(`${e.house_type}.arrival_date`)]}),
152
+ /* @__PURE__ */h("div",{children:[/* @__PURE__ */d("span",{className:"legend-field booked"}),ne("booked")]}),
153
+ /* @__PURE__ */h("div",{children:[/* @__PURE__ */d("span",{className:"legend-field departure"}),ne(`${e.house_type}.departure_date`)]}),
154
+ /* @__PURE__ */h("div",{children:[/* @__PURE__ */d("span",{className:"legend-field last_minute_discount"}),ne("discount")]})]})}async function vl({apiUrl:e,locale:t,portalCode:n,objectCode:r,startsDate:o,endDate:i}){const s=function({apiUrl:e,portalCode:t,objectCode:n,startsDate:r,endDate:o}){const i=new URL("/portal_api/v1/accommodations/availability",new URL(e).origin);return i.search=new URLSearchParams({portal_code:t,object_code:n,starts_date:de(r),end_date:de(o)}).toString(),i.toString()}({apiUrl:e,portalCode:n,objectCode:r,startsDate:o,endDate:i});try{return await fc.get(s,{headers:{locale:t}}).json()}catch(a){if(a instanceof Xs)throw new Error(`Availability request failed (${a.response.status})`);throw a}}var bl=({month:e})=>/* @__PURE__ */d("div",{className:"bu-bold bup-4",children:/* @__PURE__ */d("div",{className:"bu-calendar-col bu-text-center",children:/* @__PURE__ */d("span",{children:ue(e,Ce)})})});function wl({day:e,monthStart:t,buDate:n,prevBooked:r,dates:o,house:i,discounts:s}){const{selectedDate:a,departureDate:c,arrivalDate:u}=o,l=/* @__PURE__ */new Date,d=["bu-grid","bu-center","bu-rounded-half","bu-h-42","bu-w-42"];if(p=t,(h=e).getFullYear()!==p.getFullYear()||h.getMonth()!==p.getMonth())return d.push("disabled"),d.join(" ");var h,p;if(n&&(n.arrival&&xe(e,pe(l,1))&&0!==n.max_nights?0===r?.max_nights?d.push("departure-arrival","bu-hover-bright"):d.push("arrival","bu-hover-bright"):0===n.max_nights?void 0!==r&&0!==r.max_nights?d.push("booked-departure","bu-hover-bright"):d.push("booked"):n.max_nights>0&&(void 0===r||0===r.max_nights)&&!n.arrival&&d.push("booked")),a){we(e,a)&&d.push("selected");const t=Se(e,a),o=t>=(u?.min_nights??0),s=t<=i.max_nights&&t<=(u?.max_nights??0);n.departure&&xe(e,a)&&o&&s&&void 0!==r&&0!==r.max_nights&&d.push("departure")}if(c&&a){const t=le(c.date);xe(e,a)&&ke(e,t)&&d.push("selected"),we(e,t)&&d.push("selected")}const f=Se(e,l),m=f<=i.last_minute_days&&f>0,g=s.find(t=>ke(pe(le(t.discount_starts_at),1),e)&&xe(he(le(t.discount_ends_at),1),e));return(m||g||n.special_offer>0)&&d.push("discount"),d.join(" ")}function xl({availabilities:e,month:t,discounts:n,house:r}){const i=o(gu),s=o(mu),a=_e(t),c=ye(a),u=ve(a),l=be(c),h=[];let p=[],f=u;for(;f<=l;){for(let t=0;t<7;t++){let t=de(f),o=de(pe(f,1));const c=e.find(e=>e.date===t),u=e.find(e=>e.date===o);if(!c){p.push(/* @__PURE__ */d("div",{className:"bu-grid bu-center disabled",children:/* @__PURE__ */d("span",{children:ue(f,{day:"numeric"})})},t)),f=he(f,1);continue}const l=c;p.push(/* @__PURE__ */d("div",{className:wl({day:f,monthStart:a,discounts:n,buDate:c,prevBooked:u,house:r,dates:s}),role:"button",tabIndex:0,onClick:()=>{ke(le(l.date),/* @__PURE__ */new Date)||i({type:"clicked",day:l,house:r})},children:/* @__PURE__ */d("span",{children:ue(f,{day:"numeric"})})},c.date)),f=he(f,1)}h.push(p),p=[]}/* @__PURE__ */
155
+ return d("div",{className:"bu-grid bu-grid-cols-7",children:h})}function kl({month:e}){const t={weekday:"short"};let n=[],r=ve(e);for(let o=0;o<7;o++)n.push(/* @__PURE__ */d("div",{className:"bu-calendar-col bu-text-center",children:ue(he(r,o),t)},o));/* @__PURE__ */
156
+ return d("div",{className:"bu-grid bu-grid-cols-7",children:n})}function Sl({count:e,currentMonth:t,house:n,availabilities:r,discounts:o}){const i=fe(t,e);/* @__PURE__ */
142
157
  return h("div",{className:"bu-calendar calendar bup-16",children:[
143
- /* @__PURE__ */d(wu,{month:s}),
144
- /* @__PURE__ */d(Su,{month:s}),
145
- /* @__PURE__ */d(ku,{availabilities:r,discounts:o,month:s,house:n})]},s.toISOString())}function Eu({numberOfMonthsInARow:e,currentMonth:t,numberOfMonths:n,house:r}){const{portalCode:i,objectCode:a,locale:c,apiUrl:l}=o(ti),[h,f]=u(null),[m,g]=u(!0),[_,y]=u(!1);if(s(()=>{let e=!1;g(!0),y(!1);const r=qa(Ia(t)),o=Ba(Ma(Ua(t,n-1)));return bu({apiUrl:l,locale:c,portalCode:i,objectCode:a,startsDate:r,endDate:o}).then(t=>{e||(f(t),g(!1))}).catch(()=>{e||(y(!0),g(!1))}),()=>{e=!0}},[l,c,i,a,t,n]),m)/* @__PURE__ */return d("div",{children:/* @__PURE__ */d(p,{})});if(_||!h)/* @__PURE__ */return d("div",{children:"Error"});let v=[];for(let o=0;o<n;o++)v.push(/* @__PURE__ */d(Cu,{house:r,currentMonth:t,count:o,availabilities:h.availabilities,discounts:h.discounts},Pa(Ua(t,o)).slice(0,7)));/* @__PURE__ */
146
- return d("div",{className:`bu-grid bu-grid-cols-${e||2} bu-gap-16`,children:v})}function Tu({persons:e,variables:t}){const{portalCode:n,objectCode:r,locale:i,apiUrl:a}=o(ti),{currency:c}=ii(),[f,m]=u(null),[g,_]=u(!0),[y,v]=u(null);return s(()=>{let o=!1;return _(!0),v(null),$c({apiUrl:a,locale:i,portalCode:n,objectCode:r,startsAt:t.starts_at,endsAt:t.ends_at,persons:e,currency:c}).then(e=>{o||(m(e),_(!1))}).catch(e=>{o||(v(e),_(!1))}),()=>{o=!0}},[a,i,n,r,t.starts_at,t.ends_at,e,c]),g?/* @__PURE__ */d("div",{className:"price-overview--build bup-16",children:/* @__PURE__ */d(p,{})}):y||!f?/* @__PURE__ */d("div",{className:"price-overview--build bup-16",children:Q(y instanceof Pc?"no_prices_available_for_period":"something_went_wrong_please_try_again")}):/* @__PURE__ */d(l,{children:/* @__PURE__ */h("div",{className:"price-overview--book",children:[/* @__PURE__ */d("div",{className:"price",children:Z(Math.round(f.total_price),{style:"currency",currency:f.currency})}),/* @__PURE__ */d("div",{children:/* @__PURE__ */d("i",{children:Q("based_on_one_person",{persons:e})})})]})})}var Nu=Ja;function Ru({house:e}){const t=e.persons>2?2:e.persons,[n,r]=u(t),{arrivalDate:s,departureDate:i}=o(bc),a=o(wc);let c=lc(e.persons);/* @__PURE__ */
158
+ /* @__PURE__ */d(bl,{month:i}),
159
+ /* @__PURE__ */d(kl,{month:i}),
160
+ /* @__PURE__ */d(xl,{availabilities:r,discounts:o,month:i,house:n})]},i.toISOString())}function Cl({numberOfMonthsInARow:e,currentMonth:t,numberOfMonths:n,house:r}){const{portalCode:s,objectCode:a,locale:c,apiUrl:l}=o(zs),[h,f]=u(null),[m,g]=u(!0),[_,y]=u(!1);if(i(()=>{let e=!1;g(!0),y(!1);const r=ve(_e(t)),o=be(ye(fe(t,n-1)));return vl({apiUrl:l,locale:c,portalCode:s,objectCode:a,startsDate:r,endDate:o}).then(t=>{e||(f(t),g(!1))}).catch(()=>{e||(y(!0),g(!1))}),()=>{e=!0}},[l,c,s,a,t,n]),m)/* @__PURE__ */return d("div",{children:/* @__PURE__ */d(p,{})});if(_||!h)/* @__PURE__ */return d("div",{children:"Error"});let v=[];for(let o=0;o<n;o++)v.push(/* @__PURE__ */d(Sl,{house:r,currentMonth:t,count:o,availabilities:h.availabilities,discounts:h.discounts},de(fe(t,o)).slice(0,7)));/* @__PURE__ */
161
+ return d("div",{className:`bu-grid bu-grid-cols-${e||2} bu-gap-16`,children:v})}function El({persons:e,variables:t}){const{portalCode:n,objectCode:r,locale:s,apiUrl:a}=o(zs),{currency:c}=Vs(),[f,m]=u(null),[g,_]=u(!0),[y,v]=u(null);return i(()=>{let o=!1;_(!0),v(null);const i={arrival:t.starts_at,departure:t.ends_at};return Tu({apiUrl:a,locale:s,portalCode:n,objectCode:r,startsAt:t.starts_at,endsAt:t.ends_at,persons:e,currency:c}).then(t=>{o||(m(t),_(!1),function(e,t,n){return ul(`quote_shown:${e}:${t.arrival}:${t.departure}:${n}`)}(r,i,e)&&Bc({house_code:r,portal_code:n,locale:s,interaction_type:"quote_shown",interaction_info:{...i,persons:e,total_cents:Math.round(100*t.total_price),currency:t.currency.toUpperCase()}}))}).catch(e=>{o||(v(e),_(!1),e instanceof Nu&&ll(r,i)&&Bc({house_code:r,portal_code:n,locale:s,interaction_type:"price_unavailable",interaction_info:i}))}),()=>{o=!0}},[a,s,n,r,t.starts_at,t.ends_at,e,c]),g?/* @__PURE__ */d("div",{className:"price-overview--build bup-16",children:/* @__PURE__ */d(p,{})}):y||!f?/* @__PURE__ */d("div",{className:"price-overview--build bup-16",children:ne(y instanceof Nu?"no_prices_available_for_period":"something_went_wrong_please_try_again")}):/* @__PURE__ */d(l,{children:/* @__PURE__ */h("div",{className:"price-overview--book",children:[/* @__PURE__ */d("div",{className:"price",children:re(Math.round(f.total_price),{style:"currency",currency:f.currency})}),/* @__PURE__ */d("div",{children:/* @__PURE__ */d("i",{children:ne("based_on_one_person",{persons:e})})})]})})}var Nl=Ee;function Tl({house:e}){const t=e.persons>2?2:e.persons,[n,r]=u(t),{arrivalDate:i,departureDate:s}=o(mu),a=o(gu);let c=iu(e.persons);/* @__PURE__ */
147
162
  return h("div",{className:"calendar--picker",children:[
148
- /* @__PURE__ */h("div",{className:"calendar--picker--date",children:[/* @__PURE__ */d("span",{className:"name",children:Q(`${e.house_type}.arrival`)}),/* @__PURE__ */d("span",{className:"detail",children:s?.date?/* @__PURE__ */d("span",{children:Aa(Da(s?.date),Nu)}):Q(`${e.house_type}.pick_your_arrivaldate_in_the_calendar`)})]}),
149
- /* @__PURE__ */h("div",{className:"calendar--picker--date",children:[/* @__PURE__ */d("span",{className:"name",children:Q(`${e.house_type}.departure`)}),/* @__PURE__ */d("span",{className:"detail",children:i?.date?/* @__PURE__ */d("span",{children:Aa(Da(i?.date),Nu)}):/* @__PURE__ */h("div",{children:[/* @__PURE__ */d("div",{children:Q(`${e.house_type}.pick_your_departure_in_the_calendar`)}),s&&Q("minimum_nights",{minimum:s?.min_nights})]})})]}),
150
- /* @__PURE__ */d("div",{className:"calendar--picker--date",children:/* @__PURE__ */d("span",{className:"detail",children:/* @__PURE__ */d("select",{className:"calendar--picker--persons",value:n,onChange:e=>{r(Number(e.target.value))},children:c.map(e=>/* @__PURE__ */h("option",{value:e,children:[e," ",Q("persons")]},e))})})}),
151
- /* @__PURE__ */d("div",{className:"calendar--picker--date",children:/* @__PURE__ */d(ai,{})}),
152
- /* @__PURE__ */d("div",{className:"calendar--picker--date",children:s&&i&&/* @__PURE__ */d(Tu,{persons:n,variables:{starts_at:s?.date,ends_at:i?.date}})}),
153
- /* @__PURE__ */d("button",{className:"button",disabled:!s||!i,onClick:()=>{s&&i&&a({type:"start",persons:n})},children:Q("calculate")})]})}function Au({house:e}){/* @__PURE__ */
154
- return d("div",{className:"price-overview bup-16",children:/* @__PURE__ */d(Ru,{house:e})})}function Du({numberOfMonths:e,house:t,numberOfMonthsInARow:n}){const[r,o]=u(/* @__PURE__ */new Date);/* @__PURE__ */
155
- return h("div",{className:"calendar-container ",children:[/* @__PURE__ */d(Au,{house:t}),/* @__PURE__ */h("div",{className:"calendar-section",children:[
156
- /* @__PURE__ */d(_u,{changeMonth:o,currentMonth:r,numberOfMonths:e}),
157
- /* @__PURE__ */d(Eu,{house:t,numberOfMonths:e,numberOfMonthsInARow:n,currentMonth:r}),
158
- /* @__PURE__ */d(vu,{house:t}),
159
- /* @__PURE__ */d(yu,{house:t})]})]})}function Pu({portalSite:e}){const{portalCode:t,objectCode:n,locale:r,apiUrl:i}=o(ti),[a,c]=u({status:"loading"});if(s(()=>{ec({house_code:n,portal_code:t,interaction_type:"calendar_view",locale:r})},[n,t,r]),s(()=>{let e=!1;return c({status:"loading"}),mu({apiUrl:i,locale:r,portalCode:t,objectCode:n}).then(t=>{e||c({status:"ready",house:t})}).catch(t=>{e||(t instanceof fu&&t.notFound?c({status:"not-found"}):c({status:"error",error:t instanceof Error?t:/* @__PURE__ */new Error(`The accommodation request failed: ${String(t)}`)}))}),()=>{e=!0}},[i,r,t,n]),"loading"===a.status)/* @__PURE__ */return d("div",{children:/* @__PURE__ */d(p,{})});if("error"===a.status)/* @__PURE__ */return d("div",{children:/* @__PURE__ */d(Gs,{errors:a.error})});const l=e.bookingFormConfiguration.show_months_amount,f=e.bookingFormConfiguration.show_months_in_a_row_amount;/* @__PURE__ */
160
- return d("div",{id:"calendar-container",children:"not-found"===a.status?/* @__PURE__ */d("div",{children:Q("no_house_found")}):/* @__PURE__ */h("div",{children:[/* @__PURE__ */d("div",{className:"bup-16",children:a.house.name}),/* @__PURE__ */d(Du,{numberOfMonths:l,numberOfMonthsInARow:f,house:a.house})]})})}function $u({portalSite:e}){const{bookingStarted:t}=o(bc);/* @__PURE__ */
161
- return d(t?pu:Pu,{portalSite:e})}function Lu({portalSite:e}){/* @__PURE__ */
162
- return d(xc,{children:/* @__PURE__ */d($u,{portalSite:e})})}async function Uu({portalCode:e,objectCode:t,apiUrl:n="",after:r}){const o=new URLSearchParams({portal_code:e,object_code:t});r&&o.set("after",r);const s=`${n?new URL(n).origin:""}/portal_api/v1/accommodations/reviews?${o.toString()}`;try{const e=await Ea.get(s).json();return{house:{id:"",name:e.house.name,rating:Number(e.house.rating),scoreAmount:Number(e.house.score_amount),reviews:e.items.map(e=>({id:"",name:e.name,review:e.review,score:Number(e.score),createdAt:e.created_at,sourceName:e.source_name??"",reviewResponses:e.review_responses??[],reviewCriteria:(e.review_criteria??[]).map(e=>({id:0,name:e.name,score:Number(e.score)}))}))},pageInfo:e.page_info}}catch(i){if(i instanceof ui)throw new Error(`Reviews request failed (${i.response.status})`);throw i}}function ju(e){return e>7?"best":e>6?"good":e>4?"medium":"low"}function Ou(e){return{color:ju(e),formatted:e%1==0?String(e):e.toFixed(1)}}function Iu(e,t){const n=document.createElement("div");return e&&(n.className=e),t&&(n.textContent=t),n}function Mu(e){const t=Iu("bu_reviews bup-16"),n=Iu("bu_reviews__overview bup-16 bu_card"),r=Iu("bu_score");if(e.rating){const t=Ou(e.rating),n=Iu(`bu_score__rating bu_card ${t.color}`);n.textContent=t.formatted,r.appendChild(n)}const o=Iu("bu_reviews__overview__number",`${e.scoreAmount} ${Q("reviews")}`);return n.appendChild(r),n.appendChild(o),t.appendChild(n),e.reviews.forEach(e=>{const n=function(e){const t=Ou(e.score);return{id:e.id,name:e.name,createdAt:e.createdAt,review:e.review,color:t.color,formatted:t.formatted,sourceName:e.sourceName,reviewResponses:e.reviewResponses,criteria:e.reviewCriteria.map(e=>{const t=Ou(e.score);return{id:e.id,name:e.name,score:e.score,color:t.color,formatted:t.formatted}})}}(e),r=Iu("bu_single_review bup-16 bu_card"),o=Iu("bu_review_summary"),s=Iu("bu_score");if(e.score){const e=Iu(`bu_score__rating bu_card ${n.color}`,n.formatted);s.appendChild(e)}const i=Iu("bu_review_summary__date_name"),a=Iu(void 0,`${Va(n.createdAt)}, `),c=Iu("bu_review_summary__name",n.name);if(i.appendChild(a),i.appendChild(c),o.appendChild(s),o.appendChild(i),n.sourceName){const e=Iu("bu_review_summary__source",n.sourceName);o.appendChild(e)}if(r.appendChild(o),n.review){const e=document.createElement("blockquote");e.className="bu_review",e.textContent=n.review,r.appendChild(e)}if(n.criteria.length>0){const e=Iu("bu_criteria");n.criteria.forEach(t=>{const n=Iu("bu_score");if(t.score){const e=Iu(`bu_score__rating bu_card ${t.color}`,t.formatted);n.appendChild(e)}n.appendChild(Iu(void 0,t.name)),e.appendChild(n)}),r.appendChild(e)}if(n.reviewResponses?.length>0){const e=Iu("bu_review_responses");n.reviewResponses.forEach(t=>{const n=Iu("bu_review_response"),r=Iu("bu_review_response__label",Q("review_response_label")),o=Iu("bu_review_response__header"),s=Va(t.created_at);o.appendChild(Iu("bu_review_response__sender",t.sender)),o.appendChild(Iu("bu_review_response__date",s));const i=document.createElement("p");i.className="bu_review_response__message",i.textContent=t.message,n.appendChild(r),n.appendChild(o),n.appendChild(i),e.appendChild(n)}),r.appendChild(e)}t.appendChild(r)}),t}function qu({house:e}){const t=c(null);return s(()=>{var n,r;if(t.current)return n=t.current,r=()=>Mu(e),n.replaceChildren(r()),()=>{n.replaceChildren()}},[e]),/* @__PURE__ */d("div",{ref:t})}function Bu({objectCode:e,portalCode:t,apiUrl:n}){const[r,o]=u({status:"loading"}),i=c(!0);if(s(()=>(i.current=!0,()=>{i.current=!1}),[]),s(()=>{let r=!0;return o({status:"loading"}),Uu({portalCode:t,objectCode:e,apiUrl:n}).then(({house:e,pageInfo:t})=>{r&&o({status:"ready",house:e,endCursor:t.end_cursor,hasNextPage:t.has_next_page})}).catch(e=>{r&&o({status:"error",error:e instanceof Error?e:new Error(String(e))})}),()=>{r=!1}},[t,e,n]),"loading"===r.status)/* @__PURE__ */return d("div",{children:/* @__PURE__ */d(p,{})});if("error"===r.status)/* @__PURE__ */return d("div",{className:"bukazu-error-message","data-testid":"error",children:/* @__PURE__ */d("h2",{children:Q("something_went_wrong_please_try_again")})});const a=r.house,f="ready"===r.status&&r.hasNextPage,m="loading_more"===r.status;/* @__PURE__ */
163
+ /* @__PURE__ */h("div",{className:"calendar--picker--date",children:[/* @__PURE__ */d("span",{className:"name",children:ne(`${e.house_type}.arrival`)}),/* @__PURE__ */d("span",{className:"detail",children:i?.date?/* @__PURE__ */d("span",{children:ue(le(i?.date),Nl)}):ne(`${e.house_type}.pick_your_arrivaldate_in_the_calendar`)})]}),
164
+ /* @__PURE__ */h("div",{className:"calendar--picker--date",children:[/* @__PURE__ */d("span",{className:"name",children:ne(`${e.house_type}.departure`)}),/* @__PURE__ */d("span",{className:"detail",children:s?.date?/* @__PURE__ */d("span",{children:ue(le(s?.date),Nl)}):/* @__PURE__ */h("div",{children:[/* @__PURE__ */d("div",{children:ne(`${e.house_type}.pick_your_departure_in_the_calendar`)}),i&&ne("minimum_nights",{minimum:i?.min_nights})]})})]}),
165
+ /* @__PURE__ */d("div",{className:"calendar--picker--date",children:/* @__PURE__ */d("span",{className:"detail",children:/* @__PURE__ */d("select",{className:"calendar--picker--persons",value:n,onChange:e=>{r(Number(e.target.value))},children:c.map(e=>/* @__PURE__ */h("option",{value:e,children:[e," ",ne("persons")]},e))})})}),
166
+ /* @__PURE__ */d("div",{className:"calendar--picker--date",children:/* @__PURE__ */d(Ks,{})}),
167
+ /* @__PURE__ */d("div",{className:"calendar--picker--date",children:i&&s&&/* @__PURE__ */d(El,{persons:n,variables:{starts_at:i?.date,ends_at:s?.date}})}),
168
+ /* @__PURE__ */d("button",{className:"button",disabled:!i||!s,onClick:()=>{i&&s&&a({type:"start",persons:n})},children:ne("calculate")})]})}function Rl({house:e}){/* @__PURE__ */
169
+ return d("div",{className:"price-overview bup-16",children:/* @__PURE__ */d(Tl,{house:e})})}function Al({numberOfMonths:e,house:t,numberOfMonthsInARow:n}){const[r,o]=u(/* @__PURE__ */new Date);/* @__PURE__ */
170
+ return h("div",{className:"calendar-container ",children:[/* @__PURE__ */d(Rl,{house:t}),/* @__PURE__ */h("div",{className:"calendar-section",children:[
171
+ /* @__PURE__ */d(gl,{changeMonth:o,currentMonth:r,numberOfMonths:e}),
172
+ /* @__PURE__ */d(Cl,{house:t,numberOfMonths:e,numberOfMonthsInARow:n,currentMonth:r}),
173
+ /* @__PURE__ */d(yl,{house:t}),
174
+ /* @__PURE__ */d(_l,{house:t})]})]})}function $l({portalSite:e}){const{portalCode:t,objectCode:n,locale:r,apiUrl:s}=o(zs),[a,c]=u({status:"loading"});if(i(()=>{let e=!1;return c({status:"loading"}),pl({apiUrl:s,locale:r,portalCode:t,objectCode:n}).then(t=>{e||c({status:"ready",house:t})}).catch(t=>{e||(t instanceof hl&&t.notFound?c({status:"not-found"}):c({status:"error",error:t instanceof Error?t:/* @__PURE__ */new Error(`The accommodation request failed: ${String(t)}`)}))}),()=>{e=!0}},[s,r,t,n]),"loading"===a.status)/* @__PURE__ */return d("div",{children:/* @__PURE__ */d(p,{})});if("error"===a.status)/* @__PURE__ */return d("div",{children:/* @__PURE__ */d(Is,{errors:a.error})});const l=e.bookingFormConfiguration.show_months_amount,f=e.bookingFormConfiguration.show_months_in_a_row_amount;/* @__PURE__ */
175
+ return d("div",{id:"calendar-container",children:"not-found"===a.status?/* @__PURE__ */d("div",{children:ne("no_house_found")}):/* @__PURE__ */h("div",{children:[/* @__PURE__ */d("div",{className:"bup-16",children:a.house.name}),/* @__PURE__ */d(Al,{numberOfMonths:l,numberOfMonthsInARow:f,house:a.house})]})})}function Pl({portalSite:e}){const{bookingStarted:t}=o(mu);/* @__PURE__ */
176
+ return d(t?dl:$l,{portalSite:e})}function Dl({portalSite:e}){const{portalCode:t,objectCode:n,locale:r}=o(zs);return i(()=>{ul(`house_view:${n}`)&&Bc({house_code:n,portal_code:t,locale:r,interaction_type:"house_view",interaction_info:{entry:Yc()}})},[n,t,r]),/* @__PURE__ */d(_u,{children:/* @__PURE__ */d(Pl,{portalSite:e})})}async function Ll({portalCode:e,objectCode:t,apiUrl:n="",after:r}){const o=new URLSearchParams({portal_code:e,object_code:t});r&&o.set("after",r);const i=`${n?new URL(n).origin:""}/portal_api/v1/accommodations/reviews?${o.toString()}`;try{const e=await fc.get(i).json();return{house:{id:"",name:e.house.name,rating:Number(e.house.rating),scoreAmount:Number(e.house.score_amount),reviews:e.items.map(e=>({id:"",name:e.name,review:e.review,score:Number(e.score),createdAt:e.created_at,sourceName:e.source_name??"",reviewResponses:e.review_responses??[],reviewCriteria:(e.review_criteria??[]).map(e=>({id:0,name:e.name,score:Number(e.score)}))}))},pageInfo:e.page_info}}catch(s){if(s instanceof Xs)throw new Error(`Reviews request failed (${s.response.status})`);throw s}}function jl(e){return e>7?"best":e>6?"good":e>4?"medium":"low"}function Ul(e){return{color:jl(e),formatted:e%1==0?String(e):e.toFixed(1)}}function Ml(e,t){const n=document.createElement("div");return e&&(n.className=e),t&&(n.textContent=t),n}function Ol(e){const t=Ml("bu_reviews bup-16"),n=Ml("bu_reviews__overview bup-16 bu_card"),r=Ml("bu_score");if(e.rating){const t=Ul(e.rating),n=Ml(`bu_score__rating bu_card ${t.color}`);n.textContent=t.formatted,r.appendChild(n)}const o=Ml("bu_reviews__overview__number",`${e.scoreAmount} ${ne("reviews")}`);return n.appendChild(r),n.appendChild(o),t.appendChild(n),e.reviews.forEach(e=>{const n=function(e){const t=Ul(e.score);return{id:e.id,name:e.name,createdAt:e.createdAt,review:e.review,color:t.color,formatted:t.formatted,sourceName:e.sourceName,reviewResponses:e.reviewResponses,criteria:e.reviewCriteria.map(e=>{const t=Ul(e.score);return{id:e.id,name:e.name,score:e.score,color:t.color,formatted:t.formatted}})}}(e),r=Ml("bu_single_review bup-16 bu_card"),o=Ml("bu_review_summary"),i=Ml("bu_score");if(e.score){const e=Ml(`bu_score__rating bu_card ${n.color}`,n.formatted);i.appendChild(e)}const s=Ml("bu_review_summary__date_name"),a=Ml(void 0,`${Te(n.createdAt)}, `),c=Ml("bu_review_summary__name",n.name);if(s.appendChild(a),s.appendChild(c),o.appendChild(i),o.appendChild(s),n.sourceName){const e=Ml("bu_review_summary__source",n.sourceName);o.appendChild(e)}if(r.appendChild(o),n.review){const e=document.createElement("blockquote");e.className="bu_review",e.textContent=n.review,r.appendChild(e)}if(n.criteria.length>0){const e=Ml("bu_criteria");n.criteria.forEach(t=>{const n=Ml("bu_score");if(t.score){const e=Ml(`bu_score__rating bu_card ${t.color}`,t.formatted);n.appendChild(e)}n.appendChild(Ml(void 0,t.name)),e.appendChild(n)}),r.appendChild(e)}if(n.reviewResponses?.length>0){const e=Ml("bu_review_responses");n.reviewResponses.forEach(t=>{const n=Ml("bu_review_response"),r=Ml("bu_review_response__label",ne("review_response_label")),o=Ml("bu_review_response__header"),i=Te(t.created_at);o.appendChild(Ml("bu_review_response__sender",t.sender)),o.appendChild(Ml("bu_review_response__date",i));const s=document.createElement("p");s.className="bu_review_response__message",s.textContent=t.message,n.appendChild(r),n.appendChild(o),n.appendChild(s),e.appendChild(n)}),r.appendChild(e)}t.appendChild(r)}),t}function Il({house:e}){const t=c(null);return i(()=>{var n,r;if(t.current)return n=t.current,r=()=>Ol(e),n.replaceChildren(r()),()=>{n.replaceChildren()}},[e]),/* @__PURE__ */d("div",{ref:t})}function ql({objectCode:e,portalCode:t,apiUrl:n}){const[r,o]=u({status:"loading"}),s=c(!0);if(i(()=>(s.current=!0,()=>{s.current=!1}),[]),i(()=>{let r=!0;return o({status:"loading"}),Ll({portalCode:t,objectCode:e,apiUrl:n}).then(({house:e,pageInfo:t})=>{r&&o({status:"ready",house:e,endCursor:t.end_cursor,hasNextPage:t.has_next_page})}).catch(e=>{r&&o({status:"error",error:e instanceof Error?e:new Error(String(e))})}),()=>{r=!1}},[t,e,n]),"loading"===r.status)/* @__PURE__ */return d("div",{children:/* @__PURE__ */d(p,{})});if("error"===r.status)/* @__PURE__ */return d("div",{className:"bukazu-error-message","data-testid":"error",children:/* @__PURE__ */d("h2",{children:ne("something_went_wrong_please_try_again")})});const a=r.house,f="ready"===r.status&&r.hasNextPage,m="loading_more"===r.status;/* @__PURE__ */
163
177
  return h(l,{children:[
164
- /* @__PURE__ */d(qu,{house:a}),m&&/* @__PURE__ */d("div",{children:/* @__PURE__ */d(p,{})}),!m&&f&&/* @__PURE__ */d("button",{type:"button",className:"bu_load_more",onClick:function(){if("ready"!==r.status||!r.hasNextPage)return;const s=r.house,a=r.endCursor;o({status:"loading_more",house:s,endCursor:a}),Uu({portalCode:t,objectCode:e,apiUrl:n,after:a??void 0}).then(({house:e,pageInfo:t})=>{i.current&&o({status:"ready",house:{...s,reviews:[...s.reviews,...e.reviews]},endCursor:t.end_cursor,hasNextPage:t.has_next_page})}).catch(e=>{i.current&&o({status:"error",error:e instanceof Error?e:new Error(String(e))})})},children:Q("load_more_reviews")}),
165
- /* @__PURE__ */d("div",{className:"bu_reviews__note",children:/* @__PURE__ */d("a",{href:"https://www.bukazu.com",target:"_blank",rel:"noopener noreferrer",children:Q("reviews_note_link")})})]})}var Fu={nl:{url:"http://bukazu.com/veiligheid",label:"Beveiligd en mogelijk gemaakt door BUKAZU"},en:{url:"http://bukazu.com/en/security",label:"Secured and made possible by BUKAZU"},de:{url:"http://bukazu.com/de/sicherheit",label:"Gesichert und ermöglicht durch BUKAZU"},fr:{url:"http://bukazu.com/fr/securite",label:"Sécurisé et rendu possible par BUKAZU"},es:{url:"http://bukazu.com/es/seguridad",label:"Asegurado y hecho posible por BUKAZU"},it:{url:"http://bukazu.com/it/sicurezza",label:"Protetto e reso possibile da BUKAZU"}};function zu(e){const{url:t,label:n}=Object.prototype.hasOwnProperty.call(Fu,e)?Fu[e]:Fu.en;return`<div class="bu-safe-booking"><a href="${t}" class="bu-safe-booking-link"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" x="0px" y="0px" viewBox="0 0 100 100" enable-background="new 0 0 100 100" xml:space="preserve" width="16px" height="16px" class="bu-safe-booking-icon"><path d="M75.98,41.62h-2.47L73.5,29.31C73.49,15.9,62.58,4.99,49.17,5C35.76,5.01,24.85,15.92,24.86,29.33l0.02,12.31H24 c-4.61,0.01-8.35,3.75-8.34,8.36v36.65c0,4.61,3.75,8.35,8.36,8.35L76,94.97c4.61,0,8.35-3.74,8.34-8.35V49.96 C84.34,45.35,80.59,41.62,75.98,41.62z M33.84,41.64l-0.02-12.31c0-8.47,6.88-15.36,15.35-15.37c8.47,0,15.36,6.89,15.36,15.35 l0.02,12.31L33.84,41.64z" /></svg>${n}</a></div>`}var Hu=class extends e.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,t){Js(e)}render(){return this.state.hasError?/* @__PURE__ */d("h1",{children:"Something went wrong."}):this.props.children}};function Yu(e,t,n){const r=new URL(`/portal_api/v1/config/${t}`,new URL(e).origin);return r.search=new URLSearchParams({portal_code:n}).toString(),r.toString()}async function Wu(e,t){try{return await Ea.get(e,{headers:{locale:t}}).json()}catch(n){if(n instanceof ui)throw new Error(`Portal settings request failed (${n.response.status})`);throw n}}function Ju({apiUrl:e,locale:t,portalCode:n}){return Wu(function({apiUrl:e,portalCode:t}){return Yu(e,"settings",t)}({apiUrl:e,portalCode:n}),t)}function Ku({apiUrl:e,locale:t,portalCode:n}){return Wu(function({apiUrl:e,portalCode:t}){return Yu(e,"booking-fields",t)}({apiUrl:e,portalCode:n}),t)}function Vu({apiUrl:e,locale:t,portalCode:n}){return Wu(function({apiUrl:e,portalCode:t}){return Yu(e,"filter-fields",t)}({apiUrl:e,portalCode:n}),t)}function Xu(e,t){const n=`_${t}`,r=e??{},o={};return Object.keys(r).forEach(e=>{e.endsWith(n)&&(o[e.slice(0,-n.length)]=r[e])}),o}function Gu(e){const{results_amount:t,no_results:n,...r}=e,o=Number(t??n);return{...r,no_results:Number.isFinite(o)&&o>0?o:20}}async function Qu({portalCode:e,isSearchPage:t,isBookingPage:n,apiUrl:r,locale:o}){const s=Ju({apiUrl:r,locale:o,portalCode:e}),i=t?Vu({apiUrl:r,locale:o,portalCode:e}):Promise.resolve(void 0),a=n?Ku({apiUrl:r,locale:o,portalCode:e}):Promise.resolve(void 0),[c,u,l]=await Promise.all([s,i,a]);if(!c)throw new Error("Portal site data is missing");return function({settings:e,filterFields:t,bookingFields:n,locale:r}){const o=(n??[]??[]).map(e=>({id:e.id,label:e.label,field_type:e.field_type,type:e.field_type,options:e.field_options,required:e.required,placeholder:e.placeholder})),s=(c=t??[],(c??[]).map(e=>({id:e.id,type:e.field_type,label:e.label,...void 0!==e.max&&{max:e.max},...void 0!==e.options&&{options:e.options}}))),i=e.colors,a={filtersForm:Gu(e.filters_form),bookingFields:o,searchFields:void 0!==t?s:void 0,bookingForm:{},colors:i};var c;return{name:e.name,portal_code:e.portal_code,options:a,colorsConfiguration:i,currencies:ri(e.currencies),bookingFormConfiguration:e.booking_form,booking_fields:o,max_persons:0,max_bedrooms:0,max_bathrooms:0,max_weekprice:0,...Xu(e.labels,r)}}({settings:c,filterFields:u,bookingFields:l,locale:o})}function Zu({pageType:e,locale:t,filters:n={}}){const{portalCode:r,objectCode:i,apiUrl:a,locale:c}=o(ti),[l,f]=u({status:"loading"}),m=!i,g=!!i&&"reviews"!==e;if(s(()=>{let e=!0;f({status:"loading"});const t=G(c);return Qu({portalCode:r,isSearchPage:m,isBookingPage:g,apiUrl:a,locale:c}).then(async n=>{await t,e&&f({status:"ready",portalSite:n})}).catch(async n=>{if(await t,!e)return;const r=n instanceof Error?n:/* @__PURE__ */new Error("A portal settings request failed");f({status:"error",error:r})}),()=>{e=!1}},[r,m,g,a,c]),"loading"===l.status)/* @__PURE__ */return d(p,{});if("error"===l.status)/* @__PURE__ */return d(Gs,{errors:l.error});const _=l.portalSite;let y=_.options;const v=_.colorsConfiguration,b=document.documentElement;let w;return b.style.setProperty("--bukazu-discount",v.discount),b.style.setProperty("--bukazu-cell",v.cell),b.style.setProperty("--bukazu-arrival",v.arrival),b.style.setProperty("--bukazu-booked",v.booked),b.style.setProperty("--bukazu-departure",v.departure),b.style.setProperty("--bukazu-button",v.button),b.style.setProperty("--bukazu-button_cta",v.button_cta),w=i&&null!==i&&"reviews"!==e?/* @__PURE__ */h(Hu,{children:[/* @__PURE__ */d(Lu,{portalSite:_}),/* @__PURE__ */d("div",{dangerouslySetInnerHTML:{__html:zu(t)}})]}):i&&null!==i&&"reviews"===e?/* @__PURE__ */d(Bu,{objectCode:i,portalCode:r,apiUrl:a}):/* @__PURE__ */d(nc,{PortalSite:_,locale:t,options:y,filters:n}),/* @__PURE__ */d(si,{currencies:_.currencies,children:w})}function el({portalCode:e,objectCode:t,pageType:n,locale:r,filters:o,api_url:i="https://api.bukazu.com",sentryDsn:a}){const c=Zs(r);s(()=>{var n;a&&(n=a,void 0===Kt()&&Ys({dsn:n,integrations:e=>e.filter(e=>"GlobalHandlers"!==e.name)})),Ws({portalCode:e,objectCode:t,locale:c})},[a,e,t,c]),s(()=>{window.__localeId__=c,async function(){}()},[c]);const u=function({portalCode:e,pageType:t,locale:n,filters:r}){let o=[];if(!e){let e="No portal code is specified, so portal is not working";o.push(e)}if(t&&"reviews"!==t){let e=`'${t}' is not a valid page`;o.push(e)}n&&(Zs(n),n.toLowerCase().split(/[-_]/)[0]);r&&ei(r);const i=JSON.stringify(o);return s(()=>{o.forEach(e=>Ks(e))},[i]),0!==o.length&&/* @__PURE__ */h("div",{children:[/* @__PURE__ */d("h2",{children:"Something went wrong please try again "}),/* @__PURE__ */d("ul",{children:o.map(e=>/* @__PURE__ */d("li",{children:e},e))})]})}({portalCode:e,pageType:n,locale:c,filters:o});return u||/* @__PURE__ */d(ti.Provider,{value:{portalCode:e,objectCode:t,locale:c,apiUrl:i},children:/* @__PURE__ */d("div",{className:"bu-portal",children:/* @__PURE__ */d(Zu,{pageType:n,locale:c,filters:o})})})}export{el as default};
178
+ /* @__PURE__ */d(Il,{house:a}),m&&/* @__PURE__ */d("div",{children:/* @__PURE__ */d(p,{})}),!m&&f&&/* @__PURE__ */d("button",{type:"button",className:"bu_load_more",onClick:function(){if("ready"!==r.status||!r.hasNextPage)return;const i=r.house,a=r.endCursor;o({status:"loading_more",house:i,endCursor:a}),Ll({portalCode:t,objectCode:e,apiUrl:n,after:a??void 0}).then(({house:e,pageInfo:t})=>{s.current&&o({status:"ready",house:{...i,reviews:[...i.reviews,...e.reviews]},endCursor:t.end_cursor,hasNextPage:t.has_next_page})}).catch(e=>{s.current&&o({status:"error",error:e instanceof Error?e:new Error(String(e))})})},children:ne("load_more_reviews")}),
179
+ /* @__PURE__ */d("div",{className:"bu_reviews__note",children:/* @__PURE__ */d("a",{href:"https://www.bukazu.com",target:"_blank",rel:"noopener noreferrer",children:ne("reviews_note_link")})})]})}var Bl={nl:{url:"http://bukazu.com/veiligheid",label:"Beveiligd en mogelijk gemaakt door BUKAZU"},en:{url:"http://bukazu.com/en/security",label:"Secured and made possible by BUKAZU"},de:{url:"http://bukazu.com/de/sicherheit",label:"Gesichert und ermöglicht durch BUKAZU"},fr:{url:"http://bukazu.com/fr/securite",label:"Sécurisé et rendu possible par BUKAZU"},es:{url:"http://bukazu.com/es/seguridad",label:"Asegurado y hecho posible por BUKAZU"},it:{url:"http://bukazu.com/it/sicurezza",label:"Protetto e reso possibile da BUKAZU"}};function Fl(e){const{url:t,label:n}=Object.prototype.hasOwnProperty.call(Bl,e)?Bl[e]:Bl.en;return`<div class="bu-safe-booking"><a href="${t}" class="bu-safe-booking-link"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" x="0px" y="0px" viewBox="0 0 100 100" enable-background="new 0 0 100 100" xml:space="preserve" width="16px" height="16px" class="bu-safe-booking-icon"><path d="M75.98,41.62h-2.47L73.5,29.31C73.49,15.9,62.58,4.99,49.17,5C35.76,5.01,24.85,15.92,24.86,29.33l0.02,12.31H24 c-4.61,0.01-8.35,3.75-8.34,8.36v36.65c0,4.61,3.75,8.35,8.36,8.35L76,94.97c4.61,0,8.35-3.74,8.34-8.35V49.96 C84.34,45.35,80.59,41.62,75.98,41.62z M33.84,41.64l-0.02-12.31c0-8.47,6.88-15.36,15.35-15.37c8.47,0,15.36,6.89,15.36,15.35 l0.02,12.31L33.84,41.64z" /></svg>${n}</a></div>`}var zl=class extends e.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,t){js(e)}render(){return this.state.hasError?/* @__PURE__ */d("h1",{children:"Something went wrong."}):this.props.children}};function Hl(e,t,n){const r=new URL(`/portal_api/v1/config/${t}`,new URL(e).origin);return r.search=new URLSearchParams({portal_code:n}).toString(),r.toString()}async function Yl(e,t){try{return await fc.get(e,{headers:{locale:t}}).json()}catch(n){if(n instanceof Xs)throw new Error(`Portal settings request failed (${n.response.status})`);throw n}}function Wl({apiUrl:e,locale:t,portalCode:n}){return Yl(function({apiUrl:e,portalCode:t}){return Hl(e,"settings",t)}({apiUrl:e,portalCode:n}),t)}function Jl({apiUrl:e,locale:t,portalCode:n}){return Yl(function({apiUrl:e,portalCode:t}){return Hl(e,"booking-fields",t)}({apiUrl:e,portalCode:n}),t)}function Vl({apiUrl:e,locale:t,portalCode:n}){return Yl(function({apiUrl:e,portalCode:t}){return Hl(e,"filter-fields",t)}({apiUrl:e,portalCode:n}),t)}function Kl(e,t){const n=`_${t}`,r=e??{},o={};return Object.keys(r).forEach(e=>{e.endsWith(n)&&(o[e.slice(0,-n.length)]=r[e])}),o}function Gl(e){const{results_amount:t,no_results:n,...r}=e,o=Number(t??n);return{...r,no_results:Number.isFinite(o)&&o>0?o:20}}async function Xl({portalCode:e,isSearchPage:t,isBookingPage:n,apiUrl:r,locale:o}){const i=Wl({apiUrl:r,locale:o,portalCode:e}),s=t?Vl({apiUrl:r,locale:o,portalCode:e}):Promise.resolve(void 0),a=n?Jl({apiUrl:r,locale:o,portalCode:e}):Promise.resolve(void 0),[c,u,l]=await Promise.all([i,s,a]);if(!c)throw new Error("Portal site data is missing");return function({settings:e,filterFields:t,bookingFields:n,locale:r}){const o=(n??[]??[]).map(e=>({id:e.id,label:e.label,field_type:e.field_type,type:e.field_type,options:e.field_options,required:e.required,placeholder:e.placeholder})),i=(c=t??[],(c??[]).map(e=>({id:e.id,type:e.field_type,label:e.label,...void 0!==e.max&&{max:e.max},...void 0!==e.options&&{options:e.options}}))),s=e.colors,a={filtersForm:Gl(e.filters_form),bookingFields:o,searchFields:void 0!==t?i:void 0,bookingForm:{},colors:s};var c;return{name:e.name,portal_code:e.portal_code,options:a,colorsConfiguration:s,currencies:Ys(e.currencies),bookingFormConfiguration:e.booking_form,booking_fields:o,max_persons:0,max_bedrooms:0,max_bathrooms:0,max_weekprice:0,...Kl(e.labels,r)}}({settings:c,filterFields:u,bookingFields:l,locale:o})}function Ql({pageType:e,locale:t,filters:n={}}){const{portalCode:r,objectCode:s,apiUrl:a,locale:c}=o(zs),[l,f]=u({status:"loading"}),m=!s,g=!!s&&"reviews"!==e;if(i(()=>{let e=!0;f({status:"loading"});const t=te(c);return Xl({portalCode:r,isSearchPage:m,isBookingPage:g,apiUrl:a,locale:c}).then(async n=>{await t,e&&f({status:"ready",portalSite:n})}).catch(async n=>{if(await t,!e)return;const r=n instanceof Error?n:/* @__PURE__ */new Error("A portal settings request failed");f({status:"error",error:r})}),()=>{e=!1}},[r,m,g,a,c]),"loading"===l.status)/* @__PURE__ */return d(p,{});if("error"===l.status)/* @__PURE__ */return d(Is,{errors:l.error});const _=l.portalSite;let y=_.options;const v=_.colorsConfiguration,b=document.documentElement;let w;return b.style.setProperty("--bukazu-discount",v.discount),b.style.setProperty("--bukazu-cell",v.cell),b.style.setProperty("--bukazu-arrival",v.arrival),b.style.setProperty("--bukazu-booked",v.booked),b.style.setProperty("--bukazu-departure",v.departure),b.style.setProperty("--bukazu-button",v.button),b.style.setProperty("--bukazu-button_cta",v.button_cta),w=s&&null!==s&&"reviews"!==e?/* @__PURE__ */h(zl,{children:[/* @__PURE__ */d(Dl,{portalSite:_}),/* @__PURE__ */d("div",{dangerouslySetInnerHTML:{__html:Fl(t)}})]}):s&&null!==s&&"reviews"===e?/* @__PURE__ */d(ql,{objectCode:s,portalCode:r,apiUrl:a}):/* @__PURE__ */d(Xc,{PortalSite:_,locale:t,options:y,filters:n}),/* @__PURE__ */d(Js,{currencies:_.currencies,children:w})}function Zl({portalCode:e,objectCode:t,pageType:n,locale:r,filters:o,api_url:s="https://api.bukazu.com",sentryDsn:a}){const c=Bs(r);i(()=>{var n;a&&(n=a,void 0===Mn()&&Ds({dsn:n,integrations:e=>e.filter(e=>"GlobalHandlers"!==e.name)})),Ls({portalCode:e,objectCode:t,locale:c})},[a,e,t,c]),i(()=>{window.__localeId__=c,async function(){}()},[c]);const u=function({portalCode:e,pageType:t,locale:n,filters:r}){let o=[];if(!e){let e="No portal code is specified, so portal is not working";o.push(e)}if(t&&"reviews"!==t){let e=`'${t}' is not a valid page`;o.push(e)}n&&(Bs(n),n.toLowerCase().split(/[-_]/)[0]);r&&Fs(r);const s=JSON.stringify(o);return i(()=>{o.forEach(e=>Us(e))},[s]),0!==o.length&&/* @__PURE__ */h("div",{children:[/* @__PURE__ */d("h2",{children:"Something went wrong please try again "}),/* @__PURE__ */d("ul",{children:o.map(e=>/* @__PURE__ */d("li",{children:e},e))})]})}({portalCode:e,pageType:n,locale:c,filters:o});return u||/* @__PURE__ */d(zs.Provider,{value:{portalCode:e,objectCode:t,locale:c,apiUrl:s},children:/* @__PURE__ */d("div",{className:"bu-portal",children:/* @__PURE__ */d(Ql,{pageType:n,locale:c,filters:o})})})}export{Zl as default};