<!-- Error rendering component -->
<!-- Could not render component '@cart--parkings' - component not found. -->
<!-- Error: Could not render component '@cart--parkings' - component not found.
    at Object.render (/Users/antoniomatera/Sites/adb/node_modules/@frctl/handlebars/src/helpers/render.js:23:19)
    at Object.helperWrapper (/Users/antoniomatera/Sites/adb/node_modules/promised-handlebars/index.js:130:23)
    at Object.<anonymous> (/Users/antoniomatera/Sites/adb/node_modules/promised-handlebars/lib/utils.js:29:28)
    at Object.wrapper (/Users/antoniomatera/Sites/adb/node_modules/handlebars/dist/cjs/handlebars/internal/wrapHelper.js:15:19)
    at eval (eval at createFunctionContext (/Users/antoniomatera/Sites/adb/node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js:262:23), <anonymous>:15:102)
    at Object.prog (/Users/antoniomatera/Sites/adb/node_modules/handlebars/dist/cjs/handlebars/runtime.js:268:12)
    at Object.prepareAndResolveMarkers (/Users/antoniomatera/Sites/adb/node_modules/promised-handlebars/index.js:92:17)
    at Object.fn (/Users/antoniomatera/Sites/adb/node_modules/promised-handlebars/lib/utils.js:29:28)
    at fn (/Users/antoniomatera/Sites/adb/node_modules/handlebars-layouts/index.js:41:17)
    at Object.applyAction (/Users/antoniomatera/Sites/adb/node_modules/handlebars-layouts/index.js:54:11)
    at Array.reduce (<anonymous>)
    at Object.block (/Users/antoniomatera/Sites/adb/node_modules/handlebars-layouts/index.js:171:43)
    at Object.helperWrapper (/Users/antoniomatera/Sites/adb/node_modules/promised-handlebars/index.js:130:23)
    at Object.<anonymous> (/Users/antoniomatera/Sites/adb/node_modules/promised-handlebars/lib/utils.js:29:28)
    at Object.wrapper (/Users/antoniomatera/Sites/adb/node_modules/handlebars/dist/cjs/handlebars/internal/wrapHelper.js:15:19)
    at Object.eval [as main] (eval at createFunctionContext (/Users/antoniomatera/Sites/adb/node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js:262:23), <anonymous>:15:104) -->
{{#extend "@template-master--checkout"}}

  {{!-- HEADER --}}
  {{#content "header"}}
    {{ render "@header--progress" header merge=true }}
  {{/content}}

  {{!-- FOOTER --}}
  {{#content "footer"}}
  {{/content}}

  {{!-- MAIN --}}
	{{#content "main"}}
    
    {{ render "@booking-info--fullbleed" booking-info merge=true }}

    <div grid="grid" class="u-mt-space-16">
      <div grid="12 7@lg">
        <div>
          <h1 class="u-typo-level-4 u-color-night-100 u-typo-weight-bold">Scegli il tuo parcheggio</h1>
          <p class="u-typo-level-2 u-mt-space-16">Il costo della sosta è calcolato in base ai dati dichiarati in fase di ricerca. Il costo potrebbe variare in base alla reale durata della sosta.</p>
        </div>
      </div>
    </div>

    <div grid="grid" class="u-mt-space-24 u-mt-space-40@lg">
      <div grid="12 7@lg">
        {{ render "@parkings" }}
      </div>

      <div grid="12 5@lg">
        {{ render "@cart--parkings" cart merge=true }}
      </div>

    </div>

	{{/content}}

  {{!-- SCRIPTS JS --}}
  {{#content "scripts" mode="append"}}
    <script src="{{ path '/js/footer.min.js' }}"></script>
    <script>
      $.tangible.bookingInfo();
      $.tangible.shortcutNavigation();
      // $.tangible.navToolbar();
      
      // initialization flatpickr https://flatpickr.js.org/getting-started/
      // if browser language is italian, set flatpickr language to italian https://flatpickr.js.org/localization/
      var userLang = navigator.language || navigator.userLanguage;
      
      if (userLang == 'it-IT') {
        flatpickr.localize(flatpickr.l10ns.it);
      }
       
      // gestione abiliata/disabilita plugin mobile/desktop
      function flatPickrController() {
        var date_entrance = flatpickr("#entrance-date-time-desktop.js-flatpickr"),
            date_exit = flatpickr("#exit-date-time-desktop.js-flatpickr"),
            mobileBreakPoint = 1024;

            // se la viewport è maggiore di 1024 (display input desktop), inizializzo i flatpickr
            if ($(window).width() > mobileBreakPoint) {

              // parking form - enter
              var date_entrance = flatpickr("#entrance-date-time-desktop.js-flatpickr", {
                dateFormat: "d F Y H:i",
                enableTime: true,
                minDate: "today", 
                minuteIncrement: 15,
                allowInput:true,
                onChange: function(dateStr, dateObj){
                  date_exit.set("minDate", dateObj);
                },
                plugins: [new confirmDatePlugin({
                  confirmText: "Conferma "
                })]
              });

              // parking form - exit
              var date_exit = flatpickr("#exit-date-time-desktop.js-flatpickr", {
                dateFormat: "d F Y H:i",   
                enableTime: true,
                minuteIncrement: 15,
                allowInput:true,
                plugins: [new confirmDatePlugin({
                  confirmText: "Conferma "
                })]
              });

            } else {
              // disabilita il plugin flatpickr, utilizza input normali
              date_entrance.destroy();
              date_exit.destroy();
            }
      }

      // al caricamento e al resize, chiama la funzione che abilita o disabilita il plugin
      $(window).on('load resize', flatPickrController);
      
    // LOGICA FORM PARCHEGGI - set min date
    var $dateInput1 = $("#entrance-date-mobile"),
        $dateInput2 = $("#exit-date-mobile"),
        $dateInputDetail1 = $(".c-time-detail #entrance-date-mobile"),
        $dateInputDetail2 = $(".c-time-detail #exit-date-mobile"),
        $today = new Date().toISOString().split("T")[0];

        $.merge($dateInput1, $dateInput2).attr('min', $today);
        $.merge($dateInputDetail1, $dateInputDetail2).attr('value', $today);   

    // LOGICA FORM PARCHEGGI - validazione
    $("#entrance-date-mobile, #entrance-time-mobile, #exit-date-mobile, #exit-time-mobile").change( function() {

        var $dateInput1 = $("#entrance-date-mobile"),
            $dateInput2 = $("#exit-date-mobile"),
            $timeInput1 = $("#entrance-time-mobile"),
            $timeInput2 = $("#exit-time-mobile"),
            $noteField = $("#parking-form-note");

        var $date1 = new Date($dateInput1.val()),
            $date2 = new Date($dateInput2.val()),
            $dateParse1 = Date.parse($date1),
            $dateParse2 = Date.parse($date2),
            $time1 = $timeInput1.val(),
            $time2 = $timeInput2.val(),
            $entranceData = $dateParse1 + $time1,
            $exitData = $dateParse2 + $time2;

        if ($entranceData >= $exitData) {            
            $noteField.addClass('is-negative');
            $noteField.removeClass('u-visuallyhidden');
        } else {            
            $noteField.removeClass('is-negative');
            $noteField.addClass('u-visuallyhidden');
        }
    })
 
    // CHROME FIX - rimuove e aggiunge gli attributi required per gli input e le select dei form e-commerce
    function checkInputVisibility() {
      // breakpoint desktop-mobile
      var breakPoint = 1024,
          // input mobile
          mobileInput = $('.c-time-detail--mobile input, .c-time-detail--mobile select'),
          // input desktop
          desktopInput = $('.c-time-detail--desktop input, .c-time-detail--desktop select');

        if ($(window).width() > breakPoint) {
          desktopInput.attr('required','required');
          mobileInput.removeAttr('required');
        } else if ($(window).width() < breakPoint){
          desktopInput.removeAttr('required');
          mobileInput.attr('required','required');          
        }
    }

    // al caricamento e al resize della pagina
    $(window).on('resize load', checkInputVisibility);
 
    </script>
  {{/content}}

{{/extend}}
{
  "header": {
    "toolbarProgress": {
      "moleculeProgress": {
        "current-step": 1,
        "steps": [
          {
            "text": "Scegli parcheggio",
            "status": "data-step-current"
          },
          {
            "text": "Servizi aggiuntivi",
            "status": "data-step-incomplete"
          },
          {
            "text": "Pagamento",
            "status": "data-step-incomplete"
          },
          {
            "text": "Ricevi conferma",
            "status": "data-step-incomplete"
          }
        ]
      }
    }
  },
  "cart": {
    "showProduct": false,
    "showTelepassIcon": false,
    "noDiscount": false,
    "showModifyDates": false,
    "showProductRecap": true,
    "showAdditionals": true,
    "showAddons": false,
    "showCartTotal": true,
    "showCartCta": false,
    "hasLoading": false,
    "title": "Le tue prenotazioni",
    "additionals": [
      {
        "title": "La tua VIP Lounge",
        "btn-delete": false,
        "additional-type-name": "MBL VIP Lounge",
        "additional-type-img": "/images/oblo-mbl.png",
        "additional-recap-text": "Tariffa scontata VIP Lounge",
        "additional-price-full": "30,00 €",
        "additional-price-final": "24,00 €",
        "showModifyReservation": false,
        "showAdditionalCode": true,
        "lookOnMapLounge": {
          "modifier": "c-link c-link--spaceless",
          "text": "Mappa",
          "url": "#",
          "svg": {
            "symbol": "ic_open_in_new_24px",
            "class": "c-icon c-icon--16"
          }
        },
        "lookOnDetailsLounge": {
          "type": "button",
          "text": "Info parcheggio",
          "modifier": "c-button--as-link js-fr-dialogmodal-open",
          "opens-dialog": "dialog-p1-info",
          "aria-label": "Apri la modale per consultare la mappa del parcheggio",
          "svg": {
            "symbol": "ic-info-serif",
            "class": "c-icon--16"
          }
        },
        "parking-dialog-map": {
          "modifier": "",
          "id": "dialog-p1-map",
          "dialog-labelledby": "dialog-p1-p2-title",
          "title": "Informazioni sui parcheggi P1 e P2",
          "maplocation": "Parcheggio+P1,+40132+Bologna+BO",
          "mapzoom": "16",
          "mapwidth": "600",
          "mapheight": "300"
        },
        "parking-dialog-info": {
          "modifier": "",
          "id": "dialog-p1-info",
          "dialog-labelledby": "dialog-p1-p2-title",
          "title": "Informazioni sui parcheggi P1 e P2"
        }
      }
    ],
    "cartTotal": {
      "show": true,
      "label": "Totale della tariffa scontata pagando online",
      "netprice": "30,00 €",
      "price": "24,00 €"
    },
    "cartCta": {
      "type": "submit",
      "text": "Conferma i dati e prenota",
      "modifier": "c-button--submit c-button--elastic"
    }
  },
  "maintitle": {
    "el": "h1",
    "class": "typo-large",
    "text": "Scegli il tuo parcheggio"
  },
  "booking-info": {
    "parking-form-dialog": {
      "id": "dialog-parking-form",
      "dialog-labelledby": "title",
      "title": "Modifica gli orari della tua sosta",
      "paragraph": "Qualora non ci fossero disponibilità per gli orari scelti in questo parcheggio, ti proporremo le migliori alternative"
    }
  }
}

No notes defined.