function H(){import("data:text/javascript,")}const I=function(){const t=document.createElement("link").relList;return t&&t.supports&&t.supports("modulepreload")?"modulepreload":"preload"}(),S=function(e){return"https://cdn.myshopline.com/t/layout/plugin/2023103020061010/sales-notice-plugin/"+e},O={},p=function(t,n,r){if(!n||n.length===0)return t();const o=document.getElementsByTagName("link");return Promise.all(n.map(i=>{if(i=S(i),i in O)return;O[i]=!0;const c=i.endsWith(".css"),w=c?'[rel="stylesheet"]':"";if(!!r)for(let u=o.length-1;u>=0;u--){const f=o[u];if(f.href===i&&(!c||f.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${i}"]${w}`))return;const s=document.createElement("link");if(s.rel=c?"stylesheet":I,c||(s.as="script",s.crossOrigin=""),s.href=i,document.head.appendChild(s),c)return new Promise((u,f)=>{s.addEventListener("load",u),s.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${i}`)))})})).then(()=>t())};function a(e){return a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(e)}function b(e,t){if(a(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(a(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function P(e){var t=b(e,"string");return a(t)==="symbol"?t:String(t)}function y(e,t,n){return t=P(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function l(e){for(var t=1;t0)}function R(e){if(e&&a(e)==="object"){var t=[];return Object.keys(e).forEach(function(n){t.push("".concat(n,"=").concat(encodeURIComponent(e[n])))}),t.join("&")}return e}var E=function(t,n){var r=n.params?"".concat(t,"?").concat(R(n.params)):t;return fetch(r,l(l({},n),{},{headers:l({"content-type":"application/json"},n.headers),body:JSON.stringify((n==null?void 0:n.data)||n.body),credentials:"include"})).then(function(o){return o.status!==200?Promise.reject(o.json()):o.json()})},h=function(t,n){return typeof t<"u"?"".concat(t).concat(n):n},A=function(t){var n=t||{},r=n.baseURL;return{get:function(i,c){return E(h(r,i),l(l({},c),{},{method:"GET"}))},post:function(i,c){return E(h(r,i),l(l({},c),{},{method:"POST"}))}}};const N=A,D=()=>{window.magpieBridge||(window.magpieBridge={})},L=()=>{var e,t;return(t=(e=window==null?void 0:window.Shopline)==null?void 0:e.uri)==null?void 0:t.alias};function T(){var t;return((t=window.Shopline)==null?void 0:t.themeTypeVersion)>=2.1}const B=960,U=750;function M(){return document.body.clientWidth||document.documentElement.clientWidth}function m(e){const t=M();return e===void 0?T()?t{var t,n,r;return e?m(e):(r=(n=(t=window==null?void 0:window.SL_State)==null?void 0:t.get("request"))==null?void 0:n.is_mobile)!=null?r:m(e)};D();var j=function(){return window.self!==window.top&&window.innerWidth<=(T()?960:750)},v=function(){return W()||j()},K=function(){var t,n=(t=window.Shopline)===null||t===void 0?void 0:t.uri;return(n==null?void 0:n.alias)==="Page"||(n==null?void 0:n.alias)==="Policy"?n.customPageId:""};const V=N({baseURL:"/api/sale"}),G=e=>V.get("/plugin/common/notice_board/get",{params:e});var _=(e=>(e.WEBSITE="WEBSITE",e.MOBILE="MOBILE",e))(_||{}),F=(e=>(e.TOP="TOP",e.TOP_FIXED="TOP_FIXED",e.BOTTOM_FIXED="BOTTOM_FIXED",e))(F||{}),X=(e=>(e.TEXT_NOTICE_BOARD="TEXT_NOTICE_BOARD",e.COUNT_DOWN_NOTICE_BOARD="COUNT_DOWN_NOTICE_BOARD",e.DISCOUNT_CODE_NOTICE_BOARD="DISCOUNT_CODE_NOTICE_BOARD",e.FESTIVAL_NOTICE_BOARD="FESTIVAL_NOTICE_BOARD",e))(X||{}),$=(e=>(e.CLICK_WHOLE="CLICK_WHOLE",e.CLICK_BUTTON="CLICK_BUTTON",e))($||{}),k=(e=>(e.NONE="NONE",e.PRESET_PAGE="PRESET_PAGE",e.CUSTOMER_PAGE="CUSTOMER_PAGE",e.OUT_LINK="OUT_LINK",e))(k||{});function d(e){window.Shopline?p(()=>import("./simpleBootstrap-chunk-f9252ce2.js"),["simpleBootstrap-chunk-f9252ce2.js","App-chunk-7bd530ff.js","assets/App.a0f9ad38" + (document.dir === 'rtl' ?'-rtl':'') +".css"]).then(({default:t})=>{const{mount:n}=t;typeof n=="function"&&n(e)}):p(()=>import("./bootstrap-chunk-5a5b0d33.js"),["bootstrap-chunk-5a5b0d33.js","App-chunk-7bd530ff.js","assets/App.a0f9ad38" + (document.dir === 'rtl' ?'-rtl':'') +".css"]).then(({default:t})=>{const{mount:n}=t;typeof n=="function"&&n(e)})}if(window.Shopline){const e=K(),t=e||L(),n=v();G({supportPlatform:n?_.MOBILE:_.WEBSITE,effectivePage:t}).then(r=>{var o;r.code==="SUCCESS"&&r.data&&C((o=r.data)==null?void 0:o.noticeBoardList)&&d({options:{salesNoticeInfo:{...r.data,isMobile:n,isPreview:!1}}})})}else if(window.__SALES_MARKETING_PREVIEW_DATA__){const{previewData:e={},queryParams:t={}}=window.__SALES_MARKETING_PREVIEW_DATA__||{},n=(t==null?void 0:t.previewType)==="pc"||(t==null?void 0:t.previewType)==="mobile"?(t==null?void 0:t.previewType)==="mobile":v(),r=(t==null?void 0:t.language)||"en";d({options:{salesNoticeInfo:{...e,previewSlotId:"sales-notice-plugin-slot",isMobile:n,isPreview:!0,language:r}}})}else d();export{F as D,$ as J,k as L,X as N,y as _,H as __vite_legacy_guard,K as a,L as g,C as i};