1var availability_per_day = []; 2var wpbc_check_in_dates = []; 3var wpbc_check_out_dates = []; 4var wpbc_check_in_out_closed_dates = []; 5var highlight_availability_word = ''; 6var wpbc_search_form_dates_format = 'yy-mm-dd'; //FixIn: 8.6.1.21 7 8function getDayAvailability4Show(bk_type, tooltip_time, td_class){ 9 10 if ( wpdev_in_array( parent_booking_resources, bk_type ) ) 11 if (is_show_availability_in_tooltips) { 12 if(typeof( availability_per_day[bk_type] ) !== 'undefined') 13 if(typeof( availability_per_day[bk_type][td_class] ) !== 'undefined') { 14 if (tooltip_time!== '') tooltip_time = tooltip_time + '<br/>'; 15 16 var both_check_in_out_num = getNumberClosedCheckInOutDays( bk_type, td_class ) ; 17 18 return tooltip_time + highlight_availability_word + parseInt( availability_per_day[bk_type][td_class] - both_check_in_out_num ) ; 19 } 20 } 21 return tooltip_time; 22} 23 24 25function getNumberClosedCheckInOutDays( bk_type, td_class ){ 26 var both_check_in_out_num = 0; 27 if(typeof(wpbc_check_in_out_closed_dates) !== 'undefined') 28 if(typeof(wpbc_check_in_out_closed_dates[ bk_type ]) !== 'undefined') 29 if(typeof(wpbc_check_in_out_closed_dates[ bk_type ][ td_class ]) !== 'undefined') { 30 // [ Number of check In / Out bookings both in the same child resource ] 31 both_check_in_out_num = wpbc_check_in_out_closed_dates[ bk_type ][ td_class ] ; 32 } 33 return both_check_in_out_num; 34} 35 36 37function checkDayAvailability4Visitors(bk_type, inp_value, my_dates_array) { 38 39 if ( ( is_use_visitors_number_for_availability ) && (my_dates_array != '') ) { 40 41 var my_single_data = ''; 42 var td_class1 = ''; 43 44 if ( (availability_based_on == 'visitors') && ( wpdev_in_array( parent_booking_resources, bk_type ) ) ) { // Visitors 45 46 my_dates_array = my_dates_array.split(','); 47 48 for (var i = 0; i < my_dates_array.length; i++) { 49 if (my_dates_array[i]== '') return true; 50 my_single_data = my_dates_array[i].split('.'); 51 52 my_single_data[0] = my_single_data[0].replace(/(^\s+)|(\s+$)/g, ""); // TRim 53 my_single_data[1] = my_single_data[1].replace(/(^\s+)|(\s+$)/g, ""); // TRim 54 my_single_data[2] = my_single_data[2].replace(/(^\s+)|(\s+$)/g, ""); // TRim 55 my_single_data[0] = my_single_data[0].replace(/(^0+)|(\s+$)/g, ""); // TRim 56 my_single_data[1] = my_single_data[1].replace(/(^0+)|(\s+$)/g, ""); // TRim 57 my_single_data[2] = my_single_data[2].replace(/(^0+)|(\s+$)/g, ""); // TRim 58 td_class1 = parseInt(my_single_data[1]) + '-' + parseInt(my_single_data[0]) + '-' + parseInt(my_single_data[2]); 59 if ( parseInt( availability_per_day[bk_type][td_class1] ) < parseInt( inp_value ) ) 60 return true; 61 62 } 63 // availability based on items, so we will check visitors for maximum support of them for specific item 64 } else { // Items 65 66 if ( parseInt( max_visitors_4_bk_res[bk_type] ) < parseInt( inp_value ) ) 67 return true; 68 69 my_dates_array = my_dates_array.split(','); 70 71 for (var i = 0; i < my_dates_array.length; i++) { 72 if (my_dates_array[i]== '') return true; 73 my_single_data = my_dates_array[i].split('.'); 74 75 my_single_data[0] = my_single_data[0].replace(/(^\s+)|(\s+$)/g, ""); // TRim 76 my_single_data[1] = my_single_data[1].replace(/(^\s+)|(\s+$)/g, ""); // TRim 77 my_single_data[2] = my_single_data[2].replace(/(^\s+)|(\s+$)/g, ""); // TRim 78 my_single_data[0] = my_single_data[0].replace(/(^0+)|(\s+$)/g, ""); // TRim 79 my_single_data[1] = my_single_data[1].replace(/(^0+)|(\s+$)/g, ""); // TRim 80 my_single_data[2] = my_single_data[2].replace(/(^0+)|(\s+$)/g, ""); // TRim 81 td_class1 = parseInt(my_single_data[1]) + '-' + parseInt(my_single_data[0]) + '-' + parseInt(my_single_data[2]); 82 if ( parseInt( availability_per_day[bk_type][td_class1] ) < 1 ) //parseInt( inp_value ) ) 83 return true; 84 85 } 86 87 } 88 89 90 91 92 return false;
93 94 } else { // No apply of visitors 95 return false; 96 } 97} 98 99 //////////////////////////////////////////////////////////////////////////// 100 // Booking Search functionality 101 102 //FixIn: 8.6.1.21 103 function wpbc_search_form_click_new_page( my_form ){ 104 105 if ( 106 ( '' == jQuery( '#booking_search_check_in' ).val() ) 107 || ( '' == jQuery( '#booking_search_check_out' ).val() ) 108 ){ 109 alert( search_emty_days_warning ); 110 return false; 111 } 112 113 var search_check_in_date = jQuery.datepick.parseDate( wpbc_search_form_dates_format , jQuery( '#booking_search_check_in' ).val() ); // Parse a string value into a date object 114 var string_check_in_date = jQuery.datepick.formatDate( 'yy-mm-dd', search_check_in_date ); // Format a date object into a string value. 115 jQuery( '#booking_search_check_in' ).val( string_check_in_date ); 116 117 var search_check_out_date = jQuery.datepick.parseDate( wpbc_search_form_dates_format , jQuery( '#booking_search_check_out' ).val() ); // Parse a string value into a date object 118 var string_check_out_date = jQuery.datepick.formatDate( 'yy-mm-dd', search_check_out_date ); // Format a date object into a string value. 119 jQuery( '#booking_search_check_out' ).val( string_check_out_date ); 120 121 return true; 122 } 123 124 125 function searchFormClck( search_form, wpdev_active_locale ){ 126 127 if ( (search_form.check_in.value == '') || (search_form.check_out.value == '') ) { 128 alert(search_emty_days_warning); 129 return; 130 } 131 document.getElementById('booking_search_results' ).innerHTML = '<div style="height:20px;width:100%;text-align:center;margin:15px auto;"><img style="vertical-align:middle;box-shadow:none;width:14px;" src="'+wpdev_bk_plugin_url+'/assets/img/ajax-loader.gif"><//div>'; 132 ajax_search_submit( search_form, wpdev_active_locale ); 133 134 } 135 136 137 //<![CDATA[ 138 function ajax_search_submit( search_form, wpdev_active_locale ) { //FixIn: 6.0.1.1 139 140 //FixIn: 8.6.1.21 141 var search_check_in_date = jQuery.datepick.parseDate( wpbc_search_form_dates_format , search_form.check_in.value ); // Parse a string value into a date object 142 var string_check_in_date = jQuery.datepick.formatDate( 'yy-mm-dd', search_check_in_date ); // Format a date object into a string value. 143 144 var search_check_out_date = jQuery.datepick.parseDate( wpbc_search_form_dates_format , search_form.check_out.value ); // Parse a string value into a date object 145 var string_check_out_date = jQuery.datepick.formatDate( 'yy-mm-dd', search_check_out_date ); // Format a date object into a string value. 146 147//console.log( 'search_check_in_date, string_check_out_date',string_check_in_date, string_check_out_date ); 148 149 // Ajax POST here 150 var my_bk_category = ''; 151 var my_bk_tag = ''; 152 var my_bk_users = ''; 153 var my_bk_advanced = ''; 154 155 var elm1 = document.getElementById("booking_search_category"); 156 if( elm1 !== null) my_bk_category = search_form.category.value 157 158 var elm2 = document.getElementById("booking_search_tag"); 159 if( elm2 !== null) my_bk_tag = search_form.tag.value 160 161 var elm3 = document.getElementById("booking_bk_users"); 162 if( elm3 !== null) my_bk_users = search_form.bk_users.value 163 164 if ( jQuery("input[name='additional_search']:checked").length > 0 ) 165 my_bk_advanced = jQuery("input[name='additional_search']").val(); 166 167// var all_paramas = ''; 168// for(var i = 0; i < search_form.length; i++) { //FixIn:6.0.1 169// if ( ( search_form[i].type == 'checkbox' ) && ( ! search_form[i].checked ) ) 170// continue; 171// all_paramas += search_form[i].type + "^"; 172// all_paramas += search_form[i].name + "^"; 173// all_paramas += search_form[i].value + "~"; 174// } 175 176 //FixIn: 7.1.2.9 177 var all_paramas = ''; 178 var inp_el; 179 var inp_val 180//console.log(search_form); 181//console.log(jQuery( search_form )); 182 for( var i = 0; i < search_form.length; i++ ) { 183 if ( ( search_form[i].type == 'checkbox' ) && ( ! search_form[i].checked ) ) 184 continue; 185 186 inp_el = search_form[i].type + "^" + search_form[i].name + "^"; 187
188 inp_val = jQuery( search_form[i] ).val(); 189//console.log(inp_el, inp_val); 190 if ( jQuery.isArray( inp_val ) ) { 191 jQuery.each( inp_val, function( index ){ 192 all_paramas += inp_el + inp_val[ index ] + "~"; 193 }); 194 } else { 195 all_paramas += inp_el + inp_val + "~"; 196 } 197 } 198//console.log(all_paramas); 199 jQuery(".booking_search_ajax_container").remove(); 200 201 jQuery.ajax({ // Start Ajax Sending 202 // url: wpdev_bk_plugin_url+ '/' + wpdev_bk_plugin_filename, 203 url: wpbc_ajaxurl, 204 type:'POST', 205 success: function (data, textStatus){if( textStatus == 'success') jQuery('#booking_search_ajax' ).html( data ) ;}, 206 error:function (XMLHttpRequest, textStatus, errorThrown){window.status = 'Ajax search Error status:'+ textStatus;alert(XMLHttpRequest.status + ' ' + XMLHttpRequest.statusText);if (XMLHttpRequest.status == 500) {alert('Please check at this page according this error:' + ' https://wpbookingcalendar.com/faq/#ajax-sending-error');}}, 207 // beforeSend: someFunction, 208 data:{ 209 //ajax_action : 'BOOKING_SEARCH', 210 action : 'BOOKING_SEARCH', 211 bk_check_in: string_check_in_date , 212 bk_check_out: string_check_out_date , 213 bk_visitors: search_form.visitors.value, 214 bk_no_results_title: search_form.bk_no_results_title.value, 215 bk_search_results_title: search_form.bk_search_results_title.value, 216 bk_category:my_bk_category, 217 bk_tag:my_bk_tag, 218 bk_users:my_bk_users, 219 bk_search_params: all_paramas, 220 additional_search: my_bk_advanced, 221 wpdev_active_locale:wpdev_active_locale, 222 wpbc_nonce: document.getElementById('wpbc_search_nonce').value 223 } 224 }); 225 } 226 //]]> 227 228 229 230 231 function setDaysSelectionsInCalendar(bk_type, check_in, check_out){ 232 233 clearTimeout(timeout_DSwindow); 234 235 236 var inst = jQuery.datepick._getInst(document.getElementById('calendar_booking'+bk_type)); 237 inst.dates = []; 238 239 var original_array = []; var date; 240 241 for(var j=0; j < original_array.length ; j++) { //loop array of dates 242 if (original_array[j] != -1) inst.dates.push(original_array[j]); 243 } 244 dateStr = (inst.dates.length == 0 ? '' : jQuery.datepick._formatDate(inst, inst.dates[0])); // Get first date 245 for ( i = 1; i < inst.dates.length; i++) 246 dateStr += jQuery.datepick._get(inst, 'multiSeparator') + jQuery.datepick._formatDate(inst, inst.dates[i]); // Gathering all dates 247 jQuery('#date_booking' + bk_type).val(dateStr); // Fill the input box 248 249 if (original_array.length>0) { // Set showing of start month 250 inst.cursorDate = original_array[0]; 251 inst.drawMonth = inst.cursorDate.getMonth(); 252 inst.drawYear = inst.cursorDate.getFullYear(); 253 } 254 255 // Update calendar 256 jQuery.datepick._notifyChange(inst); 257 jQuery.datepick._adjustInstDate(inst); 258 jQuery.datepick._showDate(inst); 259 jQuery.datepick._updateDatepick(inst); 260 } 261 262 263 264function is_max_visitors_selection_more_than_available( bk_type, visitors_selection , element ) { 265 266 if ( ( wpdev_in_array( parent_booking_resources, bk_type ) ) || // Item have some capacity 267 ( is_use_visitors_number_for_availability === true ) // Item single, but checking for MAX visitors in situatio, when visitors apply to capacity 268 ) { 269 270 var my_dates_v = document.getElementById('date_booking' + bk_type).value; 271 if(typeof( checkDayAvailability4Visitors ) == 'function') { 272 var is_visitors_more_then_need = checkDayAvailability4Visitors(bk_type, visitors_selection, my_dates_v); 273 if (is_visitors_more_then_need) { 274 showErrorMessage( element , message_verif_visitors_more_then_available, false ); //FixIn: 8.5.1.3 275 return true; 276 } 277 } 278 } 279 280 return false;
281} 282 283 284 jQuery(document).ready(function(){ 285 286 if ( 287 (location.href.indexOf('bk_check_in=')>0) && 288 (location.href.indexOf('bk_check_out=')>0) && 289 (location.href.indexOf('bk_type=')>0) 290 ) { 291 timeout_SelectDaysInCalendar=setTimeout("setDaySelectionsInCalendar()",1500); 292 } 293 }); 294 295 296 function setDaySelectionsInCalendar(){ 297 clearTimeout(timeout_SelectDaysInCalendar); 298 299 // Parse a URL 300 var myURLParams = location.href.split('?'); 301 myURLParams = myURLParams[1].split('&'); 302 for ( var i = 0; i < myURLParams.length; i++ ){ //FixIn: 8.4.5.14 303 myParam = myURLParams[ i ].split( '=' ); 304 if ( myParam[ 0 ] == 'bk_check_in' ) var check_in_date = myParam[ 1 ]; 305 if ( myParam[ 0 ] == 'bk_check_out' ) var check_out_date = myParam[ 1 ]; 306 if ( myParam[ 0 ] == 'bk_visitors' ) var bk_visitors_num = myParam[ 1 ]; 307 if ( myParam[ 0 ] == 'bk_type' ) var my_bk_type = myParam[ 1 ].split( '#' )[ 0 ]; 308 } 309 jQuery('select[name=visitors'+ my_bk_type + ']').val( bk_visitors_num ); 310 311 312 check_in_date = check_in_date.split('-'); 313 check_out_date = check_out_date.split('-'); 314 var bk_type = my_bk_type; 315// jQuery( '#calendar_booking' + bk_type ).hide(); 316// jQuery( '#booking_form_div' + bk_type + ' .block_hints').hide(); 317 var inst = jQuery.datepick._getInst(document.getElementById('calendar_booking'+bk_type)); 318 inst.dates = []; 319 var original_array = []; 320 var date; 321 var bk_inputing = document.getElementById('date_booking' + bk_type); 322 var bk_distinct_dates = []; 323 324 date=new Date(); 325 date.setFullYear( check_in_date[0], (check_in_date[1]-1), check_in_date[2] ); // year, month, date 326 var original_check_in_date = date; 327 original_array.push( jQuery.datepick._restrictMinMax(inst, jQuery.datepick._determineDate(inst, date, null)) ); //add date 328 if ( ! wpdev_in_array(bk_distinct_dates, (check_in_date[2]+'.'+check_in_date[1]+'.'+check_in_date[0]) ) ) { 329 bk_distinct_dates.push(check_in_date[2]+'.'+check_in_date[1]+'.'+check_in_date[0]); 330 } 331 332 var date_out=new Date(); 333 date_out.setFullYear( check_out_date[0], (check_out_date[1]-1), check_out_date[2] ); // year, month, date 334 var original_check_out_date = date_out; 335 336 var mewDate=new Date(original_check_in_date.getFullYear(), original_check_in_date.getMonth(), original_check_in_date.getDate() ); 337 mewDate.setDate(original_check_in_date.getDate()+1); 338 339 while( 340 (original_check_out_date > date ) && 341 (original_check_in_date != original_check_out_date ) ) 342 { 343 date=new Date(mewDate.getFullYear(), mewDate.getMonth(), mewDate.getDate() ); 344 345 original_array.push( jQuery.datepick._restrictMinMax(inst, jQuery.datepick._determineDate(inst, date, null)) ); //add date 346 if ( ! wpdev_in_array(bk_distinct_dates, (date.getDate()+'.'+parseInt(date.getMonth()+1)+'.'+date.getFullYear()) ) ) { 347 bk_distinct_dates.push((date.getDate()+'.'+parseInt(date.getMonth()+1)+'.'+date.getFullYear())); 348 } 349 350 mewDate=new Date(date.getFullYear(), date.getMonth(), date.getDate() ); 351 mewDate.setDate(mewDate.getDate()+1); 352 } 353 original_array.pop(); 354 bk_distinct_dates.pop(); 355 356 // Check minimum number days condition //FixIn: 7.0.1.31 357 var is_continue_selection = true; 358 if ( bk_days_selection_mode == 'dynamic' ) 359 if ( (bk_2clicks_mode_days_min != undefined) && (original_array.length < bk_2clicks_mode_days_min ) ){ 360 is_continue_selection = false 361 } 362 if ( is_continue_selection ) { 363 for(var j=0; j < original_array.length ; j++) { //loop array of dates 364 if (original_array[j] != -1) inst.dates.push(original_array[j]); 365 } 366 dateStr = (inst.dates.length == 0 ? '' : jQuery.datepick._formatDate(inst, inst.dates[0])); // Get first date 367 for ( i = 1; i < inst.dates.length; i++) 368 dateStr += jQuery.datepick._get(inst, 'multiSeparator') + jQuery.datepick._formatDate(inst, inst.dates[i]); // Gathering all dates 369 jQuery('#date_booking' + bk_type).val(dateStr); // Fill the input box 370 } 371 if (original_array.length>0) { // Set showing of start month 372 inst.cursorDate = original_array[0]; 373 inst.drawMonth = inst.cursorDate.getMonth(); 374 inst.drawYear = inst.cursorDate.getFullYear(); 375 } 376 377 // Update calendar 378 jQuery.datepick._notifyChange(inst);
379 jQuery.datepick._adjustInstDate(inst); 380 jQuery.datepick._showDate(inst); 381 jQuery.datepick._updateDatepick(inst); 382 383 check_condition_sections_in_bkform( jQuery('#date_booking' + bk_type).val() , bk_type); 384 385 // HERE WE WILL DISABLE ALL OPTIONS IN RANGE TIME INTERVALS FOR SINGLE DAYS SELECTIONS FOR THAT DAYS WHERE HOURS ALREADY BOOKED 386 bkDisableBookedTimeSlots( jQuery('#date_booking' + bk_type).val() , bk_type); 387 388 showCostHintInsideBkForm(bk_type); 389 } 390 391 392//FixIn: 8.6.1.21 393function getMinRangeDaysSelections(){ 394 if ( bk_days_selection_mode == 'dynamic' ) return bk_2clicks_mode_days_min; 395 if ( bk_days_selection_mode == 'fixed' ) return bk_1click_mode_days_num; 396 return 0; 397} 398 399 400function wpbc_search_check_in_selected( date ) { 401 402 // Parse a string value into a date object 403 var search_check_in_date = jQuery.datepick.parseDate( wpbc_search_form_dates_format , jQuery( '#booking_search_check_in' ).val() ); 404 405 var date_to_check = new Date(); 406 date_to_check.setFullYear( search_check_in_date.getFullYear(), search_check_in_date.getMonth(), search_check_in_date.getDate() ); 407 408 409 if ( ( bk_days_selection_mode == 'fixed' ) && ( bk_1click_mode_days_start != -1 ) ){ 410 411 var startDay = getAbsClosestValue( date_to_check.getDay(), bk_1click_mode_days_start ); 412 date_to_check.setDate( date_to_check.getDate() - (date_to_check.getDay() - startDay) ); 413 414 var string_date = jQuery.datepick.formatDate( wpbc_search_form_dates_format, date_to_check ); // Format a date object into a string value. 415 416 jQuery( '#booking_search_check_in' ).val( string_date ); 417 } 418 if ( ( bk_days_selection_mode == 'dynamic' ) && ( bk_2clicks_mode_days_start != -1 ) ){ 419 420 var startDay = getAbsClosestValue( date_to_check.getDay(), bk_2clicks_mode_days_start ); 421 date_to_check.setDate( date_to_check.getDate() - (date_to_check.getDay() - startDay) ); 422 423 var string_date = jQuery.datepick.formatDate( wpbc_search_form_dates_format, date_to_check ); // Format a date object into a string value. 424 jQuery( '#booking_search_check_in' ).val( string_date ); 425 } 426 427 if ( document.getElementById( 'booking_search_check_out' ) != null ){ 428 429 var start_bk_month_4_check_out = jQuery.datepick.parseDate( wpbc_search_form_dates_format, jQuery( '#booking_search_check_in' ).val() ); 430 var myDate = new Date(); 431 myDate.setFullYear( start_bk_month_4_check_out.getFullYear(), start_bk_month_4_check_out.getMonth(), start_bk_month_4_check_out.getDate() ); 432 433 var days_interval = getMinRangeDaysSelections(); 434 if ( days_interval > 0 ) days_interval--; 435 myDate.setDate( myDate.getDate() + days_interval ); 436 437 var string_date = jQuery.datepick.formatDate( wpbc_search_form_dates_format, myDate ); // Format a date object into a string value. 438 jQuery( '#booking_search_check_out' ).val( string_date ); 439 } 440 441} 442 443 444function wpbc_search_apply_css_before_show_check_in(date ){ 445 446 var class_day = (date.getMonth() + 1) + '-' + date.getDate() + '-' + date.getFullYear(); 447 var additional_class = 'date_available '; 448 449 for ( var i = 0; i < user_unavilable_days.length; i++ ){ 450 if ( date.getDay() == user_unavilable_days[ i ] ) return [false, 'cal4date-' + class_day + ' date_user_unavailable']; 451 } 452 453 var my_test_date = new Date(); 454 my_test_date.setFullYear( wpdev_bk_today[ 0 ], (wpdev_bk_today[ 1 ] - 1), wpdev_bk_today[ 2 ], 0, 0, 0 ); //Get today 455 if ( (days_between( date, my_test_date ) + 1) < block_some_dates_from_today ) return [false, 'cal4date-' + class_day + ' date_user_unavailable']; 456 457 return [true, 'cal4date-' + class_day + ' ' + additional_class + ' ']; // Available 458} 459 460 461function wpbc_search_apply_css_before_show_check_out(date){ 462 463 var class_day = (date.getMonth() + 1) + '-' + date.getDate() + '-' + date.getFullYear(); 464 var additional_class = 'date_available '; 465 466 for ( var i = 0; i < user_unavilable_days.length; i++ ){ 467 if ( date.getDay() == user_unavilable_days[ i ] ) return [false, 'cal4date-' + class_day + ' date_user_unavailable']; 468 } 469 470 var my_test_date = new Date(); 471 my_test_date.setFullYear( wpdev_bk_today[ 0 ], (wpdev_bk_today[ 1 ] - 1), wpdev_bk_today[ 2 ], 0, 0, 0 ); //Get today 472 if ( (days_between( date, my_test_date ) + 1) < block_some_dates_from_today ) return [false, 'cal4date-' + class_day + ' date_user_unavailable']; 473 474 475 if ( 476 ( document.getElementById( 'booking_search_check_in' ) != null ) 477 && ( document.getElementById( 'booking_search_check_in' ).value != '' ) 478 ){ 479 480 // Parse a string value into a date object 481 var checkInDate = jQuery.datepick.parseDate( wpbc_search_form_dates_format, jQuery( '#booking_search_check_in' ).val() ); 482 483 var days_interval = getMinRangeDaysSelections(); 484 if ( days_interval > 0 ) days_interval--; 485 checkInDate.setDate( checkInDate.getDate() + days_interval ); 486 487 if ( checkInDate <= date ){ 488 return [true, 'cal4date-' + class_day + ' ' + additional_class + ' ']; // Available 489 } else { 490 return [false, '']; // Unavailable 491 } 492 493 } else { 494 return [true, 'cal4date-' + class_day + ' ' + additional_class + ' ']; // Available 495 } 496} 497
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.