!function(){"use strict";var e={525:function(e,t,n){n.r(t),n(330).A.action.SendAccessLog=class{constructor(e){this.validateOptions(e)&&(this.result=this.loadAccessImage(e))}validateOptions(e){return e.hostname?e.tid?e.gid?!!e.sid||(console.warn("Sechstant CRM計測タグにsidを定義してください。"),!1):(console.warn("Sechstant CRM計測タグにgidを定義してください。"),!1):(console.warn("Sechstant CRM計測タグにtidを定義してください。"),!1):(console.warn("Sechstant CRM計測タグにホスト名(hostname)を定義してください。"),!1)}loadAccessImage(e){if("00000000-0000-0000-0000-000000000000"==e.gid)return;let t="//".concat(e.hostname,"/api/accesslog/");return t+="?tid=".concat(encodeURIComponent(e.tid)),t+="&gid=".concat(encodeURIComponent(e.gid)),t+="&sid=".concat(encodeURIComponent(e.sid)),t+="&url=".concat(encodeURIComponent(document.location.href)),new Promise(((e,n)=>{const o=new Image;o.onload=()=>e(o),o.onerror=e=>n(e),o.src=t}))}}},483:function(e,t,n){n.r(t);var o=n(330);function a(e,t,n){var o;return(t="symbol"==typeof(o=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,"string");if("object"!=typeof o)return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t))?o:String(o))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}o.A.action.SendCart=class{constructor(e,t){a(this,"requiredKeys",["hostname","tid","event"]),a(this,"validKeys",["tid","gid","chash","customerhash","index","event","time","goods","goods_url","goods_name","goods_image"]),a(this,"eventCode",{cartUpdate:"CartUpdate",cartConversion:"CartConversion",goodsView:"GoodsView"});const n=this;this.params=e;const o={cartHashKey:"__msgsvc_cart",cartHashLength:16,customerHashKey:"__msgsvc_customer",customerHashLength:16};if(t&&(t.cartHashKey&&(o.cartHashKey=t.cartHashKey),t.cartHashLength&&(o.cartHashLength=t.cartHashLength),t.customerHashKey&&(o.customerHashKey=t.customerHashKey),t.customerHashLength&&(o.customerHashLength=t.customerHashLength)),this.config=o,!e)return;const s=Object.keys(e);let r=!1;for(let e in this.requiredKeys)-1==s.indexOf(this.requiredKeys[e])&&(console.warn("Sechstant CRM計測タグに".concat(this.requiredKeys[e],"を定義してください。")),r=!0);if(r)return;const c=this.getCartHash(),i=this.getCustomerHash(),u={};u.chash=c,u.customerhash=i,u.time=(new Date).getTime();for(let t in s){const n=s[t];n&&-1!=this.validKeys.indexOf(n)&&(u[n]=e[n])}const h=n.encodeParameter(u);this.baseParameters=h,this.result=new Promise(((t,o)=>{let a=1;const s=[];let r=!1;if(e.event==n.eventCode.cartConversion){const t="//".concat(e.hostname,"/api/accesslog/?").concat(h,"&index=").concat(a);s.push(n.loadImage(t)),r=!0}else if(e.event==n.eventCode.goodsView){const t=n.encodeParameter(e.goods_view),o="//".concat(e.hostname,"/api/accesslog/?").concat(h,"&").concat(t);s.push(n.loadImage(o))}else{const t=20;if(e&&e.cart&&e.cart.length>0){const o=e.cart.length;for(let r in e.cart){if(t{const o=new Image;o.onload=()=>t(o),o.onerror=e=>n(e),o.src=e}))}),32e3)}exponentialBackoffRetry(e,t){const n=this;let o=1;return function a(){return e().catch((e=>{const s=Math.min(1e3*Math.pow(2,o)+n.getRandomMilliseconds(),t);return ssetTimeout(t,e)))}getRandomMilliseconds(){return 1e3*Math.random()}}},92:function(e,t,n){n.r(t),n(330).A.library.Cookie=class{constructor(){this.name="Cookie"}get(e){return e&&this.has(e)?unescape(document.cookie.replace(new RegExp("(?:^|.*;\\s*)"+escape(e).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*"),"$1")):null}set(e,t,n,o,a,s){if(e&&!/^(?:expires|max\-age|path|domain|secure)$/i.test(e)){var r="";if(n)switch(n.constructor){case Number:r=n===1/0?"; expires=Tue, 19 Jan 2038 03:14:07 GMT":"; max-age="+n;break;case String:r="; expires="+n;break;case Date:r="; expires="+n.toGMTString()}document.cookie=escape(e)+"="+escape(t)+r+(a?"; domain="+a:"")+(o?"; path="+o:"")+(s?"; secure":"")}}remove(e,t){e&&this.has(e)&&(document.cookie=escape(e)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT"+(t?"; path="+t:""))}has(e){return new RegExp("(?:^|;\\s*)"+escape(e).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(document.cookie)}}},330:function(e,t){t.A={action:{},library:{}}}},t={};function n(o){var a=t[o];if(void 0!==a)return a.exports;var s=t[o]={exports:{}};return e[o](s,s.exports,n),s.exports}n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};!function(){n.r(o);var e=n(330);o.default=e.A,n(525),n(483),n(92);let t="__msgsvc";const a=document.currentScript.dataset;a&&a.sender&&(t=a.sender);const s=window[t];if(!s)throw new Error("Sechstant CRM計測タグ(__msgsvc)を定義してください。");s.totalCount=0,s.sendCount=0;const r=new e.A.action.SendAccessLog(s),c=new e.A.action.SendCart(s,a);if(async function(){r.result&&(s.totalCount++,await r.result.then((()=>{s.sendCount++})).catch((e=>{console.warn("SendAccessLog: error",e)}))),c.result&&(s.totalCount++,await c.result.then((()=>{s.sendCount++})).catch((e=>{console.warn("SendCart: error",e)})))}(),s.leaveConfirm){const e=function(e){s.sendCount!=s.totalCount&&(e.preventDefault(),e.returnValue="")};window.addEventListener("beforeunload",e),s.leaveConfirmTimeout&&window.setTimeout((()=>{window.removeEventListener("beforeunload",e)}),s.leaveConfirmTimeout)}}(),window.msgsvc=o}();