ds-one 0.1.11-alpha.6 → 0.1.11-alpha.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/DS1/0-face/2025-04-23-device.ts +117 -1
- package/DS1/1-root/one.css +1 -1
- package/DS1/index.ts +6 -0
- package/DS1/utils/cdn-loader.ts +5 -0
- package/DS1/utils/keys.json +41 -1
- package/README.md +1 -1
- package/dist/0-face/2025-04-23-device.d.ts +24 -0
- package/dist/0-face/2025-04-23-device.d.ts.map +1 -1
- package/dist/0-face/2025-04-23-device.js +84 -1
- package/dist/ds-one.bundle.js +113 -1
- package/dist/ds-one.bundle.js.map +3 -3
- package/dist/ds-one.bundle.min.js +32 -32
- package/dist/ds-one.bundle.min.js.map +4 -4
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/utils/cdn-loader.d.ts.map +1 -1
- package/dist/utils/cdn-loader.js +5 -0
- package/dist/utils/keys.json +41 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var Ct=!1,Er=["./keys.json","./tekst.json","./tekster.json","./language.json","./languages.json","./translations.json","./translate.json","./i18n.json","./locales.json","./strings.json","./text.json","./texts.json"];function Ar(t){if(!t)return null;let e=t.trim();return e?e.startsWith("./")||e.startsWith("../")||e.startsWith("/")||/^https?:\/\//i.test(e)?e:`./${e}`:null}function Lr(){if(typeof document>"u")return null;let e=document.querySelector("script[data-ds-one-translations]")?.getAttribute("data-ds-one-translations");if(e)return e;let r=document.querySelector('meta[name="ds-one:translations"]')?.getAttribute("content");if(r)return r;let n=document.querySelector('link[rel="ds-one-translations"]')?.getAttribute("href");return n||null}function Tr(){let t=new Set,e=typeof window<"u"?window.DS_ONE_TRANSLATIONS_FILE:null,r=Lr(),n=i=>{let s=Ar(i??"");s&&t.add(s)};return n(e??null),n(r),Er.forEach(i=>n(i)),Array.from(t)}function Nr(t){return!t||typeof t!="object"?!1:Object.values(t).every(e=>e&&typeof e=="object")}async function Ir(t){try{let e=await fetch(t);if(!e.ok)return null;let r=await e.json();return Nr(r)?Object.keys(r).length===0?(console.warn(`[DS one] No languages found in ${t}`),null):r:(console.warn(`[DS one] Invalid translation format in ${t}. Expected object with language codes as keys.`),null)}catch(e){return e instanceof TypeError&&e.message.includes("Failed to fetch")||console.error(`[DS one] Error loading external translations from ${t}:`,e),null}}async function kt(){if(Ct||(Ct=!0,typeof window>"u"))return!1;if(window.DS_ONE_TRANSLATIONS&&Object.keys(window.DS_ONE_TRANSLATIONS).length>0)return console.log(`[DS one] Translations already loaded (${Object.keys(window.DS_ONE_TRANSLATIONS).length} languages), skipping auto-load`),!0;let t=Tr();for(let e of t){let r=await Ir(e);if(!r)continue;window.DS_ONE_TRANSLATIONS=r;let n=Object.keys(r);return console.log(`[DS one] External translations loaded from ${e}: ${n.length} language(s) \u2013 ${n.join(", ")}`),window.dispatchEvent(new CustomEvent("translations-ready")),!0}return console.info(`[DS one] No external translations found. Looked in: ${t.join(", ")}. Using bundled translations.`),!1}typeof window<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>{kt()}):kt());var ve=globalThis,ye=ve.ShadowRoot&&(ve.ShadyCSS===void 0||ve.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Xe=Symbol(),Et=new WeakMap,G=class{constructor(e,r,n){if(this._$cssResult$=!0,n!==Xe)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=r}get styleSheet(){let e=this.o,r=this.t;if(ye&&e===void 0){let n=r!==void 0&&r.length===1;n&&(e=Et.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Et.set(r,e))}return e}toString(){return this.cssText}},At=t=>new G(typeof t=="string"?t:t+"",void 0,Xe),c=(t,...e)=>{let r=t.length===1?t[0]:e.reduce(((n,i,s)=>n+(a=>{if(a._$cssResult$===!0)return a.cssText;if(typeof a=="number")return a;throw Error("Value passed to 'css' function must be a 'css' function result: "+a+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[s+1]),t[0]);return new G(r,t,Xe)},Lt=(t,e)=>{if(ye)t.adoptedStyleSheets=e.map((r=>r instanceof CSSStyleSheet?r:r.styleSheet));else for(let r of e){let n=document.createElement("style"),i=ve.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=r.cssText,t.appendChild(n)}},Qe=ye?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(let n of e.cssRules)r+=n.cssText;return At(r)})(t):t;var{is:Mr,defineProperty:Vr,getOwnPropertyDescriptor:Hr,getOwnPropertyNames:Or,getOwnPropertySymbols:Dr,getPrototypeOf:Pr}=Object,V=globalThis,Tt=V.trustedTypes,Ur=Tt?Tt.emptyScript:"",Rr=V.reactiveElementPolyfillSupport,Z=(t,e)=>t,et={toAttribute(t,e){switch(e){case Boolean:t=t?Ur:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let r=t;switch(e){case Boolean:r=t!==null;break;case Number:r=t===null?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch{r=null}}return r}},It=(t,e)=>!Mr(t,e),Nt={attribute:!0,type:String,converter:et,reflect:!1,useDefault:!1,hasChanged:It};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),V.litPropertyMetadata??(V.litPropertyMetadata=new WeakMap);var N=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,r=Nt){if(r.state&&(r.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((r=Object.create(r)).wrapped=!0),this.elementProperties.set(e,r),!r.noAccessor){let n=Symbol(),i=this.getPropertyDescriptor(e,n,r);i!==void 0&&Vr(this.prototype,e,i)}}static getPropertyDescriptor(e,r,n){let{get:i,set:s}=Hr(this.prototype,e)??{get(){return this[r]},set(a){this[r]=a}};return{get:i,set(a){let g=i?.call(this);s?.call(this,a),this.requestUpdate(e,g,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Nt}static _$Ei(){if(this.hasOwnProperty(Z("elementProperties")))return;let e=Pr(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Z("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Z("properties"))){let r=this.properties,n=[...Or(r),...Dr(r)];for(let i of n)this.createProperty(i,r[i])}let e=this[Symbol.metadata];if(e!==null){let r=litPropertyMetadata.get(e);if(r!==void 0)for(let[n,i]of r)this.elementProperties.set(n,i)}this._$Eh=new Map;for(let[r,n]of this.elementProperties){let i=this._$Eu(r,n);i!==void 0&&this._$Eh.set(i,r)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let r=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let i of n)r.unshift(Qe(i))}else e!==void 0&&r.push(Qe(e));return r}static _$Eu(e,r){let n=r.attribute;return n===!1?void 0:typeof n=="string"?n:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((e=>e(this)))}addController(e){(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,r=this.constructor.elementProperties;for(let n of r.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Lt(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),this._$EO?.forEach((e=>e.hostConnected?.()))}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach((e=>e.hostDisconnected?.()))}attributeChangedCallback(e,r,n){this._$AK(e,n)}_$ET(e,r){let n=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,n);if(i!==void 0&&n.reflect===!0){let s=(n.converter?.toAttribute!==void 0?n.converter:et).toAttribute(r,n.type);this._$Em=e,s==null?this.removeAttribute(i):this.setAttribute(i,s),this._$Em=null}}_$AK(e,r){let n=this.constructor,i=n._$Eh.get(e);if(i!==void 0&&this._$Em!==i){let s=n.getPropertyOptions(i),a=typeof s.converter=="function"?{fromAttribute:s.converter}:s.converter?.fromAttribute!==void 0?s.converter:et;this._$Em=i;let g=a.fromAttribute(r,s.type);this[i]=g??this._$Ej?.get(i)??g,this._$Em=null}}requestUpdate(e,r,n){if(e!==void 0){let i=this.constructor,s=this[e];if(n??(n=i.getPropertyOptions(e)),!((n.hasChanged??It)(s,r)||n.useDefault&&n.reflect&&s===this._$Ej?.get(e)&&!this.hasAttribute(i._$Eu(e,n))))return;this.C(e,r,n)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,r,{useDefault:n,reflect:i,wrapped:s},a){n&&!(this._$Ej??(this._$Ej=new Map)).has(e)&&(this._$Ej.set(e,a??r??this[e]),s!==!0||a!==void 0)||(this._$AL.has(e)||(this.hasUpdated||n||(r=void 0),this._$AL.set(e,r)),i===!0&&this._$Em!==e&&(this._$Eq??(this._$Eq=new Set)).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(r){Promise.reject(r)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(let[i,s]of this._$Ep)this[i]=s;this._$Ep=void 0}let n=this.constructor.elementProperties;if(n.size>0)for(let[i,s]of n){let{wrapped:a}=s,g=this[i];a!==!0||this._$AL.has(i)||g===void 0||this.C(i,void 0,s,g)}}let e=!1,r=this._$AL;try{e=this.shouldUpdate(r),e?(this.willUpdate(r),this._$EO?.forEach((n=>n.hostUpdate?.())),this.update(r)):this._$EM()}catch(n){throw e=!1,this._$EM(),n}e&&this._$AE(r)}willUpdate(e){}_$AE(e){this._$EO?.forEach((r=>r.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&(this._$Eq=this._$Eq.forEach((r=>this._$ET(r,this[r])))),this._$EM()}updated(e){}firstUpdated(e){}};N.elementStyles=[],N.shadowRootOptions={mode:"open"},N[Z("elementProperties")]=new Map,N[Z("finalized")]=new Map,Rr?.({ReactiveElement:N}),(V.reactiveElementVersions??(V.reactiveElementVersions=[])).push("2.1.1");var Y=globalThis,we=Y.trustedTypes,Mt=we?we.createPolicy("lit-html",{createHTML:t=>t}):void 0,rt="$lit$",I=`lit$${Math.random().toFixed(9).slice(2)}$`,nt="?"+I,jr=`<${nt}>`,P=document,X=()=>P.createComment(""),Q=t=>t===null||typeof t!="object"&&typeof t!="function",it=Array.isArray,Ut=t=>it(t)||typeof t?.[Symbol.iterator]=="function",tt=`[
|
|
2
|
-
\f\r]`,J=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,
|
|
3
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),Ot=/'/g,Dt=/"/g,Rt=/^(?:script|style|textarea|title)$/i,st=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),o=st(1),jt=st(2),Hn=st(3),M=Symbol.for("lit-noChange"),w=Symbol.for("lit-nothing"),Pt=new WeakMap,D=P.createTreeWalker(P,129);function zt(t,e){if(!it(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return Mt!==void 0?Mt.createHTML(e):e}var Wt=(t,e)=>{let r=t.length-1,n=[],i,s=e===2?"<svg>":e===3?"<math>":"",a=J;for(let g=0;g<r;g++){let u=t[g],p,v,d=-1,A=0;for(;A<u.length&&(a.lastIndex=A,v=a.exec(u),v!==null);)A=a.lastIndex,a===J?v[1]==="!--"?a=Vt:v[1]!==void 0?a=Ht:v[2]!==void 0?(Rt.test(v[2])&&(i=RegExp("</"+v[2],"g")),a=O):v[3]!==void 0&&(a=O):a===O?v[0]===">"?(a=i??J,d=-1):v[1]===void 0?d=-2:(d=a.lastIndex-v[2].length,p=v[1],a=v[3]===void 0?O:v[3]==='"'?Dt:Ot):a===Dt||a===Ot?a=O:a===Vt||a===Ht?a=J:(a=O,i=void 0);let f=a===O&&t[g+1].startsWith("/>")?" ":"";s+=a===J?u+jr:d>=0?(n.push(p),u.slice(0,d)+rt+u.slice(d)+I+f):u+I+(d===-2?g:f)}return[zt(t,s+(t[r]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),n]},ee=class t{constructor({strings:e,_$litType$:r},n){let i;this.parts=[];let s=0,a=0,g=e.length-1,u=this.parts,[p,v]=Wt(e,r);if(this.el=t.createElement(p,n),D.currentNode=this.el.content,r===2||r===3){let d=this.el.content.firstChild;d.replaceWith(...d.childNodes)}for(;(i=D.nextNode())!==null&&u.length<g;){if(i.nodeType===1){if(i.hasAttributes())for(let d of i.getAttributeNames())if(d.endsWith(rt)){let A=v[a++],f=i.getAttribute(d).split(I),C=/([.?@])?(.*)/.exec(A);u.push({type:1,index:s,name:C[2],strings:f,ctor:C[1]==="."?xe:C[1]==="?"?_e:C[1]==="@"?$e:R}),i.removeAttribute(d)}else d.startsWith(I)&&(u.push({type:6,index:s}),i.removeAttribute(d));if(Rt.test(i.tagName)){let d=i.textContent.split(I),A=d.length-1;if(A>0){i.textContent=we?we.emptyScript:"";for(let f=0;f<A;f++)i.append(d[f],X()),D.nextNode(),u.push({type:2,index:++s});i.append(d[A],X())}}}else if(i.nodeType===8)if(i.data===nt)u.push({type:2,index:s});else{let d=-1;for(;(d=i.data.indexOf(I,d+1))!==-1;)u.push({type:7,index:s}),d+=I.length-1}s++}}static createElement(e,r){let n=P.createElement("template");return n.innerHTML=e,n}};function U(t,e,r=t,n){if(e===M)return e;let i=n!==void 0?r._$Co?.[n]:r._$Cl,s=Q(e)?void 0:e._$litDirective$;return i?.constructor!==s&&(i?._$AO?.(!1),s===void 0?i=void 0:(i=new s(t),i._$AT(t,r,n)),n!==void 0?(r._$Co??(r._$Co=[]))[n]=i:r._$Cl=i),i!==void 0&&(e=U(t,i._$AS(t,e.values),i,n)),e}var be=class{constructor(e,r){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=r}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:r},parts:n}=this._$AD,i=(e?.creationScope??P).importNode(r,!0);D.currentNode=i;let s=D.nextNode(),a=0,g=0,u=n[0];for(;u!==void 0;){if(a===u.index){let p;u.type===2?p=new z(s,s.nextSibling,this,e):u.type===1?p=new u.ctor(s,u.name,u.strings,this,e):u.type===6&&(p=new Se(s,this,e)),this._$AV.push(p),u=n[++g]}a!==u?.index&&(s=D.nextNode(),a++)}return D.currentNode=P,i}p(e){let r=0;for(let n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,r),r+=n.strings.length-2):n._$AI(e[r])),r++}},z=class t{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,r,n,i){this.type=2,this._$AH=w,this._$AN=void 0,this._$AA=e,this._$AB=r,this._$AM=n,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,r=this._$AM;return r!==void 0&&e?.nodeType===11&&(e=r.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,r=this){e=U(this,e,r),Q(e)?e===w||e==null||e===""?(this._$AH!==w&&this._$AR(),this._$AH=w):e!==this._$AH&&e!==M&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Ut(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==w&&Q(this._$AH)?this._$AA.nextSibling.data=e:this.T(P.createTextNode(e)),this._$AH=e}$(e){let{values:r,_$litType$:n}=e,i=typeof n=="number"?this._$AC(e):(n.el===void 0&&(n.el=ee.createElement(zt(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===i)this._$AH.p(r);else{let s=new be(i,this),a=s.u(this.options);s.p(r),this.T(a),this._$AH=s}}_$AC(e){let r=Pt.get(e.strings);return r===void 0&&Pt.set(e.strings,r=new ee(e)),r}k(e){it(this._$AH)||(this._$AH=[],this._$AR());let r=this._$AH,n,i=0;for(let s of e)i===r.length?r.push(n=new t(this.O(X()),this.O(X()),this,this.options)):n=r[i],n._$AI(s),i++;i<r.length&&(this._$AR(n&&n._$AB.nextSibling,i),r.length=i)}_$AR(e=this._$AA.nextSibling,r){for(this._$AP?.(!1,!0,r);e!==this._$AB;){let n=e.nextSibling;e.remove(),e=n}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},R=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,r,n,i,s){this.type=1,this._$AH=w,this._$AN=void 0,this.element=e,this.name=r,this._$AM=i,this.options=s,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=w}_$AI(e,r=this,n,i){let s=this.strings,a=!1;if(s===void 0)e=U(this,e,r,0),a=!Q(e)||e!==this._$AH&&e!==M,a&&(this._$AH=e);else{let g=e,u,p;for(e=s[0],u=0;u<s.length-1;u++)p=U(this,g[n+u],r,u),p===M&&(p=this._$AH[u]),a||(a=!Q(p)||p!==this._$AH[u]),p===w?e=w:e!==w&&(e+=(p??"")+s[u+1]),this._$AH[u]=p}a&&!i&&this.j(e)}j(e){e===w?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},xe=class extends R{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===w?void 0:e}},_e=class extends R{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==w)}},$e=class extends R{constructor(e,r,n,i,s){super(e,r,n,i,s),this.type=5}_$AI(e,r=this){if((e=U(this,e,r,0)??w)===M)return;let n=this._$AH,i=e===w&&n!==w||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,s=e!==w&&(n===w||i);i&&this.element.removeEventListener(this.name,this,n),s&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},Se=class{constructor(e,r,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=r,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){U(this,e)}},Bt={M:rt,P:I,A:nt,C:1,L:Wt,R:be,D:Ut,V:U,I:z,H:R,N:_e,U:$e,B:xe,F:Se},zr=Y.litHtmlPolyfillSupport;zr?.(ee,z),(Y.litHtmlVersions??(Y.litHtmlVersions=[])).push("3.3.1");var qt=(t,e,r)=>{let n=r?.renderBefore??e,i=n._$litPart$;if(i===void 0){let s=r?.renderBefore??null;n._$litPart$=i=new z(e.insertBefore(X(),s),s,void 0,r??{})}return i._$AI(t),i};var te=globalThis,l=class extends N{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var r;let e=super.createRenderRoot();return(r=this.renderOptions).renderBefore??(r.renderBefore=e.firstChild),e}update(e){let r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=qt(r,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return M}};l._$litElement$=!0,l.finalized=!0,te.litElementHydrateSupport?.({LitElement:l});var Wr=te.litElementPolyfillSupport;Wr?.({LitElement:l});(te.litElementVersions??(te.litElementVersions=[])).push("4.2.1");var Ft={};var Qt=["da","nb","sv","pt","es","zh","ko","ja","en","de"],qr=new Map(Qt.map((t,e)=>[t,e])),Kt={da:"Danish","da-dk":"Danish",nb:"Norwegian","nb-no":"Norwegian",sv:"Swedish","sv-se":"Swedish",de:"German","de-de":"German",en:"English","en-us":"English",pt:"Portuguese","pt-pt":"Portuguese","pt-br":"Portuguese (Brazil)",es:"Spanish","es-es":"Spanish","es-mx":"Spanish (Mexico)",zh:"Chinese","zh-hans":"Chinese (Simplified)","zh-hant":"Chinese (Traditional)",ja:"Japanese","ja-jp":"Japanese",ko:"Korean","ko-kr":"Korean"},Gt=new Map,Zt=!1;function Ce(){return typeof window<"u"&&window.DS_ONE_TRANSLATIONS?window.DS_ONE_TRANSLATIONS:Ft}var T=Ce(),ot=new Map,k="en";function re(t){return t?t.toLowerCase().split(/[-_]/)[0]??"":""}function Jt(t){let e=re(t),r=qr.get(e);return typeof r=="number"?r:Qt.length}function er(t){return[...t].sort((e,r)=>{let n=Jt(e),i=Jt(r);return n!==i?n-i:e.localeCompare(r)})}function Fr(t,e){let r=t?.replace("_","-");if(r)try{let n=Gt.get(r);n||(n=new Intl.DisplayNames([r],{type:"language"}),Gt.set(r,n));let i=e.replace("_","-"),s=n.of(i);if(s&&s!==i)return s;let a=n.of(re(i));if(a)return a}catch{Zt||(console.info("[DS one] Intl.DisplayNames is not available, using fallback language names."),Zt=!0)}}function Kr(t){let e=t.toLowerCase().replace("_","-"),r=Kt[e];if(r)return r;let n=re(e);return Kt[n]}function tr(t,e={}){if(!t)return"";let r=[];e.locale&&r.push(e.locale),typeof navigator<"u"&&(Array.isArray(navigator.languages)&&r.push(...navigator.languages),navigator.language&&r.push(navigator.language)),r.push(k),r.push("en");let n=new Set;for(let a of r){if(!a||n.has(a))continue;n.add(a);let g=Fr(a,t);if(g)return g}let i=Kr(t);if(i)return i;let s=re(t);return s?s.toUpperCase():t}var Yt={da:"da","da-dk":"da",no:"nb",nb:"nb","nb-no":"nb",nn:"nn","nn-no":"nn",sv:"sv","sv-se":"sv",pt:"pt","pt-pt":"pt","pt-br":"pt",es:"es","es-es":"es","es-mx":"es",zh:"zh","zh-cn":"zh","zh-hans":"zh","zh-tw":"zh","zh-hant":"zh",ko:"ko","ko-kr":"ko",ja:"ja","ja-jp":"ja",en:"en","en-us":"en","en-gb":"en",de:"de","de-de":"de"};function Xt(t){if(!t)return null;let e=t.toLowerCase().replace("_","-"),r=Yt[e];if(r)return r;let n=re(e),i=Yt[n];return i||t}function Gr(){if(typeof navigator>"u")return k;let t=navigator.language;if(t){let e=Xt(t);if(e)return e}if(Array.isArray(navigator.languages))for(let e of navigator.languages){let r=Xt(e);if(r)return r}return k}var Jn=typeof window<"u"?window.localStorage?.getItem("ds-one:language")??void 0:void 0,$={value:localStorage.getItem("language")||Gr(),set:function(t){this.value=t,localStorage.setItem("language",t),window.dispatchEvent(new CustomEvent("language-changed",{detail:{language:t},bubbles:!0,composed:!0}))}};typeof window<"u"&&window.addEventListener("translations-ready",()=>{T=Ce(),window.dispatchEvent(new CustomEvent("translations-loaded")),window.notionDataLoaded=!0;let t=$.value;window.dispatchEvent(new CustomEvent("language-changed",{detail:{language:t},bubbles:!0,composed:!0}))});setTimeout(()=>{window.dispatchEvent(new CustomEvent("translations-loaded")),window.notionDataLoaded=!0;let t=$.value;window.dispatchEvent(new CustomEvent("language-changed",{detail:{language:t},bubbles:!0,composed:!0}))},100);function E(t){let e=$.value;return T?.[e]?.[t]?T[e][t]:e!==k&&T?.[k]?.[t]?T[k][t]:(console.warn(`[translate] No translation found for key "${t}"`),t)}function Yn(t,e=$.value){if(!t)return!1;let r=T?.[e];return!!(r&&Object.prototype.hasOwnProperty.call(r,t)||e!==k&&T?.[k]&&Object.prototype.hasOwnProperty.call(T[k],t))}function x(t){return E(t)}async function rr(t,e=$.value){if(!t||!T||!T[e])return null;let r=T[e][t];return r||(e!==k&&T[k]?.[t]?T[k][t]:null)}function Xn(t,e,r=$.value){if(!t)return;Zr(r).set(t,e)}function Zr(t){return ot.has(t)||ot.set(t,new Map),ot.get(t)}function Qn(){let t=Ce();if(t&&Object.keys(t).length>0){let e=Object.keys(t);return Promise.resolve(er(e))}return Promise.resolve([k])}function at(){let t=Ce();return t&&Object.keys(t).length>0?er(Object.keys(t)):[k]}function ei(t,e){console.log(`Loading additional translations for ${t}:`,Object.keys(e).length,"keys")}function lt(t){localStorage.setItem("language",t),$.set(t),window.dispatchEvent(new CustomEvent("language-changed",{detail:{language:t},bubbles:!0,composed:!0}))}var ne=class extends l{constructor(){super(),this._handleLanguageChange=()=>{this._updateText()},this.variant="title",this.disabled=!1,this.bold=!1,this["no-background"]=!1,this.blank=!1,this.notionKey=null,this.key="",this.fallback="",this.language="en-US",this.defaultText="",this.href="",this._loading=!1,this._notionText=null}connectedCallback(){super.connectedCallback(),this._updateText(),window.addEventListener("language-changed",this._handleLanguageChange)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("language-changed",this._handleLanguageChange)}updated(e){super.updated(e),(e.has("key")||e.has("defaultText"))&&this._updateText()}_updateText(){this.key?this._notionText=x(this.key):this._notionText=this.defaultText||this.fallback||null,this.requestUpdate()}render(){return o`
|
|
1
|
+
function Ln(){if(typeof navigator>"u"||typeof window>"u")return!1;let t=navigator,e=window,n=t&&(t.userAgent||t.vendor)||e&&e.opera||"",r=/Mobile|Android|iP(ad|hone|od)|IEMobile|BlackBerry|Kindle|Silk-Accelerated|(hpw|web)OS|Opera M(obi|ini)|Windows Phone|Phone|Tablet/i.test(n),s=(t&&t.maxTouchPoints||0)>1,a=e?Math.min(e.innerWidth||0,e.innerHeight||0)<=820:!1;return r||s&&a}function Tn(){let t=Ln(),e=navigator,n=window,i=(e&&e.maxTouchPoints||0)>1,s=n?.innerWidth||0,a=n?.innerHeight||0,g=t&&Math.min(s,a)>=600;return{isMobile:t,isTablet:g,isDesktop:!t,isTouchCapable:i,deviceType:t?g?"tablet":"mobile":"desktop",userAgent:e&&(e.userAgent||e.vendor)||"",screenWidth:s,screenHeight:a}}function Ct(){let t=Tn();return t.isMobile?console.log(`[DS one] Mobile device detected - ${t.deviceType} (${t.screenWidth}x${t.screenHeight})`):console.log(`[DS one] Desktop device detected (${t.screenWidth}x${t.screenHeight})`),typeof window<"u"&&window.DS_ONE_DEBUG&&console.log("[DS one] Device Info:",{type:t.deviceType,isMobile:t.isMobile,isTablet:t.isTablet,isDesktop:t.isDesktop,isTouchCapable:t.isTouchCapable,viewport:`${t.screenWidth}x${t.screenHeight}`,userAgent:t.userAgent}),t}typeof window<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>{Ct()}):Ct());var kt=!1,Nn=["./keys.json","./tekst.json","./tekster.json","./language.json","./languages.json","./translations.json","./translate.json","./i18n.json","./locales.json","./strings.json","./text.json","./texts.json"];function In(t){if(!t)return null;let e=t.trim();return e?e.startsWith("./")||e.startsWith("../")||e.startsWith("/")||/^https?:\/\//i.test(e)?e:`./${e}`:null}function Mn(){if(typeof document>"u")return null;let e=document.querySelector("script[data-ds-one-translations]")?.getAttribute("data-ds-one-translations");if(e)return e;let n=document.querySelector('meta[name="ds-one:translations"]')?.getAttribute("content");if(n)return n;let r=document.querySelector('link[rel="ds-one-translations"]')?.getAttribute("href");return r||null}function Vn(){let t=new Set,e=typeof window<"u"?window.DS_ONE_TRANSLATIONS_FILE:null,n=Mn(),r=i=>{let s=In(i??"");s&&t.add(s)};return r(e??null),r(n),Nn.forEach(i=>r(i)),Array.from(t)}function Hn(t){return!t||typeof t!="object"?!1:Object.values(t).every(e=>e&&typeof e=="object")}async function Dn(t){try{console.log(`[DS one] Attempting to fetch translations from: ${t}`);let e=await fetch(t);if(!e.ok)return console.log(`[DS one] Failed to fetch ${t} (${e.status})`),null;let n=await e.json();if(console.log(`[DS one] Successfully fetched JSON from ${t}`),!Hn(n))return console.warn(`[DS one] Invalid translation format in ${t}. Expected object with language codes as keys.`),null;let r=Object.keys(n);return r.length===0?(console.warn(`[DS one] No languages found in ${t}`),null):(console.log(`[DS one] Valid translations found: ${r.join(", ")}`),n)}catch(e){return e instanceof TypeError&&e.message.includes("Failed to fetch")?(console.log(`[DS one] Network error fetching ${t}`),null):(console.error(`[DS one] Error loading external translations from ${t}:`,e),null)}}async function Et(){if(kt||(kt=!0,typeof window>"u"))return!1;if(window.DS_ONE_TRANSLATIONS&&Object.keys(window.DS_ONE_TRANSLATIONS).length>0)return console.log(`[DS one] Translations already loaded (${Object.keys(window.DS_ONE_TRANSLATIONS).length} languages), skipping auto-load`),!0;let t=Vn();for(let e of t){let n=await Dn(e);if(!n)continue;window.DS_ONE_TRANSLATIONS=n;let r=Object.keys(n);return console.log(`[DS one] External translations loaded from ${e}: ${r.length} language(s) \u2013 ${r.join(", ")}`),window.dispatchEvent(new CustomEvent("translations-ready")),!0}return console.info(`[DS one] No external translations found. Looked in: ${t.join(", ")}. Using bundled translations.`),!1}typeof window<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>{Et()}):Et());var ve=globalThis,ye=ve.ShadowRoot&&(ve.ShadyCSS===void 0||ve.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Xe=Symbol(),At=new WeakMap,G=class{constructor(e,n,r){if(this._$cssResult$=!0,r!==Xe)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=n}get styleSheet(){let e=this.o,n=this.t;if(ye&&e===void 0){let r=n!==void 0&&n.length===1;r&&(e=At.get(n)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&At.set(n,e))}return e}toString(){return this.cssText}},Lt=t=>new G(typeof t=="string"?t:t+"",void 0,Xe),c=(t,...e)=>{let n=t.length===1?t[0]:e.reduce(((r,i,s)=>r+(a=>{if(a._$cssResult$===!0)return a.cssText;if(typeof a=="number")return a;throw Error("Value passed to 'css' function must be a 'css' function result: "+a+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[s+1]),t[0]);return new G(n,t,Xe)},Tt=(t,e)=>{if(ye)t.adoptedStyleSheets=e.map((n=>n instanceof CSSStyleSheet?n:n.styleSheet));else for(let n of e){let r=document.createElement("style"),i=ve.litNonce;i!==void 0&&r.setAttribute("nonce",i),r.textContent=n.cssText,t.appendChild(r)}},Qe=ye?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let n="";for(let r of e.cssRules)n+=r.cssText;return Lt(n)})(t):t;var{is:On,defineProperty:Pn,getOwnPropertyDescriptor:Un,getOwnPropertyNames:Rn,getOwnPropertySymbols:jn,getPrototypeOf:Wn}=Object,V=globalThis,Nt=V.trustedTypes,zn=Nt?Nt.emptyScript:"",Bn=V.reactiveElementPolyfillSupport,Z=(t,e)=>t,et={toAttribute(t,e){switch(e){case Boolean:t=t?zn:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let n=t;switch(e){case Boolean:n=t!==null;break;case Number:n=t===null?null:Number(t);break;case Object:case Array:try{n=JSON.parse(t)}catch{n=null}}return n}},Mt=(t,e)=>!On(t,e),It={attribute:!0,type:String,converter:et,reflect:!1,useDefault:!1,hasChanged:Mt};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),V.litPropertyMetadata??(V.litPropertyMetadata=new WeakMap);var N=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,n=It){if(n.state&&(n.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((n=Object.create(n)).wrapped=!0),this.elementProperties.set(e,n),!n.noAccessor){let r=Symbol(),i=this.getPropertyDescriptor(e,r,n);i!==void 0&&Pn(this.prototype,e,i)}}static getPropertyDescriptor(e,n,r){let{get:i,set:s}=Un(this.prototype,e)??{get(){return this[n]},set(a){this[n]=a}};return{get:i,set(a){let g=i?.call(this);s?.call(this,a),this.requestUpdate(e,g,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??It}static _$Ei(){if(this.hasOwnProperty(Z("elementProperties")))return;let e=Wn(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Z("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Z("properties"))){let n=this.properties,r=[...Rn(n),...jn(n)];for(let i of r)this.createProperty(i,n[i])}let e=this[Symbol.metadata];if(e!==null){let n=litPropertyMetadata.get(e);if(n!==void 0)for(let[r,i]of n)this.elementProperties.set(r,i)}this._$Eh=new Map;for(let[n,r]of this.elementProperties){let i=this._$Eu(n,r);i!==void 0&&this._$Eh.set(i,n)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let n=[];if(Array.isArray(e)){let r=new Set(e.flat(1/0).reverse());for(let i of r)n.unshift(Qe(i))}else e!==void 0&&n.push(Qe(e));return n}static _$Eu(e,n){let r=n.attribute;return r===!1?void 0:typeof r=="string"?r:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((e=>e(this)))}addController(e){(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,n=this.constructor.elementProperties;for(let r of n.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Tt(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),this._$EO?.forEach((e=>e.hostConnected?.()))}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach((e=>e.hostDisconnected?.()))}attributeChangedCallback(e,n,r){this._$AK(e,r)}_$ET(e,n){let r=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,r);if(i!==void 0&&r.reflect===!0){let s=(r.converter?.toAttribute!==void 0?r.converter:et).toAttribute(n,r.type);this._$Em=e,s==null?this.removeAttribute(i):this.setAttribute(i,s),this._$Em=null}}_$AK(e,n){let r=this.constructor,i=r._$Eh.get(e);if(i!==void 0&&this._$Em!==i){let s=r.getPropertyOptions(i),a=typeof s.converter=="function"?{fromAttribute:s.converter}:s.converter?.fromAttribute!==void 0?s.converter:et;this._$Em=i;let g=a.fromAttribute(n,s.type);this[i]=g??this._$Ej?.get(i)??g,this._$Em=null}}requestUpdate(e,n,r){if(e!==void 0){let i=this.constructor,s=this[e];if(r??(r=i.getPropertyOptions(e)),!((r.hasChanged??Mt)(s,n)||r.useDefault&&r.reflect&&s===this._$Ej?.get(e)&&!this.hasAttribute(i._$Eu(e,r))))return;this.C(e,n,r)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,n,{useDefault:r,reflect:i,wrapped:s},a){r&&!(this._$Ej??(this._$Ej=new Map)).has(e)&&(this._$Ej.set(e,a??n??this[e]),s!==!0||a!==void 0)||(this._$AL.has(e)||(this.hasUpdated||r||(n=void 0),this._$AL.set(e,n)),i===!0&&this._$Em!==e&&(this._$Eq??(this._$Eq=new Set)).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(n){Promise.reject(n)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(let[i,s]of this._$Ep)this[i]=s;this._$Ep=void 0}let r=this.constructor.elementProperties;if(r.size>0)for(let[i,s]of r){let{wrapped:a}=s,g=this[i];a!==!0||this._$AL.has(i)||g===void 0||this.C(i,void 0,s,g)}}let e=!1,n=this._$AL;try{e=this.shouldUpdate(n),e?(this.willUpdate(n),this._$EO?.forEach((r=>r.hostUpdate?.())),this.update(n)):this._$EM()}catch(r){throw e=!1,this._$EM(),r}e&&this._$AE(n)}willUpdate(e){}_$AE(e){this._$EO?.forEach((n=>n.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&(this._$Eq=this._$Eq.forEach((n=>this._$ET(n,this[n])))),this._$EM()}updated(e){}firstUpdated(e){}};N.elementStyles=[],N.shadowRootOptions={mode:"open"},N[Z("elementProperties")]=new Map,N[Z("finalized")]=new Map,Bn?.({ReactiveElement:N}),(V.reactiveElementVersions??(V.reactiveElementVersions=[])).push("2.1.1");var Y=globalThis,we=Y.trustedTypes,Vt=we?we.createPolicy("lit-html",{createHTML:t=>t}):void 0,nt="$lit$",I=`lit$${Math.random().toFixed(9).slice(2)}$`,rt="?"+I,qn=`<${rt}>`,P=document,X=()=>P.createComment(""),Q=t=>t===null||typeof t!="object"&&typeof t!="function",it=Array.isArray,Rt=t=>it(t)||typeof t?.[Symbol.iterator]=="function",tt=`[
|
|
2
|
+
\f\r]`,J=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ht=/-->/g,Dt=/>/g,D=RegExp(`>|${tt}(?:([^\\s"'>=/]+)(${tt}*=${tt}*(?:[^
|
|
3
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),Ot=/'/g,Pt=/"/g,jt=/^(?:script|style|textarea|title)$/i,st=t=>(e,...n)=>({_$litType$:t,strings:e,values:n}),o=st(1),Wt=st(2),Ur=st(3),M=Symbol.for("lit-noChange"),w=Symbol.for("lit-nothing"),Ut=new WeakMap,O=P.createTreeWalker(P,129);function zt(t,e){if(!it(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return Vt!==void 0?Vt.createHTML(e):e}var Bt=(t,e)=>{let n=t.length-1,r=[],i,s=e===2?"<svg>":e===3?"<math>":"",a=J;for(let g=0;g<n;g++){let u=t[g],p,v,d=-1,A=0;for(;A<u.length&&(a.lastIndex=A,v=a.exec(u),v!==null);)A=a.lastIndex,a===J?v[1]==="!--"?a=Ht:v[1]!==void 0?a=Dt:v[2]!==void 0?(jt.test(v[2])&&(i=RegExp("</"+v[2],"g")),a=D):v[3]!==void 0&&(a=D):a===D?v[0]===">"?(a=i??J,d=-1):v[1]===void 0?d=-2:(d=a.lastIndex-v[2].length,p=v[1],a=v[3]===void 0?D:v[3]==='"'?Pt:Ot):a===Pt||a===Ot?a=D:a===Ht||a===Dt?a=J:(a=D,i=void 0);let f=a===D&&t[g+1].startsWith("/>")?" ":"";s+=a===J?u+qn:d>=0?(r.push(p),u.slice(0,d)+nt+u.slice(d)+I+f):u+I+(d===-2?g:f)}return[zt(t,s+(t[n]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),r]},ee=class t{constructor({strings:e,_$litType$:n},r){let i;this.parts=[];let s=0,a=0,g=e.length-1,u=this.parts,[p,v]=Bt(e,n);if(this.el=t.createElement(p,r),O.currentNode=this.el.content,n===2||n===3){let d=this.el.content.firstChild;d.replaceWith(...d.childNodes)}for(;(i=O.nextNode())!==null&&u.length<g;){if(i.nodeType===1){if(i.hasAttributes())for(let d of i.getAttributeNames())if(d.endsWith(nt)){let A=v[a++],f=i.getAttribute(d).split(I),C=/([.?@])?(.*)/.exec(A);u.push({type:1,index:s,name:C[2],strings:f,ctor:C[1]==="."?xe:C[1]==="?"?_e:C[1]==="@"?$e:R}),i.removeAttribute(d)}else d.startsWith(I)&&(u.push({type:6,index:s}),i.removeAttribute(d));if(jt.test(i.tagName)){let d=i.textContent.split(I),A=d.length-1;if(A>0){i.textContent=we?we.emptyScript:"";for(let f=0;f<A;f++)i.append(d[f],X()),O.nextNode(),u.push({type:2,index:++s});i.append(d[A],X())}}}else if(i.nodeType===8)if(i.data===rt)u.push({type:2,index:s});else{let d=-1;for(;(d=i.data.indexOf(I,d+1))!==-1;)u.push({type:7,index:s}),d+=I.length-1}s++}}static createElement(e,n){let r=P.createElement("template");return r.innerHTML=e,r}};function U(t,e,n=t,r){if(e===M)return e;let i=r!==void 0?n._$Co?.[r]:n._$Cl,s=Q(e)?void 0:e._$litDirective$;return i?.constructor!==s&&(i?._$AO?.(!1),s===void 0?i=void 0:(i=new s(t),i._$AT(t,n,r)),r!==void 0?(n._$Co??(n._$Co=[]))[r]=i:n._$Cl=i),i!==void 0&&(e=U(t,i._$AS(t,e.values),i,r)),e}var be=class{constructor(e,n){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=n}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:n},parts:r}=this._$AD,i=(e?.creationScope??P).importNode(n,!0);O.currentNode=i;let s=O.nextNode(),a=0,g=0,u=r[0];for(;u!==void 0;){if(a===u.index){let p;u.type===2?p=new W(s,s.nextSibling,this,e):u.type===1?p=new u.ctor(s,u.name,u.strings,this,e):u.type===6&&(p=new Se(s,this,e)),this._$AV.push(p),u=r[++g]}a!==u?.index&&(s=O.nextNode(),a++)}return O.currentNode=P,i}p(e){let n=0;for(let r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(e,r,n),n+=r.strings.length-2):r._$AI(e[n])),n++}},W=class t{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,n,r,i){this.type=2,this._$AH=w,this._$AN=void 0,this._$AA=e,this._$AB=n,this._$AM=r,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,n=this._$AM;return n!==void 0&&e?.nodeType===11&&(e=n.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,n=this){e=U(this,e,n),Q(e)?e===w||e==null||e===""?(this._$AH!==w&&this._$AR(),this._$AH=w):e!==this._$AH&&e!==M&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Rt(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==w&&Q(this._$AH)?this._$AA.nextSibling.data=e:this.T(P.createTextNode(e)),this._$AH=e}$(e){let{values:n,_$litType$:r}=e,i=typeof r=="number"?this._$AC(e):(r.el===void 0&&(r.el=ee.createElement(zt(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===i)this._$AH.p(n);else{let s=new be(i,this),a=s.u(this.options);s.p(n),this.T(a),this._$AH=s}}_$AC(e){let n=Ut.get(e.strings);return n===void 0&&Ut.set(e.strings,n=new ee(e)),n}k(e){it(this._$AH)||(this._$AH=[],this._$AR());let n=this._$AH,r,i=0;for(let s of e)i===n.length?n.push(r=new t(this.O(X()),this.O(X()),this,this.options)):r=n[i],r._$AI(s),i++;i<n.length&&(this._$AR(r&&r._$AB.nextSibling,i),n.length=i)}_$AR(e=this._$AA.nextSibling,n){for(this._$AP?.(!1,!0,n);e!==this._$AB;){let r=e.nextSibling;e.remove(),e=r}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},R=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,n,r,i,s){this.type=1,this._$AH=w,this._$AN=void 0,this.element=e,this.name=n,this._$AM=i,this.options=s,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=w}_$AI(e,n=this,r,i){let s=this.strings,a=!1;if(s===void 0)e=U(this,e,n,0),a=!Q(e)||e!==this._$AH&&e!==M,a&&(this._$AH=e);else{let g=e,u,p;for(e=s[0],u=0;u<s.length-1;u++)p=U(this,g[r+u],n,u),p===M&&(p=this._$AH[u]),a||(a=!Q(p)||p!==this._$AH[u]),p===w?e=w:e!==w&&(e+=(p??"")+s[u+1]),this._$AH[u]=p}a&&!i&&this.j(e)}j(e){e===w?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},xe=class extends R{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===w?void 0:e}},_e=class extends R{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==w)}},$e=class extends R{constructor(e,n,r,i,s){super(e,n,r,i,s),this.type=5}_$AI(e,n=this){if((e=U(this,e,n,0)??w)===M)return;let r=this._$AH,i=e===w&&r!==w||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,s=e!==w&&(r===w||i);i&&this.element.removeEventListener(this.name,this,r),s&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},Se=class{constructor(e,n,r){this.element=e,this.type=6,this._$AN=void 0,this._$AM=n,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(e){U(this,e)}},qt={M:nt,P:I,A:rt,C:1,L:Bt,R:be,D:Rt,V:U,I:W,H:R,N:_e,U:$e,B:xe,F:Se},Fn=Y.litHtmlPolyfillSupport;Fn?.(ee,W),(Y.litHtmlVersions??(Y.litHtmlVersions=[])).push("3.3.1");var Ft=(t,e,n)=>{let r=n?.renderBefore??e,i=r._$litPart$;if(i===void 0){let s=n?.renderBefore??null;r._$litPart$=i=new W(e.insertBefore(X(),s),s,void 0,n??{})}return i._$AI(t),i};var te=globalThis,l=class extends N{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var n;let e=super.createRenderRoot();return(n=this.renderOptions).renderBefore??(n.renderBefore=e.firstChild),e}update(e){let n=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Ft(n,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return M}};l._$litElement$=!0,l.finalized=!0,te.litElementHydrateSupport?.({LitElement:l});var Kn=te.litElementPolyfillSupport;Kn?.({LitElement:l});(te.litElementVersions??(te.litElementVersions=[])).push("4.2.1");var Kt={en:{language:"Language",theme:"Theme",home:"Home",about:"About",contact:"Contact",welcome:"Welcome",description:"Description",learnMore:"Learn More",copyright:"\xA9 2025",siteTitle:"Site Title",downloadCV:"Download CV"},da:{language:"Sprog",theme:"Tema",home:"Hjem",about:"Om",contact:"Kontakt",welcome:"Velkommen",description:"Beskrivelse",learnMore:"L\xE6r Mere",copyright:"\xA9 2025",siteTitle:"Site Titel",downloadCV:"Download CV"},ja:{language:"\u8A00\u8A9E",theme:"\u30C6\u30FC\u30DE",home:"\u30DB\u30FC\u30E0",about:"\u306B\u3064\u3044\u3066",contact:"\u304A\u554F\u3044\u5408\u308F\u305B",welcome:"\u3088\u3046\u3053\u305D",description:"\u8AAC\u660E",learnMore:"\u8A73\u7D30\u3092\u898B\u308B",copyright:"\xA9 2025",siteTitle:"\u30B5\u30A4\u30C8\u30BF\u30A4\u30C8\u30EB",downloadCV:"CV\u3092\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9"}};var en=["da","nb","sv","pt","es","zh","ko","ja","en","de"],Zn=new Map(en.map((t,e)=>[t,e])),Gt={da:"Danish","da-dk":"Danish",nb:"Norwegian","nb-no":"Norwegian",sv:"Swedish","sv-se":"Swedish",de:"German","de-de":"German",en:"English","en-us":"English",pt:"Portuguese","pt-pt":"Portuguese","pt-br":"Portuguese (Brazil)",es:"Spanish","es-es":"Spanish","es-mx":"Spanish (Mexico)",zh:"Chinese","zh-hans":"Chinese (Simplified)","zh-hant":"Chinese (Traditional)",ja:"Japanese","ja-jp":"Japanese",ko:"Korean","ko-kr":"Korean"},Zt=new Map,Jt=!1;function Ce(){return typeof window<"u"&&window.DS_ONE_TRANSLATIONS?window.DS_ONE_TRANSLATIONS:Kt}var T=Ce(),ot=new Map,k="en";function ne(t){return t?t.toLowerCase().split(/[-_]/)[0]??"":""}function Yt(t){let e=ne(t),n=Zn.get(e);return typeof n=="number"?n:en.length}function tn(t){return[...t].sort((e,n)=>{let r=Yt(e),i=Yt(n);return r!==i?r-i:e.localeCompare(n)})}function Jn(t,e){let n=t?.replace("_","-");if(n)try{let r=Zt.get(n);r||(r=new Intl.DisplayNames([n],{type:"language"}),Zt.set(n,r));let i=e.replace("_","-"),s=r.of(i);if(s&&s!==i)return s;let a=r.of(ne(i));if(a)return a}catch{Jt||(console.info("[DS one] Intl.DisplayNames is not available, using fallback language names."),Jt=!0)}}function Yn(t){let e=t.toLowerCase().replace("_","-"),n=Gt[e];if(n)return n;let r=ne(e);return Gt[r]}function nn(t,e={}){if(!t)return"";let n=[];e.locale&&n.push(e.locale),typeof navigator<"u"&&(Array.isArray(navigator.languages)&&n.push(...navigator.languages),navigator.language&&n.push(navigator.language)),n.push(k),n.push("en");let r=new Set;for(let a of n){if(!a||r.has(a))continue;r.add(a);let g=Jn(a,t);if(g)return g}let i=Yn(t);if(i)return i;let s=ne(t);return s?s.toUpperCase():t}var Xt={da:"da","da-dk":"da",no:"nb",nb:"nb","nb-no":"nb",nn:"nn","nn-no":"nn",sv:"sv","sv-se":"sv",pt:"pt","pt-pt":"pt","pt-br":"pt",es:"es","es-es":"es","es-mx":"es",zh:"zh","zh-cn":"zh","zh-hans":"zh","zh-tw":"zh","zh-hant":"zh",ko:"ko","ko-kr":"ko",ja:"ja","ja-jp":"ja",en:"en","en-us":"en","en-gb":"en",de:"de","de-de":"de"};function Qt(t){if(!t)return null;let e=t.toLowerCase().replace("_","-"),n=Xt[e];if(n)return n;let r=ne(e),i=Xt[r];return i||t}function Xn(){if(typeof navigator>"u")return k;let t=navigator.language;if(t){let e=Qt(t);if(e)return e}if(Array.isArray(navigator.languages))for(let e of navigator.languages){let n=Qt(e);if(n)return n}return k}var ei=typeof window<"u"?window.localStorage?.getItem("ds-one:language")??void 0:void 0,$={value:localStorage.getItem("language")||Xn(),set:function(t){this.value=t,localStorage.setItem("language",t),window.dispatchEvent(new CustomEvent("language-changed",{detail:{language:t},bubbles:!0,composed:!0}))}};typeof window<"u"&&window.addEventListener("translations-ready",()=>{T=Ce(),window.dispatchEvent(new CustomEvent("translations-loaded")),window.notionDataLoaded=!0;let t=$.value;window.dispatchEvent(new CustomEvent("language-changed",{detail:{language:t},bubbles:!0,composed:!0}))});setTimeout(()=>{window.dispatchEvent(new CustomEvent("translations-loaded")),window.notionDataLoaded=!0;let t=$.value;window.dispatchEvent(new CustomEvent("language-changed",{detail:{language:t},bubbles:!0,composed:!0}))},100);function E(t){let e=$.value;return T?.[e]?.[t]?T[e][t]:e!==k&&T?.[k]?.[t]?T[k][t]:(console.warn(`[translate] No translation found for key "${t}"`),t)}function ti(t,e=$.value){if(!t)return!1;let n=T?.[e];return!!(n&&Object.prototype.hasOwnProperty.call(n,t)||e!==k&&T?.[k]&&Object.prototype.hasOwnProperty.call(T[k],t))}function x(t){return E(t)}async function rn(t,e=$.value){if(!t||!T||!T[e])return null;let n=T[e][t];return n||(e!==k&&T[k]?.[t]?T[k][t]:null)}function ni(t,e,n=$.value){if(!t)return;Qn(n).set(t,e)}function Qn(t){return ot.has(t)||ot.set(t,new Map),ot.get(t)}function ri(){let t=Ce();if(t&&Object.keys(t).length>0){let e=Object.keys(t);return Promise.resolve(tn(e))}return Promise.resolve([k])}function at(){let t=Ce();return t&&Object.keys(t).length>0?tn(Object.keys(t)):[k]}function ii(t,e){console.log(`Loading additional translations for ${t}:`,Object.keys(e).length,"keys")}function lt(t){localStorage.setItem("language",t),$.set(t),window.dispatchEvent(new CustomEvent("language-changed",{detail:{language:t},bubbles:!0,composed:!0}))}var re=class extends l{constructor(){super(),this._handleLanguageChange=()=>{this._updateText()},this.variant="title",this.disabled=!1,this.bold=!1,this["no-background"]=!1,this.blank=!1,this.notionKey=null,this.key="",this.fallback="",this.language="en-US",this.defaultText="",this.href="",this._loading=!1,this._notionText=null}connectedCallback(){super.connectedCallback(),this._updateText(),window.addEventListener("language-changed",this._handleLanguageChange)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("language-changed",this._handleLanguageChange)}updated(e){super.updated(e),(e.has("key")||e.has("defaultText"))&&this._updateText()}_updateText(){this.key?this._notionText=x(this.key):this._notionText=this.defaultText||this.fallback||null,this.requestUpdate()}render(){return o`
|
|
4
4
|
<button
|
|
5
5
|
class=${this.variant}
|
|
6
6
|
?disabled=${this.disabled}
|
|
@@ -10,7 +10,7 @@ var Ct=!1,Er=["./keys.json","./tekst.json","./tekster.json","./language.json",".
|
|
|
10
10
|
>
|
|
11
11
|
${this._notionText?this._notionText:o`<slot></slot>`}
|
|
12
12
|
</button>
|
|
13
|
-
`}_handleClick(e){if(this.disabled){e.preventDefault(),e.stopPropagation();return}if(this.href){e.preventDefault(),e.stopPropagation(),this.blank?window.open(this.href,"_blank","noopener,noreferrer"):window.location.href=this.href;return}}};
|
|
13
|
+
`}_handleClick(e){if(this.disabled){e.preventDefault(),e.stopPropagation();return}if(this.href){e.preventDefault(),e.stopPropagation(),this.blank?window.open(this.href,"_blank","noopener,noreferrer"):window.location.href=this.href;return}}};re.properties={variant:{type:String,reflect:!0},disabled:{type:Boolean,reflect:!0},bold:{type:Boolean,reflect:!0},"no-background":{type:Boolean,reflect:!0,attribute:"no-background"},blank:{type:Boolean,reflect:!0},notionKey:{type:String,attribute:"notion-key"},key:{type:String},fallback:{type:String},language:{type:String},defaultText:{type:String,attribute:"default-text"},href:{type:String},_loading:{type:Boolean,state:!0},_notionText:{type:String,state:!0}};re.styles=c`
|
|
14
14
|
button {
|
|
15
15
|
max-height: calc(var(--08) * var(--scaling-factor));
|
|
16
16
|
border: none;
|
|
@@ -60,7 +60,7 @@ var Ct=!1,Er=["./keys.json","./tekst.json","./tekster.json","./language.json",".
|
|
|
60
60
|
.loading {
|
|
61
61
|
opacity: 0.7;
|
|
62
62
|
}
|
|
63
|
-
`;customElements.define("ds-button",
|
|
63
|
+
`;customElements.define("ds-button",re);var ke=class extends l{static get properties(){return{key:{type:String,reflect:!0},defaultValue:{type:String,reflect:!0,attribute:"default-value"},fallback:{type:String,reflect:!0},_text:{type:String,state:!0}}}constructor(){super(),this.key="",this.defaultValue="",this.fallback="",this._text="",this.boundHandlers={languageChanged:(()=>{console.log("Language changed event received in ds-text"),this._loadText()})}}connectedCallback(){super.connectedCallback(),this._loadText(),window.addEventListener("language-changed",this.boundHandlers.languageChanged),window.addEventListener("translations-loaded",this.boundHandlers.languageChanged)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("language-changed",this.boundHandlers.languageChanged),window.removeEventListener("translations-loaded",this.boundHandlers.languageChanged)}updated(e){super.updated(e),(e.has("key")||e.has("defaultValue"))&&this._loadText()}_loadText(){if(!this.key){this._text=this.defaultValue||this.fallback||"";return}try{let e=x(this.key);this._text=e||this.defaultValue||this.fallback||this.key}catch(e){console.error("Error loading text for key:",this.key,e),this._text=this.defaultValue||this.fallback||this.key}this.requestUpdate()}render(){return o`<span>${this._text||this.defaultValue||this.key}</span>`}};ke.styles=c`
|
|
64
64
|
:host {
|
|
65
65
|
display: inline;
|
|
66
66
|
}
|
|
@@ -68,7 +68,7 @@ var Ct=!1,Er=["./keys.json","./tekst.json","./tekster.json","./language.json",".
|
|
|
68
68
|
.loading {
|
|
69
69
|
opacity: 0.6;
|
|
70
70
|
}
|
|
71
|
-
`;customElements.define("ds-text",ke);var Ee={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},ie=t=>(...e)=>({_$litDirective$:t,values:e}),
|
|
71
|
+
`;customElements.define("ds-text",ke);var Ee={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},ie=t=>(...e)=>({_$litDirective$:t,values:e}),z=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,n,r){this._$Ct=e,this._$AM=n,this._$Ci=r}_$AS(e,n){return this.update(e,n)}update(e,n){return this.render(...n)}};var se=class extends z{constructor(e){if(super(e),this.it=w,e.type!==Ee.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===w||e==null)return this._t=void 0,this.it=e;if(e===M)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;let n=[e];return n.raw=n,this._t={_$litType$:this.constructor.resultType,strings:n,values:[]}}};se.directiveName="unsafeHTML",se.resultType=1;var sn=ie(se);var B=class t extends l{get type(){return this._type}set type(e){let n=this._type;this._type=e,this.requestUpdate("type",n)}constructor(){super(),this._type="",this.size="1em",this.color="currentColor",this.background="transparent",console.log("Icon constructor",this._type)}connectedCallback(){super.connectedCallback(),console.log("Icon connected",this._type)}renderIcon(){if(console.log("renderIcon called with type:",this._type),!this._type||this._type==="")return console.log("No type specified, rendering default slot"),o`<div class="icon-container"><slot></slot></div>`;let e=t.iconNameToSvgMap[this._type.toLowerCase()];if(e)return o`<div class="icon-container">${sn(e)}</div>`;switch(this._type.toLowerCase()){case"close":return console.log("Rendering close icon"),o`
|
|
72
72
|
<div class="icon-container">
|
|
73
73
|
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
|
74
74
|
<path
|
|
@@ -261,7 +261,7 @@ var Ct=!1,Er=["./keys.json","./tekst.json","./tekster.json","./language.json",".
|
|
|
261
261
|
:host {
|
|
262
262
|
--notes-style-color: #ffb6b9;
|
|
263
263
|
}
|
|
264
|
-
`;B.iconNameToSvgMap=(()=>{try{let t=import.meta.glob("../x Icon/*.svg",{as:"raw",eager:!0}),e={};for(let[r
|
|
264
|
+
`;B.iconNameToSvgMap=(()=>{try{let t=import.meta.glob("../x Icon/*.svg",{as:"raw",eager:!0}),e={};for(let[n,r]of Object.entries(t)){let s=(n.split("/").pop()??"").replace(/\.svg$/i,"").toLowerCase();s&&(e[s]=r)}return e}catch(t){return console.warn("Icon: failed to glob SVGs from x Icon/; falling back only to inline switch icons.",t),{}}})();customElements.define("icon-v1",B);console.log("Icon component registered with custom elements registry");var Ae=class extends l{static get properties(){return{href:{type:String,reflect:!0},_text:{type:String,state:!0}}}constructor(){super(),this.href="",this._text="",this.boundHandlers={languageChanged:(()=>{this._loadText()})}}connectedCallback(){super.connectedCallback(),this._loadText(),window.addEventListener("language-changed",this.boundHandlers.languageChanged),window.addEventListener("translations-loaded",this.boundHandlers.languageChanged)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("language-changed",this.boundHandlers.languageChanged),window.removeEventListener("translations-loaded",this.boundHandlers.languageChanged)}updated(e){super.updated(e),e.has("href")&&this._loadText()}_loadText(){try{let e=x("link");this._text=e||"Link"}catch(e){console.error("Error loading text for key 'link':",e),this._text="Link"}this.requestUpdate()}render(){return this.href?o`
|
|
265
265
|
<a href="${this.href}" target="_blank" rel="noopener noreferrer">
|
|
266
266
|
${this._text}
|
|
267
267
|
<icon-v1 type="open"></icon-v1>
|
|
@@ -281,7 +281,7 @@ var Ct=!1,Er=["./keys.json","./tekst.json","./tekster.json","./language.json",".
|
|
|
281
281
|
display: inline-block;
|
|
282
282
|
vertical-align: middle;
|
|
283
283
|
}
|
|
284
|
-
`;customElements.define("link-v1",Ae);var Jr=Object.defineProperty,Yr=(t,e,r)=>e in t?Jr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ct=(t,e,r)=>(Yr(t,typeof e!="symbol"?e+"":e,r),r),Xr=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)},dt=(t,e)=>{if(Object(e)!==e)throw TypeError('Cannot use the "in" operator on this value');return t.has(e)},Le=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},ir=(t,e,r)=>(Xr(t,e,"access private method"),r);function sr(t,e){return Object.is(t,e)}var b=null,oe=!1,Te=1,Ne=Symbol("SIGNAL");function q(t){let e=b;return b=t,e}function Qr(){return b}function en(){return oe}var ft={version:0,lastCleanEpoch:0,dirty:!1,producerNode:void 0,producerLastReadVersion:void 0,producerIndexOfThis:void 0,nextProducerIndex:0,liveConsumerNode:void 0,liveConsumerIndexOfThis:void 0,consumerAllowSignalWrites:!1,consumerIsAlwaysLive:!1,producerMustRecompute:()=>!1,producerRecomputeValue:()=>{},consumerMarkedDirty:()=>{},consumerOnSignalRead:()=>{}};function Ie(t){if(oe)throw new Error(typeof ngDevMode<"u"&&ngDevMode?"Assertion error: signal read during notification phase":"");if(b===null)return;b.consumerOnSignalRead(t);let e=b.nextProducerIndex++;if(F(b),e<b.producerNode.length&&b.producerNode[e]!==t&&pt(b)){let r=b.producerNode[e];Me(r,b.producerIndexOfThis[e])}b.producerNode[e]!==t&&(b.producerNode[e]=t,b.producerIndexOfThis[e]=pt(b)?lr(t,b,e):0),b.producerLastReadVersion[e]=t.version}function tn(){Te++}function or(t){if(!(!t.dirty&&t.lastCleanEpoch===Te)){if(!t.producerMustRecompute(t)&&!an(t)){t.dirty=!1,t.lastCleanEpoch=Te;return}t.producerRecomputeValue(t),t.dirty=!1,t.lastCleanEpoch=Te}}function ar(t){if(t.liveConsumerNode===void 0)return;let e=oe;oe=!0;try{for(let r of t.liveConsumerNode)r.dirty||nn(r)}finally{oe=e}}function rn(){return b?.consumerAllowSignalWrites!==!1}function nn(t){var e;t.dirty=!0,ar(t),(e=t.consumerMarkedDirty)==null||e.call(t.wrapper??t)}function sn(t){return t&&(t.nextProducerIndex=0),q(t)}function on(t,e){if(q(e),!(!t||t.producerNode===void 0||t.producerIndexOfThis===void 0||t.producerLastReadVersion===void 0)){if(pt(t))for(let r=t.nextProducerIndex;r<t.producerNode.length;r++)Me(t.producerNode[r],t.producerIndexOfThis[r]);for(;t.producerNode.length>t.nextProducerIndex;)t.producerNode.pop(),t.producerLastReadVersion.pop(),t.producerIndexOfThis.pop()}}function an(t){F(t);for(let e=0;e<t.producerNode.length;e++){let r=t.producerNode[e],n=t.producerLastReadVersion[e];if(n!==r.version||(or(r),n!==r.version))return!0}return!1}function lr(t,e,r){var n;if(mt(t),F(t),t.liveConsumerNode.length===0){(n=t.watched)==null||n.call(t.wrapper);for(let i=0;i<t.producerNode.length;i++)t.producerIndexOfThis[i]=lr(t.producerNode[i],t,i)}return t.liveConsumerIndexOfThis.push(r),t.liveConsumerNode.push(e)-1}function Me(t,e){var r;if(mt(t),F(t),typeof ngDevMode<"u"&&ngDevMode&&e>=t.liveConsumerNode.length)throw new Error(`Assertion error: active consumer index ${e} is out of bounds of ${t.liveConsumerNode.length} consumers)`);if(t.liveConsumerNode.length===1){(r=t.unwatched)==null||r.call(t.wrapper);for(let i=0;i<t.producerNode.length;i++)Me(t.producerNode[i],t.producerIndexOfThis[i])}let n=t.liveConsumerNode.length-1;if(t.liveConsumerNode[e]=t.liveConsumerNode[n],t.liveConsumerIndexOfThis[e]=t.liveConsumerIndexOfThis[n],t.liveConsumerNode.length--,t.liveConsumerIndexOfThis.length--,e<t.liveConsumerNode.length){let i=t.liveConsumerIndexOfThis[e],s=t.liveConsumerNode[e];F(s),s.producerIndexOfThis[i]=e}}function pt(t){var e;return t.consumerIsAlwaysLive||(((e=t?.liveConsumerNode)==null?void 0:e.length)??0)>0}function F(t){t.producerNode??(t.producerNode=[]),t.producerIndexOfThis??(t.producerIndexOfThis=[]),t.producerLastReadVersion??(t.producerLastReadVersion=[])}function mt(t){t.liveConsumerNode??(t.liveConsumerNode=[]),t.liveConsumerIndexOfThis??(t.liveConsumerIndexOfThis=[])}function cr(t){if(or(t),Ie(t),t.value===gt)throw t.error;return t.value}function ln(t){let e=Object.create(cn);e.computation=t;let r=()=>cr(e);return r[Ne]=e,r}var ht=Symbol("UNSET"),ut=Symbol("COMPUTING"),gt=Symbol("ERRORED"),cn={...ft,value:ht,dirty:!0,error:null,equal:sr,producerMustRecompute(t){return t.value===ht||t.value===ut},producerRecomputeValue(t){if(t.value===ut)throw new Error("Detected cycle in computations.");let e=t.value;t.value=ut;let r=sn(t),n,i=!1;try{n=t.computation.call(t.wrapper),i=e!==ht&&e!==gt&&t.equal.call(t.wrapper,e,n)}catch(s){n=gt,t.error=s}finally{on(t,r)}if(i){t.value=e;return}t.value=n,t.version++}};function dn(){throw new Error}var hn=dn;function un(){hn()}function pn(t){let e=Object.create(mn);e.value=t;let r=()=>(Ie(e),e.value);return r[Ne]=e,r}function gn(){return Ie(this),this.value}function fn(t,e){rn()||un(),t.equal.call(t.wrapper,t.value,e)||(t.value=e,vn(t))}var mn={...ft,equal:sr,value:void 0};function vn(t){t.version++,tn(),ar(t)}var _=Symbol("node"),S;(t=>{var e,r,n,i,s,a;class g{constructor(v,d={}){Le(this,r),ct(this,e);let f=pn(v)[Ne];if(this[_]=f,f.wrapper=this,d){let C=d.equals;C&&(f.equal=C),f.watched=d[t.subtle.watched],f.unwatched=d[t.subtle.unwatched]}}get(){if(!(0,t.isState)(this))throw new TypeError("Wrong receiver type for Signal.State.prototype.get");return gn.call(this[_])}set(v){if(!(0,t.isState)(this))throw new TypeError("Wrong receiver type for Signal.State.prototype.set");if(en())throw new Error("Writes to signals not permitted during Watcher callback");let d=this[_];fn(d,v)}}e=_,r=new WeakSet,n=function(){},t.isState=p=>typeof p=="object"&&dt(r,p),t.State=g;class u{constructor(v,d){Le(this,s),ct(this,i);let f=ln(v)[Ne];if(f.consumerAllowSignalWrites=!0,this[_]=f,f.wrapper=this,d){let C=d.equals;C&&(f.equal=C),f.watched=d[t.subtle.watched],f.unwatched=d[t.subtle.unwatched]}}get(){if(!(0,t.isComputed)(this))throw new TypeError("Wrong receiver type for Signal.Computed.prototype.get");return cr(this[_])}}i=_,s=new WeakSet,a=function(){},t.isComputed=p=>typeof p=="object"&&dt(s,p),t.Computed=u,(p=>{var v,d,A,f,C;function wr(y){let m,h=null;try{h=q(null),m=y()}finally{q(h)}return m}p.untrack=wr;function br(y){var m;if(!(0,t.isComputed)(y)&&!(0,t.isWatcher)(y))throw new TypeError("Called introspectSources without a Computed or Watcher argument");return((m=y[_].producerNode)==null?void 0:m.map(h=>h.wrapper))??[]}p.introspectSources=br;function xr(y){var m;if(!(0,t.isComputed)(y)&&!(0,t.isState)(y))throw new TypeError("Called introspectSinks without a Signal argument");return((m=y[_].liveConsumerNode)==null?void 0:m.map(h=>h.wrapper))??[]}p.introspectSinks=xr;function _r(y){if(!(0,t.isComputed)(y)&&!(0,t.isState)(y))throw new TypeError("Called hasSinks without a Signal argument");let m=y[_].liveConsumerNode;return m?m.length>0:!1}p.hasSinks=_r;function $r(y){if(!(0,t.isComputed)(y)&&!(0,t.isWatcher)(y))throw new TypeError("Called hasSources without a Computed or Watcher argument");let m=y[_].producerNode;return m?m.length>0:!1}p.hasSources=$r;class Sr{constructor(m){Le(this,d),Le(this,f),ct(this,v);let h=Object.create(ft);h.wrapper=this,h.consumerMarkedDirty=m,h.consumerIsAlwaysLive=!0,h.consumerAllowSignalWrites=!1,h.producerNode=[],this[_]=h}watch(...m){if(!(0,t.isWatcher)(this))throw new TypeError("Called unwatch without Watcher receiver");ir(this,f,C).call(this,m);let h=this[_];h.dirty=!1;let L=q(h);for(let me of m)Ie(me[_]);q(L)}unwatch(...m){if(!(0,t.isWatcher)(this))throw new TypeError("Called unwatch without Watcher receiver");ir(this,f,C).call(this,m);let h=this[_];F(h);for(let L=h.producerNode.length-1;L>=0;L--)if(m.includes(h.producerNode[L].wrapper)){Me(h.producerNode[L],h.producerIndexOfThis[L]);let me=h.producerNode.length-1;if(h.producerNode[L]=h.producerNode[me],h.producerIndexOfThis[L]=h.producerIndexOfThis[me],h.producerNode.length--,h.producerIndexOfThis.length--,h.nextProducerIndex--,L<h.producerNode.length){let kr=h.producerIndexOfThis[L],St=h.producerNode[L];mt(St),St.liveConsumerIndexOfThis[kr]=L}}}getPending(){if(!(0,t.isWatcher)(this))throw new TypeError("Called getPending without Watcher receiver");return this[_].producerNode.filter(h=>h.dirty).map(h=>h.wrapper)}}v=_,d=new WeakSet,A=function(){},f=new WeakSet,C=function(y){for(let m of y)if(!(0,t.isComputed)(m)&&!(0,t.isState)(m))throw new TypeError("Called watch/unwatch without a Computed or State argument")},t.isWatcher=y=>dt(d,y),p.Watcher=Sr;function Cr(){var y;return(y=Qr())==null?void 0:y.wrapper}p.currentComputed=Cr,p.watched=Symbol("watched"),p.unwatched=Symbol("unwatched")})(t.subtle||(t.subtle={}))})(S||(S={}));var _i=Symbol("SignalWatcherBrand"),$i=new FinalizationRegistry((({watcher:t,signal:e})=>{t.unwatch(e)}));var{I:Ai}=Bt;var dr=t=>t.strings===void 0;var ae=(t,e)=>{let r=t._$AN;if(r===void 0)return!1;for(let n of r)n._$AO?.(e,!1),ae(n,e);return!0},Ve=t=>{let e,r;do{if((e=t._$AM)===void 0)break;r=e._$AN,r.delete(t),t=e}while(r?.size===0)},hr=t=>{for(let e;e=t._$AM;t=e){let r=e._$AN;if(r===void 0)e._$AN=r=new Set;else if(r.has(t))break;r.add(t),bn(e)}};function yn(t){this._$AN!==void 0?(Ve(this),this._$AM=t,hr(this)):this._$AM=t}function wn(t,e=!1,r=0){let n=this._$AH,i=this._$AN;if(i!==void 0&&i.size!==0)if(e)if(Array.isArray(n))for(let s=r;s<n.length;s++)ae(n[s],!1),Ve(n[s]);else n!=null&&(ae(n,!1),Ve(n));else ae(this,t)}var bn=t=>{t.type==Ee.CHILD&&(t._$AP??(t._$AP=wn),t._$AQ??(t._$AQ=yn))},He=class extends W{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,r,n){super._$AT(e,r,n),hr(this),this.isConnected=e._$AU}_$AO(e,r=!0){e!==this.isConnected&&(this.isConnected=e,e?this.reconnected?.():this.disconnected?.()),r&&(ae(this,e),Ve(this))}setValue(e){if(dr(this._$Ct))this._$Ct._$AI(e,this);else{let r=[...this._$Ct._$AH];r[this._$Ci]=e,this._$Ct._$AI(r,this,0)}}disconnected(){}reconnected(){}};var Oe=class extends He{_$Sl(){if(this._$Su!==void 0)return;this._$SW=new S.Computed((()=>{var r;return(r=this._$Sj)===null||r===void 0?void 0:r.get()}));let e=this._$Su=new S.subtle.Watcher((()=>{var r;(r=this._$SO)===null||r===void 0||r._(this),e.watch()}));e.watch(this._$SW)}_$Sp(){var e;this._$Su!==void 0&&(this._$Su.unwatch(this._$SW),this._$SW=void 0,this._$Su=void 0,(e=this._$SO)===null||e===void 0||e.m(this))}commit(){this.setValue(S.subtle.untrack((()=>{var e;return(e=this._$SW)===null||e===void 0?void 0:e.get()})))}render(e){return S.subtle.untrack((()=>e.get()))}update(e,[r]){var n,i;return(n=this._$SO)!==null&&n!==void 0||(this._$SO=(i=e.options)===null||i===void 0?void 0:i.host),r!==this._$Sj&&this._$Sj!==void 0&&this._$Sp(),this._$Sj=r,this._$Sl(),S.subtle.untrack((()=>this._$SW.get()))}disconnected(){this._$Sp()}reconnected(){this._$Sl()}},vt=ie(Oe);var yt=t=>(e,...r)=>t(e,...r.map((n=>n instanceof S.State||n instanceof S.Computed?vt(n):n))),xn=yt(o),_n=yt(jt);var Gi=S.State,Zi=S.Computed,ur=(t,e)=>new S.State(t,e);function $n(){if(typeof window>"u")return"light";let t=window.localStorage?.getItem("ds-one:theme");return t==="light"||t==="dark"?t:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}var H=ur($n());function De(t){if(t!==H.get()&&(H.set(t),typeof window<"u")){try{window.localStorage?.setItem("ds-one:theme",t)}catch(r){console.warn("ds-one: unable to persist theme preference",r)}let e=window.document?.documentElement;e&&(e.classList.remove("light-theme","dark-theme"),e.classList.add(`${t}-theme`)),window.dispatchEvent(new CustomEvent("theme-changed",{detail:{theme:t}}))}}if(typeof window<"u"){let t=H.get(),e=window.document?.documentElement;e&&(e.classList.remove("light-theme","dark-theme"),e.classList.add(`${t}-theme`))}function j(t){if(!(typeof window>"u"))try{let e=window.localStorage?.getItem("ds-one:settings"),n={...e?JSON.parse(e):{},...t};window.localStorage?.setItem("ds-one:settings",JSON.stringify(n))}catch(e){console.warn("ds-one: unable to persist settings",e)}}var Sn=t=>{localStorage.setItem("accentColor",t)},bt=()=>localStorage.getItem("accentColor")||"--blue",wt=()=>{let t=bt();document.documentElement.style.setProperty("--accent-color",`var(${t})`)},Cn=t=>{localStorage.setItem("notesStyleMedium",t)},pr=()=>localStorage.getItem("notesStyleMedium")||"note",gr=t=>{localStorage.setItem("pageStyle",t)},le=()=>localStorage.getItem("pageStyle")||"note",Pe=class extends l{static get properties(){return{type:{type:String},values:{type:Array},label:{type:String},currentValue:{type:String,state:!0},translationsReady:{type:Boolean,state:!0},disabled:{type:Boolean,state:!0},variant:{type:String}}}constructor(){super(),this.type="",this.values=[],this.label="",this.currentValue="",this.translationsReady=!1,this.disabled=!1,this.variant="",this.boundHandlers={translationsLoaded:this.handleTranslationsLoaded.bind(this),languageChanged:this.handleLanguageChanged.bind(this),handleLanguageChanged:this.handleLanguageChanged.bind(this),handleThemeChanged:this.handleThemeChanged.bind(this),handleAccentColorChanged:this.handleAccentColorChanged.bind(this),handleNoteBehaviorChanged:this.handleNoteBehaviorChanged.bind(this)}}connectedCallback(){super.connectedCallback(),window.addEventListener("translations-loaded",this.boundHandlers.translationsLoaded),window.addEventListener("language-changed",this.boundHandlers.languageChanged),window.addEventListener("theme-changed",this.boundHandlers.handleThemeChanged),window.addEventListener("accent-color-changed",this.boundHandlers.handleAccentColorChanged),window.addEventListener("page-style-changed",this.boundHandlers.handleNoteBehaviorChanged),this.initializeValues()}async initializeValues(){if(this.type==="language"){let e=at();this.values=e,this.currentValue=$.value,this.label=this.getLabel()}else if(this.type==="theme"){this.values=["light","dark"];let e=H.get();this.currentValue=e,this.label=this.getLabel()}else if(this.type==="accent-color"){this.values=["--light-green","--green","--light-blue","--blue","--pink","--red","--orange","--yellow"];let e=bt();this.currentValue=e,wt(),this.label=this.getLabel()}else if(this.type==="notes-style-medium"){this.values=["default","big","gallery"];let e=pr();this.currentValue=e;let r=le();this.disabled=r==="note",this.label=this.getLabel()}else if(this.type==="page-style"){this.values=["note","page"];let e=le();this.currentValue=e,this.label=this.getLabel()}else this.type==="icon-only"&&(this.values=["note","page"],this.currentValue=this.values[0],this.label="");this.requestUpdate()}ensureThemeInitialized(){if(!localStorage.getItem("theme")){let n=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";localStorage.setItem("theme",n),document.documentElement.classList.add(`${n}-theme`)}}attributeChangedCallback(e,r,n){super.attributeChangedCallback(e,r,n),e==="type"&&r!==n&&this.initializeValues()}async setupInitialValue(){if(this.type==="language"){let e=$.value;this.currentValue=e,this.label=this.getLabel()}else if(this.type==="theme"){let e=H.get();this.currentValue=e,this.label=this.getLabel()}else if(this.type==="accent-color"){let e=bt();this.currentValue=e,wt(),this.label=this.getLabel()}else if(this.type==="notes-style-medium"){let e=pr();this.currentValue=e;let r=le();this.disabled=r==="note",this.label=this.getLabel()}else if(this.type==="page-style"){let e=le();this.currentValue=e,this.label=this.getLabel()}else if(this.type==="icon-only"){let e=le();this.currentValue=e,this.label=""}this.requestUpdate()}handleSettingsChanges(){this.setupInitialValue()}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("translations-loaded",this.boundHandlers.translationsLoaded),window.removeEventListener("language-changed",this.boundHandlers.languageChanged),window.removeEventListener("theme-changed",this.boundHandlers.handleThemeChanged),window.removeEventListener("accent-color-changed",this.boundHandlers.handleAccentColorChanged),window.removeEventListener("page-style-changed",this.boundHandlers.handleNoteBehaviorChanged)}handleButtonClick(e){if(e.preventDefault(),e.stopPropagation(),!this.disabled){if(this.type==="language"){let n=(this.values.indexOf(this.currentValue)+1)%this.values.length,i=this.values[n];this.currentValue=i,document.startViewTransition?document.startViewTransition(()=>{lt(i)}):lt(i),j({language:i}),window.dispatchEvent(new CustomEvent("language-changed",{detail:{language:i}}))}else if(this.type==="theme"){let n=(this.values.indexOf(this.currentValue)+1)%this.values.length,i=this.values[n];this.currentValue=i,De(i),j({theme:i})}else if(this.type==="accent-color"){let n=(this.values.indexOf(this.currentValue)+1)%this.values.length,i=this.values[n];this.currentValue=i,Sn(i),wt(),j({accentColor:i}),window.dispatchEvent(new CustomEvent("accent-color-changed",{detail:{color:i}}))}else if(this.type==="notes-style-medium"){let n=(this.values.indexOf(this.currentValue)+1)%this.values.length,i=this.values[n];this.currentValue=i,Cn(i),j({notesStyleMedium:i}),window.dispatchEvent(new CustomEvent("notes-style-medium-changed",{detail:{style:i}}))}else if(this.type==="page-style"){let n=(this.values.indexOf(this.currentValue)+1)%this.values.length,i=this.values[n];this.currentValue=i,gr(i),j({pageStyle:i}),window.dispatchEvent(new CustomEvent("page-style-changed",{detail:{behavior:i}}))}else if(this.type==="icon-only"){let n=(this.values.indexOf(this.currentValue)+1)%this.values.length,i=this.values[n];this.currentValue=i,gr(i),j({pageStyle:i}),this.label="",window.dispatchEvent(new CustomEvent("page-style-changed",{detail:{behavior:i}}))}this.label=this.getLabel(),this.requestUpdate()}}getValueDisplay(e){if(this.type==="language")return tr(e,{locale:$.value});if(this.type==="theme"){if(this.translationsReady){let r=E(`themes.${e}`);if(r&&r!==`themes.${e}`)return r}return e}else{if(this.type==="accent-color")return this.getColorName(e);if(this.type==="notes-style-medium")return this.getNotesStyleIcon(e);if(this.type==="page-style"){if(this.translationsReady){let r=E(e==="note"?"note":"page");if(r&&r!==(e==="note"?"note":"page"))return r}return e}else if(this.type==="icon-only")return e==="note"?o`<icon-v1 type="note"></icon-v1>`:e==="page"?o`<icon-v1 type="page"></icon-v1>`:o`<span>${e}</span>`}return e}getColorName(e){let n={"--red":"red","--orange":"orange","--yellow":"yellow","--light-green":"lightGreen","--green":"green","--light-blue":"lightBlue","--blue":"blue","--pink":"pink"}[e];if(n&&this.translationsReady){let i=E(n);if(i&&i!==n)return i}return e.replace("--","").replace("-"," ")}getNotesStyleIcon(e){return e==="page"?o`<icon-v1 type="page"></icon-v1>`:e==="note"?o`<icon-v1 type="note"></icon-v1>`:e==="default"?o`<icon-v1 type="default"></icon-v1>`:e==="big"?o`<icon-v1 type="big"></icon-v1>`:e==="gallery"?o`<icon-v1 type="gallery"></icon-v1>`:o`<span>${e}</span>`}getLabel(){if(this.type==="language"){if(this.translationsReady){let e=E("language");if(e&&e!=="language")return e}return"Language"}else if(this.type==="theme"){if(this.translationsReady){let e=E("theme");if(e&&e!=="theme")return e}return"Theme"}else if(this.type==="accent-color"){if(this.translationsReady){let e=E("accentColor");if(e&&e!=="accentColor")return e}return"Accent Color"}else if(this.type==="notes-style-medium"){if(this.translationsReady){let e=E("notesStyle");if(e&&e!=="notesStyle")return e}return"Notes Style"}else if(this.type==="page-style"){if(this.translationsReady){let e=E("clickingItem");if(e&&e!=="clickingItem")return e}return"Clic"}else if(this.type==="icon-only")return"";return this.label}render(){return o`
|
|
284
|
+
`;customElements.define("link-v1",Ae);var er=Object.defineProperty,tr=(t,e,n)=>e in t?er(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,ct=(t,e,n)=>(tr(t,typeof e!="symbol"?e+"":e,n),n),nr=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},dt=(t,e)=>{if(Object(e)!==e)throw TypeError('Cannot use the "in" operator on this value');return t.has(e)},Le=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},on=(t,e,n)=>(nr(t,e,"access private method"),n);function an(t,e){return Object.is(t,e)}var b=null,oe=!1,Te=1,Ne=Symbol("SIGNAL");function q(t){let e=b;return b=t,e}function rr(){return b}function ir(){return oe}var ft={version:0,lastCleanEpoch:0,dirty:!1,producerNode:void 0,producerLastReadVersion:void 0,producerIndexOfThis:void 0,nextProducerIndex:0,liveConsumerNode:void 0,liveConsumerIndexOfThis:void 0,consumerAllowSignalWrites:!1,consumerIsAlwaysLive:!1,producerMustRecompute:()=>!1,producerRecomputeValue:()=>{},consumerMarkedDirty:()=>{},consumerOnSignalRead:()=>{}};function Ie(t){if(oe)throw new Error(typeof ngDevMode<"u"&&ngDevMode?"Assertion error: signal read during notification phase":"");if(b===null)return;b.consumerOnSignalRead(t);let e=b.nextProducerIndex++;if(F(b),e<b.producerNode.length&&b.producerNode[e]!==t&&pt(b)){let n=b.producerNode[e];Me(n,b.producerIndexOfThis[e])}b.producerNode[e]!==t&&(b.producerNode[e]=t,b.producerIndexOfThis[e]=pt(b)?dn(t,b,e):0),b.producerLastReadVersion[e]=t.version}function sr(){Te++}function ln(t){if(!(!t.dirty&&t.lastCleanEpoch===Te)){if(!t.producerMustRecompute(t)&&!dr(t)){t.dirty=!1,t.lastCleanEpoch=Te;return}t.producerRecomputeValue(t),t.dirty=!1,t.lastCleanEpoch=Te}}function cn(t){if(t.liveConsumerNode===void 0)return;let e=oe;oe=!0;try{for(let n of t.liveConsumerNode)n.dirty||ar(n)}finally{oe=e}}function or(){return b?.consumerAllowSignalWrites!==!1}function ar(t){var e;t.dirty=!0,cn(t),(e=t.consumerMarkedDirty)==null||e.call(t.wrapper??t)}function lr(t){return t&&(t.nextProducerIndex=0),q(t)}function cr(t,e){if(q(e),!(!t||t.producerNode===void 0||t.producerIndexOfThis===void 0||t.producerLastReadVersion===void 0)){if(pt(t))for(let n=t.nextProducerIndex;n<t.producerNode.length;n++)Me(t.producerNode[n],t.producerIndexOfThis[n]);for(;t.producerNode.length>t.nextProducerIndex;)t.producerNode.pop(),t.producerLastReadVersion.pop(),t.producerIndexOfThis.pop()}}function dr(t){F(t);for(let e=0;e<t.producerNode.length;e++){let n=t.producerNode[e],r=t.producerLastReadVersion[e];if(r!==n.version||(ln(n),r!==n.version))return!0}return!1}function dn(t,e,n){var r;if(mt(t),F(t),t.liveConsumerNode.length===0){(r=t.watched)==null||r.call(t.wrapper);for(let i=0;i<t.producerNode.length;i++)t.producerIndexOfThis[i]=dn(t.producerNode[i],t,i)}return t.liveConsumerIndexOfThis.push(n),t.liveConsumerNode.push(e)-1}function Me(t,e){var n;if(mt(t),F(t),typeof ngDevMode<"u"&&ngDevMode&&e>=t.liveConsumerNode.length)throw new Error(`Assertion error: active consumer index ${e} is out of bounds of ${t.liveConsumerNode.length} consumers)`);if(t.liveConsumerNode.length===1){(n=t.unwatched)==null||n.call(t.wrapper);for(let i=0;i<t.producerNode.length;i++)Me(t.producerNode[i],t.producerIndexOfThis[i])}let r=t.liveConsumerNode.length-1;if(t.liveConsumerNode[e]=t.liveConsumerNode[r],t.liveConsumerIndexOfThis[e]=t.liveConsumerIndexOfThis[r],t.liveConsumerNode.length--,t.liveConsumerIndexOfThis.length--,e<t.liveConsumerNode.length){let i=t.liveConsumerIndexOfThis[e],s=t.liveConsumerNode[e];F(s),s.producerIndexOfThis[i]=e}}function pt(t){var e;return t.consumerIsAlwaysLive||(((e=t?.liveConsumerNode)==null?void 0:e.length)??0)>0}function F(t){t.producerNode??(t.producerNode=[]),t.producerIndexOfThis??(t.producerIndexOfThis=[]),t.producerLastReadVersion??(t.producerLastReadVersion=[])}function mt(t){t.liveConsumerNode??(t.liveConsumerNode=[]),t.liveConsumerIndexOfThis??(t.liveConsumerIndexOfThis=[])}function hn(t){if(ln(t),Ie(t),t.value===gt)throw t.error;return t.value}function hr(t){let e=Object.create(ur);e.computation=t;let n=()=>hn(e);return n[Ne]=e,n}var ht=Symbol("UNSET"),ut=Symbol("COMPUTING"),gt=Symbol("ERRORED"),ur={...ft,value:ht,dirty:!0,error:null,equal:an,producerMustRecompute(t){return t.value===ht||t.value===ut},producerRecomputeValue(t){if(t.value===ut)throw new Error("Detected cycle in computations.");let e=t.value;t.value=ut;let n=lr(t),r,i=!1;try{r=t.computation.call(t.wrapper),i=e!==ht&&e!==gt&&t.equal.call(t.wrapper,e,r)}catch(s){r=gt,t.error=s}finally{cr(t,n)}if(i){t.value=e;return}t.value=r,t.version++}};function pr(){throw new Error}var gr=pr;function fr(){gr()}function mr(t){let e=Object.create(wr);e.value=t;let n=()=>(Ie(e),e.value);return n[Ne]=e,n}function vr(){return Ie(this),this.value}function yr(t,e){or()||fr(),t.equal.call(t.wrapper,t.value,e)||(t.value=e,br(t))}var wr={...ft,equal:an,value:void 0};function br(t){t.version++,sr(),cn(t)}var _=Symbol("node"),S;(t=>{var e,n,r,i,s,a;class g{constructor(v,d={}){Le(this,n),ct(this,e);let f=mr(v)[Ne];if(this[_]=f,f.wrapper=this,d){let C=d.equals;C&&(f.equal=C),f.watched=d[t.subtle.watched],f.unwatched=d[t.subtle.unwatched]}}get(){if(!(0,t.isState)(this))throw new TypeError("Wrong receiver type for Signal.State.prototype.get");return vr.call(this[_])}set(v){if(!(0,t.isState)(this))throw new TypeError("Wrong receiver type for Signal.State.prototype.set");if(ir())throw new Error("Writes to signals not permitted during Watcher callback");let d=this[_];yr(d,v)}}e=_,n=new WeakSet,r=function(){},t.isState=p=>typeof p=="object"&&dt(n,p),t.State=g;class u{constructor(v,d){Le(this,s),ct(this,i);let f=hr(v)[Ne];if(f.consumerAllowSignalWrites=!0,this[_]=f,f.wrapper=this,d){let C=d.equals;C&&(f.equal=C),f.watched=d[t.subtle.watched],f.unwatched=d[t.subtle.unwatched]}}get(){if(!(0,t.isComputed)(this))throw new TypeError("Wrong receiver type for Signal.Computed.prototype.get");return hn(this[_])}}i=_,s=new WeakSet,a=function(){},t.isComputed=p=>typeof p=="object"&&dt(s,p),t.Computed=u,(p=>{var v,d,A,f,C;function xn(y){let m,h=null;try{h=q(null),m=y()}finally{q(h)}return m}p.untrack=xn;function _n(y){var m;if(!(0,t.isComputed)(y)&&!(0,t.isWatcher)(y))throw new TypeError("Called introspectSources without a Computed or Watcher argument");return((m=y[_].producerNode)==null?void 0:m.map(h=>h.wrapper))??[]}p.introspectSources=_n;function $n(y){var m;if(!(0,t.isComputed)(y)&&!(0,t.isState)(y))throw new TypeError("Called introspectSinks without a Signal argument");return((m=y[_].liveConsumerNode)==null?void 0:m.map(h=>h.wrapper))??[]}p.introspectSinks=$n;function Sn(y){if(!(0,t.isComputed)(y)&&!(0,t.isState)(y))throw new TypeError("Called hasSinks without a Signal argument");let m=y[_].liveConsumerNode;return m?m.length>0:!1}p.hasSinks=Sn;function Cn(y){if(!(0,t.isComputed)(y)&&!(0,t.isWatcher)(y))throw new TypeError("Called hasSources without a Computed or Watcher argument");let m=y[_].producerNode;return m?m.length>0:!1}p.hasSources=Cn;class kn{constructor(m){Le(this,d),Le(this,f),ct(this,v);let h=Object.create(ft);h.wrapper=this,h.consumerMarkedDirty=m,h.consumerIsAlwaysLive=!0,h.consumerAllowSignalWrites=!1,h.producerNode=[],this[_]=h}watch(...m){if(!(0,t.isWatcher)(this))throw new TypeError("Called unwatch without Watcher receiver");on(this,f,C).call(this,m);let h=this[_];h.dirty=!1;let L=q(h);for(let me of m)Ie(me[_]);q(L)}unwatch(...m){if(!(0,t.isWatcher)(this))throw new TypeError("Called unwatch without Watcher receiver");on(this,f,C).call(this,m);let h=this[_];F(h);for(let L=h.producerNode.length-1;L>=0;L--)if(m.includes(h.producerNode[L].wrapper)){Me(h.producerNode[L],h.producerIndexOfThis[L]);let me=h.producerNode.length-1;if(h.producerNode[L]=h.producerNode[me],h.producerIndexOfThis[L]=h.producerIndexOfThis[me],h.producerNode.length--,h.producerIndexOfThis.length--,h.nextProducerIndex--,L<h.producerNode.length){let An=h.producerIndexOfThis[L],St=h.producerNode[L];mt(St),St.liveConsumerIndexOfThis[An]=L}}}getPending(){if(!(0,t.isWatcher)(this))throw new TypeError("Called getPending without Watcher receiver");return this[_].producerNode.filter(h=>h.dirty).map(h=>h.wrapper)}}v=_,d=new WeakSet,A=function(){},f=new WeakSet,C=function(y){for(let m of y)if(!(0,t.isComputed)(m)&&!(0,t.isState)(m))throw new TypeError("Called watch/unwatch without a Computed or State argument")},t.isWatcher=y=>dt(d,y),p.Watcher=kn;function En(){var y;return(y=rr())==null?void 0:y.wrapper}p.currentComputed=En,p.watched=Symbol("watched"),p.unwatched=Symbol("unwatched")})(t.subtle||(t.subtle={}))})(S||(S={}));var ki=Symbol("SignalWatcherBrand"),Ei=new FinalizationRegistry((({watcher:t,signal:e})=>{t.unwatch(e)}));var{I:Ii}=qt;var un=t=>t.strings===void 0;var ae=(t,e)=>{let n=t._$AN;if(n===void 0)return!1;for(let r of n)r._$AO?.(e,!1),ae(r,e);return!0},Ve=t=>{let e,n;do{if((e=t._$AM)===void 0)break;n=e._$AN,n.delete(t),t=e}while(n?.size===0)},pn=t=>{for(let e;e=t._$AM;t=e){let n=e._$AN;if(n===void 0)e._$AN=n=new Set;else if(n.has(t))break;n.add(t),$r(e)}};function xr(t){this._$AN!==void 0?(Ve(this),this._$AM=t,pn(this)):this._$AM=t}function _r(t,e=!1,n=0){let r=this._$AH,i=this._$AN;if(i!==void 0&&i.size!==0)if(e)if(Array.isArray(r))for(let s=n;s<r.length;s++)ae(r[s],!1),Ve(r[s]);else r!=null&&(ae(r,!1),Ve(r));else ae(this,t)}var $r=t=>{t.type==Ee.CHILD&&(t._$AP??(t._$AP=_r),t._$AQ??(t._$AQ=xr))},He=class extends z{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,n,r){super._$AT(e,n,r),pn(this),this.isConnected=e._$AU}_$AO(e,n=!0){e!==this.isConnected&&(this.isConnected=e,e?this.reconnected?.():this.disconnected?.()),n&&(ae(this,e),Ve(this))}setValue(e){if(un(this._$Ct))this._$Ct._$AI(e,this);else{let n=[...this._$Ct._$AH];n[this._$Ci]=e,this._$Ct._$AI(n,this,0)}}disconnected(){}reconnected(){}};var De=class extends He{_$Sl(){if(this._$Su!==void 0)return;this._$SW=new S.Computed((()=>{var n;return(n=this._$Sj)===null||n===void 0?void 0:n.get()}));let e=this._$Su=new S.subtle.Watcher((()=>{var n;(n=this._$SO)===null||n===void 0||n._(this),e.watch()}));e.watch(this._$SW)}_$Sp(){var e;this._$Su!==void 0&&(this._$Su.unwatch(this._$SW),this._$SW=void 0,this._$Su=void 0,(e=this._$SO)===null||e===void 0||e.m(this))}commit(){this.setValue(S.subtle.untrack((()=>{var e;return(e=this._$SW)===null||e===void 0?void 0:e.get()})))}render(e){return S.subtle.untrack((()=>e.get()))}update(e,[n]){var r,i;return(r=this._$SO)!==null&&r!==void 0||(this._$SO=(i=e.options)===null||i===void 0?void 0:i.host),n!==this._$Sj&&this._$Sj!==void 0&&this._$Sp(),this._$Sj=n,this._$Sl(),S.subtle.untrack((()=>this._$SW.get()))}disconnected(){this._$Sp()}reconnected(){this._$Sl()}},vt=ie(De);var yt=t=>(e,...n)=>t(e,...n.map((r=>r instanceof S.State||r instanceof S.Computed?vt(r):r))),Sr=yt(o),Cr=yt(Wt);var Xi=S.State,Qi=S.Computed,gn=(t,e)=>new S.State(t,e);function kr(){if(typeof window>"u")return"light";let t=window.localStorage?.getItem("ds-one:theme");return t==="light"||t==="dark"?t:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}var H=gn(kr());function Oe(t){if(t!==H.get()&&(H.set(t),typeof window<"u")){try{window.localStorage?.setItem("ds-one:theme",t)}catch(n){console.warn("ds-one: unable to persist theme preference",n)}let e=window.document?.documentElement;e&&(e.classList.remove("light-theme","dark-theme"),e.classList.add(`${t}-theme`)),window.dispatchEvent(new CustomEvent("theme-changed",{detail:{theme:t}}))}}if(typeof window<"u"){let t=H.get(),e=window.document?.documentElement;e&&(e.classList.remove("light-theme","dark-theme"),e.classList.add(`${t}-theme`))}function j(t){if(!(typeof window>"u"))try{let e=window.localStorage?.getItem("ds-one:settings"),r={...e?JSON.parse(e):{},...t};window.localStorage?.setItem("ds-one:settings",JSON.stringify(r))}catch(e){console.warn("ds-one: unable to persist settings",e)}}var Er=t=>{localStorage.setItem("accentColor",t)},bt=()=>localStorage.getItem("accentColor")||"--blue",wt=()=>{let t=bt();document.documentElement.style.setProperty("--accent-color",`var(${t})`)},Ar=t=>{localStorage.setItem("notesStyleMedium",t)},fn=()=>localStorage.getItem("notesStyleMedium")||"note",mn=t=>{localStorage.setItem("pageStyle",t)},le=()=>localStorage.getItem("pageStyle")||"note",Pe=class extends l{static get properties(){return{type:{type:String},values:{type:Array},label:{type:String},currentValue:{type:String,state:!0},translationsReady:{type:Boolean,state:!0},disabled:{type:Boolean,state:!0},variant:{type:String}}}constructor(){super(),this.type="",this.values=[],this.label="",this.currentValue="",this.translationsReady=!1,this.disabled=!1,this.variant="",this.boundHandlers={translationsLoaded:this.handleTranslationsLoaded.bind(this),languageChanged:this.handleLanguageChanged.bind(this),handleLanguageChanged:this.handleLanguageChanged.bind(this),handleThemeChanged:this.handleThemeChanged.bind(this),handleAccentColorChanged:this.handleAccentColorChanged.bind(this),handleNoteBehaviorChanged:this.handleNoteBehaviorChanged.bind(this)}}connectedCallback(){super.connectedCallback(),window.addEventListener("translations-loaded",this.boundHandlers.translationsLoaded),window.addEventListener("language-changed",this.boundHandlers.languageChanged),window.addEventListener("theme-changed",this.boundHandlers.handleThemeChanged),window.addEventListener("accent-color-changed",this.boundHandlers.handleAccentColorChanged),window.addEventListener("page-style-changed",this.boundHandlers.handleNoteBehaviorChanged),this.initializeValues()}async initializeValues(){if(this.type==="language"){let e=at();this.values=e,this.currentValue=$.value,this.label=this.getLabel()}else if(this.type==="theme"){this.values=["light","dark"];let e=H.get();this.currentValue=e,this.label=this.getLabel()}else if(this.type==="accent-color"){this.values=["--light-green","--green","--light-blue","--blue","--pink","--red","--orange","--yellow"];let e=bt();this.currentValue=e,wt(),this.label=this.getLabel()}else if(this.type==="notes-style-medium"){this.values=["default","big","gallery"];let e=fn();this.currentValue=e;let n=le();this.disabled=n==="note",this.label=this.getLabel()}else if(this.type==="page-style"){this.values=["note","page"];let e=le();this.currentValue=e,this.label=this.getLabel()}else this.type==="icon-only"&&(this.values=["note","page"],this.currentValue=this.values[0],this.label="");this.requestUpdate()}ensureThemeInitialized(){if(!localStorage.getItem("theme")){let r=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";localStorage.setItem("theme",r),document.documentElement.classList.add(`${r}-theme`)}}attributeChangedCallback(e,n,r){super.attributeChangedCallback(e,n,r),e==="type"&&n!==r&&this.initializeValues()}async setupInitialValue(){if(this.type==="language"){let e=$.value;this.currentValue=e,this.label=this.getLabel()}else if(this.type==="theme"){let e=H.get();this.currentValue=e,this.label=this.getLabel()}else if(this.type==="accent-color"){let e=bt();this.currentValue=e,wt(),this.label=this.getLabel()}else if(this.type==="notes-style-medium"){let e=fn();this.currentValue=e;let n=le();this.disabled=n==="note",this.label=this.getLabel()}else if(this.type==="page-style"){let e=le();this.currentValue=e,this.label=this.getLabel()}else if(this.type==="icon-only"){let e=le();this.currentValue=e,this.label=""}this.requestUpdate()}handleSettingsChanges(){this.setupInitialValue()}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("translations-loaded",this.boundHandlers.translationsLoaded),window.removeEventListener("language-changed",this.boundHandlers.languageChanged),window.removeEventListener("theme-changed",this.boundHandlers.handleThemeChanged),window.removeEventListener("accent-color-changed",this.boundHandlers.handleAccentColorChanged),window.removeEventListener("page-style-changed",this.boundHandlers.handleNoteBehaviorChanged)}handleButtonClick(e){if(e.preventDefault(),e.stopPropagation(),!this.disabled){if(this.type==="language"){let r=(this.values.indexOf(this.currentValue)+1)%this.values.length,i=this.values[r];this.currentValue=i,document.startViewTransition?document.startViewTransition(()=>{lt(i)}):lt(i),j({language:i}),window.dispatchEvent(new CustomEvent("language-changed",{detail:{language:i}}))}else if(this.type==="theme"){let r=(this.values.indexOf(this.currentValue)+1)%this.values.length,i=this.values[r];this.currentValue=i,Oe(i),j({theme:i})}else if(this.type==="accent-color"){let r=(this.values.indexOf(this.currentValue)+1)%this.values.length,i=this.values[r];this.currentValue=i,Er(i),wt(),j({accentColor:i}),window.dispatchEvent(new CustomEvent("accent-color-changed",{detail:{color:i}}))}else if(this.type==="notes-style-medium"){let r=(this.values.indexOf(this.currentValue)+1)%this.values.length,i=this.values[r];this.currentValue=i,Ar(i),j({notesStyleMedium:i}),window.dispatchEvent(new CustomEvent("notes-style-medium-changed",{detail:{style:i}}))}else if(this.type==="page-style"){let r=(this.values.indexOf(this.currentValue)+1)%this.values.length,i=this.values[r];this.currentValue=i,mn(i),j({pageStyle:i}),window.dispatchEvent(new CustomEvent("page-style-changed",{detail:{behavior:i}}))}else if(this.type==="icon-only"){let r=(this.values.indexOf(this.currentValue)+1)%this.values.length,i=this.values[r];this.currentValue=i,mn(i),j({pageStyle:i}),this.label="",window.dispatchEvent(new CustomEvent("page-style-changed",{detail:{behavior:i}}))}this.label=this.getLabel(),this.requestUpdate()}}getValueDisplay(e){if(this.type==="language")return nn(e,{locale:$.value});if(this.type==="theme"){if(this.translationsReady){let n=E(`themes.${e}`);if(n&&n!==`themes.${e}`)return n}return e}else{if(this.type==="accent-color")return this.getColorName(e);if(this.type==="notes-style-medium")return this.getNotesStyleIcon(e);if(this.type==="page-style"){if(this.translationsReady){let n=E(e==="note"?"note":"page");if(n&&n!==(e==="note"?"note":"page"))return n}return e}else if(this.type==="icon-only")return e==="note"?o`<icon-v1 type="note"></icon-v1>`:e==="page"?o`<icon-v1 type="page"></icon-v1>`:o`<span>${e}</span>`}return e}getColorName(e){let r={"--red":"red","--orange":"orange","--yellow":"yellow","--light-green":"lightGreen","--green":"green","--light-blue":"lightBlue","--blue":"blue","--pink":"pink"}[e];if(r&&this.translationsReady){let i=E(r);if(i&&i!==r)return i}return e.replace("--","").replace("-"," ")}getNotesStyleIcon(e){return e==="page"?o`<icon-v1 type="page"></icon-v1>`:e==="note"?o`<icon-v1 type="note"></icon-v1>`:e==="default"?o`<icon-v1 type="default"></icon-v1>`:e==="big"?o`<icon-v1 type="big"></icon-v1>`:e==="gallery"?o`<icon-v1 type="gallery"></icon-v1>`:o`<span>${e}</span>`}getLabel(){if(this.type==="language"){if(this.translationsReady){let e=E("language");if(e&&e!=="language")return e}return"Language"}else if(this.type==="theme"){if(this.translationsReady){let e=E("theme");if(e&&e!=="theme")return e}return"Theme"}else if(this.type==="accent-color"){if(this.translationsReady){let e=E("accentColor");if(e&&e!=="accentColor")return e}return"Accent Color"}else if(this.type==="notes-style-medium"){if(this.translationsReady){let e=E("notesStyle");if(e&&e!=="notesStyle")return e}return"Notes Style"}else if(this.type==="page-style"){if(this.translationsReady){let e=E("clickingItem");if(e&&e!=="clickingItem")return e}return"Clic"}else if(this.type==="icon-only")return"";return this.label}render(){return o`
|
|
285
285
|
<div class="cycle-container">
|
|
286
286
|
${this.type!=="icon-only"?o`<span class="cycle-label">${this.label}</span>`:""}
|
|
287
287
|
<div
|
|
@@ -305,7 +305,7 @@ var Ct=!1,Er=["./keys.json","./tekst.json","./tekster.json","./language.json",".
|
|
|
305
305
|
`:""}
|
|
306
306
|
</div>
|
|
307
307
|
</div>
|
|
308
|
-
`}async waitForTranslations(){return new Promise(e=>{if(this.translationsReady){e();return}let
|
|
308
|
+
`}async waitForTranslations(){return new Promise(e=>{if(this.translationsReady){e();return}let n=()=>{this.translationsReady=!0,e()};window.addEventListener("translations-loaded",n,{once:!0}),setTimeout(()=>{this.translationsReady=!0,e()},5e3)})}handleTranslationsLoaded(){if(this.translationsReady=!0,this.type==="language"){let e=at();this.values=e}this.setupInitialValue()}handleLanguageChanged(){this.setupInitialValue()}handleThemeChanged(){this.setupInitialValue()}handleAccentColorChanged(){this.setupInitialValue()}handleNoteBehaviorChanged(){this.setupInitialValue()}};Pe.styles=c`
|
|
309
309
|
.cycle-container {
|
|
310
310
|
display: flex;
|
|
311
311
|
justify-content: space-between;
|
|
@@ -316,7 +316,7 @@ var Ct=!1,Er=["./keys.json","./tekst.json","./tekster.json","./language.json",".
|
|
|
316
316
|
.cycle-label {
|
|
317
317
|
color: var(--text-color-primary);
|
|
318
318
|
}
|
|
319
|
-
`;customElements.define("cycle-v1",Pe);var ce=class extends l{constructor(){super(),this.key="",this.defaultValue="",this._text="",this._visible=!1,this.boundWindowHandlers={languageChanged:(()=>{this._loadText()}),translationsLoaded:(()=>{this._loadText()})},this.boundHostHandlers={mouseenter:(()=>{this._visible=!0,this.requestUpdate()}),mouseleave:(()=>{this._visible=!1,this.requestUpdate()}),focusin:(()=>{this._visible=!0,this.requestUpdate()}),focusout:(()=>{this._visible=!1,this.requestUpdate()})}}connectedCallback(){super.connectedCallback(),this._loadText(),window.addEventListener("language-changed",this.boundWindowHandlers.languageChanged),window.addEventListener("translations-loaded",this.boundWindowHandlers.translationsLoaded),this.addEventListener("mouseenter",this.boundHostHandlers.mouseenter),this.addEventListener("mouseleave",this.boundHostHandlers.mouseleave),this.addEventListener("focusin",this.boundHostHandlers.focusin),this.addEventListener("focusout",this.boundHostHandlers.focusout)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("language-changed",this.boundWindowHandlers.languageChanged),window.removeEventListener("translations-loaded",this.boundWindowHandlers.translationsLoaded),this.removeEventListener("mouseenter",this.boundHostHandlers.mouseenter),this.removeEventListener("mouseleave",this.boundHostHandlers.mouseleave),this.removeEventListener("focusin",this.boundHostHandlers.focusin),this.removeEventListener("focusout",this.boundHostHandlers.focusout)}updated(e){(e.has("key")||e.has("defaultValue"))&&this._loadText()}async _loadText(){if(!this.key){this._text=this.defaultValue||"",this.requestUpdate();return}try{let e=await
|
|
319
|
+
`;customElements.define("cycle-v1",Pe);var ce=class extends l{constructor(){super(),this.key="",this.defaultValue="",this._text="",this._visible=!1,this.boundWindowHandlers={languageChanged:(()=>{this._loadText()}),translationsLoaded:(()=>{this._loadText()})},this.boundHostHandlers={mouseenter:(()=>{this._visible=!0,this.requestUpdate()}),mouseleave:(()=>{this._visible=!1,this.requestUpdate()}),focusin:(()=>{this._visible=!0,this.requestUpdate()}),focusout:(()=>{this._visible=!1,this.requestUpdate()})}}connectedCallback(){super.connectedCallback(),this._loadText(),window.addEventListener("language-changed",this.boundWindowHandlers.languageChanged),window.addEventListener("translations-loaded",this.boundWindowHandlers.translationsLoaded),this.addEventListener("mouseenter",this.boundHostHandlers.mouseenter),this.addEventListener("mouseleave",this.boundHostHandlers.mouseleave),this.addEventListener("focusin",this.boundHostHandlers.focusin),this.addEventListener("focusout",this.boundHostHandlers.focusout)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("language-changed",this.boundWindowHandlers.languageChanged),window.removeEventListener("translations-loaded",this.boundWindowHandlers.translationsLoaded),this.removeEventListener("mouseenter",this.boundHostHandlers.mouseenter),this.removeEventListener("mouseleave",this.boundHostHandlers.mouseleave),this.removeEventListener("focusin",this.boundHostHandlers.focusin),this.removeEventListener("focusout",this.boundHostHandlers.focusout)}updated(e){(e.has("key")||e.has("defaultValue"))&&this._loadText()}async _loadText(){if(!this.key){this._text=this.defaultValue||"",this.requestUpdate();return}try{let e=await rn(this.key);if(e){this._text=e,this.requestUpdate();return}let n=E(this.key);this._text=n&&n!==this.key?n:this.defaultValue||this.key}catch(e){console.error("tooltip-v1: error loading text for key",this.key,e),this._text=this.defaultValue||this.key}this.requestUpdate()}render(){let e=["bubble",this._visible?"visible":""].join(" ");return o`
|
|
320
320
|
<span class="slot-wrapper"><slot></slot></span>
|
|
321
321
|
${this._text?o`<div class="${e}">${this._text}</div>`:null}
|
|
322
322
|
`}};ce.properties={key:{type:String,reflect:!0},defaultValue:{type:String,reflect:!0,attribute:"default-value"},_text:{state:!0},_visible:{state:!0}};ce.styles=c`
|
|
@@ -364,7 +364,7 @@ var Ct=!1,Er=["./keys.json","./tekst.json","./tekster.json","./language.json",".
|
|
|
364
364
|
.bubble.visible {
|
|
365
365
|
opacity: 1;
|
|
366
366
|
}
|
|
367
|
-
`;customElements.define("tooltip-v1",ce);var
|
|
367
|
+
`;customElements.define("tooltip-v1",ce);var vn={en:"$42",de:"42 \u20AC",fr:"42 \u20AC",es:"42 \u20AC"};function yn({language:t,country:e}){let n=t.toLowerCase(),r=vn[n]??vn.en;return e?`${r} (${e.toUpperCase()})`:r}var Ue=class extends l{static get properties(){return{country:{type:String,reflect:!0},region:{type:String,reflect:!0},_label:{type:String,state:!0},_loading:{type:Boolean,state:!0}}}constructor(){super(),this.country="",this.region="",this._label="",this._loading=!0,this.boundHandlers={languageChanged:(()=>{this._loadPrice()})}}connectedCallback(){super.connectedCallback(),this._loadPrice(),window.addEventListener("language-changed",this.boundHandlers.languageChanged),window.addEventListener("translations-loaded",this.boundHandlers.languageChanged)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("language-changed",this.boundHandlers.languageChanged),window.removeEventListener("translations-loaded",this.boundHandlers.languageChanged)}updated(e){super.updated(e),(e.has("country")||e.has("region"))&&this._loadPrice()}_loadPrice(){this._loading=!0;let e=$.value,n=this.region||this.country,r=yn({language:e,country:n});this._label=r,this._loading=!1,this.requestUpdate()}render(){return o`<span class="${this._loading?"loading":""}"
|
|
368
368
|
>${this._label}</span
|
|
369
369
|
>`}};Ue.styles=c`
|
|
370
370
|
:host {
|
|
@@ -398,7 +398,7 @@ var Ct=!1,Er=["./keys.json","./tekst.json","./tekster.json","./language.json",".
|
|
|
398
398
|
</div>
|
|
399
399
|
`:o`<div class="markdown-container">
|
|
400
400
|
<p>No content available</p>
|
|
401
|
-
</div>`}renderMarkdown(e){let
|
|
401
|
+
</div>`}renderMarkdown(e){let n=e.replace(/^### (.*$)/gim,"<h3>$1</h3>").replace(/^## (.*$)/gim,"<h2>$1</h2>").replace(/^# (.*$)/gim,"<h1>$1</h1>").replace(/\*\*(.*?)\*\*/g,"<strong>$1</strong>").replace(/\*(.*?)\*/g,"<em>$1</em>").replace(/```([\s\S]*?)```/g,"<pre><code>$1</code></pre>").replace(/`(.*?)`/g,"<code>$1</code>").replace(/\[([^\]]+)\]\(([^)]+)\)/g,'<a href="$2">$1</a>').replace(/\n/g,"<br>");return o`${n}`}},Re.properties={content:{type:String},title:{type:String},language:{type:String},guideId:{type:String}},Re.styles=c`
|
|
402
402
|
:host {
|
|
403
403
|
display: block;
|
|
404
404
|
font-family:
|
|
@@ -561,7 +561,7 @@ var Ct=!1,Er=["./keys.json","./tekst.json","./tekster.json","./language.json",".
|
|
|
561
561
|
height: auto;
|
|
562
562
|
margin: 1rem 0;
|
|
563
563
|
}
|
|
564
|
-
`,Re));var de=class extends l{constructor(){super(...arguments),this.state="active"}connectedCallback(){super.connectedCallback(),this._isMobileDevice()&&(this.state="disabled")}_isMobileDevice(){let e=globalThis.navigator,
|
|
564
|
+
`,Re));var de=class extends l{constructor(){super(...arguments),this.state="active"}connectedCallback(){super.connectedCallback(),this._isMobileDevice()&&(this.state="disabled")}_isMobileDevice(){let e=globalThis.navigator,n=globalThis.window,r=e&&(e.userAgent||e.vendor)||n&&n.opera||"",i=/Mobile|Android|iP(ad|hone|od)|IEMobile|BlackBerry|Kindle|Silk-Accelerated|(hpw|web)OS|Opera M(obi|ini)|Windows Phone|Phone|Tablet/i.test(r),a=(e&&e.maxTouchPoints||0)>1,g=n?Math.min(n.innerWidth||0,n.innerHeight||0)<=820:!1;return i||a&&g}updated(){this._isMobileDevice()&&this.state!=="disabled"&&(this.state="disabled")}_navigateHome(){this.state!=="disabled"&&(window.location.href="./home.html")}_onKeyDown(e){this.state!=="disabled"&&(e?.key==="Enter"||e?.key===" ")&&(e.preventDefault(),this._navigateHome())}render(){let e=this.state==="disabled";return o`
|
|
565
565
|
<div class="hover-fill"></div>
|
|
566
566
|
<div
|
|
567
567
|
class="home ${e?"is-disabled":"is-active"}"
|
|
@@ -653,7 +653,7 @@ var Ct=!1,Er=["./keys.json","./tekst.json","./tekster.json","./language.json",".
|
|
|
653
653
|
font-size: inherit;
|
|
654
654
|
color: inherit;
|
|
655
655
|
}
|
|
656
|
-
`;customElements.define("year-v1",je);var
|
|
656
|
+
`;customElements.define("year-v1",je);var We=class extends l{static get properties(){return{gridarea:{type:String,reflect:!0},key:{type:String,reflect:!0},defaultValue:{type:String,reflect:!0,attribute:"default-value"},_text:{type:String,state:!0}}}set gridarea(e){let n=this._gridArea;this._gridArea=e,this.style.gridArea=e,this.requestUpdate("gridarea",n)}get gridarea(){return this._gridArea}constructor(){super(),this._gridArea="",this.key="",this.defaultValue="",this._text="",this.boundHandlers={languageChanged:(()=>{this._loadText()})}}connectedCallback(){super.connectedCallback(),this._loadText(),window.addEventListener("language-changed",this.boundHandlers.languageChanged)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("language-changed",this.boundHandlers.languageChanged)}updated(e){(e.has("key")||e.has("defaultValue"))&&this._loadText()}_loadText(){if(!this.key){this._text=this.defaultValue||"";return}try{let e=x(this.key);this._text=e||this.defaultValue||this.key}catch(e){console.error(`[title-v1] Error loading text for key "${this.key}":`,e),this._text=this.defaultValue||this.key}}firstUpdated(){this.hasAttribute("gridarea")&&(this.style.gridArea=this.getAttribute("gridarea")||"")}render(){let e=this.key&&this._text;return o` <h1>${e?this._text:o`<slot></slot>`}</h1> `}};We.styles=c`
|
|
657
657
|
:host {
|
|
658
658
|
display: flex;
|
|
659
659
|
padding: calc(2px * var(--scaling-factor));
|
|
@@ -677,13 +677,13 @@ var Ct=!1,Er=["./keys.json","./tekst.json","./tekster.json","./language.json",".
|
|
|
677
677
|
margin: 0;
|
|
678
678
|
width: 100%;
|
|
679
679
|
}
|
|
680
|
-
`;customElements.define("title-v1",
|
|
680
|
+
`;customElements.define("title-v1",We);var ze=class extends l{static get properties(){return{gridarea:{type:String,reflect:!0}}}set gridarea(e){let n=this._gridArea;this._gridArea=e,this.style.gridArea=e,this.requestUpdate("gridarea",n)}get gridarea(){return this._gridArea}constructor(){super(),this._gridArea=""}firstUpdated(){this.hasAttribute("gridarea")&&(this.style.gridArea=this.getAttribute("gridarea")||"")}render(){return o`
|
|
681
681
|
<h2
|
|
682
682
|
style="display: flex; flex-wrap: nowrap; justify-content: space-between; align-items: center; width: 100%;"
|
|
683
683
|
>
|
|
684
684
|
<slot></slot>
|
|
685
685
|
</h2>
|
|
686
|
-
`}};
|
|
686
|
+
`}};ze.styles=c`
|
|
687
687
|
:host {
|
|
688
688
|
display: flex;
|
|
689
689
|
padding: calc(2px * var(--scaling-factor));
|
|
@@ -706,7 +706,7 @@ var Ct=!1,Er=["./keys.json","./tekst.json","./tekster.json","./language.json",".
|
|
|
706
706
|
::slotted(*) {
|
|
707
707
|
margin: 0;
|
|
708
708
|
}
|
|
709
|
-
`;customElements.define("header-v1",
|
|
709
|
+
`;customElements.define("header-v1",ze);var Be=class extends l{static get properties(){return{year:{type:String,reflect:!0},category:{type:String,reflect:!0},status:{type:String,reflect:!0},type:{type:String,reflect:!0}}}constructor(){super(),this.year="",this.category="",this.status="",this.type="project",this.boundHandlers={languageChanged:(()=>{this.requestUpdate()})}}connectedCallback(){super.connectedCallback(),window.addEventListener("language-changed",this.boundHandlers.languageChanged)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("language-changed",this.boundHandlers.languageChanged)}_getStatusClass(e){return e.includes("Done")?"done":e.includes("Ongoing")?"ongoing":e.includes("Pending")?"pending":e.includes("NotStarted")?"not-started":"pending"}render(){return o`
|
|
710
710
|
${this.year?o`
|
|
711
711
|
<div class="attribute-row">${x(this.year)||this.year}</div>
|
|
712
712
|
`:""}
|
|
@@ -769,7 +769,7 @@ var Ct=!1,Er=["./keys.json","./tekst.json","./tekster.json","./language.json",".
|
|
|
769
769
|
.status-indicator.not-started {
|
|
770
770
|
background-color: #b1b4b9;
|
|
771
771
|
}
|
|
772
|
-
`;customElements.define("attributes-v1",Be);var he=class extends l{constructor(){super(),this._handleLanguageChange=()=>{this._resolveUrl()},this.urlEn="",this.urlDa="",this.urlJa="",this.filename="cv",this._activeUrl=""}connectedCallback(){super.connectedCallback(),this._resolveUrl(),window.addEventListener("language-changed",this._handleLanguageChange)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("language-changed",this._handleLanguageChange)}updated(e){(e.has("urlEn")||e.has("urlDa")||e.has("urlJa"))&&this._resolveUrl()}_resolveUrl(){let
|
|
772
|
+
`;customElements.define("attributes-v1",Be);var he=class extends l{constructor(){super(),this._handleLanguageChange=()=>{this._resolveUrl()},this.urlEn="",this.urlDa="",this.urlJa="",this.filename="cv",this._activeUrl=""}connectedCallback(){super.connectedCallback(),this._resolveUrl(),window.addEventListener("language-changed",this._handleLanguageChange)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("language-changed",this._handleLanguageChange)}updated(e){(e.has("urlEn")||e.has("urlDa")||e.has("urlJa"))&&this._resolveUrl()}_resolveUrl(){let n=(($.value||"en-US").split("-")[0]||"en").toLowerCase(),r="";n==="da"?r=this.urlDa||this.urlEn||this.urlJa:n==="ja"?r=this.urlJa||this.urlEn||this.urlDa:r=this.urlEn||this.urlDa||this.urlJa,this._activeUrl=r||""}async _download(){if(!this._activeUrl){console.warn("[downloadcv-v1] No URL available");return}console.log("[downloadcv-v1] Attempting download from:",this._activeUrl);try{let e=await fetch(this._activeUrl,{mode:"cors"});if(console.log("[downloadcv-v1] Fetch response:",e.status,e.statusText),!e.ok)throw new Error(`HTTP ${e.status}`);let n=await e.blob(),r=($.value||"en-US").split("-")[0].toLowerCase(),i=this._inferExtFromUrl(this._activeUrl)||"pdf",s=`${this.filename||"cv"}-${r}.${i}`,a=URL.createObjectURL(n),g=document.createElement("a");g.href=a,g.download=s,document.body.appendChild(g),g.click(),g.remove(),URL.revokeObjectURL(a),console.log("[downloadcv-v1] Download triggered successfully")}catch(e){console.error("[downloadcv-v1] Fetch failed, using fallback:",e),window.open(this._activeUrl,"_blank","noopener,noreferrer")}}_inferExtFromUrl(e){let n=e.indexOf("?"),r=n>=0?e.slice(0,n):e,i=r.lastIndexOf(".");if(i===-1)return null;let s=r.slice(i+1).toLowerCase();return s.length>5?null:s}render(){let e=!this._activeUrl;return o`
|
|
773
773
|
<ds-button
|
|
774
774
|
variant="primary"
|
|
775
775
|
.disabled=${e}
|
|
@@ -780,12 +780,12 @@ var Ct=!1,Er=["./keys.json","./tekst.json","./tekster.json","./language.json",".
|
|
|
780
780
|
:host {
|
|
781
781
|
display: inline-flex;
|
|
782
782
|
}
|
|
783
|
-
`;customElements.define("downloadcv-v1",he);var
|
|
783
|
+
`;customElements.define("downloadcv-v1",he);var wn="ds-view-mode",xt="text";function K(){if(typeof window>"u")return xt;try{let t=localStorage.getItem(wn);return t==="image"||t==="text"?t:xt}catch{return xt}}function _t(t){if(!(typeof window>"u"))try{localStorage.setItem(wn,t),window.dispatchEvent(new CustomEvent("view-mode-changed",{detail:t}))}catch(e){console.warn("Failed to save view mode:",e)}}function Rs(){let e=K()==="text"?"image":"text";return _t(e),e}var qe=class extends l{static get properties(){return{imgLightDesktop:{type:String,reflect:!0,attribute:"img-light-desktop"},imgDarkDesktop:{type:String,reflect:!0,attribute:"img-dark-desktop"},imgLightMobile:{type:String,reflect:!0,attribute:"img-light-mobile"},imgDarkMobile:{type:String,reflect:!0,attribute:"img-dark-mobile"},src:{type:String,reflect:!0},alt:{type:String,reflect:!0},imageToggle:{type:Boolean,reflect:!0,attribute:"image-toggle"},imageOnlyWidth:{type:Number,reflect:!0,attribute:"image-only-width"},priority:{type:Boolean,reflect:!0},externalToggle:{type:Boolean,reflect:!0,attribute:"external-toggle"},mobileKey:{type:String,reflect:!0,attribute:"mobile-key"},desktopKey:{type:String,reflect:!0,attribute:"desktop-key"},textKey:{type:String,reflect:!0,attribute:"text-key"},defaultValue:{type:String,reflect:!0,attribute:"default-value"},_text:{type:String,state:!0},_currentImage:{type:String,state:!0},_imageVisible:{type:Boolean,state:!0},_shouldAnimate:{type:Boolean,state:!0}}}constructor(){super(),this._toggleImage=()=>{this._shouldAnimate=!0,this._imageVisible=!this._imageVisible,this.requestUpdate()},this._handleImageLoad=e=>{e.target.classList.add("loaded")},this.imgLightDesktop="",this.imgDarkDesktop="",this.imgLightMobile="",this.imgDarkMobile="",this.src="",this.alt="",this.imageToggle=!1,this.imageOnlyWidth=480,this.priority=!1,this.externalToggle=!1,this.mobileKey="",this.desktopKey="",this.textKey="",this.defaultValue="",this._text="",this._currentImage="",this._imageVisible=!0,this._shouldAnimate=!1,this._mql=null,this.boundHandlers={languageChanged:(()=>{this._loadText()}),themeChanged:(()=>{this._resolveImage()}),viewportChanged:e=>{this._resolveImage(),this._loadText()},viewModeChanged:(e=>{if(this.imageToggle&&this.externalToggle){let r=e.detail==="image";this._imageVisible!==r&&(this._shouldAnimate=!0,this._imageVisible=r,this.requestUpdate())}})}}updated(e){if(e.has("imageOnlyWidth")){let n=Number(this.imageOnlyWidth)||480;this.style.setProperty("--image-only-width",`${n}px`)}if((e.has("imgLightDesktop")||e.has("imgDarkDesktop")||e.has("imgLightMobile")||e.has("imgDarkMobile")||e.has("src"))&&this._resolveImage(),(e.has("textKey")||e.has("defaultValue")||e.has("mobileKey")||e.has("desktopKey"))&&this._loadText(),e.has("imageToggle")&&!(this.imageToggle&&this.externalToggle)){let r=!this.imageToggle;this._imageVisible!==r&&(this._shouldAnimate=!0,this._imageVisible=r)}}connectedCallback(){if(super.connectedCallback(),this._loadText(),this._resolveImage(),this.imageToggle&&this.externalToggle){let e=K();this._imageVisible=e==="image"}else this._imageVisible=!this.imageToggle;this.style.setProperty("--image-only-width",`${this.imageOnlyWidth}px`);try{this._mql=window.matchMedia("(max-width: 720px)"),this._mql&&this.boundHandlers.viewportChanged&&this._mql.addEventListener("change",this.boundHandlers.viewportChanged)}catch{}window.addEventListener("language-changed",this.boundHandlers.languageChanged),window.addEventListener("theme-changed",this.boundHandlers.themeChanged),this.imageToggle&&this.externalToggle?(window.addEventListener("view-mode-changed",this.boundHandlers.viewModeChanged),setTimeout(()=>{let n=K()==="image";this._imageVisible!==n&&(this._shouldAnimate=!0,this._imageVisible=n,this.requestUpdate())},100)):this.imageToggle&&window.addEventListener("article-toggle",this._toggleImage)}disconnectedCallback(){if(super.disconnectedCallback(),window.removeEventListener("language-changed",this.boundHandlers.languageChanged),window.removeEventListener("theme-changed",this.boundHandlers.themeChanged),window.removeEventListener("article-toggle",this._toggleImage),window.removeEventListener("view-mode-changed",this.boundHandlers.viewModeChanged),this._mql&&this.boundHandlers.viewportChanged)try{this._mql.removeEventListener("change",this.boundHandlers.viewportChanged)}catch{}}_loadText(){let e=(()=>{try{return window.matchMedia&&window.matchMedia("(max-width: 720px)").matches}catch{return!1}})(),n=(()=>{let r=(this.mobileKey||"").trim(),i=(this.desktopKey||"").trim(),s=(this.textKey||"").trim();return r||i?e?r||s:i||s:s})();if(!n){this._text=this.defaultValue||"";return}try{let r=x(n);this._text=r||this.defaultValue||n}catch(r){console.error(`[article-v1] Error loading text for key "${n}":`,r),this._text=this.defaultValue||n}}_resolveImage(){if(this.src&&typeof this.src=="string"){let i=this.src.startsWith("@")?this.src.slice(1):this.src;this._currentImage=i;return}let e=document.documentElement.getAttribute("data-theme")||"light",n=(()=>{try{return window.matchMedia&&window.matchMedia("(max-width: 720px)").matches}catch{return!1}})(),r="";n?e==="dark"?r=this.imgDarkMobile||this.imgLightMobile:r=this.imgLightMobile||this.imgDarkMobile:e==="dark"?r=this.imgDarkDesktop||this.imgLightDesktop:r=this.imgLightDesktop||this.imgDarkDesktop,typeof r=="string"&&r.startsWith("@")&&(r=r.slice(1)),this._currentImage=r||""}render(){let e=(this.imageToggle?this._imageVisible:!0)&&!!this._currentImage,n=this._shouldAnimate?"fade-in":"";this._shouldAnimate&&(this._shouldAnimate=!1);let r=this._imageVisible?x("hideImage"):x("viewImage");return o`
|
|
784
784
|
<div class="container">
|
|
785
785
|
${this.imageToggle&&!this.externalToggle?o`<button @click="${this._toggleImage}" class="toggle-button">
|
|
786
|
-
${
|
|
786
|
+
${r}
|
|
787
787
|
</button>`:""}
|
|
788
|
-
${e?o`<figure class="media ${
|
|
788
|
+
${e?o`<figure class="media ${n}">
|
|
789
789
|
<img
|
|
790
790
|
src="${this._currentImage}"
|
|
791
791
|
alt="${this.alt||""}"
|
|
@@ -794,7 +794,7 @@ var Ct=!1,Er=["./keys.json","./tekst.json","./tekster.json","./language.json",".
|
|
|
794
794
|
decoding="async"
|
|
795
795
|
@load="${this._handleImageLoad}"
|
|
796
796
|
/>
|
|
797
|
-
</figure>`:o`<p class="copy ${
|
|
797
|
+
</figure>`:o`<p class="copy ${n}">${this._text}</p>`}
|
|
798
798
|
</div>
|
|
799
799
|
`}};qe.styles=c`
|
|
800
800
|
:host {
|
|
@@ -863,17 +863,17 @@ var Ct=!1,Er=["./keys.json","./tekst.json","./tekster.json","./language.json",".
|
|
|
863
863
|
.toggle-button:hover {
|
|
864
864
|
opacity: 0.7;
|
|
865
865
|
}
|
|
866
|
-
`;customElements.define("article-v1",qe);var Fe=class extends l{constructor(){super(),this._toggle=()=>{let e=this._mode==="image"?"text":"image";_t(e)},this._mode=K(),this.boundHandlers={viewModeChanged:(e=>{let
|
|
866
|
+
`;customElements.define("article-v1",qe);var Fe=class extends l{constructor(){super(),this._toggle=()=>{let e=this._mode==="image"?"text":"image";_t(e)},this._mode=K(),this.boundHandlers={viewModeChanged:(e=>{let n=e.detail==="image"?"image":"text";this._mode!==n&&(this._mode=n)}),languageChanged:(()=>{this.requestUpdate()})}}connectedCallback(){super.connectedCallback(),window.addEventListener("view-mode-changed",this.boundHandlers.viewModeChanged),window.addEventListener("language-changed",this.boundHandlers.languageChanged)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("view-mode-changed",this.boundHandlers.viewModeChanged),window.removeEventListener("language-changed",this.boundHandlers.languageChanged)}render(){let e=this._mode==="image"?x("hideImage"):x("viewImage");return o`
|
|
867
867
|
<ds-button variant="primary" @click=${this._toggle}>${e}</ds-button>
|
|
868
|
-
`}};Fe.properties={_mode:{type:String,state:!0}};customElements.define("viewtoggle-v1",Fe);var Ke=class extends l{static get properties(){return{type:{type:String,reflect:!0},shape:{type:String,reflect:!0},href:{type:String},project:{type:String,reflect:!0},loading:{type:Boolean,reflect:!0}}}constructor(){super(),this.type="theme-toggle",this.shape="circle",this.href="",this.project="",this.loading=!1}_handleClick(e){if(this.type==="theme-toggle"){e.preventDefault();let
|
|
868
|
+
`}};Fe.properties={_mode:{type:String,state:!0}};customElements.define("viewtoggle-v1",Fe);var Ke=class extends l{static get properties(){return{type:{type:String,reflect:!0},shape:{type:String,reflect:!0},href:{type:String},project:{type:String,reflect:!0},loading:{type:Boolean,reflect:!0}}}constructor(){super(),this.type="theme-toggle",this.shape="circle",this.href="",this.project="",this.loading=!1}_handleClick(e){if(this.type==="theme-toggle"){e.preventDefault();let n=H.get()==="light"?"dark":"light";Oe(n)}}connectedCallback(){super.connectedCallback(),this.addEventListener("click",e=>{this._handleClick(e)})}render(){let e=o`<div
|
|
869
869
|
class="container"
|
|
870
|
-
@click="${
|
|
870
|
+
@click="${n=>{this._handleClick(n)}}"
|
|
871
871
|
></div>`;return this.type==="link"&&this.href?o`
|
|
872
872
|
<a href="${this.href}" @click="${this._handleClick}">${e}</a>
|
|
873
873
|
`:o`
|
|
874
874
|
<div
|
|
875
875
|
class="wrapper"
|
|
876
|
-
@click="${
|
|
876
|
+
@click="${n=>{this._handleClick(n)}}"
|
|
877
877
|
>
|
|
878
878
|
${e}
|
|
879
879
|
</div>
|
|
@@ -973,8 +973,8 @@ var Ct=!1,Er=["./keys.json","./tekst.json","./tekster.json","./language.json",".
|
|
|
973
973
|
height: calc(var(--1) * var(--scaling-factor));
|
|
974
974
|
gap: calc(var(--025) * var(--scaling-factor));
|
|
975
975
|
}
|
|
976
|
-
`;customElements.define("row-v1",ue);var Je=class extends l{static get properties(){return{type:{type:String,reflect:!0},to:{type:String,reflect:!0}}}constructor(){super(),this.type="work"}render(){let e=this.getNavConfig(),
|
|
977
|
-
<a href="${
|
|
976
|
+
`;customElements.define("row-v1",ue);var Je=class extends l{static get properties(){return{type:{type:String,reflect:!0},to:{type:String,reflect:!0}}}constructor(){super(),this.type="work"}render(){let e=this.getNavConfig(),n=this.to||e.href;return o`
|
|
977
|
+
<a href="${n}">
|
|
978
978
|
<ds-text key="${e.key}"></ds-text>
|
|
979
979
|
<icon-v1 type="right"></icon-v1>
|
|
980
980
|
</a>
|
|
@@ -1053,7 +1053,7 @@ var Ct=!1,Er=["./keys.json","./tekst.json","./tekster.json","./language.json",".
|
|
|
1053
1053
|
${this.showStatus?o`<div class="header-cell">Status</div>`:""}
|
|
1054
1054
|
</div>
|
|
1055
1055
|
<div class="table-body">
|
|
1056
|
-
${this.data.map((e,
|
|
1056
|
+
${this.data.map((e,n)=>o`
|
|
1057
1057
|
<div class="data-cell product-cell">${e.product}</div>
|
|
1058
1058
|
<div class="data-cell users-cell">${e.users}</div>
|
|
1059
1059
|
<div class="data-cell retention-cell">${e.retention}</div>
|
|
@@ -1184,11 +1184,11 @@ var Ct=!1,Er=["./keys.json","./tekst.json","./tekster.json","./language.json",".
|
|
|
1184
1184
|
right: 0;
|
|
1185
1185
|
transform: none;
|
|
1186
1186
|
}
|
|
1187
|
-
`;customElements.define("ds-grid",ge);var fe=class extends l{render(){let e=this.debug||this.mode==="debug",
|
|
1187
|
+
`;customElements.define("ds-grid",ge);var fe=class extends l{render(){let e=this.debug||this.mode==="debug",n=this.mode==="company";return o`
|
|
1188
1188
|
<slot></slot>
|
|
1189
1189
|
${e?o`
|
|
1190
1190
|
<div class="debug-overlay">
|
|
1191
|
-
${
|
|
1191
|
+
${n?o`
|
|
1192
1192
|
<div class="debug-area debug-header">header</div>
|
|
1193
1193
|
<div class="debug-area debug-content">content</div>
|
|
1194
1194
|
<div class="debug-area debug-footer">footer</div>
|
|
@@ -1347,7 +1347,7 @@ var Ct=!1,Er=["./keys.json","./tekst.json","./tekster.json","./language.json",".
|
|
|
1347
1347
|
grid-area: content;
|
|
1348
1348
|
border-color: rgba(71, 231, 71, 0.63);
|
|
1349
1349
|
}
|
|
1350
|
-
`;customElements.define("ds-layout",fe);var $t="ds-scroll-position";function
|
|
1350
|
+
`;customElements.define("ds-layout",fe);var $t="ds-scroll-position";function bn(){if(!(typeof window>"u"))try{let t={x:window.scrollX,y:window.scrollY};sessionStorage.setItem($t,JSON.stringify(t))}catch(t){console.warn("[DS one] Failed to save scroll position:",t)}}function Lr(){if(typeof window>"u")return null;try{let t=sessionStorage.getItem($t);if(!t)return null;let e=JSON.parse(t);return typeof e.x=="number"&&typeof e.y=="number"&&!isNaN(e.x)&&!isNaN(e.y)?e:null}catch(t){return console.warn("[DS one] Failed to retrieve scroll position:",t),null}}function Tr(t={}){if(typeof window>"u")return!1;let e=Lr();if(!e)return!1;try{return requestAnimationFrame(()=>{window.scrollTo({left:e.x,top:e.y,behavior:t.smooth?"smooth":"instant"}),t.clear&&Nr(),window.dispatchEvent(new CustomEvent("scroll-restored",{detail:e}))}),!0}catch(n){return console.warn("[DS one] Failed to restore scroll position:",n),!1}}function Nr(){if(!(typeof window>"u"))try{sessionStorage.removeItem($t)}catch(t){console.warn("[DS one] Failed to clear scroll position:",t)}}function Ir(t={}){if(typeof window>"u")return;let{autoSave:e=!0,autoRestore:n=!0,smooth:r=!1,clearOnRestore:i=!1}=t;if(e&&(window.addEventListener("beforeunload",()=>{bn()}),window.addEventListener("pagehide",()=>{bn()})),n){let s=()=>{Tr({smooth:r,clear:i})};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",s):s()}}typeof window<"u"&&Ir({autoSave:!0,autoRestore:!0,smooth:!1,clearOnRestore:!1});export{qe as Article,Be as Attributes,re as Button,Pe as Cycle,Ye as DoubleNav,he as DownloadCV,pe as DsTable,ge as Grid,ze as Header,de as Home,B as Icon,fe as Layout,Ae as Link,Ge as List,Ze as Panel,Ue as Price,ue as Row,Je as SingleNav,Ke as SquareCircle,ke as Text,We as Title,ce as Tooltip,Fe as ViewToggle,je as Year,Nr as clearScrollPosition,$ as currentLanguage,H as currentTheme,Ln as detectMobileDevice,ri as getAvailableLanguages,at as getAvailableLanguagesSync,Xn as getBrowserLanguage,Tn as getDeviceInfo,nn as getLanguageDisplayName,rn as getNotionText,yn as getPriceLabel,Lr as getScrollPosition,x as getText,K as getViewMode,ti as hasTranslation,Ct as initDeviceDetection,Ir as initScrollManagement,ii as loadTranslations,Tr as restoreScrollPosition,bn as saveScrollPosition,j as saveSettings,lt as setLanguage,ni as setNotionText,Oe as setTheme,_t as setViewMode,Rs as toggleViewMode,E as translate};
|
|
1351
1351
|
/*! Bundled license information:
|
|
1352
1352
|
|
|
1353
1353
|
@lit/reactive-element/css-tag.js:
|