WRMCB=function(e){var c=console;if(c&&c.log&&c.error){c.log('Error running batched script.');c.error(e);}} ; try { /* module-key = 'com.atlassian.plugins.atlassian-connect-plugin:confluence-content-property-api-v5', location = 'v5/js/confluence/contentproperty/content-property.js' */ !function(t,e){"use strict";e("ac/confluence/content-property",["confluence/root","ajs"],(function(t,e){function n(e){return"/rest/api/content/"+t.getContentId()+"/property/"+e}function o(t){e.log(t);e.flag({type:"error",title:t,body:"

There was a problem communicating with the server. Please refresh the page and try again

"})}function r(t,e){const r=n(t),c=function(n,r){let c;try{c=JSON.parse(r.responseText)}catch(t){n=t}n?404===r.status?e(null):o("Unable to check item state: "+t):e(c)};c._context=e._context;window.connectHostRequest.default.request({url:r},c)}function c(t,n){e.trigger("contentProperty.update",{contentProperty:t,extension:n})}return{getContentProperty:function(t,e){r(t,e)},syncPropertyFromServer:function(t,e){const n=function(t){c(t,e._context.extension);e(t)};n._context=e._context;r(t,n)},setContentProperty:function(t,r){c(t,r._context.extension);!function(t,r){var c=t.key,s={url:n(c),contentType:"application/json",data:JSON.stringify(t)};t.version&&t.version.number&&t.version.number>1?s.type="PUT":s.type="POST";const i=function(t,n){let i;try{i=JSON.parse(n.responseText)}catch(e){t=e}if(t){r({error:n.statusText});o("Unable to "+s.type+" item: "+c)}else{e.log("contentProperty "+c+" "+s.type+" successful");r(i)}};i._context=r._context;window.connectHostRequest.default.request(s,i)}(t,r)}}}))}(AJS.$,define); }catch(e){WRMCB(e)};