PageSourceSearch

https://www.turismecunit.cat/wp-content/plugins/javo-core/inc/Addons/ManagerPro/dist/js/frontend.js?ver=6.8.1

js turismecunit.cat collected 2026-10-09 17:29:22 UTC 17,189 bytes, 1 lines download raw bytes

1!function(t){var e,n=0,s={};let a=-1,o=!1,i=function(e,n){let s=t(".spinner-border",e);n?(e.removeClass("disabled").prop("disalbed",!1),s.addClass("d-none")):(e.addClass("disabled").prop("disalbed",!0),s.removeClass("d-none"))};function r(e,n,s,o){console.log(`Updating answer for ${e} with values:`,n),t.ajax({url:match_args.ajax_url,type:"POST",data:{action:"lvlt_save_match_questions",request_id:a,listing_type:t(".matching-wrap").data("listing-type"),meta_key:e,meta_values:n,meta_type:s},dataType:"json",success:function(t){a=t.request_id,console.log("Update successful for ",e),"function"==typeof o&&o()},error:function(t){console.error("Error updating answer for ",e,t)}})}function c(i){let p=new Array;var m="question-"+(n+1),f="informative"===i.meta_type?'<span class="ms-2 feather feather-info" data-bs-toggle="tooltip" data-bs-placement="top" title="Informative : It\'s not for matching or searching. It\'s just displaying additional information."></span>':"",b=i.value?i.value.split(","):[],g=`\n        <div class="question pt-3 d-flex flex-column align-items-start" id="${m}" data-meta-key="${i.key}" data-meta-type="${i.meta_type}">\n            <h4 class="question-title py-3 px-4 rounded bg-white shadow-sm d-inline-block">${i.question}${f}</h4>\n            <div class="question-content py-4 px-5 rounded mt-3 mb-5 bg-white shadow-sm" data-bs-toggle="tooltip" data-bs-placement="right" title="${i.description}">\n                <div class="options">`;switch(i.type){case"textarea":case"number":case"date":var v="date"===i.type?"text":i.type;g+=`\n                <div class="form-group">\n                    <input type="${v}" id="${m}-${i.type}" name="${i.field}" class="form-control ${"date"===i.type?"datepicker":""}" value="${i.value||""}" placeholder="${i.placeholder}">\n                </div>`;break;case"checkbox":case"radio":t.each(i.options,(function(t,e){var n=b.indexOf(t.toString())>-1?" checked":"";g+=`\n        <div class="form-check mb-2 py-2">\n            <input type="${i.type}" id="${m}-option-${t}" name="${i.field}" value="${t}" class="form-check-input"${n}>\n            <label class="form-check-label" for="${m}-option-${t}">${e}</label>\n        </div>`}));break;case"selectpicker":g+=`\n                    <div class="form-group">\n                        <select id="${m}-select" name="${i.field}" class="form-control selectpicker" data-live-search="true">\n                    `,t.each(i.options,(function(t,e){g+=`<option value="${t}">${e}</option>`})),g+="\n                        </select>\n                    </div>",p.push((function(e){const n=t("select.selectpicker:not(.bind)",e);i.selectpicker_options.width="100%",i.selectpicker_options.multiple&&n.prop("multiple",!0),n.selectpicker(i.selectpicker_options),i.value&&n.selectpicker("val",i.value.split(","))}));break;case"slide":g+=`\n                    <div class="${m}-slider price-slider-wrap my-4" data-offset-min="${i.offset_min}" data-offset-max="${i.offset_max}"></div>\n                    <input type="hidden" class="form-control" id="${m}-slide-min" name="${i.field}_min" value="${i.value||""}">\n                    <input type="hidden" class="form-control" id="${m}-slide-max" name="${i.field}_max" value="${i.value||""}">\n                `,b=b.length?b:[parseInt(i.slide_options.numeric_slide_min)||0,parseInt(i.slide_options.numeric_slide_max)||100],p.push((function(e){const n=t("."+m+"-slider",e),s=t("#"+m+"-slide-min",e),a=t("#"+m+"-slide-max",e);noUiSlider.create(n.get(0),{start:[parseFloat(b[0]),parseInt(b[1])],connect:!0,range:{min:parseInt(i.slide_options.numeric_slide_min)||0,max:parseInt(i.slide_options.numeric_slide_max)||100},format:wNumb({decimals:0}),tooltips:[wNumb({decimals:0,thousand:","}),wNumb({decimals:0,thousand:","})]}),n.get(0).noUiSlider.on("update",(function(t,e){let n=parseInt(i.slide_options.offset_min),o=parseInt(i.slide_options.offset_max);s.val(parseInt(t[0])-n),a.val(parseInt(t[1])+o).trigger("change")}))}));break;case"text":g+=`\n                <div class="form-group">\n                    <input type="text" id="${m}-text" name="${i.field}" class="form-control" value="${i.value||""}" placeholder="${i.placeholder}">\n                </div>`}g+=`\n                </div>\n                <button type="button" class="btn btn-primary btn-lg question-complete-button" disabled>${i.buttonText}</button>\n            </div>\n        </div>`;let y=t(g);for(let t of p)"function"==typeof t&&t(y);t("#questionArea").append(y);[].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]')).map((function(t){return new bootstrap.Tooltip(t)}));"date"===i.type&&t("#"+m+"-date").datepicker({dateFormat:"yy-mm-dd"}),function(e){t("#"+e+" .form-control, #"+e+" .form-check-input").on("change input",(function(){console.log("changed"),t("#"+e+" .question-complete-button").prop("disabled",!1),l(e)})),o&&(console.log("System is in edit mode - enabling buttons"),t("#"+e+" .question-complete-button").prop("disabled",!1))}(m),function(o){t("#"+o+" .question-complete-button").on("click",(function(){var i,p=e[n],m=t("#"+o).data("meta-type"),f=new Array,b=t(this);switch(b.prop("disabled",!0),b.html(`<span class="button-text">${b.text()}</span><span class="spinner-grow spinner-grow-sm text-light" role="status" aria-hidden="true" style="visibility: hidden;"></span>`),t(".button-text",b).css("transform","translateX(-10px)"),t(".spinner-grow",b).css("visibility","visible"),console.log(p.type),p.type){case"checkbox":case"radio":i=t("#"+o+" input:checked").map((function(){return this.value})).get(),f=t("#"+o+" input:checked").map((function(){return t(this).next("label").text()})).get();break;case"selectpicker":i=(t("#"+o+" select.form-control").val()+",").split(",").filter(
1Boolean),(t("#"+o+" select.form-control").val()+",").split(",").map((function(t,e){p.options[t]&&f.push(p.options[t])}));break;case"slide":i=[t("#"+o+" .form-control[name="+p.field+"_min]").val(),t("#"+o+" .form-control[name="+p.field+"_max]").val()],f=new Array(i[0]+" ~ "+i[1]);break;default:i=[t("#"+o+" .form-control").val()],f=i}s[p.field]=i.join(", "),r(p.field,i,m,(function(){var s=`\n        <div class="question-answer d-flex flex-column align-items-end justify-content-end w-100"\n            data-question-name="${p.field}"\n            data-question-answer="${i.join(",")}">\n            <div class="py-3 px-3 rounded bg-secondary text-white shadow-sm">\n                ${f.join(", ")}\n            </div>\n            <button type="button" class="btn edit-answer fw-semibold" data-id="${o}" data-field="${p.field}">Edit</button>\n        </div>`;!function(e,n){t("#"+e).append(n),t("#"+e+" .question-content").hide(),t("#"+e+" .question-answer").show()}(o,s),"informative"!==p.meta_type&&u(o,p.key),setTimeout((function(){n<e.length-1&&(n++,c(e[n]),l("question-"+(n+1)))}),1e3),d(),b.html(p.buttonText).prop("disabled",!1)})),setTimeout((function(){var s;n===e.length-1&&(s='\n            <div class="submit-button-container text-center mt-4">\n                <button type="button" class="btn btn-primary btn-lg submit-button">Submit</button>\n            </div>',t("#questionArea").append(s),t(".submit-button").on("click",(function(){const e=t(this);e.addClass("disabled").prop("disabled",!0);let n=h();var s;t(".toast-body",n).html(match_args.strings.match_submitted_completed),n.show(),s=function(t){console.log("All questions completed, responses submitted!"),t.success&&(window.location.href=match_args.match_list_redirect),e.addClass("disabled").prop("disabled",!0)},t.ajax({url:match_args.ajax_url,type:"POST",data:{action:"lvlt_submit_match_request",request_id:a},dataType:"json",success:function(t){console.log("Submit successful"),"function"==typeof s&&s(t)},error:function(t){console.error("Error during submission",t)}})})))}),1e3)}))}(m)}function l(e){var n=t("#questionArea"),s=t("#"+e);console.log("questionId"+e),s.length?n.animate({scrollTop:s.position().top+n.scrollTop()},500):console.log("Target element does not exist:",e)}function d(){var s=(n+1)/e.length*100;t(".progress-bar").css("width",s+"%").attr("aria-valuenow",s).text(Math.round(s)+"%")}function u(n,o){var i={};for(var r in s)s.hasOwnProperty(r)&&e.find((t=>t.field===r&&"informative"!==t.meta_type))&&(i[r]=s[r]);console.log("All non-informative questions and answers:",i);t("#"+n+" .edit-answer").after('<div class="search-results-spinner"><span class="spinner-grow spinner-grow-sm" aria-hidden="true"></span><span role="status">Loading...</span></div>'),t.ajax({url:match_args.ajax_url,type:"POST",data:{action:"fetch_search_results_count",request_id:a,questionKey:o,answers:i,listing_type:t(".matching-wrap").data("listing-type"),_ajax_nonce:match_args.nonce},success:function(e){if(t("#"+n+" .search-results-spinner").remove(),e.success){var s=e.data.searchResultsCount,a=`\n                        <div class="search-results-count">Expected Matching: ${s}\n                            <a class="helper-popover" data-bs-toggle="popover" tabindex="0" data-bs-trigger="focus hover"\n                                data-bs-html="true"\n                                data-bs-title="Expected Result"\n                                data-bs-content="This number represents the estimated count of bands related to your selected matching criteria.<br>It serves as a rough estimate to assist you in determining your matching preferences.<br>However, the actual outcome may vary depending on factors such as band approval.">\n                                <i class="feather feather-help-circle"></i>\n                            </a>\n                        </div>`;t("#"+n+" .edit-answer").after(a),t("#"+n+" .helper-popover").popover();!function(t,e,n,s){let a=0;const o=e-5;function i(){a<o?(a++,t.text(a),setTimeout(i,n/o)):a<e&&(a++,t.text(a),setTimeout(i,s/5))}i()}(t("#total-matching-number"),s,1e3,3e3)}else console.log("Error: ",e.data)},error:function(e){t("#"+n+" .search-results-spinner").remove(),console.log("Failed to fetch search result count",e)}})}t(document).on("click",".edit-answer",(function(){var e=t(this).data("id"),n=t(this).data("field"),a=t("#"+e).data("meta-type"),o=t("#"+e+" .question-content"),i=t("#"+e+" .question-complete-button");o.show(),l(e),t(this).removeClass("edit-answer").addClass("cancel-edit").text("Cancel Edit"),i.text("Save").removeClass("btn-primary").addClass("btn-secondary"),i.off("click").on("click",(function(){var i,c=new Array;t("#"+e+' input[type="checkbox"], #'+e+' input[type="radio"]').length>
10?(c=t("#"+e+" input:checked").map((function(){return t(this).next("label").text()})).get(),i=t("#"+e+" input:checked").map((function(){return this.value})).get()):t("#"+e+" select.form-control").length>0?(i=(t("#"+e+" select.form-control").val()+",").split(",").filter(Boolean),t("#"+e+" select.form-control option:selected").each((function(){c.push(t(this).text())}))):t("#"+e+" .form-control[name="+n+"_min]").length>0?(i=[t("#"+e+" .form-control[name="+n+"_min]").val(),t("#"+e+" .form-control[name="+n+"_max]").val()],console.log(i),c=new Array(i[0]+" ~ "+i[1])):(c=[t("#"+e+" .form-control").val()],i=c),s[n]=i.join(", "),r(n,i,a,(function(){var s=`\n                <div class="question-answer d-flex flex-column align-items-end justify-content-end w-100"\n                    data-question-name="${n}"\n                    data-question-answer="${i.join(",")}">\n                    <div class="py-3 px-3 rounded bg-secondary text-white shadow-sm">\n                        ${c.join(", ")}\n                    </div>\n                    <button type="button" class="btn edit-answer fw-semibold" data-id="${e}" data-field="${n}">Edit</button>\n                </div>`;t("#"+e+" .question-answer").replaceWith(s),o.hide(),"informative"!==a&&u(e,n),t(this).removeClass("btn-secondary").addClass("btn-primary").text("Edit").off("click"),t(this).removeClass("cancel-edit").addClass("edit-answer")}))}))})),t(document).on("click",".cancel-edit",(function(){var e=t(this).data("id"),n=t("#"+e+" .question-content"),s=t("#"+e+" .question-complete-button");n.hide(),t(this).removeClass("cancel-edit").addClass("edit-answer").text("Edit"),s.text("Edit").removeClass("btn-secondary").addClass("btn-primary").removeClass("save-edit"),l(e)}));const p=function(){const e=t(this),n=e.closest(".matched-listings"),s=t(".matched-lists",n),a=e.data("request-id");i(e,!1),function(e,n){t.ajax({url:match_args.ajax_url,type:"POST",data:{action:"lvlt_save_matched_listings",request_id:e,listing_type:t(".lvlt-match-list-wrap").data("listing-type")},dataType:"json",success:function(t){"function"==typeof n&&n(t)},error:function(t){console.error("Error during submission",t)}})}(a,(function(n){const a=e.closest(".accordion-item"),o=n.data.response||{};t.each(o,(function(e,n){t(".request-status-count.status-"+e,a).find("i").html(n)})),s.html(n.data.render),i(e,!0);[].slice.call(document.querySelectorAll('[data-bs-toggle="popover"]')).map((function(t){return new bootstrap.Popover(t)}))}))},m=function(){const e=t(this),n=t(this).closest(".list-group-item"),s=t(this).closest(".result-match-actions"),a=n.data("listing-id"),o=n.data("request-id"),r=e.data("response"),c=function(t){t.closest(".reason-form").addClass("d-none")};s.on("click",".reason-cancel",(function(e){const n=t(this);c(n)})),s.on("click",".reason-submit",(function(n){const l=t(this),d=l.closest(".reason-form");i(e,!1),c(l),function(e,n,s,a,o,i){t.ajax({url:match_args.ajax_url,type:"POST",data:{action:"lvlt_set_matched_listing_response",request_id:e,listing_id:n,response:s,message:a,price_bidding:o},dataType:"json",success:function(t){"function"==typeof i&&i(t)},error:function(t){console.error("Error during submission",t)}})}(o,a,r,t("textarea.reason-msg",d).val(),t("input.price-bidding",d).val(),(function(n){const a=t("button.btn-request-response[data-response="+r+"]",s);i(e,!0),t(".button-label",a).html(a.data("after-string")),t("button.btn-request-response:not([data-response="+r+"])",s).addClass("d-none"),h()}))})),t(".reason-form").addClass("d-none"),t(".reason-form."+r+"-reason-form",s).removeClass("d-none")},f=function(){const e=t(this),n=t(this).closest(".match-button-actions");var s,a;i(e,!1),s=n.data("request-id"),a=function(n){if(i(e,!0),n.success){const n=e.closest("tr");t("tr[data-bs-target=#"+n.prop("id")+"]").remove(),n.remove()}},t.ajax({url:match_args.ajax_url,type:"POST",data:{action:"lvlt_remove_match_item",request_id:s},dataType:"json",success:function(t){"function"==typeof a&&a(t)},error:function(t){console.error("Error during submission",t)}})};function h(e=!0){let n=t(".lvlt-match-toast");n.length||(t(document.body).append('<div class="toast lvlt-match-toast position-fixed top-10 end-0" role="alert" aria-live="assertive" aria-atomic="true"  data-bs-delay="14000">\n                <div class="toast-header">\n                    <strong class="me-auto">Notification</strong>\n                    <button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Close"></button>\n                </div>\n                <div class="toast-body">\n                    Your message will be sent to the requester.\n                </div>\n            </div>'),n=t(".lvlt-match-toast"));const s=new bootstrap.Toast(n.get(0));return e&&s.show(),n}const b=function(){const e=t(this),n=t(this).closest(".match-button-actions"),s=e.closest(".this-match-change-status");var a,o,r;i(e,!1),a=n.data("request-id"),o=t("select",s).val(),r=function(t){i(e,!0)},t.ajax({url:match_args.ajax_url,type:"POST",data:{action:"lvlt_change_matched_status",status:o,request_id:a},dataType:"json",success:function(t){"function"==typeof r&&r(t)},error:function(t){console.error("Error during submission",t)}})};t(document).ready((function(){var s;t(".matching-wrap").length&&(s=function(t){t.length&&(c(t[n]),d())},t.ajax({url:match_args.ajax_url,type:"POST",data:{action:"lvlt_get_match_questions",listing_type:t(".matching-wrap").data("listing-type"),request_id:t(".matching-wrap").data("edit-requiest")},dataType:"json",success:function(t){a=t.request_id,o=-1<a,e=t.questions,s(e)},error:function(t){console.error("Error loading questions:",t)}}),t(".toggle-row").on("click",(function(){var e=t(this).data("bs-target");setTimeout((function(){t(e).hasClass("show")&&t(e).find(".btn-get-matched-listings").click()}),500)})),t(document).on("click",".btn-get-matched-listings",(function(){var e=t(this).data("request-id");console.log("Auto fetching matched listings for request:",e)})),t("#matchRequestsAccordion").on("shown.bs.collapse",(function(e){t(e.target).find(".btn-get-matched-listings").click()})),t(document).on("click",".btn-get-matched-listings",p),t(document).on("click",".btn-request-response",m),t(document).on("click",".btn-this-match-remove",f),t(document).on("click",".this-match-change-status > button",b))})),t(".filter-button").click((function(){var e=t(this).data("status");t("#matchRequestsTable tbody tr").each((function(){var n=t(this).find(".badge");if(n.length>0){var s=(n.attr("class")||"").split(" ")[1];"all"===e||s===e?t(this).show():t(this).hide()}}))})),t(document).ready((function(){t("#matchRequestsTable").bootstrapTable({search:!0,showColumns:!0})}))}(jQuery);

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.