text: const courierLocation = io.connect(`${base_url}websocket/liveLocation`)
  const workingRegion = io.connect(`${base_url}websocket/workingRegion`)
  const addressChange = io.connect(`${base_url}websocket/addressChange`)
  let changeAddressModal = new bootstrap.Modal(document.getElementById('change-address-modal'), {
      keyboard: true
  });
  let areYouSureModal = new bootstrap.Modal(document.getElementById('sure-modal'), {
      keyboard: true
  });
  const orderData = JSON.parse(document.getElementById('orderData').textContent);
  let orderCode
  $(document).ready(() => {
      /* Web Map */
      const orderCoordinate = orderData.backSide.coordinate.split(',')
      const orderCondition = orderData.deliveries.orderCondition
      const mapTrack = L.map('map-track').setView([orderCoordinate[0],orderCoordinate[1]], 12);
      L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}', {
          attribution: '2021 &copy; Hetes',
          maxZoom: 18,
          id: 'mapbox/streets-v11',
          tileSize: 512,
          zoomOffset: -1,
          accessToken: 'pk.eyJ1Ijoic2VyZGFydGVraW4yMSIsImEiOiJja2hscjlxN3QwMnduMnpxMWwxOGl2Z211In0.hxZ5HIz3YT5nTL1tu8w-2g'
      }).addTo(mapTrack);
      /* Live Location Track */
      if (orderCondition == "onRoad") {
          let liveMarker;
          if (!liveMarker) {
              courierLocation.emit('courierOldLocationTrackParam',({city:orderData.deliveries.deliveryAddress.city,courierID:orderData.backSide.courierID}))
              courierLocation.on('courierOldLocationTrackData',(coordinate) => {
                  const courierIcon = {                
                      mapIconUrl: `<svg fill="#00529B" width=100 height=60 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 64 80" style="enable-background:new 0 0 64 64;" xml:space="preserve"><g><g><path d="M18.9,28.1c0-0.7-0.1-1.2-0.1-1.8c-4.2,0-8.4,0-12.6,0c0,0.7,0,1.2,0.1,1.8C10.5,28.1,14.6,28.1,18.9,28.1z"/><path d="M11.7,32.4c-0.1-1-0.1-1.9-0.2-2.9c-1.8,0-3.6,0-5.3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5.4,5.4c3.1,0,5.4-2.3,5.4-5.4C56.8,48,54.5,45.7,51.5,45.7z"/><path d="M17.3,45.7c-3-0.1-5.5,2.3-5.5,5.3c-0.1,3.1,2.3,5.5,5.4,5.5c3,0.1,5.4-2.2,5.5-5.3C22.7,48.1,20.4,45.7,17.3,45.7z"/><path d="M31.1,16.3c1.9,0.4,4-0.7,4.8-2.6c0.3-0.7,0.4-1.4,0.5-2.2c0.7,0.2,1.5,0.4,2.3,0.6c0.5,0.1,0.8,0,0.9-0.4    c0.1-0.4-0.1-0.7-0.6-0.8c-0.9-0.2-1.8-0.5-2.7-0.7c-0.2-0.1-0.5-0.3-0.6-0.5c-1-1.7-3.1-2.5-5-2c-1.9,0.5-3.3,2.3-3.3,4.3    C27.4,14.1,28.9,15.8,31.1,16.3z"/></g></g></svg>`,
                  };
                  liveMarker = new L.marker([coordinate[1],coordinate[0]],{
                      icon: L.divIcon({
                          className: "leaflet-data-marker",
                          html: L.Util.template(courierIcon.mapIconUrl, courierIcon),
                          iconAnchor  : [30, 50],
                          iconSize    : [36, 42],
                          popupAnchor : [0, -30]
                      })
                  }).addTo(mapTrack); 
              });
          } else {
              courierLocation.on('courierLocation',(data) => {
                  if (!liveMarker) {
                      liveMarker = new L.marker([data.latitude,data.longitude],{
                          icon: L.divIcon({
                              html: L.Util.template(courierIcon.mapIconUrl, courierIcon),
                              iconAnchor  : [30, 50],
                              iconSize    : [36, 42],
                              popupAnchor : [0, -30]
                          })
                      }).addTo(mapTrack);
                  } else {
                      liveMarker.setLatLng([data.latitude,data.longitude])
                  }
              });
          }
      }
      const homeIcon = {                
          mapIconUrl: `<svg width=70 height=50 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 125" enable-background="new 0 0 100 100" xml:space="preserve"><path fill="#00529B" d="M11.779,53.191v40.218c0,0.734,0.294,1.458,0.814,1.976s1.24,0.813,1.978,0.813h22.483V66.667  c0-0.737,0.292-1.461,0.814-1.978c0.518-0.521,1.24-0.819,1.971-0.819h19.203c0.737,0,1.451,0.299,1.974,0.819  c0.521,0.517,0.814,1.24,0.814,1.978v29.531h22.487c0.741,0,1.446-0.285,1.973-0.813c0.521-0.527,0.814-1.231,0.814-1.976V53.139  L49.035,23.54L11.779,53.191z"/><path fill="#00529B" d="M95.549,40.734L52.845,7.886c-2.002-1.542-4.806-1.542-6.811,0L23.159,25.482v-8.885H11.989v17.474  l-8.653,6.66c-2.442,1.881-2.901,5.388-1.02,7.829c1.096,1.429,2.754,2.179,4.425,2.179c0.612,0,1.226-0.103,1.819-0.306  l39.162-31.16c0.754-0.602,1.814-0.608,2.57-0.02l40.119,31.191c2.188,0.711,4.674,0.046,6.159-1.884  C98.452,46.119,97.992,42.613,95.549,40.734z"/></svg>`,
      };
      L.marker([orderCoordinate[0],orderCoordinate[1]], {
          icon: L.divIcon({
              className: "leaflet-data-marker-2",
              html: L.Util.template(homeIcon.mapIconUrl, homeIcon),
              iconAnchor  : [30, 50],
              iconSize    : [36, 42],
              popupAnchor : [0, -30]
          })
      }).addTo(mapTrack);
  })
  /* Condition Update */
  $(document).ready(() => {
      const orderCondition = orderData.deliveries.orderCondition
      if (orderCondition == 'onRoad') {
          $('#lastConditionText').before(' <svg class="condition-svg" id="lastConditionSvg" 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 125" style="enable-background:new 0 0 100 100;" xml:space="preserve"><path d="M25.2,14h15.2c0,4.4-3.4,8-7.6,8C28.6,22,25.2,18.4,25.2,14z M39.6,10c-1.2-2.7-3.8-4.6-6.9-4.6c-3.7,0-6.8,2.9-7.5,6.6H45  v-2H39.6z M66.7,41.6c-0.2-2.1-2.1-3.6-4.2-3.6L51,38L37.2,25.2c-1.1-1-2-1.2-3.2-1.2h-3.9c-3,0-5.5,2.2-5.6,4.8l-0.9,26.8  c0,0.7,0,1.3,0.1,2l4,35.2c0.3,2.6,2.7,4.5,5.4,4.2c2.3-0.3,4-2.4,4.1-4.7l1.6-51l6.7,4c0.8,0.5,1.7,0.7,2.7,0.7h14.6  C65.1,46,66.9,44,66.7,41.6z M52,23v13h10.7c3.3,0,6,2.7,6,6s-2.7,6-6,6H52v7h32V23H52z"/></svg>')
          $('#onMyWayText').css({ color:'#C3D10D' })
          $('#onMyWaySvg').css({ fill:'#C3D10D' })
      } else if (orderCondition == 'delivered') {
          $('#lastConditionText').before(' <svg class="condition-svg" id="lastConditionSvg" 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 125" style="enable-background:new 0 0 100 100;" xml:space="preserve"><path d="M25.2,14h15.2c0,4.4-3.4,8-7.6,8C28.6,22,25.2,18.4,25.2,14z M39.6,10c-1.2-2.7-3.8-4.6-6.9-4.6c-3.7,0-6.8,2.9-7.5,6.6H45  v-2H39.6z M66.7,41.6c-0.2-2.1-2.1-3.6-4.2-3.6L51,38L37.2,25.2c-1.1-1-2-1.2-3.2-1.2h-3.9c-3,0-5.5,2.2-5.6,4.8l-0.9,26.8  c0,0.7,0,1.3,0.1,2l4,35.2c0.3,2.6,2.7,4.5,5.4,4.2c2.3-0.3,4-2.4,4.1-4.7l1.6-51l6.7,4c0.8,0.5,1.7,0.7,2.7,0.7h14.6  C65.1,46,66.9,44,66.7,41.6z M52,23v13h10.7c3.3,0,6,2.7,6,6s-2.7,6-6,6H52v7h32V23H52z"/></svg>')
          $('#lastConditionText').css({ color:'#C3D10D' })
          $('#lastConditionSvg').css({ fill:'#C3D10D' })
      } else if (orderCondition == 'customerNotFound') {
          $('#lastConditionText').before('<svg class="condition-svg" id="lastConditionSvg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 125" x="0px" y="0px"><g data-name="15-Not found the recipient"><path d="M87.16,88.82l-8.91-9.48A3,3,0,0,0,76,78.4a3.4,3.4,0,0,0-1.9.58l-.84-.88a18.63,18.63,0,0,0-.82-25.35,18.33,18.33,0,0,0-13.09-5.44h0a18.16,18.16,0,0,0-4.61.6,29.39,29.39,0,0,0-4.44-2.17l-.69-.25a21,21,0,1,0-19.19,0,29.9,29.9,0,0,0-12,8A34,34,0,0,0,9.52,76.75a2,2,0,0,0,4,0,30.06,30.06,0,0,1,7.83-20.51,25.31,25.31,0,0,1,18.71-8.41,24.52,24.52,0,0,1,8.84,1.64l1.07.44a18.57,18.57,0,0,0,9.42,34.54,18.29,18.29,0,0,0,11-3.64L71.46,82a3.29,3.29,0,0,0,.53,3.6l8.92,9.48a3,3,0,0,0,2.2,1h0a3.57,3.57,0,0,0,2.53-1.11L87,93.51h0A3.41,3.41,0,0,0,87.16,88.82ZM23,26.8a17,17,0,1,1,17,17A17,17,0,0,1,23,26.8ZM59.39,80.45a14.34,14.34,0,0,1-10.25-4.27,14.63,14.63,0,0,1,0-20.61,14.47,14.47,0,0,1,20.51,0,14.63,14.63,0,0,1,0,20.61A14.35,14.35,0,0,1,59.39,80.45ZM83.2,91.66l-7.82-8.32.57-.6,7.82,8.32Z"/><path d="M59.43,55.73a5.52,5.52,0,0,0-5.51,5.52,2,2,0,0,0,4,0,1.51,1.51,0,1,1,1.51,1.52,2,2,0,0,0-2,2V68.3a2,2,0,0,0,4,0V66.4a5.53,5.53,0,0,0-2-10.67Z"/><path d="M59.43,71.82a1.76,1.76,0,1,0,1.75,1.76A1.76,1.76,0,0,0,59.43,71.82Z"/></g></svg>')
          $('#lastConditionText').css({ color:'#C3D10D' })
          $('#lastConditionSvg').css({ fill:'#C3D10D' })
          $('#lastConditionText').text('Müşteri Bulunamadı')
      } else if (orderCondition == 'cancelled' || orderCondition == 'Cancelled') {
          $('#lastConditionText').before('<svg class="condition-svg" id="lastConditionSvg" 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 125" enable-background="new 0 0 100 100" xml:space="preserve"><rect x="5" y="5" fill="none" width="90" height="90"/><g><path d="M77.111,31.166l-8.277-8.275c-0.209-0.209-0.494-0.327-0.789-0.327s-0.578,0.118-0.787,0.327L50,40.147L32.744,22.891   c-0.209-0.209-0.492-0.327-0.788-0.327c-0.295,0-0.579,0.118-0.789,0.327l-8.276,8.275c-0.436,0.436-0.436,1.143,0,1.579L40.147,50   L22.891,67.258c-0.436,0.435-0.436,1.14,0,1.575l8.276,8.277c0.209,0.208,0.493,0.326,0.789,0.326c0.296,0,0.579-0.118,0.788-0.326   L50,59.854L67.258,77.11c0.209,0.208,0.492,0.326,0.787,0.326s0.58-0.118,0.789-0.326l8.277-8.277c0.434-0.436,0.434-1.141,0-1.575   L59.854,50l17.258-17.255C77.545,32.309,77.545,31.602,77.111,31.166z M57.488,49.211c-0.209,0.209-0.324,0.494-0.324,0.788   c0,0.296,0.115,0.58,0.324,0.788l17.258,17.256l-6.701,6.701L50.789,57.488c-0.209-0.209-0.493-0.325-0.788-0.325   s-0.579,0.116-0.788,0.325L31.956,74.745l-6.7-6.701l17.256-17.256c0.209-0.208,0.327-0.492,0.327-0.788   c0-0.294-0.117-0.579-0.327-0.788L25.255,31.957l6.7-6.701l17.257,17.257c0.209,0.209,0.493,0.326,0.788,0.326   s0.579-0.117,0.788-0.326l17.256-17.257l6.701,6.701L57.488,49.211z"/><path d="M73.172,5.023H26.83c-12.023,0-21.806,9.783-21.806,21.805v46.342c0,12.023,9.782,21.806,21.806,21.806h46.342   c12.023,0,21.805-9.782,21.805-21.806V26.829C94.977,14.806,85.195,5.023,73.172,5.023z M92.189,73.171   c0,10.487-8.531,19.019-19.018,19.019H26.83c-10.487,0-19.019-8.531-19.019-19.019V26.829c0-10.487,8.531-19.018,19.019-19.018   h46.342c10.486,0,19.018,8.531,19.018,19.018V73.171z"/></g></svg>')
          $('#lastConditionText').css({ color:'#C3D10D' })
          $('#lastConditionSvg').css({ fill:'#C3D10D' })
          $('#lastConditionText').text('İptal Edildi')
      } else if (orderCondition == 'willReturn' || orderCondition == 'returned') {
          $('#lastConditionText').before('<svg class="condition-svg" id="lastConditionSvg" xmlns:x="http://ns.adobe.com/Extensibility/1.0/" xmlns:i="http://ns.adobe.com/AdobeIllustrator/10.0/" xmlns:graph="http://ns.adobe.com/Graphs/1.0/" 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 125" style="enable-background:new 0 0 100 100;" xml:space="preserve"><switch><foreignObject requiredExtensions="http://ns.adobe.com/AdobeIllustrator/10.0/" x="0" y="0" width="1" height="1"/><g i:extraneous="self"><g><path d="M53.8,27.4c0.1-0.1,0.3-0.1,0.4,0L70.8,35c0.4,0.2,0.4,0.7,0,0.8l-16.6,7.6c-0.1,0.1-0.3,0.1-0.4,0l-16.6-7.6     c-0.4-0.2-0.4-0.7,0-0.8L53.8,27.4z"/><path d="M74.4,40.1c0.3-0.1,0.6,0.1,0.6,0.4v23.8c0,0.2-0.1,0.3-0.3,0.4l-17.4,8c-0.3,0.1-0.6-0.1-0.6-0.4V48.5     c0-0.2,0.1-0.3,0.3-0.4L74.4,40.1z"/><path d="M51.3,48.5v23.8c0,0.3-0.3,0.6-0.6,0.4l-17.4-8c-0.2-0.1-0.3-0.2-0.3-0.4V40.5c0-0.3,0.3-0.6,0.6-0.4l17.4,8     C51.2,48.2,51.3,48.3,51.3,48.5z"/><path d="M2.8,47.7c0.4-0.8,1.3-1.3,2.2-1.3h5.8C12.6,24.1,31.3,6.6,54,6.6c24,0,43.5,19.5,43.5,43.5c0,20.2-14.3,38.1-34,42.4     c-0.2,0.1-0.5,0.1-0.7,0.1c-1.5,0-2.9-1.1-3.2-2.6c-0.4-1.8,0.7-3.6,2.5-4c16.7-3.7,28.8-18.8,28.8-36     c0-20.3-16.5-36.8-36.8-36.8c-19.1,0-34.8,14.6-36.6,33.2h5.4c0.9,0,1.8,0.5,2.2,1.3c0.4,0.8,0.4,1.8-0.2,2.6l-8.9,12.8     c-0.5,0.7-1.2,1.1-2,1.1s-1.6-0.4-2-1.1L2.9,50.3C2.4,49.5,2.4,48.5,2.8,47.7z"/><path d="M47.8,86.3c0.3,0.1,0.7,0.1,1,0.2c1,0.1,2,0.2,3,0.3c1.8,0.1,3.2,1.7,3.1,3.5c-0.1,1.8-1.6,3.1-3.3,3.1     c-0.1,0-0.1,0-0.2,0c-1.2-0.1-2.4-0.2-3.5-0.4c-0.4-0.1-0.8-0.1-1.2-0.2c-1.8-0.3-3-2.1-2.7-3.9S45.9,86,47.8,86.3z"/><path d="M24.2,71.6c0.8,1.1,1.7,2.2,2.6,3.2c1.2,1.4,1.1,3.5-0.2,4.7c-0.6,0.6-1.4,0.9-2.2,0.9c-0.9,0-1.8-0.4-2.5-1.1     c-1.1-1.2-2.1-2.4-3-3.7c-1.1-1.5-0.7-3.6,0.7-4.6C21.1,69.8,23.1,70.2,24.2,71.6z"/><path d="M34.5,81.3c1.1,0.7,2.3,1.4,3.6,2c1.7,0.8,2.3,2.8,1.6,4.4c-0.6,1.2-1.8,1.9-3,1.9c-0.5,0-1-0.1-1.4-0.3     c-1.4-0.7-2.8-1.5-4.2-2.3c-1.6-1-2-3-1.1-4.6C30.9,80.8,33,80.3,34.5,81.3z"/></g></g></switch></svg>')
          $('#lastConditionText').css({ color:'#C3D10D' })
          $('#lastConditionSvg').css({ fill:'#C3D10D' })
          $('#lastConditionText').text('İade Edildi')
      } else {                           
          $('#lastConditionText').before('<svg class="condition-svg" id="lastConditionSvg" 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 125" style="enable-background:new 0 0 100 100;" xml:space="preserve"><path d="M25.2,14h15.2c0,4.4-3.4,8-7.6,8C28.6,22,25.2,18.4,25.2,14z M39.6,10c-1.2-2.7-3.8-4.6-6.9-4.6c-3.7,0-6.8,2.9-7.5,6.6H45  v-2H39.6z M66.7,41.6c-0.2-2.1-2.1-3.6-4.2-3.6L51,38L37.2,25.2c-1.1-1-2-1.2-3.2-1.2h-3.9c-3,0-5.5,2.2-5.6,4.8l-0.9,26.8  c0,0.7,0,1.3,0.1,2l4,35.2c0.3,2.6,2.7,4.5,5.4,4.2c2.3-0.3,4-2.4,4.1-4.7l1.6-51l6.7,4c0.8,0.5,1.7,0.7,2.7,0.7h14.6  C65.1,46,66.9,44,66.7,41.6z M52,23v13h10.7c3.3,0,6,2.7,6,6s-2.7,6-6,6H52v7h32V23H52z"/></svg>')
          $('#recievedPackageText').css({ color:'#C3D10D' })
          $('#recievedPackageSvg').css({ fill:'#C3D10D' })
      }
      orderCode = $('#orderCode').text()
      $('#orderCode').html(orderCode.substring(2,orderCode.length-2))
      const systemRecievedDate = orderData.backSide.systemRecievedDate
      $('#systemRecievedTime').html(systemRecievedDate[0])
      const estimatedTime = new Date($('#estimatedTime').text())
      $('#estimatedTime').html(estimatedTime.toLocaleString('tr-TR'))
  });
  /* Fast Address Change */
  $('#change-address-button').click(() => {
      if  (orderData.deliveries.orderCondition == 'creatingRoute' || orderData.deliveries.orderCondition == 'onRoad' || orderData.deliveries.orderCondition == 'customerNotFound') {
          if (orderData.backSide.routeNumber > 5) {
              const city = orderData.deliveries.deliveryAddress.city
              const district = orderData.deliveries.deliveryAddress.district
              const neighborhood = orderData.deliveries.deliveryAddress.neighborhood
              $('#change-city').val(city)
              $('#change-district').val(district)
              $('#change-address').val(orderData.deliveries.deliveryAddress.address)
              /* District */
              workingRegion.emit('district-info-filtered-param',({city}))
              $('#change-city').focusout(function(){
                  workingRegion.emit('district-info-filtered-param',({city:$('#change-city').val()}))
              });        
              workingRegion.on('district-info-filtered-data',data => {
                  let neighborhoodOptions = [`<option value=${district} selected>${district}</option>`];
                  if (typeof(data[0]) != 'undefined') {
                      $.each(data[0].district, (index, val) => {
                          if (val != district) {
                              neighborhoodOptions.push(`<option>${val}</option>`);
                          }
                      });         
                      $('#change-district').html(neighborhoodOptions.join(''));
                  } else {
                      neighborhoodOptions = [`<option value=${district} selected>${district}</option>`];
                      $('#change-district').html(neighborhoodOptions.join(''));
                  }
              });
              /* Neighborhood */
              workingRegion.emit('neighborhood-info-filtered-param',({city,district}))
              $('#change-district').change(function(){
                  workingRegion.emit('neighborhood-info-filtered-param',({city,district:$('#change-district').val()}))
              });        
              workingRegion.on('neighborhood-info-filtered-data',data => {
                  let neighborhoodOptions = [`<option value=${neighborhood} selected>${neighborhood}</option>`];
                  $.each(data[0].neighborhood, (index, val) => {
                      if (val != neighborhood) {
                          neighborhoodOptions.push(`<option>${val}</option>`);
                      }            
                  });         
                  $('#change-neighborhood').html(neighborhoodOptions.join(''));
              });
              changeAddressModal.show();
          } else {
              $('.error-type-2').toast('show');
          }
      } else {
          $('.error-type-1').toast('show');
      }
  });
  $('#change-order').click(() => {
      if (orderData.deliveries.deliveryAddress.city == $('#change-city').val()) {
          changeAddressModal.hide();
          areYouSureModal.show();
      } else if (orderData.deliveries.deliveryAddress.district == $('#change-district').val() && orderData.deliveries.deliveryAddress.district == $('#change-neighborhood').val() && orderData.deliveries.deliveryAddress.address == $('#change-address').val()) {
          changeAddressModal.hide();
      }  else {
          $('.error-type-3').toast('show');
      }
  });
  $('#sure-order').click(() => {
      const orderCondition = orderData.deliveries.orderCondition
      addressChange.emit('address-information',{'newCity':$('#change-city').val(),'newDistrict':$('#change-district').val(),'newNeighborhood':$('#change-neighborhood').val(),'newAddress':$('#change-address').val(),'orderCode':orderCode.substring(2,orderCode.length-2),'courierID':orderData.backSide.courierID,orderCondition,'routeNumber':orderData.backSide.routeNumber, 'city':orderData.deliveries.deliveryAddress.city,'district':orderData.deliveries.deliveryAddress.district,'neighborhood':orderData.deliveries.deliveryAddress.neighborhood,'address':orderData.deliveries.deliveryAddress.address})
      $('.success-type-1').toast('show')
      setTimeout(() => window.location.reload(), 2000);
  });
  $('#not-sure-order').click(() => {
      areYouSureModal.hide();
      changeAddressModal.show();
  });