r",()=>u);var n=o("gwFzn");let i="CuratedDefinitionQuery",s=`
query ${i}(
		$workspaceId: String!
		$keyPhrase: String!
		$confluenceScopeId: KnowledgeDiscoveryDefinitionScopeIdConfluence
		$jiraScopeId: KnowledgeDiscoveryDefinitionScopeIdJira
	) {
		knowledgeDiscovery {
			definition(
				workspaceId: $workspaceId
				keyPhrase: $keyPhrase
				confluenceScopeId: $confluenceScopeId
				jiraScopeId: $jiraScopeId
			) @optIn(to: "KnowledgeDiscovery Get definition") {
				__typename
				... on KnowledgeDiscoveryDefinition {
					definition
					accountId
					createdAt
					editor {
						... on User {
							name
							accountId
						}
					}
					referenceUrl
					confluenceEntity {
						... on ConfluencePage {
							id
							type
							title
							space {
								name
							}
						}
						... on ConfluenceBlogPost {
							id
							type
							title
							space {
								name
							}
						}
					}
				}
				... on QueryError {
					message
				}
			}
		}
	}
`,a=`
query PrecomputedDefinitionQuery(
		$workspaceId: String!
		$keyPhrase: String!
        $contentId: String!
	) {
		knowledgeDiscovery {
			autoDefinition(
				workspaceId: $workspaceId
				keyPhrase: $keyPhrase
				contentId: $contentId
			) @optIn(to: "KnowledgeDiscovery Get auto definition") {
				__typename
				... on KnowledgeDiscoveryAutoDefinition {
					definition
                    createdAt
					confluenceEntity {
						... on ConfluencePage {
							id
							type
							title
							space {
								name
							}
                            links {
                                base
                                webUi
                            }
						}
						... on ConfluenceBlogPost {
							id
							type
							title
							space {
								name
							}
                            links {
                                base
                                webUi
                            }
						}
					}
				}
				... on QueryError {
					message
                    extensions {
                        statusCode
                        errorType
                    }
				}
			}
		}
	}
`,d=e=>{let t=e.confluenceEntity;return{nlpResult:e.definition,uniqueSources:t?[{id:t?.id||"",title:t?.title||"",url:"referenceUrl"in e?e.referenceUrl||"":"links"in t&&t.links.base&&t.links.webUi?`${t.links.base}${t.links.webUi}`:"",type:t?.type||"",product:"Confluence",lastModified:"",iconUrl:"",spaceName:t?.space?.name||"",spaceUrl:null}]:[],nlpResultEditor:"editor"in e?{name:e.editor?.name||"",id:e.editor?.accountId||""}:void 0,disclaimer:null,errorState:null,format:o("7Zbm6").NLPSearchResultFormat.MARKDOWN,customDefinitionType:"editor"in e?o("7Zbm6").NLPSearchCustomDefinitionType.CURATED:o("7Zbm6").NLPSearchCustomDefinitionType.PRECOMPUTED}},l=(0,o("2nPZH").defineMessages)({searchAiDialogQueryPretext:{id:"contextual-reading-aids.search-ai-dialog.query-pretext",defaultMessage:"what is {queryText}?"}}),c="No matching scope for Definition",u=({workspaceId:e,cloudIdARI:t,fetchConfig:r,isDefinitionCurationEnabled:u,productConfig:p,product:g})=>{let h=(0,o("dBxQj").default)(),[m,f]=(0,n.useState)(!0),{fireAnalyticsEvent:y,commonAttributes:x}=(0,o("eRXI0").useAIAnswerContext)(),{contentId:w}=p,v=(0,n.useCallback)(async({variables:n})=>{let{query:i,locale:s,additional_context:u,experience:p,followUpsEnabled:m}=n;if(""!==w)try{let r=await (0,o("9EFEY").fetchAggResponse)({graphQuery:a,variables:{workspaceId:e,keyPhrase:n.query,contentId:w},headers:(0,o("6yuru").createAtlAttributionHeader)({atlWorkspaceId:e,tenantId:t,product:g})});if(r.data&&!r.data.knowledgeDiscovery.autoDefinition.message){let e={nlpSearch:d(r.data.knowledgeDiscovery.autoDefinition)};return f(!1),e}if(r.data&&r.data.knowledgeDiscovery.autoDefinition.message)throw Error(r.data.knowledgeDiscovery.autoDefinition.message);throw Error("Something went wrong with fetching precomputed definition")}catch(e){e instanceof Object&&"message"in e&&e.message!==c&&y((0,o("xhg8G").fetchPrecomputedDefinitionErrorPayload)(e,x))}let v={variables:{query:h.formatMessage(l.searchAiDialogQueryPretext,{queryText:i}),locale:s,cloudIdARI:t,additional_context:u,experience:p,followUpsEnabled:m},isReadingAids:!0,fetchConfig:r,generatorConfig:{yieldAnswerPart:!0,yieldFinalResponse:!0},onStreamFinalResponse:()=>{f(!1)}};return{type:o("7Zbm6").AIAnswerAPIType.STREAM,stream:(0,o("5Ymlp").aiDefinitionsStreamFetchConvoAIService)(v)}},[t,r,h,x,y,e,w,g]);return{fetchDefinition:(0,n.useCallback)(async({variables:r})=>{if(u)try{let n,a;"spaceId"in p?n=p:"projectId"in p&&(a={projectId:p.projectId});let l=await (0,o("9EFEY").fetchAggResponse)({graphQuery:s,variables:{workspaceId:e,keyPhrase:r.query,confluenceScopeId:n,jiraScopeId:a},operationName:i,headers:(0,o("6yuru").createAtlAttributionHeader)({atlWorkspaceId:e,tenantId:t,product:g})});if(l.data&&!l.data.knowledgeDiscovery.definition.message){let e={nlpSearch:d(l.data.knowledgeDiscovery.definition)};return f(!1),e}if(l.data&&l.data.knowledgeDiscovery.definition.message)throw Error(l.data.knowledgeDiscovery.definition.message);throw Error("Something went wrong with fetching curated definition")}catch(e){e instanceof Object&&"message"in e&&e.message!==c&&y((0,o("xhg8G").fetchCuratedDefinitionErrorPayload)(e,x))}return v({variables:r})},[p,v,u,e,x,y,t,g]),loading:m}}}),s("eRXI0",function(r,n){e(r.exports,"AIAnswerContext",()=>a),e(r.exports,"useAIAnswerContext",()=>d);var i=o("gwFzn");let s={cloudId:"",query:"",queryHash:"",baseQueryHash:"",source:"",searchSessionId:"",answerString:"",answerLength:0,answerWordCount:0,answerFormat:null,answerCardType:"SAIN",sources:[],followUps:[],errorStateSuggestedQueries:[],errorState:null,extraAttributes:{},apiSource:"cc-search-nlp",workspaceId:"",sessionId:"",brand:o("f7lNm").AiBrand.AI,orgId:""},a=t(i).createContext({loading:void 0,isAnswered:!1,hasError:!1,advancedSearchUrl:void 0,onNavigate:()=>{},updateContextCache:()=>{},fireAnalyticsEvent:()=>{},setQuery:()=>{},setData:()=>{},userDetails:{},disclaimer:null,commonAttributes:s,initialCollapsed:void 0,liked:void 0,setLiked:()=>{},likesDisabled:!1,setLikesDisabled:()=>{},initialReported:void 0,isReadingAids:!1,cardProviderProps:void 0,baseQuery:void 0,smartAnswersRoute:o("f7lNm").QueryIntent.DEFAULT,cardTemplate:o("f7lNm").CardTemplate.DEFAULT,brand:o("f7lNm").AiBrand.AI,answerEditor:void 0,closeParentDialog:()=>{},showGenericFooter:!1,initiallyExpanded:!1}),d=()=>(0,i.useContext)(a)}),s("5Ymlp",function(t,r){e(t.exports,"sainStreamFetchHandlerAssistanceService",()=>g),e(t.exports,"sainStreamFetchConvoAIService",()=>h),e(t.exports,"aiDefinitionsStreamFetchConvoAIService",()=>m);let n=e=>e instanceof Object&&"FINAL_RESPONSE"===e.type,i=e=>e instanceof Object&&"ERROR"===e.type,s=e=>e instanceof Object&&"ANSWER_PART"===e.type,a=e=>e instanceof Object&&"TRACE"===e.type,d=e=>e instanceof Object&&"FOLLOW_UP_QUERIES"===e.type,l=e=>e instanceof Object&&"ERROR_STATE_QUERY_SUGGESTIONS"===e.type;function c(e){return e?{named_id:"reading_aids_agent",experience:"reading-aids"}:{named_id:"sain_agent",experience:"sain"}}function u(e){return i(e)?{type:o("7Zbm6").AIAnswerQueryStreamType.FinalResponse,message:{errorState:function(e){switch("message_template"in e?e.message_template:e.message.message_template){case"NO_ANSWER_LLM":return o("7Zbm6").NLPSearchErrorState.NoAnswer;case"NO_ANSWER_PEOPLE":return o("7Zbm6").NLPSearchErrorState.NoAnswerWhoQuestion;case"NO_ANSWER_KEYWORDS":return o("7Zbm6").NLPSearchErrorState.NoAnswerKeywords;case"NO_ANSWER_SEARCH_QA_PLUGIN":return o("7Zbm6").NLPSearchErrorState.NoAnswerSearchResults;case"ACCEPTABLE_USE_VIOLATIONS":return o("7Zbm6").NLPSearchErrorState.AcceptableUseViolation;case"OPENAI_RATE_LIMIT_USER_ABUSE":return o("7Zbm6").NLPSearchErrorState.NoAnswerOpenAIRateLimitUserAbuse;case"FEATURE_DISABLED_ON_SITE":return o("7Zbm6").NLPSearchErrorState.AIDisabled;default:return o("7Zbm6").NLPSearchErrorState.NetworkError}}(e),errorCode:e.message.status_code,disclaimer:null,format:o("7Zbm6").NLPSearchResultFormat.MARKDOWN,uniqueSources:[]}}:a(e)?{type:o("7Zbm6").AIAnswerQueryStreamType.Trace,message:e.message.content}:s(e)?{type:o("7Zbm6").AIAnswerQueryStreamType.AnswerPart,message:{nlpResult:e.message.content}}:n(e)?{type:o("7Zbm6").AIAnswerQueryStreamType.FinalResponse,message:function(e){let t=e.message||e;return{nlpResult:t.content,uniqueSources:e.sources?e.sources.map(e=>({ari:e.ari,id:e.id?.toString(),title:e.title,product:e.product,type:e.type,url:e.url,lastModified:e.lastModified,iconUrl:null,spaceName:null,spaceUrl:null})):[],disclaimer:t.message_metadata?.disclaimer??null,errorState:null,format:function(e){switch(e){case"text/markdown":default:return o("7Zbm6").NLPSearchResultFormat.MARKDOWN;case"text/adf":return o("7Zbm6").NLPSearchResultFormat.ADF;case"text/json":return o("7Zbm6").NLPSearchResultFormat.JSON}}(t.content_mime_type),extraAPIAnalyticsAttributes:{message_id:t.id,conversational_channel_id:t.conversation_channel_id,experience_id:t.experience_id,user_id:t.user_ari?.replace("ari:cloud:identity::user/","")??null}}}(e.message)}:d(e)?{type:"follow-up",queries:e.message.follow_up_queries??[]}:l(e)?{type:o("7Zbm6").AIAnswerQueryStreamType.ErrorStateQuerySuggestions,suggested_queries:e.message.suggested_queries??[]}:{type:"other"}}let p=({variables:e,fetchConfig:t})=>{let{query:r,locale:n,additional_context:i}=e||{};return{content:r,locale:n,additional_context:i,entity_ari:t?.entity_ari}};async function*g({fetchReturn:e,variables:t,isReadingAids:r,fetchConfig:n,generatorConfig:i={yieldAnswerPart:!0,yieldFinalResponse:!1},onStreamFinalResponse:s}){try{let{filters:a,selectedProduct:d}=t||{},{experience:l,named_id:g}=c(r),h=`${n?.hostName||""}${o("f7lNm").ASSISTANCE_SERVICE_API_BASE_URL}/chat/v1/invoke_agent/stream`,m=[{confluenceFilters:a}];d&&m.push({knowledgeSources:[d]});let f=await (e||fetch(h,{method:"POST",headers:{"Content-Type":"application/json","X-Product":"confluence","X-Experience-Id":l,...n?.headers?n.headers:{}},body:JSON.stringify({recipient_agent_named_id:g,agent_input:{...p({variables:t,fetchConfig:n}),filters:(0,o("dh538").fg)("kd_sain_enable_source_filtering")?a?m:void 0:a}}),credentials:n?.credentials||"same-origin",signal:n?.timeout?AbortSignal.timeout(n?.timeout):void 0}));if(!f.body)return{state:"failed",reason:"backend",details:"response.body missing",errorCode:f.status};try{let e,r=f.body.getReader(),n=new TextDecoder("utf-8"),a="",d=!1;for(yield{type:o("7Zbm6").AIAnswerQueryStreamType.AnswerType,message:{format:o("7Zbm6").NLPSearchResultFormat.MARKDOWN}};!d;){let{value:l,done:c}=await r.read();d=c;let p=n.decode(l),g=(a+=p).split("\n");if(!f.ok){let e=JSON.parse(g[0]);if(e?.errors.includes(o("7Zbm6").NLPSearchErrorCodes.HIPAA_ENABLED_ERROR))return{state:"failed",reason:"backend",details:o("7Zbm6").NLPSearchErrorCodes.HIPAA_ENABLED_ERROR,errorCode:f.status};return{state:"failed",reason:"backend",details:"Unhandled error response received",errorCode:f.status}}for(;g.length>1;){let r=g.shift(),n=u(JSON.parse(r));if("other"!==n.type)if(n.type===o("7Zbm6").AIAnswerQueryStreamType.AnswerType||n.type===o("7Zbm6").AIAnswerQueryStreamType.AnswerPart||n.type===o("7Zbm6").AIAnswerQueryStreamType.Trace||n.type===o("7Zbm6").AIAnswerQueryStreamType.ErrorStateQuerySuggestions)i.yieldAnswerPart&&(yield n);else if("follow-up"===n.type){if(!e?.message||!t?.followUpsEnabled)continue;e.message.nlpFollowUpResults={followUps:n.queries},d=!0}else e=n,s?.(),t?.followUpsEnabled||(d=!0),i.yieldFinalResponse&&(yield e)}a=g[0]}if(e?.type!==o("7Zbm6").AIAnswerQueryStreamType.FinalResponse)return{state:"failed",reason:"parsing",error:"Unexpected final response value"};return{state:"complete",value:e}}catch(e){return{state:"failed",reason:"parsing",error:e}}}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)return{state:"failed",reason:"aborted"};if(e instanceof DOMException&&"TimeoutError"===e.name)return{state:"failed",reason:"timeout"};if(e instanceof Error)return{state:"failed",reason:"error",details:e.message,error:e};return{state:"failed",reason:"unknown"}}}async function*h({fetchReturn:e,variables:t,isReadingAids:r,fetchConfig:n,generatorConfig:i={yieldAnswerPart:!0,yieldFinalResponse:!1},onStreamFinalResponse:s}){try{let{filters:a,selectedProduct:d}=t||{},{experience:l,named_id:g}=c(r),h=`${n?.hostName||""}${o("f7lNm").ASSISTANCE_SERVICE_API_BASE_URL}/rovo/v1/sain/stream`,m=[{confluenceFilters:a}];d&&m.push({knowledgeSources:[d]});let f=await (e||fetch(h,{method:"POST",headers:{"Content-Type":"application/json","X-Product":"confluence","X-Experience-Id":l,...n?.headers?n.headers:{}},body:JSON.stringify({recipient_agent_named_id:g,agent_input:{...p({variables:t,fetchConfig:n}),filters:(0,o("dh538").fg)("kd_sain_enable_source_filtering")?a?m:void 0:a}}),credentials:n?.credentials||"same-origin",signal:n?.timeout?AbortSignal.timeout(n?.timeout):void 0}));if(!f.body)return{state:"failed",reason:"backend",details:"response.body missing",errorCode:f.status};try{let e,r=f.body.getReader(),n=new TextDecoder("utf-8"),a="",d=!1;for(yield{type:o("7Zbm6").AIAnswerQueryStreamType.AnswerType,message:{format:o("7Zbm6").NLPSearchResultFormat.MARKDOWN}};!d;){let{value:l,done:c}=await r.read();d=c;let p=n.decode(l),g=(a+=p).split("\n");if(!f.ok){let e=JSON.parse(g[0]);if(e?.errors.includes(o("7Zbm6").NLPSearchErrorCodes.HIPAA_ENABLED_ERROR))return{state:"failed",reason:"backend",details:o("7Zbm6").NLPSearchErrorCodes.HIPAA_ENABLED_ERROR,errorCode:f.status};return{state:"failed",reason:"backend",details:"Unhandled error response received",errorCode:f.status}}for(;g.length>1;){let r=g.shift(),n=u(JSON.parse(r));if("other"!==n.type)if(n.type===o("7Zbm6").AIAnswerQueryStreamType.AnswerType||n.type===o("7Zbm6").AIAnswerQueryStreamType.AnswerPart||n.type===o("7Zbm6").AIAnswerQueryStreamType.Trace)i.yieldAnswerPart&&(yield n);else if("follow-up"===n.type){if(!e?.message||!t?.followUpsEnabled)continue;e.message.nlpFollowUpResults={followUps:n.queries};let{serveExperiment:r}=(0,o("iA4lt").getFrontendExperiment)({abTestId:"kd_sain_show_no_answer_suggestions_exp"});r||(d=!0)}else if(n.type===o("7Zbm6").AIAnswerQueryStreamType.ErrorStateQuerySuggestions){if(!e?.message)continue;e.message.nlpSuggestedQueries=n.suggested_queries,d=!0}else e=n,s?.(),t?.followUpsEnabled||(d=!0),i.yieldFinalResponse&&(yield e)}a=g[0]}if(e?.type!==o("7Zbm6").AIAnswerQueryStreamType.FinalResponse)return{state:"failed",reason:"parsing",error:"Unexpected final response value"};return{state:"complete",value:e}}catch(e){return{state:"failed",reason:"parsing",error:e}}}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)return{state:"failed",reason:"aborted"};if(e instanceof DOMException&&"TimeoutError"===e.name)return{state:"failed",reason:"timeout"};if(e instanceof Error)return{state:"failed",reason:"error",details:e.message,error:e};return{state:"failed",reason:"unknown"}}}async function*m({fetchReturn:e,variables:t,fetchConfig:r,generatorConfig:n={yieldAnswerPart:!0,yieldFinalResponse:!1},onStreamFinalResponse:i}){try{let s=`${r?.hostName||""}${o("f7lNm").ASSISTANCE_SERVICE_API_BASE_URL}/rovo/v1/ai-definition`,a=await (e||fetch(s,{method:"POST",headers:{"Content-Type":"application/json","X-Product":"confluence","X-Experience-Id":"reading-aids",...r?.headers?r.headers:{}},body:JSON.stringify({...p({variables:t,fetchConfig:r})}),credentials:r?.credentials||"same-origin",signal:r?.timeout?AbortSignal.timeout(r?.timeout):void 0}));if(!a.body)return{state:"failed",reason:"backend",details:"response.body missing",errorCode:a.status};try{let e,r=a.body.getReader(),s=new TextDecoder("utf-8"),d="",l=!1;for(yield{type:o("7Zbm6").AIAnswerQueryStreamType.AnswerType,message:{format:o("7Zbm6").NLPSearchResultFormat.MARKDOWN}};!l;){let{value:c,done:p}=await r.read();l=p;let g=s.decode(c),h=(d+=g).split("\n");if(!a.ok){let e=JSON.parse(h[0]);if(e?.errors.includes(o("7Zbm6").NLPSearchErrorCodes.HIPAA_ENABLED_ERROR))return{state:"failed",reason:"backend",details:o("7Zbm6").NLPSearchErrorCodes.HIPAA_ENABLED_ERROR,errorCode:a.status};return{state:"failed",reason:"backend",details:"Unhandled error response received",errorCode:a.status}}for(;h.length>1;){let r=h.shift(),s=u(JSON.parse(r));if("other"!==s.type)if(s.type===o("7Zbm6").AIAnswerQueryStreamType.AnswerType||s.type===o("7Zbm6").AIAnswerQueryStreamType.AnswerPart||s.type===o("7Zbm6").AIAnswerQueryStreamType.Trace)n.yieldAnswerPart&&(yield s);else if("follow-up"===s.type){if(!e?.message||!t?.followUpsEnabled)continue;e.message.nlpFollowUpResults={followUps:s.queries};let{serveExperiment:r}=(0,o("iA4lt").getFrontendExperiment)({abTestId:"kd_sain_show_no_answer_suggestions_exp"});r||(l=!0)}else if(s.type===o("7Zbm6").AIAnswerQueryStreamType.ErrorStateQuerySuggestions){if(!e?.message)continue;e.message.nlpSuggestedQueries=s.suggested_queries,l=!0}else e=s,i?.(),t?.followUpsEnabled||(l=!0),n.yieldFinalResponse&&(yield e)}d=h[0]}if(e?.type!==o("7Zbm6").AIAnswerQueryStreamType.FinalResponse)return{state:"failed",reason:"parsing",error:"Unexpected final response value"};return{state:"complete",value:e}}catch(e){return{state:"failed",reason:"parsing",error:e}}}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)return{state:"failed",reason:"aborted"};if(e instanceof DOMException&&"TimeoutError"===e.name)return{state:"failed",reason:"timeout"};if(e instanceof Error)return{state:"failed",reason:"error",details:e.message,error:e};return{state:"failed",reason:"unknown"}}}}),s("iA4lt",function(t,r){e(t.exports,"getFrontendExperiment",()=>s),e(t.exports,"createFeatureGateHandler",()=>a),e(t.exports,"createFrontendExperimentHandler",()=>d);var n,i=((n={}).Default="not-enrolled",n.Control="control",n.Test="test",n);let s=({abTestId:e,onError:t})=>{try{let t=o("c6GJD").default.getExperiment(e).get("cohort",i.Default);return{serveExperiment:t===i.Test,abTestId:e,cohort:t}}catch(e){t?.(e)}return{serveExperiment:!1,abTestId:e,cohort:i.Default}},a=e=>{if(o("c6GJD").default.checkGate("search-experiment-overrides-killswitch")||!e)return l;try{let t=e.filter(e=>"gate"===e.type);return e=>!!t.find(t=>"name"in t&&t.name===e)||l(e)}catch(e){return console.error(e),l}},d=e=>{if(o("c6GJD").default.checkGate("search-experiment-overrides-killswitch")||!e)return s;try{let t=e.filter(e=>"experiment"===e.type);return({abTestId:e,onError:r})=>{let n=t.find(t=>"name"in t&&t.name===e);return n?{abTestId:e,serveExperiment:!0,cohort:"cohort"in n?n.cohort:i.Test}:s({abTestId:e,onError:r})}}catch(e){return console.error(e),s}},l=e=>o("c6GJD").default.checkGate(e)}),s("xhg8G",function(t,r){e(t.exports,"fetchCuratedDefinitionErrorPayload",()=>n),e(t.exports,"fetchPrecomputedDefinitionErrorPayload",()=>i),e(t.exports,"updateDefinitionErrorPayload",()=>s),e(t.exports,"toggleDefinitionErrorPayload",()=>a);let n=(e,t)=>{let{extraAttributes:r,source:n}=t;return{action:"failed",actionSubject:"aiCuratedDefinitionFetch",source:n,eventType:"track",attributes:{...(0,o("cqFuK").sanitizeExtraAttributes)(r),errorName:e instanceof Object&&"name"in e?e.name:"",errorMessage:e instanceof Object&&"message"in e?e.message:"",errorStack:e instanceof Object&&"stack"in e&&"string"==typeof e.stack?e.stack?.split("\n").at(1):""}}},i=(e,t)=>{let{extraAttributes:r,source:n}=t;return{action:"failed",actionSubject:"aiPrecomputedDefinitionFetch",source:n,eventType:"track",attributes:{...(0,o("cqFuK").sanitizeExtraAttributes)(r),errorName:e instanceof Object&&"name"in e?e.name:"",errorMessage:e instanceof Object&&"message"in e?e.message:"",errorStack:e instanceof Object&&"stack"in e&&"string"==typeof e.stack?e.stack?.split("\n").at(1):""}}},s=(e,t)=>{let{extraAttributes:r,source:n}=t;return{action:"failed",actionSubject:"aiCuratedDefinitionUpdate",source:n,eventType:"track",attributes:{...(0,o("cqFuK").sanitizeExtraAttributes)(r),errorName:e instanceof Object&&"name"in e?e.name:"",errorMessage:e instanceof Object&&"message"in e?e.message:"",errorStack:e instanceof Object&&"stack"in e&&"string"==typeof e.stack?e.stack?.split("\n").at(1):""}}},a=(e,t)=>{let{extraAttributes:r,source:n}=t;return{action:"failed",actionSubject:"aiDefinitionToggle",source:n,eventType:"track",attributes:{...(0,o("cqFuK").sanitizeExtraAttributes)(r),errorName:e instanceof Object&&"name"in e?e.name:"",errorMessage:e instanceof Object&&"message"in e?e.message:"",errorStack:e instanceof Object&&"stack"in e&&"string"==typeof e.stack?e.stack?.split("\n").at(1):""}}}}),s("cVtio",function(t,r){e(t.exports,"useAnalytics",()=>i);var n=o("gwFzn");let i=()=>{let{createAnalyticsEvent:e}=(0,o("inPa6").useAnalyticsEvents)();return[(0,n.useCallback)(t=>{e(t).fire(o("f7lNm").DEFAULT_GAS_CHANNEL)},[e])]}}),s("7DCm4",function(t,r){e(t.exports,"aiDefinitionsLoadUFOExperience",()=>i);let n="search-ai-definitions",i=new(0,o("5aVN7").UFOExperience)(`${n}-load`,{type:o("9NDUe").ExperienceTypes.Experience,performanceType:o("9NDUe").ExperiencePerformanceTypes.InlineResult,platform:{component:n}})}),s("jWDKZ",function(t,r){e(t.exports,"useTextHighlighterClickNative",()=>i),e(t.exports,"useTextHighlighterClick",()=>s);var n=o("gwFzn");let i=({singleClickCallback:e,doubleClickCallback:t,delay:r=250})=>{let[i,o]=(0,n.useState)({e:null});return(0,n.useEffect)(()=>{if(!i.e)return;let n=setTimeout(()=>{i.e?.detail===1?e(i.e):i.e?.detail&&i.e.detail>1&&t(i.e),o({e:null})},r);return()=>clearTimeout(n)},[i,e,t,r]),e=>{o({e:e})}},s=({singleClickCallback:e,doubleClickCallback:t,delay:r=250})=>{let[i,o]=(0,n.useState)({click:0,e:null});return(0,n.useEffect)(()=>{if(!i.e)return;let n=setTimeout(()=>{1===i.click&&e(i.e),o({e:null,click:0})},r);return 2===i.click&&t(i.e),()=>clearTimeout(n)},[i,e,t,r]),e=>{o({click:i.click+1,e:e})}}}),s("7wVkn",function(t,r){e(t.exports,"DefinitionPopup",()=>d);var n=o("7UHDa"),i=o("gwFzn");let s=(0,i.forwardRef)(({children:e,...t},r)=>(0,n.jsx)("span",{...t,ref:r,className:(0,o("35pXk").default)(["_1pbyowjs"]),children:e})),a=(0,i.lazy)(()=>o("1Kx95").then(e=>({default:e.DefinitionPopupContent})));function d({onClose:e,triggerPosition:t,onLoad:r,...d}){let l={height:`${t.height}px`,left:`${t.left}px`,top:`${t.top}px`,width:`${t.width}px`};return(0,n.jsx)(o("lGgRw").default,{content:({update:t})=>(0,n.jsx)(i.Suspense,{fallback:null,children:(0,n.jsx)(a,{...d,onClose:e,onLoad:()=>{r?.(),t()}})}),onClose:e,placement:"bottom-start",popupComponent:s,trigger:e=>(0,n.jsx)("span",{...e,style:l,"data-testid":"definition-popup-trigger",className:(0,o("35pXk").default)(["_tzy4idpf _kqswstnw _lcxvglyw _bfhk18uv _1ltvidpf _94n5idpf"])}),isOpen:!0})}}),s("1Kx95",function(e,t){let r=o("lhnSv")(5);e.exports=Promise.all([r("74AOw"),r("2Hpbt"),r("8rplE"),r("3jrkO"),r("4yQQA"),r("lmEoo"),r("idIgm"),r("2YffH"),r("lvdR8"),r("iDB1L"),r("bWcRJ"),r("jHyRA"),r("iLPCI"),r("gXsXx"),r("etlLt"),r("eEyVs"),r("3RGYS"),r("2nuGi"),r("2BCvs"),r("5GHZI"),r("hqz9s"),r("kvx00"),r("f7l7g"),r("8ucpZ"),r("a4yJG"),r("gryT8"),r("ej4rO"),r("4KH4C"),r("iJYTr"),r("St9Nk"),r("8lF3J"),r("8JZKd"),r("7jH9e"),r("15Tws"),r("ax9Fx"),r("1bh3I"),r("k1gI7"),r("g9CVe"),r("b3pUg"),r("jXyvy"),r("Wowvf"),r("6wr18"),r("kjZZD"),r("fMu57"),r("1XTiW"),r("gzUI2"),r("iZh6e"),r("dTsOE"),r("6qah4"),r("hhss7"),r("aZinD"),r("c6MKV"),r("ffEVr"),r("6Yu8N"),r("hsF0G"),r("7EorR"),r("77ceh")]).then(()=>o("bA47i"))}),s("lhnSv",function(e,t){e.exports=e=>t=>import(o("9WHwv").shardUrl(o("fzRTW").resolve(t),e))}),s("9WHwv",function(e,t){Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.applyShardToDomain=s,e.exports.domainShardingKey=void 0,e.exports.getDomainShardIndex=n,e.exports.shardUrl=function(e,t){return globalThis[r]?a(e,t):e},e.exports.shardUrlUnchecked=a;let r="__ATLASPACK_ENABLE_DOMAIN_SHARDS";function n(e,t){let r=t+1,n=e.split("").reduce((e,t)=>{let n=(e<<r)-e+t.charCodeAt(0);return n&n},0);return(n%=r)<0&&(n+=r),n}let i=/-\d+$/;function o(e){if(!i.test(e))return e;let t=e.lastIndexOf("-");return e.slice(0,t)}function s(e,t){let r=e.indexOf("."),n=0===t?"":`-${t-1}`;if(-1===r)return`${o(e)}${n}`;let i=o(e.slice(0,r));return`${i}${n}${e.slice(r)}`}function a(e,t){let r=new URL(e),i=n(function(e){let t=e.lastIndexOf("/");if(-1===t||t===e.length-1)throw Error("Expected an absolute URL with a file name, unable to apply sharding.");return e.slice(t+1)}(r.pathname),t);return r.hostname=s(r.hostname,i),r.toString()}e.exports.domainShardingKey=r}),s("fzRTW",function(t,r){e(t.exports,"register",()=>n,e=>n=e),e(t.exports,"resolve",()=>i,e=>i=e);var n,i,o=new Map;n=function(e,t){for(var r=0;r<t.length-1;r+=2)o.set(t[r],{baseUrl:e,path:t[r+1]})},i=function(e){var t=o.get(e);if(null==t)throw Error("Could not resolve bundle with id "+e);return new URL(t.path,t.baseUrl).toString()}}),s("9KkVf",function(t,r){e(t.exports,"EditedDefinitionScope",()=>i);var n,i=((n={}).SPACE="SPACE",n.PAGE="PAGE",n.BLOGPOST="BLOGPOST",n.ORGANIZATION="ORGANIZATION",n.PROJECT="PROJECT",n)}),s("gjBRE",function(r,n){e(r.exports,"ExtensionNode",()=>a),e(r.exports,"default",()=>d);var i=o("gwFzn"),s=o("fPlBD");class a extends o("2gkmX").default{ignoreMutation(e){return this.node.type.isAtom||"selection"!==e.type&&"data-layout"!==e.attributeName}createDomRef(){if(!(0,o("dh538").fg)("confluence_connect_macro_preset_height"))return super.createDomRef();if(!this.node.isInline){let e=document.createElement("div"),t=this.reactComponentProps?.extensionNodeViewOptions?.getExtensionHeight?.(this.node);return t&&e.style.setProperty("min-height",`${t}px`),e}return document.createElement("span")}stopEvent(e){return e.target instanceof HTMLInputElement&&(0,o("dh538").fg)("interactable_in_editor_inputs")}getContentDOM(){if(this.node.isInline)return;let e=document.createElement("div");return e.className=`${this.node.type.name}-content-dom-wrapper`,{dom:e}}render(e,r){return t(i).createElement(o("3oRlx").ExtensionNodeWrapper,{nodeType:this.node.type.name,macroInteractionDesignFeatureFlags:e.macroInteractionDesignFeatureFlags},t(i).createElement(s.Extension,{editorView:this.view,node:this.node,eventDispatcher:this.eventDispatcher,getPos:this.getPos,providerFactory:e.providerFactory,handleContentDOMRef:r,extensionHandlers:e.extensionHandlers,editorAppearance:e.extensionNodeViewOptions?.appearance,pluginInjectionApi:e.pluginInjectionApi,macroInteractionDesignFeatureFlags:e.macroInteractionDesignFeatureFlags,showLivePagesBodiedMacrosRendererView:e.showLivePagesBodiedMacrosRendererView,showUpdatedLivePages1PBodiedExtensionUI:e.showUpdatedLivePages1PBodiedExtensionUI,rendererExtensionHandlers:e.rendererExtensionHandlers}))}}function d(e,t,r,n,i,o,s,d,l,c){return(u,p,g)=>new a(u,p,g,e,t,{providerFactory:r,extensionHandlers:n,extensionNodeViewOptions:i,pluginInjectionApi:o,macroInteractionDesignFeatureFlags:s,showLivePagesBodiedMacrosRendererView:d,showUpdatedLivePages1PBodiedExtensionUI:l,rendererExtensionHandlers:c}).init()}}),s("fPlBD",function(r,n){e(r.exports,"Extension",()=>a);var i=o("gwFzn"),s=o("dhO1r");class a extends i.Component{componentWillUnmount(){this.props.providerFactory||this.providerFactory.destroy()}render(){return t(i).createElement(o("dYBVS").WithProviders,{providers:["extensionProvider"],providerFactory:this.providerFactory,renderNode:this.renderWithProvider})}constructor(e){super(e),this.providerFactory=void 0,this.renderWithProvider=({extensionProvider:e})=>{let{node:r,getPos:n,editorView:o,handleContentDOMRef:a,extensionHandlers:d,references:l,editorAppearance:c,pluginInjectionApi:u,eventDispatcher:p,macroInteractionDesignFeatureFlags:g,showLivePagesBodiedMacrosRendererView:h,showUpdatedLivePages1PBodiedExtensionUI:m,rendererExtensionHandlers:f}=this.props,{contentMode:y,mode:x}=u?.editorViewMode?.sharedState?.currentState()||{};return t(i).createElement(s.ExtensionComponent,{editorView:o,node:r,getPos:n,references:l,extensionProvider:e,handleContentDOMRef:a,extensionHandlers:d,editorAppearance:c,pluginInjectionApi:u,eventDispatcher:p,macroInteractionDesignFeatureFlags:g,showLivePagesBodiedMacrosRendererView:h,showUpdatedLivePages1PBodiedExtensionUI:m,rendererExtensionHandlers:f,isLivePageViewMode:"live-view"===y||"view"===x})},this.providerFactory=e.providerFactory||new(0,o("4FxUL").default)}}a.displayName="Extension"}),s("dhO1r",function(r,n){e(r.exports,"ExtensionComponent",()=>en);var i=o("gwFzn"),s=o("heH5c"),i=o("gwFzn"),a=o("6qIXK"),d=o("1oCLl"),i=o("gwFzn");let l={name:"1vvxzwe",styles:"background:var(--ds-background-neutral, #091E420F);border-radius:var(--ds-border-radius, 3px);position:relative;vertical-align:middle;&.with-overlay{.extension-overlay{background:var(--ds-background-neutral-hovered, #091E4224);color:transparent;}&:hover .extension-overlay{opacity:1;}}"},c={name:"1osm8if",styles:"border-radius:var(--ds-border-radius, 3px);position:absolute;width:100%;height:100%;opacity:0;pointer-events:none;transition:opacity 0.3s;top:0;left:0"},u=(0,o("3jLHL").css)({display:"inline-flex",alignItems:"center","& > img":{margin:"0 var(--ds-space-050, 4px)"},label:"placeholder-fallback"}),p={name:"z0o3d",styles:"display:inline-block;max-width:200px;margin-left:var(--ds-space-050, 4px);color:var(--ds-text-subtlest, #626F86);text-overflow:ellipsis;white-space:nowrap;overflow:hidden"},g={name:"1ib9bih-lozenge-image",styles:"max-height:16px;max-width:16px;label:lozenge-image"};var i=(o("gwFzn"),o("gwFzn"));let h={name:"1cdj1px",styles:"opacity:0;line-height:1;position:absolute;width:max-content;top:-28px;display:inline-flex;justify-content:flex-end;color:var(--ds-text-subtle, #44546F)"},m=(0,o("3jLHL").css)({display:"flex",alignItems:"center",cursor:"pointer",boxShadow:"0 0 0 1px var(--ds-border, #091E4224)",minHeight:"var(--ds-space-300, 24px)",borderRadius:"var(--ds-border-radius, 4px)",paddingLeft:"var(--ds-space-150, 12px)",paddingRight:"var(--ds-space-150, 12px)",font:'var(--ds-font-body, normal 400 14px/20px ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, "Helvetica Neue", sans-serif)',"&:hover":{backgroundColor:"var(--ds-background-input-hovered, #F7F8F9)"},outlineColor:"var(--ds-border-focused, #388BFF)",border:"none",backgroundColor:"var(--ds-background-input, #FFFFFF)",color:"var(--ds-text-subtle, #44546F)"}),f={name:"3ix1vd",styles:"opacity:1"},y=(0,o("ecnYn").xcss)({marginRight:"space.075"}),x=(0,o("2nPZH").defineMessages)({doneEditing:{id:"editor-common-extensibility-extension-lozenge-editToggle.done.editing",defaultMessage:"Done editing"},makeEdits:{id:"editor-common-extensibility-extension-lozenge-editToggle.make.edits",defaultMessage:"Make edits"}}),w=({isNodeHovered:e,customContainerStyles:r,setIsNodeHovered:n,showBodiedExtensionRendererView:s,setShowBodiedExtensionRendererView:a})=>{let d=(0,o("dBxQj").default)(),l=s?d.formatMessage(x.makeEdits):d.formatMessage(x.doneEditing),c=s?(0,o("3jLHL").jsx)(t(o("1Zr9M")),{testId:"edit-icon",label:""}):(0,o("3jLHL").jsx)(t(o("cvXh8")),{testId:"check-mark-icon",label:""}),u=(0,i.useCallback)(()=>{a?.(!s)},[s,a]),p=(0,i.useCallback)(e=>{"Enter"===e.key&&u()},[u]);return(0,o("3jLHL").jsx)("div",{"data-testid":"extension-edit-toggle-container",css:e?[h,f]:h,style:r,className:"extension-edit-toggle-container",onMouseOver:()=>n?.(!0),onMouseLeave:()=>n?.(!1),tabIndex:-1},(0,o("3jLHL").jsx)("button",{type:"button","data-testid":"edit-toggle",css:m,className:"extension-edit-toggle",onClick:u,onKeyDown:p,onFocus:()=>n?.(!0),onBlur:()=>n?.(!1)},(0,o("3jLHL").jsx)(o("bUlM5").default,{as:"span",xcss:y},c),l))};var a=o("6qIXK");let v={name:"1xnw70r",styles:"text-align:left;z-index:1;position:relative;&.bodied{margin-top:var(--ds-space-300, 24px);}"},b=(0,o("3jLHL").css)({opacity:0,lineHeight:1,display:"inline-flex",justifyContent:"left",position:"absolute",width:"max-content",top:"-28px","&.show-label":{cursor:"pointer",opacity:1},"&.nested":{marginLeft:"var(--ds-space-150, 12px)"},"&.inline":{top:"-27px"},"&.bodied-background":{background:"var(--ds-surface, #FFFFFF)"},"&.bodied-border":{boxShadow:"0 0 0 1px var(--ds-border, #091E4224)"},minHeight:"var(--ds-space-300, 24px)",alignItems:"center",borderRadius:"var(--ds-border-radius, 3px)",paddingLeft:"var(--ds-space-100, 8px)",paddingRight:"var(--ds-space-100, 8px)",color:"var(--ds-text-subtle, #44546F)",backgroundColor:"var(--ds-background-accent-gray-subtlest, #F1F2F4)","&.remove-left-margin":{marginLeft:"var(--ds-space-negative-150, -12px)"},"&.remove-nested-left-margin":{marginLeft:0},font:'var(--ds-font-body, normal 400 14px/20px ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, "Helvetica Neue", sans-serif)',"&.with-bodied-macro-live-page-styles":{backgroundColor:"var(--ds-background-input, #FFFFFF)",boxShadow:"0 0 0 1px var(--ds-border, #091E4224)"}}),A=(0,o("ecnYn").xcss)({height:"space.200",position:"absolute",width:"100%"}),E={name:"1s9vzwe",styles:"margin-left:var(--ds-space-075, 6px);&.hide-icon{display:none;}"},S=(0,o("2nPZH").defineMessages)({configure:{id:"editor-common-extensibility.macro.button.configure",defaultMessage:"Configure {macroName}"}}),I=(e,t,r,n,i)=>!e||i?t:!r||!!(t&&!n),L=({text:e,extensionName:r,isNodeHovered:n,customContainerStyles:i,isNodeNested:s,setIsNodeHovered:d,isBodiedMacro:l,showUpdatedLivePages1PBodiedExtensionUI:c,showLivePagesBodiedMacrosRendererView:u,showBodiedExtensionRendererView:p,pluginInjectionApi:g})=>{let h="inlineExtension"===r,m=l&&!n,f=I(l,n,u,p,c),y=t(a)({bodied:l}),x=t(a)("extension-label",{nested:s,inline:h,bodied:l,"bodied-border":m,"bodied-background":m,"show-label":f,"with-bodied-macro-live-page-styles":l&&u,"always-hide-label":l&&p,"remove-left-margin":!l&&!h&&!s,"remove-nested-left-margin":s&&!l&&!h}),w=t(a)({"hide-icon":l&&!n});return(0,o("3jLHL").jsx)("div",{css:v,className:y,style:i,onMouseOver:()=>{d?.(!0)},onMouseLeave:()=>{d?.(!1)},"data-testid":"new-lozenge-container",contentEditable:!1},(0,o("3jLHL").jsx)(o("3gadb").default,{content:(0,o("3jLHL").jsx)(o("4jR19").default,{...S.configure,values:{macroName:e}}),position:"top"},r=>(0,o("3jLHL").jsx)("span",{"data-testid":"new-lozenge-button",...r,css:b,className:x},e,(0,o("3jLHL").jsx)("span",{css:E,className:w,"data-testid":"config-icon"},(0,o("3jLHL").jsx)(t(o("isYda")),{label:""})))),(0,o("3jLHL").jsx)(o("6f0Oj").default,{xcss:A}))},N=e=>e.charAt(0).toUpperCase()+e.slice(1),P=({lozengeData:e,extensionName:r,title:n,params:s,renderImage:a,showMacroInteractionDesignUpdates:d,customContainerStyles:l,isNodeHovered:c,isNodeNested:g,setIsNodeHovered:h,isBodiedMacro:m,showLivePagesBodiedMacrosRendererView:f,showUpdatedLivePages1PBodiedExtensionUI:y,showBodiedExtensionRendererView:x,setShowBodiedExtensionRendererView:v,pluginInjectionApi:b})=>{let A=N(n);if(n.startsWith("synced-block:")&&(0,o("dh538").fg)("platform_synced_block_demo"))return null;if(d)return(0,o("3jLHL").jsx)(i.Fragment,null,(0,o("3jLHL").jsx)(L,{text:A,extensionName:r,isNodeHovered:c,isNodeNested:g,customContainerStyles:l,setIsNodeHovered:h,isBodiedMacro:m,showLivePagesBodiedMacrosRendererView:f,showUpdatedLivePages1PBodiedExtensionUI:y,showBodiedExtensionRendererView:x,pluginInjectionApi:b}),f&&m&&(0,o("3jLHL").jsx)(w,{isNodeHovered:c,setIsNodeHovered:h,customContainerStyles:l,showBodiedExtensionRendererView:x,setShowBodiedExtensionRendererView:v}));let E="extension"===r;return(0,o("3jLHL").jsx)("div",{"data-testid":"lozenge-fallback",css:u},e&&!E?a({height:24,width:24,...e}):(0,o("3jLHL").jsx)(t(o("bha8O")),{label:n}),(0,o("3jLHL").jsx)("span",{className:"extension-title"},A),s&&!E&&(0,o("3jLHL").jsx)("span",{css:p},Object.keys(s).map(e=>e&&` | ${e} = ${s[e].value}`)))};class C extends i.Component{render(){let{node:e,showMacroInteractionDesignUpdates:t}=this.props,r=(0,o("21PP6").getExtensionLozengeData)({node:e,type:"image"});if(!t&&r&&"extension"!==e.type.name)return this.renderImage(r);let n=(0,o("21PP6").getExtensionLozengeData)({node:e,type:"icon"});return this.renderFallback(n)}constructor(...e){super(...e),this.renderImage=e=>{let{extensionKey:t}=this.props.node.attrs,{url:r,...n}=e;return(0,o("3jLHL").jsx)("img",{css:g,src:r,...n,alt:t})},this.renderFallback=e=>{let{showMacroInteractionDesignUpdates:t,isNodeSelected:r,isNodeHovered:n,isNodeNested:i,customContainerStyles:s,setIsNodeHovered:a,isBodiedMacro:d,showLivePagesBodiedMacrosRendererView:l,showUpdatedLivePages1PBodiedExtensionUI:c,showBodiedExtensionRendererView:u,setShowBodiedExtensionRendererView:p,pluginInjectionApi:g}=this.props,{parameters:h,extensionKey:m}=this.props.node.attrs,{name:f}=this.props.node.type,y=h&&h.macroParams,x=h&&h.extensionTitle||h&&h.macroMetadata&&h.macroMetadata.title||m;return(0,o("3jLHL").jsx)(P,{isNodeHovered:n,isNodeSelected:r,isNodeNested:i,showMacroInteractionDesignUpdates:t,extensionName:f,lozengeData:e,params:y,title:x,renderImage:this.renderImage,customContainerStyles:s,setIsNodeHovered:a,isBodiedMacro:d,showLivePagesBodiedMacrosRendererView:l,showUpdatedLivePages1PBodiedExtensionUI:c,showBodiedExtensionRendererView:u,setShowBodiedExtensionRendererView:p,pluginInjectionApi:g})}}}let R=e=>{if("bodiedExtension"!==e.type.name)return!1;let t=e?.content?.firstChild,r=t?.firstChild,n=r?.type?.name==="placeholder"&&t?.childCount===1,i=!r&&1===e.childCount;return n||i},_=(0,o("3jLHL").css)(l,{"&.without-frame":{background:"transparent"},width:"100%",".extension-overflow-wrapper:not(.with-body)":{overflowX:"auto"},"&.with-bodied-border":{boxShadow:"0 0 0 1px var(--ds-border, #091E4224)"},"&.with-hover-border":{boxShadow:"0 0 0 1px var(--ds-border-input, #8590A2)"},"&.with-margin-styles":{margin:"0 var(--ds-space-negative-250, -20px)",padding:"0 var(--ds-space-250, 20px)"},"&.legacy-content":{borderRadius:"0 0 var(--ds-border-radius, 3px) var(--ds-border-radius, 3px)"}}),T=(0,o("3jLHL").css)(_,".extension-overflow-wrapper:has(.extension-editable-area){cursor:inherit;}.extension-overflow-wrapper:not(:has(.extension-editable-area)){cursor:pointer;}"),k=(0,o("3jLHL").css)({padding:"var(--ds-space-050, 4px) var(--ds-space-050, 4px) 0px",verticalAlign:"middle","&.with-children:not(.without-frame)":{padding:"var(--ds-space-050, 4px) var(--ds-space-100, 8px) var(--ds-space-100, 8px)"},"&.without-frame":{padding:0}}),D=(0,o("3jLHL").css)({padding:"var(--ds-space-100, 8px)",background:"var(--ds-surface, white)",border:"1px solid var(--ds-border, #091E4224)",borderRadius:"var(--ds-border-radius, 3px)",cursor:"initial",width:"100%","&.remove-border":{border:"none"},"&.hide-content":{display:"none"}}),j=(0,o("3jLHL").css)({boxSizing:"border-box",paddingTop:"var(--ds-space-100, 8px)",paddingBottom:"var(--ds-space-100, 8px)",background:"var(--ds-surface, white)",border:"1px solid var(--ds-border, #091E4224)",borderRadius:"var(--ds-border-radius, 3px)",cursor:"initial",width:"100%","&.remove-border":{border:"none"},"&.hide-content":{display:"none"}}),H=(0,o("3jLHL").css)({padding:"0 var(--ds-space-100, 8px) var(--ds-space-100, 8px)",display:"flex",justifyContent:"center","&.with-padding-styles":{padding:"var(--ds-space-100, 8px)"},"&.with-bodied-padding-styles":{padding:"var(--ds-space-100, 8px) var(--ds-space-250, 20px)"}}),F=(0,o("3jLHL").css)({"&.with-margin-styles":{margin:"0 var(--ds-space-negative-250, -20px)"},"&.with-padding-styles":{padding:"var(--ds-space-100, 8px)"}});function O(e){let{node:r,handleContentDOMRef:n,children:s,widthState:l,handleRef:u,shadowClassNames:p,hideFrame:g,editorAppearance:h,macroInteractionDesignFeatureFlags:m,isNodeSelected:f,isNodeHovered:y,isNodeNested:x,setIsNodeHovered:w,showLivePagesBodiedMacrosRendererView:v,showUpdatedLivePages1PBodiedExtensionUI:b,showBodiedExtensionRendererView:A,setShowBodiedExtensionRendererView:E,pluginInjectionApi:S,isLivePageViewMode:I}=e,{showMacroInteractionDesignUpdates:L}=m||{},N=e=>"extension"===e.type.name&&e.attrs?.extensionType==="com.atlassian.confluence.migration"&&e.attrs?.extensionKey==="legacy-content",P=(0,o("dh538").fg)("platform_editor_legacy_content_macro_visual_update")&&N(r),_="extension"===r.type.name&&r.attrs?.extensionKey?.startsWith("synced-block"),O=["bodiedExtension","multiBodiedExtension"].includes(r.type.name),M=(0,o("dh538").fg)("platform_synced_block_demo")?L||!!g||_:L||!!(g&&!O),U=r?.attrs?.parameters?.macroParams?.hidden?.value,{getPos:B,view:V}=e,q=t(i).useMemo(()=>{let e="function"==typeof B?B():void 0;return void 0!==e&&!isNaN(e)&&0===V.state.doc.resolve(e).depth},[V,B]),K=["full-width","wide"].includes(r.attrs.layout)&&q&&"full-width"!==h,z=!b||R(r),Z=t(a)("extension-container","block",p,{"with-overlay":!O&&!L,"with-bodied-border":L&&(O||N(r))&&!A&&z,"with-margin-styles":L&&!x&&!A,"with-hover-border":L&&y,"with-danger-overlay":L,"without-frame":M,"legacy-content":P,"wider-layout":K}),Q=t(a)("extension-overflow-wrapper",{"with-body":O,"with-margin-styles":L&&!x&&!A,"with-padding-styles":L&&A}),G=t(a)({"with-children":!!s,"without-frame":M}),W=t(a)({"with-padding-styles":L,"with-bodied-padding-styles":O&&L}),$=t(a)("extension-content","block",{"remove-border":L,"hide-content":A}),J={width:"100%"},X={};if(K){let{type:e,...t}=(0,o("fJNzZ").calculateBreakoutStyles)({mode:r.attrs.layout,widthStateWidth:l.width,widthStateLineLength:l.lineLength});X={...t},J=t}X={...X,...H};let Y=e=>{w&&w(e)},ee=(0,d.expValEquals)("platform_editor_extension_styles","isEnabled",!0)?j:D,et=!!(0,o("dh538").fg)("platform_synced_block_demo")&&_;return(0,o("3jLHL").jsx)(i.Fragment,null,P&&(0,o("3jLHL").jsx)(o("7gXVN").LegacyContentHeader,{isNodeSelected:f,isNodeHovered:y,onMouseEnter:()=>Y(!0),onMouseLeave:()=>Y(!1)}),!P&&L&&!I&&!et&&(0,o("3jLHL").jsx)(C,{isNodeSelected:f,isNodeHovered:y,isNodeNested:x,node:r,showMacroInteractionDesignUpdates:L,customContainerStyles:J,setIsNodeHovered:w,isBodiedMacro:O||N(r),showLivePagesBodiedMacrosRendererView:v,showUpdatedLivePages1PBodiedExtensionUI:b,showBodiedExtensionRendererView:A,setShowBodiedExtensionRendererView:E,pluginInjectionApi:S}),(0,o("3jLHL").jsx)("div",{"data-testid":"extension-container",ref:u,"data-layout":r.attrs.layout,className:Z,css:T,style:J,onMouseEnter:()=>Y(!0),onMouseLeave:()=>Y(!1)},(0,o("3jLHL").jsx)("div",{"data-testid":"extension-overflow-wrapper",className:Q,css:F},(0,o("3jLHL").jsx)("div",{className:"extension-overlay",css:c}),(0,o("3jLHL").jsx)("div",{css:k,contentEditable:!1,className:G},!M&&(0,o("3jLHL").jsx)(C,{isNodeSelected:f,node:r,showMacroInteractionDesignUpdates:L,pluginInjectionApi:S}),s),O&&(0,o("3jLHL").jsx)("div",{css:X,className:W,"data-testid":"extension-new-content"},!(I&&"true"===U)&&(0,o("3jLHL").jsx)("div",{"data-testid":"extension-content",css:ee,className:$},(0,o("3jLHL").jsx)("div",{ref:n}))))))}let M=(0,o("574ry").sharedPluginStateHookMigratorFactory)(e=>{let{lineLength:t,width:r}=(0,o("eiA8Z").useSharedPluginStateWithSelector)(e,["width"],e=>({width:e.widthState?.width??0,lineLength:e.widthState?.lineLength}));return{widthState:{width:r??0,lineLength:t}}},e=>{let{widthState:t}=(0,o("1Oo9w").useSharedPluginState)(e,["width"]);return{widthState:{width:t?.width??0,lineLength:t?.lineLength}}});var U=(0,o("frt7o").default)(e=>{let{pluginInjectionApi:t}=e,{widthState:r}=M(t);return(0,o("3jLHL").jsx)(O,{widthState:r,...e})},{overflowSelector:".extension-overflow-wrapper"}),i=o("gwFzn"),a=o("6qIXK"),d=o("1oCLl");let B=(0,o("3jLHL").css)(l,{cursor:"pointer",display:"inline-flex",margin:"1px 1px var(--ds-space-050, 4px)","> img":{borderRadius:"var(--ds-border-radius, 3px)"},"&::after, &::before":{verticalAlign:"text-top",display:"inline-block",content:"''"},"&.with-children":{padding:0,background:"var(--ds-background-neutral-subtle, white)"},"&.with-hover-border":{boxShadow:"0 0 0 1px var(--ds-border-input, #8590A2)"}}),V={name:"m3p6m2",styles:"max-width:100%;tr &{max-width:inherit;}.rich-media-item{max-width:100%;}"},q=(0,o("574ry").sharedPluginStateHookMigratorFactory)(e=>{let{width:t}=(0,o("eiA8Z").useSharedPluginStateWithSelector)(e,["width"],e=>({width:e.widthState?.width}));return{widthState:{width:t}}},e=>{let{widthState:t}=(0,o("1Oo9w").useSharedPluginState)(e,["width"]);return{widthState:{width:t?.width}}});var K=e=>{let{node:r,pluginInjectionApi:n,macroInteractionDesignFeatureFlags:s,isNodeSelected:l,children:u,isNodeHovered:p,setIsNodeHovered:g,isLivePageViewMode:h}=e,{showMacroInteractionDesignUpdates:m}=s||{},{widthState:f}=q(n),y=t(a)("extension-container","inline",{"with-overlay":!m,"with-children":!!u,"with-danger-overlay":m,"with-hover-border":m&&p}),x=0;if((0,d.expValEquals)("platform_editor_preview_panel_responsiveness","isEnabled",!0)){if(f.width){let e=f.width>o("aFUXX").akEditorFullPageNarrowBreakout?(0,o("aFUXX").akEditorGutterPaddingDynamic)():o("aFUXX").akEditorGutterPaddingReduced;x=f.width-2*e}}else x=f.width?f.width-2*(0,o("aFUXX").akEditorGutterPaddingDynamic)():0;let w=e=>{g&&g(e)},v=(0,o("3jLHL").jsx)(i.Fragment,null,m&&!h&&(0,o("3jLHL").jsx)(C,{node:r,isNodeSelected:l,isNodeHovered:p,showMacroInteractionDesignUpdates:m,setIsNodeHovered:g,pluginInjectionApi:n}),(0,o("3jLHL").jsx)("div",{"data-testid":"inline-extension-wrapper",css:[B,V],className:y,onMouseEnter:()=>w(!0),onMouseLeave:()=>w(!1)},(0,o("3jLHL").jsx)("div",{css:c,className:"extension-overlay"}),u||(0,o("3jLHL").jsx)(C,{node:r,isNodeSelected:l,showMacroInteractionDesignUpdates:m,pluginInjectionApi:n})));return(0,o("3jLHL").jsx)(o("bWRlG").WidthContext.Provider,{value:(0,o("bWRlG").createWidthContext)(x)},v)},i=o("gwFzn"),a=o("6qIXK"),i=o("gwFzn");let z=(e,t,r)=>{(0,o("5vVM5").createDispatch)(r)(o("lWghV").analyticsEventKey,{payload:{action:e,actionSubject:o("d925B").ACTION_SUBJECT.MULTI_BODIED_EXTENSION,eventType:o("d925B").EVENT_TYPE.TRACK,attributes:{extensionType:t.attrs.extensionType,extensionKey:t.attrs.extensionKey,localId:t.attrs.localId,currentFramesCount:t.content.childCount}}})},Z=({updateActiveChild:e,editorView:r,getPos:n,node:s,eventDispatcher:a,allowBodiedOverride:d,childrenContainer:l})=>t(i).useMemo(()=>({changeActive(t){let{state:i,dispatch:d}=r,l=e(t);a&&z(o("d925B").ACTION.CHANGE_ACTIVE,s,a);let c=n();if("number"!=typeof c)return l;let u=i.doc.nodeAt(c),p=c;if(u&&u?.type?.name==="multiBodiedExtension"&&u?.content){if(t<0||t>=u?.content?.childCount)throw Error(`Index out of bounds: valid range is 0-${u?.content?.childCount-1} inclusive`);for(let e=0;e<=t&&e<u?.content?.childCount;e++)p+=u?.content?.child(e)?.nodeSize||0;d(i.tr.setSelection(new(0,o("7T7aA").TextSelection)(i.doc.resolve(p-1))))}return l},addChild(){let{state:e,dispatch:t}=r,i=e.schema.nodes.paragraph.createAndFill({});if(!i)throw Error("Could not create paragraph");let d=e.schema.nodes.extensionFrame.createAndFill({},[i]),l=n();if("number"!=typeof l||!d)throw Error("Could not create frame or position not valid");let c=Math.min((l||1)+s.content.size,e.doc.content.size),u=e.tr.insert(c,d);return u.setSelection(new(0,o("7T7aA").TextSelection)(u.doc.resolve(c+1))),t(u),a&&z(o("d925B").ACTION.ADD_CHILD,s,a),!0},getChildrenCount:()=>s.content.childCount,removeChild(e){let t=n();if("number"!=typeof t||"number"!=typeof e)throw Error("Position or index not valid");let{state:i,dispatch:d}=r;if(1===s.content.childCount){let e=i.tr;return e.deleteRange(t,t+s.content.size),d(e),!0}let l=i.doc.resolve(t),c=i.doc.resolve(l.start(l.depth+1)).posAtIndex(e),u=i.doc.nodeAt(c);if(!u)throw Error("Could not find frame node");let p=u.content.size+c,g=i.tr;return g.deleteRange(c,p),d(g),a&&z(o("d925B").ACTION.REMOVE_CHILD,s,a),!0},updateParameters(e){let{state:t,dispatch:i}=r,d=n();if("number"!=typeof d)throw Error("Position not valid");let l={...s.attrs,parameters:{...s.attrs.parameters,macroParams:e}};return i(t.tr.setNodeMarkup(d,null,l)),a&&z(o("d925B").ACTION.UPDATE_PARAMETERS,s,a),!0},getChildren(){let{state:e}=r,t=n();if("number"!=typeof t)return[];let i=e.doc.nodeAt(t)?.content;return a&&z(o("d925B").ACTION.GET_CHILDREN,s,a),i?i.toJSON():[]},getChildrenContainer(){if(!d)throw Error("Could not provide children container");return a&&z(o("d925B").ACTION.GET_CHILDREN_CONTAINER,s,a),l}}),[s,r,n,e,a,d,l]),Q=(0,o("3jLHL").css)(l,{"&.with-margin-styles":{marginTop:0,marginLeft:"var(--ds-space-negative-150, -12px)",marginRight:"var(--ds-space-negative-150, -12px)"},cursor:"pointer",marginTop:"var(--ds-space-250, 24px)",marginBottom:"var(--ds-space-200, 16px)",".extension-title":{display:"flex",alignItems:"center",lineHeight:"16px !important",marginBottom:"var(--ds-space-100, 8px)",marginLeft:"var(--ds-space-050, 4px) !important",marginRight:"var(--ds-space-100, 8px)",paddingTop:"var(--ds-space-100, 8px) !important"},"&.with-border":{boxShadow:"0 0 0 1px var(--ds-border, #091E4224)"},"&.with-hover-border":{boxShadow:"0 0 0 1px var(--ds-border-input, #8590A2)"},"&.with-padding-background-styles":{padding:"var(--ds-space-100, 8px) var(--ds-space-250, 20px)",background:"transparent"}}),G={name:"2zq7mp",styles:"border-radius:var(--ds-border-radius, 3px);position:absolute;width:100%;height:100%;opacity:0;pointer-events:none;transition:opacity 0.3s;z-index:1;&.with-margin{margin:var(--ds-space-negative-100, -8px);}"},W=(e,t)=>(0,o("3jLHL").css)(o("dsfZn").sharedMultiBodiedExtensionStyles.mbeExtensionContainer,{[`.multiBodiedExtension-content-dom-wrapper > [data-extension-frame='true']:nth-of-type(${e+1})`]:(0,o("3jLHL").css)(o("dsfZn").sharedMultiBodiedExtensionStyles.extensionFrameContent,t&&o("dsfZn").removeMarginsAndBorder)}),$={name:"yadgg9",styles:"max-height:24px;max-width:24px"},J=({articleRef:e})=>(0,o("3jLHL").jsx)("article",{className:"multiBodiedExtension--frames","data-testid":"multiBodiedExtension--frames",ref:e}),X=(e,r,n)=>{if(n)return null;if(e){let{url:t,...n}=e;return(0,o("3jLHL").jsx)("div",{className:"extension-title"},(0,o("3jLHL").jsx)("img",{css:$,src:t,...n,alt:r}),r)}return(0,o("3jLHL").jsx)("div",{className:"extension-title","data-testid":"multiBodiedExtension-default-lozenge"},(0,o("3jLHL").jsx)(t(o("bha8O")),{label:r}),r)},Y=({node:e,handleContentDOMRef:r,getPos:n,tryExtensionHandler:s,editorView:d,eventDispatcher:l,widthState:c,editorAppearance:u,macroInteractionDesignFeatureFlags:p,isNodeSelected:g,isNodeHovered:h,isNodeNested:m,setIsNodeHovered:f,pluginInjectionApi:y,isLivePageViewMode:x,allowBodiedOverride:w=!1})=>{let{showMacroInteractionDesignUpdates:v}=p||{},{parameters:b,extensionKey:A}=e.attrs,E=b&&b.extensionTitle||b&&b.macroMetadata&&b.macroMetadata.title||A||e.type.name,S=(0,o("21PP6").getExtensionLozengeData)({node:e,type:"image"}),[I,L]=(0,i.useState)(0),N=t(i).useCallback(e=>{if("number"!=typeof e)throw L(0),Error("Index is not valid");return L(e),!0},[L]),P=t(i).useCallback(e=>r(e),[r]),R=t(i).useMemo(()=>(0,o("3jLHL").jsx)(J,{articleRef:P}),[P]),_=Z({updateActiveChild:N,editorView:d,getPos:n,node:e,eventDispatcher:l,allowBodiedOverride:w,childrenContainer:R}),T=t(i).useMemo(()=>s(_),[s,_]),k=["full-width","wide"].includes(e.attrs.layout)&&"full-width"!==u,D={};if(k){let{...t}=(0,o("fJNzZ").calculateBreakoutStyles)({mode:e.attrs.layout,widthStateLineLength:c?.lineLength,widthStateWidth:c?.width});D=t}let j=t(a)("multiBodiedExtension--wrapper","extension-container","block",{"with-border":v,"with-danger-overlay":v,"with-padding-background-styles":v,"with-margin-styles":v&&!m,"with-hover-border":v&&h}),H=t(a)("multiBodiedExtension--container",{"remove-padding":v}),F=t(a)("multiBodiedExtension--body-container"),O=t(a)("multiBodiedExtension--navigation",{"remove-margins":v,"remove-border":v}),M=t(a)("multiBodiedExtension--overlay",{"with-margin":v}),U=e=>{f&&f(e)};return(0,o("3jLHL").jsx)(i.Fragment,null,v&&!x&&(0,o("3jLHL").jsx)(C,{isNodeSelected:g,node:e,showMacroInteractionDesignUpdates:!0,customContainerStyles:D,isNodeHovered:h,isNodeNested:m,setIsNodeHovered:f,isBodiedMacro:!0,pluginInjectionApi:y}),(0,o("3jLHL").jsx)("div",{className:j,css:Q,"data-testid":"multiBodiedExtension--wrapper","data-layout":e.attrs.layout,style:D,onMouseEnter:()=>U(!0),onMouseLeave:()=>U(!1)},(0,o("3jLHL").jsx)("div",{css:G,className:M,"data-testid":"multiBodiedExtension--overlay"}),X(S,E,v),(0,o("3jLHL").jsx)("div",{className:H,css:W(I,v),"data-testid":"multiBodiedExtension--container","data-active-child-index":I},w?(0,o("3jLHL").jsx)("div",{className:F,"data-testid":"multiBodiedExtension--body-container"},T):(0,o("3jLHL").jsx)(i.Fragment,null,(0,o("3jLHL").jsx)("nav",{className:O,css:o("dsfZn").sharedMultiBodiedExtensionStyles.mbeNavigation,"data-testid":"multiBodiedExtension-navigation"},T),R))))},ee=(0,o("574ry").sharedPluginStateHookMigratorFactory)(e=>{let{width:t,lineLength:r}=(0,o("eiA8Z").useSharedPluginStateWithSelector)(e,["width"],e=>({width:e.widthState?.width,lineLength:e.widthState?.lineLength}));return{widthState:void 0===t?void 0:{width:t,lineLength:r}}},e=>{let{widthState:t}=(0,o("1Oo9w").useSharedPluginState)(e,["width"]);return{widthState:t}});var et=e=>{let{pluginInjectionApi:t}=e,{widthState:r}=ee(t);return(0,o("3jLHL").jsx)(Y,{widthState:r,...e})};let er=e=>{let t=[];return e.content.forEach(e=>{t.push((0,o("7iE7T").nodeToJSON)(e))}),t.length?t:e.attrs.text},en=e=>{let{extensionProvider:r,showLivePagesBodiedMacrosRendererView:n,node:s,...a}=e,[d,l]=(0,i.useState)(void 0),[c,u]=(0,i.useState)(!!n?.((0,o("7iE7T").nodeToJSON)(s))&&!R(s)),p=(0,i.useRef)(!0);return(0,i.useLayoutEffect)(()=>(p.current=!0,()=>{p.current=!1}),[]),(0,i.useEffect)(()=>{r?.then(e=>{p.current&&l(e)})},[r]),t(i).createElement(ei,{...a,extensionProvider:d,node:s,showLivePagesBodiedMacrosRendererView:n,showBodiedExtensionRendererView:c,setShowBodiedExtensionRendererView:u})};class ei extends i.Component{componentDidUpdate(){this.parsePrivateNodePropsIfNeeded()}render(){let{node:e,handleContentDOMRef:r,editorView:n,references:s,editorAppearance:a,pluginInjectionApi:d,getPos:l,eventDispatcher:c,macroInteractionDesignFeatureFlags:u,extensionProvider:p,showLivePagesBodiedMacrosRendererView:g,showUpdatedLivePages1PBodiedExtensionUI:h,showBodiedExtensionRendererView:m,setShowBodiedExtensionRendererView:f,isLivePageViewMode:y}=this.props,{selection:x}=n.state,w=x instanceof o("7T7aA").NodeSelection&&x.node,v="function"==typeof l&&l(),b=v&&n.state.doc.resolve(v),A=!!(b&&b.depth>0);if("multiBodiedExtension"===e.type.name){let s=this.state._privateProps?.__allowBodiedOverride&&(0,o("dh538").fg)("platform_editor_multi_body_extension_extensibility");return t(i).createElement(et,{node:e,editorView:n,getPos:l,handleContentDOMRef:r,tryExtensionHandler:this.tryExtensionHandler.bind(this),eventDispatcher:c,pluginInjectionApi:d,editorAppearance:a,macroInteractionDesignFeatureFlags:u,isNodeSelected:w===e,isNodeNested:A,isNodeHovered:this.state.isNodeHovered,setIsNodeHovered:this.setIsNodeHovered,isLivePageViewMode:y,allowBodiedOverride:s})}let E=this.tryExtensionHandler(void 0);switch(e.type.name){case"extension":case"bodiedExtension":return t(i).createElement(U,{node:e,getPos:this.props.getPos,references:s,extensionProvider:p,handleContentDOMRef:r,view:n,editorAppearance:a,hideFrame:this.state._privateProps?.__hideFrame,pluginInjectionApi:d,macroInteractionDesignFeatureFlags:u,isNodeSelected:w===e,isNodeHovered:this.state.isNodeHovered,isNodeNested:A,setIsNodeHovered:this.setIsNodeHovered,showLivePagesBodiedMacrosRendererView:!!g?.((0,o("7iE7T").nodeToJSON)(e)),showUpdatedLivePages1PBodiedExtensionUI:!!h?.((0,o("7iE7T").nodeToJSON)(e)),showBodiedExtensionRendererView:m,setShowBodiedExtensionRendererView:f,isLivePageViewMode:y},E);case"inlineExtension":return t(i).createElement(K,{node:e,macroInteractionDesignFeatureFlags:u,isNodeSelected:w===e,pluginInjectionApi:d,isNodeHovered:this.state.isNodeHovered,setIsNodeHovered:this.setIsNodeHovered,isLivePageViewMode:y},E);default:return null}}tryExtensionHandler(e){let{node:r}=this.props;try{let n=this.handleExtension(r,e);if(n&&t(i).isValidElement(n))return n}catch(e){console.error("Provided extension handler has thrown an error\n",e)}return null}constructor(...e){super(...e),this.privatePropsParsed=!1,this.state={},this.getNodeRenderer=(0,o("csnse").default)(s.getNodeRenderer),this.getExtensionModuleNodePrivateProps=(0,o("csnse").default)(s.getExtensionModuleNodePrivateProps),this.setIsNodeHovered=e=>{this.props.isLivePageViewMode||this.setState({isNodeHovered:e})},this.parsePrivateNodePropsIfNeeded=async()=>{if(this.privatePropsParsed||!this.props.extensionProvider)return;this.privatePropsParsed=!0;let{extensionType:e,extensionKey:t}=this.props.node.attrs;try{let r=await this.getExtensionModuleNodePrivateProps(this.props.extensionProvider,e,t);this.setState({_privateProps:r})}catch(e){console.error("Provided extension handler has thrown an error\n",e)}},this.handleExtension=(e,r)=>{let n,{extensionHandlers:s,editorView:a,showBodiedExtensionRendererView:d,rendererExtensionHandlers:l}=this.props,{extensionType:c,extensionKey:u,parameters:p,text:g}=e.attrs,h="bodiedExtension"===e.type.name;if(h&&!d)return;let m=e?.marks?.find(e=>"fragment"===e.type.name)?.attrs?.localId,f=h?er(e):g,y={type:e.type.name,extensionType:c,extensionKey:u,parameters:p,content:f,localId:e.attrs.localId,fragmentLocalId:m};if(h){let e=l?.[c];if(e)return(0,o("2diEG").getExtensionRenderer)(e)(y,(0,o("7iE7T").toJSON)(a.state.doc))}if(s&&s[c]&&(n=(0,o("2diEG").getExtensionRenderer)(s[c])(y,a.state.doc,r)),!n){let e=this.props.extensionProvider&&this.getNodeRenderer(this.props.extensionProvider,c,u);if(e)return"multiBodiedExtension"===y.type?t(i).createElement(e,{node:y,references:this.props.references,actions:r}):t(i).createElement(e,{node:y,references:this.props.references})}return n}}}}),s("7gXVN",function(r,n){e(r.exports,"LegacyContentHeader",()=>l);var i=o("gwFzn"),s=o("6qIXK");let a=(0,o("2nPZH").defineMessages)({legacyContentHeader:{id:"editor.extension.legacyContentHeader",defaultMessage:"Legacy Content"},contentHasLimitedFunctionality:{id:"editor.extension.legacyContentHeader.contentHasLimitedFunctionality",defaultMessage:"This content has limited functionality,"},learnMore:{id:"editor.extension.legacyContentHeader.learnMore",defaultMessage:"Learn more"}}),d=(0,o("3jLHL").css)({padding:"0 var(--ds-space-200, 16px) var(--ds-space-050, 4px) var(--ds-space-200, 16px)",backgroundColor:"var(--ds-background-neutral, #0515240F)",borderRadius:"var(--ds-border-radius, 4px) var(--ds-border-radius, 4px) 0 0",boxShadow:"0 0 0 1px var(--ds-background-neutral, #0515240F)",position:"relative",top:"-1px","&.with-hover-border":{boxShadow:"0 0 0 1px var(--ds-border-input, #8590A2)"},"&.selected":{boxShadow:"0 0 0 1px var(--ds-border-selected, #0C66E4)",backgroundColor:"var(--ds-background-selected, #E9F2FF)"},"& .status-lozenge-span":{marginRight:"var(--ds-space-100, 8px)"},"& > .legacy-content-header-text":{font:"var(--ds-font-body-UNSAFE_small, 12px)","& span":{paddingRight:"var(--ds-space-050, 4px)"},"& a":{cursor:"pointer"}}}),l=({isNodeHovered:e,isNodeSelected:r,onMouseEnter:n,onMouseLeave:l})=>{let{formatMessage:c}=(0,o("dBxQj").default)(),u=t(s)("legacy-content-header",{"with-hover-border":e,selected:r}),p=(0,i.useCallback)(()=>{window.open("https://support.atlassian.com/confluence-cloud/docs/the-legacy-content-macro/","_blank")},[]);return(0,o("3jLHL").jsx)(i.Fragment,null,(0,o("3jLHL").jsx)("div",{"data-testid":"editor-extension-legacy-content-header",css:[d],className:u,onMouseEnter:n,onMouseLeave:l},(0,o("3jLHL").jsx)(o("eUDtA").Status,{text:c(a.legacyContentHeader),color:r?"blue":"neutral",style:"bold",isBold:!0}),(0,o("3jLHL").jsx)("span",{className:"legacy-content-header-text"},(0,o("3jLHL").jsx)(t(o("ebrpi")),{label:c(a.contentHasLimitedFunctionality),size:"small"}),c(a.contentHasLimitedFunctionality)," ",(0,o("3jLHL").jsx)(o("2Nwuj").default,{onClick:p,href:"https://support.atlassian.com/confluence-cloud/docs/the-legacy-content-macro/",target:"_blank"},c(a.learnMore)))))}}),s("3oRlx",function(r,n){e(r.exports,"ExtensionNodeWrapper",()=>a),o("gwFzn");var i=o("6qIXK");let s={name:"4s3kp2",styles:"&.inline-extension{display:inline-block;}&.relative{position:relative;}"},a=({children:e,nodeType:r,macroInteractionDesignFeatureFlags:n})=>{let{showMacroInteractionDesignUpdates:a}=n||{},d=t(i)({"inline-extension":"inlineExtension"===r&&a,relative:a});return(0,o("3jLHL").jsx)("span",{className:d,css:s},e,"inlineExtension"===r&&o("TfRUG").ZERO_WIDTH_SPACE)}}),s("lOkIA",function(r,n){e(r.exports,"CenteredSpinner",()=>d);var i=o("gwFzn");function s(e,t,r){var n;return(t="symbol"==typeof(n=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?n:n+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}let a={small:12,medium:26,large:36};class d extends i.PureComponent{render(){let{style:e,size:r}=this.props;return t(i).createElement("div",{style:e,"data-test-id":"wrapper-spinner",className:(0,o("35pXk").default)(["_1bsb1osq _4t3i1osq _kqswh2mm"])},t(i).createElement("div",{"data-test-id":"spinner",style:{marginLeft:`${-a[r]/2}px`,marginTop:`${-a[r]/2}px`},className:(0,o("35pXk").default)(["_kqswstnw _1ltv1ssb _154i1ssb _1pbyb4wl"])},t(i).createElement(o("9hlns").default,{size:a[r]})))}}s(d,"displayName","CenteredSpinner"),s(d,"propTypes",{style:t(o("fppBw")).object,size:t(o("fppBw")).oneOf(["small","medium","large"])}),s(d,"defaultProps",{size:"small"})}),s("97Szk",function(r,n){e(r.exports,"useDefinitionRestrictionOptions",()=>a);var i=o("gwFzn");let s=(0,o("2nPZH").defineMessages)({editDefinitionRestrictedToSpaceOption:{id:"contextual-reading-aids.edit.definition.restricted.to.space.option",defaultMessage:"In this space"},editDefinitionRestrictedToPageOption:{id:"contextual-reading-aids.edit.definition.restricted.to.page.option",defaultMessage:"On this page"},editDefinitionRestrictedToBlogpostOption:{id:"contextual-reading-aids.edit.definition.restricted.to.blogpost.option",defaultMessage:"On this blogpost"},editDefinitionRestrictedToSiteOption:{id:"contextual-reading-aids.edit.definition.restricted.to.site.option",defaultMessage:"On this site"}});function a(e){let{formatMessage:r}=(0,o("dBxQj").default)();return(0,i.useMemo)(()=>[{label:r(s.editDefinitionRestrictedToSpaceOption),value:o("9KkVf").EditedDefinitionScope.SPACE,icon:t(i).createElement(t(o("gXn1S")),{label:""})},"blogpost"===e?{label:r(s.editDefinitionRestrictedToBlogpostOption),value:o("9KkVf").EditedDefinitionScope.BLOGPOST,icon:t(i).createElement(t(o("9RVmI")),{label:""})}:{label:r(s.editDefinitionRestrictedToPageOption),value:o("9KkVf").EditedDefinitionScope.PAGE,icon:t(i).createElement(t(o("chO1Z")),{label:""})},{label:r(s.editDefinitionRestrictedToSiteOption),value:o("9KkVf").EditedDefinitionScope.ORGANIZATION,icon:t(i).createElement(t(o("ctmPb")),{label:""})}],[e,r])}}),s("5Mdl1",function(r,n){e(r.exports,"CrossIconCloseButton",()=>s);var i=o("gwFzn");let s=({onClose:e,source:r})=>{let{createAnalyticsEvent:n}=(0,o("inPa6").useAnalyticsEvents)(),s=(0,i.useCallback)(()=>{n({type:"sendUIEvent",data:{action:"clicked",actionSubject:"button",actionSubjectId:"dismiss",source:r}}).fire(),e()},[e,n,r]);return t(i).createElement(o("1qfLF").default,{icon:e=>t(i).createElement(t(o("hmuev")),{...e,color:"var(--ds-icon-inverse, #FFFFFF)"}),appearance:"subtle",label:t(i).createElement(o("4jR19").default,a.dismiss),onClick:s})},a=(0,o("2nPZH").defineMessages)({dismiss:{id:"modernize-changeboarding.cross-icon-close-button.dismiss",defaultMessage:"Dismiss"}})}),r.rlb("3jrkO");
//# sourceMappingURL=status.ab61c94d.js.map
