hypnagaga/docs/assets/Theme-acca2adb.js
Prasanta Kumar Dutta 5e0df3456a build
2023-09-16 17:19:48 +05:30

3 lines
2.8 KiB
JavaScript

import{S as j,i as w,s as v,u as O,l as p,h as f,j as d,b as A,k as T,v as B,w as C,x as S,t as K,a as V,f as q}from"./index-2c1648fc.js";import{l as z,d as E}from"./light-59dc4e88.js";function P(e){return e&&e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}const b=e=>e.replace(/[^a-z0-9-]/gi,"");function x(e){const s="-",n={};function t(c,o,i=1){Object.keys(c).forEach(function(a){const l=c[a],r=Array.isArray(l),u=Object.prototype.toString.call(l),g=P(l),k=u==="[object Object]"||u==="[object Array]",h=o?o+s+b(a):b(a);if(!r&&!g&&k&&Object.keys(l).length)return t(l,h,i+1);n[h]=l})}return t(e),n}function y(e){return e&&typeof e=="object"&&!Array.isArray(e)}function m(e,...s){if(!s.length)return e;const n=s.shift();if(y(e)&&y(n))for(const t in n)y(n[t])?(e[t]||Object.assign(e,{[t]:{}}),m(e[t],n[t])):Object.assign(e,{[t]:n[t]});return m(e,...s)}function D(e){let s,n,t;const c=e[5].default,o=O(c,e,e[4],null);return{c(){s=p("div"),n=p("div"),o&&o.c(),f(n,"class","theme-client-override"),d(n,"display","contents"),f(s,"class","theme"),f(s,"style",e[0]),d(s,"display","contents")},m(i,a){A(i,s,a),T(s,n),o&&o.m(n,null),t=!0},p(i,[a]){o&&o.p&&(!t||a&16)&&B(o,c,i,i[4],t?S(c,i[4],a,null):C(i[4]),null),(!t||a&1)&&f(s,"style",i[0]),a&1&&d(s,"display","contents")},i(i){t||(K(o,i),t=!0)},o(i){V(o,i),t=!1},d(i){i&&q(s),o&&o.d(i)}}}const _={light:z,dark:E};function F(e,s,n){let t,c,{$$slots:o={},$$scope:i}=s,{theme:a={}}=s,{base:l="light"}=s;return e.$$set=r=>{"theme"in r&&n(1,a=r.theme),"base"in r&&n(2,l=r.base),"$$scope"in r&&n(4,i=r.$$scope)},e.$$.update=()=>{e.$$.dirty&6&&n(3,t=m({},_[l]||_.light,a)),e.$$.dirty&8&&n(0,c=Object.entries(x({theme:t})).map(([r,u])=>`--${r}: ${u};`).join(" "))},[c,a,l,t,i,o]}class G extends j{constructor(s){super(),w(this,s,F,D,v,{theme:1,base:2})}}G.__docgen={version:3,name:"Theme.svelte",data:[{keywords:[{name:"type",description:"{{ light, dark }}"}],visibility:"public",description:"Pre-made themes you can import.",name:"themes",kind:"const",static:!0,readonly:!0,type:{kind:"type",text:"{ light, dark }",type:"{ light, dark }"}},{keywords:[],visibility:"public",description:`Custom theme object. Can be a partial theme with just
what you want to change.`,name:"theme",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"object",type:"object"}},{keywords:[],visibility:"public",description:"Base theme is one of `light` or `dark` and will be merged\nwith your custom theme to fill in any values you don't\nexplicitly set.",name:"base",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"},defaultValue:"light"}],computed:[],methods:[],components:[],description:null,keywords:[],events:[],slots:[{keywords:[],visibility:"public",description:"Themed content",name:"default"}],refs:[]};export{G as T,_ as t};
//# sourceMappingURL=Theme-acca2adb.js.map