!function(){"use strict";var e={526:function(e,n,o){o.d(n,{default:function(){return d}});const t="PMC: Piano: ",i=()=>{var e,n;return null===(n=null===(e=window.location)||void 0===e?void 0:e.search)||void 0===n?void 0:n.includes("pianoDebug")};e=o.hmd(e);var r=function(e,n,o,t){return new(o||(o=Promise))((function(i,r){function c(e){try{a(t.next(e))}catch(e){r(e)}}function d(e){try{a(t.throw(e))}catch(e){r(e)}}function a(e){var n;e.done?i(e.value):(n=e.value,n instanceof o?n:new o((function(e){e(n)}))).then(c,d)}a((t=t.apply(e,n||[])).next())}))};const c={callApi:(e,...n)=>r(void 0,[e,...n],void 0,(function*(e,n={}){return yield new Promise((o=>{window.tp.api.callApi(e,n,o)})).then((o=>(i()&&console.log(t,"pmcPianoApi.callApi",e,n,o),o))).catch((o=>{i()&&console.error(t,"pmcPianoApi.callApi",e,n,o)}))})),callProtectedApi:function(e){return r(this,void 0,void 0,(function*(){var n;const o=`${null===(n=window.pmcPianoData)||void 0===n?void 0:n.wordPressRestApiUri}${e}`;return yield fetch(o,{credentials:"include"}).then((e=>e.headers.get("content-type").includes("application/json")?e.json():e.text())).then((e=>(i()&&console.log(t,"pmcPianoApi.callProtectedApi",o,e),e))).catch((e=>{i()&&console.error(t,"pmcPianoApi.callProtectedApi",o,e)}))}))},getLicenseeData:e=>r(void 0,void 0,void 0,(function*(){return yield c.callProtectedApi(`/licensee/${e}`)})),getUserCustomFields:e=>r(void 0,void 0,void 0,(function*(){return yield c.callProtectedApi(`/user/custom-fields/${e}`)})),getAccessList:()=>r(void 0,void 0,void 0,(function*(){return yield c.callApi("/access/list").then((({data:e})=>e))})),getConversionList:()=>r(void 0,void 0,void 0,(function*(){return yield c.callApi("/conversion/list").then((({conversions:e})=>e))}))};var d=c;"undefined"!=typeof exports&&(e.exports=c)}},n={};function o(t){var i=n[t];if(void 0!==i)return i.exports;var r=n[t]={id:t,loaded:!1,exports:{}};return e[t](r,r.exports,o),r.loaded=!0,r.exports}o.d=function(e,n){for(var t in n)o.o(n,t)&&!o.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:n[t]})},o.hmd=function(e){return(e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:function(){throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e},o.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)};var t=o(526);(window.pmcPiano=window.pmcPiano||{}).api=t.default}();