PageSourceSearch

https://ism.gov.in/Assets/js/support/query.js?v=1790265346

js ism.gov.in collected 2026-09-24 10:26:01 UTC 32,754 bytes, 783 lines download raw bytes

1let uploadedFile = [];
2let chatUploadedFile = [];
3const dataTransfer = new DataTransfer();
4const chatDataTransfer = new DataTransfer();
5
6var QueryController = {
7
8    RaiseQuery : function(){
9        document.getElementById("Category_id").addEventListener("change", function(event) {
10            const selectedValue = this.text;
11            const textBox = document.getElementById("Category_other");
12            const selectedText = event.target.options[event.target.selectedIndex].text;
13            // document.getElementById("outputText").textContent = selectedText
14            let html = "Type of " +  selectedText;
15            textBox.setAttribute("placeholder", html);
16        });
17
18        document.getElementById("Related_to").addEventListener("change", function() {
19            const selectedValue = this.value;
20            const textBox = document.getElementById("Related_to_other");
21            const dropDown = document.getElementById("Project_id");
22            const div = document.getElementById("Related_to_other_div");
23            const divDropdown = document.getElementById("Related_to_project_div");
24            
25            if(selectedValue == 3 || selectedValue == 4){
26                textBox.setAttribute("required", "true");
27                dropDown.value = "";
28                dropDown.removeAttribute("required");
29                div.removeAttribute("hidden");
30                divDropdown.setAttribute("hidden", "true");
31
32            }
33            else{
34                dropDown.setAttribute("required", "true");
35                textBox.value = "";
36                textBox.removeAttribute("required");
37                div.setAttribute("hidden", "true");
38                divDropdown.removeAttribute("hidden");
39
40
41                 $.ajax({
42                    url: "/support/query/get-project/"+selectedValue,
43                    type: 'get',
44                    success: function (response) {
45                        $('#Project_id').empty();
46                        $("#Project_id").append(
47                            $('<option>', {
48                                value: "",
49                                text: "Select Project"
50                            })
51                        );
52                        
53                        let i = 1;
54                        $.each(response.data, function (index, item) {
55                            $('#Project_id').append(
56                                $('<option>', {
57                                    value: item.id,
58                                    text: i+". "+ item.project_name
59                                })
60                            );
61                            i++;
62                        });
63                    },
64                    error: function () {
65                        alert('Error fetching state. Please try again.');
66                    }
67                });
68            }
69        });
70
71        document.getElementById("Segment_type").addEventListener("change", function() {
72            const selectedValue = this.value;
73            const textBox = document.getElementById("Segment_type_other");
74            const div = document.getElementById("Segment_type_other_div")
75            if(selectedValue == 7){
76                textBox.setAttribute("required", "true");
77                div.removeAttribute("hidden");
78            }
79            else{
80                textBox.removeAttribute("required");
81                div.setAttribute("hidden", "true");
82            }
83        });
84
85        document.getElementById("Ticket_type").addEventListener("change", function() {
86            const selectedValue = this.value;
87            const dropDown = document.getElementById("Parent_id");
88            const div = document.getElementById("existing_request");
89            const companyId = $("#Company_id").val();
90            
91            if(selectedValue == 2){
92                dropDown.setAttribute("required", "true");
93                div.removeAttribute("hidden");
94                $("#Parent_id").attr(
95                    "data-val-required",
96                    "Please select request type."
97                );
98                
99                $.ajax({
100                    url: "/support/query/get-ticket/"+companyId,
101                    type: 'get',
102                    success: function (response) {
103                        $('#Parent_id').empty();
104                        $("#Parent_id").append(
105                            $('<option>', {
106                                value: "",
107                                text: "Select Existing Request"
108                            })
109                        );
110                        
111                        $.each(response.data, function (index, item) {
112                            $('#Parent_id').append(
113                                $('<option>', {
114                                    value: item.id,
115                                    text:  item.ticket_no
116                                })
117                            );
118                        });
119                    },
120                    error: function () {
121                        alert('Error fetching state. Please try again.');
122                    }
123                });
124
125
126            }
127            else{
128                dropDown.removeAttribute("required");
129                div.setAttribute("hidden", "true");
130                dropDown.value = "";
131            }
132        });
133        
134        $(document).off("click", ".submitQuery").on("click", ".submitQuery", function(e)
135        { 
136            tinymce.triggerSave();
137            let summary = $("#Item_equipment_details").val();
138            if(!summary && summary.trim() === "")
139            {
140                e.preventDefault();
141                $("#errorSummaryMessage").html("Summary Cannot Be Blank");
142                return false;
143            }
144            $("#errorSummaryMessage").html("");
145            
146            let detailed = $("#Description").val();
147            if(!detailed && detailed.trim()  === "")
148            {
149                e.preventDefault();
150                $("#errorDescriptionMessage").html("Description Cannot Be Blank!");
151                return false;
152            }
153            
154            $("#errorDescriptionMessage").html("");
155            return true;
156        })
157
158    },
159
160    SupportingDocs : function(){
161        $(".uploadSupportDocs").change(function()
162        {
163            // $("#loader").show();
164            var inputId = this.id;
165            var fileInput = $(`#${inputId}`)[0];
166            if(!fileInput.files[0])
167            {
168                $("#loader").hide();
169                return;
170            }
171            
172            let supportingDocs = document.getElementById("Supporting_docs");
173            if(supportingDocs.files.length >= 3)
174            {
175                var modal =  new bootstrap.Modal(document.getElementById('errorMessageModal'));
176                $("#errorMessageModalBody").html("Max 3 Files Allowed");
177                $("#loader").hide();
178                modal.show();
179                return;   
180            }
181                
182            const allowedTypes = ['pdf', 'png', 'jpg', 'jpeg'];
183            const ext = fileInput.files[0].name.split('.').pop().toLowerCase();
184            if(fileInput.files[0].size > 10 * 1024 * 1024 || !allowedTypes.includes(ext))
185            {   
186                
187                var modal =  new bootstrap.Modal(document.getElementById('errorMessageModal'));
188                $("#errorMessageModalBody").html("Maximum file size allowed is up to 10 mb.</br>Only pdf, png, jpg, jpeg are allowed.");
189                $("#loader").hide();
190                modal.show();
191                return;   
192            }
193
194            dataTransfer.items.add(fileInput.files[0]);
195            supportingDocs.files = dataTransfer.files;
196
197            let fileUrl = URL.createObjectURL(fileInput.files[0]);
198            let supportDocsLength = supportingDocs.files.length - 1;
199
200            // Convert size to readable format
201            let sizeKB = (fileInput.files[0].size / 1024).toFixed(2);
202
203            // Create table preview
204            let html = `
205                <tr id="supportDocsRows_${supportDocsLength}">
206                    <td><a href="${fileUrl}" target="_blank">${fileInput.files[0].name}</a></td>
207                    <td>${sizeKB} KB</td>
208                    <td><button type="button" id="supportDocs_${supportDocsLength}" data-id="${supportDocsLength}" class="details-btn deleteSupportDocs"><i class="fa-regular fa-trash-can"></i></button></td>
209                </tr>
210            `;
211            $("#loader").hide();
212
213            $("#supportDocsTable").append(html);
214
215        }),
216
217        $(document).on("click", ".deleteSupportDocs", function(event){
218            var dataId = $(this).data("id");
219            dataTransfer.items.remove(dataId);
220
221            let supportingDocs = document.getElementById("Supporting_docs");
222            supportingDocs.files = dataTransfer.files;
223
224            let row = document.getElementById("supportDocsRows_"+dataId);
225            row.remove();
226        })
227    },
228
229    ChartSupportDocs : function(){
230        $(".uploadChatSupportDocs").change(function()
231        {
232            // $("#loader").show();
233            var inputId = this.id;
234            var fileInput = $(`#${inputId}`)[0];
235            if(!fileInput.files[0])
236            {
237                $("#loader").hide();
238                return;
239            }
240            
241            let chatSupportDocs = document.getElementById("Chat_media");
242            if(chatSupportDocs.files.length >= 3)
243            {
244                var modal =  new bootstrap.Modal(document.getElementById('errorMessageModal'));
245                $("#errorMessageModalBody").html("Max 3 Files Allowed");
246                $("#loader").hide();
247                modal.show();
248                return;   
249            }
250                
251            const allowedTypes = ['pdf', 'png', 'jpg', 'jpeg'];
252            const ext = fileInput.files[0].name.split('.').pop().toLowerCase();
253            if(fileInput.files[0].size > 10 * 1024 * 1024 || !allowedTypes.includes(ext))
254            {   
255                
256                var modal =  new bootstrap.Modal(document.getElementById('errorMessageModal'));
257                $("#errorMessageModalBody").html("Maximum file size allowed is up to 10 mb.</br>Only pdf, png, jpg, jpeg are allowed.");
258                $("#loader").hide();
259                modal.show();
260                return;   
261            }
262
263            chatDataTransfer.items.add(fileInput.files[0]);
264            chatSupportDocs.files = chatDataTransfer.files;
265
266            let fileUrl = URL.createObjectURL(fileInput.files[0]);
267            let chatSupportDocsLength = chatSupportDocs.files.length - 1;
268
269            // Convert size to readable format
270            let sizeKB = (fileInput.files[0].size / 1024).toFixed(2);
271
272            // Create table preview
273            let html = `
274                <tr id="chatSupportDocsRows_${chatSupportDocsLength}">
275                    <td><a href="${fileUrl}" target="_blank">${fileInput.files[0].name}</a></td>
276                    <td>${sizeKB} KB</td>
277                    <td><button type="button" id="supportDocs_${chatSupportDocsLength}" data-id="${chatSupportDocsLength}" class="details-btn deleteChatSupportDocs"><i class="fa-regular fa-trash-can"></i></button></td>
278                </tr>
279            `;
280            $("#loader").hide();
281
282            $("#supportDocsTable").append(html);
283            document.getElementById("chatDocsTable").removeAttribute("hidden");
284
285        }),
286
287        $(document).on("click", ".deleteChatSupportDocs", function(event){
288            var dataId = $(this).data("id");
289            chatDataTransfer.items.remove(dataId);
290
291            let chatSupportingDocs = document.getElementById("Chat_media");
292            chatSupportingDocs.files = chatDataTransfer.files;
293
294            let row = document.getElementById("chatSupportDocsRows_"+dataId);
295            row.remove();
296
297            let chatSupportDocsLength = chatSupportingDocs.files.length;
298            if(chatSupportDocsLength == 0)
299            {
300                document.getElementById("chatDocsTable").setAttribute("hidden", true);
301            }
302
303
304        }),
305
306        $(document).ready(function () {
307            tinymce.init({
308                selector: '.chatMessage',
309                license_key: 'gpl',
310                height: 300,
311                branding: false,
312                promotion: false,
313                statusbar: false, 
314                menubar: 'file edit insert format',
315                menu: {
316                    file: {
317                        title: 'File',
318                        items: 'print'
319                    }
320                },
321            });
322            $.validator.unobtrusive.parse("#Message");
323        })
324
325        $(document).off("click", ".addComment").on("click", ".addComment", function(e)
326        {   
327            $("#processing-loader").show();
328            tinymce.triggerSave();
329            let message = $(".chatMessage").val();
330            if(!message && message.trim()  === "")
331            {
332                e.preventDefault();
333                $(".errorChatMessage").html("Please enter the message!");
334                $("#processing-loader").hide();
335                return false;
336            }
337            $(".errorChatMessage").html("");
338            return true;
339        })
340
341        $(document).off("click", ".addNodalComment").on("click", ".addNodalComment", function(e)
342        {   
343            $("#processing-loader").show();
344            tinymce.triggerSave();
345            let receiver = $("#Receiver_id").val();
346            if(!receiver && receiver.trim() === "")
347            {
348                e.preventDefault();
349                $(".errorChatMessage").html("Please select nodal!");
350                $("#processing-loader").hide();
351                return false;
352            }
353            
354            let message = $(".chatMessage").val();
355            if(!message && message.trim()  === "")
356            {
357                e.preventDefault();
358                $(".errorChatMessage").html("Please enter the message!");
359                $("#processing-loader").hide();
360                return false;
361            }
362            $(".errorChatMessage").html("");
363            return true;
364        })
365    },
366
367    Chat: function(){
368        $(document).off('click', '.reopen').on('click', '.reopen', function(){
369            $("#processing-loader").show();
370            let guid = $(this).data("guid");
371            let html = "<div><h6 class='text-center' id='errorMessage' style='color:red;'></h6>"
372            html += "<h6 class='text-center' id='successMessage' style='color:green;'></h6></div>";
373            html += "<h5>Do you really want to re-open the ticket?</h5>";
374            html += `<div class='mt-1'><button type='button' class='btn btn-outline-primary m-1 finalReopen' data-guid='${guid}'>Yes</button>`;
375            html += `<button type='button' class='btn btn-outline-primary m-1' data-bs-dismiss="modal">No</button></div>`;
376            $("#commonModalTitle").text("Confirm");
377            $('#commonModalBody').html(html);
378            $("#commonModalDialogSize").addClass("modal-lg");
379            $.validator.unobtrusive.parse("#commonModalBody");
380            var modal =  new bootstrap.Modal(document.getElementById('commonModal'));
381            modal.show();
382            $("#processing-loader").hide();
383        })
384
385
386
387        $(document).off('click', '.finalReopen').on('click', '.finalReopen', function(){
388            $("#processing-loader").show();
389            let guid = $(this).data("guid");
390            console.log(guid);
391            $.ajax({
392                url: "/support/query/reopen/"+guid,
393                type: 'post',
394                success: function (response) {
395                    window.location.reload();
396                    $("#processing-loader").hide();
397                },
398                error: function () {
399                    $("#processing-loader").hide();
400                    alert('Error fetching state. Please try again.');
401
402                }
403            })
404        })
405
406
407        $(document).off('click', '.closed').on('click', '.closed', function(){
408            $("#processing-loader").show();
409            let guid = $(this).data("guid");
410            let html = "<div><h6 class='text-center' id='errorMessage' style='color:red;'></h6>"
411            html += "<h6 class='text-center' id='successMessage' style='color:green;'></h6></div>";
412            html += "<h5>Do you really want to close the ticket?</h5>";
413            html += `<div class='mt-1'><button type='button' class='btn btn-outline-primary m-1 finalClose' data-guid='${guid}'>Yes</button>`;
414            html += `<button type='button' class='btn btn-outline-primary m-1' data-bs-dismiss="modal">No</button></div>`;
415            $("#commonModalTitle").text("Confirm");
416            $('#commonModalBody').html(html);
417            $("#commonModalDialogSize").addClass("modal-lg");
418            $.validator.unobtrusive.parse("#commonModalBody");
419            var modal =  new bootstrap.Modal(document.getElementById('commonModal'));
420            modal.show();
421            $("#processing-loader").hide();
422        })
423
424        $(document).off('click', '.finalClose').on('click', '.finalClose', function(){
425            $("#processing-loader").show();
426            let guid = $(this).data("guid");
427            $.ajax({
428                url: "/support/query/closed/"+guid,
429                type: 'post',
430                success: function (response) {
431                    
432                    window.location.reload();
433                    $("#processing-loader").hide();
434                },
435                error: function () {
436                    $("#processing-loader").hide();
437                    alert('Error fetching state. Please try again.');
438                }
439            })
440        })
441    },
442
443    WorkFlow: function(){
444        $(".changeStatus").on("click", function(){
445            console.log("change status");
446
447            let guid = $(this).data("guid");
448            console.log(guid);
449            
450
451            $("#commonModalTitle").text("Add Document");
452            $('#commonModalBody').html("status");
453            $("#commonModalDialogSize").addClass("modal-lg");
454            $("#commonModalBody").removeAttr('style');
455            $.validator.unobtrusive.parse("#commonModalBody");
456            var modal =  new bootstrap.Modal(document.getElementById('commonModal'));
457            modal.show();
458        })
459
460        $(document).off('click', '.initiateClose').on('click', '.initiateClose', function(){
461            $("#processing-loader").show();
462            let guid = $(this).data("guid");
463            let html = "<div><h6 class='text-center' id='errorMessage' style='color:red;'></h6>"
464            html += "<h6 class='text-center' id='successMessage' style='color:green;'></h6></div>";
465            html += "<textarea class='form-control' style='min-height: 100px' id='closeRemarks'></textarea>";
466            html += `<button type='button' class='btn btn-outline-primary mt-3 finalInitiateClose' data-guid='${guid}'>Initiate Close</button>`;
467            $("#commonModalTitle").text("Please enter the remarks for initiating closure of ticket.");
468            $('#commonModalBody').html(html);
469            $("#commonModalDialogSize").addClass("modal-lg");
470            $.validator.unobtrusive.parse("#commonModalBody");
471            var modal =  new bootstrap.Modal(document.getElementById('commonModal'));
472            modal.show();
473            $("#processing-loader").hide();
474        })
475        
476        $(document).off('click', '.finalInitiateClose').on('click', '.finalInitiateClose', function(){
477            $("#processing-loader").show();
478            let remarks = $("#closeRemarks").val();
479            let guid = $(this).data("guid");
480            if(remarks == '')
481            {
482                $("#processing-loader").hide();
483                $("#errorMessage").text("Remarks cannot be blank");
484                return;
485            }
486            $("#errorMessage").text("");
487
488            $.ajax({
489                url: "/support/query/initiate-close/"+guid,
490                type: 'post',
491                data: { remarks: remarks },
492                success: function (response) {
493                    $("#processing-loader").hide();
494                    $("#successMessage").text("Initiated for closure");
495                    window.location.reload();
496                },
497                error: function () {
498                    $("#processing-loader").hide();
499                    alert('Error fetching state. Please try again.');
500                }
501            })
502        })
503        
504
505        $(".referUser").on("click", function(){
506            $("#processing-loader").show();
507            let guid = $(this).data("guid");
508            $.ajax({
509                url: "/support/query/get-referred-user/"+guid,
510                type: "get",
511                success: function(res){
512                    var modal =  new bootstrap.Modal(document.getElementById('commonModal'));
513                    $("#commonModalTitle").text("Referred SPOC/Nodal Officer List");
514                    $('#commonModalBody').html(res);
515                    $("#commonModalDialogSize").addClass("modal-lg");
516                    $("#commonModalBody").removeAttr('style');
517                    $.validator.unobtrusive.parse("#commonModalBody");
518                    modal.show();
519                    $("#processing-loader").hide();
520                },
521                error : function(event)
522                {
523                    alert("Error while fetching. Please try again.");
524                    window.location.reload();
525                    $("#processing-loader").hide();
526                }
527            }) 
528        })
529
530        $(document).off('click', '.backReferUser').on('click', '.backReferUser', function(){
531            $("#processing-loader").show();
532            let guid = $(this).data("guid");
533            $.ajax({
534                url: "/support/query/get-referred-user/"+guid,
535                type: "get",
536                success: function(res){
537                    $("#commonModalTitle").text("Referred SPOC/Nodal Officer List");
538                    $('#commonModalBody').html(res);
539                    $("#commonModalDialogSize").addClass("modal-lg");
540                    $("#commonModalBody").removeAttr('style');
541                    $("#processing-loader").hide();
542                },
543                error : function(event)
544                {
545                    alert("Error while fetching. Please try again.");
546                    window.location.reload();
547                    $("#processing-loader").hide();
548                }
549            })
550        })
551
552        $(document).off('click', '.addReferUser').on('click', '.addReferUser', function(){
553            $("#processing-loader").show();
554            let guid = $(this).data("guid");
555            $.ajax({
556                url: "/support/query/refer/"+guid,
557                type: 'get',
558                success: function (res) {
559                    $("#commonModalTitle").text("Refer");
560                    $('#commonModalBody').html(res);
561                    $("#commonModalDialogSize").addClass("modal-lg");
562                    $("#commonModalBody").removeAttr('style');
563                    $.validator.unobtrusive.parse("#commonModalBody");
564                    $("#processing-loader").hide();
565                },
566                error: function () {
567                    alert('Error fetching state. Please try again.');
568                    window.location.reload();
569                    $("#processing-loader").hide();
570                }
571            }) 
572
573        })
574
575        $(document).off('click', '.saveReferUser').on("click", ".saveReferUser", function(){
576            var formData = $('#referUserForm').serializeArray();
577            var userId = formData.find(x => x.name === 'User_id');
578            var ticketPermission = formData.find(x => x.name === 'Ticket_permission');
579
580            if (userId == "" || !ticketPermission) {
581                return;
582            }
583            
584            $("#processing-loader").show();
585            $.ajax({
586                url: "/support/query/add-refer-user/",
587                type: 'post',
588                data: formData,
589                success: function (res) {
590                    if(res)
591                    {
592                        if(res.success)
593                        {
594                            let success = "<span style='color:green'>"+res.message+"</span>"
595
596                            $.ajax({
597                                url: "/support/query/get-referred-user/"+res.ticketGuid,
598                                type: "get",
599                                success: function(res){
600                                    $("#commonModalTitle").text("Referred SPOC/Nodal Officer List");
601                                    $('#commonModalBody').html(res);
602                                    $("#commonModalDialogSize").addClass("modal-lg");
603                                    $("#commonModalBody").removeAttr('style');
604                                    $("#message").html(success);
605                                    $("#processing-loader").hide();
606                                },
607                                error : function(event)
608                                {
609                                    alert("Error while fetching. Please try again.");
610                                    window.location.reload();
611                                    $("#processing-loader").hide();
612                                }
613                            }) 
614
615                        }
616                        else
617                        {
618                            let error = "<span style='color:red'>"+res.message+"</span>"
619                            $("#message").html(error);
620                            $("#loader").hide();
621                        }
622                    }
623                    
624                },
625                error: function () {
626                    alert('Error fetching state. Please try again.');
627                    window.location.reload();
628                    $("#processing-loader").hide();
629                }
630            }) 
631
632
633        })
634
635        $(document).off('click', '.unassignUser').on('click', '.unassignUser', function(){
636            let assignedId = $(this).data("id");
637            if (confirm("Do you really want to unassign?")) {
638                $.ajax({
639                url: "/support/query/unassign-referred-user/"+assignedId,
640                type: 'post',
641                success: function (res) {
642                    window.location.reload();
643                    $("#processing-loader").hide();
644                },
645                error: function () {
646                    alert('Error fetching state. Please try again.');
647                    window.location.reload();
648                    $("#processing-loader").hide();
649                }
650            }) 
651            }
652        })
653
654        $(document).off('click', '.editReferredUser').on('click', '.editReferredUser', function(){
655            $("#processing-loader").show();
656            let ticketGuid = $(this).data("ticket-guid");
657            let ticketAssignedGuid = $(this).data("guid");
658            $.ajax({
659                url: "/support/query/edit-referred-user/"+ticketGuid+"/"+ticketAssignedGuid,
660                type: "get",
661                success: function(res){
662                    $("#commonModalTitle").text("Edit Referred User");
663                    $('#commonModalBody').html(res);
664                    $("#commonModalDialogSize").addClass("modal-lg");
665                    $("#commonModalBody").removeAttr('style');
666                    $.validator.unobtrusive.parse("#commonModalBody");
667                    $("#processing-loader").hide();
668                },
669                error : function(event)
670                {
671                    alert("Error while fetching. Please try again.");
672                    window.location.reload();
673                    $("#processing-loader").hide();
674                }
675            })
676        })
677
678        $(document).off('click', '.updateReferredUser').on('click', '.updateReferredUser', function(){
679            var error;
680            var formData = $('#referUserForm').serializeArray();
681            var guid = formData.find(x => x.name === 'Guid')?.value;
682            var ticketPermission = formData.find(x => x.name === 'Ticket_permission');
683            if (!guid || guid.trim() === "") {
684                error = "Something Went Wrong!";
685                document.getElementById("message").textContent = error;
686                document.getElementById("message").style.color = 'red';
687                return;
688            }
689
690            if (!ticketPermission)
691            {
692                error = "Please select atleast one permission";
693                document.getElementById("message").textContent = error;
694                document.getElementById("message").style.color = 'red';
695                return;
696            }
697
698            document.getElementById("message").textContent = '';
699            document.getElementById("message").style.color = '';
700
701            $("#processing-loader").show();
702            $.ajax({
703                url: "/support/query/edit-referred-user/",
704                type: 'post',
705                data: formData,
706                success: function (res) {
707                    if(res)
708                    {
709                        if(res.success)
710                        {
711                            let success = "<span style='color:green'>"+res.message+"</span>"
712
713                            $.ajax({
714                                url: "/support/query/get-referred-user/"+res.ticketGuid,
715                                type: "get",
716                                success: function(res){
717                                    $("#commonModalTitle").text("Referred SPOC/Nodal Officer List");
718                                    $('#commonModalBody').html(res);
719                                    $("#commonModalDialogSize").addClass("modal-lg");
720                                    $("#commonModalBody").removeAttr('style');
721                                    $("#message").html(success);
722                                    $("#processing-loader").hide();
723                                },
724                                error : function(event)
725                                {
726                                    alert("Error while fetching. Please try again.");
727                                    window.location.reload();
728                                    $("#processing-loader").hide();
729                                }
730                            }) 
731
732                        }
733                        else
734                        {
735                            let error = "<span style='color:red'>"+res.message+"</span>"
736                            $("#message").html(error);
737                            $("#processing-loader").hide();
738                        }
739                    }
740                },
741                error: function () {
742                    alert('Error fetching state. Please try again.');
743                    window.location.reload();
744                    $("#processing-loader").hide();
745                }
746            })
747        })
748
749        $(document).off('click', '.showReference').on('click', '.showReference', function(){
750            $("#processing-loader").show();
751            let id = $(this).data('id');
752            let name = $(this).data('name');
753            let ticketId = $(this).data('ticket');
754            let url = `/support/query/get-reference-message/${name}/${id}/${ticketId}`;
755
756            $.ajax({
757                url: url,
758                type: "get",
759                success: function(res){
760                    const modalEl = document.getElementById('commonModal');
761                    var modal = bootstrap.Modal.getInstance(modalEl);
762                    $("#commonModalTitle").text("Reference Message");
763                    $('#commonModalBody').html(res.message);
764                    $("#commonModalDialogSize").addClass("modal-lg");
765                    $("#commonModalBody").removeAttr('style');
766                    $.validator.unobtrusive.parse("#commonModalBody");
767
768                    if (!modal) {
769                        modal = new bootstrap.Modal(modalEl);
770                    }
771                    modal.show();
772                    $("#processing-loader").hide();
773                },
774                error : function(event)
775                {
776                    alert("Error while fetching. Please try again.");
777                    window.location.reload();
778                    $("#processing-loader").hide();
779                }
780            })
781        })
782    }
783}

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.