{"version":3,"file":"chunk.965.c3472093cc3fb528dacc.js","names":["Object","value","exports","html","_options","options","assign","createDocument","Parser","DOMParser","window","Error","docHtml","parseFromString","cleanHtml","allowBr","replace","removeCodeWrappers","trim","doc","body","textContent","querySelectorAll","forEach","element","tagName","querySelector","replaceWith","createElement","length","space","createTextNode","remove","firstChildInnerContent","firstElementChild","innerHTML","e","t","r","clean_basic_html_js_1","require","enumerable","get","cleanBasicHtml","kg_converters_js_1","lexicalToMobiledoc","mobiledocToLexical","lexical_to_mobiledoc_js_1","mobiledoc_to_lexical_js_1","serializedLexical","JSON","stringify","BLANK_DOC","lexical","parse","root","mobiledoc","version","MOBILEDOC_VERSION","ghostVersion","GHOST_VERSION","atoms","cards","markups","sections","children","child","type","addTextSection","HEADING_TYPES","includes","tag","listChild","listItems","listRoot","flatListItems","traverse","item","grandchild","splice","indexOf","push","listItemChild","markers","buildMarkers","section","KNOWN_CARDS","cardType","cardName","CARD_NAME_MAP","payload","key","keys","CARD_PROPERTY_MAP","map","entries","card","L_FORMAT_MAP","Map","TEXT_TYPES","codeblock","horizontalrule","embed","embedType","getOrSetMarkupIndex","markup","index","findIndex","m","childWithFormats","openMarkups","childIndex","format","openedFormats","closedFormatCount","readFormat","nextFormats","firstMissingFormatIndex","slice","markupIndexes","text","linkMarkup","url","linkMarkupIndex","linkChild","linkChildIndex","openedMarkupIndexes","closedMarkupCount","atomIndex","atom","formats","serializedMobiledoc","direction","indent","sectionTypeIdentifier","lexicalChild","lexicalNode","createEmptyLexicalNode","populateLexicalNodeWithMarkers","listNode","listType","start","listItem","i","listItemNode","cardIndex","oldName","newName","CARD_FIXES_MAP","TAG_TO_LEXICAL_NODE","p","h1","h2","h3","h4","h5","h6","blockquote","aside","a","rel","target","title","ATOM_TO_LEXICAL_NODE","MARKUP_TO_FORMAT","strong","b","em","s","u","code","sub","sup","hr","callout","backgroundColor","match","linkNode","href","openLinkMarkup","textTypeIdentifier","openMarkupsIndexes","numberOfClosedMarkups","atomName","embedChildNode","markupIndex","attrs","undefined","convertMarkupTagsToLexicalFormatBitmask","j","pop","detail","mode","style","attributes","nodeParams","parentNode","childNode","tags","module","camelCase","has","IncorrectUsageError","MaxLimit","MaxPeriodicLimit","FlagLimit","AllowlistLimit","config","constructor","this","limits","loadLimits","subscription","helpLink","db","errors","message","name","limitConfig","maxPeriodicLimitConfig","isLimited","limitName","isDisabled","limit","checkIsOverLimit","errorIfIsOverLimit","error","HostLimitError","checkWouldGoOverLimit","errorIfWouldGoOverLimit","checkIfAnyOverLimit","members","currentCountQuery","async","knex","count","as","first","newsletters","where","emails","startDate","sum","staff","select","leftJoin","whereNot","andWhereNot","union","customIntegrations","customThemes","uploads","formatter","limitStripeConnect","limitAnalytics","limitSocialWeb","publicSiteAccess","DateTime","lastPeriodStart","interval","startDateISO","fromISO","zone","now","setZone","fullPeriodsPast","Math","floor","diff","months","plus","toISO","SUPPORTED_INTERVALS","lowerCase","template","interpolate","Limit","generateError","errorObj","errorDetails","help","super","max","currentCountQueryFn","fallbackMessage","Intl","NumberFormat","total","transacting","addedCount","currentCount","maxPeriodic","lastPeriodStartDate","userFacingLimitName","disabled","allowlist","metadata","webpackContext","req","id","webpackContextResolve","__webpack_require__","o","resolve","_eai_r","_eai_d","define","defineProperty","Symbol","toStringTag","dataType","configDataType","useBrowseConfig","createQuery","path","sendingDomains","raw","Array","isArray","filter","d","trimmed","startsWith","parsed","hostSettings","managedEmail","sendingDomain","DEFAULT_UPGRADE_ROUTE","hasSendingDomain","isManagedEmail","enabled","upgradeRoute","configured","billing","upgradeUrl","require_hooks_use_handle_error","require_utils_api_fetch_api","_tanstack_react_query","react","usersDataType","currentUserUrl","apiUrl","include","currentUserQueryKey","useCurrentUser","requestOptions","fetchApi","useFetchApi","handleError","result","useQuery","queryKey","queryFn","data","users","useEffect","require_utils_api_hooks","require_utils_api_update_queries","useBrowseInvites","createInfiniteQuery","permissions","defaultSearchParams","defaultNextPageParams","lastPage","otherParams","page","meta","pagination","next","toString","returnData","originalData","pages","invites","flatMap","isEnd","useAddInvite","createMutation","method","email","roleId","role_id","expires","status","token","updateQueries","emberUpdateType","update","insertToQueryCache","useDeleteInvite","deleteFromQueryCache","require_api_current_user","require_api_users","membersPath","memberCountSearchParams","getMemberCountQueryKey","useBrowseMembers","useBrowseMemberCount","noOpMembersCountRefetch","Promise","useBrowseMembersCountQuery","pluralizedCount","noun","toLocaleString","useAddMember","member","invalidateQueries","useImportMembers","retry","file","labels","mapping","formData","FormData","append","label","val","useMember","createQueryWithId","useDisableMemberCommenting","reason","hideComments","hide_comments","useEnableMemberCommenting","useBrowseMembersInfiniteQuery","order","buildBulkMemberSearchParams","search","all","params","useBulkEditMembers","action","bulk","newsletter","searchParams","useBulkDeleteMembers","useEditMember","rest","useDeleteMember","cancel","useMemberSigninUrl","member_signin_urls","member_id","useMemberLogout","useEditMemberSubscription","memberId","subscriptionId","cancelAtPeriodEnd","cancel_at_period_end","useRemoveMemberEmailSuppression","MEMBER_ACTIVITY_LIMIT","buildMemberEventsFilter","useMemberActivityFeedQuery","Number","cursor","events","createdAt","created_at","Date","toISOString","paginationLimit","effectiveLimit","isImportMembersCompleteResponse","response","stats","imported","membersCountString","hasMultipleNewsletters","nounSingular","nounPlural","suffix","filterParts","recipientFilter","split","isFree","isPaid","isAll","useBrowseMembersInfinite","queryClient","useQueryClient","listTotal","listIsUnfiltered","isError","isPlaceholderData","memberCountQueryKey","memberCountQueryState","getQueryState","memberCountData","cachedPagination","sidebarCountMatchesList","listIsAtLeastAsFresh","dataUpdatedAt","setQueryData","updatedAt","useMemberActivityFeed","useMemberCount","currentUser","Boolean","canManageMembers","useMembersCount","currentUserQuery","canFetch","staleTime","defaultErrorHandler","isLoading","isFetching","refetch","refreshedUser","isSuccess","useMembersFetching","useIsFetching","zod","NewsletterSchema","z","object","string","uuid","description","nullable","feedback_enabled","boolean","slug","sender_name","sender_email","sender_reply_to","visibility","subscribe_on_signup","sort_order","number","header_image","show_header_icon","show_header_title","title_font_category","title_font_weight","title_alignment","show_excerpt","show_feature_image","body_font_category","footer_content","show_badge","show_header_name","show_post_title_section","show_comment_cta","show_share_button","show_subscription_details","show_latest_posts","background_color","header_background_color","button_color","link_color","post_title_color","section_title_color","divider_color","button_corners","button_style","image_corners","link_style","divider_style","nullish","updated_at","posts","optional","active_members","NewslettersMetaSchema","capabilities","dislikes","literal","prev","NewslettersResponseSchema","array","newslettersDataType","useBrowseNewsletters","parseResponse","nextPage","useAddNewsletter","opt_in_existing","_","useEditNewsletter","updateQueryCache","useVerifyNewsletterEmail","useBrowseOffers","useBrowseOffersById","useEditOffer","offer","offers","useAddOffer","useInvalidateOffers","ALL_POST_INCLUDES","join","POST_FORMATS","READ_ONLY_POST_FIELDS","POST_ONLY_FIELDS","buildPageWriteParams","source","saveRevision","save_revision","convertToLexical","convert_to_lexical","buildPostEditorReadParams","buildPostReadParams","buildPostWriteParams","emailSegment","email_segment","serializePostPayload","resource","json","field","show_title_and_feature_image","visibility_filter","tiers","require_api_post_contract","postsDataType","useBrowsePosts","useBrowsePostsInfinite","usePostQuery","useEditorPostQuery","useAddPost","post","sessionExpiryRedirect","useEditPost","useDeletePost","useBulkEditPosts","useBulkDeletePosts","useCopyPost","useImportContentCSV","header","useEditorPost","queryOptions","usePost","useBrowseRoles","useBrowseSettings","group","useEditSettings","settings","newData","filters","predicate","query","useRegenerateAccessCode","useDeleteStripeSettings","useTestSlack","getSettingValue","find","useSettings","checkStripeEnabled","hasSetting","some","setting","hasDirectKeys","hasConnectKeys","stripeDirect","getSettingValues","humanizeSettingKey","char","toUpperCase","RegExp","isSettingReadOnly","is_read_only","useEmailTrackClicks","useEmailTrackOpens","useMembersTrackSources","useNewslettersEnabled","usePaidMembersEnabled","useWebAnalyticsEnabled","useBrowseUsers","useGetUserBySlug","useEditUser","user","useDeleteUser","useUpdatePassword","newPassword","confirmNewPassword","userId","oldPassword","password","user_id","ne2Password","useMakeOwner","owner","isOwnerUser","roles","role","isAdminUser","isEditorUser","isSuperEditorUser","isAuthorUser","isContributorUser","canAccessSettings","canManageAutomations","canManageGiftLinks","canManageTags","hasAdminAccess","isAuthorOrContributor","require_hooks_use_confirm_unload","require_hooks_use_form","require_hooks_use_filterable_api","require_hooks_use_koenig_file_upload","require_hooks_use_koenig_fetch_embed","require_hooks_use_koenig_link_suggestions","require_hooks_use_feature_flag","require_hooks_use_host_limits","require_hooks_use_limiter","require_hooks_use_pintura_config","koenigFileUploadTypes","useConfirmUnload","useFeatureFlag","useFilterableApi","useForm","useHandleError","useHostLimits","useKoenigFetchEmbed","useKoenigFileUpload","useKoenigLinkSuggestions","useLimiter","usePinturaConfig","require_rolldown_runtime","__toESM","shouldConfirmUnload","handleBeforeUnload","event","preventDefault","returnValue","addEventListener","removeEventListener","require_api_config","require_providers_feature_flag_overrides_context","flag","refetchOnMount","enabledFlags","useFeatureFlagOverrides","labs","_tryghost_nql_string","filterData","filterKey","input","toLowerCase","responseKey","useRef","loadData","current","allLoaded","lastInput","escapeNqlString","loadInitialValues","values","missingValues","additionalData","initialState","savingDelay","savedDelay","onSave","onSaveError","onSavedStateReset","onSaveCompleted","onValidate","formState","setFormState","useState","saveState","setSaveState","setErrors","setTimeout","state","isValid","errs","validate","useCallback","newErrors","handleSave","force","fakeWhenUnchanged","timeBefore","duration","updateForm","updater","okVariant","okLabel","okProps","variant","reset","clearError","require_providers_framework_provider","require_utils_errors","_sentry_react","sonner","showErrorToast","toast","dismiss","sentryDSN","useFramework","withToast","console","SessionExpiredError","withScope","scope","APIError","setTag","captureException","getErrorMessage","require_utils_helpers","DEFAULT_REQUEST_OPTIONS","oembedUrl","URL","getGhostPaths","apiRoot","location","origin","set","image","mimeTypes","extensions","endpoint","requestMethod","resourceName","video","audio","mediaThumbnail","getStringAtPath","maybeObj","progress","setProgress","setLoading","filesNumber","setFilesNumber","progressTracker","updateProgress","size","totalProgress","round","defaultValidator","extension","exec","uploadFile","fileFormData","uploadResponse","onUploadProgress","uploadProgress","responseUrl","fileName","context","upload","files","validationResult","uploadPromises","uploadResult","clear","require_api_offers","require_api_posts","siteUrl","membersSignupAccess","donationsEnabled","recommendationsEnabled","includeShareLink","shareLinkLabel","offersData","latestPostsData","fields","searchPosts","searchPages","defaultLinks","useMemo","items","publishedAt","published_at","fetchAutocompleteLinks","redemption_type","searchLinks","term","require_api_invites","require_api_members","require_api_newsletters","require_api_roles","limitServiceImport","then","bind","configData","LimitService","setLimitService","default","usersLoading","invitesLoading","rolesLoading","isStaffLoading","fetchMembers","fetchNewsletters","noOpLimiter","limiter","staffUsers","staffInvites","invite","usePermission","requiredRoles","currentUserOptions","currentUserRoles","require_api_settings","parseOptionalString","TypeError","resolveUrl","adminRoot","settingsData","pinturaConfig","pintura","isEnabled","fallbackJsUrl","fallbackCssUrl","configJsUrl","configCssUrl","js","css","jsUrl","cssUrl","FeatureFlagOverridesContext","createContext","useContext","require_utils_query_client","react_jsx_runtime","FrameworkContext","externalNavigate","unsplashConfig","Authorization","onUpdate","onInvalidate","onDelete","FrameworkProvider","queryClientOverride","props","jsx","ErrorBoundary","QueryClientProvider","client","Provider","defaultUnsplashConfig","__create","create","__defProp","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__getProtoOf","getPrototypeOf","__hasOwnProp","prototype","hasOwnProperty","mod","isNodeMode","to","from","except","desc","n","call","__copyProps","k","__esModule","require_utils_api_handle_response","xhrHeadersToFetchHeaders","xhr","Headers","headerLines","getAllResponseHeaders","headerLine","separatorIndex","headerName","headerValue","GHOST_API_REQUEST","SESSION_API_REQUEST","UNAUTHENTICATED_ADMIN_ROUTE","sessionExpiryHandled","isSessionExpiry","test","redirectOnSessionExpiry","pathname","hash","fetchWithXhr","headers","credentials","signal","reject","onabort","DOMException","aborted","XMLHttpRequest","open","withCredentials","responseType","setRequestHeader","onprogress","lengthComputable","loaded","onload","Response","statusText","onerror","onSignalAbort","abort","onloadend","send","URLSearchParams","timeout","controller","AbortController","requestInit","attempts","retryingMs","startTime","retryPeriods","retryableErrors","ServerUnreachableError","MaintenanceError","getErrorData","errorName","totalSeconds","server","fetchFn","fetch","timeoutHandle","errorClass","captureMessage","extra","TimeoutError","UnauthorizedError","cause","newError","clearTimeout","UnsupportedMediaTypeError","RequestEntityTooLargeError","ok","blob","arrayBuffer","contentType","VersionMismatchError","ValidationError","ThemeValidationError","EmailError","JSONError","require_hooks_use_permissions","hasPermission","getNextPageParams","nextPageParams","useInfiniteQuery","pageParam","initialPageParam","getNextPageParam","mutateOptions","useMutation","mutationFn","staticOptions","generatedBody","requestBody","onSuccess","dataTypes","setQueriesData","idsFromPayload","currentData","deletedIds","recordsToInsert","getRecords","concat","updatedRecords","updated","reduce","record","errorOptions","responseOrLimit","errorsWithMessage","AlreadyExistsError","fallback","apiError","subdir","substr","assetRoot","downloadFile","iframe","document","getElementById","display","setAttribute","getFilenameFromContentDisposition","extendedMatch","singleQuote","extValue","firstQuote","secondQuote","encoded","decodeURIComponent","quotedMatch","unquotedMatch","blobDownload","fallbackFilename","filename","blobUrl","createObjectURL","download","appendChild","click","revokeObjectURL","blobDownloadFromEndpoint","downloadFromEndpoint","adminXQueryClient","QueryClient","defaultOptions","queries","refetchOnWindowFocus","gcTime","networkMode","__TANSTACK_QUERY_CLIENT__","FREE_SEGMENT","PAID_SEGMENT","EVERYONE_RECIPIENT_FILTER","BASE_SEGMENTS","buildRecipientFilter","segments","paidAvailable","selected","Set","base","specific","delete","getFullRecipientFilter","newsletterRecipientFilter","getNewsletterRecipientFilter","getRecipientType","normalizeRecipientFilter","parseRecipientFilter","free","paid"],"sources":["webpack://__ember_auto_import__/koenig/kg-clean-basic-html/build/cjs/clean-basic-html.js","webpack://__ember_auto_import__/koenig/kg-clean-basic-html/build/cjs/index.js","webpack://__ember_auto_import__/koenig/kg-converters/build/cjs/index.js","webpack://__ember_auto_import__/koenig/kg-converters/build/cjs/kg-converters.js","webpack://__ember_auto_import__/koenig/kg-converters/build/cjs/lexical-to-mobiledoc.js","webpack://__ember_auto_import__/koenig/kg-converters/build/cjs/mobiledoc-to-lexical.js","webpack://__ember_auto_import__/packages/limit-service/index.js","webpack://__ember_auto_import__/packages/limit-service/lib/LimitService.js","webpack://__ember_auto_import__/packages/limit-service/lib/config.js","webpack://__ember_auto_import__/packages/limit-service/lib/date-utils.js","webpack://__ember_auto_import__/packages/limit-service/lib/limit.js","webpack://__ember_auto_import__/home/runner/work/core/core/apps/node_modules/.pnpm/moment@2.30.1/node_modules/moment/locale|sync|/^\\.\\/.*$/","webpack://__ember_auto_import__/javascript/tmp/broccoli--5037-ezRLbHwjqIjN/cache-685-webpack_bundler_ember_auto_import_webpack/l.cjs","webpack://__ember_auto_import__/admin-x-framework/dist/api/config.cjs","webpack://__ember_auto_import__/admin-x-framework/dist/api/current-user.cjs","webpack://__ember_auto_import__/admin-x-framework/dist/api/invites.cjs","webpack://__ember_auto_import__/admin-x-framework/dist/api/members.cjs","webpack://__ember_auto_import__/admin-x-framework/dist/api/newsletters.cjs","webpack://__ember_auto_import__/admin-x-framework/dist/api/offers.cjs","webpack://__ember_auto_import__/admin-x-framework/dist/api/post-contract.cjs","webpack://__ember_auto_import__/admin-x-framework/dist/api/posts.cjs","webpack://__ember_auto_import__/admin-x-framework/dist/api/roles.cjs","webpack://__ember_auto_import__/admin-x-framework/dist/api/settings.cjs","webpack://__ember_auto_import__/admin-x-framework/dist/api/users.cjs","webpack://__ember_auto_import__/admin-x-framework/dist/hooks.cjs","webpack://__ember_auto_import__/admin-x-framework/dist/hooks/use-confirm-unload.cjs","webpack://__ember_auto_import__/admin-x-framework/dist/hooks/use-feature-flag.cjs","webpack://__ember_auto_import__/admin-x-framework/dist/hooks/use-filterable-api.cjs","webpack://__ember_auto_import__/admin-x-framework/dist/hooks/use-form.cjs","webpack://__ember_auto_import__/admin-x-framework/dist/hooks/use-handle-error.cjs","webpack://__ember_auto_import__/admin-x-framework/dist/hooks/use-host-limits.cjs","webpack://__ember_auto_import__/admin-x-framework/dist/hooks/use-koenig-fetch-embed.cjs","webpack://__ember_auto_import__/admin-x-framework/dist/hooks/use-koenig-file-upload.cjs","webpack://__ember_auto_import__/admin-x-framework/dist/hooks/use-koenig-link-suggestions.cjs","webpack://__ember_auto_import__/admin-x-framework/dist/hooks/use-limiter.cjs","webpack://__ember_auto_import__/admin-x-framework/dist/hooks/use-permissions.cjs","webpack://__ember_auto_import__/admin-x-framework/dist/hooks/use-pintura-config.cjs","webpack://__ember_auto_import__/admin-x-framework/dist/providers/feature-flag-overrides-context.cjs","webpack://__ember_auto_import__/admin-x-framework/dist/providers/framework-provider.cjs","webpack://__ember_auto_import__/admin-x-framework/dist/rolldown-runtime-D6vf50IK.cjs","webpack://__ember_auto_import__/admin-x-framework/dist/utils/api/fetch-api.cjs","webpack://__ember_auto_import__/admin-x-framework/dist/utils/api/handle-response.cjs","webpack://__ember_auto_import__/admin-x-framework/dist/utils/api/hooks.cjs","webpack://__ember_auto_import__/admin-x-framework/dist/utils/api/update-queries.cjs","webpack://__ember_auto_import__/admin-x-framework/dist/utils/errors.cjs","webpack://__ember_auto_import__/admin-x-framework/dist/utils/helpers.cjs","webpack://__ember_auto_import__/admin-x-framework/dist/utils/query-client.cjs","webpack://__ember_auto_import__/admin-x-framework/dist/utils/recipient-filter.cjs","webpack://__ember_auto_import__/src/index.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.cleanBasicHtml = cleanBasicHtml;\nfunction removeCodeWrappers(html) {\n    return html.replace(/<code\\b[^>]*>((.*?){.*?}(.*?))<\\/code>/gi, '$1');\n}\nfunction cleanBasicHtml(html = '', _options = {}) {\n    const defaults = {};\n    const options = Object.assign({}, defaults, _options);\n    if (!options.createDocument) {\n        const Parser = (typeof DOMParser !== 'undefined' && DOMParser) ||\n            (typeof window !== 'undefined' && window.DOMParser);\n        if (!Parser) {\n            throw new Error('cleanBasicHtml() must be passed a `createDocument` function as an option when used in a non-browser environment');\n        }\n        options.createDocument = function (docHtml) {\n            const parser = new Parser();\n            return parser.parseFromString(docHtml, 'text/html');\n        };\n    }\n    let cleanHtml = html;\n    if (!options.allowBr || cleanHtml === '<br>') {\n        cleanHtml = cleanHtml.replace(/<br\\s?\\/?>/g, ' ');\n    }\n    if (options.removeCodeWrappers) {\n        cleanHtml = removeCodeWrappers(cleanHtml);\n    }\n    cleanHtml = cleanHtml\n        .replace(/(\\s|&nbsp;){2,}/g, ' ')\n        .trim()\n        .replace(/^&nbsp;|&nbsp$/g, '')\n        .trim();\n    // remove any elements that have a blank textContent\n    if (cleanHtml) {\n        const doc = options.createDocument(cleanHtml);\n        // don't analyze the document if it's empty (can result in storing <br> tags if allowed)\n        if (doc.body.textContent === '') {\n            return '';\n        }\n        doc.body.querySelectorAll('*').forEach((element) => {\n            // Treat Zero Width Non-Joiner characters as spaces\n            if (!element.textContent?.trim().replace(/\\u200c+/g, '')) {\n                if (options.allowBr && element.tagName === 'BR') {\n                    // keep it\n                    return;\n                }\n                if (options.allowBr && element.querySelector('br')) {\n                    return element.replaceWith(doc.createElement('br'));\n                }\n                if (element.textContent && element.textContent.length > 0) {\n                    // keep a single space to avoid collapsing spaces\n                    const space = doc.createTextNode(' ');\n                    return element.replaceWith(space);\n                }\n                return element.remove();\n            }\n        });\n        if (options.firstChildInnerContent && doc.body.firstElementChild) {\n            cleanHtml = doc.body.firstElementChild.innerHTML.trim();\n        }\n        else {\n            cleanHtml = doc.body.innerHTML.trim();\n        }\n    }\n    return cleanHtml;\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.cleanBasicHtml = void 0;\nvar clean_basic_html_js_1 = require(\"./clean-basic-html.js\");\nObject.defineProperty(exports, \"cleanBasicHtml\", { enumerable: true, get: function () { return clean_basic_html_js_1.cleanBasicHtml; } });\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.mobiledocToLexical = exports.lexicalToMobiledoc = void 0;\nvar kg_converters_js_1 = require(\"./kg-converters.js\");\nObject.defineProperty(exports, \"lexicalToMobiledoc\", { enumerable: true, get: function () { return kg_converters_js_1.lexicalToMobiledoc; } });\nObject.defineProperty(exports, \"mobiledocToLexical\", { enumerable: true, get: function () { return kg_converters_js_1.mobiledocToLexical; } });\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.mobiledocToLexical = exports.lexicalToMobiledoc = void 0;\nconst lexical_to_mobiledoc_js_1 = require(\"./lexical-to-mobiledoc.js\");\nObject.defineProperty(exports, \"lexicalToMobiledoc\", { enumerable: true, get: function () { return lexical_to_mobiledoc_js_1.lexicalToMobiledoc; } });\nconst mobiledoc_to_lexical_js_1 = require(\"./mobiledoc-to-lexical.js\");\nObject.defineProperty(exports, \"mobiledocToLexical\", { enumerable: true, get: function () { return mobiledoc_to_lexical_js_1.mobiledocToLexical; } });\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.lexicalToMobiledoc = lexicalToMobiledoc;\nconst MOBILEDOC_VERSION = '0.3.1';\nconst GHOST_VERSION = '4.0';\nconst BLANK_DOC = {\n    version: MOBILEDOC_VERSION,\n    ghostVersion: GHOST_VERSION,\n    markups: [],\n    atoms: [],\n    cards: [],\n    sections: [[1, 'p', [[0, [], 0, '']]]],\n};\nconst MD_TEXT_SECTION = 1;\nconst MD_LIST_SECTION = 3;\nconst MD_CARD_SECTION = 10;\nconst MD_TEXT_MARKER = 0;\nconst MD_ATOM_MARKER = 1;\nconst L_IS_BOLD = 1;\nconst L_IS_ITALIC = 1 << 1;\nconst L_IS_STRIKETHROUGH = 1 << 2;\nconst L_IS_UNDERLINE = 1 << 3;\nconst L_IS_CODE = 1 << 4;\nconst L_IS_SUBSCRIPT = 1 << 5;\nconst L_IS_SUPERSCRIPT = 1 << 6;\nconst L_FORMAT_MAP = new Map([\n    [L_IS_BOLD, 'strong'],\n    [L_IS_ITALIC, 'em'],\n    [L_IS_STRIKETHROUGH, 's'],\n    [L_IS_UNDERLINE, 'u'],\n    [L_IS_CODE, 'code'],\n    [L_IS_SUBSCRIPT, 'sub'],\n    [L_IS_SUPERSCRIPT, 'sup'],\n]);\nconst HEADING_TYPES = ['heading', 'extended-heading'];\nconst TEXT_TYPES = ['text', 'extended-text'];\n// TODO: Feels a little too explicit as it will need updating every time we add a new card.\n//\n// One alternative is to use a list of all built-in Lexical types and assume that anything\n// not listed is a card but that feels more dangerous.\n//\n// Another alternative is to grab the list of cards from kg-default-nodes but that's creating\n// more inter-dependencies that makes development setup tricky.\nconst KNOWN_CARDS = [\n    'audio',\n    'bookmark',\n    'button',\n    'callout',\n    'codeblock',\n    'email-cta',\n    'email',\n    'embed',\n    'file',\n    'gallery',\n    'header',\n    'horizontalrule',\n    'html',\n    'image',\n    'markdown',\n    'paywall',\n    'product',\n    'signup',\n    'toggle',\n    'video',\n];\nconst CARD_NAME_MAP = {\n    codeblock: 'code',\n    horizontalrule: 'hr',\n};\nconst CARD_PROPERTY_MAP = {\n    embed: {\n        embedType: 'type',\n    },\n};\nfunction lexicalToMobiledoc(serializedLexical) {\n    if (serializedLexical === null || serializedLexical === undefined || serializedLexical === '') {\n        return JSON.stringify(BLANK_DOC);\n    }\n    const lexical = JSON.parse(serializedLexical);\n    if (!lexical.root) {\n        return JSON.stringify(BLANK_DOC);\n    }\n    const mobiledoc = buildEmptyDoc();\n    lexical.root.children?.forEach((child) => addRootChild(child, mobiledoc));\n    return JSON.stringify(mobiledoc);\n}\n/* internal functions ------------------------------------------------------- */\nfunction buildEmptyDoc() {\n    return {\n        version: MOBILEDOC_VERSION,\n        ghostVersion: GHOST_VERSION,\n        atoms: [],\n        cards: [],\n        markups: [],\n        sections: [],\n    };\n}\nfunction getOrSetMarkupIndex(markup, mobiledoc) {\n    let index = mobiledoc.markups.findIndex((m) => m[0] === markup);\n    if (index === -1) {\n        mobiledoc.markups.push([markup]);\n        index = mobiledoc.markups.length - 1;\n    }\n    return index;\n}\nfunction getOrSetAtomIndex(atom, mobiledoc) {\n    let index = mobiledoc.atoms.findIndex((m) => m === atom);\n    if (index === -1) {\n        mobiledoc.atoms.push(atom);\n        index = mobiledoc.atoms.length - 1;\n    }\n    return index;\n}\nfunction addRootChild(child, mobiledoc) {\n    if (child.type === 'paragraph') {\n        addTextSection(child, mobiledoc);\n    }\n    if (HEADING_TYPES.includes(child.type)) {\n        addTextSection(child, mobiledoc, child.tag);\n    }\n    if (child.type === 'quote') {\n        addTextSection(child, mobiledoc, 'blockquote');\n    }\n    if (child.type === 'aside') {\n        addTextSection(child, mobiledoc, 'aside');\n    }\n    if (child.type === 'list') {\n        addListSection(child, mobiledoc, child.tag);\n    }\n    if (KNOWN_CARDS.includes(child.type)) {\n        addCardSection(child, mobiledoc);\n    }\n}\nfunction addTextSection(childWithFormats, mobiledoc, tagName = 'p') {\n    const markers = buildMarkers(childWithFormats, mobiledoc);\n    const section = [MD_TEXT_SECTION, tagName, markers];\n    mobiledoc.sections.push(section);\n}\nfunction addListSection(listChild, mobiledoc, tagName = 'ul') {\n    const listItems = buildListItems(listChild, mobiledoc);\n    const section = [MD_LIST_SECTION, tagName, listItems];\n    mobiledoc.sections.push(section);\n}\nfunction buildListItems(listRoot, mobiledoc) {\n    const listItems = [];\n    flattenListChildren(listRoot);\n    listRoot.children?.forEach((listItemChild) => {\n        if (listItemChild.type === 'listitem') {\n            const markers = buildMarkers(listItemChild, mobiledoc);\n            listItems.push(markers);\n        }\n    });\n    return listItems;\n}\nfunction flattenListChildren(listRoot) {\n    const flatListItems = [];\n    function traverse(item) {\n        item.children?.forEach((child) => {\n            child.children?.forEach((grandchild) => {\n                if (grandchild.type === 'list') {\n                    traverse(grandchild);\n                    child.children.splice(child.children.indexOf(grandchild), 1);\n                }\n            });\n            if (child.type === 'listitem' && child.children?.length) {\n                flatListItems.push(child);\n            }\n        });\n    }\n    traverse(listRoot);\n    listRoot.children = flatListItems;\n}\nfunction buildMarkers(childWithFormats, mobiledoc) {\n    const markers = [];\n    if (!childWithFormats.children?.length) {\n        markers.push([MD_TEXT_MARKER, [], 0, '']);\n    }\n    else {\n        // mobiledoc tracks opened/closed formats across markers whereas lexical\n        // lists all formats for each marker so we need to manually track open formats\n        let openMarkups = [];\n        // markup: a specific format, or tag name+attributes\n        // marker: a piece of text with 0 or more markups\n        childWithFormats.children.forEach((child, childIndex) => {\n            if (TEXT_TYPES.includes(child.type)) {\n                if (child.format !== 0) {\n                    // text child has formats, track which are new and which have closed\n                    const openedFormats = [];\n                    const childFormats = readFormat(child.format);\n                    let closedFormatCount = 0;\n                    childFormats.forEach((format) => {\n                        if (!openMarkups.includes(format)) {\n                            openMarkups.push(format);\n                            openedFormats.push(format);\n                        }\n                    });\n                    // mobiledoc will immediately close any formats if the next section doesn't use them or it's not a text section\n                    if (!childWithFormats.children[childIndex + 1] ||\n                        !TEXT_TYPES.includes(childWithFormats.children[childIndex + 1].type)) {\n                        // no more children, close all formats\n                        closedFormatCount = openMarkups.length;\n                        openMarkups = [];\n                    }\n                    else {\n                        const nextChild = childWithFormats.children[childIndex + 1];\n                        const nextFormats = readFormat(nextChild.format);\n                        const firstMissingFormatIndex = openMarkups.findIndex((format) => !nextFormats.includes(format));\n                        if (firstMissingFormatIndex !== -1) {\n                            const formatsToClose = openMarkups.slice(firstMissingFormatIndex);\n                            closedFormatCount = formatsToClose.length;\n                            openMarkups = openMarkups.slice(0, firstMissingFormatIndex);\n                        }\n                    }\n                    const markupIndexes = openedFormats.map((format) => getOrSetMarkupIndex(format, mobiledoc));\n                    markers.push([MD_TEXT_MARKER, markupIndexes, closedFormatCount, child.text]);\n                }\n                else {\n                    // text child has no formats so we close all formats in mobiledoc\n                    const closedFormatCount = openMarkups.length;\n                    openMarkups = [];\n                    markers.push([MD_TEXT_MARKER, [], closedFormatCount, child.text]);\n                }\n            }\n            if (child.type === 'link') {\n                const linkMarkup = ['a', ['href', child.url]];\n                const linkMarkupIndex = mobiledoc.markups.push(linkMarkup) - 1;\n                child.children?.forEach((linkChild, linkChildIndex) => {\n                    if (linkChild.format !== 0) {\n                        const openedMarkupIndexes = [];\n                        const openedFormats = [];\n                        // first child of a link opens the link markup\n                        if (linkChildIndex === 0) {\n                            openMarkups.push(linkMarkup);\n                            openedMarkupIndexes.push(linkMarkupIndex);\n                        }\n                        // text child has formats, track which are new and which have closed\n                        const childFormats = readFormat(linkChild.format);\n                        let closedMarkupCount = 0;\n                        childFormats.forEach((format) => {\n                            if (!openMarkups.includes(format)) {\n                                openMarkups.push(format);\n                                openedFormats.push(format);\n                            }\n                        });\n                        // mobiledoc will immediately close any formats if the next section doesn't use them\n                        if (!child.children[linkChildIndex + 1]) {\n                            // last child of a link closes all markups\n                            closedMarkupCount = openMarkups.length;\n                            openMarkups = [];\n                        }\n                        else {\n                            const nextChild = child.children[linkChildIndex + 1];\n                            const nextFormats = readFormat(nextChild.format);\n                            const firstMissingFormatIndex = openMarkups.findIndex((markup) => {\n                                const markupIsLink = JSON.stringify(markup) === JSON.stringify(linkMarkup);\n                                return !markupIsLink && !nextFormats.includes(markup);\n                            });\n                            if (firstMissingFormatIndex !== -1) {\n                                const formatsToClose = openMarkups.slice(firstMissingFormatIndex);\n                                closedMarkupCount = formatsToClose.length;\n                                openMarkups = openMarkups.slice(0, firstMissingFormatIndex);\n                            }\n                        }\n                        openedMarkupIndexes.push(...openedFormats.map((format) => getOrSetMarkupIndex(format, mobiledoc)));\n                        markers.push([MD_TEXT_MARKER, openedMarkupIndexes, closedMarkupCount, linkChild.text]);\n                    }\n                    else {\n                        const openedMarkupIndexes = [];\n                        // first child of a link opens the link markup\n                        if (linkChildIndex === 0) {\n                            openMarkups.push(linkMarkup);\n                            openedMarkupIndexes.push(linkMarkupIndex);\n                        }\n                        let closedMarkupCount = openMarkups.length - 1; // don't close the link markup, just the others\n                        // last child of a link closes all markups\n                        if (!child.children[linkChildIndex + 1]) {\n                            closedMarkupCount += 1; // close the link markup\n                            openMarkups = [];\n                        }\n                        markers.push([MD_TEXT_MARKER, openedMarkupIndexes, closedMarkupCount, linkChild.text]);\n                    }\n                });\n            }\n            if (child.type === 'linebreak') {\n                const atom = ['soft-return', '', {}];\n                const atomIndex = getOrSetAtomIndex(atom, mobiledoc);\n                markers.push([MD_ATOM_MARKER, [], 0, atomIndex]);\n            }\n        });\n    }\n    return markers;\n}\n// Lexical stores formats as a bitmask, so we need to read the bitmask to\n// determine which formats are present\nfunction readFormat(format) {\n    const formats = [];\n    L_FORMAT_MAP.forEach((value, key) => {\n        if ((format & key) !== 0) {\n            formats.push(value);\n        }\n    });\n    return formats;\n}\nfunction addCardSection(child, mobiledoc) {\n    const cardType = child.type;\n    let cardName = child.type;\n    // rename card if there's a difference between lexical/mobiledoc\n    if (CARD_NAME_MAP[cardName]) {\n        cardName = CARD_NAME_MAP[cardName];\n    }\n    // don't include type in the payload\n    const payload = {};\n    for (const key of Object.keys(child)) {\n        if (key !== 'type') {\n            payload[key] = child[key];\n        }\n    }\n    // rename any properties to match mobiledoc\n    if (CARD_PROPERTY_MAP[cardType]) {\n        const map = CARD_PROPERTY_MAP[cardType];\n        for (const [key, value] of Object.entries(map)) {\n            payload[value] = payload[key];\n            delete payload[key];\n        }\n    }\n    const card = [cardName, payload];\n    mobiledoc.cards.push(card);\n    const cardIndex = mobiledoc.cards.length - 1;\n    const section = [MD_CARD_SECTION, cardIndex];\n    mobiledoc.sections.push(section);\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.mobiledocToLexical = mobiledocToLexical;\nconst BLANK_DOC = {\n    root: {\n        children: [],\n        direction: null,\n        format: '',\n        indent: 0,\n        type: 'root',\n        version: 1,\n    },\n};\nconst TAG_TO_LEXICAL_NODE = {\n    p: {\n        type: 'paragraph',\n    },\n    h1: {\n        type: 'heading',\n        tag: 'h1',\n    },\n    h2: {\n        type: 'heading',\n        tag: 'h2',\n    },\n    h3: {\n        type: 'heading',\n        tag: 'h3',\n    },\n    h4: {\n        type: 'heading',\n        tag: 'h4',\n    },\n    h5: {\n        type: 'heading',\n        tag: 'h5',\n    },\n    h6: {\n        type: 'heading',\n        tag: 'h6',\n    },\n    blockquote: {\n        type: 'quote',\n    },\n    aside: {\n        type: 'aside',\n    },\n    a: {\n        type: 'link',\n        rel: null,\n        target: null,\n        title: null,\n        url: null,\n    },\n};\nconst ATOM_TO_LEXICAL_NODE = {\n    'soft-return': {\n        type: 'linebreak',\n        version: 1,\n    },\n};\nconst MARKUP_TO_FORMAT = {\n    strong: 1,\n    b: 1,\n    em: 1 << 1,\n    i: 1 << 1,\n    s: 1 << 2,\n    u: 1 << 3,\n    code: 1 << 4,\n    sub: 1 << 5,\n    sup: 1 << 6,\n};\nconst CARD_NAME_MAP = {\n    code: 'codeblock',\n    hr: 'horizontalrule',\n};\nconst CARD_PROPERTY_MAP = {\n    embed: {\n        type: 'embedType',\n    },\n};\nconst CARD_FIXES_MAP = {\n    callout: (payload) => {\n        if (payload.backgroundColor && !payload.backgroundColor.match(/^[a-zA-Z\\d-]+$/)) {\n            payload.backgroundColor = 'white';\n        }\n        return payload;\n    },\n};\nfunction mobiledocToLexical(serializedMobiledoc) {\n    if (serializedMobiledoc === null ||\n        serializedMobiledoc === undefined ||\n        serializedMobiledoc === '') {\n        return JSON.stringify(BLANK_DOC);\n    }\n    const mobiledoc = JSON.parse(serializedMobiledoc);\n    if (!mobiledoc.sections) {\n        return JSON.stringify(BLANK_DOC);\n    }\n    const lexical = buildEmptyDoc();\n    mobiledoc.sections.forEach((child) => addRootChild(child, mobiledoc, lexical));\n    return JSON.stringify(lexical);\n}\n/* internal functions ------------------------------------------------------- */\nfunction buildEmptyDoc() {\n    return {\n        root: {\n            children: [],\n            direction: null,\n            format: '',\n            indent: 0,\n            type: 'root',\n            version: 1,\n        },\n    };\n}\nfunction addRootChild(child, mobiledoc, lexical) {\n    const sectionTypeIdentifier = child[0];\n    if (sectionTypeIdentifier === 1) {\n        // Markup (text) section\n        const lexicalChild = convertMarkupSectionToLexical(child, mobiledoc);\n        lexical.root.children.push(lexicalChild);\n        // Set direction to ltr if there is any text\n        // Otherwise direction should be null\n        // Not sure if this is necessary:\n        // if we don't plan to support RTL, we could just set 'ltr' in all cases and ignore null\n        if (lexicalChild.children && lexicalChild.children.length > 0) {\n            lexical.root.direction = 'ltr';\n        }\n    }\n    else if (sectionTypeIdentifier === 2) {\n        // Image section\n        // Not used in Ghost\n    }\n    else if (sectionTypeIdentifier === 3) {\n        // List section\n        const lexicalChild = convertListSectionToLexical(child, mobiledoc);\n        lexical.root.children.push(lexicalChild);\n        lexical.root.direction = 'ltr'; // mobiledoc only supports LTR\n    }\n    else if (sectionTypeIdentifier === 10) {\n        // Card section\n        const lexicalChild = convertCardSectionToLexical(child, mobiledoc);\n        lexical.root.children.push(lexicalChild);\n    }\n}\nfunction convertMarkupSectionToLexical(section, mobiledoc) {\n    const tagName = section[1]; // e.g. 'p'\n    const markers = section[2]; // e.g. [[0, [0], 0, \"Hello world\"]]\n    // Create an empty Lexical node from the tag name\n    // We will add nodes to the children array later\n    const lexicalNode = createEmptyLexicalNode(tagName);\n    populateLexicalNodeWithMarkers(lexicalNode, markers, mobiledoc);\n    return lexicalNode;\n}\nfunction populateLexicalNodeWithMarkers(lexicalNode, markers, mobiledoc) {\n    const markups = mobiledoc.markups;\n    const atoms = mobiledoc.atoms;\n    // Initiate some variables before looping over all the markers\n    const openMarkups = []; // tracks which markup tags are open for the current marker\n    let linkNode = undefined; // tracks current link node or undefined if no a tag is open\n    let href = undefined; // tracks the href for the current link node or undefined if no a tag is open\n    let rel = undefined; //tracks the rel attribute for the current link node or undefined if no a tag is open\n    let openLinkMarkup = false; // tracks whether the current node is a link node\n    // loop over markers and convert each one to lexical\n    for (let i = 0; i < markers.length; i++) {\n        // grab the attributes from the current marker\n        const [textTypeIdentifier, openMarkupsIndexes, numberOfClosedMarkups, value] = markers[i];\n        // Markers are either text (markup) or atoms\n        const markerType = textTypeIdentifier === 0 ? 'markup' : 'atom';\n        // If the current marker is an atom, convert the atom to Lexical and add to the node\n        if (markerType === 'atom') {\n            const atom = atoms[value];\n            const atomName = atom[0];\n            const childNode = ATOM_TO_LEXICAL_NODE[atomName];\n            embedChildNode(lexicalNode, childNode);\n            continue;\n        }\n        // calculate which markups are open for the current marker\n        openMarkupsIndexes.forEach((markupIndex) => {\n            const markup = markups[markupIndex];\n            // Extract the href from the markup if it's a link\n            if (markup[0] === 'a') {\n                openLinkMarkup = true;\n                const attrs = markup[1];\n                if (attrs && attrs[0] === 'href') {\n                    href = attrs[1];\n                }\n                if (attrs && attrs[2] === 'rel') {\n                    rel = attrs[3];\n                }\n            }\n            // Add the markup to the list of open markups\n            openMarkups.push(markup);\n        });\n        if (value !== undefined) {\n            // Convert the open markups to a bitmask compatible with Lexical\n            const format = convertMarkupTagsToLexicalFormatBitmask(openMarkups);\n            // If there is an open link tag, add the text to the link node\n            // Otherwise add the text to the parent node\n            if (openLinkMarkup) {\n                // link is open\n                // Create an empty link node if it doesn't exist already\n                linkNode =\n                    linkNode !== undefined\n                        ? linkNode\n                        : createEmptyLexicalNode('a', { url: href, rel: rel || null });\n                // Create a text node and add it to the link node\n                const textNode = createTextNode(value, format);\n                embedChildNode(linkNode, textNode);\n            }\n            else {\n                const textNode = createTextNode(value, format);\n                embedChildNode(lexicalNode, textNode);\n            }\n        }\n        // Close any markups that are closed after the current marker\n        // Remove any closed markups from openMarkups list\n        for (let j = 0; j < numberOfClosedMarkups; j++) {\n            // Remove the most recently opened markup from the list of open markups\n            const markup = openMarkups.pop();\n            // If we're closing a link tag, add the linkNode to the node\n            // Reset href and linkNode for the next markup\n            if (markup && markup[0] === 'a') {\n                embedChildNode(lexicalNode, linkNode);\n                openLinkMarkup = false;\n                href = undefined;\n                linkNode = undefined;\n            }\n        }\n    }\n}\n// Creates a text node from the given text and format\nfunction createTextNode(text, format) {\n    return {\n        detail: 0,\n        format: format,\n        mode: 'normal',\n        style: '',\n        text: text,\n        type: 'text',\n        version: 1,\n    };\n}\n// Creates an empty Lexical node from the given tag name and additional attributes\nfunction createEmptyLexicalNode(tagName, attributes = {}) {\n    const nodeParams = TAG_TO_LEXICAL_NODE[tagName];\n    const node = {\n        children: [],\n        direction: 'ltr',\n        format: '',\n        indent: 0,\n        ...nodeParams,\n        ...attributes,\n        type: nodeParams?.type || attributes.type || tagName,\n        version: 1,\n    };\n    return node;\n}\n// Adds a child node to a parent node\nfunction embedChildNode(parentNode, childNode) {\n    // If there is no child node, do nothing\n    if (!childNode) {\n        return;\n    }\n    // Add textNode to node's children\n    parentNode.children.push(childNode);\n    // If there is any text (e.g. not a blank text node), set the direction to ltr\n    if (childNode && 'text' in childNode && childNode.text) {\n        parentNode.direction = 'ltr';\n    }\n}\n// Lexical stores formats as a bitmask\n// Mobiledoc stores formats as a list of open markup tags\n// This function converts a list of open tags to a bitmask compatible with lexical\nfunction convertMarkupTagsToLexicalFormatBitmask(tags) {\n    let format = 0;\n    tags.forEach((tag) => {\n        const tagName = tag[0];\n        if (tagName in MARKUP_TO_FORMAT) {\n            format = format | MARKUP_TO_FORMAT[tagName];\n        }\n    });\n    return format;\n}\nfunction convertListSectionToLexical(child, mobiledoc) {\n    const tag = child[1];\n    const listItems = child[2];\n    const listType = tag === 'ul' ? 'bullet' : 'number';\n    const listNode = createEmptyLexicalNode(tag, {\n        tag,\n        type: 'list',\n        listType,\n        start: 1,\n        direction: 'ltr',\n    });\n    listItems?.forEach((listItem, i) => {\n        const listItemNode = createEmptyLexicalNode('li', {\n            type: 'listitem',\n            value: i + 1,\n            direction: 'ltr',\n        });\n        populateLexicalNodeWithMarkers(listItemNode, listItem, mobiledoc);\n        listNode.children.push(listItemNode);\n    });\n    return listNode;\n}\nfunction convertCardSectionToLexical(child, mobiledoc) {\n    const cardIndex = child[1];\n    let [cardName, payload] = mobiledoc.cards[cardIndex];\n    // rename card if there's a difference between mobiledoc and lexical\n    cardName = CARD_NAME_MAP[cardName] || cardName;\n    // rename any properties to match lexical\n    if (CARD_PROPERTY_MAP[cardName]) {\n        const map = CARD_PROPERTY_MAP[cardName];\n        for (const [oldName, newName] of Object.entries(map)) {\n            payload[newName] = payload[oldName];\n            delete payload[oldName];\n        }\n    }\n    // run any payload fixes\n    if (CARD_FIXES_MAP[cardName]) {\n        payload = CARD_FIXES_MAP[cardName](payload);\n    }\n    delete payload.type;\n    const decoratorNode = { type: cardName, ...payload };\n    return decoratorNode;\n}\n","module.exports = require('./lib/LimitService');\n","const camelCase = require('lodash/camelCase');\nconst has = require('lodash/has');\nconst {IncorrectUsageError} = require('@tryghost/errors');\n\nconst {MaxLimit, MaxPeriodicLimit, FlagLimit, AllowlistLimit} = require('./limit');\nconst config = require('./config');\n\nconst messages = {\n    missingErrorsConfig: `Config Missing: 'errors' is required.`,\n    noSubscriptionParameter: 'Attempted to setup a periodic max limit without a subscription'\n};\n\nclass LimitService {\n    constructor() {\n        this.limits = {};\n    }\n\n    /**\n     * Initializes the limits based on configuration\n     *\n     * @param {Object} options\n     * @param {Object} [options.limits] - hash containing limit configurations keyed by limit name and containing\n     * @param {Object} [options.subscription] - hash containing subscription configuration with interval and startDate properties\n     * @param {String} options.helpLink - URL pointing to help resources for when limit is reached\n     * @param {Object} options.db - knex db connection instance or other data source for the limit checks\n     * @param {Object} options.errors - instance of errors compatible with GhostError errors (@tryghost/errors)\n     */\n    loadLimits({limits = {}, subscription, helpLink, db, errors}) {\n        if (!errors) {\n            throw new IncorrectUsageError({\n                message: messages.missingErrorsConfig\n            });\n        }\n\n        this.errors = errors;\n\n        // CASE: reset internal limits state in case load is called multiple times\n        this.limits = {};\n\n        Object.keys(limits).forEach((name) => {\n            name = camelCase(name);\n\n            // NOTE: config module acts as an allowlist of supported config names, where each key is a name of supported config\n            if (config[name]) {\n                /** @type LimitConfig */\n                let limitConfig = Object.assign({}, config[name], limits[name]);\n\n                if (has(limitConfig, 'allowlist')) {\n                    this.limits[name] = new AllowlistLimit({name, config: limitConfig, helpLink, errors});\n                } else if (has(limitConfig, 'max')) {\n                    this.limits[name] = new MaxLimit({name: name, config: limitConfig, helpLink, db, errors});\n                } else if (has(limitConfig, 'maxPeriodic')) {\n                    if (subscription === undefined) {\n                        throw new IncorrectUsageError({\n                            message: messages.noSubscriptionParameter\n                        });\n                    }\n\n                    const maxPeriodicLimitConfig = Object.assign({}, limitConfig, subscription);\n                    this.limits[name] = new MaxPeriodicLimit({name: name, config: maxPeriodicLimitConfig, helpLink, db, errors});\n                } else {\n                    this.limits[name] = new FlagLimit({name: name, config: limitConfig, helpLink, errors});\n                }\n            }\n        });\n    }\n\n    isLimited(limitName) {\n        return !!this.limits[camelCase(limitName)];\n    }\n\n    /**\n    * Check if a limit is disabled, applicable only to limits that support the disabled flag (e.g. FlagLimit)\n    * @returns {boolean|undefined} undefined if limit is not configured\n    * @throws {IncorrectUsageError} if limit does not support disabled flag\n    */\n    isDisabled(limitName) {\n        if (!this.isLimited(limitName)) {\n            return;\n        }\n\n        const limit = this.limits[camelCase(limitName)];\n\n        if (typeof limit.isDisabled !== 'function') {\n            throw new IncorrectUsageError({\n                message: `Limit ${limitName} does not support .isDisabled()`\n            });\n        }\n\n        return limit.isDisabled();\n    }\n\n    /**\n     *\n     * @param {String} limitName - name of the configured limit\n     * @param {Object} [options] - limit parameters\n     * @param {Object} [options.transacting] Transaction to run the count query on (if required for the chosen limit)\n     * @returns\n     */\n    async checkIsOverLimit(limitName, options = {}) {\n        if (!this.isLimited(limitName)) {\n            return;\n        }\n\n        try {\n            await this.limits[limitName].errorIfIsOverLimit(options);\n            return false;\n        } catch (error) {\n            if (error instanceof this.errors.HostLimitError) {\n                return true;\n            }\n\n            throw error;\n        }\n    }\n\n    /**\n     *\n     * @param {String} limitName - name of the configured limit\n     * @param {Object} [options] - limit parameters\n     * @param {Object} [options.transacting] Transaction to run the count query on (if required for the chosen limit)\n     * @returns\n     */\n    async checkWouldGoOverLimit(limitName, options = {}) {\n        if (!this.isLimited(limitName)) {\n            return;\n        }\n\n        try {\n            await this.limits[limitName].errorIfWouldGoOverLimit(options);\n            return false;\n        } catch (error) {\n            if (error instanceof this.errors.HostLimitError) {\n                return true;\n            }\n\n            throw error;\n        }\n    }\n\n    /**\n     *\n     * @param {String} limitName - name of the configured limit\n     * @param {Object} [options] - limit parameters\n     * @param {Object} [options.transacting] Transaction to run the count query on (if required for the chosen limit)\n     * @returns\n     */\n    async errorIfIsOverLimit(limitName, options = {}) {\n        if (!this.isLimited(limitName)) {\n            return;\n        }\n\n        await this.limits[limitName].errorIfIsOverLimit(options);\n    }\n\n    /**\n     *\n     * @param {String} limitName - name of the configured limit\n     * @param {Object} [options] - limit parameters\n     * @param {Object} [options.transacting] Transaction to run the count query on (if required for the chosen limit)\n     * @returns\n     */\n    async errorIfWouldGoOverLimit(limitName, options = {}) {\n        if (!this.isLimited(limitName)) {\n            return;\n        }\n\n        await this.limits[limitName].errorIfWouldGoOverLimit(options);\n    }\n\n    /**\n     * Checks if any of the configured limits acceded\n     *\n     * @param {Object} [options] - limit parameters\n     * @param {Object} [options.transacting] Transaction to run the count queries on (if required for the chosen limit)\n     * @returns {Promise<boolean>}\n     */\n    async checkIfAnyOverLimit(options = {}) {\n        for (const limit in this.limits) {\n            if (await this.checkIsOverLimit(limit, options)) {\n                return true;\n            }\n        }\n\n        return false;\n    }\n}\n\nmodule.exports = LimitService;\n\n/**\n * @typedef {Object} LimitConfig\n * @prop {Number} [max] - max limit\n * @prop {Number} [maxPeriodic] - max limit for a period\n * @prop {Boolean} [disabled] - flag disabling/enabling limit\n * @prop {String} error - custom error to be displayed when the limit is reached\n * @prop {Function} [currentCountQuery] - function returning count for the \"max\" type of limit\n */\n","// NOTE: to support a new config in the limit service add an empty key-object pair in the export below.\n// Each type of limit has it's own structure:\n// 1. FlagLimit and AllowlistLimit types are empty objects paired with a key, e.g.: `customThemes: {}`\n// 2. MaxLimit should contain a `currentCountQuery` function which would count the resources under limit\nmodule.exports = {\n    members: {\n        currentCountQuery: async (knex) => {\n            let result = await knex('members').count('id', {as: 'count'}).first();\n            return result.count;\n        }\n    },\n    newsletters: {\n        currentCountQuery: async (knex) => {\n            let result = await knex('newsletters')\n                .count('id', {as: 'count'})\n                .where('status', '=', 'active')\n                .first();\n\n            return result.count;\n        }\n    },\n    emails: {\n        currentCountQuery: async (knex, startDate) => {\n            let result = await knex('emails')\n                .sum('email_count', {as: 'count'})\n                .where('created_at', '>=', startDate)\n                .first();\n\n            return result.count;\n        }\n    },\n    staff: {\n        currentCountQuery: async (knex) => {\n            let result = await knex('users')\n                .select('users.id')\n                .leftJoin('roles_users', 'users.id', 'roles_users.user_id')\n                .leftJoin('roles', 'roles_users.role_id', 'roles.id')\n                .whereNot('roles.name', 'Contributor').andWhereNot('users.status', 'inactive').union([\n                    knex('invites')\n                        .select('invites.id')\n                        .leftJoin('roles', 'invites.role_id', 'roles.id')\n                        .whereNot('roles.name', 'Contributor')\n                ]);\n\n            return result.length;\n        }\n    },\n    customIntegrations: {},\n    customThemes: {},\n    uploads: {\n        // NOTE: this function should not ever be used as for uploads we compare the size\n        //       of the uploaded file with the configured limit. Noop is here to keep the\n        //       MaxLimit constructor happy\n        currentCountQuery: () => {},\n        // NOTE: the uploads limit is based on file sizes provided in Bytes\n        //       a custom formatter is here for more user-friendly formatting when forming an error\n        formatter: count => `${count / 1000000}MB`\n    },\n    limitStripeConnect: {},\n    limitAnalytics: {},\n    limitSocialWeb: {},\n    publicSiteAccess: {}\n};\n","const {DateTime} = require('luxon');\nconst {IncorrectUsageError} = require('@tryghost/errors');\n\nconst messages = {\n    invalidInterval: 'Invalid interval specified. Only \"month\" value is accepted.'\n};\n\nconst SUPPORTED_INTERVALS = ['month'];\n/**\n * Calculates the start of the last period (billing, cycle, etc.) based on the start date\n * and the interval at which the cycle renews.\n *\n * @param {String} startDate - date in ISO 8601 format (https://en.wikipedia.org/wiki/ISO_8601)\n * @param {('month')} interval - currently only supports 'month' value, in the future might support 'year', etc.\n *\n * @returns {String} - date in ISO 8601 format (https://en.wikipedia.org/wiki/ISO_8601) of the last period start\n */\nconst lastPeriodStart = (startDate, interval) => {\n    if (interval === 'month') {\n        const startDateISO = DateTime.fromISO(startDate, {zone: 'UTC'});\n        const now = DateTime.now().setZone('UTC');\n        const fullPeriodsPast = Math.floor(now.diff(startDateISO, 'months').months);\n\n        const lastPeriodStartDate = startDateISO.plus({months: fullPeriodsPast});\n\n        return lastPeriodStartDate.toISO();\n    }\n\n    throw new IncorrectUsageError({\n        message: messages.invalidInterval\n    });\n};\n\nmodule.exports = {\n    lastPeriodStart,\n    SUPPORTED_INTERVALS\n};\n","const lowerCase = require('lodash/lowerCase');\nconst template = require('lodash/template');\nconst {lastPeriodStart, SUPPORTED_INTERVALS} = require('./date-utils');\n\nconst interpolate = /{{([\\s\\S]+?)}}/g;\n\nclass Limit {\n    /**\n     *\n     * @param {Object} options\n     * @param {String} options.name - name of the limit\n     * @param {String} options.error - error message to use when limit is reached\n     * @param {String} options.helpLink - URL to the resource explaining how the limit works\n     * @param {Object} [options.db] - instance of knex db connection that currentCountQuery can use to run state check through\n     * @param {Object} options.errors - instance of errors compatible with GhostError errors (@tryghost/errors)\n     */\n    constructor({name, error, helpLink, db, errors}) {\n        this.name = name;\n        this.error = error;\n        this.helpLink = helpLink;\n        this.db = db;\n        this.errors = errors;\n    }\n\n    generateError() {\n        let errorObj = {\n            errorDetails: {\n                name: this.name\n            }\n        };\n\n        if (this.helpLink) {\n            errorObj.help = this.helpLink;\n        }\n\n        return errorObj;\n    }\n}\n\nclass MaxLimit extends Limit {\n    /**\n     *\n     * @param {Object} options\n     * @param {String} options.name - name of the limit\n     * @param {Object} options.config - limit configuration\n     * @param {Number} options.config.max - maximum limit the limit would check against\n     * @param {Function} options.config.currentCountQuery - query checking the state that would be compared against the limit\n     * @param {Function} [options.config.formatter] - function to format the limit counts before they are passed to the error message\n     * @param {String} [options.config.error] - error message to use when limit is reached\n     * @param {String} [options.helpLink] - URL to the resource explaining how the limit works\n     * @param {Object} [options.db] - instance of knex db connection that currentCountQuery can use to run state check through\n     * @param {Object} options.errors - instance of errors compatible with GhostError errors (@tryghost/errors)\n     */\n    constructor({name, config, helpLink, db, errors}) {\n        super({name, error: config.error || '', helpLink, db, errors});\n\n        if (config.max === undefined) {\n            throw new errors.IncorrectUsageError({message: 'Attempted to setup a max limit without a limit'});\n        }\n\n        if (!config.currentCountQuery) {\n            throw new errors.IncorrectUsageError({message: 'Attempted to setup a max limit without a current count query'});\n        }\n\n        this.currentCountQueryFn = config.currentCountQuery;\n        this.max = config.max;\n        this.formatter = config.formatter;\n        this.fallbackMessage = `This action would exceed the ${lowerCase(this.name)} limit on your current plan.`;\n    }\n\n    /**\n     *\n     * @param {Number} count - current count that acceded the limit\n     * @returns {Object} instance of HostLimitError\n     */\n    generateError(count) {\n        let errorObj = super.generateError();\n\n        errorObj.message = this.fallbackMessage;\n\n        if (this.error) {\n            const formatter = this.formatter || Intl.NumberFormat().format;\n            try {\n                errorObj.message = template(this.error, {interpolate})(\n                    {\n                        max: formatter(this.max),\n                        count: formatter(count),\n                        name: this.name\n                    });\n            } catch (e) {\n                errorObj.message = this.fallbackMessage;\n            }\n        }\n\n        errorObj.errorDetails.limit = this.max;\n        errorObj.errorDetails.total = count;\n\n        return new this.errors.HostLimitError(errorObj);\n    }\n\n    /**\n     * @param {Object} [options]\n     * @param {Object} [options.transacting] Transaction to run the count query on\n     * @returns\n     */\n    async currentCountQuery(options = {}) {\n        return await this.currentCountQueryFn(options.transacting ?? this.db?.knex);\n    }\n\n    /**\n     * Throws a HostLimitError if the configured or passed max limit is acceded by currentCountQuery\n     *\n     * @param {Object} options\n     * @param {Number} [options.max] - overrides configured default max value to perform checks against\n     * @param {Number} [options.addedCount] - number of items to add to the currentCount during the check\n     * @param {Object} [options.transacting] Transaction to run the count query on\n     */\n    async errorIfWouldGoOverLimit(options = {}) {\n        const {max, addedCount = 1} = options;\n        let currentCount = await this.currentCountQuery(options);\n\n        if ((currentCount + addedCount) > (max || this.max)) {\n            throw this.generateError(currentCount);\n        }\n    }\n\n    /**\n     * Throws a HostLimitError if the configured or passed max limit is acceded by currentCountQuery\n     *\n     * @param {Object} options\n     * @param {Number} [options.max] - overrides configured default max value to perform checks against\n     * @param {Number} [options.currentCount] - overrides currentCountQuery to perform checks against\n     * @param {Object} [options.transacting] Transaction to run the count query on\n     */\n    async errorIfIsOverLimit(options = {}) {\n        const currentCount = options.currentCount || await this.currentCountQuery(options);\n\n        if (currentCount > (options.max || this.max)) {\n            throw this.generateError(currentCount);\n        }\n    }\n}\n\nclass MaxPeriodicLimit extends Limit {\n    /**\n     *\n     * @param {Object} options\n     * @param {String} options.name - name of the limit\n     * @param {Object} options.config - limit configuration\n     * @param {Number} options.config.maxPeriodic - maximum limit the limit would check against\n     * @param {String} options.config.error - error message to use when limit is reached\n     * @param {Function} options.config.currentCountQuery - query checking the state that would be compared against the limit\n     * @param {('month')} options.config.interval - an interval to take into account when checking the limit. Currently only supports 'month' value\n     * @param {String} options.config.startDate - start date in ISO 8601 format (https://en.wikipedia.org/wiki/ISO_8601), used to calculate period intervals\n     * @param {String} options.helpLink - URL to the resource explaining how the limit works\n     * @param {Object} [options.db] - instance of knex db connection that currentCountQuery can use to run state check through\n     * @param {Object} options.errors - instance of errors compatible with GhostError errors (@tryghost/errors)\n     */\n    constructor({name, config, helpLink, db, errors}) {\n        super({name, error: config.error || '', helpLink, db, errors});\n\n        if (config.maxPeriodic === undefined) {\n            throw new errors.IncorrectUsageError({message: 'Attempted to setup a periodic max limit without a limit'});\n        }\n\n        if (!config.currentCountQuery) {\n            throw new errors.IncorrectUsageError({message: 'Attempted to setup a periodic max limit without a current count query'});\n        }\n\n        if (!config.interval) {\n            throw new errors.IncorrectUsageError({message: 'Attempted to setup a periodic max limit without an interval'});\n        }\n\n        if (!SUPPORTED_INTERVALS.includes(config.interval)) {\n            throw new errors.IncorrectUsageError({message: `Attempted to setup a periodic max limit without unsupported interval. Please specify one of: ${SUPPORTED_INTERVALS}`});\n        }\n\n        if (!config.startDate) {\n            throw new errors.IncorrectUsageError({message: 'Attempted to setup a periodic max limit without a start date'});\n        }\n\n        this.currentCountQueryFn = config.currentCountQuery;\n        this.maxPeriodic = config.maxPeriodic;\n        this.interval = config.interval;\n        this.startDate = config.startDate;\n        this.fallbackMessage = `This action would exceed the ${lowerCase(this.name)} limit on your current plan.`;\n    }\n\n    generateError(count) {\n        let errorObj = super.generateError();\n\n        errorObj.message = this.fallbackMessage;\n\n        if (this.error) {\n            try {\n                errorObj.message = template(this.error, {interpolate})(\n                    {\n                        max: Intl.NumberFormat().format(this.maxPeriodic),\n                        count: Intl.NumberFormat().format(count),\n                        name: this.name\n                    });\n            } catch (e) {\n                errorObj.message = this.fallbackMessage;\n            }\n        }\n\n        errorObj.errorDetails.limit = this.maxPeriodic;\n        errorObj.errorDetails.total = count;\n\n        return new this.errors.HostLimitError(errorObj);\n    }\n\n    /**\n     * @param {Object} [options]\n     * @param {Object} [options.transacting] Transaction to run the count query on\n     * @returns\n     */\n    async currentCountQuery(options = {}) {\n        const lastPeriodStartDate = lastPeriodStart(this.startDate, this.interval);\n\n        return await this.currentCountQueryFn(options.transacting ? options.transacting : (this.db ? this.db.knex : undefined), lastPeriodStartDate);\n    }\n\n    /**\n     * Throws a HostLimitError if the configured or passed max limit is acceded by currentCountQuery\n     *\n     * @param {Object} options\n     * @param {Number} [options.max] - overrides configured default maxPeriodic value to perform checks against\n     * @param {Number} [options.addedCount] - number of items to add to the currentCount during the check\n     * @param {Object} [options.transacting] Transaction to run the count query on\n     */\n    async errorIfWouldGoOverLimit(options = {}) {\n        const {max, addedCount = 1} = options;\n        let currentCount = await this.currentCountQuery(options);\n\n        if ((currentCount + addedCount) > (max || this.maxPeriodic)) {\n            throw this.generateError(currentCount);\n        }\n    }\n\n    /**\n     * Throws a HostLimitError if the configured or passed max limit is acceded by currentCountQuery\n     *\n     * @param {Object} options\n     * @param {Number} [options.max] - overrides configured default maxPeriodic value to perform checks against\n     * @param {Object} [options.transacting] Transaction to run the count query on\n     */\n    async errorIfIsOverLimit(options = {}) {\n        const {max} = options;\n        let currentCount = await this.currentCountQuery(options);\n\n        if (currentCount > (max || this.maxPeriodic)) {\n            throw this.generateError(currentCount);\n        }\n    }\n}\n\nclass FlagLimit extends Limit {\n    /**\n     *\n     * @param {Object} options\n     * @param {String} options.name - name of the limit\n     * @param {Object} options.config - limit configuration\n     * @param {Number} options.config.disabled - disabled/enabled flag for the limit\n     * @param {String} options.config.error - error message to use when limit is reached\n     * @param {String} options.helpLink - URL to the resource explaining how the limit works\n     * @param {Object} [options.db] - instance of knex db connection that currentCountQuery can use to run state check through\n     * @param {Object} options.errors - instance of errors compatible with GhostError errors (@tryghost/errors)\n     */\n    constructor({name, config, helpLink, db, errors}) {\n        super({name, error: config.error || '', helpLink, db, errors});\n        const userFacingLimitName = lowerCase(name.replace(/^limit/, ''));\n\n        this.disabled = config.disabled;\n        this.fallbackMessage = `Your plan does not support ${userFacingLimitName}. Please upgrade to enable ${userFacingLimitName}.`;\n    }\n\n    generateError() {\n        let errorObj = super.generateError();\n\n        if (this.error) {\n            errorObj.message = this.error;\n        } else {\n            errorObj.message = this.fallbackMessage;\n        }\n\n        return new this.errors.HostLimitError(errorObj);\n    }\n\n    /**\n     * Flag limits are on/off so using a feature is always over the limit\n     */\n    async errorIfWouldGoOverLimit() {\n        if (this.disabled) {\n            throw this.generateError();\n        }\n    }\n\n    /**\n     * Flag limits are on/off. They don't necessarily mean the limit wasn't possible to reach\n     * NOTE: this method should not be relied on as it's impossible to check the limit was surpassed!\n     */\n    async errorIfIsOverLimit() {\n        return;\n    }\n\n    /**\n     * Checks whether the Flag limit is disabled or not\n     * @returns boolean\n     */\n    isDisabled() {\n        return !!this.disabled;\n    }\n}\n\nclass AllowlistLimit extends Limit {\n    /**\n     *\n     * @param {Object} options\n     * @param {String} options.name - name of the limit\n     * @param {Object} options.config - limit configuration\n     * @param {[String]} options.config.allowlist - allowlist values that would be compared against\n     * @param {String} options.config.error - error message to use when limit is reached\n     * @param {String} options.helpLink - URL to the resource explaining how the limit works\n     * @param {Object} options.errors - instance of errors compatible with GhostError errors (@tryghost/errors)\n     */\n    constructor({name, config, helpLink, errors}) {\n        super({name, error: config.error || '', helpLink, errors});\n\n        if (!config.allowlist || !config.allowlist.length) {\n            throw new this.errors.IncorrectUsageError({message: 'Attempted to setup an allowlist limit without an allowlist'});\n        }\n\n        this.allowlist = config.allowlist;\n        this.fallbackMessage = `This action would exceed the ${lowerCase(this.name)} limit on your current plan.`;\n    }\n\n    generateError() {\n        let errorObj = super.generateError();\n\n        if (this.error) {\n            errorObj.message = this.error;\n        } else {\n            errorObj.message = this.fallbackMessage;\n        }\n\n        return new this.errors.HostLimitError(errorObj);\n    }\n\n    async errorIfWouldGoOverLimit(metadata) {\n        if (!metadata || !metadata.value) {\n            throw new this.errors.IncorrectUsageError({message: 'Attempted to check an allowlist limit without a value'});\n        }\n        if (!this.allowlist.includes(metadata.value)) {\n            throw this.generateError();\n        }\n    }\n\n    async errorIfIsOverLimit(metadata) {\n        if (!metadata || !metadata.value) {\n            throw new this.errors.IncorrectUsageError({message: 'Attempted to check an allowlist limit without a value'});\n        }\n        if (!this.allowlist.includes(metadata.value)) {\n            throw this.generateError();\n        }\n    }\n}\n\nmodule.exports = {\n    MaxLimit,\n    MaxPeriodicLimit,\n    FlagLimit,\n    AllowlistLimit\n};\n","var map = {\n\t\"./af\": 1199,\n\t\"./af.js\": 1199,\n\t\"./ar\": 36347,\n\t\"./ar-dz\": 77230,\n\t\"./ar-dz.js\": 77230,\n\t\"./ar-kw\": 63390,\n\t\"./ar-kw.js\": 63390,\n\t\"./ar-ly\": 65283,\n\t\"./ar-ly.js\": 65283,\n\t\"./ar-ma\": 30570,\n\t\"./ar-ma.js\": 30570,\n\t\"./ar-ps\": 15505,\n\t\"./ar-ps.js\": 15505,\n\t\"./ar-sa\": 94112,\n\t\"./ar-sa.js\": 94112,\n\t\"./ar-tn\": 20386,\n\t\"./ar-tn.js\": 20386,\n\t\"./ar.js\": 36347,\n\t\"./az\": 2067,\n\t\"./az.js\": 2067,\n\t\"./be\": 2405,\n\t\"./be.js\": 2405,\n\t\"./bg\": 77091,\n\t\"./bg.js\": 77091,\n\t\"./bm\": 36429,\n\t\"./bm.js\": 36429,\n\t\"./bn\": 88548,\n\t\"./bn-bd\": 62919,\n\t\"./bn-bd.js\": 62919,\n\t\"./bn.js\": 88548,\n\t\"./bo\": 94219,\n\t\"./bo.js\": 94219,\n\t\"./br\": 89248,\n\t\"./br.js\": 89248,\n\t\"./bs\": 30551,\n\t\"./bs.js\": 30551,\n\t\"./ca\": 36000,\n\t\"./ca.js\": 36000,\n\t\"./cs\": 46330,\n\t\"./cs.js\": 46330,\n\t\"./cv\": 32805,\n\t\"./cv.js\": 32805,\n\t\"./cy\": 51096,\n\t\"./cy.js\": 51096,\n\t\"./da\": 96035,\n\t\"./da.js\": 96035,\n\t\"./de\": 3015,\n\t\"./de-at\": 30917,\n\t\"./de-at.js\": 30917,\n\t\"./de-ch\": 24475,\n\t\"./de-ch.js\": 24475,\n\t\"./de.js\": 3015,\n\t\"./dv\": 29706,\n\t\"./dv.js\": 29706,\n\t\"./el\": 95637,\n\t\"./el.js\": 95637,\n\t\"./en-au\": 33146,\n\t\"./en-au.js\": 33146,\n\t\"./en-ca\": 45800,\n\t\"./en-ca.js\": 45800,\n\t\"./en-gb\": 2053,\n\t\"./en-gb.js\": 2053,\n\t\"./en-ie\": 86274,\n\t\"./en-ie.js\": 86274,\n\t\"./en-il\": 53993,\n\t\"./en-il.js\": 53993,\n\t\"./en-in\": 2663,\n\t\"./en-in.js\": 2663,\n\t\"./en-nz\": 38060,\n\t\"./en-nz.js\": 38060,\n\t\"./en-sg\": 95022,\n\t\"./en-sg.js\": 95022,\n\t\"./eo\": 14060,\n\t\"./eo.js\": 14060,\n\t\"./es\": 44920,\n\t\"./es-do\": 98508,\n\t\"./es-do.js\": 98508,\n\t\"./es-mx\": 22604,\n\t\"./es-mx.js\": 22604,\n\t\"./es-us\": 75269,\n\t\"./es-us.js\": 75269,\n\t\"./es.js\": 44920,\n\t\"./et\": 85773,\n\t\"./et.js\": 85773,\n\t\"./eu\": 75598,\n\t\"./eu.js\": 75598,\n\t\"./fa\": 17933,\n\t\"./fa.js\": 17933,\n\t\"./fi\": 83909,\n\t\"./fi.js\": 83909,\n\t\"./fil\": 80893,\n\t\"./fil.js\": 80893,\n\t\"./fo\": 24455,\n\t\"./fo.js\": 24455,\n\t\"./fr\": 49940,\n\t\"./fr-ca\": 53317,\n\t\"./fr-ca.js\": 53317,\n\t\"./fr-ch\": 77678,\n\t\"./fr-ch.js\": 77678,\n\t\"./fr.js\": 49940,\n\t\"./fy\": 53429,\n\t\"./fy.js\": 53429,\n\t\"./ga\": 96692,\n\t\"./ga.js\": 96692,\n\t\"./gd\": 72511,\n\t\"./gd.js\": 72511,\n\t\"./gl\": 82103,\n\t\"./gl.js\": 82103,\n\t\"./gom-deva\": 33906,\n\t\"./gom-deva.js\": 33906,\n\t\"./gom-latn\": 96893,\n\t\"./gom-latn.js\": 96893,\n\t\"./gu\": 55896,\n\t\"./gu.js\": 55896,\n\t\"./he\": 98755,\n\t\"./he.js\": 98755,\n\t\"./hi\": 46639,\n\t\"./hi.js\": 46639,\n\t\"./hr\": 9130,\n\t\"./hr.js\": 9130,\n\t\"./hu\": 29171,\n\t\"./hu.js\": 29171,\n\t\"./hy-am\": 26406,\n\t\"./hy-am.js\": 26406,\n\t\"./id\": 74694,\n\t\"./id.js\": 74694,\n\t\"./is\": 24220,\n\t\"./is.js\": 24220,\n\t\"./it\": 72681,\n\t\"./it-ch\": 40757,\n\t\"./it-ch.js\": 40757,\n\t\"./it.js\": 72681,\n\t\"./ja\": 33649,\n\t\"./ja.js\": 33649,\n\t\"./jv\": 75572,\n\t\"./jv.js\": 75572,\n\t\"./ka\": 14824,\n\t\"./ka.js\": 14824,\n\t\"./kk\": 81770,\n\t\"./kk.js\": 81770,\n\t\"./km\": 35724,\n\t\"./km.js\": 35724,\n\t\"./kn\": 94005,\n\t\"./kn.js\": 94005,\n\t\"./ko\": 65814,\n\t\"./ko.js\": 65814,\n\t\"./ku\": 17028,\n\t\"./ku-kmr\": 25683,\n\t\"./ku-kmr.js\": 25683,\n\t\"./ku.js\": 17028,\n\t\"./ky\": 23984,\n\t\"./ky.js\": 23984,\n\t\"./lb\": 21038,\n\t\"./lb.js\": 21038,\n\t\"./lo\": 4009,\n\t\"./lo.js\": 4009,\n\t\"./lt\": 27208,\n\t\"./lt.js\": 27208,\n\t\"./lv\": 53970,\n\t\"./lv.js\": 53970,\n\t\"./me\": 13030,\n\t\"./me.js\": 13030,\n\t\"./mi\": 51413,\n\t\"./mi.js\": 51413,\n\t\"./mk\": 85336,\n\t\"./mk.js\": 85336,\n\t\"./ml\": 26189,\n\t\"./ml.js\": 26189,\n\t\"./mn\": 17227,\n\t\"./mn.js\": 17227,\n\t\"./mr\": 1975,\n\t\"./mr.js\": 1975,\n\t\"./ms\": 12256,\n\t\"./ms-my\": 87323,\n\t\"./ms-my.js\": 87323,\n\t\"./ms.js\": 12256,\n\t\"./mt\": 36053,\n\t\"./mt.js\": 36053,\n\t\"./my\": 1042,\n\t\"./my.js\": 1042,\n\t\"./nb\": 1228,\n\t\"./nb.js\": 1228,\n\t\"./ne\": 60057,\n\t\"./ne.js\": 60057,\n\t\"./nl\": 31442,\n\t\"./nl-be\": 17014,\n\t\"./nl-be.js\": 17014,\n\t\"./nl.js\": 31442,\n\t\"./nn\": 46152,\n\t\"./nn.js\": 46152,\n\t\"./oc-lnc\": 62100,\n\t\"./oc-lnc.js\": 62100,\n\t\"./pa-in\": 41771,\n\t\"./pa-in.js\": 41771,\n\t\"./pl\": 6300,\n\t\"./pl.js\": 6300,\n\t\"./pt\": 88340,\n\t\"./pt-br\": 20645,\n\t\"./pt-br.js\": 20645,\n\t\"./pt.js\": 88340,\n\t\"./ro\": 15195,\n\t\"./ro.js\": 15195,\n\t\"./ru\": 75813,\n\t\"./ru.js\": 75813,\n\t\"./sd\": 62339,\n\t\"./sd.js\": 62339,\n\t\"./se\": 6876,\n\t\"./se.js\": 6876,\n\t\"./si\": 41176,\n\t\"./si.js\": 41176,\n\t\"./sk\": 52930,\n\t\"./sk.js\": 52930,\n\t\"./sl\": 38891,\n\t\"./sl.js\": 38891,\n\t\"./sq\": 91392,\n\t\"./sq.js\": 91392,\n\t\"./sr\": 28025,\n\t\"./sr-cyrl\": 50808,\n\t\"./sr-cyrl.js\": 50808,\n\t\"./sr.js\": 28025,\n\t\"./ss\": 38538,\n\t\"./ss.js\": 38538,\n\t\"./sv\": 50773,\n\t\"./sv.js\": 50773,\n\t\"./sw\": 22582,\n\t\"./sw.js\": 22582,\n\t\"./ta\": 23155,\n\t\"./ta.js\": 23155,\n\t\"./te\": 27863,\n\t\"./te.js\": 27863,\n\t\"./tet\": 29464,\n\t\"./tet.js\": 29464,\n\t\"./tg\": 58425,\n\t\"./tg.js\": 58425,\n\t\"./th\": 9492,\n\t\"./th.js\": 9492,\n\t\"./tk\": 21341,\n\t\"./tk.js\": 21341,\n\t\"./tl-ph\": 37317,\n\t\"./tl-ph.js\": 37317,\n\t\"./tlh\": 59394,\n\t\"./tlh.js\": 59394,\n\t\"./tr\": 15622,\n\t\"./tr.js\": 15622,\n\t\"./tzl\": 26952,\n\t\"./tzl.js\": 26952,\n\t\"./tzm\": 61567,\n\t\"./tzm-latn\": 83753,\n\t\"./tzm-latn.js\": 83753,\n\t\"./tzm.js\": 61567,\n\t\"./ug-cn\": 34856,\n\t\"./ug-cn.js\": 34856,\n\t\"./uk\": 40816,\n\t\"./uk.js\": 40816,\n\t\"./ur\": 25695,\n\t\"./ur.js\": 25695,\n\t\"./uz\": 51639,\n\t\"./uz-latn\": 15521,\n\t\"./uz-latn.js\": 15521,\n\t\"./uz.js\": 51639,\n\t\"./vi\": 80885,\n\t\"./vi.js\": 80885,\n\t\"./x-pseudo\": 97765,\n\t\"./x-pseudo.js\": 97765,\n\t\"./yo\": 93592,\n\t\"./yo.js\": 93592,\n\t\"./zh-cn\": 71922,\n\t\"./zh-cn.js\": 71922,\n\t\"./zh-hk\": 37406,\n\t\"./zh-hk.js\": 37406,\n\t\"./zh-mo\": 81043,\n\t\"./zh-mo.js\": 81043,\n\t\"./zh-tw\": 72998,\n\t\"./zh-tw.js\": 72998\n};\n\n\nfunction webpackContext(req) {\n\tvar id = webpackContextResolve(req);\n\treturn __webpack_require__(id);\n}\nfunction webpackContextResolve(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t}\n\treturn map[req];\n}\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = 54551;","\nwindow._eai_r = require;\nwindow._eai_d = define;\n","Object.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst require_utils_api_hooks = require(\"../utils/api/hooks.cjs\");\n//#region src/api/config.ts\nvar dataType = \"ConfigResponseType\";\nvar configDataType = dataType;\nvar useBrowseConfig = require_utils_api_hooks.createQuery({\n\tdataType,\n\tpath: \"/config/\"\n});\nvar isManagedEmail = (config) => {\n\treturn !!config?.hostSettings?.managedEmail?.enabled;\n};\nvar normalizeSendingDomains = (raw) => {\n\tif (Array.isArray(raw)) return raw.filter((d) => typeof d === \"string\" && d.length > 0);\n\tif (typeof raw === \"string\" && raw.length > 0) {\n\t\tconst trimmed = raw.trim();\n\t\tif (trimmed.startsWith(\"[\")) try {\n\t\t\tconst parsed = JSON.parse(trimmed);\n\t\t\tif (Array.isArray(parsed)) return parsed.filter((d) => typeof d === \"string\" && d.length > 0);\n\t\t} catch {}\n\t\treturn [raw];\n\t}\n\treturn [];\n};\nvar sendingDomains = (config) => {\n\treturn normalizeSendingDomains(config?.hostSettings?.managedEmail?.sendingDomain);\n};\nvar hasSendingDomain = (config) => {\n\treturn sendingDomains(config).length > 0;\n};\nvar sendingDomain = (config) => {\n\treturn sendingDomains(config)[0];\n};\nvar DEFAULT_UPGRADE_ROUTE = \"/magicpages\";\nvar upgradeRoute = (config) => {\n\tconst configured = config?.hostSettings?.billing?.upgradeUrl;\n\treturn configured ? configured.replace(/^#/, \"\") : DEFAULT_UPGRADE_ROUTE;\n};\n//#endregion\nexports.DEFAULT_UPGRADE_ROUTE = DEFAULT_UPGRADE_ROUTE;\nexports.configDataType = configDataType;\nexports.hasSendingDomain = hasSendingDomain;\nexports.isManagedEmail = isManagedEmail;\nexports.sendingDomain = sendingDomain;\nexports.sendingDomains = sendingDomains;\nexports.upgradeRoute = upgradeRoute;\nexports.useBrowseConfig = useBrowseConfig;\n\n//# sourceMappingURL=config.cjs.map","Object.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst require_hooks_use_handle_error = require(\"../hooks/use-handle-error.cjs\");\nconst require_utils_api_fetch_api = require(\"../utils/api/fetch-api.cjs\");\nlet _tanstack_react_query = require(\"@tanstack/react-query\");\nlet react = require(\"react\");\n//#region src/api/current-user.ts\nvar usersDataType = \"UsersResponseType\";\nvar currentUserUrl = require_utils_api_fetch_api.apiUrl(\"/users/me/\", { include: \"roles\" });\nvar currentUserQueryKey = [usersDataType, currentUserUrl];\nvar useCurrentUser = ({ requestOptions } = {}) => {\n\tconst fetchApi = require_utils_api_fetch_api.useFetchApi();\n\tconst handleError = require_hooks_use_handle_error();\n\tconst result = (0, _tanstack_react_query.useQuery)({\n\t\tqueryKey: currentUserQueryKey,\n\t\tqueryFn: () => fetchApi(currentUserUrl, requestOptions),\n\t\tselect: (data) => data.users[0]\n\t});\n\t(0, react.useEffect)(() => {\n\t\tif (result.error) handleError(result.error);\n\t}, [handleError, result.error]);\n\treturn result;\n};\n//#endregion\nexports.currentUserQueryKey = currentUserQueryKey;\nexports.useCurrentUser = useCurrentUser;\nexports.usersDataType = usersDataType;\n\n//# sourceMappingURL=current-user.cjs.map","Object.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst require_utils_api_hooks = require(\"../utils/api/hooks.cjs\");\nconst require_utils_api_update_queries = require(\"../utils/api/update-queries.cjs\");\n//#region src/api/invites.ts\nvar dataType = \"InvitesResponseType\";\nvar useBrowseInvites = require_utils_api_hooks.createInfiniteQuery({\n\tdataType,\n\tpath: \"/invites/\",\n\tpermissions: [\"Owner\", \"Administrator\"],\n\tdefaultSearchParams: {\n\t\tlimit: \"100\",\n\t\tinclude: \"roles\"\n\t},\n\tdefaultNextPageParams: (lastPage, otherParams) => ({\n\t\t...otherParams,\n\t\tpage: (lastPage.meta?.pagination.next || 1).toString()\n\t}),\n\treturnData: (originalData) => {\n\t\tconst { pages } = originalData;\n\t\tconst invites = pages.flatMap((page) => page.invites);\n\t\tconst meta = pages[pages.length - 1].meta;\n\t\treturn {\n\t\t\tinvites,\n\t\t\tmeta,\n\t\t\tisEnd: meta ? meta.pagination.pages === meta.pagination.page : true\n\t\t};\n\t}\n});\nvar useAddInvite = require_utils_api_hooks.createMutation({\n\tmethod: \"POST\",\n\tpath: () => \"/invites/\",\n\tbody: ({ email, roleId }) => ({ invites: [{\n\t\temail,\n\t\trole_id: roleId,\n\t\texpires: null,\n\t\tstatus: null,\n\t\ttoken: null\n\t}] }),\n\tupdateQueries: {\n\t\tdataType,\n\t\temberUpdateType: \"createOrUpdate\",\n\t\tupdate: require_utils_api_update_queries.insertToQueryCache(\"invites\")\n\t}\n});\nvar useDeleteInvite = require_utils_api_hooks.createMutation({\n\tpath: (id) => `/invites/${id}/`,\n\tmethod: \"DELETE\",\n\tupdateQueries: {\n\t\tdataType,\n\t\temberUpdateType: \"delete\",\n\t\tupdate: require_utils_api_update_queries.deleteFromQueryCache(\"invites\")\n\t}\n});\n//#endregion\nexports.useAddInvite = useAddInvite;\nexports.useBrowseInvites = useBrowseInvites;\nexports.useDeleteInvite = useDeleteInvite;\n\n//# sourceMappingURL=invites.cjs.map","Object.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst require_utils_api_fetch_api = require(\"../utils/api/fetch-api.cjs\");\nconst require_api_current_user = require(\"./current-user.cjs\");\nconst require_utils_api_hooks = require(\"../utils/api/hooks.cjs\");\nrequire(\"../utils/recipient-filter.cjs\");\nconst require_api_users = require(\"./users.cjs\");\nlet _tanstack_react_query = require(\"@tanstack/react-query\");\nlet react = require(\"react\");\n//#region src/api/members.ts\nvar dataType = \"MembersResponseType\";\nvar membersPath = \"/members/\";\nvar memberCountSearchParams = { limit: \"1\" };\nvar getMemberCountQueryKey = () => [dataType, require_utils_api_fetch_api.apiUrl(membersPath, memberCountSearchParams)];\n/**\n* True while any member query is in flight. Callers use this to hold a control\n* disabled across the refetch a mutation invalidates, so it can't be fired\n* again against state the screen hasn't re-rendered yet.\n*\n* Lives here because `dataType` is private to this module: reading the key from\n* a consumer means hand-copying the string, which then breaks silently and\n* without a type error if it ever changes.\n*/\nvar useMembersFetching = () => (0, _tanstack_react_query.useIsFetching)({ queryKey: [dataType] }) > 0;\nvar useBrowseMembers = require_utils_api_hooks.createQuery({\n\tdataType,\n\tpath: membersPath\n});\nvar useBrowseMemberCount = require_utils_api_hooks.createQuery({\n\tdataType,\n\tpath: membersPath,\n\tdefaultSearchParams: memberCountSearchParams\n});\nfunction useMemberCount() {\n\tconst { data: currentUser } = require_api_current_user.useCurrentUser();\n\tconst { data } = useBrowseMemberCount({ enabled: Boolean(currentUser && require_api_users.canManageMembers(currentUser)) });\n\treturn data?.meta?.pagination.total;\n}\nvar MEMBERS_COUNT_STALE_TIME = 60 * 1e3;\nvar noOpMembersCountRefetch = () => Promise.resolve();\nvar useBrowseMembersCountQuery = require_utils_api_hooks.createQuery({\n\tdataType,\n\tpath: membersPath\n});\n/**\n* Number of members matching a filter, consolidated from the Ember\n* `members-count-cache` service + `members-count-fetcher` resource: a browse\n* request with `limit=1` reading `meta.pagination.total`, cached per-filter\n* for 60 seconds. As in Ember, roles that cannot manage members get\n* `count: null` without a request and a nullish filter counts as 0 without a\n* request. A failed request resolves to `count: null` with no error toast —\n* an unreadable count is not a count of zero, and callers render descriptive\n* copy for `null` rather than claiming an audience of none. While the current\n* user is still loading the result has `count: null` and `isLoading: true`,\n* so callers can tell it apart from a role that cannot browse members. The\n* request error and retry are also exposed for callers such as publish limits\n* that cannot safely treat an unreadable count as zero.\n*/\nfunction useMembersCount(filter, { requestOptions } = {}) {\n\tconst currentUserQuery = require_api_current_user.useCurrentUser({ requestOptions });\n\tconst { data: currentUser } = currentUserQuery;\n\tconst canFetch = Boolean(currentUser && require_api_users.canManageMembers(currentUser));\n\tconst enabled = canFetch && filter !== null && filter !== void 0;\n\tconst result = useBrowseMembersCountQuery({\n\t\tsearchParams: {\n\t\t\tfilter: filter ?? \"\",\n\t\t\torder: \"id\",\n\t\t\tlimit: \"1\",\n\t\t\tpage: \"1\"\n\t\t},\n\t\tstaleTime: MEMBERS_COUNT_STALE_TIME,\n\t\tenabled,\n\t\tdefaultErrorHandler: false,\n\t\trequestOptions\n\t});\n\tconst refetchAfterCurrentUserError = async () => {\n\t\tconst refreshedUser = await currentUserQuery.refetch();\n\t\tif (refreshedUser.isSuccess && refreshedUser.data && require_api_users.canManageMembers(refreshedUser.data) && filter !== null && filter !== void 0) return result.refetch();\n\t\treturn refreshedUser;\n\t};\n\tif (currentUserQuery.isError) return {\n\t\tcount: null,\n\t\tisLoading: false,\n\t\tisFetching: currentUserQuery.isFetching,\n\t\terror: currentUserQuery.error,\n\t\trefetch: refetchAfterCurrentUserError\n\t};\n\tif (currentUser === void 0) return {\n\t\tcount: null,\n\t\tisLoading: true,\n\t\tisFetching: false,\n\t\terror: null,\n\t\trefetch: noOpMembersCountRefetch\n\t};\n\tif (!enabled) return {\n\t\tcount: canFetch ? 0 : null,\n\t\tisLoading: false,\n\t\tisFetching: false,\n\t\terror: null,\n\t\trefetch: noOpMembersCountRefetch\n\t};\n\tif (result.isError) return {\n\t\tcount: null,\n\t\tisLoading: false,\n\t\tisFetching: result.isFetching,\n\t\terror: result.error,\n\t\trefetch: result.refetch\n\t};\n\treturn {\n\t\tcount: result.data?.meta?.pagination.total ?? null,\n\t\tisLoading: result.isLoading,\n\t\tisFetching: result.isFetching,\n\t\terror: result.error,\n\t\trefetch: result.refetch\n\t};\n}\nfunction pluralizedCount(count, noun) {\n\treturn `${count.toLocaleString()} ${count === 1 ? noun : `${noun}s`}`;\n}\n/**\n* Human-readable copy for a recipient count, ported from the Ember\n* `members-count-cache#countString` (which fetched the count itself; this\n* pure port takes it from `useMembersCount`, which matches its semantics).\n*/\nfunction membersCountString(filter = \"\", { count, newsletter, hasMultipleNewsletters = false } = {}) {\n\tconst nounSingular = newsletter && hasMultipleNewsletters ? \"subscriber\" : \"member\";\n\tconst nounPlural = `${nounSingular}s`;\n\tconst suffix = newsletter && hasMultipleNewsletters ? ` of ${newsletter.name}` : \"\";\n\tconst filterParts = (newsletter ? filter.replace(newsletter.recipientFilter, \"\").replace(/^\\+\\((.*)\\)$/, \"$1\") : filter).split(\",\");\n\tconst isFree = filterParts.length === 1 && filterParts[0] === \"status:free\";\n\tconst isPaid = filterParts.length === 1 && filterParts[0] === \"status:-free\";\n\tconst isAll = !filter || filterParts.includes(\"status:free\") && filterParts.includes(\"status:-free\");\n\tif (count === void 0 || count === null) {\n\t\tif (isFree) return `all free ${nounPlural}${suffix}`;\n\t\tif (isPaid) return `all paid ${nounPlural}${suffix}`;\n\t\tif (isAll) return `all ${nounPlural}${suffix}`;\n\t\treturn \"a custom members segment\";\n\t}\n\tif (isFree) return pluralizedCount(count, `free ${nounSingular}`) + suffix;\n\tif (isPaid) return pluralizedCount(count, `paid ${nounSingular}`) + suffix;\n\treturn pluralizedCount(count, nounSingular) + suffix;\n}\nvar useAddMember = require_utils_api_hooks.createMutation({\n\tmethod: \"POST\",\n\tpath: () => \"/members/\",\n\tbody: (member) => ({ members: [member] }),\n\tinvalidateQueries: { dataType }\n});\nfunction isImportMembersCompleteResponse(response) {\n\treturn typeof response.meta?.stats?.imported === \"number\";\n}\nfunction buildImportMembersFormData({ file, labels = [], mapping = {} }) {\n\tconst formData = new FormData();\n\tformData.append(\"membersfile\", file);\n\tfor (const label of labels) formData.append(\"labels\", label);\n\tfor (const [key, val] of Object.entries(mapping)) if (typeof val === \"string\") formData.append(`mapping[${key}]`, val);\n\treturn formData;\n}\nvar useImportMembers = require_utils_api_hooks.createMutation({\n\tmethod: \"POST\",\n\tretry: false,\n\tpath: () => \"/members/upload/\",\n\tbody: buildImportMembersFormData,\n\tinvalidateQueries: { dataType }\n});\nvar useMember = require_utils_api_hooks.createQueryWithId({\n\tdataType,\n\tpath: (id) => `/members/${id}/`\n});\nvar useDisableMemberCommenting = require_utils_api_hooks.createMutation({\n\tmethod: \"POST\",\n\tpath: ({ id }) => `/members/${id}/commenting/disable`,\n\tbody: ({ reason, hideComments }) => ({\n\t\treason,\n\t\thide_comments: hideComments\n\t}),\n\tinvalidateQueries: { dataType: [\"CommentsResponseType\", dataType] }\n});\nvar useEnableMemberCommenting = require_utils_api_hooks.createMutation({\n\tmethod: \"POST\",\n\tpath: ({ id }) => `/members/${id}/commenting/enable`,\n\tbody: () => ({}),\n\tinvalidateQueries: { dataType: [\"CommentsResponseType\", dataType] }\n});\nvar useBrowseMembersInfiniteQuery = require_utils_api_hooks.createInfiniteQuery({\n\tdataType,\n\tpath: membersPath,\n\tdefaultSearchParams: {\n\t\tinclude: \"labels,tiers\",\n\t\tlimit: \"100\",\n\t\torder: \"created_at desc\"\n\t},\n\tdefaultNextPageParams: (lastPage, otherParams) => {\n\t\tif (!lastPage.meta?.pagination.next) return;\n\t\treturn {\n\t\t\t...otherParams,\n\t\t\tpage: lastPage.meta.pagination.next.toString()\n\t\t};\n\t},\n\treturnData: (originalData) => {\n\t\tconst { pages } = originalData;\n\t\tconst members = pages.flatMap((page) => page.members);\n\t\tconst meta = pages[pages.length - 1].meta;\n\t\treturn {\n\t\t\tmembers,\n\t\t\tmeta,\n\t\t\tisEnd: meta ? meta.pagination.pages === meta.pagination.page : true\n\t\t};\n\t}\n});\nfunction isUnfilteredMemberList(searchParams) {\n\treturn !searchParams?.filter && !searchParams?.search;\n}\n/**\n* Keeps the sidebar member-count cache consistent with the members list without\n* an extra request. The list hook owns this reconciliation because it is the\n* only place that knows both whether the query is filtered and how fresh its\n* data is.\n*\n* It only updates the count query if it already exists, and never overwrites a\n* count that was fetched more recently than the list.\n*/\nfunction useSyncMemberCountFromList(result, searchParams) {\n\tconst queryClient = (0, _tanstack_react_query.useQueryClient)();\n\tconst listTotal = result.data?.meta?.pagination?.total;\n\tconst listIsUnfiltered = isUnfilteredMemberList(searchParams);\n\t(0, react.useEffect)(() => {\n\t\tif (!(listIsUnfiltered && !result.isError && !result.isPlaceholderData && typeof listTotal === \"number\")) return;\n\t\tconst memberCountQueryKey = getMemberCountQueryKey();\n\t\tconst memberCountQueryState = queryClient.getQueryState(memberCountQueryKey);\n\t\tconst memberCountData = memberCountQueryState?.data;\n\t\tconst cachedPagination = memberCountData?.meta?.pagination;\n\t\tif (!memberCountQueryState || !memberCountData || !cachedPagination) return;\n\t\tconst sidebarCountMatchesList = cachedPagination.total === listTotal;\n\t\tconst listIsAtLeastAsFresh = memberCountQueryState.dataUpdatedAt <= result.dataUpdatedAt;\n\t\tif (sidebarCountMatchesList || !listIsAtLeastAsFresh) return;\n\t\tqueryClient.setQueryData(memberCountQueryKey, {\n\t\t\t...memberCountData,\n\t\t\tmeta: {\n\t\t\t\t...memberCountData.meta,\n\t\t\t\tpagination: {\n\t\t\t\t\t...cachedPagination,\n\t\t\t\t\ttotal: listTotal\n\t\t\t\t}\n\t\t\t}\n\t\t}, { updatedAt: result.dataUpdatedAt });\n\t}, [\n\t\tqueryClient,\n\t\tlistIsUnfiltered,\n\t\tlistTotal,\n\t\tresult.dataUpdatedAt,\n\t\tresult.isError,\n\t\tresult.isPlaceholderData\n\t]);\n}\nfunction useBrowseMembersInfinite(options = {}) {\n\tconst result = useBrowseMembersInfiniteQuery(options);\n\tuseSyncMemberCountFromList(result, options.searchParams);\n\treturn result;\n}\nfunction buildBulkMemberSearchParams({ filter, search, all }) {\n\tif (!all && !filter && !search) throw new Error(\"Bulk operation requires a filter, search, or all flag\");\n\tconst params = {};\n\tif (all) params.all = \"true\";\n\tif (filter) params.filter = filter;\n\tif (search) params.search = search;\n\treturn params;\n}\nvar useBulkEditMembers = require_utils_api_hooks.createMutation({\n\tmethod: \"PUT\",\n\tpath: () => \"/members/bulk/\",\n\tbody: ({ action }) => ({ bulk: {\n\t\taction: action.type,\n\t\tmeta: action.meta || {},\n\t\tnewsletter: action.newsletter\n\t} }),\n\tsearchParams: buildBulkMemberSearchParams,\n\tinvalidateQueries: { dataType }\n});\nvar useBulkDeleteMembers = require_utils_api_hooks.createMutation({\n\tmethod: \"DELETE\",\n\tpath: () => \"/members/\",\n\tsearchParams: buildBulkMemberSearchParams,\n\tinvalidateQueries: { dataType }\n});\nvar useEditMember = require_utils_api_hooks.createMutation({\n\tmethod: \"PUT\",\n\tpath: ({ id }) => `/members/${id}/`,\n\tsearchParams: () => ({ include: \"tiers,metafields\" }),\n\tbody: ({ id, ...rest }) => ({ members: [{\n\t\tid,\n\t\t...rest\n\t}] }),\n\tinvalidateQueries: { dataType }\n});\nvar useDeleteMember = require_utils_api_hooks.createMutation({\n\tmethod: \"DELETE\",\n\tpath: ({ id }) => `/members/${id}/`,\n\tsearchParams: ({ cancel }) => ({ cancel: cancel ? \"true\" : \"false\" }),\n\tinvalidateQueries: { dataType }\n});\nvar useMemberSigninUrl = require_utils_api_hooks.createQueryWithId({\n\tdataType: \"MemberSigninUrlResponseType\",\n\tpath: (id) => `/members/${id}/signin_urls/`,\n\treturnData: (originalData) => {\n\t\treturn originalData.member_signin_urls?.[0] ?? {\n\t\t\tmember_id: \"\",\n\t\t\turl: \"\"\n\t\t};\n\t}\n});\nvar useMemberLogout = require_utils_api_hooks.createMutation({\n\tmethod: \"DELETE\",\n\tpath: ({ id }) => `/members/${id}/sessions/`,\n\tinvalidateQueries: { dataType }\n});\nvar useEditMemberSubscription = require_utils_api_hooks.createMutation({\n\tmethod: \"PUT\",\n\tpath: ({ memberId, subscriptionId }) => `/members/${memberId}/subscriptions/${subscriptionId}/`,\n\tbody: ({ cancelAtPeriodEnd, status }) => ({\n\t\t...cancelAtPeriodEnd !== void 0 ? { cancel_at_period_end: cancelAtPeriodEnd } : {},\n\t\t...status ? { status } : {}\n\t}),\n\tinvalidateQueries: { dataType }\n});\nvar useRemoveMemberEmailSuppression = require_utils_api_hooks.createMutation({\n\tmethod: \"DELETE\",\n\tpath: ({ id }) => `/members/${id}/suppression/`,\n\tinvalidateQueries: { dataType }\n});\nvar MEMBER_ACTIVITY_LIMIT = \"20\";\nfunction memberEventsCursor(events) {\n\tconst createdAt = events[events.length - 1]?.data?.created_at;\n\tif (!createdAt) return;\n\treturn new Date(createdAt).toISOString().slice(0, 19).replace(\"T\", \" \");\n}\nfunction buildMemberEventsFilter(memberId) {\n\treturn `data.member_id:'${memberId}'`;\n}\nvar useMemberActivityFeedQuery = require_utils_api_hooks.createInfiniteQuery({\n\tdataType: \"MemberActivityFeedResponseType\",\n\tpath: \"/members/events/\",\n\tdefaultSearchParams: { limit: MEMBER_ACTIVITY_LIMIT },\n\tdefaultNextPageParams: (lastPage, otherParams) => {\n\t\tconst limit = Number(otherParams.limit ?? MEMBER_ACTIVITY_LIMIT);\n\t\tconst cursor = memberEventsCursor(lastPage.events);\n\t\tif (!cursor || lastPage.events.length < limit) return;\n\t\treturn {\n\t\t\t...otherParams,\n\t\t\tfilter: `data.created_at:<'${cursor}'+${otherParams.filter ?? \"\"}`\n\t\t};\n\t},\n\treturnData: (originalData) => {\n\t\tconst { pages } = originalData;\n\t\tconst events = pages.flatMap((page) => page.events);\n\t\tconst lastPage = pages[pages.length - 1];\n\t\tconst paginationLimit = lastPage?.meta?.pagination?.limit;\n\t\tconst effectiveLimit = typeof paginationLimit === \"number\" ? paginationLimit : Number(MEMBER_ACTIVITY_LIMIT);\n\t\treturn {\n\t\t\tevents,\n\t\t\tmeta: lastPage?.meta,\n\t\t\tisEnd: (lastPage?.events.length ?? 0) < effectiveLimit\n\t\t};\n\t}\n});\nfunction useMemberActivityFeed(memberId, options = {}) {\n\tconst { limit = MEMBER_ACTIVITY_LIMIT, enabled } = options;\n\treturn useMemberActivityFeedQuery({\n\t\tsearchParams: {\n\t\t\tfilter: buildMemberEventsFilter(memberId),\n\t\t\tlimit\n\t\t},\n\t\t...enabled !== void 0 ? { enabled } : {}\n\t});\n}\n//#endregion\nexports.getMemberCountQueryKey = getMemberCountQueryKey;\nexports.isImportMembersCompleteResponse = isImportMembersCompleteResponse;\nexports.membersCountString = membersCountString;\nexports.useAddMember = useAddMember;\nexports.useBrowseMembers = useBrowseMembers;\nexports.useBrowseMembersInfinite = useBrowseMembersInfinite;\nexports.useBulkDeleteMembers = useBulkDeleteMembers;\nexports.useBulkEditMembers = useBulkEditMembers;\nexports.useDeleteMember = useDeleteMember;\nexports.useDisableMemberCommenting = useDisableMemberCommenting;\nexports.useEditMember = useEditMember;\nexports.useEditMemberSubscription = useEditMemberSubscription;\nexports.useEnableMemberCommenting = useEnableMemberCommenting;\nexports.useImportMembers = useImportMembers;\nexports.useMember = useMember;\nexports.useMemberActivityFeed = useMemberActivityFeed;\nexports.useMemberCount = useMemberCount;\nexports.useMemberLogout = useMemberLogout;\nexports.useMemberSigninUrl = useMemberSigninUrl;\nexports.useMembersCount = useMembersCount;\nexports.useMembersFetching = useMembersFetching;\nexports.useRemoveMemberEmailSuppression = useRemoveMemberEmailSuppression;\n\n//# sourceMappingURL=members.cjs.map","Object.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst require_utils_api_hooks = require(\"../utils/api/hooks.cjs\");\nconst require_utils_api_update_queries = require(\"../utils/api/update-queries.cjs\");\nlet zod = require(\"zod\");\n//#region src/api/newsletters.ts\nvar NewsletterSchema = zod.z.object({\n\tid: zod.z.string(),\n\tuuid: zod.z.string(),\n\tname: zod.z.string(),\n\tdescription: zod.z.string().nullable(),\n\tfeedback_enabled: zod.z.boolean(),\n\tslug: zod.z.string(),\n\tsender_name: zod.z.string().nullable(),\n\tsender_email: zod.z.string().nullable(),\n\tsender_reply_to: zod.z.string(),\n\tstatus: zod.z.string(),\n\tvisibility: zod.z.string(),\n\tsubscribe_on_signup: zod.z.boolean(),\n\tsort_order: zod.z.number(),\n\theader_image: zod.z.string().nullable(),\n\tshow_header_icon: zod.z.boolean(),\n\tshow_header_title: zod.z.boolean(),\n\ttitle_font_category: zod.z.string(),\n\ttitle_font_weight: zod.z.string(),\n\ttitle_alignment: zod.z.string(),\n\tshow_excerpt: zod.z.boolean(),\n\tshow_feature_image: zod.z.boolean(),\n\tbody_font_category: zod.z.string(),\n\tfooter_content: zod.z.string().nullable(),\n\tshow_badge: zod.z.boolean(),\n\tshow_header_name: zod.z.boolean(),\n\tshow_post_title_section: zod.z.boolean(),\n\tshow_comment_cta: zod.z.boolean(),\n\tshow_share_button: zod.z.boolean(),\n\tshow_subscription_details: zod.z.boolean(),\n\tshow_latest_posts: zod.z.boolean(),\n\tbackground_color: zod.z.string(),\n\theader_background_color: zod.z.string(),\n\tbutton_color: zod.z.string().nullable(),\n\tlink_color: zod.z.string().nullable(),\n\tpost_title_color: zod.z.string().nullable(),\n\tsection_title_color: zod.z.string().nullable(),\n\tdivider_color: zod.z.string().nullable(),\n\tbutton_corners: zod.z.string().nullable(),\n\tbutton_style: zod.z.string().nullable(),\n\timage_corners: zod.z.string().nullable(),\n\tlink_style: zod.z.string().nullable(),\n\tdivider_style: zod.z.string().nullish(),\n\tcreated_at: zod.z.string(),\n\tupdated_at: zod.z.string().nullable(),\n\tcount: zod.z.object({\n\t\tposts: zod.z.number().optional(),\n\t\tactive_members: zod.z.number().optional()\n\t}).optional()\n});\nvar NewslettersMetaSchema = zod.z.object({\n\tcapabilities: zod.z.object({ dislikes: zod.z.boolean().optional() }).optional(),\n\tpagination: zod.z.object({\n\t\tpage: zod.z.number(),\n\t\tlimit: zod.z.union([zod.z.number(), zod.z.literal(\"all\")]),\n\t\tpages: zod.z.number(),\n\t\ttotal: zod.z.number(),\n\t\tnext: zod.z.number().nullable(),\n\t\tprev: zod.z.number().nullable()\n\t})\n});\nvar NewslettersResponseSchema = zod.z.object({\n\tmeta: NewslettersMetaSchema.optional(),\n\tnewsletters: zod.z.array(NewsletterSchema)\n});\nvar dataType = \"NewslettersResponseType\";\nvar newslettersDataType = dataType;\nvar useBrowseNewsletters = require_utils_api_hooks.createInfiniteQuery({\n\tdataType,\n\tpath: \"/newsletters/\",\n\tparseResponse: (data) => NewslettersResponseSchema.parse(data),\n\tdefaultSearchParams: {\n\t\tinclude: \"count.active_members,count.posts\",\n\t\tlimit: \"50\"\n\t},\n\tdefaultNextPageParams: (lastPage, otherParams) => {\n\t\tconst nextPage = lastPage.meta?.pagination.next;\n\t\tif (!nextPage) return;\n\t\treturn {\n\t\t\t...otherParams,\n\t\t\tpage: nextPage.toString()\n\t\t};\n\t},\n\treturnData: (originalData) => {\n\t\tconst { pages } = originalData;\n\t\tconst newsletters = pages.flatMap((page) => page.newsletters);\n\t\tconst meta = pages[pages.length - 1].meta;\n\t\treturn {\n\t\t\tnewsletters,\n\t\t\tmeta,\n\t\t\tisEnd: meta ? meta.pagination.pages === meta.pagination.page : true\n\t\t};\n\t}\n});\nvar useAddNewsletter = require_utils_api_hooks.createMutation({\n\tmethod: \"POST\",\n\tpath: () => \"/newsletters/\",\n\tbody: ({ opt_in_existing: _, ...newsletter }) => ({ newsletters: [newsletter] }),\n\tsearchParams: (payload) => ({\n\t\topt_in_existing: payload.opt_in_existing.toString(),\n\t\tinclude: \"count.active_members,count.posts\"\n\t}),\n\tupdateQueries: {\n\t\tdataType,\n\t\temberUpdateType: \"createOrUpdate\",\n\t\tupdate: require_utils_api_update_queries.insertToQueryCache(\"newsletters\")\n\t}\n});\nvar useEditNewsletter = require_utils_api_hooks.createMutation({\n\tmethod: \"PUT\",\n\tpath: (newsletter) => `/newsletters/${newsletter.id}/`,\n\tbody: (newsletter) => ({ newsletters: [newsletter] }),\n\tdefaultSearchParams: { include: \"count.active_members,count.posts\" },\n\tupdateQueries: {\n\t\tdataType,\n\t\temberUpdateType: \"createOrUpdate\",\n\t\tupdate: require_utils_api_update_queries.updateQueryCache(\"newsletters\")\n\t}\n});\nvar useVerifyNewsletterEmail = require_utils_api_hooks.createMutation({\n\tmethod: \"PUT\",\n\tpath: () => \"/newsletters/verifications/\",\n\tbody: ({ token }) => ({ token }),\n\tdefaultSearchParams: { include: \"count.active_members,count.posts\" },\n\tupdateQueries: {\n\t\tdataType,\n\t\temberUpdateType: \"createOrUpdate\",\n\t\tupdate: require_utils_api_update_queries.updateQueryCache(\"newsletters\")\n\t}\n});\n//#endregion\nexports.NewsletterSchema = NewsletterSchema;\nexports.NewslettersResponseSchema = NewslettersResponseSchema;\nexports.newslettersDataType = newslettersDataType;\nexports.useAddNewsletter = useAddNewsletter;\nexports.useBrowseNewsletters = useBrowseNewsletters;\nexports.useEditNewsletter = useEditNewsletter;\nexports.useVerifyNewsletterEmail = useVerifyNewsletterEmail;\n\n//# sourceMappingURL=newsletters.cjs.map","Object.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst require_utils_api_hooks = require(\"../utils/api/hooks.cjs\");\nconst require_utils_api_update_queries = require(\"../utils/api/update-queries.cjs\");\nlet _tanstack_react_query = require(\"@tanstack/react-query\");\n//#region src/api/offers.ts\nvar dataType = \"OffersResponseType\";\nvar useInvalidateOffers = () => {\n\tconst queryClient = (0, _tanstack_react_query.useQueryClient)();\n\treturn () => {\n\t\treturn queryClient.invalidateQueries({ queryKey: [dataType] });\n\t};\n};\nvar useBrowseOffers = require_utils_api_hooks.createQuery({\n\tdataType,\n\tpath: \"/offers/\",\n\tdefaultSearchParams: {}\n});\nvar useBrowseOffersById = require_utils_api_hooks.createQueryWithId({\n\tdataType,\n\tpath: (id) => `/offers/${id}/`\n});\nvar useEditOffer = require_utils_api_hooks.createMutation({\n\tmethod: \"PUT\",\n\tpath: (offer) => `/offers/${offer.id}/`,\n\tbody: (offer) => ({ offers: [offer] }),\n\tupdateQueries: {\n\t\tdataType,\n\t\temberUpdateType: \"createOrUpdate\",\n\t\tupdate: require_utils_api_update_queries.updateQueryCache(\"offers\")\n\t}\n});\nvar useAddOffer = require_utils_api_hooks.createMutation({\n\tmethod: \"POST\",\n\tpath: () => \"/offers/\",\n\tbody: (offer) => ({ offers: [offer] }),\n\tupdateQueries: {\n\t\tdataType,\n\t\temberUpdateType: \"createOrUpdate\",\n\t\tupdate: require_utils_api_update_queries.insertToQueryCache(\"offers\")\n\t}\n});\n//#endregion\nexports.useAddOffer = useAddOffer;\nexports.useBrowseOffers = useBrowseOffers;\nexports.useBrowseOffersById = useBrowseOffersById;\nexports.useEditOffer = useEditOffer;\nexports.useInvalidateOffers = useInvalidateOffers;\n\n//# sourceMappingURL=offers.cjs.map","Object.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\n//#region src/api/post-contract.ts\n/**\n* Request contract for post/page reads and writes against the Admin API.\n*\n* The Ember editor's adapters and serializers are the spec here — these\n* builders must produce the same query params and payload shapes as\n* `apps/ember-admin/app/adapters/post.js`, `adapters/page.js` and\n* `serializers/post.js`/`page.js` so the API sees identical requests from\n* either client.\n*/\n/**\n* Posts/pages include all relations by default on reads, but create/update\n* responses only include what is explicitly requested — so writes re-request\n* everything, including `post_revisions` for the client-side revision compare.\n*/\nvar ALL_POST_INCLUDES = [\n\t\"tags\",\n\t\"authors\",\n\t\"authors.roles\",\n\t\"email\",\n\t\"tiers\",\n\t\"newsletter\",\n\t\"count.clicks\",\n\t\"post_revisions\",\n\t\"post_revisions.author\"\n].join(\",\");\n/** Every post/page request asks for both content formats. */\nvar POST_FORMATS = \"mobiledoc,lexical\";\nvar ALL_MEMBERS_SEGMENT = \"status:free,status:-free\";\nfunction buildPostReadParams() {\n\treturn { formats: POST_FORMATS };\n}\n/** Editor reads additionally need revision history and its author relation. */\nfunction buildPostEditorReadParams() {\n\treturn {\n\t\tformats: POST_FORMATS,\n\t\tinclude: ALL_POST_INCLUDES\n\t};\n}\n/** Query params for post create/update requests. */\nfunction buildPostWriteParams(options = {}) {\n\tconst params = { formats: POST_FORMATS };\n\tif (options.source) params.source = options.source;\n\tif (options.newsletter) {\n\t\tparams.newsletter = options.newsletter;\n\t\tif (options.emailSegment) params.email_segment = options.emailSegment === ALL_MEMBERS_SEGMENT ? \"all\" : options.emailSegment;\n\t}\n\tif (options.saveRevision) params.save_revision = \"true\";\n\tif (options.convertToLexical) params.convert_to_lexical = \"true\";\n\tparams.include = ALL_POST_INCLUDES;\n\treturn params;\n}\n/** Query params for page create/update requests — as posts, minus email delivery. */\nfunction buildPageWriteParams(options = {}) {\n\tconst params = { formats: POST_FORMATS };\n\tif (options.source) params.source = options.source;\n\tif (options.saveRevision) params.save_revision = \"true\";\n\tif (options.convertToLexical) params.convert_to_lexical = \"true\";\n\tparams.include = ALL_POST_INCLUDES;\n\treturn params;\n}\nvar READ_ONLY_POST_FIELDS = [\n\t\"author_id\",\n\t\"uuid\",\n\t\"url\",\n\t\"send_email_when_published\",\n\t\"email_recipient_filter\",\n\t\"email\",\n\t\"newsletter\",\n\t\"post_revisions\",\n\t\"author\"\n];\nvar POST_ONLY_FIELDS = [\n\t\"email_subject\",\n\t\"email_only\",\n\t\"email_id\"\n];\n/**\n* Shape an editable post/page into the exact payload the API expects: strips\n* read-only and virtual fields and resolves the visibility/tiers coupling\n* (tiers only accompany `visibility: 'tiers'`, and an empty tiers selection\n* means \"leave visibility unchanged\").\n*/\nfunction serializePostPayload(data, resource = \"post\") {\n\tconst json = { ...data };\n\tfor (const field of READ_ONLY_POST_FIELDS) delete json[field];\n\tif (resource === \"page\") for (const field of POST_ONLY_FIELDS) delete json[field];\n\telse delete json.show_title_and_feature_image;\n\tif (json.visibility === null) {\n\t\tdelete json.visibility;\n\t\tdelete json.visibility_filter;\n\t\tdelete json.tiers;\n\t}\n\tif (json.visibility === \"tiers\") delete json.visibility_filter;\n\tif (json.visibility === \"tiers\" && !json.tiers?.length) {\n\t\tdelete json.visibility;\n\t\tdelete json.tiers;\n\t}\n\treturn json;\n}\n//#endregion\nexports.ALL_POST_INCLUDES = ALL_POST_INCLUDES;\nexports.POST_FORMATS = POST_FORMATS;\nexports.buildPageWriteParams = buildPageWriteParams;\nexports.buildPostEditorReadParams = buildPostEditorReadParams;\nexports.buildPostReadParams = buildPostReadParams;\nexports.buildPostWriteParams = buildPostWriteParams;\nexports.serializePostPayload = serializePostPayload;\n\n//# sourceMappingURL=post-contract.cjs.map","Object.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst require_utils_api_hooks = require(\"../utils/api/hooks.cjs\");\nconst require_api_post_contract = require(\"./post-contract.cjs\");\n//#region src/api/posts.ts\nvar dataType = \"PostsResponseType\";\nvar postsDataType = dataType;\nvar useBrowsePosts = require_utils_api_hooks.createQuery({\n\tdataType,\n\tpath: \"/posts/\"\n});\nvar useBrowsePostsInfinite = require_utils_api_hooks.createInfiniteQuery({\n\tdataType,\n\tpath: \"/posts/\",\n\tdefaultNextPageParams: (lastPage, otherParams) => {\n\t\tif (!lastPage.meta?.pagination.next) return;\n\t\treturn {\n\t\t\t...otherParams,\n\t\t\tpage: lastPage.meta.pagination.next.toString()\n\t\t};\n\t},\n\treturnData: (originalData) => {\n\t\tconst { pages } = originalData;\n\t\tconst posts = pages.flatMap((page) => page.posts);\n\t\tconst meta = pages[pages.length - 1].meta;\n\t\treturn {\n\t\t\tposts,\n\t\t\tmeta,\n\t\t\tisEnd: meta ? meta.pagination.pages === meta.pagination.page : true\n\t\t};\n\t}\n});\nvar usePostQuery = require_utils_api_hooks.createQueryWithId({\n\tdataType,\n\tpath: (id) => `/posts/${id}/`\n});\nvar usePost = (id, options = {}) => {\n\tconst { searchParams, ...queryOptions } = options;\n\treturn usePostQuery(id, {\n\t\t...queryOptions,\n\t\tsearchParams: {\n\t\t\t...require_api_post_contract.buildPostReadParams(),\n\t\t\t...searchParams\n\t\t}\n\t});\n};\nvar useEditorPostQuery = require_utils_api_hooks.createQueryWithId({\n\tdataType,\n\tpath: (id) => `/posts/${id}/`\n});\nvar useEditorPost = (id, options = {}) => {\n\tconst { searchParams, ...queryOptions } = options;\n\treturn useEditorPostQuery(id, {\n\t\t...queryOptions,\n\t\tsearchParams: {\n\t\t\t...searchParams,\n\t\t\t...require_api_post_contract.buildPostEditorReadParams()\n\t\t}\n\t});\n};\nvar useAddPost = require_utils_api_hooks.createMutation({\n\tmethod: \"POST\",\n\tpath: () => \"/posts/\",\n\tsearchParams: ({ options }) => require_api_post_contract.buildPostWriteParams(options),\n\tbody: ({ post }) => ({ posts: [require_api_post_contract.serializePostPayload(post)] }),\n\trequestOptions: ({ sessionExpiryRedirect }) => ({ sessionExpiryRedirect }),\n\tinvalidateQueries: { dataType }\n});\nvar useEditPost = require_utils_api_hooks.createMutation({\n\tmethod: \"PUT\",\n\tpath: ({ post }) => `/posts/${post.id}/`,\n\tsearchParams: ({ options }) => require_api_post_contract.buildPostWriteParams(options),\n\tbody: ({ post }) => ({ posts: [require_api_post_contract.serializePostPayload(post)] }),\n\trequestOptions: ({ sessionExpiryRedirect }) => ({ sessionExpiryRedirect }),\n\tinvalidateQueries: { dataType }\n});\nvar useDeletePost = require_utils_api_hooks.createMutation({\n\tmethod: \"DELETE\",\n\tpath: ({ id }) => `/posts/${id}/`,\n\trequestOptions: ({ sessionExpiryRedirect }) => ({ sessionExpiryRedirect })\n});\n/**\n* Bulk-edit posts matching an NQL filter.\n*\n* The filter is the point: after Cmd+A the selection is inverted and covers\n* posts that were never loaded, so the action has to be expressed as a query\n* rather than as a list of ids.\n*/\nvar useBulkEditPosts = require_utils_api_hooks.createMutation({\n\tmethod: \"PUT\",\n\tpath: () => \"/posts/bulk/\",\n\tsearchParams: ({ filter }) => ({ filter }),\n\tbody: ({ action }) => ({ bulk: {\n\t\taction: action.type,\n\t\tmeta: \"meta\" in action ? action.meta : {}\n\t} })\n});\n/** Bulk-delete posts matching an NQL filter. */\nvar useBulkDeletePosts = require_utils_api_hooks.createMutation({\n\tmethod: \"DELETE\",\n\tpath: () => \"/posts/\",\n\tsearchParams: ({ filter }) => ({ filter })\n});\n/**\n* Duplicate a post. The copy is always a draft, whatever the source was, so\n* callers place it at the top of the list rather than beside its original.\n*/\nvar useCopyPost = require_utils_api_hooks.createMutation({\n\tmethod: \"POST\",\n\tpath: (id) => `/posts/${id}/copy/`\n});\nvar useImportContentCSV = require_utils_api_hooks.createMutation({\n\tmethod: \"POST\",\n\tretry: false,\n\tpath: () => \"/posts/upload/\",\n\tbody: ({ file, mapping }) => {\n\t\tconst formData = new FormData();\n\t\tformData.append(\"postsfile\", file);\n\t\tfor (const [header, field] of Object.entries(mapping)) formData.append(`mapping[${header}]`, field);\n\t\treturn formData;\n\t}\n});\n//#endregion\nexports.postsDataType = postsDataType;\nexports.useAddPost = useAddPost;\nexports.useBrowsePosts = useBrowsePosts;\nexports.useBrowsePostsInfinite = useBrowsePostsInfinite;\nexports.useBulkDeletePosts = useBulkDeletePosts;\nexports.useBulkEditPosts = useBulkEditPosts;\nexports.useCopyPost = useCopyPost;\nexports.useDeletePost = useDeletePost;\nexports.useEditPost = useEditPost;\nexports.useEditorPost = useEditorPost;\nexports.useImportContentCSV = useImportContentCSV;\nexports.usePost = usePost;\n\n//# sourceMappingURL=posts.cjs.map","Object.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nvar useBrowseRoles = require(\"../utils/api/hooks.cjs\").createQuery({\n\tdataType: \"RolesResponseType\",\n\tpath: \"/roles/\",\n\tdefaultSearchParams: { limit: \"100\" }\n});\n//#endregion\nexports.useBrowseRoles = useBrowseRoles;\n\n//# sourceMappingURL=roles.cjs.map","Object.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst require_utils_api_hooks = require(\"../utils/api/hooks.cjs\");\n//#region src/api/settings.ts\nvar dataType = \"SettingsResponseType\";\nvar useBrowseSettings = require_utils_api_hooks.createQuery({\n\tdataType,\n\tpath: \"/settings/\",\n\tdefaultSearchParams: { group: \"site,theme,private,members,portal,newsletter,email,labs,slack,unsplash,views,firstpromoter,editor,comments,analytics,announcement,pintura,donations,security,social_web,explore,transistor\" }\n});\nvar useEditSettings = require_utils_api_hooks.createMutation({\n\tmethod: \"PUT\",\n\tpath: () => \"/settings/\",\n\tbody: (settings) => ({ settings: settings.map(({ key, value }) => ({\n\t\tkey,\n\t\tvalue\n\t})) }),\n\tupdateQueries: {\n\t\tdataType,\n\t\temberUpdateType: \"createOrUpdate\",\n\t\tupdate: (newData) => ({\n\t\t\t...newData,\n\t\t\tsettings: newData.settings\n\t\t})\n\t},\n\tinvalidateQueries: { filters: { predicate(query) {\n\t\treturn query.queryKey[0] !== dataType;\n\t} } }\n});\nvar useRegenerateAccessCode = require_utils_api_hooks.createMutation({\n\tmethod: \"POST\",\n\tpath: () => \"/settings/access_code/regenerate/\",\n\tupdateQueries: {\n\t\tdataType,\n\t\temberUpdateType: \"createOrUpdate\",\n\t\tupdate: (newData) => ({\n\t\t\t...newData,\n\t\t\tsettings: newData.settings\n\t\t})\n\t},\n\tinvalidateQueries: { filters: { predicate(query) {\n\t\treturn query.queryKey[0] !== dataType;\n\t} } }\n});\nvar useDeleteStripeSettings = require_utils_api_hooks.createMutation({\n\tmethod: \"DELETE\",\n\tpath: () => \"/settings/stripe/connect/\",\n\tinvalidateQueries: { dataType }\n});\nvar useTestSlack = require_utils_api_hooks.createMutation({\n\tmethod: \"POST\",\n\tpath: () => \"/slack/test/\"\n});\nfunction humanizeSettingKey(key) {\n\treturn key.replace(/^[a-z]/, (char) => char.toUpperCase()).replace(/_/g, \" \").replace(new RegExp(`\\\\b(${[\n\t\t\"API\",\n\t\t\"CTA\",\n\t\t\"RSS\"\n\t].join(\"|\")})\\\\b`, \"ig\"), (match) => match.toUpperCase());\n}\nfunction getSettingValues(settings, keys) {\n\treturn keys.map((key) => settings?.find((setting) => setting.key === key)?.value);\n}\nfunction getSettingValue(settings, key) {\n\tif (!settings) return null;\n\treturn settings.find((d) => d.key === key)?.value || null;\n}\nfunction isSettingReadOnly(settings, key) {\n\tif (!settings) return;\n\treturn settings.find((d) => d.key === key)?.is_read_only || false;\n}\nfunction useSettings({ requestOptions } = {}) {\n\tconst { data } = useBrowseSettings({ requestOptions });\n\treturn data?.settings;\n}\nfunction usePaidMembersEnabled(options) {\n\tconst settings = useSettings(options);\n\tif (!settings) return;\n\treturn getSettingValue(settings, \"paid_members_enabled\") ?? false;\n}\nfunction useNewslettersEnabled(options) {\n\tconst settings = useSettings(options);\n\tif (!settings) return;\n\treturn getSettingValue(settings, \"editor_default_email_recipients\") !== \"disabled\";\n}\nfunction useMembersTrackSources() {\n\tconst settings = useSettings();\n\tif (!settings) return;\n\treturn getSettingValue(settings, \"members_track_sources\") ?? false;\n}\nfunction useEmailTrackOpens() {\n\tconst settings = useSettings();\n\tif (!settings) return;\n\treturn getSettingValue(settings, \"email_track_opens\") ?? false;\n}\nfunction useEmailTrackClicks() {\n\tconst settings = useSettings();\n\tif (!settings) return;\n\treturn getSettingValue(settings, \"email_track_clicks\") ?? false;\n}\nfunction useWebAnalyticsEnabled() {\n\tconst settings = useSettings();\n\tif (!settings) return false;\n\treturn getSettingValue(settings, \"web_analytics_enabled\") === true;\n}\nfunction checkStripeEnabled(settings, config) {\n\tconst hasSetting = (key) => settings.some((setting) => setting.key === key && setting.value);\n\tconst hasDirectKeys = hasSetting(\"stripe_secret_key\") && hasSetting(\"stripe_publishable_key\");\n\tconst hasConnectKeys = hasSetting(\"stripe_connect_secret_key\") && hasSetting(\"stripe_connect_publishable_key\");\n\tif (config.stripeDirect) return hasDirectKeys;\n\treturn hasConnectKeys || hasDirectKeys;\n}\n//#endregion\nexports.checkStripeEnabled = checkStripeEnabled;\nexports.getSettingValue = getSettingValue;\nexports.getSettingValues = getSettingValues;\nexports.humanizeSettingKey = humanizeSettingKey;\nexports.isSettingReadOnly = isSettingReadOnly;\nexports.useBrowseSettings = useBrowseSettings;\nexports.useDeleteStripeSettings = useDeleteStripeSettings;\nexports.useEditSettings = useEditSettings;\nexports.useEmailTrackClicks = useEmailTrackClicks;\nexports.useEmailTrackOpens = useEmailTrackOpens;\nexports.useMembersTrackSources = useMembersTrackSources;\nexports.useNewslettersEnabled = useNewslettersEnabled;\nexports.usePaidMembersEnabled = usePaidMembersEnabled;\nexports.useRegenerateAccessCode = useRegenerateAccessCode;\nexports.useTestSlack = useTestSlack;\nexports.useWebAnalyticsEnabled = useWebAnalyticsEnabled;\n\n//# sourceMappingURL=settings.cjs.map","Object.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst require_api_current_user = require(\"./current-user.cjs\");\nconst require_utils_api_hooks = require(\"../utils/api/hooks.cjs\");\nconst require_utils_api_update_queries = require(\"../utils/api/update-queries.cjs\");\n//#region src/api/users.ts\nvar dataType = require_api_current_user.usersDataType;\nvar useBrowseUsers = require_utils_api_hooks.createInfiniteQuery({\n\tdataType,\n\tpath: \"/users/\",\n\tdefaultSearchParams: {\n\t\tlimit: \"100\",\n\t\tinclude: \"roles\"\n\t},\n\tdefaultNextPageParams: (lastPage, otherParams) => {\n\t\tif (!lastPage.meta?.pagination.next) return;\n\t\treturn {\n\t\t\t...otherParams,\n\t\t\tpage: lastPage.meta.pagination.next.toString()\n\t\t};\n\t},\n\treturnData: (originalData) => {\n\t\tconst { pages } = originalData;\n\t\tconst users = pages.flatMap((page) => page.users);\n\t\tconst meta = pages[pages.length - 1].meta;\n\t\treturn {\n\t\t\tusers,\n\t\t\tmeta,\n\t\t\tisEnd: meta ? meta.pagination.pages === meta.pagination.page : true\n\t\t};\n\t}\n});\nvar useGetUserBySlug = require_utils_api_hooks.createQueryWithId({\n\tdataType,\n\tpath: (slug) => `/users/slug/${slug}/`,\n\tdefaultSearchParams: { include: \"roles\" }\n});\nvar useEditUser = require_utils_api_hooks.createMutation({\n\tmethod: \"PUT\",\n\tpath: (user) => `/users/${user.id}/`,\n\tbody: (user) => ({ users: [user] }),\n\tsearchParams: () => ({ include: \"roles\" }),\n\tupdateQueries: {\n\t\tdataType,\n\t\temberUpdateType: \"createOrUpdate\",\n\t\tupdate: require_utils_api_update_queries.updateQueryCache(\"users\")\n\t}\n});\nvar useDeleteUser = require_utils_api_hooks.createMutation({\n\tmethod: \"DELETE\",\n\tpath: (id) => `/users/${id}/`,\n\tupdateQueries: {\n\t\tdataType,\n\t\temberUpdateType: \"delete\",\n\t\tupdate: require_utils_api_update_queries.deleteFromQueryCache(\"users\")\n\t}\n});\nvar useUpdatePassword = require_utils_api_hooks.createMutation({\n\tmethod: \"PUT\",\n\tpath: () => \"/users/password/\",\n\tbody: ({ newPassword, confirmNewPassword, userId, oldPassword }) => ({ password: [{\n\t\tuser_id: userId,\n\t\toldPassword: oldPassword || \"\",\n\t\tnewPassword,\n\t\tne2Password: confirmNewPassword\n\t}] })\n});\nvar useMakeOwner = require_utils_api_hooks.createMutation({\n\tmethod: \"PUT\",\n\tpath: () => \"/users/owner/\",\n\tbody: (userId) => ({ owner: [{ id: userId }] }),\n\tupdateQueries: {\n\t\tdataType,\n\t\temberUpdateType: \"createOrUpdate\",\n\t\tupdate: require_utils_api_update_queries.updateQueryCache(\"users\")\n\t}\n});\nfunction isOwnerUser(user) {\n\treturn user.roles.some((role) => role.name === \"Owner\");\n}\nfunction isAdminUser(user) {\n\treturn user.roles.some((role) => role.name === \"Administrator\");\n}\nfunction isEditorUser(user) {\n\treturn user.roles.some((role) => role.name === \"Editor\") || user.roles.some((role) => role.name === \"Super Editor\");\n}\nfunction isSuperEditorUser(user) {\n\treturn user.roles.some((role) => role.name === \"Super Editor\");\n}\nfunction isAuthorUser(user) {\n\treturn user.roles.some((role) => role.name === \"Author\");\n}\nfunction isContributorUser(user) {\n\treturn user.roles.some((role) => role.name === \"Contributor\");\n}\nfunction isAuthorOrContributor(user) {\n\treturn isAuthorUser(user) || isContributorUser(user);\n}\nfunction canAccessSettings(user) {\n\treturn isOwnerUser(user) || isAdminUser(user) || isEditorUser(user);\n}\nfunction canManageMembers(user) {\n\treturn isOwnerUser(user) || isAdminUser(user) || isSuperEditorUser(user);\n}\nfunction canManageTags(user) {\n\treturn isOwnerUser(user) || isAdminUser(user) || isEditorUser(user);\n}\nfunction canManageGiftLinks(user) {\n\treturn isOwnerUser(user) || isAdminUser(user) || isEditorUser(user);\n}\nfunction hasAdminAccess(user) {\n\treturn isOwnerUser(user) || isAdminUser(user);\n}\nfunction canManageAutomations(user) {\n\treturn isOwnerUser(user) || isAdminUser(user);\n}\n//#endregion\nexports.canAccessSettings = canAccessSettings;\nexports.canManageAutomations = canManageAutomations;\nexports.canManageGiftLinks = canManageGiftLinks;\nexports.canManageMembers = canManageMembers;\nexports.canManageTags = canManageTags;\nexports.hasAdminAccess = hasAdminAccess;\nexports.isAdminUser = isAdminUser;\nexports.isAuthorOrContributor = isAuthorOrContributor;\nexports.isAuthorUser = isAuthorUser;\nexports.isContributorUser = isContributorUser;\nexports.isEditorUser = isEditorUser;\nexports.isOwnerUser = isOwnerUser;\nexports.isSuperEditorUser = isSuperEditorUser;\nexports.useBrowseUsers = useBrowseUsers;\nexports.useDeleteUser = useDeleteUser;\nexports.useEditUser = useEditUser;\nexports.useGetUserBySlug = useGetUserBySlug;\nexports.useMakeOwner = useMakeOwner;\nexports.useUpdatePassword = useUpdatePassword;\n\n//# sourceMappingURL=users.cjs.map","Object.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst require_hooks_use_handle_error = require(\"./hooks/use-handle-error.cjs\");\nconst require_utils_api_fetch_api = require(\"./utils/api/fetch-api.cjs\");\nconst require_hooks_use_confirm_unload = require(\"./hooks/use-confirm-unload.cjs\");\nconst require_hooks_use_form = require(\"./hooks/use-form.cjs\");\nconst require_hooks_use_filterable_api = require(\"./hooks/use-filterable-api.cjs\");\nconst require_hooks_use_koenig_file_upload = require(\"./hooks/use-koenig-file-upload.cjs\");\nconst require_hooks_use_koenig_fetch_embed = require(\"./hooks/use-koenig-fetch-embed.cjs\");\nconst require_hooks_use_koenig_link_suggestions = require(\"./hooks/use-koenig-link-suggestions.cjs\");\nconst require_hooks_use_feature_flag = require(\"./hooks/use-feature-flag.cjs\");\nconst require_hooks_use_host_limits = require(\"./hooks/use-host-limits.cjs\");\nconst require_hooks_use_limiter = require(\"./hooks/use-limiter.cjs\");\nconst require_hooks_use_pintura_config = require(\"./hooks/use-pintura-config.cjs\");\nexports.koenigFileUploadTypes = require_hooks_use_koenig_file_upload.koenigFileUploadTypes;\nexports.useConfirmUnload = require_hooks_use_confirm_unload.useConfirmUnload;\nexports.useFeatureFlag = require_hooks_use_feature_flag.useFeatureFlag;\nexports.useFetchApi = require_utils_api_fetch_api.useFetchApi;\nexports.useFilterableApi = require_hooks_use_filterable_api;\nexports.useForm = require_hooks_use_form;\nexports.useHandleError = require_hooks_use_handle_error;\nexports.useHostLimits = require_hooks_use_host_limits.useHostLimits;\nexports.useKoenigFetchEmbed = require_hooks_use_koenig_fetch_embed.useKoenigFetchEmbed;\nexports.useKoenigFileUpload = require_hooks_use_koenig_file_upload.useKoenigFileUpload;\nexports.useKoenigLinkSuggestions = require_hooks_use_koenig_link_suggestions.useKoenigLinkSuggestions;\nexports.useLimiter = require_hooks_use_limiter.useLimiter;\nexports.usePinturaConfig = require_hooks_use_pintura_config.usePinturaConfig;\n","Object.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst require_rolldown_runtime = require(\"../rolldown-runtime-D6vf50IK.cjs\");\nlet react = require(\"react\");\nreact = require_rolldown_runtime.__toESM(react, 1);\n//#region src/hooks/use-confirm-unload.ts\nfunction useConfirmUnload(shouldConfirmUnload) {\n\treact.useEffect(() => {\n\t\tif (!shouldConfirmUnload) return;\n\t\tconst handleBeforeUnload = (event) => {\n\t\t\tevent.preventDefault();\n\t\t\tevent.returnValue = \"\";\n\t\t};\n\t\twindow.addEventListener(\"beforeunload\", handleBeforeUnload);\n\t\treturn () => {\n\t\t\twindow.removeEventListener(\"beforeunload\", handleBeforeUnload);\n\t\t};\n\t}, [shouldConfirmUnload]);\n}\n//#endregion\nexports.useConfirmUnload = useConfirmUnload;\n\n//# sourceMappingURL=use-confirm-unload.cjs.map","Object.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst require_api_config = require(\"../api/config.cjs\");\nconst require_providers_feature_flag_overrides_context = require(\"../providers/feature-flag-overrides-context.cjs\");\n//#region src/hooks/use-feature-flag.ts\n/**\n* Returns whether a Labs flag is explicitly enabled by config or the current\n* session's URL overrides. Only boolean `true` config values count. Avoids\n* refetching stale config when a feature-gated component mounts.\n*/\nvar useFeatureFlag = (flag, { requestOptions, defaultErrorHandler } = {}) => {\n\tconst { data: config } = require_api_config.useBrowseConfig({\n\t\tdefaultErrorHandler,\n\t\trefetchOnMount: false,\n\t\trequestOptions\n\t});\n\tconst { enabledFlags } = require_providers_feature_flag_overrides_context.useFeatureFlagOverrides();\n\treturn config?.config.labs?.[flag] === true || enabledFlags.includes(flag);\n};\n//#endregion\nexports.useFeatureFlag = useFeatureFlag;\n\n//# sourceMappingURL=use-feature-flag.cjs.map","const require_utils_api_fetch_api = require(\"../utils/api/fetch-api.cjs\");\nlet react = require(\"react\");\nlet _tryghost_nql_string = require(\"@tryghost/nql-string\");\n//#region src/hooks/use-filterable-api.ts\nvar filterData = (data = [], filterKey, input) => {\n\tif (!data || !input) return data;\n\treturn data.filter((item) => item[filterKey]?.toLowerCase().includes(input.toLowerCase()));\n};\nvar useFilterableApi = ({ path, filterKey, responseKey, limit = 20 }) => {\n\tconst fetchApi = require_utils_api_fetch_api.useFetchApi();\n\tconst result = (0, react.useRef)({});\n\tconst loadData = async (input) => {\n\t\tif ((result.current.allLoaded || result.current.lastInput === input) && result.current.data) return filterData(result.current.data, filterKey, input);\n\t\tconst response = await fetchApi(require_utils_api_fetch_api.apiUrl(path, {\n\t\t\tfilter: input ? `${filterKey}:~${(0, _tryghost_nql_string.escapeNqlString)(input)}` : \"\",\n\t\t\tlimit: limit.toString()\n\t\t}));\n\t\tresult.current.data = response[responseKey];\n\t\tresult.current.allLoaded = !input && !response.meta?.pagination.next;\n\t\tresult.current.lastInput = input;\n\t\treturn filterData(response[responseKey], filterKey, input);\n\t};\n\tconst loadInitialValues = async (values, key) => {\n\t\tawait loadData(\"\");\n\t\tconst data = [...result.current.data || []];\n\t\tconst missingValues = values.filter((value) => !result.current.data?.find((item) => item[key] === value));\n\t\tif (missingValues.length) {\n\t\t\tconst additionalData = await fetchApi(require_utils_api_fetch_api.apiUrl(path, {\n\t\t\t\tfilter: `${key}:[${missingValues.join(\",\")}]`,\n\t\t\t\tlimit: \"100\"\n\t\t\t}));\n\t\t\tdata.push(...additionalData[responseKey]);\n\t\t}\n\t\treturn values.map((value) => data.find((item) => item[key] === value));\n\t};\n\treturn {\n\t\tloadData,\n\t\tloadInitialValues\n\t};\n};\n//#endregion\nmodule.exports = useFilterableApi;\n\n//# sourceMappingURL=use-filterable-api.cjs.map","let react = require(\"react\");\n//#region src/hooks/use-form.ts\nvar useForm = ({ initialState, savingDelay, savedDelay = 2e3, onSave, onSaveError, onSavedStateReset: onSaveCompleted, onValidate }) => {\n\tconst [formState, setFormState] = (0, react.useState)(initialState);\n\tconst [saveState, setSaveState] = (0, react.useState)(\"\");\n\tconst [errors, setErrors] = (0, react.useState)({});\n\t(0, react.useEffect)(() => {\n\t\tif (saveState === \"saved\") setTimeout(() => {\n\t\t\tonSaveCompleted?.();\n\t\t\tsetSaveState((state) => state === \"saved\" ? \"\" : state);\n\t\t}, savedDelay);\n\t}, [saveState, savedDelay]);\n\tconst isValid = (errs) => Object.values(errs).filter(Boolean).length === 0;\n\tconst validate = (0, react.useCallback)(() => {\n\t\tif (!onValidate) return true;\n\t\tconst newErrors = onValidate(formState);\n\t\tsetErrors(newErrors);\n\t\treturn isValid(newErrors);\n\t}, [formState, onValidate]);\n\tconst handleSave = (0, react.useCallback)(async (options = {}) => {\n\t\tif (!validate()) {\n\t\t\tsetSaveState(\"error\");\n\t\t\treturn false;\n\t\t}\n\t\tif (saveState !== \"unsaved\" && !options.force && !options.fakeWhenUnchanged) return true;\n\t\tconst timeBefore = Date.now();\n\t\tsetSaveState(\"saving\");\n\t\ttry {\n\t\t\tif (saveState === \"unsaved\" || options.force) await onSave(formState);\n\t\t\tconst duration = Date.now() - timeBefore;\n\t\t\tif (savingDelay && duration < savingDelay) await new Promise((resolve) => {\n\t\t\t\tsetTimeout(resolve, savingDelay - duration);\n\t\t\t});\n\t\t\tsetSaveState(\"saved\");\n\t\t\treturn true;\n\t\t} catch (e) {\n\t\t\tawait onSaveError?.(e);\n\t\t\tsetSaveState(\"unsaved\");\n\t\t\tthrow e;\n\t\t}\n\t}, [\n\t\tformState,\n\t\tsaveState,\n\t\tsavingDelay,\n\t\tonSave,\n\t\tonSaveError,\n\t\tvalidate\n\t]);\n\tconst updateForm = (0, react.useCallback)((updater) => {\n\t\tsetFormState(updater);\n\t\tsetSaveState(\"unsaved\");\n\t}, []);\n\tlet okVariant = \"default\";\n\tif (saveState === \"saved\") okVariant = \"default\";\n\telse if (saveState === \"error\") okVariant = \"destructive\";\n\tlet okLabel = \"\";\n\tif (saveState === \"saved\") okLabel = \"Saved\";\n\telse if (saveState === \"saving\") okLabel = \"Saving...\";\n\telse if (saveState === \"error\") okLabel = \"Retry\";\n\tconst okProps = {\n\t\tdisabled: saveState === \"saving\",\n\t\tvariant: okVariant,\n\t\tlabel: okLabel || void 0\n\t};\n\treturn {\n\t\tformState,\n\t\tsaveState,\n\t\thandleSave,\n\t\tupdateForm,\n\t\tsetFormState,\n\t\treset() {\n\t\t\tsetFormState(initialState);\n\t\t\tsetSaveState(\"\");\n\t\t},\n\t\tvalidate,\n\t\tisValid: isValid(errors),\n\t\tclearError: (field) => {\n\t\t\tsetErrors((state) => ({\n\t\t\t\t...state,\n\t\t\t\t[field]: \"\"\n\t\t\t}));\n\t\t},\n\t\terrors,\n\t\tsetErrors,\n\t\tokProps\n\t};\n};\n//#endregion\nmodule.exports = useForm;\n\n//# sourceMappingURL=use-form.cjs.map","const require_rolldown_runtime = require(\"../rolldown-runtime-D6vf50IK.cjs\");\nconst require_providers_framework_provider = require(\"../providers/framework-provider.cjs\");\nconst require_utils_errors = require(\"../utils/errors.cjs\");\nlet _sentry_react = require(\"@sentry/react\");\n_sentry_react = require_rolldown_runtime.__toESM(_sentry_react, 1);\nlet react = require(\"react\");\nlet sonner = require(\"sonner\");\n//#region src/hooks/use-handle-error.ts\nfunction showErrorToast(message) {\n\tsonner.toast.dismiss();\n\tsonner.toast.error(message);\n}\n/**\n* Generic error handling for API calls. This is enabled by default for queries (can be disabled by\n* setting defaultErrorHandler:false when using the query) but should be called when mutations throw\n* errors in order to handle anything unexpected.\n*/\nvar useHandleError = () => {\n\tconst { sentryDSN } = require_providers_framework_provider.useFramework();\n\treturn (0, react.useCallback)((error, { withToast = true } = {}) => {\n\t\tconsole.error(error);\n\t\tif (sentryDSN && !(error instanceof require_utils_errors.SessionExpiredError)) _sentry_react.withScope((scope) => {\n\t\t\tif (error instanceof require_utils_errors.APIError && error.response) {\n\t\t\t\tscope.setTag(\"api_url\", error.response.url);\n\t\t\t\tscope.setTag(\"api_response_status\", error.response.status);\n\t\t\t}\n\t\t\t_sentry_react.captureException(error);\n\t\t});\n\t\tif (!withToast) return;\n\t\tif (error instanceof require_utils_errors.APIError && error.response?.status === 418) sonner.toast.dismiss();\n\t\telse if (error instanceof require_utils_errors.SessionExpiredError) sonner.toast.dismiss();\n\t\telse if (error instanceof require_utils_errors.APIError) showErrorToast(require_utils_errors.getErrorMessage(error, error.message));\n\t\telse showErrorToast(\"Something went wrong, please try again.\");\n\t}, [sentryDSN]);\n};\n//#endregion\nmodule.exports = useHandleError;\n\n//# sourceMappingURL=use-handle-error.cjs.map","Object.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst require_api_config = require(\"../api/config.cjs\");\n//#region src/hooks/use-host-limits.ts\n/**\n* The site's host plan limits from config — undefined while config is loading\n* or when the site has none.\n*/\nvar useHostLimits = () => {\n\tconst { data } = require_api_config.useBrowseConfig({ refetchOnMount: false });\n\treturn data?.config.hostSettings?.limits;\n};\n//#endregion\nexports.useHostLimits = useHostLimits;\n\n//# sourceMappingURL=use-host-limits.cjs.map","Object.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst require_utils_helpers = require(\"../utils/helpers.cjs\");\nconst require_utils_api_fetch_api = require(\"../utils/api/fetch-api.cjs\");\nlet react = require(\"react\");\n//#region src/hooks/use-koenig-fetch-embed.ts\nvar DEFAULT_REQUEST_OPTIONS = {};\n/** The session-expiry policy applies to every lookup this fetcher makes. */\nvar useKoenigFetchEmbed = (requestOptions = DEFAULT_REQUEST_OPTIONS) => {\n\tconst fetchApi = require_utils_api_fetch_api.useFetchApi();\n\treturn (0, react.useCallback)(async (url, { type } = {}) => {\n\t\tconst oembedUrl = new URL(`${require_utils_helpers.getGhostPaths().apiRoot}/oembed/`, window.location.origin);\n\t\toembedUrl.searchParams.set(\"url\", url);\n\t\tif (type) oembedUrl.searchParams.set(\"type\", type);\n\t\treturn await fetchApi(oembedUrl, requestOptions);\n\t}, [fetchApi, requestOptions]);\n};\n//#endregion\nexports.useKoenigFetchEmbed = useKoenigFetchEmbed;\n\n//# sourceMappingURL=use-koenig-fetch-embed.cjs.map","Object.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst require_utils_helpers = require(\"../utils/helpers.cjs\");\nconst require_utils_api_fetch_api = require(\"../utils/api/fetch-api.cjs\");\nlet react = require(\"react\");\n//#region src/hooks/use-koenig-file-upload.ts\nvar koenigFileUploadTypes = {\n\timage: {\n\t\tmimeTypes: [\n\t\t\t\"image/gif\",\n\t\t\t\"image/jpg\",\n\t\t\t\"image/jpeg\",\n\t\t\t\"image/png\",\n\t\t\t\"image/svg+xml\",\n\t\t\t\"image/webp\"\n\t\t],\n\t\textensions: [\n\t\t\t\"gif\",\n\t\t\t\"jpg\",\n\t\t\t\"jpeg\",\n\t\t\t\"png\",\n\t\t\t\"svg\",\n\t\t\t\"svgz\",\n\t\t\t\"webp\"\n\t\t],\n\t\tendpoint: \"/images/upload/\",\n\t\trequestMethod: \"post\",\n\t\tresourceName: \"images\"\n\t},\n\tvideo: {\n\t\tmimeTypes: [\n\t\t\t\"video/mp4\",\n\t\t\t\"video/webm\",\n\t\t\t\"video/ogg\"\n\t\t],\n\t\textensions: [\n\t\t\t\"mp4\",\n\t\t\t\"webm\",\n\t\t\t\"ogv\"\n\t\t],\n\t\tendpoint: \"/media/upload/\",\n\t\trequestMethod: \"post\",\n\t\tresourceName: \"media\"\n\t},\n\taudio: {\n\t\tmimeTypes: [\n\t\t\t\"audio/mp3\",\n\t\t\t\"audio/mpeg\",\n\t\t\t\"audio/ogg\",\n\t\t\t\"audio/wav\",\n\t\t\t\"audio/vnd.wav\",\n\t\t\t\"audio/wave\",\n\t\t\t\"audio/x-wav\",\n\t\t\t\"audio/mp4\",\n\t\t\t\"audio/x-m4a\"\n\t\t],\n\t\textensions: [\n\t\t\t\"mp3\",\n\t\t\t\"wav\",\n\t\t\t\"ogg\",\n\t\t\t\"m4a\"\n\t\t],\n\t\tendpoint: \"/media/upload/\",\n\t\trequestMethod: \"post\",\n\t\tresourceName: \"media\"\n\t},\n\tmediaThumbnail: {\n\t\tmimeTypes: [\n\t\t\t\"image/gif\",\n\t\t\t\"image/jpg\",\n\t\t\t\"image/jpeg\",\n\t\t\t\"image/png\",\n\t\t\t\"image/webp\"\n\t\t],\n\t\textensions: [\n\t\t\t\"gif\",\n\t\t\t\"jpg\",\n\t\t\t\"jpeg\",\n\t\t\t\"png\",\n\t\t\t\"webp\"\n\t\t],\n\t\tendpoint: \"/media/thumbnail/upload/\",\n\t\trequestMethod: \"put\",\n\t\tresourceName: \"media\"\n\t},\n\tfile: {\n\t\textensions: [],\n\t\tendpoint: \"/files/upload/\",\n\t\trequestMethod: \"post\",\n\t\tresourceName: \"files\"\n\t}\n};\nvar getStringAtPath = (maybeObj, path) => {\n\tlet current = maybeObj;\n\tfor (const key of path) if (current && typeof current === \"object\" && key in current) current = current[key];\n\telse return null;\n\treturn typeof current === \"string\" ? current : null;\n};\nvar useKoenigFileUpload = (type = \"image\") => {\n\tconst [progress, setProgress] = (0, react.useState)(0);\n\tconst [isLoading, setLoading] = (0, react.useState)(false);\n\tconst [errors, setErrors] = (0, react.useState)([]);\n\tconst [filesNumber, setFilesNumber] = (0, react.useState)(0);\n\tconst progressTracker = (0, react.useRef)(/* @__PURE__ */ new Map());\n\tconst fetchApi = require_utils_api_fetch_api.useFetchApi();\n\tfunction updateProgress() {\n\t\tif (progressTracker.current.size === 0) {\n\t\t\tsetProgress(0);\n\t\t\treturn;\n\t\t}\n\t\tlet totalProgress = 0;\n\t\tprogressTracker.current.forEach((value) => {\n\t\t\ttotalProgress += value;\n\t\t});\n\t\tsetProgress(Math.round(totalProgress / progressTracker.current.size));\n\t}\n\tconst defaultValidator = (file) => {\n\t\tif (type === \"file\") return true;\n\t\tconst extensions = koenigFileUploadTypes[type].extensions;\n\t\tconst [, extension] = /(?:\\.([^.]+))?$/.exec(file.name) ?? [];\n\t\tif (!extensions) return true;\n\t\tif (!extension || extensions.indexOf(extension.toLowerCase()) === -1) return `The file type you uploaded is not supported. Please use ${`.${extensions.join(\", .\").toUpperCase()}`}`;\n\t\treturn true;\n\t};\n\tconst validate = (files = []) => {\n\t\tconst validationResult = [];\n\t\tfor (let i = 0; i < files.length; i += 1) {\n\t\t\tconst file = files[i];\n\t\t\tconst result = defaultValidator(file);\n\t\t\tif (result === true) continue;\n\t\t\tvalidationResult.push({\n\t\t\t\tfileName: file.name,\n\t\t\t\tmessage: result\n\t\t\t});\n\t\t}\n\t\treturn validationResult;\n\t};\n\tconst uploadFile = async (file, { formData = {} } = {}) => {\n\t\tprogressTracker.current.set(file, 0);\n\t\tconst fileFormData = new FormData();\n\t\tfileFormData.append(\"file\", file, file.name);\n\t\tObject.keys(formData).forEach((key) => {\n\t\t\tfileFormData.append(key, formData[key]);\n\t\t});\n\t\tconst url = `${require_utils_helpers.getGhostPaths().apiRoot}${koenigFileUploadTypes[type].endpoint}`;\n\t\ttry {\n\t\t\tconst uploadResponse = await fetchApi(url, {\n\t\t\t\tmethod: koenigFileUploadTypes[type].requestMethod,\n\t\t\t\tbody: fileFormData,\n\t\t\t\tonUploadProgress(uploadProgress) {\n\t\t\t\t\tprogressTracker.current.set(file, uploadProgress);\n\t\t\t\t\tupdateProgress();\n\t\t\t\t}\n\t\t\t});\n\t\t\tprogressTracker.current.set(file, 100);\n\t\t\tupdateProgress();\n\t\t\tlet responseUrl;\n\t\t\tif (uploadResponse) {\n\t\t\t\tconst resource = uploadResponse[koenigFileUploadTypes[type].resourceName];\n\t\t\t\tif (resource && Array.isArray(resource) && resource[0]) responseUrl = resource[0].url;\n\t\t\t}\n\t\t\treturn {\n\t\t\t\turl: responseUrl,\n\t\t\t\tfileName: file.name\n\t\t\t};\n\t\t} catch (error) {\n\t\t\tconsole.error(error);\n\t\t\tconst context = getStringAtPath(error, [\n\t\t\t\t\"data\",\n\t\t\t\t\"errors\",\n\t\t\t\t0,\n\t\t\t\t\"context\"\n\t\t\t]) || \"\";\n\t\t\tconst message = getStringAtPath(error, [\n\t\t\t\t\"data\",\n\t\t\t\t\"errors\",\n\t\t\t\t0,\n\t\t\t\t\"message\"\n\t\t\t]) || getStringAtPath(error, [\"message\"]) || \"\";\n\t\t\tthrow {\n\t\t\t\tmessage: context || message,\n\t\t\t\tcontext,\n\t\t\t\tfileName: file.name\n\t\t\t};\n\t\t}\n\t};\n\tconst upload = async (files = [], options = {}) => {\n\t\tsetFilesNumber(files.length);\n\t\tsetLoading(true);\n\t\tsetErrors([]);\n\t\tconst validationResult = validate(files);\n\t\tif (validationResult.length) {\n\t\t\tsetErrors(validationResult);\n\t\t\tsetLoading(false);\n\t\t\tsetProgress(100);\n\t\t\treturn null;\n\t\t}\n\t\tconst uploadPromises = [];\n\t\tfor (let i = 0; i < files.length; i += 1) {\n\t\t\tconst file = files[i];\n\t\t\tuploadPromises.push(uploadFile(file, options));\n\t\t}\n\t\ttry {\n\t\t\tconst uploadResult = await Promise.all(uploadPromises);\n\t\t\tsetProgress(100);\n\t\t\tprogressTracker.current.clear();\n\t\t\tsetLoading(false);\n\t\t\tsetErrors([]);\n\t\t\treturn uploadResult;\n\t\t} catch (error) {\n\t\t\tconsole.error(error);\n\t\t\tsetErrors([error]);\n\t\t\tsetLoading(false);\n\t\t\tsetProgress(100);\n\t\t\tprogressTracker.current.clear();\n\t\t\treturn null;\n\t\t}\n\t};\n\treturn {\n\t\tprogress,\n\t\tisLoading,\n\t\tupload,\n\t\terrors,\n\t\tfilesNumber\n\t};\n};\n//#endregion\nexports.koenigFileUploadTypes = koenigFileUploadTypes;\nexports.useKoenigFileUpload = useKoenigFileUpload;\n\n//# sourceMappingURL=use-koenig-file-upload.cjs.map","Object.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst require_hooks_use_filterable_api = require(\"./use-filterable-api.cjs\");\nconst require_api_offers = require(\"../api/offers.cjs\");\nconst require_api_posts = require(\"../api/posts.cjs\");\nlet react = require(\"react\");\n//#region src/hooks/use-koenig-link-suggestions.ts\nvar useKoenigLinkSuggestions = ({ siteUrl, membersSignupAccess, donationsEnabled, recommendationsEnabled, includeShareLink = false, shareLinkLabel = \"Share\" }) => {\n\tconst { data: offersData } = require_api_offers.useBrowseOffers();\n\tconst { data: latestPostsData } = require_api_posts.useBrowsePosts({ searchParams: {\n\t\tfilter: \"status:published\",\n\t\tfields: \"id,url,title,visibility,published_at\",\n\t\torder: \"published_at desc\",\n\t\tlimit: \"5\"\n\t} });\n\tconst searchPosts = require_hooks_use_filterable_api({\n\t\tpath: \"/search-index/posts/\",\n\t\tfilterKey: \"title\",\n\t\tresponseKey: \"posts\"\n\t});\n\tconst searchPages = require_hooks_use_filterable_api({\n\t\tpath: \"/search-index/pages/\",\n\t\tfilterKey: \"title\",\n\t\tresponseKey: \"pages\"\n\t});\n\tconst defaultLinks = (0, react.useMemo)(() => {\n\t\treturn [{\n\t\t\tlabel: \"Latest posts\",\n\t\t\titems: (latestPostsData?.posts || []).map((post) => ({\n\t\t\t\tid: post.id,\n\t\t\t\ttitle: post.title,\n\t\t\t\turl: post.url,\n\t\t\t\tvisibility: post.visibility,\n\t\t\t\tpublishedAt: post.published_at ?? void 0\n\t\t\t}))\n\t\t}];\n\t}, [latestPostsData?.posts]);\n\treturn {\n\t\tfetchAutocompleteLinks: (0, react.useCallback)(async () => {\n\t\t\tconst defaults = [{\n\t\t\t\tlabel: \"Homepage\",\n\t\t\t\tvalue: siteUrl\n\t\t\t}, {\n\t\t\t\tlabel: \"Free signup\",\n\t\t\t\tvalue: \"#/portal/signup/free\"\n\t\t\t}];\n\t\t\tconst shareLink = includeShareLink ? [{\n\t\t\t\tlabel: shareLinkLabel,\n\t\t\t\tvalue: \"#/share\"\n\t\t\t}] : [];\n\t\t\tconst memberLinks = membersSignupAccess === \"all\" ? [{\n\t\t\t\tlabel: \"Paid signup\",\n\t\t\t\tvalue: \"#/portal/signup\"\n\t\t\t}, {\n\t\t\t\tlabel: \"Upgrade or change plan\",\n\t\t\t\tvalue: \"#/portal/account/plans\"\n\t\t\t}] : [];\n\t\t\tconst donationLink = donationsEnabled ? [{\n\t\t\t\tlabel: \"Tips and donations\",\n\t\t\t\tvalue: \"#/portal/support\"\n\t\t\t}] : [];\n\t\t\tconst recommendationLink = recommendationsEnabled ? [{\n\t\t\t\tlabel: \"Recommendations\",\n\t\t\t\tvalue: \"#/portal/recommendations\"\n\t\t\t}] : [];\n\t\t\tconst offersLinks = (offersData?.offers || []).filter((offer) => offer.status === \"active\" && offer.redemption_type === \"signup\").map((offer) => ({\n\t\t\t\tlabel: `Offer - ${offer.name}`,\n\t\t\t\tvalue: new URL(offer.code, siteUrl).toString()\n\t\t\t}));\n\t\t\treturn [\n\t\t\t\t...defaults,\n\t\t\t\t...memberLinks,\n\t\t\t\t...donationLink,\n\t\t\t\t...shareLink,\n\t\t\t\t...recommendationLink,\n\t\t\t\t...offersLinks\n\t\t\t];\n\t\t}, [\n\t\t\tdonationsEnabled,\n\t\t\tincludeShareLink,\n\t\t\tmembersSignupAccess,\n\t\t\toffersData?.offers,\n\t\t\trecommendationsEnabled,\n\t\t\tshareLinkLabel,\n\t\t\tsiteUrl\n\t\t]),\n\t\tsearchLinks: (0, react.useCallback)(async (term) => {\n\t\t\tif (!term) return defaultLinks;\n\t\t\tconst [posts, pages] = await Promise.all([searchPosts.loadData(term), searchPages.loadData(term)]);\n\t\t\treturn [{\n\t\t\t\tlabel: \"Posts\",\n\t\t\t\titems: posts.filter((item) => item.status === \"published\").map((item) => ({\n\t\t\t\t\tid: item.id,\n\t\t\t\t\ttitle: item.title,\n\t\t\t\t\turl: item.url,\n\t\t\t\t\tvisibility: item.visibility,\n\t\t\t\t\tpublishedAt: item.published_at\n\t\t\t\t}))\n\t\t\t}, {\n\t\t\t\tlabel: \"Pages\",\n\t\t\t\titems: pages.filter((item) => item.status === \"published\").map((item) => ({\n\t\t\t\t\tid: item.id,\n\t\t\t\t\ttitle: item.title,\n\t\t\t\t\turl: item.url,\n\t\t\t\t\tvisibility: item.visibility,\n\t\t\t\t\tpublishedAt: item.published_at\n\t\t\t\t}))\n\t\t\t}].filter((group) => group.items.length > 0);\n\t\t}, [\n\t\t\tdefaultLinks,\n\t\t\tsearchPages,\n\t\t\tsearchPosts\n\t\t])\n\t};\n};\n//#endregion\nexports.useKoenigLinkSuggestions = useKoenigLinkSuggestions;\n\n//# sourceMappingURL=use-koenig-link-suggestions.cjs.map","Object.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst require_utils_errors = require(\"../utils/errors.cjs\");\nconst require_api_config = require(\"../api/config.cjs\");\nconst require_api_invites = require(\"../api/invites.cjs\");\nconst require_api_users = require(\"../api/users.cjs\");\nconst require_api_members = require(\"../api/members.cjs\");\nconst require_api_newsletters = require(\"../api/newsletters.cjs\");\nconst require_api_roles = require(\"../api/roles.cjs\");\nlet react = require(\"react\");\n//#region src/hooks/use-limiter.ts\nvar limitServiceImport = import(\"@tryghost/limit-service\");\nvar IncorrectUsageError = class extends Error {\n\tconstructor({ message }) {\n\t\tsuper(message);\n\t}\n};\nvar useLimiter = () => {\n\tconst { data: configData } = require_api_config.useBrowseConfig({ refetchOnMount: false });\n\tconst config = configData?.config;\n\tconst [LimitService, setLimitService] = (0, react.useState)(null);\n\t(0, react.useEffect)(() => {\n\t\tlimitServiceImport.then((exports) => setLimitService(() => exports.default));\n\t}, []);\n\tconst { data: { users } = { users: [] }, isLoading: usersLoading } = require_api_users.useBrowseUsers();\n\tconst { data: { invites } = { invites: [] }, isLoading: invitesLoading } = require_api_invites.useBrowseInvites();\n\tconst { data: { roles } = {}, isLoading: rolesLoading } = require_api_roles.useBrowseRoles();\n\tconst isStaffLoading = usersLoading || invitesLoading || rolesLoading;\n\tconst { refetch: fetchMembers } = require_api_members.useBrowseMembers({\n\t\tsearchParams: { limit: \"1\" },\n\t\tenabled: false\n\t});\n\tconst { refetch: fetchNewsletters } = require_api_newsletters.useBrowseNewsletters({\n\t\tsearchParams: {\n\t\t\tfilter: \"status:active\",\n\t\t\tlimit: \"1\"\n\t\t},\n\t\tenabled: false\n\t});\n\tconst helpLink = (0, react.useMemo)(() => {\n\t\tif (config?.hostSettings?.billing?.enabled === true && config.hostSettings.billing.url) return config.hostSettings.billing.url;\n\t\telse return \"https://ghost.org/help/\";\n\t}, [config?.hostSettings?.billing]);\n\treturn (0, react.useMemo)(() => {\n\t\tconst noOpLimiter = {\n\t\t\tisLimited: () => false,\n\t\t\tisDisabled: () => false,\n\t\t\tcheckWouldGoOverLimit: () => Promise.resolve(false),\n\t\t\terrorIfWouldGoOverLimit: () => Promise.resolve(),\n\t\t\terrorIfIsOverLimit: () => Promise.resolve()\n\t\t};\n\t\tif (!LimitService || !config?.hostSettings?.limits || isStaffLoading) return noOpLimiter;\n\t\tconst limits = { ...config.hostSettings.limits };\n\t\tconst limiter = new LimitService();\n\t\tif (limits.staff) limits.staff.currentCountQuery = () => {\n\t\t\tconst staffUsers = users.filter((user) => user.status !== \"inactive\" && !user.roles.some((role) => role.name === \"Contributor\"));\n\t\t\tconst staffInvites = invites.filter((invite) => {\n\t\t\t\treturn (roles?.find(({ id }) => id === invite.role_id))?.name !== \"Contributor\";\n\t\t\t});\n\t\t\treturn Promise.resolve(staffUsers.length + staffInvites.length);\n\t\t};\n\t\tif (limits.members) limits.members.currentCountQuery = async () => {\n\t\t\tconst { data: members } = await fetchMembers();\n\t\t\treturn members?.meta?.pagination?.total || 0;\n\t\t};\n\t\tif (limits.newsletters) limits.newsletters.currentCountQuery = async () => {\n\t\t\tconst { data: { pages } = { pages: [] } } = await fetchNewsletters();\n\t\t\treturn pages[0].meta?.pagination.total || 0;\n\t\t};\n\t\tlimiter.loadLimits({\n\t\t\tlimits,\n\t\t\thelpLink,\n\t\t\terrors: {\n\t\t\t\tHostLimitError: require_utils_errors.HostLimitError,\n\t\t\t\tIncorrectUsageError\n\t\t\t}\n\t\t});\n\t\treturn {\n\t\t\tisLimited: (limitName) => limiter.isLimited(limitName),\n\t\t\tisDisabled: (limitName) => limiter.isDisabled(limitName),\n\t\t\tcheckWouldGoOverLimit: (limitName) => limiter.checkWouldGoOverLimit(limitName),\n\t\t\terrorIfWouldGoOverLimit: (limitName, metadata = {}) => limiter.errorIfWouldGoOverLimit(limitName, metadata),\n\t\t\terrorIfIsOverLimit: (limitName) => limiter.errorIfIsOverLimit(limitName)\n\t\t};\n\t}, [\n\t\tLimitService,\n\t\tconfig,\n\t\tfetchMembers,\n\t\tfetchNewsletters,\n\t\thelpLink,\n\t\tinvites,\n\t\tisStaffLoading,\n\t\troles,\n\t\tusers\n\t]);\n};\n//#endregion\nexports.useLimiter = useLimiter;\n\n//# sourceMappingURL=use-limiter.cjs.map","Object.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst require_api_current_user = require(\"../api/current-user.cjs\");\n//#region src/hooks/use-permissions.ts\nvar usePermission = (requiredRoles, currentUserOptions) => {\n\tconst { data: currentUser } = require_api_current_user.useCurrentUser(currentUserOptions);\n\tif (!requiredRoles || requiredRoles.length === 0) return true;\n\tconst currentUserRoles = currentUser?.roles.map((role) => role.name);\n\tif (!currentUserRoles) return false;\n\treturn requiredRoles.some((role) => currentUserRoles.includes(role));\n};\n//#endregion\nexports.usePermission = usePermission;\n\n//# sourceMappingURL=use-permissions.cjs.map","Object.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst require_utils_helpers = require(\"../utils/helpers.cjs\");\nconst require_api_settings = require(\"../api/settings.cjs\");\nconst require_api_config = require(\"../api/config.cjs\");\nlet react = require(\"react\");\n//#region src/hooks/use-pintura-config.ts\nvar parseOptionalString = (value) => {\n\tif (value === null || typeof value === \"undefined\") return;\n\tif (typeof value === \"string\") return value;\n\tthrow new TypeError(\"Expected value to be null, undefined, or a string\");\n};\nvar resolveUrl = (url) => {\n\tif (url.startsWith(\"/\")) {\n\t\tconst { adminRoot } = require_utils_helpers.getGhostPaths();\n\t\treturn window.location.origin + adminRoot.replace(/\\/$/, \"\") + url;\n\t}\n\treturn url;\n};\n/**\n* Returns the URLs for Pintura, or `null` when Pintura is not\n* enabled/configured.\n*\n* Suitable for passing to Koenig's `cardConfig`. Koenig handles its own script\n* and CSS loading — this hook only resolves the URLs from settings and host\n* config.\n*/\nfunction usePinturaConfig({ requestOptions } = {}) {\n\tconst { data: configData } = require_api_config.useBrowseConfig({ requestOptions });\n\tconst { data: settingsData } = require_api_settings.useBrowseSettings({ requestOptions });\n\tconst pinturaConfig = (configData?.config)?.pintura;\n\tconst [isEnabled, fallbackJsUrl, fallbackCssUrl] = require_api_settings.getSettingValues(settingsData?.settings ?? null, [\n\t\t\"pintura\",\n\t\t\"pintura_js_url\",\n\t\t\"pintura_css_url\"\n\t]);\n\tlet configJsUrl;\n\tlet configCssUrl;\n\tif (isEnabled) {\n\t\tconfigJsUrl = pinturaConfig?.js || parseOptionalString(fallbackJsUrl);\n\t\tconfigCssUrl = pinturaConfig?.css || parseOptionalString(fallbackCssUrl);\n\t}\n\treturn (0, react.useMemo)(() => {\n\t\tif (!configJsUrl || !configCssUrl) return null;\n\t\treturn {\n\t\t\tjsUrl: resolveUrl(configJsUrl),\n\t\t\tcssUrl: resolveUrl(configCssUrl)\n\t\t};\n\t}, [configJsUrl, configCssUrl]);\n}\n//#endregion\nexports.usePinturaConfig = usePinturaConfig;\n\n//# sourceMappingURL=use-pintura-config.cjs.map","Object.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nlet react = require(\"react\");\n//#region src/providers/feature-flag-overrides-context.ts\nvar FeatureFlagOverridesContext = (0, react.createContext)({ enabledFlags: [] });\nvar useFeatureFlagOverrides = () => (0, react.useContext)(FeatureFlagOverridesContext);\n//#endregion\nexports.FeatureFlagOverridesContext = FeatureFlagOverridesContext;\nexports.useFeatureFlagOverrides = useFeatureFlagOverrides;\n\n//# sourceMappingURL=feature-flag-overrides-context.cjs.map","Object.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst require_utils_query_client = require(\"../utils/query-client.cjs\");\nlet _sentry_react = require(\"@sentry/react\");\nlet _tanstack_react_query = require(\"@tanstack/react-query\");\nlet react = require(\"react\");\nlet react_jsx_runtime = require(\"react/jsx-runtime\");\n//#region src/providers/framework-provider.tsx\nvar defaultUnsplashConfig = {\n\tAuthorization: \"Client-ID 8672af113b0a8573edae3aa3713886265d9bb741d707f6c01a486cde8c278980\",\n\t\"Accept-Version\": \"v1\",\n\t\"Content-Type\": \"application/json\",\n\t\"App-Pragma\": \"no-cache\",\n\t\"X-Unsplash-Cache\": true\n};\nvar FrameworkContext = (0, react.createContext)({\n\tghostVersion: \"\",\n\texternalNavigate: () => {},\n\tunsplashConfig: {\n\t\tAuthorization: \"\",\n\t\t\"Accept-Version\": \"\",\n\t\t\"Content-Type\": \"\",\n\t\t\"App-Pragma\": \"\",\n\t\t\"X-Unsplash-Cache\": true\n\t},\n\tsentryDSN: null,\n\tonUpdate: () => {},\n\tonInvalidate: () => {},\n\tonDelete: () => {}\n});\nfunction FrameworkProvider({ children, queryClient: queryClientOverride, ...props }) {\n\treturn /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_sentry_react.ErrorBoundary, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_tanstack_react_query.QueryClientProvider, {\n\t\tclient: (0, react.useMemo)(() => {\n\t\t\tif (queryClientOverride) return queryClientOverride;\n\t\t\treturn require_utils_query_client;\n\t\t}, [queryClientOverride]),\n\t\tchildren: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FrameworkContext.Provider, {\n\t\t\tvalue: props,\n\t\t\tchildren\n\t\t})\n\t}) });\n}\nvar useFramework = () => (0, react.useContext)(FrameworkContext);\n//#endregion\nexports.FrameworkProvider = FrameworkProvider;\nexports.defaultUnsplashConfig = defaultUnsplashConfig;\nexports.useFramework = useFramework;\n\n//# sourceMappingURL=framework-provider.cjs.map","//#region \\0rolldown/runtime.js\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __copyProps = (to, from, except, desc) => {\n\tif (from && typeof from === \"object\" || typeof from === \"function\") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {\n\t\tkey = keys[i];\n\t\tif (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {\n\t\t\tget: ((k) => from[k]).bind(null, key),\n\t\t\tenumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable\n\t\t});\n\t}\n\treturn to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", {\n\tvalue: mod,\n\tenumerable: true\n}) : target, mod));\n//#endregion\nObject.defineProperty(exports, \"__toESM\", {\n\tenumerable: true,\n\tget: function() {\n\t\treturn __toESM;\n\t}\n});\n","Object.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst require_rolldown_runtime = require(\"../../rolldown-runtime-D6vf50IK.cjs\");\nconst require_providers_framework_provider = require(\"../../providers/framework-provider.cjs\");\nconst require_utils_errors = require(\"../errors.cjs\");\nconst require_utils_helpers = require(\"../helpers.cjs\");\nconst require_utils_api_handle_response = require(\"./handle-response.cjs\");\nlet _sentry_react = require(\"@sentry/react\");\n_sentry_react = require_rolldown_runtime.__toESM(_sentry_react, 1);\nlet react = require(\"react\");\n//#region src/utils/api/fetch-api.ts\nvar xhrHeadersToFetchHeaders = (xhr) => {\n\tconst result = new Headers();\n\tconst headerLines = xhr.getAllResponseHeaders()?.split(\"\\r\\n\") || [];\n\tfor (const headerLine of headerLines) {\n\t\tconst separatorIndex = headerLine.indexOf(\":\");\n\t\tif (separatorIndex === -1) continue;\n\t\tconst headerName = headerLine.slice(0, separatorIndex);\n\t\tconst headerValue = headerLine.slice(separatorIndex + 1).trim();\n\t\tresult.append(headerName, headerValue);\n\t}\n\treturn result;\n};\nvar xhrToFetchResponse = (xhr) => new Response(xhr.response, {\n\tstatus: xhr.status,\n\tstatusText: xhr.statusText,\n\theaders: xhrHeadersToFetchHeaders(xhr)\n});\nvar GHOST_API_REQUEST = /\\/ghost\\/api\\//;\nvar SESSION_API_REQUEST = /\\/ghost\\/api\\/admin\\/session([/?#]|$)/;\nvar UNAUTHENTICATED_ADMIN_ROUTE = /^#\\/(?:reset|setup|signin|signup)(?:[/?]|$)/;\nvar sessionExpiryHandled = false;\nvar isUnauthenticatedAdminRoute = (adminRoot) => {\n\treturn window.location.pathname === adminRoot && (!window.location.hash || window.location.hash === \"#/\" || UNAUTHENTICATED_ADMIN_ROUTE.test(window.location.hash));\n};\nvar isSessionExpiry = (endpoint) => {\n\tconst url = endpoint.toString();\n\treturn GHOST_API_REQUEST.test(url) && !SESSION_API_REQUEST.test(url);\n};\nvar redirectOnSessionExpiry = () => {\n\tconst { adminRoot } = require_utils_helpers.getGhostPaths();\n\tif (!sessionExpiryHandled && !isUnauthenticatedAdminRoute(adminRoot)) {\n\t\tsessionExpiryHandled = true;\n\t\twindow.location.replace(adminRoot);\n\t}\n};\nvar fetchWithXhr = (onUploadProgress, endpoint, { method, headers, credentials, body, signal }) => new Promise((resolve, reject) => {\n\tconst onabort = () => {\n\t\treject(new DOMException(\"Aborted\", \"AbortError\"));\n\t};\n\tif (signal.aborted) {\n\t\tonabort();\n\t\treturn;\n\t}\n\tconst xhr = new XMLHttpRequest();\n\txhr.open(method, endpoint.toString(), true);\n\tswitch (credentials) {\n\t\tcase \"omit\": throw new Error(\"\\\"omit\\\" credentials cannot be represented with legacy XMLHttpRequest. Consider \\\"same-origin\\\".\");\n\t\tcase \"same-origin\":\n\t\t\txhr.withCredentials = false;\n\t\t\tbreak;\n\t\tcase \"include\":\n\t\t\txhr.withCredentials = true;\n\t\t\tbreak;\n\t\tdefault: throw new Error(credentials);\n\t}\n\txhr.responseType = \"arraybuffer\";\n\tfor (const [headerName, headerValue] of Object.entries(headers)) xhr.setRequestHeader(headerName, headerValue);\n\txhr.upload.onprogress = (event) => {\n\t\tif (event.lengthComputable) onUploadProgress(event.loaded / event.total * 100);\n\t};\n\txhr.onload = () => {\n\t\tresolve(xhrToFetchResponse(xhr));\n\t};\n\txhr.onerror = () => {\n\t\treject(/* @__PURE__ */ new TypeError(\"Network request failed\"));\n\t};\n\txhr.onabort = onabort;\n\tconst onSignalAbort = () => xhr.abort();\n\tsignal.addEventListener(\"abort\", onSignalAbort);\n\txhr.onloadend = () => {\n\t\tsignal.removeEventListener(\"abort\", onSignalAbort);\n\t};\n\txhr.send(body);\n});\nvar useFetchApi = () => {\n\tconst { ghostVersion, sentryDSN } = require_providers_framework_provider.useFramework();\n\treturn (0, react.useCallback)(async (endpoint, { method = \"GET\", headers = {}, body, credentials = \"include\", timeout, retry = true, responseType, sessionExpiryRedirect = true, onUploadProgress } = {}) => {\n\t\tconst controller = new AbortController();\n\t\tconst requestInit = {\n\t\t\tmethod,\n\t\t\theaders: {\n\t\t\t\t\"app-pragma\": \"no-cache\",\n\t\t\t\t...ghostVersion ? { \"x-ghost-version\": ghostVersion } : {},\n\t\t\t\t...typeof body === \"string\" ? { [\"content-type\"]: \"application/json\" } : {},\n\t\t\t\t...headers\n\t\t\t},\n\t\t\tcredentials,\n\t\t\tmode: \"cors\",\n\t\t\tbody,\n\t\t\tsignal: controller.signal\n\t\t};\n\t\tlet attempts = 0;\n\t\tlet retryingMs = 0;\n\t\tconst startTime = Date.now();\n\t\tconst maxRetryingMs = 15e3;\n\t\tconst retryPeriods = [500, 1e3];\n\t\tconst retryableErrors = [\n\t\t\trequire_utils_errors.ServerUnreachableError,\n\t\t\trequire_utils_errors.MaintenanceError,\n\t\t\tTypeError\n\t\t];\n\t\tconst getErrorData = (error, response) => {\n\t\t\tconst data = {\n\t\t\t\terrorName: error?.name,\n\t\t\t\tattempts,\n\t\t\t\ttotalSeconds: retryingMs / 1e3,\n\t\t\t\tendpoint: endpoint.toString()\n\t\t\t};\n\t\t\tif (endpoint.toString().includes(\"/ghost/api/\")) data.server = response?.headers.get(\"server\");\n\t\t\treturn data;\n\t\t};\n\t\tconst fetchFn = onUploadProgress ? fetchWithXhr.bind(null, onUploadProgress) : fetch;\n\t\tconst timeoutHandle = timeout ? setTimeout(() => controller.abort(), timeout) : void 0;\n\t\ttry {\n\t\t\twhile (attempts === 0 || retry) try {\n\t\t\t\treturn await require_utils_api_handle_response(await fetchFn(endpoint, requestInit), { responseType });\n\t\t\t} catch (error) {\n\t\t\t\tretryingMs = Date.now() - startTime;\n\t\t\t\tif (retry && retryableErrors.some((errorClass) => error instanceof errorClass) && retryingMs <= maxRetryingMs) {\n\t\t\t\t\tawait new Promise((resolve) => {\n\t\t\t\t\t\tsetTimeout(resolve, retryPeriods[attempts] || retryPeriods[retryPeriods.length - 1]);\n\t\t\t\t\t});\n\t\t\t\t\tattempts += 1;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (attempts !== 0 && sentryDSN) _sentry_react.captureMessage(\"Request failed after multiple attempts\", { extra: getErrorData() });\n\t\t\t\tif (error && typeof error === \"object\" && \"name\" in error && error.name === \"AbortError\") throw new require_utils_errors.TimeoutError();\n\t\t\t\tif (error instanceof require_utils_errors.UnauthorizedError && isSessionExpiry(endpoint)) {\n\t\t\t\t\tif (sessionExpiryRedirect) redirectOnSessionExpiry();\n\t\t\t\t\tthrow new require_utils_errors.SessionExpiredError(error.response, error.data, { cause: error });\n\t\t\t\t}\n\t\t\t\tlet newError = error;\n\t\t\t\tif (!(error instanceof require_utils_errors.APIError)) newError = new require_utils_errors.ServerUnreachableError({ cause: error });\n\t\t\t\tthrow newError;\n\t\t\t}\n\t\t} finally {\n\t\t\tclearTimeout(timeoutHandle);\n\t\t}\n\t}, [ghostVersion, sentryDSN]);\n};\nvar { apiRoot } = require_utils_helpers.getGhostPaths();\nvar apiUrl = (path, searchParams = {}) => {\n\tconst url = new URL(`${apiRoot}${path}`, window.location.origin);\n\turl.search = new URLSearchParams(searchParams).toString();\n\treturn url.toString();\n};\n//#endregion\nexports.apiUrl = apiUrl;\nexports.useFetchApi = useFetchApi;\n\n//# sourceMappingURL=fetch-api.cjs.map","const require_utils_errors = require(\"../errors.cjs\");\n//#region src/utils/api/handle-response.ts\nvar isTextContentType = (contentType) => {\n\treturn !!contentType && (contentType.startsWith(\"text/\") || contentType.includes(\"application/yaml\"));\n};\nvar handleResponse = async (response, { responseType } = {}) => {\n\tif (response.status === 0) throw new require_utils_errors.ServerUnreachableError();\n\telse if (response.status === 503) throw new require_utils_errors.MaintenanceError(response, await response.text());\n\telse if (response.status === 415) throw new require_utils_errors.UnsupportedMediaTypeError(response, await response.text());\n\telse if (response.status === 413) throw new require_utils_errors.RequestEntityTooLargeError(response, await response.text());\n\telse if (response.status === 401) {\n\t\tif (response.headers.get(\"content-type\")?.includes(\"json\")) throw new require_utils_errors.UnauthorizedError(response, await response.json());\n\t\tthrow new require_utils_errors.UnauthorizedError(response, await response.text());\n\t} else if (!response.ok) {\n\t\tif (!response.headers.get(\"content-type\")?.includes(\"json\")) throw new require_utils_errors.APIError(response, await response.text());\n\t\tconst data = await response.json();\n\t\tif (response.status === 403 && data.errors?.[0]?.message === \"Authorization failed\") throw new require_utils_errors.UnauthorizedError(response, data);\n\t\telse if (data.errors?.[0]?.type === \"VersionMismatchError\") throw new require_utils_errors.VersionMismatchError(response, data);\n\t\telse if (data.errors?.[0]?.type === \"ValidationError\") throw new require_utils_errors.ValidationError(response, data);\n\t\telse if (data.errors?.[0]?.type === \"NoPermissionError\") throw new require_utils_errors.ValidationError(response, data);\n\t\telse if (data.errors?.[0]?.type === \"ThemeValidationError\") throw new require_utils_errors.ThemeValidationError(response, data);\n\t\telse if (data.errors?.[0]?.type === \"HostLimitError\") throw new require_utils_errors.HostLimitError(response, data);\n\t\telse if (data.errors?.[0]?.type === \"EmailError\") throw new require_utils_errors.EmailError(response, data);\n\t\telse throw new require_utils_errors.JSONError(response, data);\n\t} else if (response.status === 204) return;\n\telse if (responseType === \"blob\") return await response.blob();\n\telse if (responseType === \"arraybuffer\") return await response.arrayBuffer();\n\telse if (isTextContentType(response.headers.get(\"content-type\"))) return await response.text();\n\telse return await response.json();\n};\n//#endregion\nmodule.exports = handleResponse;\n\n//# sourceMappingURL=handle-response.cjs.map","Object.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst require_providers_framework_provider = require(\"../../providers/framework-provider.cjs\");\nconst require_hooks_use_handle_error = require(\"../../hooks/use-handle-error.cjs\");\nconst require_utils_api_fetch_api = require(\"./fetch-api.cjs\");\nconst require_hooks_use_permissions = require(\"../../hooks/use-permissions.cjs\");\nlet _tanstack_react_query = require(\"@tanstack/react-query\");\nlet react = require(\"react\");\n//#region src/utils/api/hooks.ts\nvar createQuery = (options) => ({ searchParams, requestOptions, ...query } = {}) => {\n\tconst url = require_utils_api_fetch_api.apiUrl(options.path, searchParams || options.defaultSearchParams);\n\tconst fetchApi = require_utils_api_fetch_api.useFetchApi();\n\tconst handleError = require_hooks_use_handle_error();\n\tconst hasPermission = require_hooks_use_permissions.usePermission(options.permissions, { requestOptions });\n\tconst result = (0, _tanstack_react_query.useQuery)({\n\t\t...query,\n\t\tenabled: hasPermission && (query.enabled ?? true),\n\t\tqueryKey: [options.dataType, url],\n\t\tqueryFn: async () => {\n\t\t\tif (options.parseResponse) {\n\t\t\t\tconst data = await fetchApi(url, {\n\t\t\t\t\theaders: options.headers,\n\t\t\t\t\t...requestOptions\n\t\t\t\t});\n\t\t\t\treturn options.parseResponse(data);\n\t\t\t}\n\t\t\treturn fetchApi(url, {\n\t\t\t\theaders: options.headers,\n\t\t\t\t...requestOptions\n\t\t\t});\n\t\t}\n\t});\n\tconst data = (0, react.useMemo)(() => result.data && options.returnData ? options.returnData(result.data) : result.data, [result.data]);\n\t(0, react.useEffect)(() => {\n\t\tif (result.error && query.defaultErrorHandler !== false) handleError(result.error);\n\t}, [\n\t\thandleError,\n\t\tresult.error,\n\t\tquery.defaultErrorHandler\n\t]);\n\treturn {\n\t\t...result,\n\t\tdata\n\t};\n};\nvar createInfiniteQuery = (options) => ({ searchParams, requestOptions, getNextPageParams, ...query } = {}) => {\n\tconst fetchApi = require_utils_api_fetch_api.useFetchApi();\n\tconst handleError = require_hooks_use_handle_error();\n\tconst hasPermission = require_hooks_use_permissions.usePermission(options.permissions, { requestOptions });\n\tconst nextPageParams = getNextPageParams || options.defaultNextPageParams || (() => ({}));\n\tconst result = (0, _tanstack_react_query.useInfiniteQuery)({\n\t\t...query,\n\t\tenabled: hasPermission && (query.enabled ?? true),\n\t\tqueryKey: [options.dataType, require_utils_api_fetch_api.apiUrl(options.path, searchParams || options.defaultSearchParams)],\n\t\tqueryFn: async ({ pageParam }) => {\n\t\t\tconst url = require_utils_api_fetch_api.apiUrl(options.path, pageParam || searchParams || options.defaultSearchParams);\n\t\t\tif (options.parseResponse) {\n\t\t\t\tconst data = await fetchApi(url, {\n\t\t\t\t\theaders: options.headers,\n\t\t\t\t\t...requestOptions\n\t\t\t\t});\n\t\t\t\treturn options.parseResponse(data);\n\t\t\t}\n\t\t\treturn fetchApi(url, {\n\t\t\t\theaders: options.headers,\n\t\t\t\t...requestOptions\n\t\t\t});\n\t\t},\n\t\tinitialPageParam: void 0,\n\t\tgetNextPageParam: (data) => nextPageParams(data, searchParams || options.defaultSearchParams || {})\n\t});\n\tconst data = (0, react.useMemo)(() => result.data && options.returnData(result.data), [result.data]);\n\t(0, react.useEffect)(() => {\n\t\tif (result.error && query.defaultErrorHandler !== false) handleError(result.error);\n\t}, [\n\t\thandleError,\n\t\tresult.error,\n\t\tquery.defaultErrorHandler\n\t]);\n\treturn {\n\t\t...result,\n\t\tdata\n\t};\n};\nvar createQueryWithId = (options) => (id, { searchParams, ...query } = {}) => {\n\treturn createQuery({\n\t\t...options,\n\t\tpath: options.path(id)\n\t})({\n\t\tsearchParams: searchParams || options.defaultSearchParams,\n\t\t...query\n\t});\n};\nvar mutate = ({ fetchApi, path, payload, searchParams, options }) => {\n\tconst { defaultSearchParams, body, requestOptions, ...staticOptions } = options;\n\tconst url = require_utils_api_fetch_api.apiUrl(path, searchParams || defaultSearchParams);\n\tconst generatedBody = payload && body?.(payload);\n\tlet requestBody = void 0;\n\tif (generatedBody instanceof FormData) requestBody = generatedBody;\n\telse if (generatedBody) requestBody = JSON.stringify(generatedBody);\n\treturn fetchApi(url, {\n\t\tbody: requestBody,\n\t\t...staticOptions,\n\t\t...payload === void 0 ? {} : requestOptions?.(payload)\n\t});\n};\nvar createMutation = ({ path, searchParams, defaultSearchParams, updateQueries, invalidateQueries, ...mutateOptions }) => () => {\n\tconst fetchApi = require_utils_api_fetch_api.useFetchApi();\n\tconst queryClient = (0, _tanstack_react_query.useQueryClient)();\n\tconst { onUpdate, onInvalidate, onDelete } = require_providers_framework_provider.useFramework();\n\treturn (0, _tanstack_react_query.useMutation)({\n\t\tmutationFn: (payload) => mutate({\n\t\t\tfetchApi,\n\t\t\tpath: path(payload),\n\t\t\tpayload,\n\t\t\tsearchParams: searchParams?.(payload) || defaultSearchParams,\n\t\t\toptions: mutateOptions\n\t\t}),\n\t\tonSuccess: (0, react.useCallback)((newData, payload) => {\n\t\t\tif (invalidateQueries && \"dataType\" in invalidateQueries) {\n\t\t\t\tconst dataTypes = Array.isArray(invalidateQueries.dataType) ? invalidateQueries.dataType : [invalidateQueries.dataType];\n\t\t\t\tfor (const dataType of dataTypes) {\n\t\t\t\t\tqueryClient.invalidateQueries({ queryKey: [dataType] });\n\t\t\t\t\tonInvalidate(dataType);\n\t\t\t\t}\n\t\t\t} else if (invalidateQueries) queryClient.invalidateQueries(invalidateQueries.filters, invalidateQueries.options);\n\t\t\tif (updateQueries) {\n\t\t\t\tqueryClient.setQueriesData({ queryKey: [updateQueries.dataType] }, (data) => updateQueries.update(newData, data, payload));\n\t\t\t\tif (updateQueries.emberUpdateType === \"createOrUpdate\") onUpdate(updateQueries.dataType, newData);\n\t\t\t\telse if (updateQueries.emberUpdateType === \"delete\") {\n\t\t\t\t\tif (typeof payload !== \"string\") throw new Error(\"Expected delete mutation to have a string (ID) payload. Either change the payload or update the createMutation hook\");\n\t\t\t\t\tonDelete(updateQueries.dataType, payload);\n\t\t\t\t}\n\t\t\t}\n\t\t}, [\n\t\t\tonInvalidate,\n\t\t\tonUpdate,\n\t\t\tonDelete,\n\t\t\tqueryClient\n\t\t])\n\t});\n};\n//#endregion\nexports.createInfiniteQuery = createInfiniteQuery;\nexports.createMutation = createMutation;\nexports.createQuery = createQuery;\nexports.createQueryWithId = createQueryWithId;\n\n//# sourceMappingURL=hooks.cjs.map","Object.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\n//#region src/utils/api/update-queries.ts\nvar insertToQueryCache = (field, recordsToInsert) => {\n\treturn (newData, currentData) => {\n\t\tif (!currentData) return currentData;\n\t\tconst getRecords = recordsToInsert || ((response) => response[field]);\n\t\tif (typeof currentData === \"object\" && \"pages\" in currentData) {\n\t\t\tconst { pages } = currentData;\n\t\t\tconst lastPage = pages[pages.length - 1];\n\t\t\treturn {\n\t\t\t\t...currentData,\n\t\t\t\tpages: pages.slice(0, -1).concat({\n\t\t\t\t\t...lastPage,\n\t\t\t\t\t[field]: lastPage[field].concat(getRecords(newData))\n\t\t\t\t})\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t...currentData,\n\t\t\t[field]: currentData[field].concat(getRecords(newData))\n\t\t};\n\t};\n};\nvar updateQueryCache = (field, updatedRecords) => {\n\treturn (newData, currentData) => {\n\t\tif (!currentData) return currentData;\n\t\tconst updated = (updatedRecords || ((response) => {\n\t\t\treturn response[field].reduce((result, record) => ({\n\t\t\t\t...result,\n\t\t\t\t[record.id]: record\n\t\t\t}), {});\n\t\t}))(newData);\n\t\tif (typeof currentData === \"object\" && \"pages\" in currentData) {\n\t\t\tconst { pages } = currentData;\n\t\t\treturn {\n\t\t\t\t...currentData,\n\t\t\t\tpages: pages.map((page) => ({\n\t\t\t\t\t...page,\n\t\t\t\t\t[field]: page[field].map((current) => updated[current.id] || current)\n\t\t\t\t}))\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t...currentData,\n\t\t\t[field]: currentData[field].map((current) => updated[current.id] || current)\n\t\t};\n\t};\n};\nvar deleteFromQueryCache = (field, idsFromPayload) => {\n\treturn (_, currentData, payload) => {\n\t\tif (!currentData) return currentData;\n\t\tconst deletedIds = idsFromPayload?.(payload) || [payload];\n\t\tif (typeof currentData === \"object\" && \"pages\" in currentData) {\n\t\t\tconst { pages } = currentData;\n\t\t\treturn {\n\t\t\t\t...currentData,\n\t\t\t\tpages: pages.map((page) => ({\n\t\t\t\t\t...page,\n\t\t\t\t\t[field]: page[field].filter((current) => !deletedIds.includes(current.id))\n\t\t\t\t}))\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t...currentData,\n\t\t\t[field]: currentData[field].filter((current) => !deletedIds.includes(current.id))\n\t\t};\n\t};\n};\n//#endregion\nexports.deleteFromQueryCache = deleteFromQueryCache;\nexports.insertToQueryCache = insertToQueryCache;\nexports.updateQueryCache = updateQueryCache;\n\n//# sourceMappingURL=update-queries.cjs.map","Object.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\n//#region src/utils/errors.ts\nvar APIError = class extends Error {\n\tresponse;\n\tdata;\n\tconstructor(response, data, message, errorOptions) {\n\t\tif (!message && response && response.url.includes(\"/ghost/api/admin/\")) message = `Something went wrong while loading ${response.url.replace(/.+\\/ghost\\/api\\/admin\\//, \"\").replace(/\\W.*/, \"\").replace(\"_\", \" \")}, please try again.`;\n\t\tsuper(message || \"Something went wrong, please try again.\", errorOptions);\n\t\tthis.response = response;\n\t\tthis.data = data;\n\t}\n};\nvar JSONError = class extends APIError {\n\tdata;\n\tconstructor(response, data, message, errorOptions) {\n\t\tsuper(response, data, message, errorOptions);\n\t\tthis.data = data;\n\t}\n};\nvar VersionMismatchError = class extends JSONError {\n\tconstructor(response, data, errorOptions) {\n\t\tsuper(response, data, \"API server is running a newer version of Ghost, please upgrade.\", errorOptions);\n\t}\n};\nvar ServerUnreachableError = class extends APIError {\n\tconstructor(errorOptions) {\n\t\tsuper(void 0, void 0, \"Something went wrong, please try again.\", errorOptions);\n\t}\n};\nvar TimeoutError = class extends APIError {\n\tconstructor(errorOptions) {\n\t\tsuper(void 0, void 0, \"Request timed out, please try again.\", errorOptions);\n\t}\n};\nvar RequestEntityTooLargeError = class extends APIError {\n\tconstructor(response, data, errorOptions) {\n\t\tsuper(response, data, \"Request is larger than the maximum file size the server allows\", errorOptions);\n\t}\n};\nvar UnsupportedMediaTypeError = class extends APIError {\n\tconstructor(response, data, errorOptions) {\n\t\tsuper(response, data, \"Request contains an unknown or unsupported file type.\", errorOptions);\n\t}\n};\nvar MaintenanceError = class extends APIError {\n\tconstructor(response, data, errorOptions) {\n\t\tsuper(response, data, \"Ghost is currently undergoing maintenance, please wait a moment then retry.\", errorOptions);\n\t}\n};\nvar UnauthorizedError = class extends APIError {\n\tconstructor(response, data, errorOptions) {\n\t\tsuper(response, data, \"You are not authorised to make this request.\", errorOptions);\n\t}\n};\nvar SessionExpiredError = class extends UnauthorizedError {};\nvar ThemeValidationError = class extends JSONError {\n\tconstructor(response, data, errorOptions) {\n\t\tsuper(response, data, \"Theme is not compatible or contains errors.\", errorOptions);\n\t}\n};\nvar HostLimitError = class extends JSONError {\n\terrorDetails;\n\tconstructor(responseOrLimit, data, errorOptions) {\n\t\tif (responseOrLimit instanceof Response) super(responseOrLimit, data, \"A hosting plan limit was reached or exceeded.\", errorOptions);\n\t\telse {\n\t\t\tsuper(void 0, void 0, responseOrLimit.message || \"A hosting plan limit was reached or exceeded.\");\n\t\t\tthis.errorDetails = responseOrLimit.errorDetails;\n\t\t}\n\t}\n};\nvar EmailError = class extends JSONError {\n\tconstructor(response, data, errorOptions) {\n\t\tsuper(response, data, \"Please verify your email settings\", errorOptions);\n\t}\n};\nvar ValidationError = class extends JSONError {\n\tconstructor(response, data, errorOptions) {\n\t\tsuper(response, data, data.errors[0].message, errorOptions);\n\t}\n};\nvar errorsWithMessage = [\n\tValidationError,\n\tThemeValidationError,\n\tHostLimitError,\n\tEmailError\n];\n/**\n* What the server said went wrong, for showing to a person.\n*\n* The API serializer rewrites `message` to a generic summary and leaves the sentence that\n* explains the failure — and usually what to do about it — in `context`, so that is read\n* first. Any error carrying an API body is read the same way: a caller should not have to\n* know which class it got back to find the text, and reading only one class left every\n* other one showing \"Could not save…\" while the reason sat unread in the payload.\n*/\nfunction getErrorMessage(error, fallback) {\n\tconst apiError = error instanceof JSONError ? error.data?.errors?.[0] : void 0;\n\treturn apiError?.context || apiError?.message || fallback;\n}\nvar AlreadyExistsError = class extends Error {\n\tconstructor(message) {\n\t\tsuper(message);\n\t}\n};\n//#endregion\nexports.APIError = APIError;\nexports.AlreadyExistsError = AlreadyExistsError;\nexports.EmailError = EmailError;\nexports.HostLimitError = HostLimitError;\nexports.JSONError = JSONError;\nexports.MaintenanceError = MaintenanceError;\nexports.RequestEntityTooLargeError = RequestEntityTooLargeError;\nexports.ServerUnreachableError = ServerUnreachableError;\nexports.SessionExpiredError = SessionExpiredError;\nexports.ThemeValidationError = ThemeValidationError;\nexports.TimeoutError = TimeoutError;\nexports.UnauthorizedError = UnauthorizedError;\nexports.UnsupportedMediaTypeError = UnsupportedMediaTypeError;\nexports.ValidationError = ValidationError;\nexports.VersionMismatchError = VersionMismatchError;\nexports.errorsWithMessage = errorsWithMessage;\nexports.getErrorMessage = getErrorMessage;\n\n//# sourceMappingURL=errors.cjs.map","Object.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\n//#region src/utils/helpers.ts\nfunction getGhostPaths() {\n\tconst path = window.location.pathname;\n\tconst subdir = path.substr(0, path.search(\"/ghost/\"));\n\treturn {\n\t\tsubdir,\n\t\tadminRoot: `${subdir}/ghost/`,\n\t\tassetRoot: `${subdir}/ghost/assets/`,\n\t\tapiRoot: `${subdir}/ghost/api/admin`\n\t};\n}\nfunction downloadFile(url) {\n\tlet iframe = document.getElementById(\"iframeDownload\");\n\tif (!iframe) {\n\t\tiframe = document.createElement(\"iframe\");\n\t\tiframe.id = \"iframeDownload\";\n\t\tiframe.style.display = \"none\";\n\t\tdocument.body.append(iframe);\n\t}\n\tiframe.setAttribute(\"src\", url);\n}\nfunction downloadFromEndpoint(path) {\n\tdownloadFile(`${getGhostPaths().apiRoot}${path}`);\n}\n/**\n* Extracts the filename from a `Content-Disposition` header, preferring the\n* RFC 5987 extended form (`filename*=`) over the basic `filename=` form.\n* Returns `undefined` when neither is present.\n*/\nfunction getFilenameFromContentDisposition(header) {\n\tif (!header) return;\n\tconst extendedMatch = header.match(/filename\\*=([^;]+)/i);\n\tif (extendedMatch?.[1]) {\n\t\tconst singleQuote = \"'\";\n\t\tconst extValue = extendedMatch[1].trim();\n\t\tconst firstQuote = extValue.indexOf(singleQuote);\n\t\tconst secondQuote = firstQuote === -1 ? -1 : extValue.indexOf(singleQuote, firstQuote + 1);\n\t\tconst encoded = secondQuote === -1 ? extValue : extValue.slice(secondQuote + 1);\n\t\ttry {\n\t\t\treturn decodeURIComponent(encoded.replace(/^[\"']|[\"']$/g, \"\"));\n\t\t} catch {}\n\t}\n\tconst quotedMatch = header.match(/filename=\"([^\"]*)\"/i);\n\tif (quotedMatch?.[1]) return quotedMatch[1].trim();\n\tconst unquotedMatch = header.match(/filename=([^;]+)/i);\n\tif (unquotedMatch?.[1]) return unquotedMatch[1].trim();\n}\n/**\n* Downloads a file by fetching it as a blob and triggering a browser download.\n* Use this instead of downloadFile/downloadFromEndpoint for streaming responses\n* (e.g. large CSV exports) where the iframe approach may not work reliably.\n*\n* The filename comes from the response's `Content-Disposition` header;\n* `fallbackFilename` is only used when the server omits it.\n*/\nasync function blobDownload(url, fallbackFilename, { signal } = {}) {\n\tconst response = await fetch(url, {\n\t\tmethod: \"GET\",\n\t\tsignal\n\t});\n\tif (!response.ok) throw new Error(`Download failed: ${response.status} ${response.statusText}`);\n\tconst filename = getFilenameFromContentDisposition(response.headers.get(\"content-disposition\")) ?? fallbackFilename ?? \"download\";\n\tconst blob = await response.blob();\n\tconst blobUrl = window.URL.createObjectURL(blob);\n\tconst a = document.createElement(\"a\");\n\ta.href = blobUrl;\n\ta.download = filename;\n\tdocument.body.appendChild(a);\n\ta.click();\n\ta.remove();\n\twindow.URL.revokeObjectURL(blobUrl);\n}\nasync function blobDownloadFromEndpoint(path, fallbackFilename, options = {}) {\n\treturn blobDownload(`${getGhostPaths().apiRoot}${path}`, fallbackFilename, options);\n}\n//#endregion\nexports.blobDownload = blobDownload;\nexports.blobDownloadFromEndpoint = blobDownloadFromEndpoint;\nexports.downloadFile = downloadFile;\nexports.downloadFromEndpoint = downloadFromEndpoint;\nexports.getFilenameFromContentDisposition = getFilenameFromContentDisposition;\nexports.getGhostPaths = getGhostPaths;\n\n//# sourceMappingURL=helpers.cjs.map","let _tanstack_react_query = require(\"@tanstack/react-query\");\n//#region src/utils/query-client.ts\nvar queryClient = window.adminXQueryClient || new _tanstack_react_query.QueryClient({ defaultOptions: { queries: {\n\trefetchOnWindowFocus: false,\n\tstaleTime: 5 * (60 * 1e3),\n\tgcTime: 10 * (60 * 1e3),\n\tretry: false,\n\tnetworkMode: \"always\"\n} } });\nwindow.__TANSTACK_QUERY_CLIENT__ = queryClient;\nif (!window.adminXQueryClient) window.adminXQueryClient = queryClient;\n//#endregion\nmodule.exports = queryClient;\n\n//# sourceMappingURL=query-client.cjs.map","Object.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\n//#region src/utils/recipient-filter.ts\nvar FREE_SEGMENT = \"status:free\";\nvar PAID_SEGMENT = \"status:-free\";\n/**\n* The canonical \"everyone\" spelling. Selecting both the free and paid\n* checkboxes produces this filter, and the server treats it as all members.\n*/\nvar EVERYONE_RECIPIENT_FILTER = `${FREE_SEGMENT},${PAID_SEGMENT}`;\n/** Expands the API's legacy segment sentinels into the filters used by Admin. */\nfunction normalizeRecipientFilter(filter) {\n\tif (filter === \"all\") return EVERYONE_RECIPIENT_FILTER;\n\tif (!filter || filter === \"none\") return null;\n\treturn filter;\n}\nvar BASE_SEGMENTS = [FREE_SEGMENT, PAID_SEGMENT];\n/**\n* Splits a recipient filter into base (free/paid) and specific (label/tier)\n* segments by comma, the way `gh-members-recipient-select` does. This is a\n* plain comma split, not an NQL parse: a specific segment whose value contains\n* a comma is split apart the same way the Ember component splits it.\n*/\nfunction parseRecipientFilter(filter) {\n\tconst items = (filter || \"\").split(\",\");\n\tconst base = [];\n\tconst specific = [];\n\tfor (const item of items) if (BASE_SEGMENTS.includes(item.trim())) {\n\t\tif (!base.includes(item)) base.push(item);\n\t} else if (item.trim() !== \"\") {\n\t\tif (!specific.includes(item)) specific.push(item);\n\t}\n\treturn {\n\t\tfree: base.includes(FREE_SEGMENT),\n\t\tpaid: base.includes(PAID_SEGMENT),\n\t\tbase,\n\t\tspecific\n\t};\n}\n/**\n* Rebuilds a recipient filter string from parsed segments, mirroring\n* `gh-members-recipient-select#updateFilter`: base segments first, then\n* specific segments, deduplicated, joined by comma. Returns `null` for an\n* empty selection (the \"no recipients\" state).\n*\n* `paidAvailable: false` drops the paid segment, matching the component's\n* behavior when Stripe is not connected.\n*/\nfunction buildRecipientFilter(segments, { paidAvailable = true } = {}) {\n\tconst selected = /* @__PURE__ */ new Set([...segments.base, ...segments.specific]);\n\tif (!paidAvailable) selected.delete(PAID_SEGMENT);\n\treturn Array.from(selected).join(\",\") || null;\n}\n/**\n* Classifies a recipient filter the way the publish flow does\n* (`editor/modals/publish-flow.js#recipientType`).\n*\n* The \"all\" case is a substring check, not a segment check, so any filter\n* containing both `status:free` and `status:-free` anywhere classifies as\n* \"all\" even alongside other segments — e.g. `label:x,status:free,status:-free`.\n*/\nfunction getRecipientType(filter) {\n\tif (!filter) return \"none\";\n\tif (filter === \"status:free\") return \"free\";\n\tif (filter === \"status:-free\") return \"paid\";\n\tif (filter.includes(\"status:free\") && filter.includes(\"status:-free\")) return \"all\";\n\treturn \"specific\";\n}\n/**\n* Derives the filter that scopes members to a newsletter's audience\n* (`models/newsletter.js#recipientFilter`): actively subscribed to the\n* newsletter, email not disabled, and paid-only when the newsletter's\n* visibility is `paid`.\n*/\nfunction getNewsletterRecipientFilter({ slug, visibility }) {\n\tconst filter = [`newsletters.slug:${slug}`, \"email_disabled:0\"];\n\tif (visibility === \"paid\") filter.push(PAID_SEGMENT);\n\treturn filter.join(\"+\");\n}\n/**\n* Composes the full filter sent to the email service\n* (`utils/publish-options.js#fullRecipientFilter`): the newsletter's audience\n* filter, optionally AND-ed with the selected recipient filter.\n*/\nfunction getFullRecipientFilter(newsletterRecipientFilter, recipientFilter) {\n\tlet filter = newsletterRecipientFilter;\n\tif (recipientFilter) filter += `+(${recipientFilter})`;\n\treturn filter;\n}\n//#endregion\nexports.EVERYONE_RECIPIENT_FILTER = EVERYONE_RECIPIENT_FILTER;\nexports.FREE_SEGMENT = FREE_SEGMENT;\nexports.PAID_SEGMENT = PAID_SEGMENT;\nexports.buildRecipientFilter = buildRecipientFilter;\nexports.getFullRecipientFilter = getFullRecipientFilter;\nexports.getNewsletterRecipientFilter = getNewsletterRecipientFilter;\nexports.getRecipientType = getRecipientType;\nexports.normalizeRecipientFilter = normalizeRecipientFilter;\nexports.parseRecipientFilter = parseRecipientFilter;\n\n//# sourceMappingURL=recipient-filter.cjs.map",null],"mappings":";AACAA,sCAA+CC,WAC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,KAAKsF,UAAUjO,SAASkO,EAASvS,OAClC,MAAMgN,KAAKoE,eAEnB,WAAAjP,EAAAC,EAAAC,GC7WJ,IAAAwD,EAAA,CACA,YACA,eACA,aACA,gBACA,mBACA,gBACA,mBACA,gBACA,mBACA,gBACA,mBACA,gBACA,mBACA,gBACA,mBACA,gBACA,mBACA,gBACA,YACA,eACA,YACA,eACA,aACA,gBACA,aACA,gBACA,aACA,gBACA,mBACA,gBACA,aACA,gBACA,aACA,gBACA,aACA,gBACA,YACA,eACA,aACA,gBACA,aACA,gBACA,aACA,gBACA,aACA,gBACA,YACA,gBACA,mBACA,gBACA,mBACA,eACA,aACA,gBACA,aACA,gBACA,gBACA,mBACA,gBACA,mBACA,eACA,kBACA,gBACA,mBACA,gBACA,mBACA,eACA,kBACA,gBACA,mBACA,gBACA,mBACA,aACA,gBACA,aACA,gBACA,mBACA,gBACA,mBACA,gBACA,mBACA,gBACA,aACA,gBACA,aACA,gBACA,aACA,gBACA,aACA,gBACA,cACA,iBACA,aACA,gBACA,aACA,gBACA,mBACA,gBACA,mBACA,gBACA,aACA,gBACA,aACA,gBACA,aACA,gBACA,aACA,gBACA,mBACA,sBACA,mBACA,sBACA,aACA,gBACA,aACA,gBACA,aACA,gBACA,YACA,eACA,aACA,gBACA,gBACA,mBACA,aACA,gBACA,aACA,gBACA,aACA,gBACA,mBACA,gBACA,aACA,gBACA,aACA,gBACA,aACA,gBACA,aACA,gBACA,aACA,gBACA,aACA,gBACA,aACA,gBACA,aACA,iBACA,oBACA,gBACA,aACA,gBACA,aACA,gBACA,YACA,eACA,aACA,gBACA,aACA,gBACA,aACA,gBACA,aACA,gBACA,aACA,gBACA,aACA,gBACA,aACA,gBACA,YACA,eACA,aACA,gBACA,mBACA,gBACA,aACA,gBACA,YACA,eACA,YACA,eACA,aACA,gBACA,aACA,gBACA,mBACA,gBACA,aACA,gBACA,iBACA,oBACA,gBACA,mBACA,YACA,eACA,aACA,gBACA,mBACA,gBACA,aACA,gBACA,a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