"use strict"; (() => { var __create = Object.create; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; var __esm = (fn, res) => function __init() { return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; }; var __commonJS = (cb, mod) => function __require() { return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( // If the importer is in node compatibility mode or this is not an ESM // file that has been converted to a CommonJS file using a Babel- // compatible transform (i.e. "__esModule" has not been set), then set // "default" to the CommonJS "module.exports" for node compatibility. isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod )); // ../node_modules/@esbuild-plugins/node-globals-polyfill/process.js function defaultSetTimout() { throw new Error("setTimeout has not been defined"); } function defaultClearTimeout() { throw new Error("clearTimeout has not been defined"); } function runTimeout(fun) { if (cachedSetTimeout === setTimeout) { return setTimeout(fun, 0); } if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { cachedSetTimeout = setTimeout; return setTimeout(fun, 0); } try { return cachedSetTimeout(fun, 0); } catch (e) { try { return cachedSetTimeout.call(null, fun, 0); } catch (e2) { return cachedSetTimeout.call(this, fun, 0); } } } function runClearTimeout(marker) { if (cachedClearTimeout === clearTimeout) { return clearTimeout(marker); } if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { cachedClearTimeout = clearTimeout; return clearTimeout(marker); } try { return cachedClearTimeout(marker); } catch (e) { try { return cachedClearTimeout.call(null, marker); } catch (e2) { return cachedClearTimeout.call(this, marker); } } } function cleanUpNextTick() { if (!draining || !currentQueue) { return; } draining = false; if (currentQueue.length) { queue = currentQueue.concat(queue); } else { queueIndex = -1; } if (queue.length) { drainQueue(); } } function drainQueue() { if (draining) { return; } var timeout = runTimeout(cleanUpNextTick); draining = true; var len = queue.length; while (len) { currentQueue = queue; queue = []; while (++queueIndex < len) { if (currentQueue) { currentQueue[queueIndex].run(); } } queueIndex = -1; len = queue.length; } currentQueue = null; draining = false; runClearTimeout(timeout); } function nextTick(fun) { var args = new Array(arguments.length - 1); if (arguments.length > 1) { for (var i = 1; i < arguments.length; i++) { args[i - 1] = arguments[i]; } } queue.push(new Item(fun, args)); if (queue.length === 1 && !draining) { runTimeout(drainQueue); } } function Item(fun, array) { this.fun = fun; this.array = array; } function noop() { } function binding(name) { throw new Error("process.binding is not supported"); } function cwd() { return "/"; } function chdir(dir) { throw new Error("process.chdir is not supported"); } function umask() { return 0; } function hrtime(previousTimestamp) { var clocktime = performanceNow.call(performance) * 1e-3; var seconds = Math.floor(clocktime); var nanoseconds = Math.floor(clocktime % 1 * 1e9); if (previousTimestamp) { seconds = seconds - previousTimestamp[0]; nanoseconds = nanoseconds - previousTimestamp[1]; if (nanoseconds < 0) { seconds--; nanoseconds += 1e9; } } return [seconds, nanoseconds]; } function uptime() { var currentTime = /* @__PURE__ */ new Date(); var dif = currentTime - startTime; return dif / 1e3; } var cachedSetTimeout, cachedClearTimeout, queue, draining, currentQueue, queueIndex, title, platform, browser, env, argv, version, versions, release, config, on, addListener, once, off, removeListener, removeAllListeners, emit, performance, performanceNow, startTime, process, defines; var init_process = __esm({ "../node_modules/@esbuild-plugins/node-globals-polyfill/process.js"() { cachedSetTimeout = defaultSetTimout; cachedClearTimeout = defaultClearTimeout; if (typeof globalThis.setTimeout === "function") { cachedSetTimeout = setTimeout; } if (typeof globalThis.clearTimeout === "function") { cachedClearTimeout = clearTimeout; } queue = []; draining = false; queueIndex = -1; Item.prototype.run = function() { this.fun.apply(null, this.array); }; title = "browser"; platform = "browser"; browser = true; env = {}; argv = []; version = ""; versions = {}; release = {}; config = {}; on = noop; addListener = noop; once = noop; off = noop; removeListener = noop; removeAllListeners = noop; emit = noop; performance = globalThis.performance || {}; performanceNow = performance.now || performance.mozNow || performance.msNow || performance.oNow || performance.webkitNow || function() { return (/* @__PURE__ */ new Date()).getTime(); }; startTime = /* @__PURE__ */ new Date(); process = { nextTick, title, browser, env, argv, version, versions, on, addListener, once, off, removeListener, removeAllListeners, emit, binding, cwd, chdir, umask, hrtime, platform, release, config, uptime }; defines = {}; Object.keys(defines).forEach((key) => { const segs = key.split("."); let target = process; for (let i = 0; i < segs.length; i++) { const seg = segs[i]; if (i === segs.length - 1) { target[seg] = defines[key]; } else { target = target[seg] || (target[seg] = {}); } } }); } }); // ../node_modules/@wix/santa-main-r/lib/lib/common/experiment.js var require_experiment = __commonJS({ "../node_modules/@wix/santa-main-r/lib/lib/common/experiment.js"(exports, module) { "use strict"; init_process(); var transformedExperimentsCache = /* @__PURE__ */ new WeakMap(); function getRunningExperiments(context) { var model = context && (context.rendererModel || context.editorModel) || {}; var _model$runningExperim = model.runningExperiments, runningExperiments = _model$runningExperim === void 0 ? {} : _model$runningExperim; return runningExperiments; } function transformRunningExperiments(runningExperiments) { return Object.keys(runningExperiments).reduce(function(acc, key) { acc[key.toLowerCase()] = runningExperiments[key]; return acc; }, /* @__PURE__ */ Object.create(null)); } function getValue(name, context) { var runningExperiments = getRunningExperiments(context); var value = runningExperiments[name]; if (value !== void 0) { return value; } var transformedExperiments = transformedExperimentsCache.get(runningExperiments); if (!transformedExperiments) { transformedExperiments = transformRunningExperiments(runningExperiments); transformedExperimentsCache.set(runningExperiments, transformedExperiments); } return transformedExperiments[name.toLowerCase()]; } function isMultiValueExperimentOpen(name, context) { var value = getValue(name, context); return !!(value && value !== "old" && value !== "false"); } module.exports = { getRunningExperiments, isMultiValueExperimentOpen, isOpen: isMultiValueExperimentOpen, getValue }; } }); // ../node_modules/@wix/santa-main-r/lib/lib/common/experimentFactory.js var require_experimentFactory = __commonJS({ "../node_modules/@wix/santa-main-r/lib/lib/common/experimentFactory.js"(exports, module) { "use strict"; init_process(); var exp = require_experiment(); function build(context) { return { getRunningExperiments: function getRunningExperiments(override) { return exp.getRunningExperiments(override || context); }, isOpen: function isOpen(name, override) { return exp.isOpen(name, override || context); }, getValue: function getValue(name, override) { return exp.getValue(name, override || context); }, isMultiValueExperimentOpen: function isMultiValueExperimentOpen(name, override) { return exp.isMultiValueExperimentOpen(name, override || context); } }; } module.exports = { build }; } }); // src/tb-main.ts init_process(); var import_experimentFactory = __toESM(require_experimentFactory()); // src/main-r/index.ts init_process(); // src/main-r/addExperimentsFromQuery.ts init_process(); // src/main-r/getQueryUtils.ts init_process(); function getParameterFromQuery(query, name) { name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); const regex = new RegExp(`[\\?&]${name}=([^&#]*)`); const results = regex.exec(query); return results?.[1] ? decodeURIComponent(results[1]).replace(/\+/g, " ") : ""; } function isParameterTrueInQuery(query, name) { return getParameterFromQuery(query, name) === "true"; } function getQueryUtils(window2) { return { getParameterFromQuery, isParameterTrueInQuery, getParameterByName: getParameterFromQuery.bind(null, window2.location.search), isParameterTrue: isParameterTrueInQuery.bind(null, window2.location.search) }; } // src/main-r/get-rjs-config.ts init_process(); // src/main-r/rjs-config-utils.ts init_process(); // src/main-r/joinURL.ts init_process(); var safe = (a) => typeof a === "undefined" ? "undefined" : a; function safeReplace(a, search, replaceValue) { return safe(a).replace(search, replaceValue); } function joinURL(...args) { let url = args[0]; for (let i = 1; i < args.length; ++i) { url = safeReplace(url, /\/$/, "") + "/" + safeReplace(args[i], /^\//, ""); } return url; } // src/main-r/rjs-config-utils.ts function unpkg(pkg, v, p) { return `https://static.parastorage.com/unpkg/${pkg}@${v}/${p}`; } function unpkgObj(pkg, v, min, debug) { return { min: unpkg(pkg, v, min), source: unpkg(pkg, v, debug) }; } var node = (m, p) => `node_modules/${m}/${p}`; function unpkgOrNode(versions2, local, m, p) { const actualLocal = isLocal(versions2, local, m); return actualLocal ? node(m, p) : unpkg(m, versions2[m], p); } function isLocal(versions2, local, m) { return local || versions2[m] === "link"; } function unpkgOrNodeObj(versions2, local, m, min, debug) { const actualLocal = isLocal(versions2, local, m); return actualLocal ? nodeObj(m, min, debug) : unpkgObj(m, versions2[m], min, debug); } function nodeObj(m, min, debug) { return { min: node(m, min), source: node(m, debug) }; } function mergeInto(dst, src) { Object.keys(src).forEach((k) => { dst[k] = dst[k] || src[k]; }); } function scriptLocation(serviceTopology, name, fallback) { return serviceTopology?.scriptsLocationMap[name] || fallback; } function isExperimentOpen(experimentInstance, name) { return experimentInstance && typeof experimentInstance.isOpen === "function" && experimentInstance.isOpen(name); } // src/main-r/get-rjs-config.ts var defaults = { "@wix/santa-core-utils": "1.307.0", "@wix/santa-skin-utils": "1.1.0", "image-client-api": "1.40.0", imageClientLib: "1.40.0", zepto: "1.2.0", xss: "0.2.12", "react-dom-factories": "1.0.2", lodash: "4.7.0", "pm-rpc": "1.0.7", hammerjs: "2.0.8", // jsVendor: { mobx: "3.3.3", "mobx-react": "4.2.2", tweenmax: "1.19.0", "@wix/fedops-logger": "3.0.5", "dm-ajv": "8.1.3" }; var wixUiSantaStaticOverrideExp = "allowWixUiSantaStaticOverride"; function getRjsConfig(versions2, serviceTopology, local, experiment) { const platformSdkRoot = scriptLocation(serviceTopology, "js-platform-editor-sdk"); const platformAppConfigurationUrl = scriptLocation( serviceTopology, "js-platform-apps-configuration", "https://static.parastorage.com/services/js-platform-apps-configuration/1.7.0" ); const promoteAnalyticsAdapterUrl = scriptLocation(serviceTopology, "promote-analytics-adapter"); const santaSiteAuthUrl = scriptLocation(serviceTopology, "santa-site-auth-module"); mergeInto(versions2, defaults); const _unpkg = unpkgOrNode.bind(null, versions2, local); const _unpkgObj = unpkgOrNodeObj.bind(null, versions2, local); const promoteAnalyticsAdapterPath = local ? node("@wix/promote-analytics-adapter", "dist/statics/analytics-event-adapter.bundle.min") : joinURL(promoteAnalyticsAdapterUrl, "analytics-event-adapter.bundle.min"); const santaSiteAuthPath = local ? node("@wix/santa-site-auth-module", "dist/statics/santa-site-auth-module.bundle.min") : joinURL(santaSiteAuthUrl, "santa-site-auth-module.bundle.min"); const paths = { // -------------- RUNTIME -------------------------------------------------------------- wixImmutable: _unpkg("@wix/santa-core-utils", "dist/wixImmutable"), lodash: _unpkg("lodash", "lodash.min"), vendor: _unpkgObj("@wix/santa-bundle", "dist/bundle.min", "dist/bundle"), react: _unpkgObj("react", "umd/react.production.min", "umd/react.development"), reactDOM: _unpkgObj("react-dom", "umd/react-dom.production.min", "umd/react-dom.development"), reactDOMServer: _unpkgObj( "react-dom", "umd/react-dom-server.browser.production.min", "umd/react-dom-server.browser.development" ), reactTestUtils: _unpkg("react-dom", "umd/react-dom-test-utils.development"), "prop-types": _unpkgObj("prop-types", "prop-types.min", "prop-types"), "create-react-class": _unpkgObj("create-react-class", "create-react-class.min", "create-react-class"), "react-dom-factories": _unpkg("react-dom-factories", "index"), mobx: _unpkgObj("mobx", "lib/mobx.umd.min", "lib/mobx.umd"), "mobx-react": _unpkgObj("mobx-react", "index.min", "index"), zepto: _unpkgObj("zepto", "dist/zepto.min", "dist/zepto"), immutable: _unpkgObj("immutable", "dist/immutable.min", "dist/immutable"), TweenMax: _unpkgObj("gsap", "src/minified/TweenMax.min", "src/uncompressed/TweenMax"), //bundle TweenLite: _unpkgObj("gsap", "src/minified/TweenMax.min", "src/uncompressed/TweenMax"), TimelineMax: _unpkgObj("gsap", "src/minified/TweenMax.min", "src/uncompressed/TweenMax"), ScrollToPlugin: _unpkgObj( "gsap", "src/minified/plugins/ScrollToPlugin.min", "src/uncompressed/plugins/ScrollToPlugin" ), //bundle Draggable: _unpkgObj("gsap", "src/minified/utils/Draggable.min", "src/uncompressed/utils/Draggable"), DrawSVGPlugin: _unpkgObj( "@wix/santa-external-modules", "tweenmax-plugins/1.19.0/DrawSVGPlugin.min", "tweenmax-plugins/1.19.0/DrawSVGPlugin" ), MorphSVGPlugin: _unpkgObj( "@wix/santa-external-modules", "tweenmax-plugins/1.19.0/MorphSVGPlugin.min", "tweenmax-plugins/1.19.0/MorphSVGPlugin" ), //gsap3 - upgrade GSAP - temporary path for the transition phase gsap3: _unpkgObj( "@wix/santa-external-modules", "tweenmax-plugins/3.1.1-transition-phase/gsap.min", "tweenmax-plugins/3.1.1-transition-phase/gsap" ), ScrollToPlugin3: _unpkgObj( "@wix/santa-external-modules", "tweenmax-plugins/3.1.1-transition-phase/ScrollToPlugin.min", "tweenmax-plugins/3.1.1-transition-phase/ScrollToPlugin" ), color: _unpkg("@wix/santa-external-modules", "color-convert/0.2.0/color.min"), speakingurl: _unpkg("@wix/santa-external-modules", "speakingurl/7.0.0/speakingurl.min"), "date-fns": _unpkgObj("@wix/santa-external-modules", "date-fns/1.3.0/date_fns.min", "date-fns/1.3.0/date_fns"), xss: _unpkg("xss", "dist/xss.min"), //shim immutableDiff: _unpkg("@wix/santa-external-modules", "immutableDiff/immutablejsdiff.min"), pmrpc: _unpkg("pm-rpc", "build/pm-rpc.min"), "ag-grid": _unpkgObj("ag-grid", "dist/ag-grid.min", "dist/ag-grid"), SoundManager: _unpkg("soundmanager2", "script/soundmanager2-nodebug-jsmin"), hammer: _unpkg("hammerjs", "hammer.min"), mousetrap: _unpkg("mousetrap", "mousetrap.min"), swfobject: _unpkg("@wix/santa-external-modules", "swfobject/2.3.20130521/swfobject.min"), "fedops-logger": _unpkg("@wix/fedops-logger", "dist/statics/fedops-logger-module.bundle.min"), "fast-json-stable-stringify": _unpkg("@wix/santa-external-modules", "dist/fast-json-stable-stringify"), // ------------- internal ------------------------------------------------------------------- platformEvents: _unpkgObj("@wix/platform-editor-sdk", "lib/platformEvents.min", "lib/platformEvents"), "document-services": _unpkgObj( "@wix/document-services", "dist/document-services.min", "dist/document-services" ), documentServices: _unpkg("@wix/document-services-implementation", "dist/document-services-implementation"), "document-services-implementation": _unpkgObj( "@wix/document-services-implementation", "dist/document-services-implementation.min", "dist/document-services-implementation" ), mobileCore: _unpkgObj("@wix/santa-mobile-core", "dist/mobileCore.min", "dist/mobileCore"), platformUtils: _unpkg("@wix/santa-platform-utils", "dist/platformUtils-bundle"), "santa-shared-schemas": _unpkg("@wix/santa-shared-schemas", "dist/santa-shared-schemas"), "santa-components": _unpkgObj( "@wix/santa-components", "dist/santa-components.prod", "dist/santa-components.devel" ), "santa-components-layout": _unpkgObj( "@wix/santa-components", "dist/santa-components-layout.prod", "dist/santa-components-layout.devel" ), "santa-components/popover": _unpkgObj( "@wix/santa-components", "dist/santa-component-popover.prod", "dist/santa-component-popover.devel" ), "santa-renderer": _unpkg("santa-renderer", "dist/santa-renderer"), mobileLayoutUtils: _unpkgObj("@wix/santa-mobile-core", "dist/mobileLayoutUtils.min", "dist/mobileLayoutUtils"), skinUtils: _unpkg("@wix/santa-skin-utils", "dist/skin-utils"), "mesh-migrator": _unpkg("@wix/mesh-migrator", "dist/mesh-migrator"), "santa-core-utils": _unpkg("@wix/santa-core-utils", "dist/coreUtils"), warmupUtilsLib: _unpkg("@wix/santa-core-utils", "dist/warmupUtils"), tweenEngine: _unpkg("@wix/santa-core-utils", "dist/tweenEngine"), "image-client-api": _unpkg("image-client-api", "dist/imageClientApi"), imageClientSDK: _unpkg("image-client-api", "dist/imageClientSDK"), "santa-site-auth-module": santaSiteAuthPath, wixDomSanitizer: _unpkg("@wix/wix-dom-sanitizer", "dist/wix-dom-sanitizer"), "santa-data-fixer": _unpkgObj("@wix/santa-data-fixer", "dist/santa-data-fixer.min", "dist/santa-data-fixer"), "santa-animations": _unpkg("@wix/santa-animations", "dist/santa-animations"), "media-resize-map": _unpkg("@wix/santa-animations", "dist/mediaResizeMap"), "host-platform-api": _unpkg("@wix/santa-host-platform-services", "dist/host-platform-api"), "host-worker-init": _unpkg("@wix/santa-host-platform-services", "dist/host-worker-init"), wixFullstoryLoader: _unpkg("@wix/wix-fullstory-loader", "dist/statics/app.bundle"), "data-capsule": _unpkg("data-capsule", "dist/statics/frame-listener.bundle.min"), coreMultilingual: _unpkg("@wix/santa-multilingual", "dist/languages"), "hls-light": _unpkg("hls.js", "dist/hls.light.min"), //lazy hls: _unpkg("hls.js", "dist/hls.min"), //lazy "promote-analytics-adapter": promoteAnalyticsAdapterPath, "js-platform-apps-configuration-editor": joinURL(platformAppConfigurationUrl, "platform-apps-editor.min"), wixUiRichTextArea: _unpkg("@wix/wix-ui-santa", "dist/statics/RichTextArea.bundle.min"), wixUiRichTextBox: _unpkg("@wix/wix-ui-santa", "dist/statics/RichTextBox.bundle.min"), wixUiToggleSwitch: _unpkg("@wix/wix-ui-santa", "dist/statics/ToggleSwitch.bundle.min"), wixUiTimePicker: _unpkg("@wix/wix-ui-santa", "dist/statics/TimePicker.bundle.min"), wixUiVideoPlayer: _unpkg("@wix/wix-ui-santa", "dist/statics/VideoPlayer.bundle.min"), wixUiPagination: _unpkg("@wix/wix-ui-santa", "dist/statics/Pagination.bundle.min"), "wix-json-schema-utils": _unpkg("@wix/wix-json-schema-utils", "dist/wix-json-schema-utils"), wixUiRating: _unpkg("@wix/wix-ui-santa", "dist/statics/Rating.bundle.min"), wixUiSlider: _unpkg("@wix/wix-ui-santa", "dist/statics/Slider.bundle.min"), wixUiTags: _unpkg("@wix/wix-ui-santa", "dist/statics/Tags.bundle.min"), wixUiCompsToPackages: _unpkg("@wix/wix-ui-santa", "dist/statics/compsToPackages.bundle.min"), wixUiSsrViewerCompsService: node("@wix/wix-ui-santa", "dist/src/components-service/viewer-ssr"), "wix-ui-santa": isExperimentOpen(experiment, wixUiSantaStaticOverrideExp) ? scriptLocation(serviceTopology, "wix-ui-santa") : _unpkg("@wix/wix-ui-santa", "dist/statics"), "stylable-panel": _unpkg("@wixc3/stylable-panel", "dist/stylable-panel"), "stylable-panel-drivers": _unpkg("@wixc3/stylable-panel-drivers", "dist/stylable-panel-drivers"), "stylable-santa-flatten": _unpkg("@wix/stylable-santa-flatten", "dist/main"), "wix-base-ui": _unpkg("@wix/wix-base-ui", "dist/base-ui"), "io-client": _unpkg("socket.io-client", "dist/socket.io"), "@wix/wix-code-backend-testkit": _unpkg("@wix/wix-code-backend-testkit", "dist/bundle"), // ------------- TESTING ------------------------------------------------------------------- fake: "js/plugins/fake/src/main/fake", definition: "js/plugins/definition/src/main/definition", ReactProxy: _unpkg("@wix/santa-external-modules", "react-proxy/ReactProxy"), Squire: _unpkg("@wix/santa-external-modules", "squire/Squire"), jasmine: _unpkg("@wix/santa-external-modules", "jasmine/2.1.3/jasmine"), "jasmine-html": _unpkg("@wix/santa-external-modules", "jasmine/2.1.3/jasmine-html"), "jasmine-boot": _unpkg("@wix/santa-external-modules", "jasmine/2.1.3/jasmine-boot"), // ------------- DEVELOPMENT --------------------------------------------------------------- io: "https://cdnjs.cloudflare.com/ajax/libs/socket.io/1.4.0/socket.io.min", patcher: node("@wix/santa-utils", "common/hot/patcher"), hot: node("@wix/santa-utils", "common/hot/listener"), "@wix/dm-ajv": `https://static.parastorage.com/services/dm-ajv/${versions2["dm-ajv"]}/browser/index` }; if (platformSdkRoot) { paths.platformAPI = { min: joinURL(platformSdkRoot, "lib", "platform-api.min"), source: joinURL(platformSdkRoot, "lib", "platform-api") }; paths.platformEvents = { min: joinURL(platformSdkRoot, "lib", "platformEvents.min"), source: joinURL(platformSdkRoot, "lib", "platformEvents") }; } const wixCodePlatformBaseUrl = scriptLocation(serviceTopology, "wix-code-platform"); if (wixCodePlatformBaseUrl) { const getPathToWixCodePlatformFile = (filename) => local ? node("@wix/wix-code-platform", `dist/${filename}`) : joinURL(wixCodePlatformBaseUrl, filename); paths["elementory-browser-support"] = getPathToWixCodePlatformFile("elementory-browser-support.min"); paths["wix-data-schemas-creator"] = { min: getPathToWixCodePlatformFile("wix-data-schemas-creator.min"), source: getPathToWixCodePlatformFile("wix-data-schemas-creator") }; } return { //By default load any module IDs from js/lib baseUrl: "/", //except, if the module ID starts with "app", //load it from the js/app directory. paths //config is relative to the baseUrl, and //never includes a ".js" extension since //the paths config could be for a directory. paths, bundles: { vendor: ["prop-types", "create-react-class", "mobx"] }, map: { "*": { imageClientLib: "image-client-api", "react-dom": "reactDOM", coreUtilsLib: "santa-core-utils", "@wix/santa-core-utils": "santa-core-utils", "@wix/js-platform-apps-configuration/build/platform-apps-editor": "js-platform-apps-configuration-editor", "@wix/platform-editor-sdk/lib/platformEvents.min": "platformEvents", "@wix/platform-editor-sdk/lib/platform-api.min": "platformAPI", "@wix/santa-components": "santa-components" } }, shim: { color: { exports: "Color" }, "jasmine-html": { deps: ["jasmine"] }, "jasmine-boot": { deps: ["jasmine", "jasmine-html"] }, SoundManager: { exports: "soundManager" }, ReactProxy: { deps: ["react"], exports: "ReactProxy" }, xss: { exports: "filterXSS" } }, waitSeconds: 0 }; } // src/main-r/PackagesUtil.ts init_process(); // src/main-r/reduceQueryToObject.ts init_process(); function reduceQueryToObject(str, separator = "&", equalizer = "=") { return (str || "").replace(/^\?/, "").split(separator).reduce((o, pairString) => { const pair = pairString.split(equalizer); o[pair[0]] = pair[1]; return o; }, {}); } // src/main-r/PackagesUtil.ts var PackagesUtil = class { constructor(packagesStructure, query, bundles = []) { this.packagesStructure = packagesStructure; this.query = query; this.bundles = bundles; } /** * changes the config to load packages correctly, accounting the query */ buildConfig(config2) { const queryParamsObject = reduceQueryToObject(this.query.replace(/^\?/, "")); let debug = (decodeURIComponent(queryParamsObject.debug) || "").split(",").filter(Boolean); if (debug.indexOf("all") !== -1) { const debuggableExternals = Object.keys(config2.paths).filter((path) => config2.paths[path]?.source); debug = this.packagesStructure.concat(debuggableExternals); } const isInDebug = (i) => debug.indexOf(i) !== -1; Object.keys(config2.paths).filter((k) => typeof config2.paths[k] === "object" && !Array.isArray(config2.paths[k])).forEach((k) => { config2.paths[k] = config2.paths[k][isInDebug(k) ? "source" : "min"]; }); config2.bundles = config2.bundles || {}; this.packagesStructure.filter((p) => !isInDebug(p)).filter((p) => this.bundles.indexOf(p) === -1).forEach((pkg) => { config2.bundles[pkg] = pkg; config2.paths[pkg] = `dist/packages-bin/${pkg}/${pkg}.min`; }); if (this.bundles && this.bundles.length > 0) { const bundleName = "first-load"; config2.bundles[bundleName] = this.bundles; config2.paths[bundleName] = `dist/packages-bin/${bundleName}/${bundleName}.min`; } config2.packages = config2.packages || []; const projectPackages = this.packagesStructure.filter(isInDebug).map((name) => ({ name, location: `packages/${name}/src/main`, main: name })); config2.packages = config2.packages.concat(projectPackages); return config2; } }; // ../santa-ds-libs/src/santa/index.ts init_process(); // ../santa-ds-libs/src/santa/options.json var options_default = { versions: { "@sentry/browser": "4.6.6", "@wix/bi-logger-sanitizer": "1.1.3", "@wix/fedops-logger": "3.0.125", "@wix/fed-sec-utils": "1.0.492", "@wix/js-platform-apps-configuration": "1.0.526", "@wix/platform-editor-sdk": "^1.3978.0", "@wix/promote-analytics-adapter": "1.0.484", "@wix/santa-animations": "1.496.0", "@wix/santa-browser-detection": "1.448.0", "@wix/santa-bundle": "1.1062.0", "@wix/santa-components": "1.1984.0", "@wix/santa-core-utils": "1.2722.0", "@wix/santa-ds-libs": "^1.0.0", "@wix/santa-data-fixer": "1.1640.0", "@wix/santa-external-modules": "1.644.0", "@wix/santa-galleries": "1.1191.0", "@wix/santa-host-platform-services": "1.737.0", "@wix/santa-image-utils": "1.969.0", "@wix/santa-main-r": "1.1643.0", "@wix/santa-mobile-core": "1.1270.0", "@wix/santa-multilingual": "1.1157.0", "@wix/santa-platform-utils": "1.1429.0", "@wix/santa-shared-schemas": "1.594.0", "@wix/santa-site-auth-module": "1.0.16", "@wix/santa-skin-utils": "1.1686.0", "@wix/stylable-santa-flatten": "3.0.56", "@wix/viewer-platform-worker": "1.0.3667", "@wix/wix-base-ui": "2.778.0", "@wix/wix-code-backend-testkit": "1.17.0", "@wix/wix-code-platform": "1.1097.69", "@wix/wix-dom-sanitizer": "1.786.0", "@wix/wix-fullstory-loader": "1.404.0", "@wix/wix-json-schema-utils": "1.429.0", "@wix/wix-ui-santa": "2.0.358", "@wixc3/stylable-panel-drivers": "2.3.2", "ag-grid": "6.4.2", atob: "2.1.2", "blueimp-md5": "2.18.0", color: "0.11.4", "create-react-class": "15.7.0", "data-capsule": "1.0.83", "date-fns": "1.30.1", gsap: "2.1.3", hammerjs: "2.0.8", "hls.js": "0.8.9", "image-client-api": "1.4060.0", immutable: "3.8.2", jsdom: "9.12.0", lodash: "4.17.21", mobx: "3.3.3", "mobx-react": "4.2.2", mousetrap: "1.6.5", "node-fetch": "2.6.1", "pm-rpc": "3.2.7", "prop-types": "15.7.2", "raven-js": "3.27.2", react: "16.14.0", "react-dom": "16.14.0", "react-dom-factories": "1.0.2", seedrandom: "3.0.5", "socket.io-client": "2.4.0", soundmanager2: "2.97.20150601-a", speakingurl: "7.0.0", swfobject: "2.2.1", wspy: "3.0.19", xss: "0.2.18", zepto: "1.2.0", tweenmax: "1.19.0" }, bundles: [ "displayer", "backgroundCommon", "site-widgets", "formCommon", "textCommon", "socialCommon", "thirdPartyAnalytics", "galleriesCommon", "buttonCommon", "compDesignUtils", "imageZoom", "render", "skinExports", "compUtils", "hostLibs", "dataFixer" ], manifest: {} }; // ../santa-ds-libs/src/santa/index.ts var version2 = "1.13803.0"; // src/checkConfig.ts init_process(); function checkConfig(paths) { const map = /* @__PURE__ */ new Map(); for (const v of Object.values(paths)) { map.set(v, (map.get(v) ?? 0) + 1); } const result = { ...paths }; Object.entries(paths).forEach((v, k) => { if (map.get(v) !== 1) { delete result[k]; } }); return result; } // src/utils.ts init_process(); var loadScript = (src, name, async = false) => new Promise((resolve, reject) => { const element = document.createElement("script"); element.async = async; element.src = src; element.onload = () => resolve(); element.onerror = reject; document.head.appendChild(element); }).catch((err) => { throw new Error(`Failed to load script ${name}: ${err.message}`); }); // externals.mjs init_process(); var externals = { react: "React", "react-dom": "ReactDOM", lodash: "_", zepto: "zepto", experiment: "experiment", // The value doesn't matter in this case, we just need requirejs to treat experiment-amd as "already loaded", // Otherwise, it will throw an error upon usage "experiment-amd": "experimentAmd", color: "color", "@wix/santa-components": "santa-components", "create-react-class": "create-react-class", "prop-types": "prop-types", "pm-rpc": "pmrpc", xss: "xss", SoundManager: "SoundManager", "data-capsule": "data-capsule", "@wix/santa-core-utils": "santa-core-utils", immutable: "immutable", "@wix/js-platform-apps-configuration/build/platform-apps-editor": "js-platform-apps-configuration-editor", "@wix/platform-editor-sdk/lib/platformEvents.min": "platformEvents", "@wix/platform-editor-sdk/lib/platform-api.min": "platformAPI", "@wix/santa-browser-detection": null, "@wix/santa-image-utils": null, "@wix/wix-dom-sanitizer": null, requirejs: null, runExp: null, "@wix/dm-ajv": "@wix/dm-ajv" }; function externalsForRjsMapping() { const relevantEntries = Object.entries(externals).filter(([, v]) => !!v); return Object.fromEntries(relevantEntries); } // src/tb-main.ts function genUnpkgUrl(packageName, version3, path) { return `https://static.parastorage.com/unpkg/${packageName}@${version3}/${path}`; } var loadRequireJs = async () => { if (!window.requirejs) { await loadScript( "https://static.parastorage.com/services/third-party/requirejs/2.1.15/require.min.js", "requirejs" ); } }; var santaUnpkg = (p) => genUnpkgUrl("@wix/wix-santa", version2, p); var fixSantaPaths = (paths, packages) => { packages.forEach((p) => { p.location = santaUnpkg(p.location); }); const fixedPaths = checkConfig(paths); return fixedPaths; }; var defineExperimentInstance = () => { const experiments = window.queryUtils.getParameterByName("experiments"); experiments.split(",").forEach((name) => { window.rendererModel.runningExperiments[name] = "new"; }); const experimentInst = import_experimentFactory.default.build(window); window.define("experiment", () => experimentInst); window.define("experiment-amd", () => experimentInst); return experimentInst; }; var main = async () => { await loadRequireJs(); const queryUtils = getQueryUtils(window); window.queryUtils = queryUtils; const isDebug = !!queryUtils.getParameterByName("debug"); const experimentInstance = defineExperimentInstance(); const versions2 = { ...options_default.versions }; const isBuilderCompModel = window.rendererModel?.siteMetaData?.builderComponentModel; if (experimentInstance.isOpen("dm_react18") && isBuilderCompModel) { versions2.react = "18.3.1"; versions2["react-dom"] = "18.3.1"; } const rjsConfig = getRjsConfig(versions2, window.serviceTopology, false, {}); rjsConfig.paths.mainScript = `${window.dmBase}/tb-main/dist/tb-main-internal${isDebug ? "" : ".min"}`; const packagesUtil = new PackagesUtil([], window.location.search); const { paths, packages, map, shim, bundles } = packagesUtil.buildConfig(rjsConfig); const fixedPaths = fixSantaPaths(paths, packages); map["*"]["pm-rpc"] = "pmrpc"; window.requirejs.config({ paths: fixedPaths, packages, map, shim, waitSeconds: 60, bundles }); const externals2 = externalsForRjsMapping(); const packageNames = Object.keys(externals2); window.requirejs(packageNames, (...values) => { for (let i = 0; i < packageNames.length; i++) { const packageName = packageNames[i]; const pkg = values[i]; const alias = externals2[packageName]; window[alias] = pkg; } window.requirejs(["mainScript"], () => { }); }); }; main(); })(); //# sourceMappingURL=tb-main.js.map