PageSourceSearch

https://www.browncastlegames.com/cdn/shop/t/16/assets/subscription…?v=34967155181433301461720372472

js browncastlegames.com collected 2026-10-06 20:46:47 UTC 32,537 bytes, 348 lines download raw bytes

1(async function(){if(window.ShopifyAnalytics.meta.page.pageType!=="product")return;var product=JSON.parse(document.querySelector("#sealoop_product").textContent),screenWidth=document.body.clientWidth/3,shopify_product_id=product.id,variants=product.variants,selected_variant_id=JSON.parse(document.querySelector("#sealoop_product_selected_or_first_variant").textContent),selected_variant=null,selected_variant_isExist_plan=!1,url_variant_id=window.location.href.split("variant=")[1],plan=product.selling_plan_groups,money_format=JSON.parse(document.querySelector("#sealoop_money_format").textContent),priceformat=money_format.replace(/<[^>]+>/g,"").split("{")[0],form_elementArr=document.forms,shopify_payment_button=null,domain=Shopify.shop,description=null,template=1,translationData={};let customStyle="";if(domain==="betternotebook-8689.myshopify.com"&&(customStyle+=`div#sealoop_subscription_plan {
2			margin-top: -50px;
3	}`),!plan)return;const baseUrl="prod".indexOf("dev")===-1?"https://subapi.sealapps.com/":"https://subapitest.uppercommerce.com/";if((await getShopSetting()).data.is_subscription_enabled!==1)return;isExistParentAndUpdateElement(),handleInit();function request2(params,url,callback,method="POST"){return new Promise(resolve=>{const xmlHttp=new XMLHttpRequest;xmlHttp.open(method,url,!0),xmlHttp.setRequestHeader("Content-Type","application/json"),xmlHttp.send(JSON.stringify(params)),xmlHttp.onreadystatechange=function(){if(xmlHttp.readyState==4&&xmlHttp.status==200||xmlHttp.status==304){const json=JSON.parse(this.responseText),{code,data}=json;code===200?(callback&&callback(data),resolve(json)):code!==500&&resolve(json)}}})}function getShopSetting(){return requestIni({shopify_product_id},baseUrl+"api/v1/setting/getShopSettings",void 0,"GET")}function getTemplate(){let url=baseUrl+"api/v1/guide/getStep";return requestIni({step:3},url).then(res=>res.code!=200?!1:(template=res.data.style,shopify_payment_button!=null&&(importStyles(),selectDescription(),VariantListener()),!0)).catch(err=>!1)}function getTranslation(){let url=baseUrl+"api/v1/getTranslateByC";return requestIni({},url).then(res=>res.code!=200?!1:(translationData=res.data,!0)).catch(err=>!1)}function requestIni(params,url,callback,method="POST"){return new Promise(resolve=>{const xmlHttp=new XMLHttpRequest;method==="GET"&&(url+=Object.keys(params).reduce((pre,item)=>pre+"&"+item+"="+params[item],"").replace("&","?")),xmlHttp.open(method,url,!0),xmlHttp.setRequestHeader("Content-Type","application/json"),xmlHttp.setRequestHeader("authorization",domain),method==="POST"?xmlHttp.send(JSON.stringify(params||{})):method==="GET"&&xmlHttp.send(),xmlHttp.onreadystatechange=function(){if(xmlHttp.readyState==4&&xmlHttp.status==200||xmlHttp.status==304){const json=JSON.parse(this.responseText),{code,data}=json;code===200?(callback&&callback(data),resolve(json)):code!==500&&resolve(json)}}})}function isExistParentAndUpdateElement(){if(form_elementArr!=null){for(let i=0;i<form_elementArr.length;i++)if(form_elementArr[i].action.indexOf("/cart/add")!=-1){const children=form_elementArr[i].elements;if(domain==="regenerativcollagen.myshopify.com"&&form_elementArr[i].offsetParent!==null&&(shopify_payment_button=form_elementArr[i]),!shopify_payment_button){for(let i2=0;i2<children.length;i2++)if(children[i2].getAttribute("type")==="submit"){shopify_payment_button=children[i2].parentElement;break}}if(shopify_payment_button)break}}}function handleInit(){if(shopify_payment_button!=null){{let html='<div id="sealoop_subscription_plan"><input type="hidden" name="selling_plan" class="selling_plan"/>';html+='<div class="sub-plan-head"></div>',html+='<div class="sub-plan-group-box"></div></div>',shopify_payment_button.insertAdjacentHTML("afterBegin",html)}document.querySelector(".sub-plan-group-box").addEventListener("click",evt=>{const dom=evt.target;checkGroupShow(dom)}),getTranslation(),getTemplate()}}
3function getVarData(){variants.forEach(v=>{v.id==selected_variant_id&&(selected_variant=v)}),initSubPlanGroup()}function initSubPlanGroup(){let html="";selected_variant_isExist_plan=!1,plan.forEach(vv=>{vv.app_id=="auto-subscription"&&(vv.price_data=[],selected_variant.selling_plan_allocations.forEach(v=>{vv.selling_plans.forEach(val=>{val.id==v.selling_plan_id&&(selected_variant_isExist_plan=!0,vv.price_data.push({id:val.id,price:returnFloat(v.price/100),per_delivery_price:v.per_delivery_price/100}),v.discount_type=val.price_adjustments[0].value_type,v.discount_value=val.price_adjustments[0].value),description?.forEach(d=>{d.resource_id==val.id&&(d.description==null&&(d.description=""),val.description=d.description)})})}),template==1&&(html+=cubeCreateHtml(vv)),template==2&&(html+=radioCreateHtml(vv)),template==3&&(html+=dropDownCreateHtml(vv)))});let headHtml="";if(selected_variant_isExist_plan){if(product.requires_selling_plan)switch(headHtml+=`<legend id="purchase-options" class="sub_legend">${translationData.options}</legend>`,template){case 1:headHtml+='<div class="Sealapp-Subscription-Option"></div>';break;case 2:headHtml+='<div class="Sealapp-Subscription-Option Sealapp-Subscription_Unfurl">';break;case 3:headHtml+='<div class="Sealapp-Subscription-Option Sealapp-Subscription_DownList">';break}else switch(headHtml+='<legend id="purchase-options" class="sub_legend" style="display:none ">Purchase Options</legend>',template){case 1:headHtml+=`<div class="Sealapp-Subscription-Option">
4									<div class="Sealapp-Subscription-Option_One-Time Sealapp-Subscription-Option_Rectangle" style="background-color: rgb(242, 247, 254); border: 1px solid rgb(144, 178, 228);">
5										<input class="sub-plan-selector-group-item" name="sub-plan-selector-group" value="" style="display:none" checked />
6										<div class="Sealapp-Subscription-Option_Rectangle-top">${translationData.option1}</div>
7											<div class="Sealapp-Subscription-Option_Rectangle_bottom"> ${priceformat+returnFloat(selected_variant.price/100)} (${translationData.app_full_price})</div>
8									</div>
9								</div>`;break;case 2:headHtml+=`<div class="Sealapp-Subscription-Option Sealapp-Subscription_Unfurl">
10									<div class="Sealapp-Subscription-Option_One-Time Sealapp-Subscription-Option_Unfurl">
11											<label for="PolarisRadioButton1" class="Sealapp-Subscription-Option_Unfurl_Label">
12													<span class="Sealapp-Subscription-Option_label-radio">
13															<input id="PolarisRadioButton1" type="radio" class="Sealapp-Subscription-Option_label-radio-Input" value="" name="sub-plan-selector-group" checked>
14													</span>
15													<span>${translationData.option1}</span>
16													<span class="Sealapp-Subscription-Option_price">${priceformat+returnFloat(selected_variant.price/100)}</span>
17											</label>
18									</div>`;break;case 3:headHtml+=`<div class="Sealapp-Subscription-Option Sealapp-Subscription_DownList">
19									<div class="Sealapp-Subscription-Option_One-Time Sealapp-Subscription-Option_DownList">
20											<label for="PolarisRadioButton1" class="Sealapp-Subscription-Option_DownList_Label">
21													<span class="Sealapp-Subscription-Option_label-radio">
22															<input id="PolarisRadioButton1" type="radio" class="Sealapp-Subscription-Option_label-radio-Input" value="" name="sub-plan-selector-group" checked>
23													</span>
24													<span>${translationData.option1}</span>
25													<span class="Sealapp-Subscription-Option_price">${priceformat+returnFloat(selected_variant.price/100)}</span>
26											</label>
27									</div>`;break}document.querySelector(".sub-plan-head").innerHTML=headHtml,document.querySelector(".Sealapp-Subscription-Option").insertAdjacentHTML("beforeend",html)}else document.querySelector(".sub-plan-head").innerHTML=headHtml;if(template==1){if(product.requires_selling_plan){var cubeInput=document.querySelector("[name=sub-plan-selector-group]");cubeInput.checked=!0;var cubeEl=document.querySelector(".Sealapp-Subscription-Option_Rectangle");cubeEl.style.backgroundColor="#f2f7fe",cubeEl.style.border="1px solid #90b2e4",document.querySelector(".selling_plan")!=null&&(document.querySelector(".selling_plan").value=cubeInput.value?cubeInput.value:"")}cubeEvent()}if(template==2){if(product.requires_selling_plan){var radioParentInput=document.querySelector("input[name=sub-plan-selector-group]"),radioChildInput=document.querySelector("input[name=sub-plan-selector-group-item]");radioParentInput.checked=!0,radioChildInput.checked=!0;var radioEl=document.querySelector(".Sealapp-Subscription-Option_Unfurl"),radioElChild=radioEl.querySelector(".Sealapp-Subscription-Option-Child_Unfurl");radioEl.style.backgroundColor="#f2f7fe",radioEl.style.border="1px solid #90b2e4",radioElChild.style.display="block",document.querySelector(".selling_plan")!=null&&(document.querySelector(".selling_plan").value=radioC
27hildInput.value?radioChildInput.value:"")}radioSelect()}if(template==3){if(product.requires_selling_plan){var listParentInput=document.querySelector("input[name=sub-plan-selector-group]"),listChildInput=document.querySelector("input[name=sub-plan-selector-group-item]");listParentInput.checked=!0,listChildInput.checked=!0;var listEl=document.querySelector(".Sealapp-Subscription-Option_DownList"),listElChild=listEl.querySelector(".Sealapp-Subscription-Option-Child_DownList"),listElChildSelect=listEl.querySelector(".dropDownList-container"),selectTitle=listElChildSelect.querySelector(".Subscription-Option_DownList-Childs").innerText;listElChild.querySelector(".dropDown-price").innerText=selectTitle,listEl.style.backgroundColor="#f2f7fe",listElChild.style.display="block",listElChildSelect.style.display="none",document.querySelector(".selling_plan")!=null&&(document.querySelector(".selling_plan").value=listChildInput.value?listChildInput.value:"")}dropDownSelect()}}function cubeCreateHtml(plan2){let html="";return plan2.price_data&&plan2.price_data.length>0&&plan2.selling_plans.forEach(v=>{let discount_type=v.price_adjustments[0].value_type,discount_value=v.price_adjustments[0].value,discount="";switch(discount_type){case"percentage":discount_value>0?discount="("+discount_value+"% "+translationData.app_off_price+")":discount="";break;case"fixed_amount":discount_value>0?discount="("+priceformat+discount_value/100+" "+translationData.app_off_price+")":discount="";break;case"none":discount="("+translationData.app_full_price+")";break}plan2.price_data.forEach(vv=>{vv.id==v.id&&(v.description==null&&(v.description=""),html+='<div class="Sealapp-Subscription-Option_Other-Time Sealapp-Subscription-Option_Rectangle">',v.description?html+=`<div class="plan-name">
28																	<div class="Sealapp-Subscription-Option_Rectangle-top">${v.name}</div>
29																	<div data-v-f6026308="" class="help">
30																		<svg t="1673860449261" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2891" width="15" height="15">
31																			<path d="M568.944 494.933c0-17.067-5.689-28.444-17.067-34.133-11.378-11.378-22.756-17.067-39.822-17.067s-28.444 5.689-39.822 17.067c-11.378 11.378-17.067 22.756-17.067 34.133v244.622c0 17.067 5.689 28.444 17.067 34.133 11.378 11.378 22.756 17.067 39.822 17.067s28.444-5.689 39.822-17.067 17.067-22.756 17.067-34.133V494.933z m-56.888-250.311c-17.067 0-34.133 5.689-45.511 17.067-17.067 11.378-22.756 28.444-22.756 45.511s5.689 34.133 17.067 45.511 28.444 17.067 45.511 17.067 34.133-5.689 45.511-17.067 17.067-28.444 17.067-45.511-5.689-34.133-17.067-45.511c-5.689-11.378-22.756-17.067-39.822-17.067z m0 739.556c-62.578 0-125.156-11.378-182.044-34.133s-108.089-56.889-147.911-102.4c-45.511-45.511-73.956-91.022-102.4-147.911-22.756-56.889-34.133-119.467-34.133-182.044s11.378-125.156 34.133-182.044 56.889-108.089 102.4-147.911c45.511-45.511 91.022-73.956 147.911-102.4 56.889-22.756 119.467-34.133 182.044-34.133S637.212 62.58 694.1 85.335s108.089 56.889 147.911 102.4c45.511 45.511 73.956 91.022 102.4 147.911 22.756 56.889 34.133 119.467 34.133 182.044s-11.378 125.156-34.133 182.044-56.889 108.089-102.4 147.911C796.5 893.156 750.989 921.601 694.1 950.045c-56.889 22.756-119.467 34.133-182.044 34.133z" p-id="2892" fill="#bfbfbf">
32																			</path>
33																		</svg>
34																		<div class="description-content">
35																			${v.description}
36																		</div>
37																	</div>
38																</div>`:html+=`<div class="Sealapp-Subscription-Option_Rectangle-top">${v.name}</div>`,html+=`<div class="Sealapp-Subscription-Option_Rectangle_bottom">${priceformat+vv.price} ${discount}</div>
39																		<input type="radio" value="${v.id}" data-price="${vv.price}" name="sub-plan-selector-group" class="sub-plan-selector-group-item" style="display:none">
40																</div>`)})}),html}function radioCreateHtml(plan2){let html="";return plan2.price_data&&plan2.price_data.length>0&&(html=`<div class="Sealapp-Subscription-Option_Other-Time Sealapp-Subscription-Option_Unfurl">
41					<label for="PolarisRadioButton${plan2.id}" class="Sealapp-Subscription-Option_Unfurl_Label" >
42							<span class="Sealapp-Subscription-Option_label-radio">
43									<input id="PolarisRadioButton${plan2.id}" type="radio" class="Sealapp-Subscription-Option_label-radio-Input" value="${plan2.id}" name="sub-plan-selector-group">
44							</span>
45							<span>${plan2.name}</span>
46							<span class="Sealapp-Subscription-Option_price">${priceformat+plan2.price_data[0].price}</span>
47					</label>
48					<div class="Sealapp-Subscription-Option-Child_Unfurl">`,plan2.selling_plans.forEach(v=>{let discount_type=v.price_adjustments[0].value_type,discount_value=v.price_adjustments[0].value,discount="";switch(discount_type){case"percentage":discount_value>0?discount="("+discount_value+"% "+translationData.app_off_price+")":discount="";break;case"fixed_amount":discount_value>0?discount="("+priceformat+discount_value/100+" "+translationData.app_off_price+")":discount="";break;case"none":discount="("+translationData.app_full_price+")";break}plan2.price_data.forEach(vv=>{vv.id==v.id&&(v.description==null&&(v.description=""),html+=`<label for="PolarisRadioButton${v.id}" class="Sealapp-Subscription-Option_Unfurl_Label Sealapp_Unfurl_Label_Child ">
49											<div class="plan-info">
50												<span class="Sealapp-Subscription-Option_label-radio">
51														<input id="PolarisRadioButton${v.id}" type="radio" class="Sealapp-Subscription-Option_label-radio-Input" value="${v.id}" data-price="${vv.price}" name="sub-plan-selector-group-item">
52												</span>
53												<span>${v.name} ${discount}</span>
54												<span class="Sealapp-Subscription-Option_price">${priceformat+vv.price}</span>
55											</div>
56										<div class="radio-description">
57											${v.description}
58										</div>
59									</label>`)})}),html+="</div></div></div>"),html}function dropDownCreateHtml(plan2){let html="";return plan2.price_data&&plan2.price_data.length>0&&(html=`<div class="Sealapp-Subscription-Option_Other-Time Sealapp-Subscription-Option_DownList">
60					<label for="PolarisRadioButton${plan2.id}" class="Sealapp-Subscription-Option_DownList_Label" >
61							<span class="Sealapp-Subscription-Option_label-radio">
62									<input id="PolarisRadioButton${plan2.id}" type="radio" class="Sealapp-Subscription-Option_label-radio-Input" value="${plan2.id}" name="sub-plan-selector-group">
63							</span>
64							<span>${plan2.name}</span>
65							<span class="Sealapp-Subscription-Option_price">${priceformat+plan2.price_data[0].price}</span>
66					</label>
67					<div class="Sealapp-Subscription-Option-Child_DownList">
68							
69							<div class="Subscription-Option_DownList-Childs-Group " tabindex="-1">
70									<div class="Subscription-Option_DownList-Childs-One">
71											<span class="dropDown-price">Every 1 day ($10 off)</span> 
72											<svg class="Subscription-Option_DownList-Childs-icon" viewB
72ox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1847" width="12" height="12"><path d="M1024 255.996 511.971 767.909 0 255.996 1024 255.996z" p-id="1848"></path></svg>
73									</div>
74									<div class = "dropDownList-container">`,plan2.selling_plans.forEach(v=>{let discount_type=v.price_adjustments[0].value_type,discount_value=v.price_adjustments[0].value,discount="";switch(discount_type){case"percentage":discount_value>0?discount="("+discount_value+"% "+translationData.app_off_price+")":discount="";break;case"fixed_amount":discount_value>0?discount="("+priceformat+discount_value/100+" "+translationData.app_off_price+")":discount="";break;case"none":discount="("+translationData.app_full_price+")";break}plan2.price_data.forEach(vv=>{vv.id==v.id&&(v.description==null&&(v.description=""),html+=`
75													<div class="Subscription-Option_DownList-Childs">
76													<div class="plan-name">${v.name} ${discount}</div>
77													<input id="PolarisRadioButton${v.id}" type="radio" class="Sealapp-Subscription-Option_label-radio-Input" value="${v.id}" data-price="${vv.price}" name="sub-plan-selector-group-item" style="display:none">
78														<div class="dropDown-description">${v.description}</div>
79													</div>
80													`)})}),html+=`</div></div></div><div class="plan-description">plan...........................description</div>
81										</div>
82										</div>`),html}function VariantListener(){window.location.href.indexOf("variant=")!=-1&&url_variant_id!=window.location.href.split("variant=")[1]&&(url_variant_id=window.location.href.split("variant=")[1],selected_variant_id=url_variant_id,getVarData()),setTimeout(()=>{VariantListener()},50)}function cubeEvent(){const el=document.querySelectorAll(".Sealapp-Subscription-Option_Rectangle");for(let index=0;index<el.length;index++)el[index].addEventListener("click",cubeSelect)}function cubeSelect(evt){const el=document.querySelectorAll(".Sealapp-Subscription-Option_Rectangle");let frequency_plan_id=0;for(let i=0;i<el.length;i++){const element=el[i];element.style.backgroundColor="#fff",element.style.border="1px solid #babfc3"}const dom=this;dom.style.backgroundColor="#f2f7fe",dom.style.border="1px solid #90b2e4";const frequency_plan_Arr=dom.querySelector(".sub-plan-selector-group-item");frequency_plan_id=frequency_plan_Arr.value?frequency_plan_Arr.value:"",frequency_plan_price=frequency_plan_Arr.getAttribute("data-price"),document.querySelector(".selling_plan")!=null&&(document.querySelector(".selling_plan").value=frequency_plan_id),changePrice(frequency_plan_price,frequency_plan_id)}function radioSelect(){const ipt=document.querySelectorAll(".Sealapp-Subscription-Option_Unfurl");for(let i=0;i<ipt.length;i++)ipt[i].addEventListener("change",checkRadioGroupPlanShow)}function checkRadioGroupPlanShow(evt){let frequency_plan_id=0,frequency_plan_price2=selected_variant.price/100;const otherDom=document.querySelectorAll(".Sealapp-Subscription-Option_Unfurl"),otherDomChild=document.querySelectorAll(".Sealapp-Subscription-Option-Child_Unfurl"),allDesEls=document.querySelectorAll(".radio-description");for(let i=0;i<otherDom.length;i++){const element=otherDom[i];element.style.backgroundColor="#fafbfb",element.style.border="0px"}for(let k=0;k<otherDomChild.length;k++){const element=otherDomChild[k];element.style.display="none"}for(let k=0;k<allDesEls.length;k++){const element=allDesEls[k];element.style.display="none"}const dom=this,selectLable=evt.target,child=dom.querySelector(".Sealapp-Subscription-Option-Child_Unfurl"),inputChild=dom.querySelector("input[name=sub-plan-selector-group-item]");if(dom.style.backgroundColor="#f2f7fe",dom.style.border="1px solid #90b2e4",child&&(child.style.display="block"),inputChild&&selectLable.getAttribute("name")=="sub-plan-selector-group"){var fathertag=inputChild.parentNode.parentNode.parentNode;if(fathertag.className=="Sealapp-Subscription-Option_Unfurl_Label Sealapp_Unfurl_Label_Child "){const desEl2=fathertag.querySelector(".radio-description");desEl2.style.display="block"}inputChild.checked=!0}dom.querySelector("input[id=PolarisRadioButton1]")&&document.querySelector(".selling_plan")!=null?document.querySelector(".selling_plan").value="":(dom.querySelectorAll("input[name=sub-plan-selector-group-item]").forEach(v=>{if(v.checked){var vfathertag=v.parentNode.parentNode.parentNode;desEl=vfathertag.querySelector(".radio-description"),desEl.style.display="block",frequency_plan_id=v.value,frequency_plan_price2=v.getAttribute("data-price")}}),dom.querySelector(".Sealapp-Subscription-Option_price").innerText=priceformat+frequency_plan_price2,document.querySelector(".selling_plan")!=null&&(document.querySelector(".selling_plan").value=frequency_plan_id),changePrice(frequency_plan_price2,frequency_plan_id))}function dropDownSelect(){const ipt=document.querySelectorAll(".Sealapp-Subscription-Option_DownList");for(let i=0;i<ipt.length;i++)ipt[i].addEventListener("change",checkGroupPlanShow);const dowLists=document.querySelectorAll(".Subscription-Option_DownList-Childs-Group");for(let k=0;k<dowLists.length;k++){const element=dowLists[k];element.onblur=function(){const dropDownList=element.querySelector(".dropDownList-container");dropDownList.style.display="none"},element.addEventListener("click",clickChildsPlanShow)}}function checkGroupPlanShow(evt){let frequency_plan_id=0,frequency_plan_price2=selected_variant.price/100;const dom=this,otherDom=document.querySelectorAll(".Sealapp-Subscription-Option_DownList"),otherDomChild=document.querySelectorAll(".Sealapp-Subscription-Option-Child_DownList"),listChilds=document.querySelectorAll(".dropDownList-container"),allDesEls=document.querySelectorAll(".plan-description");for(let i=0;i<otherDom.length;i++){const element=otherDom[i];element.style.backgroundColor="#fafbfb"}for(let k=0;k<otherDomChild.length;k++){const element=otherDomChild[k];element.style.display="none"}for(let i=0;i<listChilds.length;i++){const element=listChilds[i];element.style.display="none"}for(let i=0;i<allDesEls.length;i++){const element=allDesEls[i];element.style.display="none"}if(dom.style.backgroundColor="#f2f7fe",dom.querySelector("input[id=PolarisRadioButton1]")&&document.querySelector(".selling_plan")!=null)document.querySelector(".selling_plan").value="";else{const child=dom.querySelector(".Sealapp-Subscription-Option-Child_DownList");if(child.style.display="block",evt.target.getAttribute("name")=="sub-plan-selector-group"){const domlistChilds=dom.querySelector(".plan-name"),planDes=dom.querySelector(".dropDown-description"),showDescription=dom.querySelector(".plan-description");showDescription.innerText=planDes.innerText,showDescription.style.display="block",child.querySelector(".dropDown-price").innerText=domlistChilds.innerText;const frequency_plan=getParentElement(domlistChilds,1).querySelector("input[name=sub-plan-selector-group-item]");frequency_plan&&(frequency_plan_id=frequency_plan.value,frequency_plan_price2=frequency_plan.getAttribute("data-price")),document.querySelector(".selling_plan")!=null&&(document.querySelector(".selling_plan").value=frequency_plan_id),changePrice(frequency_plan_price2,frequency_plan_id)}}}function clickChildsPlanShow(evt){let frequency_plan_id=0,frequency_plan_price2=selected_variant.price/100;const dom=this,child=dom.querySelector(".Subscription-Option_DownList-Childs-One"),openChilds=dom.querySelector(".dropDownList-container");if(openChilds.style.display==="none"?openChilds.style.display="block":openChilds.style.display="none",dom.className.trim()==="Subscription-Option_DownList-Childs-Group"){const planName=evt.target.querySelector(".plan-name"),parentNode=getParentElement(evt.target,1),planDes=parentNode.querySelector(".dropDown-description"),showDescription=getParentElement(dom,2).querySelector(".plan-description");if(showDescription.innerText=planDes.innerText,showDescription.style.display="block",child.querySelector(".dropDown-price").innerText=evt.target.innerText,evt.target.className.trim()==="plan-name"){const frequency_plan=parentNode.querySelector("input[name=sub-plan-selector-group-item]");frequency_plan&&(frequency_plan_id=frequency_plan.value,frequency_plan_price2=frequency_plan.getAttribute("data-price"));const parentDom=dom.parentElement.parentElement;parentDom.querySelector(".Sealapp-Subscription-Option_price").innerText=priceformat+frequency_plan_price2,changePrice(frequency_plan_price2,frequency_plan_id)}document.querySelector(".selling_plan")!=null&&(document.querySelector(".selling_plan").value=frequency_plan_id)}}function selectDescription(){if(plan==null)return;let selling_plans=[];plan.forEach(v=>{v.app_id=="auto-subscription"&&v.selling_plans.forEach(s=>{selling_plans.push(s.id)})}),selling_plans=JSON.stringify(selling_plans);var request=new XMLHttpRequest;request.open("post",baseUrl+"api/v1/plan/Description?selling_plans_Id="+selling_plans),request.send(),request.onreadystatechange=function(){request.readyState==4&&request.status==200&&(description=JSON.parse(request.responseText),description=description.data,getVarData())}}function returnFloat(value){const decimals=value.toString().split(".");return decimals.length==1?(value=value.toString()+".00",value):(decimals.length>1&&decimals[1].length<2&&(value=value.toString()+"0"),value)}function getParentElement(el,classes){return classes>0?getParentElement(el.parentNode,classes-1):el}function changePrice(planPrice,planId){const compare_price=selected_variant.selling_plan_allocations.find(plan2=>plan2.selling_plan_id==planId).compare_at_price/100;if(document.querySelector(".price-item--regular")!=null)if(selected_variant.price/100!=planPrice){const discount=priceformat+(compare_price-planPrice),price_html="<span class='sub-discount-price'>"+priceformat+planPrice+"</span><span class='sub-original-price' style='text-decoration: line-through;'>"+priceformat+compare_price+"</span><span class='sub-discount-description'>SAVE "+discount+"</span>";document.querySelector(".price-item--regular").innerHTML=price_html}else document.querySelector(".price-item--regular").innerHTML=priceformat+planPrice}function importStyles(){const cubeStyle=`<style>
83			.Sealapp-Subscription-Option{
84					margin: 0 -0.4rem 0.8rem -0.4rem;
85					font-size: 14px;
86					font-weight: 500;
87					display: flex;
88					flex-wrap: wrap;
89			}
90			.Sealapp-Subscription-Option_Rectangle{
91					width: 46%;
92					margin: 0.4rem;
93					display: flex;
94					justify-content: center;
95					align-items: center;
96					flex-wrap: wrap;
97					flex-direction: column;
98					border: 1px solid #babfc3;
99					border-radius: 4px;
100					cursor: pointer;
101					padding: 8px;
102					text-align: center;
103					word-break: break-all;
104			}
105			.Sealapp-Subscription-Option_Rectangle:hover{
106					background-color: #f2f7fe !important;
107					border: 1px solid #90b2e4 !important;
108			}
109			
110			.Sealapp-Subscription-Option_Rectangle-top,
111			.Sealapp-Subscription-Option_Rectangle_bottom{
112					margin:  0.3rem auto;
113			}
114			.Sealapp-Subscription-Option_Rectangle_bottom{
115					color: #2c6ecb;
116			}
117			.plan-name{
118				 display:flex;
119				 align-items: center;
120				 position: relative;
121			}
122			.help{
123				/* position: relative; */
124				margin-left: 0.8rem;
125				cursor: pointer;
126				max-height:20px;
127			}
128			.description-content{
129				top: 20px;
130				position: absolute;
131				background-color: #ffffff;
132				border-radius: 4px;
133				width: 250px;
134				color:#000000;
135				padding: 4px 8px;
136				display: none;
137				transform: translate(10%, 0%);
138				z-index: 99999;
139				box-shadow: 0px 0px 2px 0px #5c5f62;
140			}
141			
142			.help:hover .description-content{
143				display: block;
144			}
145			.sub-discount-price{
146				margin-right: 10px;
147				text-decoration: none;
148				color: #da4f49;
149			}
150			
151			.sub-discount-description{
152				right: 0px;
153				top: 25px;
154				position: absolute;
155				background-color: #ffffff;
156				border-radius: 4px;
157				width: ${screenWidth}px;
158				max-width: 250px;
159				color:#000000;
160				padding: 4px 8px;
161				display: none;
162				transform: translate(10%, 0%);
163				z-index: 99999;
164				box-shadow: 0px 0px 2px 0px #5c5f62;
165			}
166		</style>`,radioStyle=`<style>
167			.Sealapp-Subscription-Option{
168					margin: 0 -0.4rem;
169					font-size: 14px;
170					font-weight: 500;
171					display: flex;
172					flex-wrap: wrap;
173			}
174			.Sealapp-Subscription_Unfurl{
175					margin: 0.4rem 0;
176			}
177			.Sealapp-Subscription-Option_Unfurl{
178					width: 100%;
179					border-radius: 6px;
180					padding: 0.4rem 0.6rem;
181					margin: 0.4rem 0;
182					background-color: #fafbfb;
183			}
184			.Sealapp-Subscription-Option_Unfurl_Label{
185					width: 100%;
186					display: flex;
187			}
188			.Sealapp-Subscription-Option-Child_Unfurl{
189					margin-left: 1.6rem;
190					display: none;
191			}
192			.Sealapp_Unfurl_Label_Child{
193					margin-top: 0.4rem;
194					display:flex;
195					flex-direction: column;
196			}
197			.Sealapp-Subscription-Option_label-radio-Input{
198					margin-right: 0.6rem;
199			}
200			.Sealapp-Subscription-Option_label-radio{
201					color: aqua;
202			}
203			.Sealapp-Subscription-Option_price{
204					display: block;
205					margin-left: auto;
206			}
207			
208			.Sealapp-Subscription input{
209					accent-color: #2c6ecb;
210			}
211			.plan-info{
212					display:flex;
213			}
214			.radio-description{
215				margin-left: 24px;
216				font-size: 10px;
217				display:none;
218			}
219			.sub-discount-price{
220				margin-right: 10px;
221				text-decoration: none;
222				color: #da4f49;
223				}
224			
225			.sub-discount-description{
226				margin-left: 10px;
227				padding: 2px 6px;
228				border: 1px solid #da4f49;
229				border-radius: 3px;
230				font-size: 10px;
231				display: inline;
232				position: relative;
233				top: -3px;
234				letter-spacing: 1px;
235				color: #da4f49;
236						}
237			</style>`,dropDownStyle=`<style>
238			.Sealapp-Subscription-Option{
239					margin: 0 -0.4rem;
240					font-size: 14px;
241					font-weight: 500;
242					display: flex;
243					flex-wrap: wrap;
244			}
245			.Sealapp-Subscription_DownList{
246					margin: 0.4rem 0;
247			}
248			.Sealapp-Subscription-Option_DownList{
249					width: 100%;
250					border-radius: 6px;
251					padding: 0.4rem 0.6rem;
252					margin: 0.4rem 0;
253					background-color: #fafbfb;
254			}
255			.Sealapp-Subscription-Option_DownList_Label{
256					display: flex;
257			}
258			.Sealapp-Subscription-Option-Child_DownList{
259					margin:0.8rem 0rem 0.4rem 1.6rem;
260					display: none;
261					border-radius: 6px;
262					background-color:#fff;
263			}
264			.Subscription-Option_DownList-Childs-One{
265					position: relative;
266					z-index:100;
267					display: flex;
268					align-items: center;
269					border-radius: 6px;
270					background-color:#fff;
271					margin-top: 0.2rem;
272					box-shadow:0 0 5px rgb(23 24 24 / 5%), 0 1px 2px rgb(0 0 0 / 15%);
273			}
274			.Subscription-Option_DownList-Childs-One{
275					padding:0.4rem 0.8rem;
276					user-select:none;
277			}
278			.Subscription-Option_DownList-Childs:hover{
279					background: #f1f2f3;
280			}
281			
282			.Subscription-Option_DownList-Childs-icon{
283					display: block;
284					margin-left: auto;
285					pointer-events: none;
286			}
287			.Sealapp-Subscription-Option_label-radio-Input{
288					margin-right: 0.6rem;
289			}
290			.Sealapp-Subscription-Option_label-radio{
291					color: aqua;
292			}
293			.Sealapp-Subscription-Option_price{
294					display: block;
295					margin-left: auto;
296			}
297			
298			.Sealapp-Subscription input{
299					accent-color: #2c6ecb;
300			}
301			.Subscription-Option_DownList-Childs-Group{
302					position: relative;
303			}
304			.dropDownList-container{  
305					position: absolute;
306					background-color: #fff;
307					width: 100%;
308					/* top: 35px; */
309					box-shadow: 0px 3px 6px -3px rgba(23, 24, 24, 0.08), 0px 8px 20px -4px rgba(23, 24, 24, 0.12);
310					border-bottom-left-radius: 8px;
311					border-bottom-right-radius: 8px;
312					z-index: 99;
313					overflow: hidden;
314			}
315			.dropDown-description{
316				padding:0.4rem 0.8rem;
317				margin-left: 24px;
318				font-size: 10px;
319				display:none;
320			}
321			.plan-name{
322				padding:0.4rem 0.8rem;
323			}
324			.plan-description{
325				margin: 0.8rem 0rem 0.4rem 1.6rem;
326				display: none;
327				font-size: 12px;
328			}
329			.sub-discount-price{
330				margin-right: 10px;
331				text-decoration: none;
332				color: #da4f49;
333				}
334			
335			.sub-discount-description{
336				margin-left: 10px;
337				padding: 2px 6px;
338				border: 1px solid #da4f49;
339				border-radius: 3px;
340				font-size: 10px;
341				display: inline;
342				position: relative;
343				top: -3px;
344				letter-spacing: 1px;
345				color: #da4f49;
346						}
347			</style>`;switch(template){case 1:document.head.insertAdjacentHTML("beforeend",cubeStyle);break;case 2:document.head.insertAdjacentHTML("beforeend",radioStyle);break;case 3:document.head.insertAdjacentHTML("beforeend",dropDownStyle);break}customStyle&&document.head.insertAdjacentHTML("beforeend",`<style>${customStyle}</style>`)}})();
348//# sourceMappingURL=/cdn/shop/t/16/assets/subscription-plan-selector-js.js.map?v=34967155181433301461720372472

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.