/home/blackyak/www/wordpress/wp-content/plugins/wp-travel-engine/dist/admin/booking-edit.js
(()=>{"use strict";const e=window.wp.i18n;function t(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function n(e){return e instanceof t(e).Element||e instanceof Element}function r(e){return e instanceof t(e).HTMLElement||e instanceof HTMLElement}function o(e){return"undefined"!=typeof ShadowRoot&&(e instanceof t(e).ShadowRoot||e instanceof ShadowRoot)}var i=Math.max,a=Math.min,s=Math.round;function c(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function l(){return!/^((?!chrome|android).)*safari/i.test(c())}function u(e,o,i){void 0===o&&(o=!1),void 0===i&&(i=!1);var a=e.getBoundingClientRect(),c=1,u=1;o&&r(e)&&(c=e.offsetWidth>0&&s(a.width)/e.offsetWidth||1,u=e.offsetHeight>0&&s(a.height)/e.offsetHeight||1);var p=(n(e)?t(e):window).visualViewport,d=!l()&&i,f=(a.left+(d&&p?p.offsetLeft:0))/c,m=(a.top+(d&&p?p.offsetTop:0))/u,y=a.width/c,v=a.height/u;return{width:y,height:v,top:m,right:f+y,bottom:m+v,left:f,x:f,y:m}}function p(e){var n=t(e);return{scrollLeft:n.pageXOffset,scrollTop:n.pageYOffset}}function d(e){return e?(e.nodeName||"").toLowerCase():null}function f(e){return((n(e)?e.ownerDocument:e.document)||window.document).documentElement}function m(e){return u(f(e)).left+p(e).scrollLeft}function y(e){return t(e).getComputedStyle(e)}function v(e){var t=y(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function g(e,n,o){void 0===o&&(o=!1);var i,a,c=r(n),l=r(n)&&function(e){var t=e.getBoundingClientRect(),n=s(t.width)/e.offsetWidth||1,r=s(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(n),y=f(n),g=u(e,l,o),h={scrollLeft:0,scrollTop:0},b={x:0,y:0};return(c||!c&&!o)&&(("body"!==d(n)||v(y))&&(h=(i=n)!==t(i)&&r(i)?{scrollLeft:(a=i).scrollLeft,scrollTop:a.scrollTop}:p(i)),r(n)?((b=u(n,!0)).x+=n.clientLeft,b.y+=n.clientTop):y&&(b.x=m(y))),{x:g.left+h.scrollLeft-b.x,y:g.top+h.scrollTop-b.y,width:g.width,height:g.height}}function h(e){var t=u(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function b(e){return"html"===d(e)?e:e.assignedSlot||e.parentNode||(o(e)?e.host:null)||f(e)}function w(e){return["html","body","#document"].indexOf(d(e))>=0?e.ownerDocument.body:r(e)&&v(e)?e:w(b(e))}function x(e,n){var r;void 0===n&&(n=[]);var o=w(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),a=t(o),s=i?[a].concat(a.visualViewport||[],v(o)?o:[]):o,c=n.concat(s);return i?c:c.concat(x(b(s)))}function S(e){return["table","td","th"].indexOf(d(e))>=0}function q(e){return r(e)&&"fixed"!==y(e).position?e.offsetParent:null}function A(e){for(var n=t(e),i=q(e);i&&S(i)&&"static"===y(i).position;)i=q(i);return i&&("html"===d(i)||"body"===d(i)&&"static"===y(i).position)?n:i||function(e){var t=/firefox/i.test(c());if(/Trident/i.test(c())&&r(e)&&"fixed"===y(e).position)return null;var n=b(e);for(o(n)&&(n=n.host);r(n)&&["html","body"].indexOf(d(n))<0;){var i=y(n);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||t&&"filter"===i.willChange||t&&i.filter&&"none"!==i.filter)return n;n=n.parentNode}return null}(e)||n}var E="top",_="bottom",O="right",L="left",T="auto",k=[E,_,O,L],C="start",j="end",D="viewport",M="popper",I=k.reduce((function(e,t){return e.concat([t+"-"+C,t+"-"+j])}),[]),H=[].concat(k,[T]).reduce((function(e,t){return e.concat([t,t+"-"+C,t+"-"+j])}),[]),$=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function N(e){var t=new Map,n=new Set,r=[];function o(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&o(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||o(e)})),r}var B={placement:"bottom",modifiers:[],strategy:"absolute"};function P(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some((function(e){return!(e&&"function"==typeof e.getBoundingClientRect)}))}function R(e){void 0===e&&(e={});var t=e,r=t.defaultModifiers,o=void 0===r?[]:r,i=t.defaultOptions,a=void 0===i?B:i;return function(e,t,r){void 0===r&&(r=a);var i,s,c={placement:"bottom",orderedModifiers:[],options:Object.assign({},B,a),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},l=[],u=!1,p={state:c,setOptions:function(r){var i="function"==typeof r?r(c.options):r;d(),c.options=Object.assign({},a,c.options,i),c.scrollParents={reference:n(e)?x(e):e.contextElement?x(e.contextElement):[],popper:x(t)};var s,u,f=function(e){var t=N(e);return $.reduce((function(e,n){return e.concat(t.filter((function(e){return e.phase===n})))}),[])}((s=[].concat(o,c.options.modifiers),u=s.reduce((function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e}),{}),Object.keys(u).map((function(e){return u[e]}))));return c.orderedModifiers=f.filter((function(e){return e.enabled})),c.orderedModifiers.forEach((function(e){var t=e.name,n=e.options,r=void 0===n?{}:n,o=e.effect;if("function"==typeof o){var i=o({state:c,name:t,instance:p,options:r});l.push(i||function(){})}})),p.update()},forceUpdate:function(){if(!u){var e=c.elements,t=e.reference,n=e.popper;if(P(t,n)){c.rects={reference:g(t,A(n),"fixed"===c.options.strategy),popper:h(n)},c.reset=!1,c.placement=c.options.placement,c.orderedModifiers.forEach((function(e){return c.modifiersData[e.name]=Object.assign({},e.data)}));for(var r=0;r<c.orderedModifiers.length;r++)if(!0!==c.reset){var o=c.orderedModifiers[r],i=o.fn,a=o.options,s=void 0===a?{}:a,l=o.name;"function"==typeof i&&(c=i({state:c,options:s,name:l,instance:p})||c)}else c.reset=!1,r=-1}}},update:(i=function(){return new Promise((function(e){p.forceUpdate(),e(c)}))},function(){return s||(s=new Promise((function(e){Promise.resolve().then((function(){s=void 0,e(i())}))}))),s}),destroy:function(){d(),u=!0}};if(!P(e,t))return p;function d(){l.forEach((function(e){return e()})),l=[]}return p.setOptions(r).then((function(e){!u&&r.onFirstUpdate&&r.onFirstUpdate(e)})),p}}var F={passive:!0};function V(e){return e.split("-")[0]}function W(e){return e.split("-")[1]}function U(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function z(e){var t,n=e.reference,r=e.element,o=e.placement,i=o?V(o):null,a=o?W(o):null,s=n.x+n.width/2-r.width/2,c=n.y+n.height/2-r.height/2;switch(i){case E:t={x:s,y:n.y-r.height};break;case _:t={x:s,y:n.y+n.height};break;case O:t={x:n.x+n.width,y:c};break;case L:t={x:n.x-r.width,y:c};break;default:t={x:n.x,y:n.y}}var l=i?U(i):null;if(null!=l){var u="y"===l?"height":"width";switch(a){case C:t[l]=t[l]-(n[u]/2-r[u]/2);break;case j:t[l]=t[l]+(n[u]/2-r[u]/2)}}return t}var J={top:"auto",right:"auto",bottom:"auto",left:"auto"};function X(e){var n,r=e.popper,o=e.popperRect,i=e.placement,a=e.variation,c=e.offsets,l=e.position,u=e.gpuAcceleration,p=e.adaptive,d=e.roundOffsets,m=e.isFixed,v=c.x,g=void 0===v?0:v,h=c.y,b=void 0===h?0:h,w="function"==typeof d?d({x:g,y:b}):{x:g,y:b};g=w.x,b=w.y;var x=c.hasOwnProperty("x"),S=c.hasOwnProperty("y"),q=L,T=E,k=window;if(p){var C=A(r),D="clientHeight",M="clientWidth";C===t(r)&&"static"!==y(C=f(r)).position&&"absolute"===l&&(D="scrollHeight",M="scrollWidth"),(i===E||(i===L||i===O)&&a===j)&&(T=_,b-=(m&&C===k&&k.visualViewport?k.visualViewport.height:C[D])-o.height,b*=u?1:-1),i!==L&&(i!==E&&i!==_||a!==j)||(q=O,g-=(m&&C===k&&k.visualViewport?k.visualViewport.width:C[M])-o.width,g*=u?1:-1)}var I,H=Object.assign({position:l},p&&J),$=!0===d?function(e,t){var n=e.x,r=e.y,o=t.devicePixelRatio||1;return{x:s(n*o)/o||0,y:s(r*o)/o||0}}({x:g,y:b},t(r)):{x:g,y:b};return g=$.x,b=$.y,u?Object.assign({},H,((I={})[T]=S?"0":"",I[q]=x?"0":"",I.transform=(k.devicePixelRatio||1)<=1?"translate("+g+"px, "+b+"px)":"translate3d("+g+"px, "+b+"px, 0)",I)):Object.assign({},H,((n={})[T]=S?b+"px":"",n[q]=x?g+"px":"",n.transform="",n))}const Y={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},o=t.attributes[e]||{},i=t.elements[e];r(i)&&d(i)&&(Object.assign(i.style,n),Object.keys(o).forEach((function(e){var t=o[e];!1===t?i.removeAttribute(e):i.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var o=t.elements[e],i=t.attributes[e]||{},a=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});r(o)&&d(o)&&(Object.assign(o.style,a),Object.keys(i).forEach((function(e){o.removeAttribute(e)})))}))}},requires:["computeStyles"]};var Q={left:"right",right:"left",bottom:"top",top:"bottom"};function G(e){return e.replace(/left|right|bottom|top/g,(function(e){return Q[e]}))}var K={start:"end",end:"start"};function Z(e){return e.replace(/start|end/g,(function(e){return K[e]}))}function ee(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&o(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function te(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function ne(e,r,o){return r===D?te(function(e,n){var r=t(e),o=f(e),i=r.visualViewport,a=o.clientWidth,s=o.clientHeight,c=0,u=0;if(i){a=i.width,s=i.height;var p=l();(p||!p&&"fixed"===n)&&(c=i.offsetLeft,u=i.offsetTop)}return{width:a,height:s,x:c+m(e),y:u}}(e,o)):n(r)?function(e,t){var n=u(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(r,o):te(function(e){var t,n=f(e),r=p(e),o=null==(t=e.ownerDocument)?void 0:t.body,a=i(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=i(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),c=-r.scrollLeft+m(e),l=-r.scrollTop;return"rtl"===y(o||n).direction&&(c+=i(n.clientWidth,o?o.clientWidth:0)-a),{width:a,height:s,x:c,y:l}}(f(e)))}function re(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function oe(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function ie(e,t){void 0===t&&(t={});var o=t,s=o.placement,c=void 0===s?e.placement:s,l=o.strategy,p=void 0===l?e.strategy:l,m=o.boundary,v=void 0===m?"clippingParents":m,g=o.rootBoundary,h=void 0===g?D:g,w=o.elementContext,S=void 0===w?M:w,q=o.altBoundary,L=void 0!==q&&q,T=o.padding,C=void 0===T?0:T,j=re("number"!=typeof C?C:oe(C,k)),I=S===M?"reference":M,H=e.rects.popper,$=e.elements[L?I:S],N=function(e,t,o,s){var c="clippingParents"===t?function(e){var t=x(b(e)),o=["absolute","fixed"].indexOf(y(e).position)>=0&&r(e)?A(e):e;return n(o)?t.filter((function(e){return n(e)&&ee(e,o)&&"body"!==d(e)})):[]}(e):[].concat(t),l=[].concat(c,[o]),u=l[0],p=l.reduce((function(t,n){var r=ne(e,n,s);return t.top=i(r.top,t.top),t.right=a(r.right,t.right),t.bottom=a(r.bottom,t.bottom),t.left=i(r.left,t.left),t}),ne(e,u,s));return p.width=p.right-p.left,p.height=p.bottom-p.top,p.x=p.left,p.y=p.top,p}(n($)?$:$.contextElement||f(e.elements.popper),v,h,p),B=u(e.elements.reference),P=z({reference:B,element:H,strategy:"absolute",placement:c}),R=te(Object.assign({},H,P)),F=S===M?R:B,V={top:N.top-F.top+j.top,bottom:F.bottom-N.bottom+j.bottom,left:N.left-F.left+j.left,right:F.right-N.right+j.right},W=e.modifiersData.offset;if(S===M&&W){var U=W[c];Object.keys(V).forEach((function(e){var t=[O,_].indexOf(e)>=0?1:-1,n=[E,_].indexOf(e)>=0?"y":"x";V[e]+=U[n]*t}))}return V}function ae(e,t,n){return i(e,a(t,n))}function se(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function ce(e){return[E,O,_,L].some((function(t){return e[t]>=0}))}var le=R({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var n=e.state,r=e.instance,o=e.options,i=o.scroll,a=void 0===i||i,s=o.resize,c=void 0===s||s,l=t(n.elements.popper),u=[].concat(n.scrollParents.reference,n.scrollParents.popper);return a&&u.forEach((function(e){e.addEventListener("scroll",r.update,F)})),c&&l.addEventListener("resize",r.update,F),function(){a&&u.forEach((function(e){e.removeEventListener("scroll",r.update,F)})),c&&l.removeEventListener("resize",r.update,F)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=z({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=void 0===r||r,i=n.adaptive,a=void 0===i||i,s=n.roundOffsets,c=void 0===s||s,l={placement:V(t.placement),variation:W(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,X(Object.assign({},l,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:c})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,X(Object.assign({},l,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},Y,{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.offset,i=void 0===o?[0,0]:o,a=H.reduce((function(e,n){return e[n]=function(e,t,n){var r=V(e),o=[L,E].indexOf(r)>=0?-1:1,i="function"==typeof n?n(Object.assign({},t,{placement:e})):n,a=i[0],s=i[1];return a=a||0,s=(s||0)*o,[L,O].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}(n,t.rects,i),e}),{}),s=a[t.placement],c=s.x,l=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=l),t.modifiersData[r]=a}},{name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,i=void 0===o||o,a=n.altAxis,s=void 0===a||a,c=n.fallbackPlacements,l=n.padding,u=n.boundary,p=n.rootBoundary,d=n.altBoundary,f=n.flipVariations,m=void 0===f||f,y=n.allowedAutoPlacements,v=t.options.placement,g=V(v),h=c||(g!==v&&m?function(e){if(V(e)===T)return[];var t=G(e);return[Z(e),t,Z(t)]}(v):[G(v)]),b=[v].concat(h).reduce((function(e,n){return e.concat(V(n)===T?function(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=n.boundary,i=n.rootBoundary,a=n.padding,s=n.flipVariations,c=n.allowedAutoPlacements,l=void 0===c?H:c,u=W(r),p=u?s?I:I.filter((function(e){return W(e)===u})):k,d=p.filter((function(e){return l.indexOf(e)>=0}));0===d.length&&(d=p);var f=d.reduce((function(t,n){return t[n]=ie(e,{placement:n,boundary:o,rootBoundary:i,padding:a})[V(n)],t}),{});return Object.keys(f).sort((function(e,t){return f[e]-f[t]}))}(t,{placement:n,boundary:u,rootBoundary:p,padding:l,flipVariations:m,allowedAutoPlacements:y}):n)}),[]),w=t.rects.reference,x=t.rects.popper,S=new Map,q=!0,A=b[0],j=0;j<b.length;j++){var D=b[j],M=V(D),$=W(D)===C,N=[E,_].indexOf(M)>=0,B=N?"width":"height",P=ie(t,{placement:D,boundary:u,rootBoundary:p,altBoundary:d,padding:l}),R=N?$?O:L:$?_:E;w[B]>x[B]&&(R=G(R));var F=G(R),U=[];if(i&&U.push(P[M]<=0),s&&U.push(P[R]<=0,P[F]<=0),U.every((function(e){return e}))){A=D,q=!1;break}S.set(D,U)}if(q)for(var z=function(e){var t=b.find((function(t){var n=S.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return A=t,"break"},J=m?3:1;J>0&&"break"!==z(J);J--);t.placement!==A&&(t.modifiersData[r]._skip=!0,t.placement=A,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,s=void 0===o||o,c=n.altAxis,l=void 0!==c&&c,u=n.boundary,p=n.rootBoundary,d=n.altBoundary,f=n.padding,m=n.tether,y=void 0===m||m,v=n.tetherOffset,g=void 0===v?0:v,b=ie(t,{boundary:u,rootBoundary:p,padding:f,altBoundary:d}),w=V(t.placement),x=W(t.placement),S=!x,q=U(w),T="x"===q?"y":"x",k=t.modifiersData.popperOffsets,j=t.rects.reference,D=t.rects.popper,M="function"==typeof g?g(Object.assign({},t.rects,{placement:t.placement})):g,I="number"==typeof M?{mainAxis:M,altAxis:M}:Object.assign({mainAxis:0,altAxis:0},M),H=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,$={x:0,y:0};if(k){if(s){var N,B="y"===q?E:L,P="y"===q?_:O,R="y"===q?"height":"width",F=k[q],z=F+b[B],J=F-b[P],X=y?-D[R]/2:0,Y=x===C?j[R]:D[R],Q=x===C?-D[R]:-j[R],G=t.elements.arrow,K=y&&G?h(G):{width:0,height:0},Z=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},ee=Z[B],te=Z[P],ne=ae(0,j[R],K[R]),re=S?j[R]/2-X-ne-ee-I.mainAxis:Y-ne-ee-I.mainAxis,oe=S?-j[R]/2+X+ne+te+I.mainAxis:Q+ne+te+I.mainAxis,se=t.elements.arrow&&A(t.elements.arrow),ce=se?"y"===q?se.clientTop||0:se.clientLeft||0:0,le=null!=(N=null==H?void 0:H[q])?N:0,ue=F+oe-le,pe=ae(y?a(z,F+re-le-ce):z,F,y?i(J,ue):J);k[q]=pe,$[q]=pe-F}if(l){var de,fe="x"===q?E:L,me="x"===q?_:O,ye=k[T],ve="y"===T?"height":"width",ge=ye+b[fe],he=ye-b[me],be=-1!==[E,L].indexOf(w),we=null!=(de=null==H?void 0:H[T])?de:0,xe=be?ge:ye-j[ve]-D[ve]-we+I.altAxis,Se=be?ye+j[ve]+D[ve]-we-I.altAxis:he,qe=y&&be?function(e,t,n){var r=ae(e,t,n);return r>n?n:r}(xe,ye,Se):ae(y?xe:ge,ye,y?Se:he);k[T]=qe,$[T]=qe-ye}t.modifiersData[r]=$}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,o=e.options,i=n.elements.arrow,a=n.modifiersData.popperOffsets,s=V(n.placement),c=U(s),l=[L,O].indexOf(s)>=0?"height":"width";if(i&&a){var u=function(e,t){return re("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:oe(e,k))}(o.padding,n),p=h(i),d="y"===c?E:L,f="y"===c?_:O,m=n.rects.reference[l]+n.rects.reference[c]-a[c]-n.rects.popper[l],y=a[c]-n.rects.reference[c],v=A(i),g=v?"y"===c?v.clientHeight||0:v.clientWidth||0:0,b=m/2-y/2,w=u[d],x=g-p[l]-u[f],S=g/2-p[l]/2+b,q=ae(w,S,x),T=c;n.modifiersData[r]=((t={})[T]=q,t.centerOffset=q-S,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&ee(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,a=ie(t,{elementContext:"reference"}),s=ie(t,{altBoundary:!0}),c=se(a,r),l=se(s,o,i),u=ce(c),p=ce(l);t.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:l,isReferenceHidden:u,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":p})}}]}),ue="tippy-content",pe="tippy-arrow",de="tippy-svg-arrow",fe={passive:!0,capture:!0},me=function(){return document.body};function ye(e,t,n){if(Array.isArray(e)){var r=e[t];return null==r?Array.isArray(n)?n[t]:n:r}return e}function ve(e,t){var n={}.toString.call(e);return 0===n.indexOf("[object")&&n.indexOf(t+"]")>-1}function ge(e,t){return"function"==typeof e?e.apply(void 0,t):e}function he(e,t){return 0===t?e:function(r){clearTimeout(n),n=setTimeout((function(){e(r)}),t)};var n}function be(e){return[].concat(e)}function we(e,t){-1===e.indexOf(t)&&e.push(t)}function xe(e){return[].slice.call(e)}function Se(e){return Object.keys(e).reduce((function(t,n){return void 0!==e[n]&&(t[n]=e[n]),t}),{})}function qe(){return document.createElement("div")}function Ae(e){return["Element","Fragment"].some((function(t){return ve(e,t)}))}function Ee(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function _e(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function Oe(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[r](t,n)}))}function Le(e,t){for(var n=t;n;){var r;if(e.contains(n))return!0;n=null==n.getRootNode||null==(r=n.getRootNode())?void 0:r.host}return!1}var Te={isTouch:!1},ke=0;function Ce(){Te.isTouch||(Te.isTouch=!0,window.performance&&document.addEventListener("mousemove",je))}function je(){var e=performance.now();e-ke<20&&(Te.isTouch=!1,document.removeEventListener("mousemove",je)),ke=e}function De(){var e,t=document.activeElement;if((e=t)&&e._tippy&&e._tippy.reference===e){var n=t._tippy;t.blur&&!n.state.isVisible&&t.blur()}}var Me=!("undefined"==typeof window||"undefined"==typeof document||!window.msCrypto),Ie=Object.assign({appendTo:me,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},{animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),He=Object.keys(Ie);function $e(e){var t=(e.plugins||[]).reduce((function(t,n){var r,o=n.name,i=n.defaultValue;return o&&(t[o]=void 0!==e[o]?e[o]:null!=(r=Ie[o])?r:i),t}),{});return Object.assign({},e,t)}function Ne(e,t){var n=Object.assign({},t,{content:ge(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys($e(Object.assign({},Ie,{plugins:t}))):He).reduce((function(t,n){var r=(e.getAttribute("data-tippy-"+n)||"").trim();if(!r)return t;if("content"===n)t[n]=r;else try{t[n]=JSON.parse(r)}catch(e){t[n]=r}return t}),{})}(e,t.plugins));return n.aria=Object.assign({},Ie.aria,n.aria),n.aria={expanded:"auto"===n.aria.expanded?t.interactive:n.aria.expanded,content:"auto"===n.aria.content?t.interactive?null:"describedby":n.aria.content},n}function Be(e,t){e.innerHTML=t}function Pe(e){var t=qe();return!0===e?t.className=pe:(t.className=de,Ae(e)?t.appendChild(e):Be(t,e)),t}function Re(e,t){Ae(t.content)?(Be(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?Be(e,t.content):e.textContent=t.content)}function Fe(e){var t=e.firstElementChild,n=xe(t.children);return{box:t,content:n.find((function(e){return e.classList.contains(ue)})),arrow:n.find((function(e){return e.classList.contains(pe)||e.classList.contains(de)})),backdrop:n.find((function(e){return e.classList.contains("tippy-backdrop")}))}}function Ve(e){var t=qe(),n=qe();n.className="tippy-box",n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=qe();function o(n,r){var o=Fe(t),i=o.box,a=o.content,s=o.arrow;r.theme?i.setAttribute("data-theme",r.theme):i.removeAttribute("data-theme"),"string"==typeof r.animation?i.setAttribute("data-animation",r.animation):i.removeAttribute("data-animation"),r.inertia?i.setAttribute("data-inertia",""):i.removeAttribute("data-inertia"),i.style.maxWidth="number"==typeof r.maxWidth?r.maxWidth+"px":r.maxWidth,r.role?i.setAttribute("role",r.role):i.removeAttribute("role"),n.content===r.content&&n.allowHTML===r.allowHTML||Re(a,e.props),r.arrow?s?n.arrow!==r.arrow&&(i.removeChild(s),i.appendChild(Pe(r.arrow))):i.appendChild(Pe(r.arrow)):s&&i.removeChild(s)}return r.className=ue,r.setAttribute("data-state","hidden"),Re(r,e.props),t.appendChild(n),n.appendChild(r),o(e.props,e.props),{popper:t,onUpdate:o}}Ve.$$tippy=!0;var We=1,Ue=[],ze=[];function Je(e,t){var n,r,o,i,a,s,c,l,u=Ne(e,Object.assign({},Ie,$e(Se(t)))),p=!1,d=!1,f=!1,m=!1,y=[],v=he(J,u.interactiveDebounce),g=We++,h=(l=u.plugins).filter((function(e,t){return l.indexOf(e)===t})),b={id:g,reference:e,popper:qe(),popperInstance:null,props:u,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:h,clearDelayTimeouts:function(){clearTimeout(n),clearTimeout(r),cancelAnimationFrame(o)},setProps:function(t){if(!b.state.isDestroyed){D("onBeforeUpdate",[b,t]),U();var n=b.props,r=Ne(e,Object.assign({},n,Se(t),{ignoreAttributes:!0}));b.props=r,W(),n.interactiveDebounce!==r.interactiveDebounce&&(H(),v=he(J,r.interactiveDebounce)),n.triggerTarget&&!r.triggerTarget?be(n.triggerTarget).forEach((function(e){e.removeAttribute("aria-expanded")})):r.triggerTarget&&e.removeAttribute("aria-expanded"),I(),j(),S&&S(n,r),b.popperInstance&&(G(),Z().forEach((function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)}))),D("onAfterUpdate",[b,t])}},setContent:function(e){b.setProps({content:e})},show:function(){var e=b.state.isVisible,t=b.state.isDestroyed,n=!b.state.isEnabled,r=Te.isTouch&&!b.props.touch,o=ye(b.props.duration,0,Ie.duration);if(!(e||t||n||r||L().hasAttribute("disabled")||(D("onShow",[b],!1),!1===b.props.onShow(b)))){if(b.state.isVisible=!0,O()&&(x.style.visibility="visible"),j(),P(),b.state.isMounted||(x.style.transition="none"),O()){var i=k();Ee([i.box,i.content],0)}var a,c,l;s=function(){var e;if(b.state.isVisible&&!m){if(m=!0,x.offsetHeight,x.style.transition=b.props.moveTransition,O()&&b.props.animation){var t=k(),n=t.box,r=t.content;Ee([n,r],o),_e([n,r],"visible")}M(),I(),we(ze,b),null==(e=b.popperInstance)||e.forceUpdate(),D("onMount",[b]),b.props.animation&&O()&&function(e){F(e,(function(){b.state.isShown=!0,D("onShown",[b])}))}(o)}},c=b.props.appendTo,l=L(),(a=b.props.interactive&&c===me||"parent"===c?l.parentNode:ge(c,[l])).contains(x)||a.appendChild(x),b.state.isMounted=!0,G()}},hide:function(){var e=!b.state.isVisible,t=b.state.isDestroyed,n=!b.state.isEnabled,r=ye(b.props.duration,1,Ie.duration);if(!(e||t||n)&&(D("onHide",[b],!1),!1!==b.props.onHide(b))){if(b.state.isVisible=!1,b.state.isShown=!1,m=!1,p=!1,O()&&(x.style.visibility="hidden"),H(),R(),j(!0),O()){var o=k(),i=o.box,a=o.content;b.props.animation&&(Ee([i,a],r),_e([i,a],"hidden"))}M(),I(),b.props.animation?O()&&function(e,t){F(e,(function(){!b.state.isVisible&&x.parentNode&&x.parentNode.contains(x)&&t()}))}(r,b.unmount):b.unmount()}},hideWithInteractivity:function(e){T().addEventListener("mousemove",v),we(Ue,v),v(e)},enable:function(){b.state.isEnabled=!0},disable:function(){b.hide(),b.state.isEnabled=!1},unmount:function(){b.state.isVisible&&b.hide(),b.state.isMounted&&(K(),Z().forEach((function(e){e._tippy.unmount()})),x.parentNode&&x.parentNode.removeChild(x),ze=ze.filter((function(e){return e!==b})),b.state.isMounted=!1,D("onHidden",[b]))},destroy:function(){b.state.isDestroyed||(b.clearDelayTimeouts(),b.unmount(),U(),delete e._tippy,b.state.isDestroyed=!0,D("onDestroy",[b]))}};if(!u.render)return b;var w=u.render(b),x=w.popper,S=w.onUpdate;x.setAttribute("data-tippy-root",""),x.id="tippy-"+b.id,b.popper=x,e._tippy=b,x._tippy=b;var q=h.map((function(e){return e.fn(b)})),A=e.hasAttribute("aria-expanded");return W(),I(),j(),D("onCreate",[b]),u.showOnCreate&&ee(),x.addEventListener("mouseenter",(function(){b.props.interactive&&b.state.isVisible&&b.clearDelayTimeouts()})),x.addEventListener("mouseleave",(function(){b.props.interactive&&b.props.trigger.indexOf("mouseenter")>=0&&T().addEventListener("mousemove",v)})),b;function E(){var e=b.props.touch;return Array.isArray(e)?e:[e,0]}function _(){return"hold"===E()[0]}function O(){var e;return!(null==(e=b.props.render)||!e.$$tippy)}function L(){return c||e}function T(){var e,t,n=L().parentNode;return n?null!=(t=be(n)[0])&&null!=(e=t.ownerDocument)&&e.body?t.ownerDocument:document:document}function k(){return Fe(x)}function C(e){return b.state.isMounted&&!b.state.isVisible||Te.isTouch||i&&"focus"===i.type?0:ye(b.props.delay,e?0:1,Ie.delay)}function j(e){void 0===e&&(e=!1),x.style.pointerEvents=b.props.interactive&&!e?"":"none",x.style.zIndex=""+b.props.zIndex}function D(e,t,n){var r;void 0===n&&(n=!0),q.forEach((function(n){n[e]&&n[e].apply(n,t)})),n&&(r=b.props)[e].apply(r,t)}function M(){var t=b.props.aria;if(t.content){var n="aria-"+t.content,r=x.id;be(b.props.triggerTarget||e).forEach((function(e){var t=e.getAttribute(n);if(b.state.isVisible)e.setAttribute(n,t?t+" "+r:r);else{var o=t&&t.replace(r,"").trim();o?e.setAttribute(n,o):e.removeAttribute(n)}}))}}function I(){!A&&b.props.aria.expanded&&be(b.props.triggerTarget||e).forEach((function(e){b.props.interactive?e.setAttribute("aria-expanded",b.state.isVisible&&e===L()?"true":"false"):e.removeAttribute("aria-expanded")}))}function H(){T().removeEventListener("mousemove",v),Ue=Ue.filter((function(e){return e!==v}))}function $(t){if(!Te.isTouch||!f&&"mousedown"!==t.type){var n=t.composedPath&&t.composedPath()[0]||t.target;if(!b.props.interactive||!Le(x,n)){if(be(b.props.triggerTarget||e).some((function(e){return Le(e,n)}))){if(Te.isTouch)return;if(b.state.isVisible&&b.props.trigger.indexOf("click")>=0)return}else D("onClickOutside",[b,t]);!0===b.props.hideOnClick&&(b.clearDelayTimeouts(),b.hide(),d=!0,setTimeout((function(){d=!1})),b.state.isMounted||R())}}}function N(){f=!0}function B(){f=!1}function P(){var e=T();e.addEventListener("mousedown",$,!0),e.addEventListener("touchend",$,fe),e.addEventListener("touchstart",B,fe),e.addEventListener("touchmove",N,fe)}function R(){var e=T();e.removeEventListener("mousedown",$,!0),e.removeEventListener("touchend",$,fe),e.removeEventListener("touchstart",B,fe),e.removeEventListener("touchmove",N,fe)}function F(e,t){var n=k().box;function r(e){e.target===n&&(Oe(n,"remove",r),t())}if(0===e)return t();Oe(n,"remove",a),Oe(n,"add",r),a=r}function V(t,n,r){void 0===r&&(r=!1),be(b.props.triggerTarget||e).forEach((function(e){e.addEventListener(t,n,r),y.push({node:e,eventType:t,handler:n,options:r})}))}function W(){var e;_()&&(V("touchstart",z,{passive:!0}),V("touchend",X,{passive:!0})),(e=b.props.trigger,e.split(/\s+/).filter(Boolean)).forEach((function(e){if("manual"!==e)switch(V(e,z),e){case"mouseenter":V("mouseleave",X);break;case"focus":V(Me?"focusout":"blur",Y);break;case"focusin":V("focusout",Y)}}))}function U(){y.forEach((function(e){var t=e.node,n=e.eventType,r=e.handler,o=e.options;t.removeEventListener(n,r,o)})),y=[]}function z(e){var t,n=!1;if(b.state.isEnabled&&!Q(e)&&!d){var r="focus"===(null==(t=i)?void 0:t.type);i=e,c=e.currentTarget,I(),!b.state.isVisible&&ve(e,"MouseEvent")&&Ue.forEach((function(t){return t(e)})),"click"===e.type&&(b.props.trigger.indexOf("mouseenter")<0||p)&&!1!==b.props.hideOnClick&&b.state.isVisible?n=!0:ee(e),"click"===e.type&&(p=!n),n&&!r&&te(e)}}function J(e){var t=e.target,n=L().contains(t)||x.contains(t);if("mousemove"!==e.type||!n){var r=Z().concat(x).map((function(e){var t,n=null==(t=e._tippy.popperInstance)?void 0:t.state;return n?{popperRect:e.getBoundingClientRect(),popperState:n,props:u}:null})).filter(Boolean);(function(e,t){var n=t.clientX,r=t.clientY;return e.every((function(e){var t=e.popperRect,o=e.popperState,i=e.props.interactiveBorder,a=o.placement.split("-")[0],s=o.modifiersData.offset;if(!s)return!0;var c="bottom"===a?s.top.y:0,l="top"===a?s.bottom.y:0,u="right"===a?s.left.x:0,p="left"===a?s.right.x:0,d=t.top-r+c>i,f=r-t.bottom-l>i,m=t.left-n+u>i,y=n-t.right-p>i;return d||f||m||y}))})(r,e)&&(H(),te(e))}}function X(e){Q(e)||b.props.trigger.indexOf("click")>=0&&p||(b.props.interactive?b.hideWithInteractivity(e):te(e))}function Y(e){b.props.trigger.indexOf("focusin")<0&&e.target!==L()||b.props.interactive&&e.relatedTarget&&x.contains(e.relatedTarget)||te(e)}function Q(e){return!!Te.isTouch&&_()!==e.type.indexOf("touch")>=0}function G(){K();var t=b.props,n=t.popperOptions,r=t.placement,o=t.offset,i=t.getReferenceClientRect,a=t.moveTransition,c=O()?Fe(x).arrow:null,l=i?{getBoundingClientRect:i,contextElement:i.contextElement||L()}:e,u=[{name:"offset",options:{offset:o}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!a}},{name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(O()){var n=k().box;["placement","reference-hidden","escaped"].forEach((function(e){"placement"===e?n.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?n.setAttribute("data-"+e,""):n.removeAttribute("data-"+e)})),t.attributes.popper={}}}}];O()&&c&&u.push({name:"arrow",options:{element:c,padding:3}}),u.push.apply(u,(null==n?void 0:n.modifiers)||[]),b.popperInstance=le(l,x,Object.assign({},n,{placement:r,onFirstUpdate:s,modifiers:u}))}function K(){b.popperInstance&&(b.popperInstance.destroy(),b.popperInstance=null)}function Z(){return xe(x.querySelectorAll("[data-tippy-root]"))}function ee(e){b.clearDelayTimeouts(),e&&D("onTrigger",[b,e]),P();var t=C(!0),r=E(),o=r[0],i=r[1];Te.isTouch&&"hold"===o&&i&&(t=i),t?n=setTimeout((function(){b.show()}),t):b.show()}function te(e){if(b.clearDelayTimeouts(),D("onUntrigger",[b,e]),b.state.isVisible){if(!(b.props.trigger.indexOf("mouseenter")>=0&&b.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&p)){var t=C(!1);t?r=setTimeout((function(){b.state.isVisible&&b.hide()}),t):o=requestAnimationFrame((function(){b.hide()}))}}else R()}}function Xe(e,t){void 0===t&&(t={});var n=Ie.plugins.concat(t.plugins||[]);document.addEventListener("touchstart",Ce,fe),window.addEventListener("blur",De);var r,o=Object.assign({},t,{plugins:n}),i=(r=e,Ae(r)?[r]:function(e){return ve(e,"NodeList")}(r)?xe(r):Array.isArray(r)?r:xe(document.querySelectorAll(r))).reduce((function(e,t){var n=t&&Je(t,o);return n&&e.push(n),e}),[]);return Ae(e)?i[0]:i}Xe.defaultProps=Ie,Xe.setDefaultProps=function(e){Object.keys(e).forEach((function(t){Ie[t]=e[t]}))},Xe.currentInput=Te,Object.assign({},Y,{effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow)}}),Xe.setDefaultProps({render:Ve});const Ye=Xe,Qe=document.querySelector("[data-currency-symbol]")?.dataset?.currencySymbol||"$";(()=>{const t=window.location.search,n=new URLSearchParams(t),r=n.get("wptravelengine_action"),o="booking"===n.get("post_type"),i={};function a(){document.querySelectorAll(".wpte-date-picker")?.forEach((e=>{const t=e.dataset?.options,n=t?JSON.parse(t):{},r=flatpickr(e,n);e.id&&(i[e.id]=r)}))}a();const s=i.order_trip_start_date,c=i.order_trip_end_date;s&&c&&s.config.onChange.push(((e,t)=>{if(e.length>0){c.set("minDate",e[0]);const t=c.selectedDates[0];t&&t<e[0]&&c.clear()}}));const l=()=>{document.querySelectorAll(".wpte-tooltip")?.forEach((e=>{Ye(e,{content:e.dataset?.content,allowHTML:!0,interactive:!0,placement:"top",theme:"light-border"})}))};l();const u=()=>{const e=document.querySelector(".is-active");e&&e.classList.remove("is-active")};let p=null,d=null;document.querySelectorAll(".wpte-tab")?.forEach((e=>{""!=e.dataset.target&&e.addEventListener("click",(e=>{const t=e.currentTarget;e.preventDefault();const n=document.querySelector(`[data-target-id=${t.dataset.target}]`);n&&(p&&clearTimeout(p),d=t.dataset.target,function(e,t=10){if(!e)return void console.warn("scrollToElementWithOffset: target element not found");const n=e.getBoundingClientRect().top+window.scrollY-t;window.scrollTo({top:n,behavior:"smooth"})}(n,100),u(),t.parentElement.classList.add("is-active"),p=setTimeout((()=>{d=null,p=null}),1e3))}))}));var f=document.querySelectorAll(".wpte-form-section"),m={},y=0;Array.prototype.forEach.call(f,(function(e){m[e.dataset?.targetId]=e.offsetTop})),window.onscroll=function(){if(d)return;var e=document.documentElement.scrollTop||document.body.scrollTop;let t=null;for(y in m)m[y]<=e-400&&(t=y);if(t){u();const e=document.querySelector(`[data-target=${t}]`);e&&e.parentElement&&e.parentElement.classList.add("is-active")}};const v=document.querySelector(".wpte-copy-field"),g=v?.querySelector("input"),h=v?.querySelector("button");h?.addEventListener("click",(e=>{g.select(),g.setSelectionRange(0,99999),navigator.clipboard?navigator.clipboard.writeText(g.value):document.execCommand("copy")}));const b=()=>{const e=document.querySelectorAll(".wpte-accordion");e&&e.forEach((e=>{const t=e.querySelector(".wpte-accordion-toggle"),n=e.querySelector(".wpte-accordion-content");"true"!==t?.dataset.listenerAttached&&(t&&"none"!==n.style.display&&t.classList.add("active"),t?.addEventListener("click",(e=>{n.style.opacity=0,n.style.transition="opacity 0.3s","none"===n.style.display?(t.classList.add("active"),n.style.display="block",setTimeout((()=>{n.style.opacity=1}),100)):(t.classList.remove("active"),n.style.opacity=0,setTimeout((()=>{n.style.display="none"}),300))})),t&&(t.dataset.listenerAttached="true"))}))};b();const w=document.querySelectorAll("[data-type=add]"),x=document.getElementById("order_trip_number_of_travelers"),S=()=>{const e=document.querySelectorAll('[name*="fname"]'),t=document.querySelectorAll('[name*="lname"]');function n(e){const t=e.closest("tr").previousElementSibling;if(t){const n=e.closest("tr"),r=n.querySelector('[name*="fname"]'),o=n.querySelector('[name*="lname"]'),i=((r?r.value:"")+" "+(o?o.value:"")).trim();t.querySelector("td:first-child").innerText=i||"New Traveller","function"==typeof M&&setTimeout((()=>{M()}),0)}}e&&e.forEach((e=>{e.addEventListener("input",(e=>{n(e.target)}))})),t&&t.forEach((e=>{e.addEventListener("input",(e=>{n(e.target)}))}))};S();const q=e=>{if(!e)return 0;const t=String(e).trim().replace(/[^\d.-]/g,""),n=parseFloat(t);return isNaN(n)?0:n},A=()=>{const e=document.querySelector(".wpte-booking-due");if(e){const t=document.querySelector(".wpte-booking-total .wpte-price"),n=document.querySelector(".wpte-payment-summary-item-total .wpte-payment-deposit .wpte-price"),r=(t?q(t.textContent):0)-(n?q(n.textContent):0),o=e.querySelector(".wpte-price"),i=e.querySelector(".amount-column strong");if(o&&i){o.textContent=Math.abs(r).toFixed(2);const e=i.querySelector(".wpte-currency-code");e&&(Array.from(i.childNodes).forEach((e=>{e.nodeType===Node.TEXT_NODE&&"-"===e.textContent.trim()&&i.removeChild(e)})),r<0&&i.insertBefore(document.createTextNode("-"),e))}}},E=()=>{const e=document.querySelector(".wpte-booking-summary-table"),t=[...e.querySelectorAll(".wpte-line-item-total .wpte-price")].reduce(((e,t)=>e+q(t.textContent)),0),n=e.querySelectorAll(".wpte-booking-discount");let r=0;n.forEach((e=>{const t=e.querySelector(".wpte-price");t&&(r+=q(t.textContent))}));const o=[...e.querySelectorAll('[data-line-item__fees_section] input[name="fees[value][]"]')].reduce(((e,t)=>e+parseFloat(t.value||0)),0),i=t-r+o,a=e.querySelector(".wpte-booking-total .wpte-price");if(a){a.textContent=i.toFixed(2);const t=e.querySelector('.wpte-booking-total input[name="total"]');t&&(t.value=i.toFixed(2)),A()}};document.addEventListener("input",(e=>{if(e.target.classList.contains("wpte-cost-input")){const t=e.target;let n=t.value;n=n.replace(/[^\d.]/g,"");const r=n.split(".");r.length>2&&(n=r[0]+"."+r.slice(1).join("")),2===r.length&&r[1].length>2&&(n=r[0]+"."+r[1].substring(0,2)),t.value!==n&&(t.value=n),n&&!isNaN(n)&&parseFloat(n)<0&&(t.value="0")}}));const _=(e,t,{label:n,quantity:r,price:o})=>{const i=e.querySelectorAll("tr")[t];if(i){const e=i.querySelector(".wpte-line-item-total .wpte-price"),t=i.querySelector(".wpte-line-item-label"),a=i.querySelector(".wpte-line-item-quantity"),s=i.querySelector(".wpte-line-item-price .wpte-price")||i.querySelector(".wpte-line-item-price");t&&(t.textContent=n),a&&(a.textContent=r||1),s&&(s.textContent=o||0),e&&(e.textContent=(r||1)*(o||0)),E()}},O=()=>{const e=document.querySelector("[data-traveller-section]");e&&!e.hasAttribute("data-pricing-category-listener")&&(e.setAttribute("data-pricing-category-listener","true"),e.addEventListener("change",(e=>{if(e.target.matches('[name*="pricing_category"]')){const t=e.target.options[e.target.selectedIndex],n=t?t.textContent:e.target.value,r=e.target.closest("tr").previousElementSibling;if(r){const e=r.querySelector(".wpte-pricing-category-label");e&&(e.innerText=n)}}})))};O();const L=()=>{const e=document.querySelector("[data-traveller-section]");e&&!e.hasAttribute("data-pickup-point-listener")&&(e.setAttribute("data-pickup-point-listener","true"),e.addEventListener("input",(e=>{e.target.matches('input[name*="[pickup_point]"]')&&M()})))};L();const T=()=>{const e=document.querySelector("[data-accommodation-section]");e&&e.querySelectorAll("tr").forEach(((e,t)=>{const n=e.querySelector('input[name*="accommodation][label]"]'),r=e.querySelector('input[name*="accommodation][quantity]"]'),o=e.querySelector('input[name*="accommodation][price]"]');if(n&&r&&o){const e=e=>{setTimeout((()=>{const e=document.querySelector("[data-line-item__accommodation_section]");_(e,t,{label:n.value,quantity:r.value,price:o.value})}),100)};n.addEventListener("input",e),r.addEventListener("input",e),o.addEventListener("input",e)}}))},k=()=>{const e=document.querySelector("[data-extra-service-section]");e&&e.querySelectorAll("tr").forEach(((e,t)=>{const n=e.querySelector('input[name*="extra_service][label]"]'),r=e.querySelector('input[name*="extra_service][quantity]"]'),o=e.querySelector('input[name*="extra_service][price]"]');if(n&&r&&o){const e=()=>{setTimeout((()=>{const e=document.querySelector("[data-line-item__extra_service_section]");_(e,t,{label:n.value,quantity:r.value,price:o.value})}),100)};n.addEventListener("input",e),r.addEventListener("input",e),o.addEventListener("input",e)}}))},C=()=>{const e=document.querySelector("[data-travel-insurance-section]");e&&e.querySelectorAll("tr").forEach(((e,t)=>{const n=e.querySelector('input[name*="travel_insurance][label]"]'),r=e.querySelector('input[name*="travel_insurance][quantity]"]'),o=e.querySelector('input[name*="travel_insurance][price]"]');if(n&&r&&o){const e=()=>{setTimeout((()=>{const e=document.querySelector("[data-line-item__travel_insurance_section]");_(e,t,{label:n.value,quantity:r.value,price:o.value})}),100)};n.addEventListener("input",e),r.addEventListener("input",e),o.addEventListener("input",e)}}))},j=()=>{const e=document.querySelector("[data-line-item__pricing_category_section]");e&&Array.from(e.querySelectorAll("tr")).forEach((e=>{const t=e.querySelector(".wpte-line-item-total .wpte-price"),n=e.querySelector(".wpte-line-item-quantity"),r=parseInt(n?.textContent||1),o=e.querySelector('input[name*="price"]'),i=(e,n)=>{const r=(e||1)*(parseFloat(n)||0);t.textContent=r.toFixed(2),E()};o&&(o.addEventListener("input",(e=>i(r,e.target.value||0))),i(r,o.value||0))}))},D=()=>{const t=document.querySelector("[data-traveller-section]");if(!t)return;const n=()=>{const n=Array.from(t.querySelectorAll("tr")),r=n.filter(((e,t)=>t%2==0)),o=document.querySelector("[data-line-item__pricing_category_section]"),i={};o&&o.querySelectorAll("tr").forEach((e=>{const t=e.getAttribute("data-category-id"),n=e.querySelector('input[name*="price"]');t&&n&&(i[t]=parseFloat(n.value||"0"))}));const a=document.querySelector("[data-line-item__pickup_point_section]"),s={};a&&a.querySelectorAll("tr[data-traveler-index]").forEach((e=>{const t=e.getAttribute("data-traveler-index"),n=e.querySelector('input[name*="[price]"]');t&&n&&(s[t]=parseFloat(n.value||"0"))}));const c={};r.forEach(((e,t)=>{const r=n[2*t+1];if(r){const e=r.querySelector('select[name*="[pricing_category]"]');if(e){const t=e.value,n=e.options[e.selectedIndex].textContent;c[t]||(c[t]={label:n,count:0}),c[t].count++}}})),o&&(o.innerHTML="",Object.keys(c).forEach((t=>{const n=c[t],r="selectoption"===t?(0,e.__)("Traveller","wp-travel-engine"):n.label,a=i[t]||0;o.insertAdjacentHTML("beforeend",`\n <tr data-category-id="${t}">\n <td>\n <div style="display: flex;align-items:center;gap:.5em;">\n <span class="wpte-line-item-label" data-traveller-category-id="${t}">${r}:</span>\n <span class="wpte-line-item-quantity">${n.count}</span> ×\n <input type="hidden"\n name="line_items[pricing_category][${t}][quantity][]"\n value="${n.count}"\n class="wpte-line-item-quantity-input"\n data-category-id="${t}">\n <input type="number"\n placeholder="Price"\n name="line_items[pricing_category][${t}][price][]"\n value="${a}"\n style="min-width: 50px;" min="0" step="any"\n data-category-id="${t}">\n </div>\n </td>\n <td class="wpte-line-item-total">\n <span>\n <strong>${Qe}</strong>\n <strong class="wpte-price">0.00</strong>\n </span>\n </td>\n </tr>\n `)})),o.querySelectorAll("tr[data-category-id]").forEach((e=>{const t=e.querySelector(".wpte-line-item-quantity"),n=e.querySelector(".wpte-line-item-quantity-input");t&&n&&(n.value=t.textContent)})),j())};n(),t.hasAttribute("data-pricing-rebuild-listener")||(t.setAttribute("data-pricing-rebuild-listener","true"),t.addEventListener("change",(e=>{e.target.matches('select[name*="[pricing_category]"]')&&n()})))},M=()=>{const e=document.querySelector("[data-traveller-section]");if(!e)return;const t=()=>{const t=Array.from(e.querySelectorAll("tr")),n=t.filter(((e,t)=>t%2==0)),r=document.querySelector("[data-line-item__pickup_point_section]"),o={};r&&(r.querySelectorAll("tr[data-traveler-index]").forEach((e=>{const t=e.getAttribute("data-traveler-index"),n=e.querySelector('input[name*="[price]"]');t&&n&&(o[t]=parseFloat(n.value||"0"))})),0===Object.keys(o).length&&r.querySelectorAll("tr[data-traveller-id]").forEach((e=>{const t=e.getAttribute("data-traveller-id"),n=e.querySelector('input[name*="[price]"]');t&&n&&(o[t]=parseFloat(n.value||"0"))}))),r&&(r.innerHTML="",n.forEach(((e,n)=>{const i=t[2*n+1];if(i){const t=i.querySelector('input[name*="[pickup_point]"]');if(t){const i=e.querySelector("td:first-child"),a=i?i.textContent.trim():`Traveller ${n+1}`,s=t.value.trim(),c=o[n]||0;""!==s&&r.insertAdjacentHTML("beforeend",`\n <tr data-traveler-index="${n}" class="wpte-line-item-pickup-point-row">\n <td>\n <div style="display: flex;align-items:center;gap:.5em;">\n <span class="wpte-line-item-label" style="flex-wrap: wrap;">${s} <span class="wpte-line-item-traveller-name">(${a}):</span></span>\n <span class="wpte-line-item-quantity">1</span> ×\n <input type="hidden"\n name="line_items[pickup_point][label][]"\n value="${s} (${a})">\n <input type="hidden"\n name="line_items[pickup_point][quantity][]"\n value="1">\n <input type="hidden"\n name="line_items[pickup_point][traveller_id][]"\n value="${n}">\n <input type="number"\n placeholder="Price"\n name="line_items[pickup_point][price][]"\n value="${c}"\n style="min-width: 50px;" min="0" step="any"\n class="wpte-cost-input"\n data-traveler-index="${n}">\n </div>\n </td>\n <td class="wpte-line-item-total">\n <span>\n <strong>${Qe}</strong>\n <strong class="wpte-price">${c}</strong>\n </span>\n </td>\n </tr>\n `)}}})),I())};t(),e.hasAttribute("data-pickup-point-rebuild-listener")||(e.setAttribute("data-pickup-point-rebuild-listener","true"),e.addEventListener("input",(e=>{e.target.matches('input[name*="[pickup_point]"]')&&t()})))},I=()=>{const e=document.querySelector("[data-line-item__pickup_point_section]");e&&Array.from(e.querySelectorAll("tr")).forEach((e=>{const t=e.querySelector(".wpte-line-item-total .wpte-price"),n=e.querySelector('input[name*="[price]"]'),r=e=>{const n=parseFloat(e)||0;t.textContent=n,E()};n&&(n.addEventListener("input",(e=>r(e.target.value||0))),r(n.value||0))}))},H=(e,t,n)=>{const r=e.querySelector(`.wpte-payment-${t} .wpte-price`);r&&(r.textContent=parseFloat(n||0).toFixed(2))},$=(e,t,n)=>{const r=n.reduce(((t,n)=>{const r=e.querySelector(`input[data-key="${n}"]`);return r&&r.value?t+parseFloat(r.value):t}),0),o=e.querySelector('input[data-key="amount"]');o&&(o.value=r),H(t,"amount",r)},N=()=>{const e=document.querySelector("[data-summary-info]");if(!e)return;const t=Array.from(e.querySelectorAll('input[data-key="deposit"]')).reduce(((e,t)=>e+parseFloat(t.value||0)),0)+Array.from(e.querySelectorAll('input[data-key="amount"]')).reduce(((e,t)=>e+parseFloat(t.value||0)),0),n=document.querySelector('input[name="paid_amount"]');n&&(n.value=t.toFixed(2))},B=()=>{var e;const t=document.querySelector("[data-summary-info]"),n=JSON.parse(null!==(e=t.dataset.summaryInfo)&&void 0!==e?e:"[]"),r=document.querySelector(".wpte-payment-summary-item-total");n.forEach((e=>{const n=Array.from(t.querySelectorAll(`input[data-key="${e}"]`)).reduce(((e,t)=>e+parseFloat(t.value||0)),0),o=r?.querySelector(`tr.wpte-payment-${e} .wpte-price`);o&&(o.textContent=n.toFixed(2))})),N(),A()},P=e=>{var t;const n=document.querySelector("[data-payments-section]"),r=document.querySelector("[data-payment-summary-items]");if(!n||!r)return;const o=JSON.parse(null!==(t=document.querySelector('[data-target-id="payments"]').dataset.summaryInfo)&&void 0!==t?t:"[]"),i=n.querySelectorAll(".wpte-fields-grid"),a=r.querySelectorAll(".wpte-payment-card"),s=n.querySelectorAll(".wpte-accordion-subtitle"),c=wp.template("payment-summary-card"),l=wp.template("payment-summary-card-total");if(i.length>0){const e=document.querySelector(".wpte-payment-summary-item-total");e.querySelector(".wpte-payment-summary-card")||e.insertAdjacentHTML("beforeend",l({}))}if(0===a.length&&i.length>1)for(let e=0;e<i.length;e++)r.insertAdjacentHTML("beforeend",c({index:e,title:s[e].textContent}));a?.length>0&&i.length!==a?.length&&r.insertAdjacentHTML("beforeend",c({index:e,title:s[e]?.textContent}));const u=r.querySelectorAll(".wpte-payment-card");i.forEach(((e,t)=>{const n=u[t];if(!n)return;const r=o.filter((e=>"amount"!==e));r.forEach((t=>{const r=e.querySelector(`input[data-key="${t}"]`);r&&r.value&&H(n,t,r.value)})),$(e,n,r)})),B(),b()},R=()=>{const e=document.querySelector("[data-line-item__discounts_section]");e&&(e.hasAttribute("data-discount-listener")||(e.setAttribute("data-discount-listener","true"),e.addEventListener("input",(e=>{e.target.matches('input[name="discounts[value][]"]')&&E()}))))},F=()=>{const e=document.querySelector("[data-line-item__fees_section]");e&&(e.hasAttribute("data-fee-listener")||(e.setAttribute("data-fee-listener","true"),e.addEventListener("input",(e=>{e.target.matches('input[name="fees[value][]"]')&&E()}))))};function V(e){const t=document.querySelector("[data-traveller-section]")?.querySelector(".wpte-delete-button");t&&(1==e?t.classList.add("hidden"):t.classList.remove("hidden"))}function W(e){const t=e.closest("[data-accommodation-section]"),n=e.closest("[data-extra-service-section]"),r=e.closest("[data-traveller-section]"),o=e.closest("[data-payments-section]"),i=e.closest('[class*="-wrapper"]')||e.closest("tr"),a=i?.nextElementSibling,s=i?.previousElementSibling;if(t){const e=Array.from(t.querySelectorAll("tr")).indexOf(i),n=document.querySelector("[data-line-item__accommodation_section]");if(n&&-1!==e){const t=Array.from(n.querySelectorAll("tr"));t[e]?(t[e].remove(),console.log("Removed accommodation line item at index:",e)):console.warn("Line item not found at index:",e,"Total line items:",t.length)}else console.warn("Line item section not found or invalid row index:",e)}else if(n){const e=Array.from(n.querySelectorAll("tr")).indexOf(i),t=document.querySelector("[data-line-item__extra-service_section]")||document.querySelector("[data-line-item__extra_service_section]");if(t){const n=(t.querySelector("tbody")||t).querySelectorAll("tr");n[e]&&n[e].remove()}}else{if(r)return i?.remove(),a?.remove(),x&&document.querySelector("[data-traveller-section]")&&(x.value=document.querySelector("[data-traveller-section]").querySelectorAll("tr").length/2,V(x.value)),"HR"===s?.tagName&&s?.remove(),D(),M(),void E();if(o){const e=Array.from(o.querySelectorAll(".wpte-payment-wrapper, .wpte-fields-grid")).indexOf(i);i?.remove(),a?.remove(),"HR"===s?.tagName&&s?.remove();const t=o.querySelectorAll(".wpte-payment-wrapper, .wpte-fields-grid"),n=document.querySelector("[data-payment-summary-items]");if(1===t.length&&n)n.querySelectorAll(".wpte-payment-card").forEach((e=>e.remove()));else if(e>0&&n){const t=n.querySelectorAll(".wpte-payment-card"),r=e;t[r]&&t[r].remove()}return P(),void B()}}i?.remove(),a?.remove(),"HR"===s?.tagName&&s?.remove(),E()}if((r||o)&&(P(),B(),A(),N(),(()=>{const e=document.querySelector('[data-target-id="payments"]');if(!e)return;const t=JSON.parse(e.dataset.summaryInfo),n=e.querySelector("[data-payments-section]");n&&(n.hasAttribute("data-payment-sync-initialized")||(n.setAttribute("data-payment-sync-initialized","true"),n.addEventListener("input",(e=>{const r=e.target,o=t.some((e=>r.dataset.key&&r.dataset.key===`${e}`));if(!o)return;const i=t.filter((e=>"amount"!==e)),a=i.find((e=>r.dataset.key===`${e}`)),s=r.value,c=r.closest(".wpte-fields-grid")||r.closest(".wpte-payment-wrapper");if(c){const e=Array.from(n.querySelectorAll(".wpte-fields-grid")).indexOf(c),t=document.querySelector("[data-payment-summary-items]");if(t){const n=t.querySelectorAll(".wpte-payment-card")[e]||document.querySelector(".wpte-booking-summary-area .wpte-payment-summary-table");n&&(H(n,a,s),$(c,n,i))}B()}}))))})(),j(),T(),k(),C(),D(),M(),R(),F()),w){w.forEach((e=>{const t=document.querySelector(e.dataset.target),n=e.dataset.lineItemTarget?document.querySelector(e.dataset.lineItemTarget):null,r=e.dataset.lineItemTemplate?wp.template(e.dataset.lineItemTemplate):null;e.addEventListener("click",(function(o){if(o.preventDefault(),t){var i,s,c;const o=t.closest("[data-emergency-contact-section]")||(t.matches("[data-emergency-contact-section]")?t:null),u=t.closest("[data-traveller-section]")||(t.matches("[data-traveller-section]")?t:null),p=u?.querySelectorAll("tr")?.length?"traveller":"lead-traveller",d=null!==(i=null!==(s=parseInt(e.dataset.totalCount))&&void 0!==s?s:parseInt(e.dataset.currentIndex))&&void 0!==i?i:0,f=wp.template(e.dataset.template),m=JSON.parse(null!==(c=e.dataset.args)&&void 0!==c?c:"{}");if(t.insertAdjacentHTML("beforeend",f({index:d,...m,...p&&{travellerType:p}})),u){u.querySelectorAll(".wpte-toggle-button.is-active").forEach((e=>{e.classList.remove("is-active")})),u.querySelectorAll(".wpte-row-details.table-row").forEach((e=>{e.classList.remove("table-row")}));const e=u.querySelectorAll("tr"),t=e[e.length-2],n=e[e.length-1];if(t){const e=t.querySelector(".wpte-toggle-button");e&&e.classList.add("is-active")}n&&n.classList.contains("wpte-row-details")&&(n.classList.add("table-row"),function(e,t){const n=e.querySelectorAll("input, select, textarea, label"),r=/\[(\d+)\]/g;n?.forEach((e=>{if(e.matches("label")){const n=e.getAttribute("for");n&&e.setAttribute("for",n.replace(r,`[${t}]`))}else e.name=e.name.replace(r,`[${t}]`),e.id=e.id.replace(r,`[${t}]`)}))}(n,e.length/2-1))}if(o){const e=o.querySelectorAll(".wpte-fields-grid"),t=e.length-1,n=e[t];n&&function(e,t){e.querySelectorAll('input[type="radio"], input[type="checkbox"]').forEach((e=>{e.name=e.name.replace(/\[([^\]]+)\]\[\]/,`[${t}][]`)}))}(n,t)}if(n&&r){let e=n.querySelector("tbody");e||(n.insertAdjacentHTML("beforeend","<tbody></tbody>"),e=n.querySelector("tbody")),e.insertAdjacentHTML("beforeend",r({index:d,...m}))}e.dataset.currentIndex=t.querySelectorAll("tr, .wpte-payment-wrapper").length,e.dataset.totalCount=t.querySelectorAll("tr, .wpte-payment-wrapper").length,S(),a(),O(),L(),j(),T(),k(),C(),D(),M(),R(),F(),"payment-template"===e.dataset.template&&P(d),x&&document.querySelector("[data-traveller-section]")&&(x.value=document.querySelector("[data-traveller-section]").querySelectorAll("tr").length/2,V(x.value)),l()}}))})),document.addEventListener("click",(function(e){if(e.target.classList.contains("wpte-table-delete-row")){const t=e.target.closest("tr"),n=t?.closest("[data-accommodation-section]"),r=t?.closest("[data-extra-service-section]"),o=t?.closest("[data-travel-insurance-section]"),i=t?.closest("[data-line-item__discounts_section]"),a=t?.closest("[data-line-item__fees_section]");if(n){const e=Array.from(n.querySelectorAll("tr")).indexOf(t),r=document.querySelector("[data-line-item__accommodation_section]");if(r&&-1!==e){const t=Array.from(r.querySelectorAll("tr"));t[e]?(t[e].remove(),console.log("Removed accommodation line item at index:",e)):console.warn("Line item not found at index:",e,"Total line items:",t.length)}else console.warn("Line item section not found or invalid row index:",e);E()}else if(r){const e=Array.from(r.querySelectorAll("tr")).indexOf(t),n=document.querySelector("[data-line-item__extra-service_section]")||document.querySelector("[data-line-item__extra_service_section]");if(n){const t=(n.querySelector("tbody")||n).querySelectorAll("tr");t[e]&&t[e].remove()}E()}else if(o){const e=Array.from(o.querySelectorAll("tr")).indexOf(t),n=document.querySelector("[data-line-item__travel_insurance_section]");if(n){const t=(n.querySelector("tbody")||n).querySelectorAll("tr");t[e]&&t[e].remove()}E()}else if(i||a)return t?.remove(),void E();t?.remove()}if(e.target.classList.contains("wpte-delete-section")){e.preventDefault();const t=e.target.closest(".wpte-accordion").querySelector("[data-type=add]");if(t&&(t.dataset.currentIndex=parseInt(t.dataset.currentIndex)-1,t.dataset.totalCount=parseInt(t.dataset.totalCount)-1),window.currentDeleteButton=e.target,e.target.closest("[data-traveller-section]")){const e=document.getElementById("wpte-delete-traveller-confirm-modal");e?e.classList.add("open"):console.error("Modal not found!")}else W(e.target)}if(e.target.classList.contains("wpte-toggle-button")){const t=e.target.closest("tr").nextElementSibling;t.classList.contains("wpte-row-details")&&(e.target.classList.toggle("is-active"),t.classList.toggle("table-row"))}}));const e=document.getElementById("wpte-delete-traveller-confirm-modal");if(e){const t=e.querySelector(".wpte-confirm-modal"),n=e.querySelector(".wpte-traveller-delete"),r=function(){e.classList.remove("open")};e.addEventListener("click",(function(o){o.target.classList.contains("wpte-traveller-delete")||o.target===n?(window.currentDeleteButton&&W(window.currentDeleteButton),r()):(o.target.classList.contains("wpte-cancel")||o.target===e&&!t.contains(o.target))&&(console.log("Delete cancelled!"),r())}))}}const U=document.getElementById("booking_status");U&&jQuery(U).select2({tags:!0})})();const Ge=document.getElementById("wte-resend-purchase-receipt");Ge&&Ge.addEventListener("click",(async t=>{t.preventDefault(),Ge.disabled=!0;const n=Ge.textContent;Ge.textContent=(0,e.__)("Sending...","wp-travel-engine");try{const t=Ge.dataset.bookingId,n=Ge.dataset.nonce;if(!t||!n)throw new Error((0,e.__)("Missing required data attributes","wp-travel-engine"));const r=await fetch(wp.ajax.settings.url,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({action:"wte_resend_purchase_receipt",booking_id:t,nonce:n,resend_purchase_receipt:!0})}),o=await r.json();o.success?toastr.success(o.data?.message||(0,e.__)("Purchase receipt sent successfully!","wp-travel-engine")):toastr.error(o.data?.message||(0,e.__)("Failed to send purchase receipt","wp-travel-engine"))}catch(t){toastr.error(t.message||(0,e.__)("An error occurred while sending the receipt. Please try again.","wp-travel-engine"))}finally{Ge.disabled=!1,Ge.textContent=n}}))})();