UNPKG

@digital-blueprint/formalize-app

Version:

[GitHub Repository](https://github.com/digital-blueprint/formalize-app) | [npmjs package](https://www.npmjs.com/package/@digital-blueprint/formalize-app) | [Unpkg CDN](https://unpkg.com/browse/@digital-blueprint/formalize-app/) | [Formalize Bundle](https:

22 lines (21 loc) 3.36 kB
function t(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}function e(e){for(var i=1;i<arguments.length;i++){var n=null!=arguments[i]?arguments[i]:{};i%2?t(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):t(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function r(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)} /*! * License: LGPL-2.1-or-later * Dependencies: * * @webcomponents/scoped-custom-element-registry: BSD-3-Clause * @dbp-toolkit/app-shell: LGPL-2.1-or-later * @dbp-toolkit/language-select: LGPL-2.1-or-later * @dbp-toolkit/auth: LGPL-2.1-or-later * @dbp-toolkit/theme-switcher: LGPL-2.1-or-later * universal-router: MIT * @dbp-toolkit/matomo: LGPL-2.1-or-later * @dbp-toolkit/tabulator-table: LGPL-2.1-or-later * xlsx: Apache-2.0 * jspdf-autotable: MIT * xss: MIT * cssfilter: MIT * @dbp-toolkit/common: LGPL-2.1-or-later * lit-html: BSD-3-Clause */(t,"string");return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}import{L as i,a as n,D as o,s}from"./notification.DekX2Yn_.es.js";import{c as a}from"./i18n.sFs-myza.es.js";import{g as c}from"./error.CxyP7_gO.es.js";class u extends(i(n(o),a)){constructor(){super(),this._initialized=!1,this.entryPointUrl="",this.basePath=""}static get properties(){return e(e({},super.properties),{},{entryPointUrl:{type:String,attribute:"entry-point-url"},basePath:{type:String,attribute:"base-path"}})}connectedCallback(){super.connectedCallback()}loginCallback(){this._initialized||(this.initialize(),this._initialized=!0)}initialize(){}update(t){t.forEach(((t,e)=>{})),super.update(t)}isLoading(){return this.isAuthPending()}async httpGetAsync(t,e){return await fetch(t,e).then((t=>{if(!t.ok)throw t;return t})).catch((t=>t))}handleErrorResponse(t){switch(t.status){case 401:case 403:s({summary:this._i18n.t("errors.unauthorized-title"),body:this._i18n.t("errors.unauthorized-body"),type:"danger",timeout:5});break;case 404:s({summary:this._i18n.t("errors.notfound-title"),body:this._i18n.t("errors.notfound-body"),type:"danger",timeout:5});break;case 422:s({summary:this._i18n.t("errors.unprocessable_entity-title"),body:this._i18n.t("errors.unprocessable_entity-body"),type:"danger",timeout:5});break;default:s({summary:this._i18n.t("errors.other-title"),body:this._i18n.t("errors.other-body"),type:"danger",timeout:5})}}async sendErrorAnalyticsEvent(t,e,r,i={}){let n={};try{n=await i.clone().json()}catch(t){n=i}const o={status:i.status||"",url:i.url||"",description:n["hydra:description"]||"",errorDetails:n["relay:errorDetails"]||"",information:r,stack:c().slice(1,6)};this.sendSetPropertyEvent("analytics-event",{category:t,action:e,name:JSON.stringify(o)})}}export{u as D}; //# sourceMappingURL=dbp-formalize-lit-element.Ct2psBFR.es.js.map