"use strict";(self.webpackChunkdami=self.webpackChunkdami||[]).push([[6276],{26276:(e,a,t)=>{t.r(a),t.d(a,{default:()=>i});var o=t(93150),n=t.n(o);function s(e,a){const t=document.createElement("textarea");return document.body.appendChild(t),"paste"===e?(t.focus(),document.execCommand("paste"),a=t.value):"copy"===e&&(t.value=a,t.select(),document.execCommand("copy"),t.blur()),t.remove(),a}async function i({data:e,id:a,label:t}){if(!await n().permissions.contains({permissions:["clipboardRead"]}))throw new Error("no-clipboard-acces");let o="";if(e.type&&"get"!==e.type){if("insert"===e.type){let n="";if(e.copySelectedText){if(!this.activeTab.id)throw new Error("no-tab");n=await this._sendMessageToTab({id:a,label:t})}else n=e.dataToCopy;o=n,s("copy",n)}}else{const a=s("paste");o=a,e.assignVariable&&this.setVariable(e.variableName,a),e.saveData&&this.addDataToColumn(e.dataColumn,a)}return{data:o,nextBlockId:this.getBlockConnections(a)}}}}]);