/**
 * Minified by jsDelivr using Terser v5.48.0.
 * Original file: /npm/@prismatic-io/embedded@4.14.0/dist/index.umd.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
!function(e,t){"object"==typeof exports&&typeof module<"u"?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=typeof globalThis<"u"?globalThis:e||self).prismatic={})}(this,function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var t=Object.create,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,s=(e,t,i,s)=>{if(t&&"object"==typeof t||"function"==typeof t)for(var c,l=o(t),u=0,f=l.length;u<f;u++)c=l[u],!a.call(e,c)&&c!==i&&n(e,c,{get:(e=>t[e]).bind(null,c),enumerable:!(s=r(t,c))||s.enumerable});return e};let c={agent:void 0,filters:{},initComplete:!1,jwt:"",embeddedDesignerEnabled:!1,prismaticUrl:"https://app.prismatic.io",screenConfiguration:void 0,theme:void 0,fontConfiguration:void 0,translation:void 0},l=new Set(Object.keys(c)),u=e=>l.has(e),f=(e,t,n)=>{e[t]=n},d=new class{constructor(e){this.state=null,this.defaultState=e}getInitialState(){return JSON.parse(JSON.stringify(this.defaultState))}getStateCopy(){return this.state?JSON.parse(JSON.stringify(this.state)):this.getInitialState()}setState(e){this.state=e}}(c),p=e=>{if(!d.getStateCopy().initComplete)throw Error(`Expected init to be called before calling ${e}`);if(!d.getStateCopy().jwt&&"authenticate"!==e)throw Error(`Expected authenticate to be called before calling ${e}`)};var h=((e,r,o)=>(o=null==e?{}:t(i(e)),s(!r&&e&&e.__esModule&&a.call(e,"default")?o:n(o,"default",{value:e,enumerable:!0}),e)))(((e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports))((e,t)=>{var n="__lodash_hash_undefined__",r=9007199254740991,o="[object Arguments]",i="[object Function]",a="[object Object]",s=/^\[object .+?Constructor\]$/,c=/^(?:0|[1-9]\d*)$/,l={};l["[object Float32Array]"]=l["[object Float64Array]"]=l["[object Int8Array]"]=l["[object Int16Array]"]=l["[object Int32Array]"]=l["[object Uint8Array]"]=l["[object Uint8ClampedArray]"]=l["[object Uint16Array]"]=l["[object Uint32Array]"]=!0,l[o]=l["[object Array]"]=l["[object ArrayBuffer]"]=l["[object Boolean]"]=l["[object DataView]"]=l["[object Date]"]=l["[object Error]"]=l[i]=l["[object Map]"]=l["[object Number]"]=l[a]=l["[object RegExp]"]=l["[object Set]"]=l["[object String]"]=l["[object WeakMap]"]=!1;var u="object"==typeof global&&global&&global.Object===Object&&global,f="object"==typeof self&&self&&self.Object===Object&&self,d=u||f||Function("return this")(),p="object"==typeof e&&e&&!e.nodeType&&e,h=p&&"object"==typeof t&&t&&!t.nodeType&&t,g=h&&h.exports===p,_=g&&u.process,E=function(){try{return h&&h.require&&h.require("util").types||_&&_.binding&&_.binding("util")}catch{}}(),v=E&&E.isTypedArray;var b=Array.prototype,y=Function.prototype,m=Object.prototype,O=d["__core-js_shared__"],I=y.toString,S=m.hasOwnProperty,N=function(){var e=/[^.]+$/.exec(O&&O.keys&&O.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),C=m.toString,T=I.call(Object),A=RegExp("^"+I.call(S).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),w=g?d.Buffer:void 0,D=d.Symbol,R=d.Uint8Array,L=w?w.allocUnsafe:void 0,j=function(e,t){return function(n){return e(t(n))}}(Object.getPrototypeOf,Object),$=Object.create,U=m.propertyIsEnumerable,k=b.splice,P=D?D.toStringTag:void 0,F=function(){try{var e=le(Object,"defineProperty");return e({},"",{}),e}catch{}}(),W=w?w.isBuffer:void 0,x=Math.max,G=Date.now,M=le(d,"Map"),z=le(Object,"create"),q=function(){function e(){}return function(t){if(!me(t))return{};if($)return $(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function B(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function K(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function V(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function J(e){var t=this.__data__=new K(e);this.size=t.size}function Y(e,t){var n=_e(e),r=!n&&ge(e),o=!n&&!r&&ve(e),i=!n&&!r&&!o&&Se(e),a=n||r||o||i,s=a?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],c=s.length;for(var l in e)(t||S.call(e,l))&&(!a||!("length"==l||o&&("offset"==l||"parent"==l)||i&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||ue(l,c)))&&s.push(l);return s}function H(e,t,n){(void 0!==n&&!he(e[t],n)||void 0===n&&!(t in e))&&Z(e,t,n)}function Q(e,t,n){var r=e[t];(!S.call(e,t)||!he(r,n)||void 0===n&&!(t in e))&&Z(e,t,n)}function X(e,t){for(var n=e.length;n--;)if(he(e[n][0],t))return n;return-1}function Z(e,t,n){"__proto__"==t&&F?F(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}B.prototype.clear=function(){this.__data__=z?z(null):{},this.size=0},B.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t},B.prototype.get=function(e){var t=this.__data__;if(z){var r=t[e];return r===n?void 0:r}return S.call(t,e)?t[e]:void 0},B.prototype.has=function(e){var t=this.__data__;return z?void 0!==t[e]:S.call(t,e)},B.prototype.set=function(e,t){var r=this.__data__;return this.size+=+!this.has(e),r[e]=z&&void 0===t?n:t,this},K.prototype.clear=function(){this.__data__=[],this.size=0},K.prototype.delete=function(e){var t=this.__data__,n=X(t,e);return!(n<0)&&(n==t.length-1?t.pop():k.call(t,n,1),--this.size,!0)},K.prototype.get=function(e){var t=this.__data__,n=X(t,e);return n<0?void 0:t[n][1]},K.prototype.has=function(e){return X(this.__data__,e)>-1},K.prototype.set=function(e,t){var n=this.__data__,r=X(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},V.prototype.clear=function(){this.size=0,this.__data__={hash:new B,map:new(M||K),string:new B}},V.prototype.delete=function(e){var t=ce(this,e).delete(e);return this.size-=+!!t,t},V.prototype.get=function(e){return ce(this,e).get(e)},V.prototype.has=function(e){return ce(this,e).has(e)},V.prototype.set=function(e,t){var n=ce(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},J.prototype.clear=function(){this.__data__=new K,this.size=0},J.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},J.prototype.get=function(e){return this.__data__.get(e)},J.prototype.has=function(e){return this.__data__.has(e)},J.prototype.set=function(e,t){var n=this.__data__;if(n instanceof K){var r=n.__data__;if(!M||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new V(r)}return n.set(e,t),this.size=n.size,this};var ee=function(e){return function(t,n,r){for(var o=-1,i=Object(t),a=r(t),s=a.length;s--;){var c=a[e?s:++o];if(!1===n(i[c],c,i))break}return t}}();function te(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":P&&P in Object(e)?function(e){var t=S.call(e,P),n=e[P];try{e[P]=void 0;var r=!0}catch{}var o=C.call(e);return r&&(t?e[P]=n:delete e[P]),o}(e):function(e){return C.call(e)}(e)}function ne(e){return Oe(e)&&te(e)==o}function re(e){return!(!me(e)||function(e){return!!N&&N in e}(e))&&(be(e)?A:s).test(function(e){if(null!=e){try{return I.call(e)}catch{}try{return e+""}catch{}}return""}(e))}function oe(e){if(!me(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=fe(e),n=[];for(var r in e)"constructor"==r&&(t||!S.call(e,r))||n.push(r);return n}function ie(e,t,n,r,o){e!==t&&ee(t,function(i,a){if(o||=new J,me(i))!function(e,t,n,r,o,i,a){var s=de(e,n),c=de(t,n),l=a.get(c);if(l)return void H(e,n,l);var u=i?i(s,c,n+"",e,t,a):void 0,f=void 0===u;if(f){var d=_e(c),p=!d&&ve(c),h=!d&&!p&&Se(c);u=c,d||p||h?_e(s)?u=s:function(e){return Oe(e)&&Ee(e)}(s)?u=function(e,t){var n=-1,r=e.length;for(t||=Array(r);++n<r;)t[n]=e[n];return t}(s):p?(f=!1,u=function(e,t){if(t)return e.slice();var n=e.length,r=L?L(n):new e.constructor(n);return e.copy(r),r}(c,!0)):h?(f=!1,u=function(e,t){var n=t?function(e){var t=new e.constructor(e.byteLength);return new R(t).set(new R(e)),t}(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}(c,!0)):u=[]:Ie(c)||ge(c)?(u=s,ge(s)?u=function(e){return function(e,t,n,r){var o=!n;n||={};for(var i=-1,a=t.length;++i<a;){var s=t[i],c=r?r(n[s],e[s],s,n,e):void 0;void 0===c&&(c=e[s]),o?Z(n,s,c):Q(n,s,c)}return n}(e,Ne(e))}(s):(!me(s)||be(s))&&(u=function(e){return"function"!=typeof e.constructor||fe(e)?{}:q(j(e))}(c))):f=!1}f&&(a.set(c,u),o(u,c,r,i,a),a.delete(c)),H(e,n,u)}(e,t,a,n,ie,r,o);else{var s=r?r(de(e,a),i,a+"",e,t,o):void 0;void 0===s&&(s=i),H(e,a,s)}},Ne)}function ae(e,t){return pe(function(e,t,n){return t=x(void 0===t?e.length-1:t,0),function(){for(var r=arguments,o=-1,i=x(r.length-t,0),a=Array(i);++o<i;)a[o]=r[t+o];o=-1;for(var s=Array(t+1);++o<t;)s[o]=r[o];return s[t]=n(a),function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}(e,this,s)}}(e,t,Ae),e+"")}var se=F?function(e,t){return F(e,"toString",{configurable:!0,enumerable:!1,value:Te(t),writable:!0})}:Ae;function ce(e,t){var n=e.__data__;return function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?n["string"==typeof t?"string":"hash"]:n.map}function le(e,t){var n=function(e,t){return e?.[t]}(e,t);return re(n)?n:void 0}function ue(e,t){var n=typeof e;return t??=r,!!t&&("number"==n||"symbol"!=n&&c.test(e))&&e>-1&&e%1==0&&e<t}function fe(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||m)}function de(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var pe=function(e){var t=0,n=0;return function(){var r=G(),o=16-(r-n);if(n=r,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(se);function he(e,t){return e===t||e!=e&&t!=t}var ge=ne(function(){return arguments}())?ne:function(e){return Oe(e)&&S.call(e,"callee")&&!U.call(e,"callee")},_e=Array.isArray;function Ee(e){return null!=e&&ye(e.length)&&!be(e)}var ve=W||function(){return!1};function be(e){if(!me(e))return!1;var t=te(e);return t==i||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}function ye(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=r}function me(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Oe(e){return"object"==typeof e&&!!e}function Ie(e){if(!Oe(e)||te(e)!=a)return!1;var t=j(e);if(null===t)return!0;var n=S.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&I.call(n)==T}var Se=v?function(e){return function(t){return e(t)}}(v):function(e){return Oe(e)&&ye(e.length)&&!!l[te(e)]};function Ne(e){return Ee(e)?Y(e,!0):oe(e)}var Ce=function(e){return ae(function(t,n){var r=-1,o=n.length,i=o>1?n[o-1]:void 0,a=o>2?n[2]:void 0;for(i=e.length>3&&"function"==typeof i?(o--,i):void 0,a&&function(e,t,n){if(!me(n))return!1;var r=typeof t;return!!("number"==r?Ee(n)&&ue(t,n.length):"string"==r&&t in n)&&he(n[t],e)}(n[0],n[1],a)&&(i=o<3?void 0:i,o=1),t=Object(t);++r<o;){var s=n[r];s&&e(t,s,r,i)}return t})}(function(e,t,n){ie(e,t,n)});function Te(e){return function(){return e}}function Ae(e){return e}t.exports=Ce})());function g(){return function(e){var t=[];if(0===e.length)return"";if("string"!=typeof e[0])throw TypeError("Url must be a string. Received "+e[0]);e[0].match(/^[^/:]+:\/*$/)&&e.length>1&&(e[0]=e.shift()+e[0]),e[0]=e[0].match(/^file:\/\/\//)?e[0].replace(/^([^/:]+):\/*/,"$1:///"):e[0].replace(/^([^/:]+):\/*/,"$1://");for(var n=0;n<e.length;n++){var r=e[n];if("string"!=typeof r)throw TypeError("Url must be a string. Received "+r);""!==r&&(n>0&&(r=r.replace(/^[\/]+/,"")),r=n<e.length-1?r.replace(/[\/]+$/,""):r.replace(/[\/]+$/,"/"),t.push(r))}var o=t.join("/"),i=(o=o.replace(/\/(\?|&|#[^!])/g,"$1")).split("?");return i.shift()+(i.length>0?"?":"")+i.join("&")}("object"==typeof arguments[0]?arguments[0]:[].slice.call(arguments))}let _=e=>!0===e.usePopover,E=function(e){return e.INSTANCE_CONFIGURATION_CANCELED="INSTANCE_CONFIGURATION_CANCELED",e.INSTANCE_CONFIGURATION_CLOSED="INSTANCE_CONFIGURATION_CLOSED",e.INSTANCE_CONFIGURATION_LOADED="INSTANCE_CONFIGURATION_LOADED",e.INSTANCE_CONFIGURATION_PAGE_LOADED="INSTANCE_CONFIGURATION_PAGE_LOADED",e.INSTANCE_CONFIGURATION_OPENED="INSTANCE_CONFIGURATION_OPENED",e.INSTANCE_CREATED="INSTANCE_CREATED",e.INSTANCE_DELETED="INSTANCE_DELETED",e.INSTANCE_DEPLOYED="INSTANCE_DEPLOYED",e.MARKETPLACE_CLOSED="MARKETPLACE_CLOSED",e.POPOVER_CLOSE_REQUESTED="POPOVER_CLOSE_REQUESTED",e.POPOVER_CLOSED="POPOVER_CLOSED",e.SET_AGENT_CONTEXT="SET_AGENT_CONTEXT",e.SET_CONFIG_VAR="SET_CONFIG_VAR",e.SET_FILTERS="SET_FILTERS",e.SET_SCREEN_CONFIGURATION="SET_SCREEN_CONFIGURATION",e.SET_TOKEN="SET_TOKEN",e.SET_TRANSLATION="SET_TRANSLATION",e.SET_VERSION="SET_VERSION",e.USER_CONFIGURATION_CLOSED="USER_CONFIGURATION_CLOSED",e.USER_CONFIGURATION_DELETED="USER_CONFIGURATION_DELETED",e.USER_CONFIGURATION_DEPLOYED="USER_CONFIGURATION_DEPLOYED",e.USER_CONFIGURATION_LOADED="USER_CONFIGURATION_LOADED",e.USER_CONFIGURATION_PAGE_LOADED="USER_CONFIGURATION_PAGE_LOADED",e.USER_CONFIGURATION_OPENED="USER_CONFIGURATION_OPENED",e.WORKFLOW_ENABLED="WORKFLOW_ENABLED",e.WORKFLOW_DELETED="WORKFLOW_DELETED",e.WORKFLOW_DISABLED="WORKFLOW_DISABLED",e}({}),v=()=>document.querySelector(w),b=()=>{let e=j(`${T} > iframe`);U(e)&&(e.contentWindow?.postMessage({event:"MARKETPLACE_CLOSED"},"*"),window.postMessage({event:"POPOVER_CLOSED"},"*"),v()?.classList.remove(D))},y=e=>Array.from(document.getElementsByTagName("iframe")).find(t=>t.contentWindow===e.source),m=e=>{let t=(e=>"iframe"in e)(e)?e.iframe:$(e.selector);U(t)&&t.contentWindow?.postMessage(e.event,"*")},O="pio__embedded",I="pio__iframe",S="pio__iframe-preload",N="pio__styles",C="pio__iframeContainer",T=`#${O} .${C}`,A="pio__overlay",w=`#${O} > .${A}`,D=`${A}--is_visible`,R="pio__popover",L="pio__closeBtn",j=e=>document.querySelector(e),$=e=>document.querySelector(`${e||T} > iframe`),U=e=>!(!e||"IFRAME"!==e.tagName),k=(e,t,n)=>{!_(t)&&!t.selector&&console.error("Could not find display selector.");let r=j(_(t)?T:t.selector);if(!r)return;let o=d.getStateCopy();t&&Object.entries(t).forEach(([e,t])=>{if(u(e)){let n=o[e],r=n instanceof Object?(0,h.default)(n,t):t;f(o,e,r)}});let i=new URLSearchParams({...n,embed:"true"});o.theme&&i.set("theme",o.theme),o.screenConfiguration?.initializing&&i.set("initializing",JSON.stringify(o.screenConfiguration.initializing)),o.fontConfiguration&&i.set("fontConfiguration",JSON.stringify(o.fontConfiguration));let a=`${g(o.prismaticUrl,e)}?${i}`;r.innerHTML=`\n    <iframe\n      id="${I}"\n      src="${a}"\n      height="100%"\n      width="100%"\n      frameBorder="0"\n      allow="clipboard-read; clipboard-write"\n    ></iframe>\n  `;let s=r.querySelector("iframe");if(s){let e=new AbortController;P(e),window.addEventListener("message",e=>{if("PRISMATIC_INITIALIZED"===e.data?.event){m({iframe:s,event:{event:"SET_TOKEN",data:o.jwt}}),m({iframe:s,event:{event:"SET_VERSION",data:"4.14.0"}}),m({iframe:s,event:{event:"SET_TRANSLATION",data:o.translation}});let e=_(t)?{...o.screenConfiguration??{},isInPopover:!0}:o.screenConfiguration;m({iframe:s,event:{event:"SET_SCREEN_CONFIGURATION",data:e}}),m({iframe:s,event:{event:"SET_FILTERS",data:o.filters}}),m({iframe:s,event:{event:"SET_AGENT_CONTEXT",data:o.agent?.context}})}else"POPOVER_CLOSE_REQUESTED"===e.data?.event&&b()},{signal:e.signal}),!1!==t?.autoFocusIframe&&s.addEventListener("mouseenter",()=>{s.focus()},{signal:e.signal})}_(t)&&v()?.classList.add(D)},P=e=>{new MutationObserver((t,n)=>{for(let r of t)if("childList"===r.type){let t=Array.from(r.removedNodes);for(let r of t)r.nodeType===Node.ELEMENT_NODE&&("IFRAME"===r.tagName&&"pio__iframe"===r.id||null!==r.querySelector("iframe#pio__iframe"))&&(e.abort(),n.disconnect())}}).observe(document.body,{attributes:!1,childList:!0,subtree:!0})},F=({...e})=>{if(p("configureInstance"),W(e)){let{instanceId:t,skipRedirectOnRemove:n,...r}=e;return k("/find-integration-marketplace/",r,{instanceId:t,...n?{skipRedirectOnRemove:"true"}:{}})}if(x(e)){let{integrationId:t,skipRedirectOnRemove:n,...r}=e;return k("/find-integration-marketplace/",r,{integrationId:t,...n?{skipRedirectOnRemove:"true"}:{}})}if(G(e)){let{integrationName:t,skipRedirectOnRemove:n,...r}=e;k("/find-integration-marketplace/",r,{integrationName:t,...n?{skipRedirectOnRemove:"true"}:{}})}},W=e=>!(!("instanceId"in e)||!e.instanceId),x=e=>!(!("integrationId"in e)||!e.integrationId),G=e=>!(!("integrationName"in e)||!e.integrationName),M=async({query:e,variables:t})=>{p("authenticate");let{jwt:n,prismaticUrl:r}=d.getStateCopy();return await(await fetch(g(r,"api"),{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify({query:e,variables:t})})).json()},z="The authenticate method expects an object containing a token and additional optional configuration.",q=["token"],B=async e=>{if(p("authenticate"),!e)throw Error(z);let t=new Set(Object.keys(e));if(!q.every(e=>t.has(e)))throw Error(z);let{token:n}=e,r=document.getElementById(I),o=d.getStateCopy();o.jwt!==n&&r&&m({iframe:r,event:{event:"SET_TOKEN",data:n}});let i=e.prismaticUrl??o.prismaticUrl,a=await fetch(g(i,"embedded","authenticate"),{headers:{Authorization:`Bearer ${n}`},method:"post"});if(!a.ok){let e=await a.text();throw Error(e?`Authentication failed. Server sent back: ${e}`:"Authentication failed. Please check that your customer and organization information are correct, and that the token you provided is not expired.")}o.jwt=n,d.setState(o),o.embeddedDesignerEnabled=(await M({query:"{\n      authenticatedUser {\n        customer {\n          allowEmbeddedDesigner\n        }\n      }\n    }"})).data.authenticatedUser.customer.allowEmbeddedDesigner,d.setState(o)};async function K(e,t){return p("createWorkflow"),M({query:"\n  mutation createWorkflow($name: String!, $contextStableKey: String, $contextData: String, $externalId: String) {\n    importWorkflow(input: {\n      name: $name\n      contextStableKey: $contextStableKey\n      contextData: $contextData\n      externalId: $externalId\n    }) {\n      workflow {\n        id\n      }\n      errors {\n        field\n        messages\n      }\n    }\n  }\n",variables:{name:t.name,contextStableKey:e,contextData:JSON.stringify(t.contextData),externalId:t.externalId}})}let V,J=`<style id="${N}">\n  .${A} {\n    backdrop-filter: blur(10px);\n    background: rgb(119 119 119 / 29%);\n    bottom: 0;\n    display: block;\n    left: 0;\n    opacity: 0;\n    position: fixed;\n    right: 0;\n    top: 0;\n    transition: all 0.3s ease-in;\n    visibility: hidden;\n    z-index: 9999;\n  }\n  .${A}.${D} {\n    opacity: 1;\n    visibility: visible;\n  }\n  .${R} {\n    background: #fff;\n    border-radius: 4px;\n    bottom: 0;\n    height: 80vh;\n    left: 0;\n    margin: auto;\n    overflow: hidden;\n    position: absolute;\n    right: 0;\n    top: 0;\n    width: 80vw;\n  }\n  .${L} {\n    all: unset;\n    cursor: pointer;\n    position: absolute;\n    right: 1.5em;\n    top: 1.3em;\n  }\n  .${C} {\n    height: 100%\n  }\n</style>`,Y={filters:{marketplace:{includeActiveIntegrations:!0},integrations:{},components:{}},screenConfiguration:{configurationWizard:{},instance:{},marketplace:{},initializing:{}},skipPreload:!1,theme:"LIGHT",fontConfiguration:void 0,translation:{}},H=e=>{let t=(0,h.default)({},Y,e),n=d.getInitialState();if(t&&Object.entries(t).forEach(([e,t])=>{u(e)&&f(n,e,t)}),n.initComplete=!0,d.setState(n),document.getElementById("pio__embedded"))return;!document.getElementById("pio__iframe-preload")&&!t.skipPreload&&document.body.insertAdjacentHTML("beforeend",`<iframe\n        id="${S}"\n        src="${n.prismaticUrl}/embedded"\n        style="visibility: hidden; display: none;"\n        height="0"\n        width="0"\n      />`),document.head.insertAdjacentHTML("beforeend",J);let r=document.createElement("div");r.id=O,r.innerHTML=`\n    <div class="${A}">\n      <div class="${R}">\n        <button class="${L}" aria-label="close popover" data-close>✕</button>\n        <div class="${C}"></div>\n      </div>\n    </div>\n  `,document.body.appendChild(r);let o=document.querySelector(`#${O} .${L}`),i=document.querySelector(w);V=new AbortController;let{signal:a}=V;i?.addEventListener("click",e=>{e.target===e.currentTarget&&b()},{signal:a}),o?.addEventListener("click",()=>b(),{signal:a}),document.addEventListener("keyup",e=>{"Escape"===e.key&&document.querySelector(`.${D}`)&&b()},{signal:a})},Q=()=>{document.getElementById(O)?.remove(),document.getElementById(S)?.remove(),document.getElementById(N)?.remove(),V?.abort(),V=void 0,d.setState(d.getInitialState())},X=({instanceId:e,selector:t,theme:n,screenConfiguration:r,onCancel:o,onSuccess:i,onDelete:a})=>{if(p("editInstanceConfiguration"),k(`/configure-instance/${e}/`,{selector:t,...n?{theme:n}:{},screenConfiguration:{...r,configurationWizard:{...r?.configurationWizard,isInModal:!0}}},{reconfigure:"true"}),!o&&!i&&!a)return;let s=new AbortController;return window.addEventListener("message",e=>{switch(e.data?.event){case"INSTANCE_DEPLOYED":i?.(),s.abort();break;case"INSTANCE_DELETED":a?.(),s.abort();break;case"INSTANCE_CONFIGURATION_CANCELED":o?.(),s.abort()}},{signal:s.signal}),()=>s.abort()},Z=({instanceId:e,selector:t,theme:n,screenConfiguration:r,onCancel:o,onSuccess:i,onDelete:a})=>{if(p("editUserLevelConfiguration"),k(`/configure-instance/${e}/`,{selector:t,...n?{theme:n}:{},screenConfiguration:{...r,configurationWizard:{...r?.configurationWizard,isInModal:!0}}},{reconfigure:"true",userLevelConfigured:"true"}),!o&&!i&&!a)return;let s=new AbortController;return window.addEventListener("message",e=>{switch(e.data?.event){case"USER_CONFIGURATION_DEPLOYED":i?.(),s.abort();break;case"USER_CONFIGURATION_DELETED":a?.(),s.abort();break;case"INSTANCE_CONFIGURATION_CANCELED":o?.(),s.abort()}},{signal:s.signal}),()=>s.abort()},ee=async e=>(p("queryWorkflows"),M({query:"\n  query queryWorkflows(\n    $cursor: String\n    $searchTerm: String\n    $descriptionSearch: String\n    $categorySearch: String\n    $labelSearch: String\n    $contextStableKey: String\n    $externalId: String\n    $first: Int\n    $sortBy: [IntegrationVariantOrder]\n  ) {\n    workflows: integrationVariants(\n      after: $cursor\n      name_Icontains: $searchTerm\n      description_Icontains: $descriptionSearch\n      category: $categorySearch\n      labels_Icontains: $labelSearch\n      contextStableKey: $contextStableKey\n      externalId: $externalId\n      exclude: [INTEGRATION]\n      first: $first\n      sortBy: $sortBy\n    ) {\n      nodes {\n        ... on Workflow {\n          id\n          name\n          versionNumber\n          description\n          externalId\n          updatedAt\n          lastExecutedAt\n          createdAt\n          category\n          labels\n          customer {\n            id\n            name\n          }\n          instance {\n            enabled\n          }\n          deployedVersion {\n            id\n          }\n        }\n      }\n      pageInfo {\n        hasNextPage\n        endCursor\n      }\n      totalCount\n    }\n  }\n",variables:e})),te=({configVars:e,...t})=>{m({...t,event:{event:"SET_CONFIG_VAR",data:e}})},ne=({componentId:e,...t})=>{p("showComponent"),k(`/components/${e}/`,t,{})},re=e=>{p("showComponents"),k("/components/",e,{})},oe=e=>{p("showConnections"),k("/customer-connections/",e,{})},ie=(e={usePopover:!0})=>{p("showDashboard"),k("/dashboard/",e,{})},ae=e=>{let{embeddedDesignerEnabled:t}=d.getStateCopy();if(!t)throw Error(`Embedded designer must be enabled for this customer in order to call ${e}`)},se=({integrationId:e,...t})=>{p("showDesigner"),ae("showDesigner"),k(`/integrations/${e}/`,t,{})},ce=e=>{p("showIntegrations"),ae("showIntegrations"),k("/integrations/",e,{})},le=e=>{p("showLogs"),k("/logs/",e,{})},ue=(e={usePopover:!0})=>{p("showMarketplace"),k("/integration-marketplace/",e,{})},fe=({workflowId:e,onDelete:t,...n})=>{if(p("showWorkflowBuilder"),k(`/builder/${e}/`,n,{}),t){let e=new AbortController;return window.addEventListener("message",e=>{"WORKFLOW_DELETED"===e.data?.event&&t()},{signal:e.signal}),()=>e.abort()}},de=e=>{p("showWorkflows"),k("/workflows/",e,{})},pe=function(e){return e.and="and",e.or="or",e}({}),he=function(e){return e.equal="equal",e.notEqual="notEqual",e.in="in",e.notIn="notIn",e.startsWith="startsWith",e.doesNotStartWith="doesNotStartWith",e.endsWith="endsWith",e.doesNotEndWith="doesNotEndWith",e}({});var ge=((e,t)=>{let r={};for(var o in e)n(r,o,{get:e[o],enumerable:!0});return t||n(r,Symbol.toStringTag,{value:"Module"}),r})({BooleanOperator:()=>pe,EMBEDDED_DEFAULTS:()=>Y,PrismaticMessageEvent:()=>E,TermOperator:()=>he,authenticate:()=>B,closePopover:()=>b,configureInstance:()=>F,createWorkflow:()=>K,dispose:()=>Q,editInstanceConfiguration:()=>X,editUserLevelConfiguration:()=>Z,getMessageIframe:()=>y,graphqlRequest:()=>M,init:()=>H,isConfigureInstanceWithInstanceId:()=>W,isConfigureInstanceWithIntegrationId:()=>x,isConfigureInstanceWithIntegrationName:()=>G,queryWorkflows:()=>ee,setConfigVars:()=>te,showComponent:()=>ne,showComponents:()=>re,showConnections:()=>oe,showDashboard:()=>ie,showDesigner:()=>se,showIntegrations:()=>ce,showLogs:()=>le,showMarketplace:()=>ue,showWorkflow:()=>fe,showWorkflows:()=>de});e.BooleanOperator=pe,e.EMBEDDED_DEFAULTS=Y,e.PrismaticMessageEvent=E,e.TermOperator=he,e.authenticate=B,e.closePopover=b,e.configureInstance=F,e.createWorkflow=K,e.default=ge,e.dispose=Q,e.editInstanceConfiguration=X,e.editUserLevelConfiguration=Z,e.getMessageIframe=y,e.graphqlRequest=M,e.init=H,e.isConfigureInstanceWithInstanceId=W,e.isConfigureInstanceWithIntegrationId=x,e.isConfigureInstanceWithIntegrationName=G,e.queryWorkflows=ee,e.setConfigVars=te,e.showComponent=ne,e.showComponents=re,e.showConnections=oe,e.showDashboard=ie,e.showDesigner=se,e.showIntegrations=ce,e.showLogs=le,e.showMarketplace=ue,e.showWorkflow=fe,e.showWorkflows=de});
//# sourceMappingURL=/sm/9c21d9abe0233c703bab5ea1a178c24fddc687637463e618d96babf84935ab2a.map