{
  "version": 3,
  "sources": ["/cdn/shop/t/1064/assets/nt-bgr-production-scope.js?auto=format%2Ccompress"],
  "sourcesContent": ["/* Production eligibility and verified SDK identity. No allocation or network calls. */\n(function (global) {\n  'use strict';\n  const products = new Map([['/products/dtf-transfers','6969285312595'],['/products/dtf-transfers-v2','8009502818387']]);\n  const token = value => typeof value === 'string' && /^[A-Za-z0-9_.:-]{1,100}$/.test(value);\n  function themeAllowed(config, roles = ['main','unpublished','development']) {\n    const id = String(config?.themeId || ''), theme = global.Shopify?.theme, host = global.location?.hostname || '';\n    return /^[1-9]\\d{0,19}$/.test(id) && String(theme?.id) === id && roles.includes(theme?.role) &&\n      !global.Shopify?.designMode && (['ninjatransfers.com','www.ninjatransfers.com','transferss.myshopify.com'].includes(host) ||\n        /^[a-z0-9-]+\\.shopifypreview\\.com$/.test(host));\n  }\n  function productMatches(config) {\n    let builder;\n    try { builder = JSON.parse(global.document?.getElementById('bsv4-config')?.textContent || '{}'); } catch (_) { return false; }\n    // Legacy (non-builder) pages: operational diagnostics only, via the theme's\n    // nt-bgr-legacy-diagnostics.js. Never matches a page that has a builder island.\n    if(config.builderEngine === 'legacy') {\n      return config.activation === 'default' && config.templateActivation === true &&\n        !global.document?.getElementById('bsv4-config') && /^[1-9]\\d{0,19}$/.test(String(config.productId));\n    }\n    if(config.activation === 'default' && config.templateActivation === true) {\n      return typeof config.templateSuffix === 'string' && /^[a-z0-9-]+$/.test(config.templateSuffix) &&\n        config.templateSuffix === builder.templateSuffix && /^[1-9]\\d{0,19}$/.test(String(builder.productId)) &&\n        String(config.productId) === String(builder.productId) && ['common','stock'].includes(config.builderEngine);\n    }\n    return products.get(global.location.pathname) === String(builder.productId) && String(config.productId) === String(builder.productId);\n  }\n  function productAllowed(config, roles = ['main']) {\n    return ['live','editor'].includes(config?.mode) && config.enabled === true && themeAllowed(config, roles) &&\n      (config.activation === 'default' || ['ninjatransfers.com','www.ninjatransfers.com'].includes(global.location.hostname)) && productMatches(config);\n  }\n  function editorContext(config) {\n    const params = new URLSearchParams(global.location?.search || '');\n    return productAllowed(config) && config.experimentKey === 'nt_bgr_v1' &&\n      config.optimizely?.experimentId === '4640327313653760' && params.get('optimizely_embed_editor') === 'true' &&\n      !params.has('preview_theme_id') && (!params.has('optimizely_experiment_id') ||\n        params.get('optimizely_experiment_id') === '4640327313653760');\n  }\n  function editorVariation(config) {\n    if (!editorContext(config)) return null;\n    const root = global.document?.getElementById('optimizely-visual-editor-root');\n    const selected = (root?.shadowRoot || root)?.querySelector?.('[role=\"tab\"][aria-selected=\"true\"]')?.id || '';\n    return selected.endsWith('-6152193181483008') ? 'control' :\n      selected.endsWith('-4780337073487872') ? 'ninja_ai' : null;\n  }\n  function editorAllowed(config) { return !!editorVariation(config); }\n  function allowed(config) {\n    if (config?.mode !== 'live' || !productAllowed(config,\n        config.activation === 'default' ? ['main','unpublished','development'] : ['main'])) return false;\n    // Default delivery is a storefront capability, not an experiment assignment.\n    // Stale experiment/QA cookies and unavailable storage must not disable it.\n    if (config.activation === 'default') return true;\n    const params = new URLSearchParams(global.location.search || '');\n    if ([...params.keys()].some(key => /^(?:nt_bgr_|nt_ai_|optimizely_|optly_|preview_theme_id)/.test(key))) return false;\n    // A browser used for draft QA stays out of this experiment, including after returning to main.\n    try { if (global.localStorage?.getItem('nt-bgr-draft:nt_bgr_v1')) return false; } catch (_) { return false; }\n    return true;\n  }\n  function consent() {\n    try { return global.Shopify?.customerPrivacy?.analyticsProcessingAllowed?.() === true; } catch (_) { return false; }\n  }\n  function draftAllowed(config) {\n    return config?.mode === 'draft' && config.enabled === true && themeAllowed(config, ['unpublished','development']) && productMatches(config);\n  }\n  function draftUploadAllowed(config) {\n    return config?.apiEnvironment === 'production' && draftAllowed(config);\n  }\n  function identity(config, sdk = global.optimizely) {\n    if (!allowed(config)) return null;\n    const ids = config.optimizely;\n    if (ids?.experimentId !== '4640327313653760' || ids.variationIds?.control !== '6152193181483008' ||\n        ids.variationIds?.ninja_ai !== '4780337073487872') return null;\n    try {\n      const state = sdk?.get?.('state')?.getExperimentStates?.({isActive:true})?.[ids.experimentId];\n      const visitorId = sdk?.get?.('visitor')?.visitorId;\n      if (!state?.isActive || state.isInExperimentHoldback !== false || !token(visitorId)) return null;\n      const variationId = String(state.variation?.id || '');\n      const variation = Object.keys(ids.variationIds).find(key => ids.variationIds[key] === variationId);\n      return variation ? {visitorId,variation,variationId,experimentId:ids.experimentId} : null;\n    } catch (_) { return null; }\n  }\n  global.NtBgrProductionScope = {allowed,consent,identity,themeAllowed,productMatches,draftAllowed,draftUploadAllowed,editorContext,editorAllowed,editorVariation};\n})(globalThis);\n"],
  "mappings": "CACC,SAAU,OAAQ,CACjB,aACA,MAAM,SAAW,IAAI,IAAI,CAAC,CAAC,0BAA0B,eAAe,EAAE,CAAC,6BAA6B,eAAe,CAAC,CAAC,EAC/G,MAAQ,OAAS,OAAO,OAAU,UAAY,2BAA2B,KAAK,KAAK,EACzF,SAAS,aAAa,OAAQ,MAAQ,CAAC,OAAO,cAAc,aAAa,EAAG,CAC1E,MAAM,GAAK,OAAO,QAAQ,SAAW,EAAE,EAAG,MAAQ,OAAO,SAAS,MAAO,KAAO,OAAO,UAAU,UAAY,GAC7G,MAAO,kBAAkB,KAAK,EAAE,GAAK,OAAO,OAAO,EAAE,IAAM,IAAM,MAAM,SAAS,OAAO,IAAI,GACzF,CAAC,OAAO,SAAS,aAAe,CAAC,qBAAqB,yBAAyB,0BAA0B,EAAE,SAAS,IAAI,GACtH,oCAAoC,KAAK,IAAI,EACnD,CACA,SAAS,eAAe,OAAQ,CAC9B,IAAI,QACJ,GAAI,CAAE,QAAU,KAAK,MAAM,OAAO,UAAU,eAAe,aAAa,GAAG,aAAe,IAAI,CAAG,MAAY,CAAE,MAAO,EAAO,CAG7H,OAAG,OAAO,gBAAkB,SACnB,OAAO,aAAe,WAAa,OAAO,qBAAuB,IACtE,CAAC,OAAO,UAAU,eAAe,aAAa,GAAK,kBAAkB,KAAK,OAAO,OAAO,SAAS,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