(window.webpackJsonp=window.webpackJsonp||[]).push([[60,191],{147:function(t,e,a){"use strict";a.r(e),a.d(e,"YasguiPersistenceMigrationService",(function(){return o}));var n=a(86);const i="yagui__"+n.VIEW_SPARQL_EDITOR,s="completed",r="rejected",o=function(){const t=()=>({val:{active:null,tabs:[],tabConfig:{}}}),e=(t,e,a=null)=>{t.val.migration={date:(new Date).toISOString(),status:e,error:a}},a=(t,e)=>{t.val.tabs.push(e)},n=(t,e)=>{t.val.tabConfig[e.id]=e},o=t=>{let e=localStorage.getItem(t);if(e)return e=JSON.parse(e),e},l=t=>{t.val.tabs=t.val.tabs.filter(t=>!t.startsWith("_"))},g=t=>{for(const e in t.val.tabConfig)e.startsWith("_")&&delete t.val.tabConfig[e]},c=(t,e)=>{localStorage.setItem(t,JSON.stringify(e))},u=(t,e)=>`${e} ${t}`,d=()=>Math.random().toString(36).substring(7);return{isMigrationNeeded:()=>{const t=o(i);let e=!1;return t&&(e=t.val.migration&&(t.val.migration.status===s||t.val.migration.status===r)),!(!localStorage.getItem("ls.tabs-state")||e)},revertMigration:()=>{const t=o(i);l(t),g(t),c(i,t)},migrateYasguiPersistence:r=>{let l=o("ls.tabs-state");l=Object.freeze(l);let g=o(i);g||(g=t()),l.map(t=>({id:t.id,name:t.name,yasqe:{value:t.query,sameAs:t.sameAs,infer:t.inference,pageSize:1e3,pageNumber:1},yasr:{response:null,settings:{selectedPlugin:"extended_table",pluginsConfig:{}}},requestConfig:{method:"POST"}})).forEach((t,e)=>{t.id="_"+d(),t.name=t.name||u(e,r),a(g,t.id),n(g,t)}),g.val.active=g.val.tabs[0],e(g,s),c(i,g)},rejectMigration:()=>{const t=o(i);e(t,r),c(i,t)}}}()},86:function(t,e,a){"use strict";a.r(e),a.d(e,"VIEW_SPARQL_EDITOR",(function(){return n}));const n="graphdb-workbench-sparql-editor"}}]);