"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9668],{59668:function(n,e,t){t.d(e,{OFs:function(){return i},hAJ:function(){return r},eR8:function(){return q},neo:function(){return T},s_o:function(){return m},gzE:function(){return b},KM0:function(){return s},_FE:function(){return o},qvv:function(){return $},VTK:function(){return k},rDn:function(){return j},SCv:function(){return N},XH6:function(){return _},s2h:function(){return g},bXR:function(){return A},Iox:function(){return x},y9g:function(){return I}});let a="\n  fragment reservations on reservations {\n    id\n    created_at\n    updated_at\n    status\n    guest_id\n    metadata\n    provider\n    type\n    itinerary_id\n    order_reference\n    payment_reference\n    member_id\n    property_name\n    property_id\n    property_shortcode\n    cancel_reason\n    cancel_description\n    lang\n    checkin\n    checkout\n    total\n    subtotal\n    taxes\n    currency\n    exchange_rate\n    request_currency\n    fee\n    pay_now\n    pay_later\n    totals\n    payments\n    payment_method\n    adults\n    children\n    infants\n    nights\n    coupon\n    fee_percentage\n    taxes_exclusive\n    occupancy\n    rooms\n    current_step\n    error_message\n    voucher_sent\n    subtotal_extras\n    taxes_extras\n    total_extras\n    pay_now_with_extras\n    pay_later_with_extras\n    cancel_date\n    cancel_voucher_sent\n    cancel_transaction_fee\n    cancel_refund\n    payment_provider\n  }\n",r="\n  query reservations(\n    $where: reservations_bool_exp\n    $limit: Int\n    $offset: Int\n    $order_by: [reservations_order_by!]\n  ) {\n    reservations(\n      where: $where\n      limit: $limit\n      offset: $offset\n      order_by: $order_by\n    ) {\n      ...reservations\n    }\n  }\n\n  ".concat(a,"\n"),i="\n  query reservations_by_pk($id: uuid!) {\n    reservations_by_pk(id: $id) {\n      ...reservations\n    }\n  }\n\n  ".concat(a,"\n"),o="\n  mutation insert_reservations_one($object: reservations_insert_input!) {\n    insert_reservations_one(object: $object) {\n      id\n    }\n  }\n",_="\n  mutation update_reservations($where: reservations_bool_exp!, $set: reservations_set_input!) {\n    update_reservations(where: $where, _set: $set) {\n      affected_rows\n    }\n  }\n",s="\n  mutation insert_guests_one($object: guests_insert_input!) {\n    insert_guests_one(object: $object) {\n      id\n    }\n  }\n",c="\n  fragment properties on properties {\n    id\n    created_at\n    updated_at\n    name\n    website_id\n    shortcode\n    type\n    verified\n    last_sync\n    zavia_id\n    guruhotels_enabled\n    guruhotels_subdomain\n    country_id\n    state_id\n    city_id\n  }\n",d="\n  fragment websites on websites {\n    id\n    created_at\n    updated_at\n    property_id\n    theme\n    name\n    gmb\n    domain\n    emails\n    phones\n    site_id\n    tracking_codes\n    subdomain\n    custom_domain\n    current_state\n    cloudflare_id\n    verified\n    customizer\n    notifications\n    general_codes\n    posthog_dashboard_id\n    posthog_sharing_url\n    only_checkout\n    enable_pay_due\n  }\n";"\n  query websites(\n    $where: websites_bool_exp\n    $limit: Int\n    $offset: Int\n    $order_by: [websites_order_by!]\n  ) {\n    websites(\n      where: $where\n      limit: $limit\n      offset: $offset\n      order_by: $order_by\n    ) {\n      ...websites\n      property {\n        ...properties\n      }\n    }\n  }\n\n  ".concat(c,"\n  ").concat(d,"\n"),"\n  query websites_by_pk($id: uuid!) {\n    websites_by_pk(id: $id) {\n      ...websites\n      property {\n        ...properties\n      }\n    }\n  }\n\n  ".concat(c,"\n  ").concat(d,"\n");let l="\n  fragment engine_cancellation_penalties on engine_cancellation_penalties {\n    id\n    created_at\n    updated_at\n    days_before_arrival\n    rate\n    logic\n    author_id\n  }\n",u="\n  fragment engine_no_show_penalties on engine_no_show_penalties {\n    id\n    created_at\n    updated_at\n    rate\n    logic\n    author_id\n  }\n",p="\n  ".concat(l,"\n  ").concat(u,"\n\n  fragment engine_cancellation_policies on engine_cancellation_policies {\n    id\n    created_at\n    updated_at\n    name\n    description\n    is_refundable\n    author_id\n    property_id\n    no_show_penalty_id\n    no_show_penalty {\n      ...engine_no_show_penalties\n    }\n    cancellation_penalties {\n      ...engine_cancellation_penalties\n    }\n  }\n");"\n  ".concat(p,"\n  ").concat(l,"\n  ").concat(u,"\n\n  query engine_cancellation_policies(\n    $where: engine_cancellation_policies_bool_exp\n    $limit: Int\n    $offset: Int\n    $order_by: [engine_cancellation_policies_order_by!]\n  ) {\n    engine_cancellation_policies(\n      where: $where\n      limit: $limit\n      offset: $offset\n      order_by: $order_by\n    ) {\n      ...engine_cancellation_policies\n      cancellation_penalties {\n        ...engine_cancellation_penalties\n      }\n      no_show_penalty {\n        ...engine_no_show_penalties\n      }\n    }\n  }\n");let m="\n  query engine_products(\n    $where: engine_products_bool_exp\n    $limit: Int\n    $offset: Int\n    $order_by: [engine_products_order_by!]\n  ) {\n    engine_products(\n      where: $where\n      limit: $limit\n      offset: $offset\n      order_by: $order_by\n    ) {\n      ...engine_products\n    }\n  }\n\n  ".concat("\n  fragment engine_products on engine_products {\n    id\n    created_at\n    updated_at\n    name\n    description\n    currency\n    rate\n    product_category_id\n    property_id\n    images\n    sold\n    inventory\n  }\n","\n"),g="\n  mutation update_engine_products($where: engine_products_bool_exp!, $object: engine_products_set_input!) {\n    update_engine_products(where: $where, _set: $object) {\n      affected_rows\n    }\n  }\n",y="\n  ".concat("\n  fragment libraries_meal_plans on libraries_meal_plans {\n    id\n    name\n  }\n","\n  ").concat(p,"\n\n  fragment engine_rate_plans on engine_rate_plans {\n    id\n    created_at\n    updated_at\n    name\n    description\n    includes_meal_plan\n    cancellation_policy_id\n    meal_plan_id\n    meal_plan {\n      ...libraries_meal_plans\n    }\n    cancellation_policy {\n      ...engine_cancellation_policies\n    }\n  }\n"),f="\n  fragment engine_rates on engine_rates {\n    id\n    created_at\n    updated_at\n    date\n    rate\n    room_rate_plan_id\n    rate_extra_adult\n    rate_extra_child\n  }\n",h="\n  fragment engine_restrictions on engine_restrictions {\n    id\n    created_at\n    updated_at\n    date\n    room_rate_plan_id\n    closed_to_arrival\n    closed_to_departure\n    max_stay\n    min_stay_arrival\n    min_stay_through\n    stop_sell\n    property_id\n  }\n";"\n  ".concat(y,"\n  ").concat("\n  fragment engine_availability on engine_availability {\n    id\n    created_at\n    updated_at\n    date\n    inventory\n    sold\n    room_id\n  }\n","\n  ").concat(f,"\n  ").concat(h,"\n\n  fragment engine_rooms on engine_rooms {\n    id\n    created_at\n    updated_at\n    name\n    description\n    image\n    max_inventory\n    max_occupancy\n    max_adults\n    max_children\n    availability {\n      ...engine_availability\n    }\n    rooms_rate_plans {\n      id\n      active\n      rate_plan {\n        ...engine_rate_plans\n      }\n      rates {\n        ...engine_rates\n      }\n      restrictions {\n        ...engine_restrictions\n      }\n    }\n    content_room_id\n    base_occupancy\n    base_rate\n    base_rate_extra_adult\n    base_rate_extra_child\n  }\n"),"\n  ".concat(f,"\n  ").concat(y,"\n  ").concat(h,"\n\n  fragment engine_rooms_rate_plans on engine_rooms_rate_plans {\n    id\n    created_at\n    updated_at\n    rate_plan_id\n    room_id\n    active\n    rate_plan {\n      ...engine_rate_plans\n    }\n    rates(where: { date: { _gte: $startDate, _lte: $endDate } }) {\n      ...engine_rates\n    }\n    restrictions(where: { date: { _gte: $startDate, _lte: $endDate } }) {\n      ...engine_restrictions\n    }\n  }\n");let b="\n  ".concat("\n  fragment engine_settings on engine_settings {\n    id\n    created_at\n    updated_at\n    currency\n    property_id\n    pay_online\n    pay_at_hotel\n    deposit\n    price_configuration\n    only_adults\n    max_age_children\n    max_age_infants\n    products_fee\n  }\n","\n\n  query engine_settings(\n    $where: engine_settings_bool_exp\n    $limit: Int\n    $offset: Int\n    $order_by: [engine_settings_order_by!]\n  ) {\n    engine_settings(\n      where: $where\n      limit: $limit\n      offset: $offset\n      order_by: $order_by\n    ) {\n      ...engine_settings\n    }\n  }\n"),$="\n  mutation insert_transactions_one($object: transactions_insert_input!) {\n    insert_transactions_one(object: $object) {\n      id\n    }\n  }\n";"\n  ".concat("\n  fragment engine_bookings_itineraries_rooms on engine_bookings_itineraries_rooms {\n    id\n    created_at\n    updated_at\n    room_id\n    rate_plan_id\n    property_id\n    itinerary_id\n    adults\n    children\n    children_ages\n    status\n    subtotal\n    total\n    taxes_exclusive\n    taxes_inclusive\n    cancellation_policy\n    cancellation_date\n    is_refundable\n    no_show_penalty\n    cancellation_penalty\n    cancellation_penalty_refund\n  }\n","\n  ").concat("\n  fragment engine_bookings_itineraries_payments on engine_bookings_itineraries_payments {\n    id\n    created_at\n    updated_at\n    status\n    amount\n    currency\n    method\n    payment_reference\n    order_reference\n    itinerary_token\n    guest_id\n  }\n","\n  ").concat("\n  fragment engine_bookings_itineraries_guests on engine_bookings_itineraries_guests {\n    id\n    created_at\n    updated_at\n    first_name\n    last_name\n    email\n    phone\n    phone_code\n    address\n    address_line_2\n    country\n    state\n    city\n    zip_code\n    itinerary_token\n  }\n","\n\n  fragment engine_bookings_itineraries on engine_bookings_itineraries {\n    id\n    created_at\n    updated_at\n    token\n    status\n    property_id\n    subtotal_rooms\n    taxes_rooms_inclusive\n    taxes_rooms_exclusive\n    taxes_inclusive_reservation\n    taxes_exclusive_reservation\n    total_rooms\n    currency\n    lang\n    checkin\n    checkout\n    metadata\n    payment_status\n    itinerary_id\n    cancellation_date\n    rooms {\n      ...engine_bookings_itineraries_rooms\n    }\n    payments {\n      ...engine_bookings_itineraries_payments\n    }\n    guests {\n      ...engine_bookings_itineraries_guests\n    }\n  }\n");let w="https://api.guruhotel.dev/v1/graphql",v="ZquM2I4b4*z3";if(!w)throw Error("Missing PROPERTY_DATA_ENDPOINT env var");if(!v)throw Error("Missing PROPERTY_DATA_SECRET env var");async function x(n){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"no-cache",a=await fetch(w,{method:"POST",headers:{"Content-Type":"application/json","X-Hasura-Admin-Secret":v},body:JSON.stringify({query:n,variables:e}),cache:t}),{data:r,errors:i}=await a.json();return{data:r,errors:i}}let k="\n  query countries(\n    $where: countries_bool_exp\n    $limit: Int\n    $offset: Int\n    $order_by: [countries_order_by!]\n  ) {\n    countries(\n      where: $where\n      limit: $limit\n      offset: $offset\n      order_by: $order_by\n    ) {\n      ...countries\n    }\n  }\n\n  ".concat("\n  fragment countries on countries {\n    id\n    iso2\n    iso3\n    name\n    native\n    phone_code\n  }\n","\n"),j="\n  query states(\n    $where: states_bool_exp\n    $limit: Int\n    $offset: Int\n    $order_by: [states_order_by!]\n  ) {\n    states(\n      where: $where\n      limit: $limit\n      offset: $offset\n      order_by: $order_by\n    ) {\n      ...states\n    }\n  }\n\n  ".concat("\n  fragment states on states {\n    country_code\n    country_name\n    country_id\n    id\n    name\n    state_code\n    type\n  }\n","\n"),E="https://payments.guruhotel.com/graphql",P="YHUdfGD67543na18mdfgsd512424Pdv628fva8FYHT4987TP";async function I(n){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"no-cache";if(!E)throw Error("PAYMENT_URL is not defined");if(!P)throw Error("PAYMENT_API_TOKEN is not defined");let a=await fetch(E,{method:"POST",headers:{"Content-Type":"application/json",Authorization:P},body:JSON.stringify({query:n,variables:e}),cache:t}),{data:r,errors:i}=await a.json();return{data:r,errors:i}}let T="\n  mutation createPayment($input: CreatePaymentInput!) {\n    createPayment(input: $input) {\n      result {\n        success\n        error\n        message\n      }\n      payment {\n        order_reference\n        payment_reference\n        monthly_installments\n        payment_method\n        status\n        amount_paid\n        createdAt\n        metadata\n        currency\n        client_info {\n          client_reference\n        }\n        account\n        account_currency\n        gurufee\n      }\n    }\n  }\n",A="\n  mutation updatePayment($input: UpdatePaymentInput!) {\n    updatePayment(input: $input) {\n      result {\n        success\n        error\n        message\n      }\n      payment {\n        metadata\n      }\n    }\n  }\n",q="\n  mutation cancelPayment($input: CancelPaymentInput!) {\n    cancelPayment(input: $input) {\n      result {\n        success\n        error\n        message\n      }\n      payment {\n        id\n        order_reference\n        payment_reference\n        amount_paid\n        amount_refunded\n        metadata\n      }\n    }\n  }\n",N="\n  mutation update_users($where: users_bool_exp!, $object: users_set_input!) {\n    update_users(where: $where, _set: $object) {\n      affected_rows\n    }\n  }\n";t(83100)},83100:function(n,e,t){t.d(e,{Z:function(){return i}});var a=t(68068),r=t.n(a);async function i(n,e,t,a){let i,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"no-cache",_="https://api.ean.com";if(!_)throw Error("Missing EPS_ENDPOINT env variable");let s=Object.entries(e).reduce((n,e)=>{let[t,a]=e;return Array.isArray(a)&&a.length>1?n.concat(a.map(n=>"".concat(t,"=").concat(n))):Array.isArray(a)?n.concat("".concat(t,"=").concat(a[0])):n.concat("".concat(t,"=").concat(a))},[]).join("&"),c=s?"".concat(_,"/v3/").concat(n,"?").concat(s):"".concat(_,"/v3/").concat(n),d=function(){let n="3tpj0aano9aerdg7o2ik2br9u1",e="cobjekac36h7j";if(!n)throw Error("Missing EPS_KEY");if(!e)throw Error("Missing EPS_SECRET");let t=Math.round(new Date().getTime()/1e3),a=r().createHash("sha512").update(n+e+t).digest("hex");return"EAN apikey=".concat(n,",signature=").concat(a,",timestamp=").concat(t)}();i=t?{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:d,"Customer-Ip":a},body:JSON.stringify(t)}:{headers:{"Content-Type":"application/json",Authorization:d,Accept:"application/json"}};let l=await fetch(c,{...i,cache:o});return await l.json()}}}]);