1/* 2master/chatfilterjs 3Copyright 2022 Profile Your City, Inc. 4*/ 5 6var ida = ''; 7var idcc = '00000000_00000000'; 8var chat_closed = false; 9//localStorage.setItem('chatinit','false'); 10var hide_the_chat = false; 11 12chatDataOut = []; 13adminChatDataOut = []; 14 15//SCROLL TO LATEST ON FIRST LOAD 16document.addEventListener("DOMContentLoaded", function () { 17 18 newStateCheck(function(currentState){ 19 20 if (currentState == 'agent') { 21 //console.log('agent chat 31:'+currentState); 22 chatUpdateItems(); 23 } else { 24 //console.log('AUTO chat 34:'+currentState); 25 aChatUpdateItems(); 26 if(hide_the_chat) { 27 $('#'+ida+'chatbox').hide(); 28 //console.log('43'); 29 } 30 } 31 32 }); 33 34 $('.closechat').click(function(){ 35 $('#'+ida+'chatbox').hide(); 36 chat_closed = true; 37 //console.log('chat close 1: '+chat_closed); 38 $.get('https://decaturrealestategroup.com/'+ida+'chat-down', function(data) { 39 }); 40 localStorage.setItem('chat_is_closed','1'); 41 }); 42 43 $('.closechat2').click(function(){ 44 $('#'+ida+'chatbox').hide(); 45 chat_closed = true; 46 //console.log('chat close 1: '+chat_closed); 47 $.get('https://decaturrealestategroup.com/'+ida+'chat-down', function(data) { 48 }); 49 localStorage.setItem('chat_is_closed','1'); 50 }); 51 52 53}); 54 55//HANDLE ENTER KEY 56$('#'+ida+'postchat').keypress(function (e) { 57 var key = e.which; 58 59 if(key == 13) // the enter key code 60 { 61 // alert('pressed enter'); 62 //console.log('pressed enter'); 63 64 $('#'+ida+'chatsubmit').text("Sending"); 65 66 newStateCheck(function(currentState){ 67 if(currentState == 'agent') { //agent chat 68 //console.log('agent chat 63'); 69 //$('#chatsubmit').text("Sending"); 70 $('#'+ida+'chatmessage').val($('input[name='+ida+'message]').val()); 71 $('#'+ida+'chatsubmit').click(); 72 73 $.get('https://decaturrealestategroup.com/'+ida+'chat-up?time=1790620798', function(data) { 74 }); 75 localStorage.setItem('chat_is_closed','0'); 76 } else { //auto chat bot 77 //console.log('AUTO chat 72'); 78 $('#'+ida+'chatsubmit').click(); 79 } 80 }); 81 82 $('#'+ida+'chatsubmit').text("Send"); 83 84 85 return false; 86 } 87}); 88 89if ( !Storage.prototype.setObject ) { 90 Storage.prototype.setObject = function(key, value) { 91 this.setItem(key, JSON.stringify(value)); 92 } 93} 94 95if ( !Storage.prototype.getObject ) { 96 Storage.prototype.getObject = function(key) { 97 var value = this.getItem(key); 98 return value && JSON.parse(value); 99 } 100} 101 102//SAY HI ON OPEN 103$('#'+ida+'chatinit').click(function(){ 104 105 //$('#'+ida+'chatbox').show(); 106 localStorage.setItem('chat_is_closed','0'); 107 108 newStateCheck(function(currentState){ 109 110 if(currentState == 'agent') { //agent chat 111 //console.log('agent chat 104'); 112 chatUpdateItems(); 113 } else { //auto chat bot 114 //console.log('AUTO chat 107'); 115 116 aGuestMenuMessage(); 117 118 aChatUpdateItems(); 119 120 } 121 122 }); 123 124 $.get('https://decaturrealestategroup.com/'+ida+'chat-up?time=1790620798', function(data) { 125 }); 126 127}); 128 129//no chat yet prompt 130hasdata = localStorage.getObject('chatData'); 131if (isObject(hasdata)) { 132 if (hasdata.length < 1) { 133 //console.log('has data empty'); 134 $('#chatcount').text("Let's Chat!"); 135 aGuestMenuMessage(); 136 } else { 137 $('#chatcount').text("Let's Chat!"); 138 139 //console.log('no dl has data'); 140 if(!hide_the_chat) { 141 //$('#'+ida+'chatbox').show(); 142 localStorage.setItem('chat_is_closed','0'); 143 //console.log('175'); 144 } else { 145 //$('#'+ida+'chatbox').hide(); 146 localStorage.setItem('chat_is_closed','1'); 147 //console.log('178'); 148 } 149 //console.log('has data full'); 150 } 151} else { 152 //console.log('has data no object'); 153 154 //console.log('no dl first load'); 155 if(!hide_the_chat) { 156 //$('#'+ida+'chatbox').show(); 157 localStorage.setItem('chat_is_closed','0'); 158 //console.log('190'); 159 } else { 160 //$('#'+ida+'chatbox').hide(); 161 localStorage.setItem('chat_is_closed','1'); 162 //console.log('193'); 163 } 164 $('#chatcount').text("Let's Chat!"); 165 aGuestMenuMessage(); 166 } 167 168// queries 169// current_url = window.location.href; 170 171mls_listing_id = ''; 172type = ''; 173//closedchatmls = localStorage.getItem('closedchatmls');
174showchat = true; 175 176if(ida == '' && mls_listing_id != '') { // && (closedchatmls != mls_listing_id) 177 178 listing_quest = "What do you think of this property? Click an option: <br><a href=\"#\" class=\"btn btn-round btn-danger btn-xs\" style=\"padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px;height:unset;\" onclick=\"$(\'#chatmessage\').val(\'I Like It MLS#:"+mls_listing_id+"\');document.getElementById(\'chatsubmit\').click();\">I Like It</a><br><a href=\"#\" class=\"btn btn-round btn-warning btn-xs\" style=\"padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px;height:unset;\" onclick=\"$(\'#chatmessage\').val(\'Close but no\');document.getElementById(\'chatsubmit\').click();\">Close but no</a><br><a href=\"#\" class=\"btn btn-round btn-info btn-xs\" style=\"padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px;height:unset;\" onclick=\"$(\'#chatmessage\').val(\'Not what I want\');document.getElementById(\'chatsubmit\').click();\">Not what I want</a>"; 179 180 aChatMessage(listing_quest,$('input[name='+ida+'user_id]').val(),$('input[name='+ida+'agent_id]').val(),'Automatic Helper','agent'); 181 182 if(chat_closed != true) { 183 //console.log('chat_closed false'); 184 var chat_closed = false; 185 openChatOnScrollUp(true); 186 } else { 187 //console.log('chat_closed' + chat_closed); 188 var chat_closed = true; 189 openChatOnScrollUp(false); 190 } 191 192 193} 194 195current_url = window.location.href; 196if (current_url.match(/(results\?)/gmi)) { 197 //console.log('on results'); 198 //console.log('guest results'); 199 aChatFilter('triggergaa'); 200 if(!hide_the_chat) { 201 //$('#'+ida+'chatbox').show(); 202 localStorage.setItem('chat_is_closed','0'); 203 //console.log('265'); 204 } else { 205 //$('#'+ida+'chatbox').hide(); 206 localStorage.setItem('chat_is_closed','1'); 207 //console.log('268'); 208 } 209 } 210 211if (current_url.match(/(\?logout)/gmi)) { 212 //alert('cleared!'); 213 localStorage.clear(); 214} 215 216if (current_url.match(/auth\/login/gmi)) { 217 //console.log('on auth/login'); 218var x = window.matchMedia("(max-width: 700px)") 219var toHide = hideChatIf(x) 220 if(toHide) { 221 //$('#'+ida+'chatbox').hide(); 222 localStorage.setItem('chat_is_closed','1'); 223 } else { 224 if(!hide_the_chat) { 225 //$('#'+ida+'chatbox').show(); 226 localStorage.setItem('chat_is_closed','0'); 227 //console.log('287'); 228 } else { 229 //$('#'+ida+'chatbox').hide(); 230 localStorage.setItem('chat_is_closed','1'); 231 //console.log('290'); 232 } 233 } 234} 235 236//SAVE CHAT response DATA 237$('#'+ida+'chatsubmit').click(function(){ 238 239 newStateCheck(function(currentState){ 240 if(currentState == 'agent') { 241 242 var tm = $('input[name=message]').val(); 243 244 if(tm != '') { 245 246 $('#'+ida+'chatsubmit').text("Sending"); 247 248 $.ajax({ 249 url: 'https://decaturrealestategroup.com/newuchat', 250 type: "post", 251 data: {'message':$('input[name=message]').val(), 252 'user_id':$('input[name=user_id]').val(), 253 'agent_id':$('input[name=agent_id]').val(), 254 'username':$('input[name=username]').val(), 255 'code':$('input[name=code]').val(), 256 'from':$('input[name=from]').val(), 257 '_token': $('input[name=_token]').val()}, 258 success: function(data){ 259 // alert('chat clicked'); 260 chatUpdateItems(true); 261 $('#postchat')[0].reset(); 262 $('.chat-input').val(''); 263 $(".chat-input").focus(); 264 265 $('.conversation-list').scrollTo('100%', '100%', { 266 easing: 'swing' 267 }); 268 269 } 270 }); 271 272 } 273 274 } else { //auto chat bot 275 276 //$('#chatsubmit').text("Sending"); 277 278 var message = $('input[name='+ida+'message]').val(); 279 var mrm = message.toLowerCase(); 280 281 if (mrm == 'restart' || mrm == 'do over' || mrm == 'done' || mrm == 'stop' || mrm == 'end' || mrm == 'quit' || mrm == 'go to bed' || mrm == 'go to sleep' || mrm == 'get some rest' ) { 282 283 aChatUpdateItems(); 284 aChatFilter(mrm); 285 286 } else { 287 aChatMessage($('input[name='+ida+'message]').val(),$('input[name='+ida+'user_id]').val(),$('input[name='+ida+'agent_id]').val(),$('input[name='+ida+'username]').val(),$('input[name='+ida+'from]').val()); 288
289 var pendinganswer = localStorage.getItem('await'); 290 var pendingvalid = localStorage.getItem('await_valid'); 291 var qindex = localStorage.getItem('question_index'); 292 293 294 if (localStorage.getItem('series_name') != null && pendinganswer != null && pendinganswer != '' && pendingvalid != null && pendingvalid != '') { 295 localStorage.setItem(pendinganswer, $('input[name='+ida+'message]').val()); // set question name answer 296 297 valid_arr = aChatValid($('input[name='+ida+'message]').val(),pendingvalid); 298 299 if (typeof valid_arr[0].isvalid !== 'undefined' && valid_arr[0].isvalid) { 300 301 var tttime = MysqlDateNow(); 302 //alert(tttime); 303 //go to next 304 localStorage.setItem('await',''); 305 localStorage.setItem('await_valid',''); 306 localStorage.setItem('answer_time_'+qindex,tttime); 307 aChatSeries(true,$('input[name='+ida+'message]').val()); 308 309 } else { 310 //send validation error 311 aChatMessage(valid_arr[0].message,$('input[name='+ida+'user_id]').val(),$('input[name='+ida+'agent_id]').val(),'Automatic Helper','agent'); 312 313 } 314 } 315 316/* if(pendinganswer == 'cht_max_price') { 317 const changeSelected = (e) => { 318 const $select = document.querySelector('#sonmaxprice'); 319 $select.value = localStorage.getItem('cht_min_price'); 320 }; 321 }*/ 322 323 aChatUpdateItems(); 324 aChatFilter(mrm); 325 326 } 327 328 } 329 330 $('#'+ida+'chatmessage').val('');//reset input message box 331 332 $('#'+ida+'chatsubmit').text("Send"); 333 334 }); 335 336 }); 337 338 339 function aGuestMenuMessage() { 340 341 var series_json = { 342 "series_name": "hello", 343 "series": false, 344 "questions": [ 345 { 346 "name": "cht_hello", 347 "question": "Hi! Searching has never been so easy! Click an option:<br>• <a href=\"#\" style=\"text-decoration:underline;\" onclick=\"$('#chatmessage').val('Find a Property');document.getElementById('chatsubmit').click();\">Find a Property</a><br>• <a href=\"#\" style=\"text-decoration:underline;\" onclick=\"$('#chatmessage').val('Create a Property Alert');document.getElementById('chatsubmit').click();\">Create a Property Alert</a><br>• <a href=\"#\" style=\"text-decoration:underline;\" onclick=\"$('#chatmessage').val('Create An Account');document.getElementById('chatsubmit').click();\">Create An Account</a><br>• <a href=\"#\" style=\"text-decoration:underline;\" onclick=\"$('#chatmessage').val('Log Into My Account');document.getElementById('chatsubmit').click();\">Log Into My Account</a><br>• <a href=\"#\" style=\"text-decoration:underline;\" onclick=\"$(\'#chatmessage\').val(\'Chat with Live Agent\');document.getElementById(\'chatsubmit\').click();\">Chat with Live Agent</a><br>• <a href=\"#\" style=\"text-decoration:underline;\" onclick=\"$('#chatmessage').val('Contact An Agent');document.getElementById('chatsubmit').click();\">Call/Email An Agent</a>", 348 "validation": "none", 349 "answer": "" 350 } 351 ] 352 }; 353 354 localStorage.setObject('seriesData', series_json); 355 356 aFlushSeries(); 357 aChatSeries(true,''); 358 359 } 360 function aChatFilter(mrm) { 361 362 //console.log('Guest chat'); 363 364 current_url = window.location.href; 365 //console.log('Guest chat current_url:'+current_url); 366 367 368 if (mrm == 'hi' || mrm == 'hi!' |mrm == 'hello' || mrm == 'hola' || mrm == 'anyone there?' || mrm == 'anybody there?' || mrm == 'help' || mrm == 'need help' || mrm == 'i need help' || mrm == 'help me' || mrm == 'start') { 369 aGuestMenuMessage(); 370 371 } else if (mrm.match(/(talk to|speak to|live|real|actual)(.*?)(person|agent|broker|real estate agent|realtor|human)/gmi) || mrm == 'realtor' || mrm.match(/(interested|looking for|available|wondering|call me)/gmi)) { 372 373 var series_json = { 374 "series_name": "guest get live agent", 375 "series": true, 376 "redirect": current_url, 377 "questions": [ 378 { 379 "name": "cht_client_email", 380 "question": "😀 I can help with that! What's your email address?", 381 "validation": "email", 382 "answer": "" 383 }, 384 { 385 "name": "cht_client_name", 386 "question": "What's your name?", 387 //"condition": "nouser", 388 "validation": "notempty", 389 "answer": "" 390 } 391 ] 392 }; 393 394 localStorage.setObject('seriesData', series_json);
395 aFlushSeries(); 396 aChatSeries(true,''); 397 398} else if (mrm.match(/contact(.*?)(agent|realtor|company|broker)/gmi)) { //Contact My Agent 399 var agent_name = 'Michelle Decatur, Broker/Owner'; 400 var agent_email = '[email protected]'; 401 var agent_phone = '317-507-0227'; 402 403 var series_json = { 404 "series_name": "find agent", 405 "series": false, 406 "questions": [ 407 { 408 "name": "cht_reply", 409 "question": "OK, you want to contact an agent. 😀<br>Your Agent: "+agent_name+"<br>Call: <a href=\"tel:1"+agent_phone+"\">"+agent_phone+"</a><br>Email: <a href=\"mailto:"+agent_email+"\">"+agent_email+"</a><br><a href=\"/contact\">or Click here to contact an agent.</a>. Type HELP or <a href=\"#\" onclick=\"$(\'#chatmessage\').val(\'HELP\');document.getElementById(\'chatsubmit\').click();\" style=\"text-decoration:underline;\">Click HELP</a> to see these options again. 😀", 410 "validation": "", 411 "answer": "" 412 } 413 ] 414 }; 415 416 localStorage.setObject('seriesData', series_json); 417 aFlushSeries(); 418 aChatSeries(true,''); 419 420 421 } else if (mrm.match(/(list|advertise)(.*?)(property|listing|house)/gmi)) { 422 var series_json = { 423 "series_name": "list property", 424 "series": false, 425 "questions": [ 426 { 427 "name": "cht_reply", 428 "question": "Click below to watch video and learn how to add your property to our site:<br><iframe width=\"100%\" src=\"https://www.youtube.com/embed/DVmwt6RHxrE\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" allowfullscreen></iframe><a href=\"/list-your-property\" style=\"text-decoration:underline;\">Then click here and enter the details of your property now.</a>. Type HELP or <a href=\"#\" onclick=\"$(\'#chatmessage\').val(\'HELP\');document.getElementById(\'chatsubmit\').click();\" style=\"text-decoration:underline;\">Click HELP</a> to see these options again. 😀", 429 "validation": "", 430 "answer": "" 431 } 432 ] 433 }; 434 435 localStorage.setObject('seriesData', series_json); 436 aFlushSeries(); 437 aChatSeries(true,''); 438 439 } else if (mrm.match(/(create|make|start)(.*?)account/gmi) || mrm == 'signup' || mrm == 'sign up' || mrm == 'log in' || mrm == 'login') { 440 var series_json = { 441 "series_name": "guest create account", 442 "series": true, 443 "redirect": current_url, 444 "questions": [ 445 { 446 "name": "cht_client_email", 447 "question": "😀 I can help with that! What's your email address?", 448 "validation": "email", 449 "answer": "" 450 }, 451 { 452 "name": "cht_client_name", 453 "question": "What's your name?", 454 //"condition": "nouser", 455 "validation": "notempty", 456 "answer": "" 457 } 458 ] 459 }; 460 461 localStorage.setObject('seriesData', series_json); 462 aFlushSeries(); 463 aChatSeries(true,''); 464 465 466 } else if (mrm.match(/(set up|setup|create|email|add)(.*?)(alert|update|property alert|property update)/gmi)) { 467 var series_json = { 468 "series_name": "guest property alert", 469 "series": true, 470 "redirect": current_url, 471 "questions": [ 472 { 473 "name": "cht_ptype", 474 "question": "One of our most popular requests 😀! What type of property are you searching for? Click an option: <br><a href=\"#\" class=\"btn btn-round btn-danger btn-xs\" style=\"padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px;height:unset;\" onclick=\"$(\'#chatmessage\').val(\'Single Family\');document.getElementById(\'chatsubmit\').click();\">Single Family</a><br><a href=\"#\" class=\"btn btn-round btn-primary btn-xs\" style=\"padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px;height:unset;\" onclick=\"$(\'#chatmessage\').val(\'Condominiums\');document.getElementById(\'chatsubmit\').click();\">Condominiums</a><br><a href=\"#\" class=\"btn btn-round btn-success btn-xs\" style=\"padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px;height:unset;\" onclick=\"$(\'#chatmessage\').val(\'Lots or Land\');document.getElementById(\'chatsubmit\').click();\">Lots or Land</a>", 475 "validation": "limit:single family|condominiums|lots or land", 476 "answer": "" 477 }, 478 { 479 "name": "cht_min_price", 480 "question": "What's your minimum price? (type for example $1, 10K or 100,000) or choose then click Save Choice:<br><select id=\"sonminprice\" onchange=\"$(\'#chatmessage\').val(this.value);\"><option value=\"1000\">$1,000</option><option value=\"5000\">$5,000</option><option value=\"10000\">$10,000</option><option value=\"25000\">$25,000</option><option value=\"50000\">$50,000</option><option value=\"100000\">$100,000</option><option value=\"150000\">$150,000</option><option value=\"200000\">$200,000</option><option value=\"250000\">
480$250,000</option><option value=\"300000\">$300,000</option><option value=\"350000\">$350,000</option><option value=\"400000\">$400,000</option><option value=\"450000\">$450,000</option><option value=\"500000\">$500,000</option><option value=\"750000\">$750,000</option><option value=\"1000000\">$1,000,000</option><option value=\"2000000\">$2,000,000</option><option value=\"3000000\">$3,000,000</option><option value=\"4000000\">$4,000,000</option><option value=\"5000000\">$5,000,000</option><option value=\"10000000\">$10,000,000</option></select> <a href=\"#\" class=\"btn btn-round btn-danger btn-xs\" style=\"padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px;height:unset;\" onclick=\"$(\'#chatmessage\').val($(\'#sonminprice\').val());document.getElementById(\'chatsubmit\').click();\">Save Choice</a>", 481 "validation": "numeric", 482 "answer": "" 483 }, 484 { 485 "name": "cht_max_price", 486 "question": "What's your maximum price? (type for example: 250K or 250,000) or choose then click Save Choice:<br> <select id=\"sonmaxprice\" onchange=\"$(\'#chatmessage\').val(this.value);\"><option value=\"99999999999\">No Maximum</option><option value=\"100000000\">$100,000,000</option><option value=\"10000000\">$10,000,000</option><option value=\"5000000\">$5,000,000</option><option value=\"4000000\">$4,000,000</option><option value=\"3000000\">$3,000,000</option><option value=\"2000000\">$2,000,000</option><option value=\"1000000\">$1,000,000</option><option value=\"750000\">$750,000</option><option value=\"500000\">$500,000</option><option value=\"450000\">$450,000</option><option value=\"400000\">$400,000</option><option value=\"350000\">$350,000</option><option value=\"300000\">$300,000</option><option value=\"250000\">$250,000</option><option value=\"200000\">$200,000</option><option value=\"150000\">$150,000</option><option value=\"100000\">$100,000</option><option value=\"50000\">$50,000</option><option value=\"25000\">$25,000</option><option value=\"10000\">$10,000</option><option value=\"5000\">$5,000</option></select> <a href=\"#\" class=\"btn btn-round btn-danger btn-xs\" style=\"padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px;height:unset;\" onclick=\"$(\'#chatmessage\').val($(\'#sonmaxprice\').val());document.getElementById(\'chatsubmit\').click();\">Save Choice</a>", 487 "validation": "numeric", 488 "answer": "" 489 }, 490 { 491 "name": "cht_min_beds", 492 "question": "How many bedrooms minimum? (type for example: 3 or three) or choose then click Save Choice:<br><select id=\"sonbedrooms\" onchange=\"$(\'#chatmessage\').val(this.value);\"><option value=\"1\">1</option><option value=\"2\">2</option><option value=\"3\">3</option><option value=\"4\">4</option><option value=\"5\">5</option><option value=\"6\">6</option><option value=\"7\">7</option><option value=\"8\">8</option><option value=\"9\">9</option><option value=\"10\">10</option></select> <a href=\"#\" class=\"btn btn-round btn-danger btn-xs\" style=\"padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px;height:unset;\" onclick=\"$(\'#chatmessage\').val($(\'#sonbedrooms\').val());document.getElementById(\'chatsubmit\').click();\">Save Choice</a>", 493 "validation": "numeric", 494 "condition": "cht_ptype:single family|condominiums", 495 "answer": "" 496 }, 497 { 498 "name": "cht_min_baths", 499 "question": "How many bathrooms minimum? (type for example: 2 or two) or choose then click Save Choice:<br><select id=\"sonbathsfull\" onchange=\"$(\'#chatmessage\').val(this.value);\"><option value=\"0\">0</option><option value=\"1\">1</option><option value=\"2\">2</option><option value=\"3\">3</option><option value=\"4\">4</option><option value=\"5\">5</option><option value=\"6\">6</option><option value=\"7\">7</option><option value=\"8\">8</option><option value=\"9\">9</option><option value=\"10\">10</option></select> <a href=\"#\" class=\"btn btn-round btn-danger btn-xs\" style=\"padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px;height:unset;\" onclick=\"$(\'#chatmessage\').val($(\'#sonbathsfull\').val());document.getElementById(\'chatsubmit\').click();\">
499Save Choice</a>", 500 "validation": "numeric", 501 "condition": "cht_ptype:single family|condominiums", 502 "answer": "" 503 } 504 , 505 { 506 "name": "cht_city", 507 "question": "Which city should it search? " + buildMultiSelectCity(), 508 "validation": "none", 509 "answer": "" 510 }, 511 { 512 "name": "cht_community_name", 513 "question": "Do you want to look in a specific community? <span id='bmsc'></span>", 514 "validation": "none", 515 "answer": "" 516 }, 517 { 518 "name": "cht_subdivision", 519 "question": "Should I search a specific subdivision? <span id='bmss'></span>", 520 "validation": "none", 521 "answer": "" 522 }, 523 { 524 "name": "cht_min_acres", 525 "question": "How many acres minimum? (type for example: 3 or three) or choose then click Save Choice:<br><select id=\"sonacres\" onchange=\"$(\'#chatmessage\').val(this.value);\"><option value=\"0\">Under 1 Acre</option><option value=\"1\">1</option><option value=\"2\">2</option><option value=\"3\">3</option><option value=\"4\">4</option><option value=\"5\">5</option><option value=\"6\">6</option><option value=\"7\">7</option><option value=\"8\">8</option><option value=\"9\">9</option><option value=\"10\">10</option><option value=\"15\">15</option><option value=\"20\">20</option><option value=\"30\">30</option><option value=\"40\">40</option><option value=\"50\">50</option><option value=\"100\">100</option></select> <a href=\"#\" class=\"btn btn-round btn-danger btn-xs\" style=\"padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px;height:unset;\" onclick=\"$(\'#chatmessage\').val($(\'#sonacres\').val());document.getElementById(\'chatsubmit\').click();\">Save Choice</a>", 526 "validation": "numeric", 527 "condition": "cht_ptype:lots or land", 528 "answer": "" 529 }, 530 { 531 "name": "cht_pool", 532 "question": "Only include properties with private pools? <a href=\"#\" class=\"btn btn-round btn-success btn-xs\" style=\"padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px;height:unset;\" onclick=\"$(\'#chatmessage\').val(\'Yes\');document.getElementById(\'chatsubmit\').click();\">Yes</a> <a href=\"#\" class=\"btn btn-round btn-danger btn-xs\" style=\"padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px;height:unset;\" onclick=\"$(\'#chatmessage\').val(\'No\');document.getElementById(\'chatsubmit\').click();\">No</a>", 533 "condition": "cht_ptype:single family", 534 "validation": "yesno", 535 "answer": "" 536 }, 537 { 538 "name": "cht_client_email", 539 "question": "What's your email address?", 540 "validation": "email", 541 "answer": "" 542 }, 543 { 544 "name": "cht_client_name", 545 "question": "What's your name?", 546 //"condition": "nouser", 547 "validation": "notempty", 548 "answer": "" 549 } 550 ] 551 }; 552 553 localStorage.setObject('seriesData', series_json); 554 aFlushSeries(); 555 aChatSeries(true,''); 556 557 } else if (mrm == 'triggergaa') { 558 559var series_json = { 560 "series_name": "results guest add alert", 561 "series": true, 562 "current_url": current_url, 563 "questions": [ 564 { 565 "name": "cht_client_email", 566 "question": "Want to receive new alerts for properties matching this search?<br><br> 😀 I can help with that! <br><br>What email address should we send your alerts to?", 567 "validation": "email", 568 "answer": "" 569 }, 570 { 571 "name": "cht_client_name", 572 "question": "What's your name?", 573 //"condition": "nouser", 574 "validation": "notempty", 575 "answer": "" 576 } 577 ] 578}; 579 580localStorage.setObject('seriesData', series_json); 581aFlushSeries(); 582aChatSeries(true,''); 583 584 585} else if (mrm.match(/find(.*?)(property|land|listing|house|home)/gmi)) { 586 var series_json = { 587 "series_name": "guest find property", 588 "series": true, 589 "questions": [ 590 { 591 "name": "cht_ptype", 592 "question": "I can help find what you need 😀! What type of property are you searching for? Click an option: <br><a href=\"#\" class=\"btn btn-round btn-danger btn-xs\" style=\"padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px;height:unset;\" onclick=\"$(\'#chatmessage\').val(\'Single Family\');document.getElementById(\'chatsubmit\').click();\">Single Family</a><br><a href=\"#\" class=\"btn btn-round btn-primary btn-xs\" style=\"padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px;height:unset;\" onclick=\"$(\'#chatmessage\').val(\'Condominiums\');document.getElementById(\'chatsubmit\').click();\">Condominiums</a><br><a href=\"#\" class=\"btn btn-round btn-success btn-xs\" style=\"padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px;height:unset;\" onclick=\"$(\'#chatmessage\').val(\'Lots or Land\');document.getElementById(\'chatsubmit\').click();\">Lots or Land</a>", 593 "validation": "limit:single family|condominiums|lots or land", 594 "answer": "" 595 }, 596 { 597 "name": "cht_min_price", 598 "question": "What's your minimum price? (type for example $1, 10K or 100,000) or choose then click Save Choice:<br><select id=\"sonminprice\" onchange=\"$(\'#chatmessage\').val(this.value);\"><option value=\"1000\">$1,000</option><option value=\"5000\">$5,000</option><option value=\"10000\">$10,000</option><option value=\"25000\">$25,000</option><option value=\"50000\">$50,000</option><option value=\"100000\">$100,000</option><option value=\"150000\">$150,000</option><option value=\"200000\">$200,000</option><option value=\"250000\">
598$250,000</option><option value=\"300000\">$300,000</option><option value=\"350000\">$350,000</option><option value=\"400000\">$400,000</option><option value=\"450000\">$450,000</option><option value=\"500000\">$500,000</option><option value=\"750000\">$750,000</option><option value=\"1000000\">$1,000,000</option><option value=\"2000000\">$2,000,000</option><option value=\"3000000\">$3,000,000</option><option value=\"4000000\">$4,000,000</option><option value=\"5000000\">$5,000,000</option><option value=\"10000000\">$10,000,000</option></select> <a href=\"#\" class=\"btn btn-round btn-danger btn-xs\" style=\"padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px;height:unset;\" onclick=\"$(\'#chatmessage\').val($(\'#sonminprice\').val());document.getElementById(\'chatsubmit\').click();\">Save Choice</a>", 599 "validation": "numeric", 600 "answer": "" 601 }, 602 { 603 "name": "cht_max_price", 604 "question": "What's your maximum price? (type for example: 250K or 250,000) or choose then click Save Choice:<br><select id=\"sonmaxprice\" onchange=\"$(\'#chatmessage\').val(this.value);\"><option value=\"99999999999\">No Maximum</option><option value=\"100000000\">$100,000,000</option><option value=\"10000000\">$10,000,000</option><option value=\"5000000\">$5,000,000</option><option value=\"4000000\">$4,000,000</option><option value=\"3000000\">$3,000,000</option><option value=\"2000000\">$2,000,000</option><option value=\"1000000\">$1,000,000</option><option value=\"750000\">$750,000</option><option value=\"500000\">$500,000</option><option value=\"450000\">$450,000</option><option value=\"400000\">$400,000</option><option value=\"350000\">$350,000</option><option value=\"300000\">$300,000</option><option value=\"250000\">$250,000</option><option value=\"200000\">$200,000</option><option value=\"150000\">$150,000</option><option value=\"100000\">$100,000</option><option value=\"50000\">$50,000</option><option value=\"25000\">$25,000</option><option value=\"10000\">$10,000</option><option value=\"5000\">$5,000</option></select> <a href=\"#\" class=\"btn btn-round btn-danger btn-xs\" style=\"padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px;height:unset;\" onclick=\"$(\'#chatmessage\').val($(\'#sonmaxprice\').val());document.getElementById(\'chatsubmit\').click();\">Save Choice</a>", 605 "validation": "numeric", 606 "answer": "" 607 }, 608 { 609 "name": "cht_min_beds", 610 "question": "How many bedrooms minimum? (type for example: 3 or three) or choose then click Save Choice:<br><select id=\"sonbedrooms\" onchange=\"$(\'#chatmessage\').val(this.value);\"><option value=\"1\">1</option><option value=\"2\">2</option><option value=\"3\">3</option><option value=\"4\">4</option><option value=\"5\">5</option><option value=\"6\">6</option><option value=\"7\">7</option><option value=\"8\">8</option><option value=\"9\">9</option><option value=\"10\">10</option></select> <a href=\"#\" class=\"btn btn-round btn-danger btn-xs\" style=\"padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px;height:unset;\" onclick=\"$(\'#chatmessage\').val($(\'#sonbedrooms\').val());document.getElementById(\'chatsubmit\').click();\">Save Choice</a>", 611 "validation": "numeric", 612 "condition": "cht_ptype:single family|condominiums", 613 "answer": "" 614 }, 615 { 616 "name": "cht_min_baths", 617 "question": "How many bathrooms minimum? (type for example: 2 or two) or choose then click Save Choice:<br><select id=\"sonbathsfull\" onchange=\"$(\'#chatmessage\').val(this.value);\"><option value=\"0\">0</option><option value=\"1\">1</option><option value=\"2\">2</option><option value=\"3\">3</option><option value=\"4\">4</option><option value=\"5\">5</option><option value=\"6\">6</option><option value=\"7\">7</option><option value=\"8\">8</option><option value=\"9\">9</option><option value=\"10\">10</option></select> <a href=\"#\" class=\"btn btn-round btn-danger btn-xs\" style=\"padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px;height:unset;\" onclick=\"$(\'#chatmessage\').val($(\'#sonbathsfull\').val());document.getElementById(\'chatsubmit\').click();\">
617Save Choice</a>", 618 "validation": "numeric", 619 "condition": "cht_ptype:single family|condominiums", 620 "answer": "" 621 } 622 , 623 { 624 "name": "cht_city", 625 "question": "Which city should it search?" + buildMultiSelectCity(), 626 "validation": "none", 627 "answer": "" 628 }, 629 { 630 "name": "cht_community_name", 631 "question": "Do you want to look in a specific community? <span id='bmsc'></span>", 632 "validation": "none", 633 "answer": "" 634 }, 635 { 636 "name": "cht_subdivision", 637 "question": "Should I search a specific subdivision? <span id='bmss'></span>", 638 "validation": "none", 639 "answer": "" 640 }, 641 { 642 "name": "cht_min_acres", 643 "question": "How many acres minimum? (type for example: 3 or three) or choose then click Save Choice:<br><select id=\"sonacres\" onchange=\"$(\'#chatmessage\').val(this.value);\"><option value=\"0\">Under 1 Acre</option><option value=\"1\">1</option><option value=\"2\">2</option><option value=\"3\">3</option><option value=\"4\">4</option><option value=\"5\">5</option><option value=\"6\">6</option><option value=\"7\">7</option><option value=\"8\">8</option><option value=\"9\">9</option><option value=\"10\">10</option><option value=\"15\">15</option><option value=\"20\">20</option><option value=\"30\">30</option><option value=\"40\">40</option><option value=\"50\">50</option><option value=\"100\">100</option></select> <a href=\"#\" class=\"btn btn-round btn-danger btn-xs\" style=\"padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px;height:unset;\" onclick=\"$(\'#chatmessage\').val($(\'#sonacres\').val());document.getElementById(\'chatsubmit\').click();\">Save Choice</a>", 644 "validation": "numeric", 645 "condition": "cht_ptype:lots or land", 646 "answer": "" 647 }, 648 { 649 "name": "cht_pool", 650 "question": "Only include properties with private pools? <a href=\"#\" class=\"btn btn-round btn-success btn-xs\" style=\"padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px;height:unset;\" onclick=\"$(\'#chatmessage\').val(\'Yes\');document.getElementById(\'chatsubmit\').click();\">Yes</a> <a href=\"#\" class=\"btn btn-round btn-danger btn-xs\" style=\"padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px;height:unset;\" onclick=\"$(\'#chatmessage\').val(\'No\');document.getElementById(\'chatsubmit\').click();\">No</a>", 651 "condition": "cht_ptype:single family", 652 "validation": "yesno", 653 "answer": "" 654 } 655 ] 656 }; 657 658 localStorage.setObject('seriesData', series_json); 659 aFlushSeries(); 660 aChatSeries(true,''); 661 662 } else if (mrm.match(/(current)(.*?)(link|url)/gmi)) { 663 var series_json = { 664 "series_name": "current link", 665 "series": false, 666 "questions": [ 667 { 668 "name": "cht_reply", 669 "question": "You are on: "+current_url+" Type HELP or <a href=\"#\" onclick=\"$(\'#chatmessage\').val(\'HELP\');document.getElementById(\'chatsubmit\').click();\" style=\"text-decoration:underline;\">Click HELP</a> to see these options again. 😀", 670 "validation": "", 671 "answer": "" 672 } 673 ] 674 }; 675 676 localStorage.setObject('seriesData', series_json); 677 aFlushSeries(); 678 aChatSeries(true,''); 679 680 } else if (mrm.match(/not what i want/gmi)) { 681 var series_json = { 682 "series_name": "guest not what i want", 683 "series": true, 684 "redirect": current_url, 685 "passthrough": [ 686 { 687 "mls_listing_id": "", 688 "type": "" 689 } 690 ], 691 "questions": [ 692 { 693 "name": "cht_what_you_think", 694 "question": "What needs to be different about this property?", 695 "validation": "notempty", 696 "answer": "" 697 }, 698 { 699 "name": "cht_client_email", 700 "question": "😀 We have powerful free tools available to help you find exactly the property you need. <br><br>To get access to the tools and get started now, What's your email address?", 701 "validation": "email", 702 "answer": "" 703 }, 704 { 705 "name": "cht_client_name", 706 "question": "What's your name?", 707 "validation": "notempty", 708 "answer": "" 709 } 710 ] 711 }; 712 713 localStorage.setObject('seriesData', series_json);
714 aFlushSeries(); 715 aChatSeries(true,''); 716 717 } else if (mrm.match(/close but no/gmi)) { 718 719 var series_json = { 720 "series_name": "guest close but no", 721 "series": true, 722 "redirect": current_url, 723 "passthrough": [ 724 { 725 "mls_listing_id": "", 726 "type": "" 727 } 728 ], 729 "questions": [ 730 { 731 "name": "cht_what_you_think", 732 "question": "What needs to be different about this property to make it perfect?", 733 "validation": "notempty", 734 "answer": "" 735 }, 736 { 737 "name": "cht_client_email", 738 "question": "😀 We have powerful free tools available to help you find exactly the property you need. <br><br>To get access to the tools and get started now, What's your email address?", 739 "validation": "email", 740 "answer": "" 741 }, 742 { 743 "name": "cht_client_name", 744 "question": "What's your name?", 745 "validation": "notempty", 746 "answer": "" 747 } 748 ] 749 }; 750 751 localStorage.setObject('seriesData', series_json); 752 aFlushSeries(); 753 aChatSeries(true,''); 754 755 } else if (mrm.match(/i like it/gmi)) { 756 757 var series_json = { 758 "series_name": "guest i like it", 759 "series": true, 760 "redirect": current_url, 761 "passthrough": [ 762 { 763 "mls_listing_id": "", 764 "type": "" 765 } 766 ], 767 "questions": [ 768 { 769 "name": "cht_client_email", 770 "question": "Glad you found something you like, let’s add it to your favorites!<br><br>To get started, What's your email address?", 771 "validation": "email", 772 "answer": "" 773 }, 774 { 775 "name": "cht_client_name", 776 "question": "What's your name?", 777 "validation": "notempty", 778 "answer": "" 779 } 780 ] 781 }; 782 783 localStorage.setObject('seriesData', series_json); 784 aFlushSeries(); 785 aChatSeries(true,''); 786 787 } else if (mrm == 'log into my account' ||mrm == 'sign into my account' || mrm == 'log in' || mrm == 'login' || mrm == 'signin' || mrm == 'sign in' || mrm == 'sing in' || mrm == 'singin') { 788 var series_json = { 789 "series_name": "sign in", 790 "series": false, 791 "questions": [ 792 { 793 "name": "cht_signin", 794 "question": "<a href=\"/auth/login\" style=\"text-decoration:underline;\">Click here to log in now.</a> Forgot your password? <a href=\"/password/email\" style=\"text-decoration:underline;\">Click here to reset your password.</a> Type HELP or <a href=\"#\" onclick=\"$(\'#chatmessage\').val(\'HELP\');document.getElementById(\'chatsubmit\').click();\" style=\"text-decoration:underline;\">Click HELP</a> to see options again.", 795 "validation": "none", 796 "answer": "" 797 } 798 ] 799 }; 800 801 localStorage.setObject('seriesData', series_json); 802 803 aFlushSeries(); 804 aChatSeries(true,''); 805 806 } else if (mrm.match(/Hi |Hello |can I |when will |when can |when I |where is |where does |where can |what is |what can |why is |why are |how are |how is |how do /gmi)) { 807 var series_json = { 808 "series_name": "guest get live agent catchall", 809 "series": true, 810 "redirect": current_url, 811 "questions": [ 812 { 813 "name": "cht_client_email", 814 "question": "I'm just a humble bot 😀 But I can help with that! What's your email address?", 815 "validation": "email", 816 "answer": "" 817 }, 818 { 819 "name": "cht_client_name", 820 "question": "What's your name?", 821 //"condition": "nouser", 822 "validation": "notempty", 823 "answer": "" 824 } 825 ] 826 }; 827 828 localStorage.setObject('seriesData', series_json); 829 aFlushSeries(); 830 aChatSeries(true,''); 831 832 833 } 834 } //func 835 836 837/*if(hide_the_chat) { 838 $('#'+ida+'chatbox').hide(); 839 //console.log('1412'); 840}*/ 841if(localStorage.getItem('chat_is_closed') === '1') { 842 console.log('chat_is_closed'); 843 $('#'+ida+'chatbox').hide(); 844} else { 845 console.log('chat_not_closed'); 846 //$('#'+ida+'chatbox').show(); 847}
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.