scrivito
Version:
Scrivito is a professional, yet easy to use SaaS Enterprise Content Management Service, built for digital agencies and medium to large businesses. It is completely maintenance-free, cost-effective, and has unprecedented performance and security.
1,239 lines (1,019 loc) • 970 kB
JavaScript
/******/ (() => { // webpackBootstrap
/******/ "use strict";
/******/ var __webpack_modules__ = ({
/***/ 3617:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ r: () => (/* binding */ absoluteUrl)
/* harmony export */ });
/* harmony import */ var urijs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4066);
/* harmony import */ var urijs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(urijs__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var scrivito_sdk_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5204);
function absoluteUrl(url) {
const uri = urijs__WEBPACK_IMPORTED_MODULE_0__(url);
if (uri.normalizeProtocol().protocol() === "data") return url;
return uri.absoluteTo((0,scrivito_sdk_common__WEBPACK_IMPORTED_MODULE_1__/* .currentHref */ .pb)()).toString();
}
/***/ }),
/***/ 1579:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ E: () => (/* binding */ provideAuthGroups),
/* harmony export */ N: () => (/* binding */ getAuthGroups)
/* harmony export */ });
/* harmony import */ var scrivito_sdk_state__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1946);
const authGroupsState = (0,scrivito_sdk_state__WEBPACK_IMPORTED_MODULE_0__/* .createStateContainer */ .Ld)();
function provideAuthGroups(authGroups) {
authGroupsState.set(authGroups);
}
function getAuthGroups() {
return authGroupsState.get();
}
/***/ }),
/***/ 4572:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ Dn: () => (/* binding */ isLatestNavigateToCallId),
/* harmony export */ fH: () => (/* binding */ getNextNavigateToCallId),
/* harmony export */ vU: () => (/* binding */ basicNavigateTo)
/* harmony export */ });
/* harmony import */ var urijs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4066);
/* harmony import */ var urijs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(urijs__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var scrivito_sdk_app_support_browser_location__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7478);
/* harmony import */ var scrivito_sdk_app_support_change_location__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2354);
/* harmony import */ var scrivito_sdk_app_support_destination_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7550);
/* harmony import */ var scrivito_sdk_app_support_routing__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7183);
/* harmony import */ var scrivito_sdk_common__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(5204);
/* harmony import */ var scrivito_sdk_loadable__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(5688);
/* harmony import */ var scrivito_sdk_models__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(4360);
/* harmony import */ var scrivito_sdk_realm__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(7461);
/* harmony import */ var scrivito_sdk_state__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(1946);
let latestCallId = 0;
function getNextNavigateToCallId() {
latestCallId++;
return latestCallId;
}
function isLatestNavigateToCallId(callId) {
return latestCallId === callId;
}
function basicNavigateTo(target, callId = getNextNavigateToCallId()) {
(0,scrivito_sdk_state__WEBPACK_IMPORTED_MODULE_9__/* .failIfFrozen */ .q2)("basicNavigateTo");
return (0,scrivito_sdk_loadable__WEBPACK_IMPORTED_MODULE_6__/* .load */ .Hh)(() => destinationForTarget(target)).then((routingTarget) => {
if (isLatestNavigateToCallId(callId)) {
switch (routingTarget.type) {
case "remote":
(0,scrivito_sdk_app_support_change_location__WEBPACK_IMPORTED_MODULE_2__/* .changeLocation */ .Uc)(routingTarget.url);
break;
case "local":
navigateToResource(routingTarget.resource);
break;
case "crossSite":
(0,scrivito_sdk_common__WEBPACK_IMPORTED_MODULE_5__/* .assignLocation */ .dT)(routingTarget.url);
break;
case "unavailable":
(0,scrivito_sdk_common__WEBPACK_IMPORTED_MODULE_5__/* .logError */ .vV)(
`Could not navigate to Obj ${routingTarget.objId}, no URL found`
);
}
}
});
}
function destinationForTarget(target) {
if (isUrlRoutingTarget(target)) return destinationForUrl(target.url);
const { objId, query, hash } = target;
const obj = scrivito_sdk_models__WEBPACK_IMPORTED_MODULE_7__/* .BasicObj */ .kI.get(objId);
if (!obj) return (0,scrivito_sdk_app_support_routing__WEBPACK_IMPORTED_MODULE_4__/* .generateDestinationForId */ .yW)({ objId, query, hash });
if ((0,scrivito_sdk_realm__WEBPACK_IMPORTED_MODULE_8__/* .isBinaryBasicObj */ .Xg)(obj)) {
const blob = obj.get("blob", ["binary"]);
if (!blob) return (0,scrivito_sdk_app_support_destination_types__WEBPACK_IMPORTED_MODULE_3__/* .generateDestinationUnavailable */ .c)({ objId });
return { type: "remote", url: blob.url() };
}
return (0,scrivito_sdk_app_support_routing__WEBPACK_IMPORTED_MODULE_4__/* .generateDestination */ .uT)({ obj, query, hash });
}
function navigateToResource(resource) {
const currentResource = scrivito_sdk_app_support_browser_location__WEBPACK_IMPORTED_MODULE_1__/* .get */ .Jt();
if (resource === currentResource) {
scrivito_sdk_app_support_browser_location__WEBPACK_IMPORTED_MODULE_1__/* .replace */ .HC(resource);
} else {
scrivito_sdk_app_support_browser_location__WEBPACK_IMPORTED_MODULE_1__/* .push */ .VC(resource);
}
}
function isUrlRoutingTarget(routingTarget) {
return !!routingTarget.url;
}
function destinationForUrl(url) {
const uri = urijs__WEBPACK_IMPORTED_MODULE_0__(url);
return (0,scrivito_sdk_app_support_routing__WEBPACK_IMPORTED_MODULE_4__/* .isLocalUri */ .S$)(uri) ? { type: "local", resource: uri.resource() } : { type: "remote", url };
}
/***/ }),
/***/ 5112:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ P: () => (/* binding */ basicUrlFor),
/* harmony export */ a: () => (/* binding */ basicUrlForObj)
/* harmony export */ });
/* harmony import */ var scrivito_sdk_app_support_routing__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7183);
/* harmony import */ var scrivito_sdk_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5204);
/* harmony import */ var scrivito_sdk_models__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4360);
/* harmony import */ var scrivito_sdk_realm__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7461);
var __defProp = Object.defineProperty;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
for (var prop in b || (b = {}))
if (__hasOwnProp.call(b, prop))
__defNormalProp(a, prop, b[prop]);
if (__getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(b)) {
if (__propIsEnum.call(b, prop))
__defNormalProp(a, prop, b[prop]);
}
return a;
};
function basicUrlFor(target, options) {
if (target instanceof scrivito_sdk_models__WEBPACK_IMPORTED_MODULE_2__/* .BasicLink */ .Re) return urlForLink(target, options);
if (target instanceof scrivito_sdk_models__WEBPACK_IMPORTED_MODULE_2__/* .Binary */ .yI) return target.url();
return basicUrlForObj(target, options);
}
function basicUrlForObj(obj, options) {
if ((0,scrivito_sdk_realm__WEBPACK_IMPORTED_MODULE_3__/* .isBinaryBasicObj */ .Xg)(obj)) {
const binaryUrl = urlForBinaryObj(obj, options.preserveObjId);
if (binaryUrl) return binaryUrl;
}
return urlForNonBinaryObj(obj, options);
}
function urlForBinaryObj(obj, withoutPlaceholder) {
const blob = obj.get("blob", ["binary"]);
if (blob) {
return withoutPlaceholder ? blob.urlWithoutPlaceholder() : blob.url();
}
}
function urlForLink(link, options) {
if (link.isExternal()) return link.url();
const obj = link.obj();
if (obj instanceof scrivito_sdk_models__WEBPACK_IMPORTED_MODULE_2__/* .BasicObj */ .kI) {
return basicUrlForObj(obj, populateMissingOptionsFromLink(options, link));
}
throw new scrivito_sdk_common__WEBPACK_IMPORTED_MODULE_1__/* .ArgumentError */ .c1("Missing link target.");
}
function urlForNonBinaryObj(obj, { query: queryString, queryParameters, withoutOriginIfLocal, hash }) {
const query = queryParameters != null ? queryParameters : queryString;
if (!withoutOriginIfLocal) {
return (0,scrivito_sdk_app_support_routing__WEBPACK_IMPORTED_MODULE_0__/* .generateUrlWithCanonicalOrigin */ .xu)({ obj, query, hash });
}
const destination = (0,scrivito_sdk_app_support_routing__WEBPACK_IMPORTED_MODULE_0__/* .generateDestination */ .uT)({ obj, query, hash });
switch (destination.type) {
case "local":
return destination.resource;
case "crossSite":
return destination.url;
default:
return destination.fallbackUrl;
}
}
function populateMissingOptionsFromLink(options, link) {
const linkOptions = __spreadValues({}, options);
if (!options.queryParameters && typeof options.query !== "string") {
linkOptions.query = link.query() || void 0;
}
if (typeof options.hash !== "string") {
linkOptions.hash = link.hash() || void 0;
}
return linkOptions;
}
/***/ }),
/***/ 7478:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
Jt: () => (/* binding */ get),
lQ: () => (/* binding */ getHistoryChangesCount),
GL: () => (/* binding */ getHistoryState),
zE: () => (/* binding */ isCurrentHistoryState),
VC: () => (/* binding */ push),
HC: () => (/* binding */ replace),
W6: () => (/* binding */ useHistory)
});
// UNUSED EXPORTS: createInitialHistory, reset
;// CONCATENATED MODULE: external "history"
const external_history_namespaceObject = require("history");
// EXTERNAL MODULE: external "urijs"
var external_urijs_ = __webpack_require__(4066);
// EXTERNAL MODULE: ./scrivito_sdk/common/index.ts + 62 modules
var common = __webpack_require__(5204);
// EXTERNAL MODULE: ./scrivito_sdk/state/index.ts + 13 modules
var state = __webpack_require__(1946);
;// CONCATENATED MODULE: ./scrivito_sdk/app_support/browser_location.ts
let browser_location_history;
let unlistenToHistory;
let lastAction;
function useHistory(historyToUse) {
if (historyToUse.createHref({ pathname: "/" }) !== "/") {
throw new common/* ArgumentError */.c1(
`Expected a history without a preconfigured basename. For further details, see: ${(0,common/* docUrl */.yJ)("js-sdk/useHistory")}`
);
}
if (historyToUse === browser_location_history) {
return;
}
const isFirstHistory = !browser_location_history;
listenToHistory(historyToUse);
browser_location_history = historyToUse;
if (!isFirstHistory) {
historyHasChanged();
}
}
function getHistoryState() {
return {
historyChangesCount: getHistoryChangesCount(),
location: get(),
isRevisit: lastAction === "POP"
};
}
function get() {
const location = getHistory().location;
return `${location.pathname}${location.search}${location.hash}`;
}
function getHistoryChangesCount() {
return historyChangesCountState.get() || 0;
}
function push(resource) {
const uri = new external_urijs_(resource);
getHistory().push({
pathname: uri.pathname(),
search: uri.search(),
hash: uri.hash()
});
}
function replace(resource) {
const uri = new external_urijs_(resource);
getHistory().replace({
pathname: uri.pathname(),
search: uri.search(),
hash: uri.hash()
});
}
function isCurrentHistoryState(historyState) {
return historyState.historyChangesCount === getHistoryChangesCount();
}
function browser_location_reset() {
browser_location_history = void 0;
lastAction = void 0;
unlistenToHistory = void 0;
historyChangesCountState.clear();
}
function createInitialHistory() {
return (0,external_history_namespaceObject.createBrowserHistory)();
}
function ensureHistory() {
if (!browser_location_history) {
useHistory(createInitialHistory());
}
}
function getHistory() {
ensureHistory();
return browser_location_history;
}
function listenToHistory(historyToListen) {
if (unlistenToHistory) {
unlistenToHistory();
}
if (isHistoryV4(historyToListen)) {
unlistenToHistory = historyToListen.listen((_location, action) => {
historyHasChanged(action);
});
} else {
unlistenToHistory = historyToListen.listen(({ action }) => {
historyHasChanged(action);
});
}
}
function historyHasChanged(action) {
lastAction = action;
historyChangesCountState.set(getHistoryChangesCount() + 1);
}
const historyChangesCountState = (0,state/* createStateContainer */.Ld)();
function isHistoryV4(historyToCheck) {
return historyToCheck.hasOwnProperty("length");
}
(0,common/* onReset */.Nj)(browser_location_reset);
/***/ }),
/***/ 5057:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ V: () => (/* binding */ canEditObjWithId),
/* harmony export */ p: () => (/* binding */ canEdit)
/* harmony export */ });
/* harmony import */ var scrivito_sdk_app_support_ui_adapter__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5460);
/* harmony import */ var scrivito_sdk_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5204);
/* harmony import */ var scrivito_sdk_loadable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5688);
/* harmony import */ var scrivito_sdk_models__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4360);
/* harmony import */ var scrivito_sdk_realm__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7461);
function canEdit(obj) {
checkCanEditArguments(obj);
return canEditObjWithId((0,scrivito_sdk_realm__WEBPACK_IMPORTED_MODULE_4__/* .unwrapAppClass */ .zo)(obj).id());
}
function canEditObjWithId(objId) {
const ui = scrivito_sdk_app_support_ui_adapter__WEBPACK_IMPORTED_MODULE_0__/* .uiAdapter */ .B;
if (!ui) return false;
return (0,scrivito_sdk_loadable__WEBPACK_IMPORTED_MODULE_2__/* .loadWithDefault */ .qt)(false, () => ui.canEdit((0,scrivito_sdk_models__WEBPACK_IMPORTED_MODULE_3__/* .currentWorkspaceId */ .o_)(), objId)) || false;
}
function checkCanEditArguments(obj) {
if (!(0,scrivito_sdk_models__WEBPACK_IMPORTED_MODULE_3__/* .isWrappingBasicObj */ .mD)(obj)) {
(0,scrivito_sdk_common__WEBPACK_IMPORTED_MODULE_1__/* .throwInvalidArgumentsError */ .Ht)(
"canEdit",
"'obj' must be an instance of 'Obj'.",
{ docPermalink: "js-sdk/canEdit" }
);
}
}
/***/ }),
/***/ 2354:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ EV: () => (/* binding */ openInNewWindow),
/* harmony export */ NA: () => (/* binding */ redirectToUrl),
/* harmony export */ Uc: () => (/* binding */ changeLocation)
/* harmony export */ });
/* harmony import */ var urijs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4066);
/* harmony import */ var urijs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(urijs__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var scrivito_sdk_app_support_ui_adapter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5460);
/* harmony import */ var scrivito_sdk_common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5204);
/* harmony import */ var _routing__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7183);
function redirectToUrl(url) {
if (scrivito_sdk_app_support_ui_adapter__WEBPACK_IMPORTED_MODULE_1__/* .uiAdapter */ .B) changeLocation(url);
else (0,scrivito_sdk_common__WEBPACK_IMPORTED_MODULE_2__/* .replaceLocation */ ._0)(url);
}
function changeLocation(url) {
if (scrivito_sdk_app_support_ui_adapter__WEBPACK_IMPORTED_MODULE_1__/* .uiAdapter */ .B) {
scrivito_sdk_app_support_ui_adapter__WEBPACK_IMPORTED_MODULE_1__/* .uiAdapter */ .B.navigateToExternalUrl(url);
} else {
(0,scrivito_sdk_common__WEBPACK_IMPORTED_MODULE_2__/* .assignLocation */ .dT)(url);
}
}
function openInNewWindow(url) {
if (scrivito_sdk_app_support_ui_adapter__WEBPACK_IMPORTED_MODULE_1__/* .uiAdapter */ .B && (0,_routing__WEBPACK_IMPORTED_MODULE_3__/* .isLocalUri */ .S$)(urijs__WEBPACK_IMPORTED_MODULE_0__(url))) {
scrivito_sdk_app_support_ui_adapter__WEBPACK_IMPORTED_MODULE_1__/* .uiAdapter */ .B.openInNewUiWindow(convertToAbsoluteLocalUrl(url));
} else {
(0,scrivito_sdk_common__WEBPACK_IMPORTED_MODULE_2__/* .openWindow */ .D1)(url, "_blank");
}
}
function convertToAbsoluteLocalUrl(url) {
const origin = (0,scrivito_sdk_common__WEBPACK_IMPORTED_MODULE_2__/* .currentOrigin */ .u4)();
if (origin === void 0) throw new scrivito_sdk_common__WEBPACK_IMPORTED_MODULE_2__/* .InternalError */ .Gd();
return new urijs__WEBPACK_IMPORTED_MODULE_0__(url).origin(origin).toString();
}
/***/ }),
/***/ 349:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ _: () => (/* binding */ getContentBrowserConfiguration),
/* harmony export */ w: () => (/* binding */ configureContentBrowser)
/* harmony export */ });
/* harmony import */ var lodash_es_mapValues__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(5796);
/* harmony import */ var scrivito_sdk_app_support_absolute_url__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3617);
/* harmony import */ var scrivito_sdk_app_support_ui_adapter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5460);
/* harmony import */ var scrivito_sdk_app_support_ui_adapter_compatible_value__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7283);
/* harmony import */ var scrivito_sdk_common__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5204);
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __objRest = (source, exclude) => {
var target = {};
for (var prop in source)
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
target[prop] = source[prop];
if (source != null && __getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(source)) {
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
target[prop] = source[prop];
}
return target;
};
let filters;
let filtersBuilder;
function getContentBrowserConfiguration(validObjClasses) {
if (filtersBuilder) {
const context = {};
if (validObjClasses) {
context._validObjClasses = validObjClasses;
}
const dynamicFilters = filtersBuilder(context);
if (dynamicFilters) {
return { filters: copyWithAbsoluteUrls(dynamicFilters) };
}
} else if (filters) {
return { filters };
}
}
function configureContentBrowser(configuration) {
if (!scrivito_sdk_app_support_ui_adapter__WEBPACK_IMPORTED_MODULE_1__/* .uiAdapter */ .B) {
return;
}
if (configuration.filters) {
if (isFilterBuilder(configuration.filters)) {
filtersBuilder = configuration.filters;
filters = void 0;
} else {
filters = copyWithAbsoluteUrls(configuration.filters);
filtersBuilder = void 0;
}
}
const baseFilter = configuration.baseFilter;
if (baseFilter) {
const baseQuery = baseFilter.query;
if (baseQuery) {
scrivito_sdk_app_support_ui_adapter__WEBPACK_IMPORTED_MODULE_1__/* .uiAdapter */ .B.configureContentBrowser(
(0,scrivito_sdk_app_support_ui_adapter_compatible_value__WEBPACK_IMPORTED_MODULE_2__/* .uiAdapterCompatibleValue */ .n)({ baseQuery })
);
}
}
}
function isFilterBuilder(maybeFilterBuilder) {
return typeof maybeFilterBuilder === "function";
}
function copyWithAbsoluteUrls(contentBrowserFilters) {
return (0,lodash_es_mapValues__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A)(contentBrowserFilters, (_a) => {
var item = __objRest(_a, []);
const { icon, options } = item;
const hasCustomIcon = icon && !icon.match(/^\w+$/);
if (icon) item.icon = hasCustomIcon ? (0,scrivito_sdk_app_support_absolute_url__WEBPACK_IMPORTED_MODULE_0__/* .absoluteUrl */ .r)(icon) : icon;
if (options) item.options = copyWithAbsoluteUrls(options);
return item;
});
}
(0,scrivito_sdk_common__WEBPACK_IMPORTED_MODULE_3__/* .onReset */ .Nj)(() => {
filters = void 0;
filtersBuilder = void 0;
});
/***/ }),
/***/ 2726:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ I: () => (/* binding */ configureObjClassForContentType),
/* harmony export */ p: () => (/* binding */ getObjClassForContentTypeMapping)
/* harmony export */ });
/* harmony import */ var scrivito_sdk_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5204);
/* harmony import */ var scrivito_sdk_state__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1946);
const state = (0,scrivito_sdk_state__WEBPACK_IMPORTED_MODULE_1__/* .createStateContainer */ .Ld)();
function getObjClassForContentTypeMapping() {
return state.get();
}
function configureObjClassForContentType(configuration) {
checkConfigureObjClassForContentType(configuration);
if (!configuration["*/*"]) {
throw new scrivito_sdk_common__WEBPACK_IMPORTED_MODULE_0__/* .ArgumentError */ .c1(
'No ObjClass has been configured for the contentType "*/*"'
);
}
if (state.get() !== void 0) {
throw new scrivito_sdk_common__WEBPACK_IMPORTED_MODULE_0__/* .ScrivitoError */ .aS(
"configureObjClassForContentType must be called only once"
);
}
state.set(configuration);
}
function checkConfigureObjClassForContentType(configuration) {
Object.keys(configuration).forEach((contentType) => {
if (!/^(\*\/\*|[^\/\*]+\/(\*|[^\*;]+))$/.test(contentType)) {
(0,scrivito_sdk_common__WEBPACK_IMPORTED_MODULE_0__/* .throwInvalidArgumentsError */ .Ht)(
"configureObjClassForContentType",
`Content type '${contentType}' is not valid.`,
{ docPermalink: "js-sdk/configureObjClassForContentType" }
);
}
});
}
/***/ }),
/***/ 1728:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ L: () => (/* binding */ setConstraintsValidationCallback),
/* harmony export */ v: () => (/* binding */ getConstraintsValidationCallback)
/* harmony export */ });
/* harmony import */ var scrivito_sdk_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5204);
let constraintsValidationCallback;
function setConstraintsValidationCallback(callback) {
constraintsValidationCallback = callback;
}
function getConstraintsValidationCallback() {
if (constraintsValidationCallback) {
return constraintsValidationCallback;
}
throw new scrivito_sdk_common__WEBPACK_IMPORTED_MODULE_0__/* .ScrivitoError */ .aS(
'Constraints validation callback is not configured. Forgot to call Scrivito.configure with the "constraintsCallback" option?'
);
}
(0,scrivito_sdk_common__WEBPACK_IMPORTED_MODULE_0__/* .onReset */ .Nj)(() => constraintsValidationCallback = void 0);
/***/ }),
/***/ 5015:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ C: () => (/* binding */ shouldContentTagsForEmptyAttributesBeSkipped),
/* harmony export */ l: () => (/* binding */ skipContentTagsForEmptyAttributes)
/* harmony export */ });
/* harmony import */ var scrivito_sdk_state__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1946);
const contentTagsForEmptyAttributes = (0,scrivito_sdk_state__WEBPACK_IMPORTED_MODULE_0__/* .createStateContainer */ .Ld)();
function skipContentTagsForEmptyAttributes() {
contentTagsForEmptyAttributes.set(false);
}
function shouldContentTagsForEmptyAttributesBeSkipped() {
return contentTagsForEmptyAttributes.get() === false;
}
/***/ }),
/***/ 1048:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ p: () => (/* binding */ currentAppSpace)
/* harmony export */ });
/* harmony import */ var scrivito_sdk_app_support_editing_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1616);
/* harmony import */ var scrivito_sdk_models__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4360);
function currentAppSpace() {
const currentObjSpace = (0,scrivito_sdk_models__WEBPACK_IMPORTED_MODULE_1__/* .objSpaceScope */ .aG)((0,scrivito_sdk_models__WEBPACK_IMPORTED_MODULE_1__/* .currentObjSpaceId */ .eb)());
return (0,scrivito_sdk_app_support_editing_context__WEBPACK_IMPORTED_MODULE_0__/* .isComparisonActive */ .gY)() ? currentObjSpace : currentObjSpace.and(scrivito_sdk_models__WEBPACK_IMPORTED_MODULE_1__/* .excludeDeletedObjs */ .cb);
}
/***/ }),
/***/ 7639:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ F2: () => (/* binding */ currentPage),
/* harmony export */ Jm: () => (/* binding */ setCustomComponentSiteId),
/* harmony export */ OI: () => (/* binding */ currentSiteId),
/* harmony export */ P$: () => (/* binding */ isCurrentPage),
/* harmony export */ R3: () => (/* binding */ currentPageParams),
/* harmony export */ wF: () => (/* binding */ withDefaultSiteContext),
/* harmony export */ wj: () => (/* binding */ withForbiddenSiteContext)
/* harmony export */ });
/* harmony import */ var urijs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4066);
/* harmony import */ var urijs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(urijs__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var scrivito_sdk_app_support_current_page_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5634);
/* harmony import */ var scrivito_sdk_common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5204);
/* harmony import */ var scrivito_sdk_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1091);
/* harmony import */ var scrivito_sdk_models__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(4360);
/* harmony import */ var scrivito_sdk_realm__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(7461);
/* harmony import */ var scrivito_sdk_state__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(1946);
function currentPage() {
var _a;
(0,scrivito_sdk_data__WEBPACK_IMPORTED_MODULE_3__/* .assertNotUsingInMemoryTenant */ .C_)("Scrivito.currentPage");
const page = (_a = (0,scrivito_sdk_app_support_current_page_data__WEBPACK_IMPORTED_MODULE_1__/* .getCurrentPageData */ .Vd)()) == null ? void 0 : _a.currentPage;
return page ? (0,scrivito_sdk_realm__WEBPACK_IMPORTED_MODULE_5__/* .wrapInAppClass */ .Dy)(page) : null;
}
function isCurrentPage(page) {
var _a;
(0,scrivito_sdk_data__WEBPACK_IMPORTED_MODULE_3__/* .assertNotUsingInMemoryTenant */ .C_)("Scrivito.isCurrentPage");
checkIsCurrentPage(page);
return ((_a = currentPage()) == null ? void 0 : _a.id()) === page.id();
}
function currentPageParams() {
var _a;
(0,scrivito_sdk_data__WEBPACK_IMPORTED_MODULE_3__/* .assertNotUsingInMemoryTenant */ .C_)("Scrivito.currentPageParams");
return urijs__WEBPACK_IMPORTED_MODULE_0__.parseQuery(((_a = (0,scrivito_sdk_app_support_current_page_data__WEBPACK_IMPORTED_MODULE_1__/* .getCurrentRoute */ .$V)()) == null ? void 0 : _a.query) || "");
}
const currentSiteContext = new scrivito_sdk_common__WEBPACK_IMPORTED_MODULE_2__/* .ContextContainer */ .hl();
const forbiddenSiteContext = new scrivito_sdk_common__WEBPACK_IMPORTED_MODULE_2__/* .ContextContainer */ .hl();
function currentSiteId() {
var _a, _b, _c, _d;
const errorMessage = forbiddenSiteContext.current();
if (errorMessage) throw new scrivito_sdk_common__WEBPACK_IMPORTED_MODULE_2__/* .ScrivitoError */ .aS(errorMessage);
const customComponentSiteId = customComponentSiteIdState.get();
if (customComponentSiteId !== void 0) return customComponentSiteId;
return (_d = (_c = currentSiteContext.current()) != null ? _c : (_b = (_a = (0,scrivito_sdk_app_support_current_page_data__WEBPACK_IMPORTED_MODULE_1__/* .getCurrentRoute */ .$V)()) == null ? void 0 : _a.siteData) == null ? void 0 : _b.siteId) != null ? _d : null;
}
function withDefaultSiteContext(fn) {
return currentSiteContext.runWith("default", fn);
}
function withForbiddenSiteContext(message, fn) {
return forbiddenSiteContext.runWith(message, fn);
}
const customComponentSiteIdState = (0,scrivito_sdk_state__WEBPACK_IMPORTED_MODULE_6__/* .createStateContainer */ .Ld)();
function setCustomComponentSiteId(siteId) {
customComponentSiteIdState.set(siteId);
}
function checkIsCurrentPage(obj) {
if (!(0,scrivito_sdk_models__WEBPACK_IMPORTED_MODULE_4__/* .isWrappingBasicObj */ .mD)(obj)) {
(0,scrivito_sdk_common__WEBPACK_IMPORTED_MODULE_2__/* .throwInvalidArgumentsError */ .Ht)(
"isCurrentPage",
"'obj' must be an instance of 'Obj'.",
{
docPermalink: "js-sdk/isCurrentPage"
}
);
}
}
/***/ }),
/***/ 5634:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ $V: () => (/* binding */ getCurrentRoute),
/* harmony export */ OU: () => (/* binding */ withCurrentPageContext),
/* harmony export */ Vd: () => (/* binding */ getCurrentPageData),
/* harmony export */ uR: () => (/* binding */ getNotFoundErrorPageState)
/* harmony export */ });
/* unused harmony export setNavigationStateProvider */
/* harmony import */ var scrivito_sdk_app_support_current_app_space__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1048);
/* harmony import */ var scrivito_sdk_app_support_routing__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7183);
/* harmony import */ var scrivito_sdk_common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5204);
/* harmony import */ var scrivito_sdk_loadable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5688);
/* harmony import */ var scrivito_sdk_models__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(4360);
var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
for (var prop in b || (b = {}))
if (__hasOwnProp.call(b, prop))
__defNormalProp(a, prop, b[prop]);
if (__getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(b)) {
if (__propIsEnum.call(b, prop))
__defNormalProp(a, prop, b[prop]);
}
return a;
};
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
let getCurrentNavigationState = () => void 0;
function setNavigationStateProvider(provider) {
getCurrentNavigationState = provider;
}
const navigationContext = new scrivito_sdk_common__WEBPACK_IMPORTED_MODULE_2__/* .ContextContainer */ .hl();
function getCurrentPageData() {
return (0,scrivito_sdk_loadable__WEBPACK_IMPORTED_MODULE_3__/* .loadableWithDefault */ .s4)(void 0, () => {
var _a;
const navigationState = (_a = navigationContext.current()) != null ? _a : getCurrentNavigationState();
if (!navigationState) return void 0;
const route = navigationState.locationRoute;
if (route.objId) {
const currentPage = (0,scrivito_sdk_models__WEBPACK_IMPORTED_MODULE_4__/* .getObjFrom */ .ED)((0,scrivito_sdk_app_support_current_app_space__WEBPACK_IMPORTED_MODULE_0__/* .currentAppSpace */ .p)(), route.objId);
if (!currentPage) {
return {
navigationState: __spreadProps(__spreadValues({}, navigationState), {
locationRoute: __spreadProps(__spreadValues({}, route), { objId: void 0 })
})
};
}
return { navigationState, currentPage };
}
return { navigationState };
});
}
function getCurrentRoute() {
var _a;
const navigationState = (_a = navigationContext.current()) != null ? _a : (0,scrivito_sdk_loadable__WEBPACK_IMPORTED_MODULE_3__/* .loadableWithDefault */ .s4)(void 0, getCurrentNavigationState);
return navigationState == null ? void 0 : navigationState.locationRoute;
}
function withCurrentPageContext(context, fn) {
return navigationContext.runWith(
{
locationRoute: {
objId: context.page.id(),
sitePath: context.sitePath,
siteData: {
siteId: context.siteId,
baseUrl: context.baseUrl
}
},
historyState: {
historyChangesCount: 0,
location: `${context.baseUrl}${context.sitePath}`,
isRevisit: false
}
},
fn
);
}
function getNotFoundErrorPageState() {
var _a;
if (navigationContext.current()) return;
const navigationState = (_a = getCurrentPageData()) == null ? void 0 : _a.navigationState;
if (!navigationState) return;
if (!(0,scrivito_sdk_app_support_routing__WEBPACK_IMPORTED_MODULE_1__/* .isObjNotFoundRoute */ .UO)(navigationState.locationRoute)) return;
return navigationState;
}
/***/ }),
/***/ 7550:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ R: () => (/* binding */ recognizeDestinationUnavailable),
/* harmony export */ c: () => (/* binding */ generateDestinationUnavailable)
/* harmony export */ });
/* harmony import */ var urijs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4066);
/* harmony import */ var urijs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(urijs__WEBPACK_IMPORTED_MODULE_0__);
function generateDestinationUnavailable(params) {
return {
type: "unavailable",
fallbackUrl: getDestinationUnavailableFallbackUrl(params),
objId: params.objId
};
}
function recognizeDestinationUnavailable(fallbackUri) {
if (fallbackUri.path() !== "") return null;
const fallbackHash = fallbackUri.hash();
if (fallbackHash.indexOf("#SCRIVITO_UNAVAILABLE_") === 0) {
const encodedParams = fallbackHash.substr("#SCRIVITO_UNAVAILABLE_".length);
const paramsUri = new urijs__WEBPACK_IMPORTED_MODULE_0__(encodedParams);
const objId = paramsUri.path();
const params = { objId };
if (paramsUri.query()) params.query = paramsUri.query();
if (paramsUri.hash()) params.hash = paramsUri.hash();
return params;
}
return null;
}
function getDestinationUnavailableFallbackUrl(params) {
const paramsUri = new urijs__WEBPACK_IMPORTED_MODULE_0__("").path(params.objId);
if (params.query) paramsUri.query(params.query);
if (params.hash) paramsUri.hash(params.hash);
const encodedParams = paramsUri.toString();
const fallbackUri = new urijs__WEBPACK_IMPORTED_MODULE_0__("").hash(`SCRIVITO_UNAVAILABLE_${encodedParams}`);
return fallbackUri.toString();
}
/***/ }),
/***/ 2295:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ O: () => (/* binding */ setEditingConfigFor),
/* harmony export */ u: () => (/* binding */ getEditingConfigFor)
/* harmony export */ });
/* harmony import */ var scrivito_sdk_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5204);
/* harmony import */ var scrivito_sdk_state__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1946);
class EditingConfigStore {
constructor() {
this.store = {};
this.updateCounter = (0,scrivito_sdk_state__WEBPACK_IMPORTED_MODULE_1__/* .createStateContainer */ .Ld)();
}
set(key, value) {
this.store[key] = value;
this.incrementUpdateCounter();
}
get(key) {
this.updateCounter.get();
return this.store[key];
}
clear() {
this.store = {};
this.incrementUpdateCounter();
}
incrementUpdateCounter() {
this.updateCounter.set((this.updateCounter.get() || 0) + 1);
}
}
const editingConfigStore = new EditingConfigStore();
function setEditingConfigFor(className, editingConfig) {
editingConfigStore.set(className, editingConfig);
}
function getEditingConfigFor(className) {
return editingConfigStore.get(className);
}
(0,scrivito_sdk_common__WEBPACK_IMPORTED_MODULE_0__/* .onReset */ .Nj)(() => editingConfigStore.clear());
/***/ }),
/***/ 1616:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ HD: () => (/* binding */ isInPlaceEditingActive),
/* harmony export */ gY: () => (/* binding */ isComparisonActive)
/* harmony export */ });
/* unused harmony exports initializeEditingContextFromBrowsingContext, setIsInPlaceEditingActive, setIsComparisonActive */
/* harmony import */ var scrivito_sdk_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5204);
/* harmony import */ var scrivito_sdk_models__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4360);
let inPlaceEditingActive = false;
let comparisonActive = false;
function initializeEditingContextFromBrowsingContext(browsingContextName) {
const editingContext = editingContextFromBrowsingContext(browsingContextName);
if (!editingContext.workspaceId) {
setCurrentWorkspaceId("published");
return false;
}
setCurrentWorkspaceId(editingContext.workspaceId);
inPlaceEditingActive = !!editingContext.inPlaceEditingActive;
comparisonActive = !inPlaceEditingActive && !!editingContext.comparisonActive;
return true;
}
function editingContextFromBrowsingContext(browsingContextName) {
const markerIndex = browsingContextName.indexOf(" _scrivito {");
if (markerIndex === -1) return {};
const { editing, comparison, workspaceId } = JSON.parse(
browsingContextName.substring(markerIndex + 11)
);
return {
workspaceId,
inPlaceEditingActive: !!editing,
comparisonActive: !!comparison
};
}
function isInPlaceEditingActive() {
return inPlaceEditingActive;
}
function isComparisonActive() {
return comparisonActive;
}
function setIsInPlaceEditingActive(isActive) {
inPlaceEditingActive = isActive;
}
function setIsComparisonActive(isActive) {
comparisonActive = isActive;
}
(0,scrivito_sdk_common__WEBPACK_IMPORTED_MODULE_0__/* .onReset */ .Nj)(() => {
inPlaceEditingActive = false;
comparisonActive = false;
});
/***/ }),
/***/ 2026:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ q: () => (/* binding */ getExtensionsUrl),
/* harmony export */ s: () => (/* binding */ setExtensionsUrl)
/* harmony export */ });
/* harmony import */ var scrivito_sdk_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5204);
/* harmony import */ var scrivito_sdk_state__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1946);
const extensionsUrl = (0,scrivito_sdk_state__WEBPACK_IMPORTED_MODULE_1__/* .createStateContainer */ .Ld)();
function setExtensionsUrl(url) {
extensionsUrl.set(url);
}
function getExtensionsUrl() {
const url = extensionsUrl.get();
if (url) return new URL(url, (0,scrivito_sdk_common__WEBPACK_IMPORTED_MODULE_0__/* .currentOrigin */ .u4)()).toString();
}
/***/ }),
/***/ 5584:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ T: () => (/* binding */ setForcedEditorLanguage),
/* harmony export */ V: () => (/* binding */ getForcedEditorLanguage)
/* harmony export */ });
/* harmony import */ var scrivito_sdk_state__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1946);
const forcedEditorLanguage = (0,scrivito_sdk_state__WEBPACK_IMPORTED_MODULE_0__/* .createStateContainer */ .Ld)();
function setForcedEditorLanguage(language) {
forcedEditorLanguage.set(language);
}
function getForcedEditorLanguage() {
return forcedEditorLanguage.get();
}
/***/ }),
/***/ 7717:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ u: () => (/* binding */ getClassName)
/* harmony export */ });
/* harmony import */ var scrivito_sdk_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5204);
/* harmony import */ var scrivito_sdk_data_integration__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9800);
/* harmony import */ var scrivito_sdk_realm__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7461);
function getClassName(subject) {
var _a;
if (typeof subject === "string") return subject;
if (subject instanceof scrivito_sdk_data_integration__WEBPACK_IMPORTED_MODULE_1__/* .DataClass */ .bA) {
return subject.name();
}
if (subject instanceof scrivito_sdk_data_integration__WEBPACK_IMPORTED_MODULE_1__/* .DataItem */ .sO) {
return subject.dataClassName();
}
const className = (_a = scrivito_sdk_realm__WEBPACK_IMPORTED_MODULE_2__/* .Schema */ .Sj.forClass(subject)) == null ? void 0 : _a.name();
if (typeof className !== "string") {
throw new scrivito_sdk_common__WEBPACK_IMPORTED_MODULE_0__/* .ArgumentError */ .c1("Invalid class name, class or instance");
}
return className;
}
/***/ }),
/***/ 8848:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ d: () => (/* binding */ getComparisonRange)
/* harmony export */ });
/* harmony import */ var scrivito_sdk_app_support_ui_adapter__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5460);
/* harmony import */ var scrivito_sdk_client__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(853);
/* harmony import */ var scrivito_sdk_models__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4360);
function getComparisonRange() {
var _a;
return ((_a = scrivito_sdk_app_support_ui_adapter__WEBPACK_IMPORTED_MODULE_0__/* .uiAdapter */ .B) == null ? void 0 : _a.comparisonRange()) || [scrivito_sdk_client__WEBPACK_IMPORTED_MODULE_1__/* .PUBLISHED_SPACE */ .M1, (0,scrivito_sdk_models__WEBPACK_IMPORTED_MODULE_2__/* .currentObjSpaceId */ .eb)()];
}
/***/ }),
/***/ 4404:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ s: () => (/* binding */ getCurrentPageId)
/* harmony export */ });
/* harmony import */ var scrivito_sdk_app_support_navigation_state__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9286);
/* harmony import */ var scrivito_sdk_loadable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5688);
function getCurrentPageId() {
return (0,scrivito_sdk_loadable__WEBPACK_IMPORTED_MODULE_1__/* .loadableWithDefault */ .s4)(
void 0,
() => {
var _a, _b;
return (_b = (_a = (0,scrivito_sdk_app_support_navigation_state__WEBPACK_IMPORTED_MODULE_0__/* .getCurrentNavigationState */ .$0)()) == null ? void 0 : _a.locationRoute) == null ? void 0 : _b.objId;
}
);
}
/***/ }),
/***/ 2117:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ Z: () => (/* binding */ getDetailsPageAndQuery),
/* harmony export */ p: () => (/* binding */ getDetailsPageUrl)
/* harmony export */ });
/* harmony import */ var scrivito_sdk_app_support_basic_url_for__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5112);
/* harmony import */ var scrivito_sdk_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5204);
/* harmony import */ var scrivito_sdk_models__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4360);
function getDetailsPageUrl(dataItem, siteId) {
const detailsPageAndQuery = getDetailsPageAndQuery(dataItem, siteId);
if (!detailsPageAndQuery) return null;
const { detailsPage, query } = detailsPageAndQuery;
return (0,scrivito_sdk_app_support_basic_url_for__WEBPACK_IMPORTED_MODULE_0__/* .basicUrlForObj */ .a)(detailsPage, { query });
}
function getDetailsPageAndQuery(dataItem, siteId) {
const dataClassName = dataItem.dataClassName();
const detailsPage = (0,scrivito_sdk_models__WEBPACK_IMPORTED_MODULE_2__/* .getDetailsPageForDataParam */ .mM)(dataClassName, siteId);
if (!detailsPage) return null;
const query = `${(0,scrivito_sdk_common__WEBPACK_IMPORTED_MODULE_1__/* .parameterizeDataClass */ .gi)(dataClassName)}=${dataItem.id()}`;
return { detailsPage, query };
}
/***/ }),
/***/ 2109:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ d: () => (/* binding */ getEditorAuthToken)
/* harmony export */ });
/* harmony import */ var scrivito_sdk_app_support_treat_localhost_like__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5302);
/* harmony import */ var scrivito_sdk_app_support_ui_adapter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5460);
/* harmony import */ var scrivito_sdk_common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5204);
function getEditorAuthToken({
audience,
authViaAccount,
authViaInstance
}) {
var _a;
const data = (_a = scrivito_sdk_app_support_ui_adapter__WEBPACK_IMPORTED_MODULE_1__/* .uiAdapter */ .B) == null ? void 0 : _a.getEditorAuthToken({
audience,
authViaAccount,
authViaInstance,
treatLocalhostLike: (0,scrivito_sdk_app_support_treat_localhost_like__WEBPACK_IMPORTED_MODULE_0__/* .getTreatLocalhostLike */ .d)()
});
if (!data) return;
if ("error" in data) throw new scrivito_sdk_common__WEBPACK_IMPORTED_MODULE_2__/* .ScrivitoError */ .aS(data.error);
return data.token;
}
/***/ }),
/***/ 9708:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ A: () => (/* binding */ setHasComponentHandler),
/* harmony export */ I: () => (/* binding */ hasComponent)
/* harmony export */ });
/* harmony import */ var scrivito_sdk_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5204);
let hasComponentHandler;
function hasComponent(name) {
if (!hasComponentHandler) {
throw new scrivito_sdk_common__WEBPACK_IMPORTED_MODULE_0__/* .InternalError */ .Gd();
}
return hasComponentHandler(name);
}
function setHasComponentHandler(func) {
hasComponentHandler = func;
}
/***/ }),
/***/ 8261:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ L: () => (/* binding */ getInitialContentDumpUrl),
/* harmony export */ d: () => (/* binding */ setInitialContentDumpUrl)
/* harmony export */ });
/* harmony import */ var scrivito_sdk_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5204);
/* harmony import */ var scrivito_sdk_state__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1946);
const initialContentDumpUrl = (0,scrivito_sdk_state__WEBPACK_IMPORTED_MODULE_1__/* .createStateContainer */ .Ld)();
function setInitialContentDumpUrl(url) {
try {
new URL(url);
} catch (e) {
throw new scrivito_sdk_common__WEBPACK_IMPORTED_MODULE_0__/* .ArgumentError */ .c1(
"'initialContentDumpUrl' must be an absolute URL with protocol"
);
}
initialContentDumpUrl.set(url);
}
function getInitialContentDumpUrl() {
return initialContentDumpUrl.get();
}
/***/ }),
/***/ 838:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ OG: () => (/* binding */ initializeContentForObj),
/* harmony export */ T6: () => (/* binding */ initializeContentForWidget),
/* harmony export */ hF: () => (/* binding */ initialContentFor)
/* harmony export */ });
/* harmony import */ var lodash_es_isEmpty__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1865);
/* harmony import */ var scrivito_sdk_app_support_editing_config_store__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2295);
/* harmony import */ var scrivito_sdk_app_support_present_ui_adapter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7272);
/* harmony import */ var scrivito_sdk_loadable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5688);
/* harmony import */ var scrivito_sdk_models__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4360);
/* harmony import */ var scrivito_sdk_realm__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7461);
function initialContentFor(className, attributeName) {
var _a;
const initialContent = (_a = (0,scrivito_sdk_app_support_editing_config_store__WEBPACK_IMPORTED_MODULE_0__/* .getEditingConfigFor */ .u)(className)) == null ? void 0 : _a.initialContent;
if (initialContent) {
const attributeContent = initialContent[attributeName];
if (typeof attributeContent === "function") {
return attribu