PageSourceSearch

https://www.tires-easy-truck.com/_ui/versioned/d95925b249f703e4cdc…/dist/js/chunk-DhvlYcKC.js

js tires-easy-truck.com collected 2026-10-04 04:54:38 UTC 4,610 bytes, 1 lines download raw bytes

1import{a as p,b as y}from"./chunk-DDHtAA0h.js";const s=$(".j-cancellation-request-page"),a=s.find(".j-cancellation-request-form"),A=s.find(".j-cancellation-process-back"),l=s.find(".j-cancellation-process-next"),k=a.find("input"),h=a.find(".j-additional-information"),g=a.find(".j-dropdown"),m=s.find(".j-cancellations-order-item-checkbox"),N=ACC.config.maxTextLength,j=()=>parseInt(s.data("step"),10),U=()=>{const e=j();if(!(!s.length||!e)){if(P(e),e===1){x();return}if(e===2){S();return}e===3&&f()}},P=e=>{if(!(!e||!a.length)){switch(e){case 1:a.on("submit",t=>q(t,e)),k.on("input",x);break;case 2:a.on("submit",t=>I(t,e)),m.on("change",S);break;case 3:a.on("submit",t=>V(t,e)),g.each(function(){$(this).on("dropdown.change",X)}),h.each(function(){$(this).on("input",_)});break;case 4:a.on("submit",t=>M(t,e));break}A.on("click",t=>J(t,e))}},q=(e,t)=>{if(e.preventDefault(),!G())return;const n=a.serialize(),o=a.attr("action");c(!0),p(o,"GET",n,r=>F(r,t),r=>v(r))},F=({successful:e,dataObject:t,errors:n},o)=>{if(c(!1),e&&t?.status==="OK"){u(o);return}console.error(`Something went wrong at step 1: ${n}`),v(t?.status)},v=e=>{c(!1);const t=e==="NOT_FOUND"?ACC.messages.cancellationProcessErrorNotFound:e==="EXPIRED"?ACC.messages.cancellationProcessErrorExpired:ACC.messages.cancellationProcessErrorDefault;d(t)},I=(e,t)=>{e.preventDefault();const n=a.serialize(),o=a.attr("action");c(!0),p(o,"GET",n,r=>O(r,t),()=>b())},O=({successful:e,errors:t},n)=>{if(c(!1),e){u(n);return}console.error(`Something went wrong at tires selection: ${t}`),b()},b=()=>{c(!1),d(ACC.messages.cancellationProcessErrorDefault)},V=(e,t)=>{if(e.preventDefault(),!T()||!D())return;const n=R(),o=JSON.stringify(n),r=a.attr("action");c(!0),y(r,"POST",o,i=>L(i,t),()=>E())},R=()=>{const e=s.find(".j-cancellation-order-container").toArray().map(t=>({price:{formattedValue:$(t).find(".entry-price").val()},productCode:$(t).find(".entry-product-code").val(),productTitle:$(t).find(".entry-product-title").val(),entryNumber:$(t).find(".entry-number").val(),quantity:$(t).find(".entry-quantity").val(),actionQuantity:$(t).find('[name="actionQuantity"]').val(),reasonCode:$(t).find('[name="reasonCode"]').val(),additionalInfo:$(t).find(".additionalInformation textarea").val()}));return{code:s.find(".order-number").val(),validationCode:s.find(".validation-code").val(),date:s.find(".date").val(),phoneNumber:s.find("#phone").val(),entries:e}},L=({successful:e,errors:t},n)=>{if(c(!1),e){u(n);return}console.error(`Return process failed: ${t}`),E()},E=()=>{c(!1),d(ACC.messages.cancellationProcessErrorDefault)},M=(e,t)=>{e.preventDefault();const n=a.attr("action"),o="recaptchaToken="+s.find('[name="recaptchaToken"]').val();c(!0),p(n,"POST",o,r=>B(r,t),r=>C(r))},B=({successful:e,dataObject:t,errors:n},o)=>{if(c(!1),e){u(o);return}console.error(`Return process failed: ${n}`),C(t?.status)},C=e=>{c(!1);const t=e==="NOT_FOUND"?ACC.messages.cancellationProcessErrorNotFound:e==="EXPIRED"?ACC.messages.cancellationProcessErrorExpired:ACC.messages.cancellationProcessErrorDefault;d(t)},X=(e,t)=>{const n=t.$target,o=$(e.currentTarget).closest(".j-dropdown");if(!n||!o.length)return;const r=n.data("option"),i=o.find('input[type="hidden"]');i.length&&i.val(r),f()},_=e=>{const t=w(e.currentTarget);z(e.currentTarget,t),f()},c=e=>{l.toggleClass("loading",e),l.prop("disabled",e)},d=e=>{const t=$(".j-cancellation-error");t.find("h5").text(e),t.removeClass("hidden")},x=()=>{const e=a.find("[required]").toArray().every(t=>$(t).val());return l.prop("disabled",!e),e},S=()=>{const e=m.toArray().reduce((o,r,i)=>($(r).is(":checked")&&o.push(i),o),[]),t=s.find(".entry-numbers"),n=e.length>0;return t.val(n?e.join(","):""),l.prop("disabled",!n),n},T=()=>g.toArray().every(e=>{const n=$(e).find('input[type="hidden"]');return n.length&&n.val()}),G=()=>{const e=s.find("#phone"),t=e.val(),n=t.replace(/\s|-/g,""),o=e.closest(".custom-input-group").find(".j-input-error"),r=t.length>0&&/^((\+|00)?(\d)?)?(\d{10})$/.test(n);return o.toggle(!r),r},w=e=>{const t=$(e),n=N,o=t.val().length,r=t.closest(".custom-input-group").find(".j-input-error");return o===0?r.text("This field is required"):o>n&&(r.text("Maximum number of characters exceeded"),t.val(t.val().slice(0,n))),o>0&&o<n},D=()=>h.toArray().every(e=>w(e)),z=(e,t)=>{$(e).closest(".custom-input-group").find(".j-input-error").toggle(!t)},f=()=>{const e=D()&&T();l.prop("disabled",!e)},u=e=>{window.location.href=`/cancellation-request/step-${e+1}`},J=(e,t)=>
1{if(e.preventDefault(),t===1){window.history.back();return}window.location.href=`/cancellation-request/step-${t-1}`};export{U as init};

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.