/products\/Screenshot2021-12-28at15.18.18.png?v=1640704737"}},"requires_selling_plan":false,"selling_plan_allocations":[]},{"id":42211700343010,"title":"Silver","option1":"Silver","option2":null,"option3":null,"sku":"","requires_shipping":true,"taxable":true,"featured_image":{"id":36376647237858,"product_id":7486666047714,"position":4,"created_at":"2021-12-28T15:18:54+00:00","updated_at":"2021-12-28T15:18:56+00:00","alt":null,"width":908,"height":672,"src":"\/\/projektride.co.uk\/cdn\/shop\/products\/Screenshot2021-12-28at15.12.38.png?v=1640704736","variant_ids":[42211700343010]},"available":false,"name":"Muc-Off Tubeless Valves 44mm V2 - Silver","public_title":"Silver","options":["Silver"],"price":2500,"weight":0,"compare_at_price":2500,"inventory_management":"shopify","barcode":"","featured_media":{"alt":null,"id":28927427084514,"position":4,"preview_image":{"aspect_ratio":1.351,"height":672,"width":908,"src":"\/\/projektride.co.uk\/cdn\/shop\/products\/Screenshot2021-12-28at15.12.38.png?v=1640704736"}},"re
allocations":[]}],"images":["\/\/projektride.co.uk\/cdn\/shop\/products\/Screenshot2021-12-28at15.11.32.png?v=1640704737","\/\/projektride.co.uk\/cdn\/shop\/products\/Screenshot2021-12-28at15.11.48.png?v=1640704737","\/\/projektride.co.uk\/cdn\/shop\/products\/Screenshot2021-12-28at15.13.01.png?v=1640704737","\/\/projektride.co.uk\/cdn\/shop\/products\/Screenshot2021-12-28at15.12.38.png?v=1640704736","\/\/projektride.co.uk\/cdn\/shop\/products\/Screenshot2021-12-28at15.18.18.png?v=1640704737"],"featured_image":"\/\/projektride.co.uk\/cdn\/shop\/products\/Screenshot2021-12-28at15.11.32.png?v=1640704737","options":["Color"],"media":[{"alt":null,"id":28927426986210,"position":1,"preview_image":{"aspect_ratio":1.351,"height":672,"width":908,"src":"\/\/projektride.co.uk\/cdn\/shop\/products\/Screenshot2021-12-28at15.11.32.png?v=1640704737"},"aspect_ratio":1.351,"height":672,"media_type":"image","src":"\/\/projektride.co.uk\/cdn\/shop\/products\/Screenshot2021-12-28at15.11.32.png?v=1640704737","width":908},{"alt":njektride.co.uk\/cdn\/shop\/products\/Screenshot2021-12-28at15.12.38.png?v=1640704736","width":908},{"alt":null,"id":28927427117282,"position":5,"preview_image":{"aspect_ratio":1.351,"height":672,"width":908,"src":"\/\/projektride.co.uk\/cdn\/shop\/products\/Screenshot2021-12-28at15.18.18.png?v=1640704737"},"aspect_ratio":1.351,"height":672,"media_type":"image","src":"\/\/projektride.co.uk\/cdn\/shop\/products\/Screenshot2021-12-28at15.18.18.png?v=1640704737","width":908}],"requires_selling_plan":false,"selling_plan_groups":[],"content":"\u003cmeta charset=\"utf-8\"\u003e\n\u003cp data-mce-fragment=\"1\"\u003eIntroducing our V2 Tubeless valves with a new Tyre Insert air flow system. Featuring 6 slots machined into the base of the valve stem allowing them to be compatible with most tubeless tyre inserts and allow your tubeless sealant fluid and air to flow freely when running tubeless tyre inserts. We’ve also upgraded them to aircraft-grade 7075 aluminium to be lighter and stronger than before!\u003c\/p\u003e11700375778 : "deny",};
window._RestockRocketConfig.variantsInventoryQuantity = {42211700244706 : parseInt("2"),42211700277474 : parseInt("1"),42211700310242 : parseInt("0"),42211700343010 : parseInt("0"),42211700375778 : parseInt("1"),};
window._RestockRocketConfig.variantsPreorderCount = {42211700244706 : parseInt(""),42211700277474 : parseInt(""),42211700310242 : parseInt(""),42211700343010 : parseInt(""),42211700375778 : parseInt(""),};
window._RestockRocketConfig.variantsPreorderCountForMarket = {42211700244706 : null,42211700277474 : null,42211700310242 : null,42211700343010 : null,42211700375778 : null,};
window._RestockRocketConfig.variantsPreorderMaxCount = {42211700244706 : parseInt(""),42211700277474 : parseInt(""),42211700310242 : parseInt(""),42211700343010 : parseInt(""),42211700375778 : parseInt(""),};
window._RestockRocketConfig.variantsPreorderMaxCountForMarket = {42211700244706 : null,42211700277474 : null,42211700310242 : null,42211700343010 : null,42211700375778 : null, iptHost = window._RestockRocketConfig.scriptUrlProduct.substring(0, window._RestockRocketConfig.scriptUrlProduct.lastIndexOf('/') + 1)
window._RestockRocketConfig.host = 'https://app.restockrocket.io'
const SETTINGS_CACHE_DURATION = 15 * 60 * 1000; // 15 minutes in milliseconds
function checkSettingsExpiry(settings) {
try {
if (!settings || !settings.updated_at) {
console.debug('STOQ - Invalid settings data structure');
return null;
}
if (!settings.cache) {
console.debug('STOQ - settings caching disabled');
return null;
}
// Check if translations are enabled but missing from cache
// This handles the backfill period where DB has translations but metafield doesn't
if (settings.multi_language_enabled) {
if (!settings.translations) {
// Translations enabled but no translation data in metafield
// Metafield hasn't been backfilled yet - force refresh
console.debug('STOQ - multi-language ena < ng cache');
return null;
}
return settings;
} catch (error) {
console.debug('STOQ - Error checking settings cache:', error);
return null;
}
}
function createRestockRocketContainer() {
const restockRocketContainer = document.createElement('div');
restockRocketContainer.id = 'restock-rocket';
document.body.appendChild(restockRocketContainer);
}
function createRestockRocketScript(scriptUrl) {
const restockRocketScriptElement = document.createElement('script');
restockRocketScriptElement.setAttribute('defer', 'defer');
restockRocketScriptElement.src = scriptUrl;
document.body.appendChild(restockRocketScriptElement);
}
createRestockRocketContainer()
console.debug('STOQ - extension activated')
function applyTranslations(settings) {
try {
// Skip translation logic entirely if multi-language is not enabled
if (!settings || !settings.multi_language_enabled) {
return settings;
}
if (!settings.t
ngs[key] = value;
}
});
} else {
console.debug('STOQ - No translated fields found for locale:', normalizedLocale);
}
delete settings.translations;
return settings;
} catch (e) {
console.debug('STOQ - error applying translations:', e);
return settings;
}
}
// First try to get settings from metafields with expiry check
const cachedSettings = window._RestockRocketConfig.cachedSettings;
const validCachedSettings = cachedSettings ? checkSettingsExpiry(cachedSettings) : null;
if (validCachedSettings) {
console.debug('STOQ - using cached settings');
initializeScripts(validCachedSettings);
} else {
console.debug('STOQ - fetching fresh settings');
const headers = {
'X-Shopify-Shop-Domain': window._RestockRocketConfig.shop || window.Shopify.shop,
'ngrok-skip-browser-warning': 'skip'
};
if (window.Shopify?.theme?.role === 'main') {
headers['X-Shopify-Theme-Schema-Name'] = window.Shopify.theme.stializeScripts(settings) {
settings = applyTranslations(settings);
window._RestockRocketConfig.settings = settings;
console.debug(`STOQ - settings configured for ${window._RestockRocketConfig.pageType}`);
if(settings.enable_app) {
const hijackIntegration = window._RestockRocketConfig.integrations.find(function(integration) {
return integration.type === 'hijack' && integration.enabled && integration.page_types.includes(window._RestockRocketConfig.pageType);
})
if(window._RestockRocketConfig.pageType === 'collection' && (settings.show_button_on_collection || settings.preorder_collection_enabled)) {
createRestockRocketScript(window._RestockRocketConfig.scriptUrlCollection);
} else if(window._RestockRocketConfig.pageType === 'index' && (settings.show_button_on_index || settings.preorder_index_enabled)) {
createRestockRocketScript(window._RestockRocketConfig.scriptUrlCollection);
} else if(window._RestockRocketConfig.pageType === 'search' && ( d', {
detail: {
pageType: window._RestockRocketConfig.pageType,
enabled: settings.enable_app,
settings: settings
}
});
console.debug('STOQ - dispatching app loaded event');
window.dispatchEvent(appLoadedEvent);
}
}
function updateCartSellingPlans() {
// Wait for the API to be available with retries
const maxRetries = 10;
const retryDelay = 500;
function attemptCartCheck(attempt = 1) {
if (window._RestockRocket && window._RestockRocket.updateCartSellingPlans) {
window._RestockRocket.updateCartSellingPlans()
.then(hasUpdates => {
if (hasUpdates) {
console.debug('STOQ - cart selling plans updated successfully');
} else {
console.debug('STOQ - no cart selling plan updates needed');
}
})
.catch(error => {
console.error('STOQ - error updating cart selling plans:', error);
});
} else if (attemp
<
ock-rocket-button-container{position:relative;z-index:1;width:100%}.restock-rocket-button-container-float-right{position:fixed;z-index:123123;top:calc(50% - 200px);right:0;transform:rotate(270deg);transform-origin:bottom right}.restock-rocket-button-container-float-left{position:fixed;z-index:123123;top:calc(50% - 200px);left:40px;transform:rotate(90deg);transform-origin:top left}.restock-rocket-button-container-float-left:hover,.restock-rocket-button-container-float-right:hover,.restock-rocket-button-container:hover,.restock-rocket-button-float:hover,.restock-rocket-button:hover{opacity:.8}.restock-rocket-button{min-height:50px;margin-top:10px;margin-bottom:10px}.restock-rocket-button-collection{position:relative;font-size:13px;line-height:1;padding:7px;height:auto;z-index:3}.restock-rocket-wrapper{background-color:rgba(0,0,0,.5);z-index:123123123;width:100%;height:100%;overflow:auto;position:fixed;right:0;top:0;transition-property:all;transition-duration:.3s;display:flex;flex-direction:column;justify-conten