(()=>{"use strict";const t="0.18",e=/^rgba?\((\d+),\s*(\d+),\s*(\d+)/;const n=/^#(?:[0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i;const r="NAVIGATE",o="SET_HEIGHT",i="iframe_id",a="24px",u={LIGHT:{BORDER:"1px solid rgba(31, 26, 20, 0.18)",SHADOW:"0 12px 32px rgba(31, 26, 20, 0.14)"},DARK:{BORDER:"1px solid rgba(255, 255, 255, 0.16)",SHADOW:"0 12px 32px rgba(0, 0, 0, 0.4)"}},l={CARD:"card"},d=600,c="opacity 0.3s ease-in-out",s="mb-auto-height-iframe-styles",m={FRAME:"mb-auto-height-iframe-frame",FRAME_CARD:"mb-auto-height-iframe-frame-card",PROGRESS_BAR:"mb-auto-height-iframe-progress",PROGRESS_BAR_VALUE:"mb-auto-height-iframe-progress-value"},f=`\n.${m.FRAME} {\n    width: 100%;\n}\n.${m.FRAME_CARD} {\n    background: #ffffff;\n    border: ${u.LIGHT.BORDER};\n    border-radius: ${a};\n    box-shadow: ${u.LIGHT.SHADOW};\n    overflow: hidden;\n}\n.${m.FRAME_CARD} > iframe {\n    border-radius: inherit;\n    clip-path: inset(0 round ${a});\n}\n.${m.FRAME_CARD} > .${m.PROGRESS_BAR} {\n    border-top-left-radius: inherit;\n    border-top-right-radius: inherit;\n}\n.${m.PROGRESS_BAR} {\n    height: 2px;\n    background-color: rgba(255, 118, 49, 0.18);\n    width: 100%;\n    overflow: hidden;\n}\n.${m.PROGRESS_BAR_VALUE} {\n    width: 100%;\n    height: 100%;\n    background-color: rgb(255, 118, 49);\n    animation: mbAutoHeightIframeIndeterminateAnimation 1s infinite linear;\n    transform-origin: 0% 50%;\n}\n@keyframes mbAutoHeightIframeIndeterminateAnimation {\n    0% {\n        transform: translateX(0) scaleX(0);\n    }\n    40% {\n        transform: translateX(0) scaleX(0.4);\n    }\n    100% {\n        transform: translateX(100%) scaleX(0.5);\n    }\n}\n`;function g({target:i,src:l,title:g,frame:h,backgroundColor:O,loadingColor:R}){!function(){if(document.getElementById(s))return;const t=document.createElement("style");t.id=s,t.textContent=f,document.head.appendChild(t)}();const _=`${l}-${Date.now()}`,C=function({src:t,title:e,backgroundColor:n}){const r=document.createElement("iframe");return r.title=e,r.src=t,r.style.width="100%",r.style.border="none",r.style.transition=c,r.style.display="block",r.style.backgroundColor=null!=n?n:"transparent",r}({src:E({url:l,iframeId:_}),title:g,backgroundColor:O}),T=function(n){const r=document.createElement("div"),o=document.createElement("div");return r.className=m.PROGRESS_BAR,o.className=m.PROGRESS_BAR_VALUE,n&&(r.style.backgroundColor=function(n){const r=function(t){const n=document.createElement("span");n.style.color=t,document.body.appendChild(n);const r=window.getComputedStyle(n).color;n.remove();const o=r.match(e);return o?{red:Number(o[1]),green:Number(o[2]),blue:Number(o[3])}:null}(n);return r?`rgba(${r.red}, ${r.green}, ${r.blue}, ${t})`:n}(n),o.style.backgroundColor=n),r.appendChild(o),r}(R),A=function(t){var e;const n=document.createElement("div");return n.setAttribute("role","region"),n.setAttribute("aria-label",function(t){return b(t)?"Mallard Bay framed widget iframe":"Mallard Bay widget iframe"}(t)),n.setAttribute("data-mb-auto-height-iframe-frame",null!==(e=null==t?void 0:t.variant)&&void 0!==e?e:"plain"),n.className=b(t)?`${m.FRAME} ${m.FRAME_CARD}`:m.FRAME,n}(h);b(h)&&function({iframeFrame:t,iframe:e,progressBar:r,backgroundColor:o}){const i=function(t){const e=null==t?void 0:t.trim();return Boolean(e&&n.test(e)&&function(t){const e=t.replace("#",""),n=e.length<=4?e.slice(0,3).split("").map((t=>t+t)).join(""):e.slice(0,6),r=t=>{const e=parseInt(n.slice(t,t+2),16)/255;return e<=.03928?e/12.92:((e+.055)/1.055)**2.4},o=.2126*r(0)+.7152*r(2)+.0722*r(4);return 1.05/(o+.05)>(o+.05)/.05}(e))}(o)?u.DARK:u.LIGHT;t.style.background=null!=o?o:"transparent",t.style.border=i.BORDER,t.style.borderRadius=a,t.style.boxShadow=i.SHADOW,t.style.overflow="hidden",t.style.width="100%",e.style.borderRadius=a,e.style.clipPath=`inset(0 round ${a})`,r.style.borderTopLeftRadius=a,r.style.borderTopRightRadius=a}({iframeFrame:A,iframe:C,progressBar:T,backgroundColor:O});let p=!1,y=0;function L(){const t=!p||!y;C.style.height=`${t?d:y}px`,C.style.opacity=t?"0":"1",T.hidden=!t}C.addEventListener("load",(()=>{p=!0,L()})),window.addEventListener("message",(t=>{var e,n,i;if((null===(e=t.data)||void 0===e?void 0:e.iframeId)===_&&function({event:t,iframe:e,src:n}){const r=function(t){try{return new URL(t,window.location.href).origin}catch(t){return null}}(n);return t.source===e.contentWindow&&Boolean(r&&t.origin===r)}({event:t,iframe:C,src:l}))return(null===(n=t.data)||void 0===n?void 0:n.type)===o?(y=Number(t.data.height)||0,void L()):void((null===(i=t.data)||void 0===i?void 0:i.type)===r&&function(t){const e=function(t){if("string"!=typeof t)return null;try{const e=new URL(t,window.location.href);return["http:","https:"].includes(e.protocol)?e.username||e.password?null:e.toString():null}catch(t){return null}}(t);e&&(window.location.href=e)}(t.data.url))})),L(),A.replaceChildren(T,C),i.replaceChildren(A)}function E({url:t,iframeId:e}){const n=new URL(t,window.location.href);return n.searchParams.set(i,e),n.toString()}function b(t){return(null==t?void 0:t.variant)===l.CARD}var h,O;!function(t){t.Problem="problem",t.Solution="solution",t.Default="default"}(h||(h={})),function(t){t.CLIENT_NAME="x-client-name",t.CLIENT_VERSION="x-client-version",t.UTM_CAMPAIGN="x-utm-campaign",t.UTM_CONTENT="x-utm-content",t.UTM_SOURCE="x-utm-source",t.UTM_MEDIUM="x-utm-medium",t.UTM_TERM="x-utm-term"}(O||(O={}));const R="source_url",_="form_id",C="widget_frame",T="widget_mode",A="omit_embed_title";var p;!function(t){t.AddOn="AddOn",t.QuoteAddOn="QuoteAddOn",t.PricingPackage="PricingPackage"}(p||(p={}));var y,L,v,S,N;!function(t){t.CurrentOutfitter="useCurrentOutfitter must be used within a CurrentOutfitterProvider",t.CurrentListing="useCurrentListing must be used within a CurrentListingProvider",t.CurrentBooking="useCurrentBooking must be used within a CurrentBookingProvider",t.Search="useSearch must be used within a SearchProvider"}(y||(y={})),function(t){t.Outfitter="Outfitter",t.Listing="Listing",t.Country="Country",t.State="State",t.Species="Species",t.SearchHistory="SearchHistory"}(L||(L={})),function(t){t.Outfitter="OUTFITTER",t.Listing="LISTING"}(v||(v={})),function(t){t.Map="MAP",t.Video="VIDEO",t.Banner="BANNER",t.EntityCardCollection="ENTITY_CARD_COLLECTION",t.EntityCarouselCollection="ENTITY_CAROUSEL_COLLECTION",t.ImageFullWidth="IMAGE_FULL_WIDTH"}(S||(S={})),function(t){t.IdList="ID_LIST",t.Search="SEARCH"}(N||(N={}));const M={CARD:"card",PLAIN:"plain"},w={WIDGET_FRAME:"data-widget-frame",WIDGET_LOGO_URL:"data-widget-logo-url",THEME_BRAND_COLOR:"data-theme-brand-color",THEME_BACKGROUND_COLOR:"data-theme-background-color",THEME_TEXT_COLOR:"data-theme-text-color",THEME_BUTTON_COLOR:"data-theme-button-color",THEME_BUTTON_TEXT_COLOR:"data-theme-button-text-color",THEME_HEADER_BACKGROUND_COLOR:"data-theme-header-background-color",THEME_HEADER_TEXT_COLOR:"data-theme-header-text-color",THEME_FONT_FAMILY:"data-theme-font-family",THEME_HEADING_FONT_FAMILY:"data-theme-heading-font-family",THEME_FONT_CSS_URL:"data-theme-font-css-url"};function I(t){if(t===M.CARD)return{variant:M.CARD}}function D(t){var e,n,r;return null!==(n=null===(e=t.theme)||void 0===e?void 0:e.brandColor)&&void 0!==n?n:null===(r=t.theme)||void 0===r?void 0:r.buttonColor}function H({element:t,attributeName:e,key:n}){const r=k(t,e);return r?{[n]:r}:{}}function k(t,e){return(null==t?void 0:t.getAttribute(e))||null}function B(t){return`\\u${t.charCodeAt(0).toString(16).padStart(4,"0")}`}const F="data-form-id",U="data-omit-embed-title";function G(){return function({element:t,shouldIncludeWidgetConfig:e=!1}){const n=function(t){const e=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},H({element:t,attributeName:w.THEME_BRAND_COLOR,key:"brandColor"})),H({element:t,attributeName:w.THEME_BACKGROUND_COLOR,key:"backgroundColor"})),H({element:t,attributeName:w.THEME_TEXT_COLOR,key:"textColor"})),H({element:t,attributeName:w.THEME_BUTTON_COLOR,key:"buttonColor"})),H({element:t,attributeName:w.THEME_BUTTON_TEXT_COLOR,key:"buttonTextColor"})),H({element:t,attributeName:w.THEME_HEADER_BACKGROUND_COLOR,key:"headerBackgroundColor"})),H({element:t,attributeName:w.THEME_HEADER_TEXT_COLOR,key:"headerTextColor"})),H({element:t,attributeName:w.THEME_FONT_FAMILY,key:"fontFamily"})),H({element:t,attributeName:w.THEME_HEADING_FONT_FAMILY,key:"headingFontFamily"})),H({element:t,attributeName:w.THEME_FONT_CSS_URL,key:"fontCssUrl"}));return Object.keys(e).length>0?e:void 0}(t),r=e?k(t,w.WIDGET_LOGO_URL):null;return Object.assign(Object.assign({},n?{theme:n}:{}),r?{widget:{logoUrl:r}}:{})}({element:document.currentScript})}!function(){var t;const e=null===(t=document.currentScript)||void 0===t?void 0:t.getAttribute(F),n=window.location.href,r=function(t){const e=k(document.currentScript,w.WIDGET_FRAME),n=Object.values(M);return e&&n.includes(e)?e:M.CARD}(),o=G(),i=function(){var t;return"true"===(null===(t=document.currentScript)||void 0===t?void 0:t.getAttribute(U))}(),a=new URLSearchParams;a.set(_,null!=e?e:""),a.set(R,n),a.set(T,"inline"),a.set(C,r),function(t,e){e&&t.set(A,"true")}(a,i),function(t,e){(function(t){return Boolean(t.theme&&Object.keys(t.theme).length>0||t.widget&&Object.keys(t.widget).length>0)})(e)&&t.set("mb_config",function(t){return btoa(JSON.stringify(t).replace(/[\u007F-\uFFFF]/g,B))}(e))}(a,o),function({src:t,title:e,widgetFrame:n,appConfig:r}){var o;const i=document.currentScript;if(!i)return;const a=document.createElement("div");i.insertAdjacentElement("beforebegin",a),g({target:a,src:t,title:e,frame:I(n),backgroundColor:null===(o=r.theme)||void 0===o?void 0:o.backgroundColor,loadingColor:D(r)})}({src:`https://mallardbay.com/embed-content/form-submission?${a.toString()}`,title:"Mallard Bay form widget",widgetFrame:r,appConfig:o})}()})();