commit 5bd53c1e51a1a65168b356b8ea7709c330eaf231 Author: 浪子 Date: Sat May 16 14:47:05 2026 +0800 初始版本 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5c44471 --- /dev/null +++ b/.gitignore @@ -0,0 +1,12 @@ +node_modules/ +dist/ +.astro/ +.env +.env.* +!.env.example +npm-debug.log* +yarn-debug.log* +yarn-error.log* +.DS_Store +Thumbs.db +.claude diff --git a/README.md b/README.md new file mode 100644 index 0000000..dbae4b4 --- /dev/null +++ b/README.md @@ -0,0 +1,169 @@ +# Asky for Astro + +把原 WordPress 主题 [Asky](https://github.com/saresam/Asky) 移植到 [Astro](https://astro.build/),保留 100% 原始视觉样式,并提供一个独立的 TypeScript 配置文件 `asky.config.ts` 同步原主题的所有设置项。 + +> 作者署名:原 WP 主题来自 keith / 路易 / Fuzzz / saresam,Astro 移植版本仅做框架适配,样式 0 改动。 + +--- + +## 目录结构 + +``` +asky/ +├── asky.config.ts ← 主题配置(核心:所有 WP 选项都在这) +├── astro.config.mjs ← Astro 框架配置 +├── package.json +├── tsconfig.json +├── public/ ← 原主题资源(一字未改) +│ ├── style.css ← 原 WP 主题 style.css 直接拷贝 +│ ├── images/ ← 原主题 images/ +│ ├── inc/ ← 原主题 inc/(字体 / iconfont 等) +│ └── js/ ← 原主题 js/(jQuery / app.js / 进度条等) +└── src/ + ├── lib/ + │ └── options.ts ← akinaOption() 等价的取值函数 + ├── layouts/ + │ └── BaseLayout.astro + ├── components/ ← Header / Footer / Imgbox / Feature / 等 + ├── content/ + │ ├── config.ts ← 内容集合定义 + │ └── posts/ ← Markdown 文章 + └── pages/ + ├── index.astro + ├── posts/[slug].astro + ├── 404.astro + ├── search.astro + └── archive.astro +``` + +--- + +## 安装与运行 + +```bash +npm install +npm run dev # 启动开发服务器 http://localhost:4321 +npm run build # 构建到 dist/ +npm run preview # 本地预览构建结果 +``` + +--- + +## 同步原 WordPress 主题设置 + +打开 `asky.config.ts`,里面的字段名与原 `options.php` 中每一项的 `id` **完全一致**,因此把 WP 后台「主题选项」里的值原样填到这里即可: + +| 原 WP 选项 | asky.config.ts 字段 | 默认值 | +|---|---|---| +| 主题风格颜色 | `theme_skin` | `#FE9600` | +| 个人头像 | `focus_logo` | `/images/avatar.jpg` | +| 博主描述 | `admin_des` | `我们的征途是是星辰大海` | +| 首页文章风格 | `post_list_style` | `imageflow` | +| 分页模式 | `pagenav_style` | `ajax` | +| 自动加载下一页 | `auto_load_post` | `3600` | +| 公告 | `head_notice` / `notice_title` | `false` / `欢迎来到我的小站` | +| 背景图 API | `bgapi` | `https://www.loliapi.com/acg/` | +| 背景图 1~5 | `focus_img_1` ~ `focus_img_5` | `''` | +| 波浪动画 | `waveloop` | `false` | +| 聚焦图 1~3 | `feature1_img/title/link` ... | `/images/temp.jpg` | +| 社交(微博/QQ/GitHub …) | `sina` / `qq` / `github` ... | `''` | +| 蜂窝动效 | `canvas_nest` | `false` | +| 跳动小鱼动效 | `flying_fish` | `false` | + +完整字段列表见 `asky.config.ts` 的 `AskyConfig` 接口。 + +### 在组件 / 页面中使用 + +```astro +--- +import { askyOption, isOptionOn, bloginfo } from '~/lib/options'; + +const skin = askyOption('theme_skin'); +const showLike = askyOption('post_like') === 'yes'; +const showFish = isOptionOn('flying_fish'); +const siteName = bloginfo('name'); +--- +``` + +`askyOption(id, fallback)` 等价于原主题里的 PHP 函数 `akina_option($id, $fallback)`; +`isOptionOn(id)` 用来判断 checkbox 类型(`true`/`'1'`/`1` 都视作开启)。 + +--- + +## 关于样式 + +- `public/style.css` 是从 `F:/Download/Asky/style.css` **原样**拷贝(128 KB / 5958 行); +- 所有图片、字体、图标都在 `public/images/`、`public/inc/fonts/`,路径与原 WP 主题保持一致; +- 因此 CSS 中相对路径(如 `url(images/earth.jpg)`、`url('inc/fonts/iconfont.woff2')`)无需修改即可正常解析; +- 主题色通过 `theme_skin` 注入 CSS 变量 `--theme-skin`,不会覆写 `style.css`。 + +如果想做局部调整,请使用 `asky.config.ts` 中的 `site_custom_style`: + +```ts +site_custom_style: ` + .site-header { background: rgba(0,0,0,.3); } +` +``` + +--- + +## 写文章 + +在 `src/content/posts/` 中新建 `.md`: + +```markdown +--- +title: "我的新文章" +date: 2026-05-20 +description: "副标题 / 摘要" +thumbnail: "/images/foo.jpg" +sticky: false +tags: ["Astro"] +categories: ["默认分类"] +author: "Admin" +--- + +正文 Markdown ... +``` + +--- + +## 评论系统(Twikoo) + +评论使用 [Twikoo](https://twikoo.js.org/) 作为后端,前端**不引入官方 UI / CSS**,而是直接 `fetch` 调用云函数,列表项 HTML 结构与原 WP 主题 `akina_comment_format` 完全一致——主题原本的 `.comment-arrow / .main.shadow / .commeta / .body / .arrow-left` 等 CSS 全部命中。 + +### 启用步骤 + +1. 按 [Twikoo 文档](https://twikoo.js.org/quick-start.html) 部署一份云函数(推荐 Vercel 或 CloudBase,免费)。 +2. 把得到的部署 URL 填到 `asky.config.ts`: + + ```ts + twikoo: { + envId: 'https://your-app.vercel.app/', // 云函数地址 + region: '', // 仅腾讯云填 'ap-shanghai' + avatarUrl: 'https://cravatar.cn/avatar/', + showUa: true // 显示 UA 图标(OS / 浏览器) + } + ``` + +3. 留空 `envId` 时评论区显示「请在 asky.config.ts 中配置 twikoo.envId」。 + +### 已支持 + +- 加载评论列表(含嵌套回复) +- 提交评论 / 回复 +- 点赞 / 取消点赞 +- UA 图标(复用 `/images/ua/*.png`) +- 实时更新「欢迎回来 XXX」的欢迎语 + +--- + +## 路线图(未实现的动态功能) + +下面这些是原 WP 主题的运行时动态特性,移植版只保留了 HTML 结构与 CSS,需要按需自行接入后端: + +- AJAX 分页 / Pjax 局部刷新 +- 文章点赞计数(原本基于 `$_COOKIE` + WP meta) +- 搜索结果由 WP 数据库查询,这里暂用纯前端过滤 + +视觉上、布局上、交互动画上则与原主题完全一致。 diff --git a/asky.config.ts b/asky.config.ts new file mode 100644 index 0000000..66c35c6 --- /dev/null +++ b/asky.config.ts @@ -0,0 +1,473 @@ +/** + * Asky 主题配置文件 + * ------------------------------------------------------------------ + * 本文件等同于原 WordPress 主题 options.php 中的所有可配置项。 + * 每个字段的 key 与原主题的 option id 完全一致, + * 因此在原 WP 后台「主题选项」里看到的设置项都可以在这里同步。 + * + * 在 .astro / .ts 文件中使用: + * import { askyOption } from '~/lib/options'; + * askyOption('admin_des'); + * 也支持 : + * import config from '@config'; + * config.admin_des; + * + * 文件结构:上半部分 = 实际设置项(直接编辑这里), + * 下半部分 = AskyConfig 类型定义(一般无需修改)。 + * ------------------------------------------------------------------ + */ + +const config: AskyConfig = { + /* ===== 站点基本信息 ===== */ + site: { + name: 'Asky', + // 站点名称(对应 WP `name`) + + description: '我们的征途是星辰大海', + // 站点描述(对应 WP `description`) + + url: 'https://example.com', + // 站点 URL(对应 WP `url`) + + language: 'zh-CN', + // 站点语言 + + charset: 'UTF-8', + // 字符集 + + menu: [ + { label: '首页', url: '/' }, + { label: '归档', url: '/archive' }, + { label: '关于', url: '/about' } + ] + // 主导航菜单(对应原 wp_nav_menu 'primary' 位置) + }, + + /* ===== 基本设置 ===== */ + theme_skin: '#FE9600', + // 主题风格颜色 + + akina_logo: '', + // Logo 图片 URL,最佳尺寸 242*150 + + akina_meta: false, + // 是否启用自定义关键词与描述 + + akina_meta_keywords: '', + // 网站关键词(半角逗号分隔,建议 5 个以内) + + akina_meta_description: '', + // 网站描述(建议 120 字以内) + + shownav: false, + // 是否默认展开导航菜单(false=收缩,true=展开) + + patternimg: false, + // 文章/独立页面/分类页是否显示头部装饰图 + + top_search: 'yes', + // 顶部搜索按钮 'yes' | 'no' + + post_list_style: 'imageflow', + // 首页文章风格:'standard'=标准,'imageflow'=图文 + + list_type: 'round', + // 首页文章特色图样式:'round'=圆角,'square'=直角 + + pagenav_style: 'ajax', + // 分页模式:'ajax'=ajax 加载,'np'=上一页/下一页 + + auto_load_post: '3600', + // 自动加载下一页延时(秒),'3600' 表示不自动加载 + + admin_des: '我们的征途是是星辰大海', + // 博主描述(一段自我介绍的话) + + footer_info: '© 2025', + // 页脚版权信息,支持 HTML + + site_custom_style: '', + // 自定义 CSS 样式(无需写 \ No newline at end of file diff --git a/public/images/cd-arrow.svg b/public/images/cd-arrow.svg new file mode 100644 index 0000000..eb8f50b --- /dev/null +++ b/public/images/cd-arrow.svg @@ -0,0 +1,20 @@ + + + + +Imported Layers +Created with Sketch. + + + + + + + + + + + + diff --git a/public/images/earth.jpg b/public/images/earth.jpg new file mode 100644 index 0000000..75e67ea Binary files /dev/null and b/public/images/earth.jpg differ diff --git a/public/images/f-logo.png b/public/images/f-logo.png new file mode 100644 index 0000000..c612bb0 Binary files /dev/null and b/public/images/f-logo.png differ diff --git a/public/images/favicon.ico b/public/images/favicon.ico new file mode 100644 index 0000000..7a363dc Binary files /dev/null and b/public/images/favicon.ico differ diff --git a/public/images/gotop.png b/public/images/gotop.png new file mode 100644 index 0000000..33f5086 Binary files /dev/null and b/public/images/gotop.png differ diff --git a/public/images/gowest/allmen.png b/public/images/gowest/allmen.png new file mode 100644 index 0000000..ac09e88 Binary files /dev/null and b/public/images/gowest/allmen.png differ diff --git a/public/images/gowest/road.jpg b/public/images/gowest/road.jpg new file mode 100644 index 0000000..56e7361 Binary files /dev/null and b/public/images/gowest/road.jpg differ diff --git a/public/images/grid.png b/public/images/grid.png new file mode 100644 index 0000000..6f157b7 Binary files /dev/null and b/public/images/grid.png differ diff --git a/public/images/hd.jpg b/public/images/hd.jpg new file mode 100644 index 0000000..fc94118 Binary files /dev/null and b/public/images/hd.jpg differ diff --git a/public/images/icons.png b/public/images/icons.png new file mode 100644 index 0000000..d613540 Binary files /dev/null and b/public/images/icons.png differ diff --git a/public/images/login.png b/public/images/login.png new file mode 100644 index 0000000..1bf80fa Binary files /dev/null and b/public/images/login.png differ diff --git a/public/images/login_loading.gif b/public/images/login_loading.gif new file mode 100644 index 0000000..b6bc6d0 Binary files /dev/null and b/public/images/login_loading.gif differ diff --git a/public/images/none.png b/public/images/none.png new file mode 100644 index 0000000..4d025ee Binary files /dev/null and b/public/images/none.png differ diff --git a/public/images/postload.gif b/public/images/postload.gif new file mode 100644 index 0000000..f81db0b Binary files /dev/null and b/public/images/postload.gif differ diff --git a/public/images/random/random.jpg b/public/images/random/random.jpg new file mode 100644 index 0000000..a18de10 Binary files /dev/null and b/public/images/random/random.jpg differ diff --git a/public/images/rocket.png b/public/images/rocket.png new file mode 100644 index 0000000..f5a872f Binary files /dev/null and b/public/images/rocket.png differ diff --git a/public/images/smilies/icon_arrow.gif b/public/images/smilies/icon_arrow.gif new file mode 100644 index 0000000..26e3cdd Binary files /dev/null and b/public/images/smilies/icon_arrow.gif differ diff --git a/public/images/smilies/icon_biggrin.gif b/public/images/smilies/icon_biggrin.gif new file mode 100644 index 0000000..6c138ff Binary files /dev/null and b/public/images/smilies/icon_biggrin.gif differ diff --git a/public/images/smilies/icon_confused.gif b/public/images/smilies/icon_confused.gif new file mode 100644 index 0000000..e26ec42 Binary files /dev/null and b/public/images/smilies/icon_confused.gif differ diff --git a/public/images/smilies/icon_cool.gif b/public/images/smilies/icon_cool.gif new file mode 100644 index 0000000..b2ec990 Binary files /dev/null and b/public/images/smilies/icon_cool.gif differ diff --git a/public/images/smilies/icon_cry.gif b/public/images/smilies/icon_cry.gif new file mode 100644 index 0000000..f39c938 Binary files /dev/null and b/public/images/smilies/icon_cry.gif differ diff --git a/public/images/smilies/icon_eek.gif b/public/images/smilies/icon_eek.gif new file mode 100644 index 0000000..0956f5e Binary files /dev/null and b/public/images/smilies/icon_eek.gif differ diff --git a/public/images/smilies/icon_evil.gif b/public/images/smilies/icon_evil.gif new file mode 100644 index 0000000..c138adb Binary files /dev/null and b/public/images/smilies/icon_evil.gif differ diff --git a/public/images/smilies/icon_exclaim.gif b/public/images/smilies/icon_exclaim.gif new file mode 100644 index 0000000..0197acf Binary files /dev/null and b/public/images/smilies/icon_exclaim.gif differ diff --git a/public/images/smilies/icon_idea.gif b/public/images/smilies/icon_idea.gif new file mode 100644 index 0000000..8ee76a2 Binary files /dev/null and b/public/images/smilies/icon_idea.gif differ diff --git a/public/images/smilies/icon_lol.gif b/public/images/smilies/icon_lol.gif new file mode 100644 index 0000000..6507f4e Binary files /dev/null and b/public/images/smilies/icon_lol.gif differ diff --git a/public/images/smilies/icon_mad.gif b/public/images/smilies/icon_mad.gif new file mode 100644 index 0000000..5568d0e Binary files /dev/null and b/public/images/smilies/icon_mad.gif differ diff --git a/public/images/smilies/icon_mrgreen.gif b/public/images/smilies/icon_mrgreen.gif new file mode 100644 index 0000000..88fc13c Binary files /dev/null and b/public/images/smilies/icon_mrgreen.gif differ diff --git a/public/images/smilies/icon_neutral.gif b/public/images/smilies/icon_neutral.gif new file mode 100644 index 0000000..44bc6f4 Binary files /dev/null and b/public/images/smilies/icon_neutral.gif differ diff --git a/public/images/smilies/icon_question.gif b/public/images/smilies/icon_question.gif new file mode 100644 index 0000000..31332f1 Binary files /dev/null and b/public/images/smilies/icon_question.gif differ diff --git a/public/images/smilies/icon_razz.gif b/public/images/smilies/icon_razz.gif new file mode 100644 index 0000000..a035adb Binary files /dev/null and b/public/images/smilies/icon_razz.gif differ diff --git a/public/images/smilies/icon_redface.gif b/public/images/smilies/icon_redface.gif new file mode 100644 index 0000000..855413f Binary files /dev/null and b/public/images/smilies/icon_redface.gif differ diff --git a/public/images/smilies/icon_rolleyes.gif b/public/images/smilies/icon_rolleyes.gif new file mode 100644 index 0000000..5de853b Binary files /dev/null and b/public/images/smilies/icon_rolleyes.gif differ diff --git a/public/images/smilies/icon_sad.gif b/public/images/smilies/icon_sad.gif new file mode 100644 index 0000000..04e52d0 Binary files /dev/null and b/public/images/smilies/icon_sad.gif differ diff --git a/public/images/smilies/icon_smile.gif b/public/images/smilies/icon_smile.gif new file mode 100644 index 0000000..d32f40d Binary files /dev/null and b/public/images/smilies/icon_smile.gif differ diff --git a/public/images/smilies/icon_surprised.gif b/public/images/smilies/icon_surprised.gif new file mode 100644 index 0000000..6c7eced Binary files /dev/null and b/public/images/smilies/icon_surprised.gif differ diff --git a/public/images/smilies/icon_twisted.gif b/public/images/smilies/icon_twisted.gif new file mode 100644 index 0000000..733a492 Binary files /dev/null and b/public/images/smilies/icon_twisted.gif differ diff --git a/public/images/smilies/icon_wink.gif b/public/images/smilies/icon_wink.gif new file mode 100644 index 0000000..154ccb2 Binary files /dev/null and b/public/images/smilies/icon_wink.gif differ diff --git a/public/images/social_icon.png b/public/images/social_icon.png new file mode 100644 index 0000000..f442246 Binary files /dev/null and b/public/images/social_icon.png differ diff --git a/public/images/temp.jpg b/public/images/temp.jpg new file mode 100644 index 0000000..bbd12f2 Binary files /dev/null and b/public/images/temp.jpg differ diff --git a/public/images/ua/360se.png b/public/images/ua/360se.png new file mode 100644 index 0000000..ac54c2a Binary files /dev/null and b/public/images/ua/360se.png differ diff --git a/public/images/ua/android.png b/public/images/ua/android.png new file mode 100644 index 0000000..4588c70 Binary files /dev/null and b/public/images/ua/android.png differ diff --git a/public/images/ua/chrome.png b/public/images/ua/chrome.png new file mode 100644 index 0000000..d8303c0 Binary files /dev/null and b/public/images/ua/chrome.png differ diff --git a/public/images/ua/chromium.png b/public/images/ua/chromium.png new file mode 100644 index 0000000..1475fb1 Binary files /dev/null and b/public/images/ua/chromium.png differ diff --git a/public/images/ua/crios.png b/public/images/ua/crios.png new file mode 100644 index 0000000..254bb89 Binary files /dev/null and b/public/images/ua/crios.png differ diff --git a/public/images/ua/debian.png b/public/images/ua/debian.png new file mode 100644 index 0000000..2e5413b Binary files /dev/null and b/public/images/ua/debian.png differ diff --git a/public/images/ua/edge.png b/public/images/ua/edge.png new file mode 100644 index 0000000..cb5a59a Binary files /dev/null and b/public/images/ua/edge.png differ diff --git a/public/images/ua/fedora.png b/public/images/ua/fedora.png new file mode 100644 index 0000000..f1d4593 Binary files /dev/null and b/public/images/ua/fedora.png differ diff --git a/public/images/ua/firefox.png b/public/images/ua/firefox.png new file mode 100644 index 0000000..b52962c Binary files /dev/null and b/public/images/ua/firefox.png differ diff --git a/public/images/ua/ie.png b/public/images/ua/ie.png new file mode 100644 index 0000000..8bc9612 Binary files /dev/null and b/public/images/ua/ie.png differ diff --git a/public/images/ua/ie10.png b/public/images/ua/ie10.png new file mode 100644 index 0000000..8bc9612 Binary files /dev/null and b/public/images/ua/ie10.png differ diff --git a/public/images/ua/ie11.png b/public/images/ua/ie11.png new file mode 100644 index 0000000..8bc9612 Binary files /dev/null and b/public/images/ua/ie11.png differ diff --git a/public/images/ua/ie8.png b/public/images/ua/ie8.png new file mode 100644 index 0000000..8bc9612 Binary files /dev/null and b/public/images/ua/ie8.png differ diff --git a/public/images/ua/ie9.png b/public/images/ua/ie9.png new file mode 100644 index 0000000..8bc9612 Binary files /dev/null and b/public/images/ua/ie9.png differ diff --git a/public/images/ua/ipad.png b/public/images/ua/ipad.png new file mode 100644 index 0000000..603569f Binary files /dev/null and b/public/images/ua/ipad.png differ diff --git a/public/images/ua/iphone.png b/public/images/ua/iphone.png new file mode 100644 index 0000000..42777d0 Binary files /dev/null and b/public/images/ua/iphone.png differ diff --git a/public/images/ua/linux.png b/public/images/ua/linux.png new file mode 100644 index 0000000..e3b99d2 Binary files /dev/null and b/public/images/ua/linux.png differ diff --git a/public/images/ua/macos.png b/public/images/ua/macos.png new file mode 100644 index 0000000..c4f2ae9 Binary files /dev/null and b/public/images/ua/macos.png differ diff --git a/public/images/ua/maxthon.png b/public/images/ua/maxthon.png new file mode 100644 index 0000000..e50834b Binary files /dev/null and b/public/images/ua/maxthon.png differ diff --git a/public/images/ua/opera.png b/public/images/ua/opera.png new file mode 100644 index 0000000..ebfd1eb Binary files /dev/null and b/public/images/ua/opera.png differ diff --git a/public/images/ua/opera15.png b/public/images/ua/opera15.png new file mode 100644 index 0000000..2338243 Binary files /dev/null and b/public/images/ua/opera15.png differ diff --git a/public/images/ua/safari.png b/public/images/ua/safari.png new file mode 100644 index 0000000..ded5948 Binary files /dev/null and b/public/images/ua/safari.png differ diff --git a/public/images/ua/sogou.png b/public/images/ua/sogou.png new file mode 100644 index 0000000..633ddcd Binary files /dev/null and b/public/images/ua/sogou.png differ diff --git a/public/images/ua/ubuntu.png b/public/images/ua/ubuntu.png new file mode 100644 index 0000000..c3d401f Binary files /dev/null and b/public/images/ua/ubuntu.png differ diff --git a/public/images/ua/ucweb.png b/public/images/ua/ucweb.png new file mode 100644 index 0000000..d56fc4c Binary files /dev/null and b/public/images/ua/ucweb.png differ diff --git a/public/images/ua/unknow.png b/public/images/ua/unknow.png new file mode 100644 index 0000000..99fa1e7 Binary files /dev/null and b/public/images/ua/unknow.png differ diff --git a/public/images/ua/windows.png b/public/images/ua/windows.png new file mode 100644 index 0000000..961088c Binary files /dev/null and b/public/images/ua/windows.png differ diff --git a/public/images/ua/windows_phone.png b/public/images/ua/windows_phone.png new file mode 100644 index 0000000..984c0c5 Binary files /dev/null and b/public/images/ua/windows_phone.png differ diff --git a/public/images/ua/windows_vista.png b/public/images/ua/windows_vista.png new file mode 100644 index 0000000..961088c Binary files /dev/null and b/public/images/ua/windows_vista.png differ diff --git a/public/images/ua/windows_win10.png b/public/images/ua/windows_win10.png new file mode 100644 index 0000000..984c0c5 Binary files /dev/null and b/public/images/ua/windows_win10.png differ diff --git a/public/images/ua/windows_win7.png b/public/images/ua/windows_win7.png new file mode 100644 index 0000000..2bcb690 Binary files /dev/null and b/public/images/ua/windows_win7.png differ diff --git a/public/images/ua/windows_win8.png b/public/images/ua/windows_win8.png new file mode 100644 index 0000000..c4bbb2f Binary files /dev/null and b/public/images/ua/windows_win8.png differ diff --git a/public/images/ua/wordpress.png b/public/images/ua/wordpress.png new file mode 100644 index 0000000..2ca6040 Binary files /dev/null and b/public/images/ua/wordpress.png differ diff --git a/public/images/wave1.png b/public/images/wave1.png new file mode 100644 index 0000000..106831b Binary files /dev/null and b/public/images/wave1.png differ diff --git a/public/images/wave2.png b/public/images/wave2.png new file mode 100644 index 0000000..52a0922 Binary files /dev/null and b/public/images/wave2.png differ diff --git a/public/inc/css/admin.css b/public/inc/css/admin.css new file mode 100644 index 0000000..c300988 --- /dev/null +++ b/public/inc/css/admin.css @@ -0,0 +1,46 @@ +.theme-about { + background: #fff; + max-width:860px; + margin: 0 auto; + box-shadow: 0 2px 6px rgba(0,0,0,.04); + border: 1px solid #ddd; + margin-top:50px +} +.fu-info { + padding:20px 40px +} +.fu-info p { + line-height: 30px; + font-size: 15px; + color: #797979; + letter-spacing: 2px; +} + +.fu-she { + text-align: center; + margin-bottom: 30px; + display: inline-block; + width: 100%; + padding:20px 0 +} +.fu-she span { + margin-right:15px +} +.akina img { + width: 50px; +} +.fufooter-info { + height: 70px; + background: #384152; + margin-top:20px +} +span.copyright-fu { + width: 100%; + display: inline-block; + padding: 25px 0; + text-align: center; + color: white; +} +.fufooter-info a{ + color:#fff +} \ No newline at end of file diff --git a/public/inc/css/color-picker.min.css b/public/inc/css/color-picker.min.css new file mode 100644 index 0000000..337f2ed --- /dev/null +++ b/public/inc/css/color-picker.min.css @@ -0,0 +1 @@ +.wp-color-picker{width:80px}.wp-picker-container .hidden{display:none}.wp-color-result{background-color:#f9f9f9;border:1px solid #bbb;border-radius:2px;cursor:pointer;display:inline-block;height:22px;margin:0 6px 6px 0;position:relative;top:1px;user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;vertical-align:bottom;display:inline-block;padding-left:30px}.wp-color-result:after{background:#f3f3f3;background-image:-webkit-gradient(linear,left top,left bottom,from(#fefefe),to(#f4f4f4));background-image:-webkit-linear-gradient(top,#fefefe,#f4f4f4);background-image:-moz-linear-gradient(top,#fefefe,#f4f4f4);background-image:-o-linear-gradient(top,#fefefe,#f4f4f4);background-image:linear-gradient(to bottom,#fefefe,#f4f4f4);color:#333;text-shadow:0 1px 0 #fff;border-radius:0 1px 1px 0;border-left:1px solid #bbb;content:attr(title);display:block;font-size:11px;line-height:22px;padding:0 6px;position:relative;right:0;text-align:center;top:0}.wp-color-result:hover{border-color:#aaa;box-shadow:0 1px 1px rgba(0,0,0,0.1);-moz-box-shadow:0 1px 1px rgba(0,0,0,0.1);-ms-box-shadow:0 1px 1px rgba(0,0,0,0.1);-o-box-shadow:0 1px 1px rgba(0,0,0,0.1);-webkit-box-shadow:0 1px 1px rgba(0,0,0,0.1)}.wp-color-result:hover:after{color:#222;border-color:#aaa;border-left:1px solid #999}.wp-color-result.wp-picker-open{top:0}.wp-color-result.wp-picker-open:after{content:attr(data-current)}.wp-picker-container,.wp-picker-container:active{display:inline-block;outline:0}.wp-color-result:focus{border-color:#888;-moz-box-shadow:0 1px 2px rgba(0,0,0,0.2);-ms-box-shadow:0 1px 2px rgba(0,0,0,0.2);-o-box-shadow:0 1px 2px rgba(0,0,0,0.2);-webkit-box-shadow:0 1px 2px rgba(0,0,0,0.2);box-shadow:0 1px 2px rgba(0,0,0,0.2)}.wp-color-result:focus:after{border-color:#888}.wp-picker-open+.wp-picker-input-wrap{display:inline-block;vertical-align:top}.wp-picker-container .button{margin-left:6px}.wp-picker-container .iris-square-slider .ui-slider-handle:focus{background-color:#555}.wp-picker-container .iris-picker{border-color:#dfdfdf;margin-top:6px}input[type="text"].iris-error{background-color:#ffebe8;border-color:#c00;color:#000} \ No newline at end of file diff --git a/public/inc/css/optionsframework.css b/public/inc/css/optionsframework.css new file mode 100644 index 0000000..6f03141 --- /dev/null +++ b/public/inc/css/optionsframework.css @@ -0,0 +1,459 @@ +/* Options Framework Admin Styles */ + +body { + font-family:miranafont,"Hiragino Sans GB",STXihei,"Microsoft YaHei",SimSun,sans-serif; + background:#F5F5F5 ; + height: auto; +} + +.nav-tab-wrapper { + position: relative; + max-width: 1000px; + margin: auto !important; +} + +.wrap h2.nav-tab-wrapper { + border-bottom:none +} + +.metabox-holder { + padding-top:0 !important +} + +.nav-tab-active { + border-bottom: none; + background: #fff; + color: #000; + border:none; + font-weight: 300; + font-size: 18px; + color: #4B6894; +} + +.nav-tab-active:hover { + background: #fff; +} + +.nav-tab { + background: none; + border:none; + padding: 10px 20px; + font-weight: 300; + font-size: 15px; + color: darkgoldenrod; + border-radius: 3px 3px 0 0; +} + +.nav-tab-active { + background:#fff +} + +a#options-group-1-tab:before { + font-family: "dashicons"; + content: "\f111"; + float: left; +} + +a#options-group-2-tab:before { + font-family: "dashicons"; + content: "\f102"; + float: left; +} + +a#options-group-3-tab:before { + font-family: "dashicons"; + content: "\f123"; + float: left; +} + +a#options-group-4-tab:before { + font-family: "dashicons"; + content: "\f487"; + float: left; +} + +a#options-group-5-tab:before { + font-family: "dashicons"; + content: "\f227"; + float: left; +} + +a#options-group-6-tab:before { + font-family: "dashicons"; + content: "\f105"; + float: left; +} + +a#options-group-7-tab:before { + font-family: "dashicons"; + content: "\f110"; + float: left; +} + +a#options-group-8-tab:before { + font-family: "dashicons"; + content: "\f109"; + float: left; +} + +a#options-group-10-tab:before { + font-family: "dashicons"; + content: "\f112"; + float: left; +} + + +input[type=checkbox], input[type=radio] { + border: 1px solid #b4b9be; + background: #fff; + color: #555; + clear: none; + cursor: pointer; + display: inline-block; + line-height: 0; + height: 16px; + margin: -4px 4px 0 0; + outline: none; + padding: 0!important; + text-align: center; + vertical-align: middle; + width: 16px; + min-width: 16px; + box-shadow: none +} + +input[type="button"]{ + box-shadow: none !important; + border: none !important; + background:#FF5858 !important; + color:#fff !important +} + +input[type=text], +input[type=password], +input[type=checkbox], +input[type=color], +input[type=date], +input[type=datetime], +input[type=datetime-local], +input[type=email], +input[type=month], +input[type=number], +input[type=radio], +input[type=tel], +input[type=time], +input[type=url], +input[type=week], +input[type=search], +select, textarea{ + box-shadow:none +} +input[type="submit" i], input[type="reset" i]{ + +} + +#optionsframework h4 { + font-weight:300; + font-size: 15px +} +#optionsframework { + position:relative; + z-index: 0; + max-width:1000px; + background:#FBFBFB; + padding: 30px; + margin: auto; + box-shadow: none; + border: none; + border: 1px solid #fff; + border-radius: 3px; +} +#optionsframework h3 { + cursor: default; + cursor: default; + font-size: 20px; + font-weight: 600; + color: #3F607D; + display: none; +} +#optionsframework p { + margin-bottom:0; + padding-bottom:10px; + line-height: 1.4em; +} +#optionsframework .section { + padding: 10px; + margin-bottom: 20px; + padding-bottom: 30px; + border-bottom: 1px solid #E8E8E8; +} +#optionsframework .group { + padding-bottom:40px; +} +#optionsframework .section .heading { + padding:10px 0px; + margin:0 0 15px; + font-weight: 600; + color: #455E8C; +} +#optionsframework .section .controls { + float: left; + min-width:350px; + width: 54%; + padding-right:2%; +} +#optionsframework .section .explain { + max-width:38%; + float: left; + font-size: 12px; + line-height:20px; + color: #777; +} +#optionsframework .section-checkbox .controls { + width: 98%; +} +#optionsframework .section-checkbox .explain { + max-width:94%; +} +#optionsframework .of-input { + width:100%; +} +#optionsframework .controls select, #optionsframework .controls textarea { + margin-bottom:10px; + width:100%; +} +#optionsframework .section-radio label, #optionsframework .section-multicheck label { + float:left; + max-width:90%; + line-height: 16px; + margin-bottom: 5px; +} +#optionsframework input.checkbox, #optionsframework input.of-radio { + width: 15px; + margin-top:2px; + float:left; + clear:both; + border-radius: 50%; +} +#optionsframework .section-typography .controls { + float:none; + width:auto; +} +#optionsframework .section-typography .explain { + float:none; + width:auto; +} +#optionsframework .controls .of-typography-size { + width:80px; + float:left +} +#optionsframework .controls .of-typography-unit { + width:50px; + margin-left:5px; + float:left +} +#optionsframework .controls .of-typography-face { + width:100px; + margin-left:5px; + float:left +} +#optionsframework .controls .of-typography-style { + width:80px; + margin-left:5px; + margin-right:5px; + float:left +} +#optionsframework .of-background-properties { + clear:both; + margin-top: 18px; +} +#optionsframework .controls .of-background-repeat { + width:125px; + margin-right:5px; + float:left +} +#optionsframework .controls .of-background-position { + width:125px; + margin-right:5px; + float:left +} +#optionsframework .controls .of-background-attachment { + width:125px; + margin-right:5px; + float:left +} +#optionsframework .section-background .wp-picker-container { + margin-bottom:10px; +} +#optionsframework .controls .of-radio-img-img { + border:3px solid #f9f9f9; + margin:0 5px 10px 0; + display:none; + cursor:pointer; + float:left; +} +#optionsframework .controls .of-radio-img-selected { + border:3px solid #ccc +} +#optionsframework .controls .of-radio-img-img:hover { + opacity:.8; +} +#optionsframework .controls .of-border-width { + width:80px; + float:left +} +#optionsframework .controls .of-border-style { + width:120px; + float:left +} +#optionsframework .hide { + display:none; +} +#optionsframework .of-option-image { + max-width:340px; + margin:3px 0 18px 0; +} +#optionsframework .mini .controls select, #optionsframework .section .mini .controls { + width: 140px; +} +#optionsframework .mini .controls input, #optionsframework .mini .controls { + min-width:140px; + width: 140px; +} +#optionsframework .mini .explain { + max-width:74%; +} + +/* Editor */ + +#optionsframework .section-editor .explain { + max-width: 98%; + float:none; + margin-bottom:5px; +} + +/* Image Uploader */ + +#optionsframework .controls input.upload { + width:80%; + box-shadow: none; +} +#optionsframework .controls input.upload_button { + float:right; + border-color:#BBBBBB; + cursor:pointer; +} +#optionsframework .controls input.upload_button:hover { + border-color:#666666; + color:#000; +} +#optionsframework .screenshot { + float:left; + margin-left:1px; + position:relative; + width:150px; + margin-top:20px; +} +#optionsframework .screenshot img { + background:#FAFAFA; + border-color:#ccc #eee #eee #ccc; + border-style:solid; + border-width:1px; + float:left; + max-width:334px; + max-height: 130px; + padding:4px; + margin-bottom:10px; +} +#optionsframework .screenshot .remove-image { + background:url("../images/ico-delete.png") no-repeat; + border:medium none; + bottom:4px; + display:block; + float:left; + height:16px; + padding:0; + position:absolute; + left:-4px; + text-indent:-9999px; + width:16px; +} +#optionsframework .screenshot .no_image .file_link { + margin-left: 20px; +} +#optionsframework .screenshot .no_image .remove-button { + bottom: 0px; +} +#optionsframework .reset-button { + float: left; + box-shadow: none; + border: none; + background: #374D6F; + text-shadow: none; + color:#fff; + height: 40px; + width: 100px; + border-radius: 0px; + cursor:pointer; +} + +/* Bottom Section */ + +#optionsframework-submit { + padding: 7px 10px; + background-image: -moz-linear-gradient(center top , #F9F9F9, #ECECEC); +} +#optionsframework .button-primary { + float: right; + box-shadow: none; + border: none; + background: #FF6464; + text-shadow: none; + /* padding: 10px; */ + height: 40px; + width: 100px; + border-radius: 0px; +} +#optionsframework .section:after { + content: ""; + display: table; +} +#optionsframework .section:after { + clear: both; +} + +input.of-radio-img-radio{display: none;} +.of-radio-img-label{display: none;} +.of-radio-color{ + display: inline-block;width: 20px;height: 20px;margin: 0 5px 0 0; +} +#optionsframework .controls .of-radio-img-img { + border:3px solid #f9f9f9; + margin:0 5px 10px 0; + /*display:none;*/ + cursor:pointer; + float:left; +} +#optionsframework .controls .of-radio-img-selected { + border:3px solid #ccc +} +#optionsframework .controls .of-radio-img-img:hover { + opacity:.8; +} +#optionsframework .controls .of-border-width { + width:80px; + float:left +} +#optionsframework .controls .of-border-style { + width:120px; + float:left +} + + +#optionsframework .section-color .controls, +#optionsframework .section-colorradio .controls, +#optionsframework .section-radio .controls{float: none;width: 100%;overflow: hidden;margin-bottom: 5px;} + +#optionsframework .section-color .explain, +#optionsframework .section-colorradio .explain, +#optionsframework .section-radio .explain{float: none;width: 100%;} diff --git a/public/inc/fonts/demo.css b/public/inc/fonts/demo.css new file mode 100644 index 0000000..a67054a --- /dev/null +++ b/public/inc/fonts/demo.css @@ -0,0 +1,539 @@ +/* Logo 字体 */ +@font-face { + font-family: "iconfont logo"; + src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834'); + src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834#iefix') format('embedded-opentype'), + url('https://at.alicdn.com/t/font_985780_km7mi63cihi.woff?t=1545807318834') format('woff'), + url('https://at.alicdn.com/t/font_985780_km7mi63cihi.ttf?t=1545807318834') format('truetype'), + url('https://at.alicdn.com/t/font_985780_km7mi63cihi.svg?t=1545807318834#iconfont') format('svg'); +} + +.logo { + font-family: "iconfont logo"; + font-size: 160px; + font-style: normal; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +/* tabs */ +.nav-tabs { + position: relative; +} + +.nav-tabs .nav-more { + position: absolute; + right: 0; + bottom: 0; + height: 42px; + line-height: 42px; + color: #666; +} + +#tabs { + border-bottom: 1px solid #eee; +} + +#tabs li { + cursor: pointer; + width: 100px; + height: 40px; + line-height: 40px; + text-align: center; + font-size: 16px; + border-bottom: 2px solid transparent; + position: relative; + z-index: 1; + margin-bottom: -1px; + color: #666; +} + + +#tabs .active { + border-bottom-color: #f00; + color: #222; +} + +.tab-container .content { + display: none; +} + +/* 页面布局 */ +.main { + padding: 30px 100px; + width: 960px; + margin: 0 auto; +} + +.main .logo { + color: #333; + text-align: left; + margin-bottom: 30px; + line-height: 1; + height: 110px; + margin-top: -50px; + overflow: hidden; + *zoom: 1; +} + +.main .logo a { + font-size: 160px; + color: #333; +} + +.helps { + margin-top: 40px; +} + +.helps pre { + padding: 20px; + margin: 10px 0; + border: solid 1px #e7e1cd; + background-color: #fffdef; + overflow: auto; +} + +.icon_lists { + width: 100% !important; + overflow: hidden; + *zoom: 1; +} + +.icon_lists li { + width: 100px; + margin-bottom: 10px; + margin-right: 20px; + text-align: center; + list-style: none !important; + cursor: default; +} + +.icon_lists li .code-name { + line-height: 1.2; +} + +.icon_lists .icon { + display: block; + height: 100px; + line-height: 100px; + font-size: 42px; + margin: 10px auto; + color: #333; + -webkit-transition: font-size 0.25s linear, width 0.25s linear; + -moz-transition: font-size 0.25s linear, width 0.25s linear; + transition: font-size 0.25s linear, width 0.25s linear; +} + +.icon_lists .icon:hover { + font-size: 100px; +} + +.icon_lists .svg-icon { + /* 通过设置 font-size 来改变图标大小 */ + width: 1em; + /* 图标和文字相邻时,垂直对齐 */ + vertical-align: -0.15em; + /* 通过设置 color 来改变 SVG 的颜色/fill */ + fill: currentColor; + /* path 和 stroke 溢出 viewBox 部分在 IE 下会显示 + normalize.css 中也包含这行 */ + overflow: hidden; +} + +.icon_lists li .name, +.icon_lists li .code-name { + color: #666; +} + +/* markdown 样式 */ +.markdown { + color: #666; + font-size: 14px; + line-height: 1.8; +} + +.highlight { + line-height: 1.5; +} + +.markdown img { + vertical-align: middle; + max-width: 100%; +} + +.markdown h1 { + color: #404040; + font-weight: 500; + line-height: 40px; + margin-bottom: 24px; +} + +.markdown h2, +.markdown h3, +.markdown h4, +.markdown h5, +.markdown h6 { + color: #404040; + margin: 1.6em 0 0.6em 0; + font-weight: 500; + clear: both; +} + +.markdown h1 { + font-size: 28px; +} + +.markdown h2 { + font-size: 22px; +} + +.markdown h3 { + font-size: 16px; +} + +.markdown h4 { + font-size: 14px; +} + +.markdown h5 { + font-size: 12px; +} + +.markdown h6 { + font-size: 12px; +} + +.markdown hr { + height: 1px; + border: 0; + background: #e9e9e9; + margin: 16px 0; + clear: both; +} + +.markdown p { + margin: 1em 0; +} + +.markdown>p, +.markdown>blockquote, +.markdown>.highlight, +.markdown>ol, +.markdown>ul { + width: 80%; +} + +.markdown ul>li { + list-style: circle; +} + +.markdown>ul li, +.markdown blockquote ul>li { + margin-left: 20px; + padding-left: 4px; +} + +.markdown>ul li p, +.markdown>ol li p { + margin: 0.6em 0; +} + +.markdown ol>li { + list-style: decimal; +} + +.markdown>ol li, +.markdown blockquote ol>li { + margin-left: 20px; + padding-left: 4px; +} + +.markdown code { + margin: 0 3px; + padding: 0 5px; + background: #eee; + border-radius: 3px; +} + +.markdown strong, +.markdown b { + font-weight: 600; +} + +.markdown>table { + border-collapse: collapse; + border-spacing: 0px; + empty-cells: show; + border: 1px solid #e9e9e9; + width: 95%; + margin-bottom: 24px; +} + +.markdown>table th { + white-space: nowrap; + color: #333; + font-weight: 600; +} + +.markdown>table th, +.markdown>table td { + border: 1px solid #e9e9e9; + padding: 8px 16px; + text-align: left; +} + +.markdown>table th { + background: #F7F7F7; +} + +.markdown blockquote { + font-size: 90%; + color: #999; + border-left: 4px solid #e9e9e9; + padding-left: 0.8em; + margin: 1em 0; +} + +.markdown blockquote p { + margin: 0; +} + +.markdown .anchor { + opacity: 0; + transition: opacity 0.3s ease; + margin-left: 8px; +} + +.markdown .waiting { + color: #ccc; +} + +.markdown h1:hover .anchor, +.markdown h2:hover .anchor, +.markdown h3:hover .anchor, +.markdown h4:hover .anchor, +.markdown h5:hover .anchor, +.markdown h6:hover .anchor { + opacity: 1; + display: inline-block; +} + +.markdown>br, +.markdown>p>br { + clear: both; +} + + +.hljs { + display: block; + background: white; + padding: 0.5em; + color: #333333; + overflow-x: auto; +} + +.hljs-comment, +.hljs-meta { + color: #969896; +} + +.hljs-string, +.hljs-variable, +.hljs-template-variable, +.hljs-strong, +.hljs-emphasis, +.hljs-quote { + color: #df5000; +} + +.hljs-keyword, +.hljs-selector-tag, +.hljs-type { + color: #a71d5d; +} + +.hljs-literal, +.hljs-symbol, +.hljs-bullet, +.hljs-attribute { + color: #0086b3; +} + +.hljs-section, +.hljs-name { + color: #63a35c; +} + +.hljs-tag { + color: #333333; +} + +.hljs-title, +.hljs-attr, +.hljs-selector-id, +.hljs-selector-class, +.hljs-selector-attr, +.hljs-selector-pseudo { + color: #795da3; +} + +.hljs-addition { + color: #55a532; + background-color: #eaffea; +} + +.hljs-deletion { + color: #bd2c00; + background-color: #ffecec; +} + +.hljs-link { + text-decoration: underline; +} + +/* 代码高亮 */ +/* PrismJS 1.15.0 +https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript */ +/** + * prism.js default theme for JavaScript, CSS and HTML + * Based on dabblet (http://dabblet.com) + * @author Lea Verou + */ +code[class*="language-"], +pre[class*="language-"] { + color: black; + background: none; + text-shadow: 0 1px white; + font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; + text-align: left; + white-space: pre; + word-spacing: normal; + word-break: normal; + word-wrap: normal; + line-height: 1.5; + + -moz-tab-size: 4; + -o-tab-size: 4; + tab-size: 4; + + -webkit-hyphens: none; + -moz-hyphens: none; + -ms-hyphens: none; + hyphens: none; +} + +pre[class*="language-"]::-moz-selection, +pre[class*="language-"] ::-moz-selection, +code[class*="language-"]::-moz-selection, +code[class*="language-"] ::-moz-selection { + text-shadow: none; + background: #b3d4fc; +} + +pre[class*="language-"]::selection, +pre[class*="language-"] ::selection, +code[class*="language-"]::selection, +code[class*="language-"] ::selection { + text-shadow: none; + background: #b3d4fc; +} + +@media print { + + code[class*="language-"], + pre[class*="language-"] { + text-shadow: none; + } +} + +/* Code blocks */ +pre[class*="language-"] { + padding: 1em; + margin: .5em 0; + overflow: auto; +} + +:not(pre)>code[class*="language-"], +pre[class*="language-"] { + background: #f5f2f0; +} + +/* Inline code */ +:not(pre)>code[class*="language-"] { + padding: .1em; + border-radius: .3em; + white-space: normal; +} + +.token.comment, +.token.prolog, +.token.doctype, +.token.cdata { + color: slategray; +} + +.token.punctuation { + color: #999; +} + +.namespace { + opacity: .7; +} + +.token.property, +.token.tag, +.token.boolean, +.token.number, +.token.constant, +.token.symbol, +.token.deleted { + color: #905; +} + +.token.selector, +.token.attr-name, +.token.string, +.token.char, +.token.builtin, +.token.inserted { + color: #690; +} + +.token.operator, +.token.entity, +.token.url, +.language-css .token.string, +.style .token.string { + color: #9a6e3a; + background: hsla(0, 0%, 100%, .5); +} + +.token.atrule, +.token.attr-value, +.token.keyword { + color: #07a; +} + +.token.function, +.token.class-name { + color: #DD4A68; +} + +.token.regex, +.token.important, +.token.variable { + color: #e90; +} + +.token.important, +.token.bold { + font-weight: bold; +} + +.token.italic { + font-style: italic; +} + +.token.entity { + cursor: help; +} diff --git a/public/inc/fonts/demo_index.html b/public/inc/fonts/demo_index.html new file mode 100644 index 0000000..ac7044c --- /dev/null +++ b/public/inc/fonts/demo_index.html @@ -0,0 +1,1277 @@ + + + + + iconfont Demo + + + + + + + + + + + + + +
+

+ + +

+ +
+
+
    + +
  • + +
    + clock +
    +
    .icon-clock +
    +
  • + +
  • + +
    + chat-full +
    +
    .icon-chat-full +
    +
  • + +
  • + +
    + communityfill +
    +
    .icon-communityfill +
    +
  • + +
  • + +
    + fire +
    +
    .icon-fire +
    +
  • + +
  • + +
    + left +
    +
    .icon-left +
    +
  • + +
  • + +
    + info +
    +
    .icon-info +
    +
  • + +
  • + +
    + good_fill +
    +
    .icon-good_fill +
    +
  • + +
  • + +
    + about +
    +
    .icon-about +
    +
  • + +
  • + +
    + message_fill +
    +
    .icon-message_fill +
    +
  • + +
  • + +
    + pullright +
    +
    .icon-pullright +
    +
  • + +
  • + +
    + pen +
    +
    .icon-pen +
    +
  • + +
  • + +
    + heart_line +
    +
    .icon-heart_line +
    +
  • + +
  • + +
    + notice +
    +
    .icon-notice +
    +
  • + +
  • + +
    + mark +
    +
    .icon-mark +
    +
  • + +
  • + +
    + people +
    +
    .icon-people +
    +
  • + +
  • + +
    + good_line +
    +
    .icon-good_line +
    +
  • + +
  • + +
    + friends_circle +
    +
    .icon-friends_circle +
    +
  • + +
  • + +
    + pullleft +
    +
    .icon-pullleft +
    +
  • + +
  • + +
    + right +
    +
    .icon-right +
    +
  • + +
  • + +
    + tags +
    +
    .icon-tags +
    +
  • + +
  • + +
    + yes_fill +
    +
    .icon-yes_fill +
    +
  • + +
  • + +
    + warning +
    +
    .icon-warning +
    +
  • + +
  • + +
    + friend +
    +
    .icon-friend +
    +
  • + +
  • + +
    + clover +
    +
    .icon-clover +
    +
  • + +
  • + +
    + timeline +
    +
    .icon-timeline +
    +
  • + +
  • + +
    + heart +
    +
    .icon-heart +
    +
  • + +
  • + +
    + yemian +
    +
    .icon-yemian +
    +
  • + +
  • + +
    + VIP +
    +
    .icon-VIP +
    +
  • + +
  • + +
    + pen_fill +
    +
    .icon-pen_fill +
    +
  • + +
  • + +
    + eye_fill +
    +
    .icon-eye_fill +
    +
  • + +
  • + +
    + eye +
    +
    .icon-eye +
    +
  • + +
  • + +
    + time +
    +
    .icon-time +
    +
  • + +
  • + +
    + home +
    +
    .icon-home +
    +
  • + +
  • + +
    + newmssco +
    +
    .icon-newmssco +
    +
  • + +
  • + +
    + weibo +
    +
    .icon-weibo +
    +
  • + +
  • + +
    + share_out +
    +
    .icon-share_out +
    +
  • + +
  • + +
    + wechat +
    +
    .icon-wechat +
    +
  • + +
  • + +
    + star_line +
    +
    .icon-star_line +
    +
  • + +
  • + +
    + qq +
    +
    .icon-qq +
    +
  • + +
  • + +
    + locate +
    +
    .icon-locate +
    +
  • + +
  • + +
    + calendar +
    +
    .icon-calendar +
    +
  • + +
  • + +
    + douban +
    +
    .icon-douban +
    +
  • + +
  • + +
    + file +
    +
    .icon-file +
    +
  • + +
  • + +
    + link +
    +
    .icon-link +
    +
  • + +
  • + +
    + message +
    +
    .icon-message +
    +
  • + +
  • + +
    + github +
    +
    .icon-github +
    +
  • + +
  • + +
    + more +
    +
    .icon-more +
    +
  • + +
  • + +
    + filebox +
    +
    .icon-filebox +
    +
  • + +
  • + +
    + countdownfill +
    +
    .icon-countdownfill +
    +
  • + +
  • + +
    + camera +
    +
    .icon-camera +
    +
  • + +
  • + +
    + close +
    +
    .icon-close +
    +
  • + +
  • + +
    + download +
    +
    .icon-download +
    +
  • + +
  • + +
    + avatar +
    +
    .icon-avatar +
    +
  • + +
  • + +
    + del +
    +
    .icon-del +
    +
  • + +
  • + +
    + bigvoice +
    +
    .icon-bigvoice +
    +
  • + +
  • + +
    + yes +
    +
    .icon-yes +
    +
  • + +
  • + +
    + shuidi +
    +
    .icon-shuidi +
    +
  • + +
  • + +
    + upload +
    +
    .icon-upload +
    +
  • + +
  • + +
    + star_fill +
    +
    .icon-star_fill +
    +
  • + +
  • + +
    + star +
    +
    .icon-star +
    +
  • + +
  • + +
    + up +
    +
    .icon-up +
    +
  • + +
  • + +
    + search +
    +
    .icon-search +
    +
  • + +
  • + +
    + menu +
    +
    .icon-menu +
    +
  • + +
  • + +
    + share +
    +
    .icon-share +
    +
  • + +
  • + +
    + menu_1 +
    +
    .icon-menu_1 +
    +
  • + +
  • + +
    + download_1 +
    +
    .icon-download_1 +
    +
  • + +
  • + +
    + question +
    +
    .icon-question +
    +
  • + +
+
+

font-class 引用

+
+ +

font-class 是 Unicode 使用方式的一种变种,主要是解决 Unicode 书写不直观,语意不明确的问题。

+

与 Unicode 使用方式相比,具有如下特点:

+
    +
  • 相比于 Unicode 语意明确,书写更直观。可以很容易分辨这个 icon 是什么。
  • +
  • 因为使用 class 来定义图标,所以当要替换图标时,只需要修改 class 里面的 Unicode 引用。
  • +
+

使用步骤如下:

+

第一步:引入项目下面生成的 fontclass 代码:

+
<link rel="stylesheet" href="./iconfont.css">
+
+

第二步:挑选相应图标并获取类名,应用于页面:

+
<span class="iconfont icon-xxx"></span>
+
+
+

" + iconfont" 是你项目下的 font-family。可以通过编辑项目查看,默认是 "iconfont"。

+
+
+
+
+
    + +
  • + +
    clock
    +
    #icon-clock
    +
  • + +
  • + +
    chat-full
    +
    #icon-chat-full
    +
  • + +
  • + +
    communityfill
    +
    #icon-communityfill
    +
  • + +
  • + +
    fire
    +
    #icon-fire
    +
  • + +
  • + +
    left
    +
    #icon-left
    +
  • + +
  • + +
    info
    +
    #icon-info
    +
  • + +
  • + +
    good_fill
    +
    #icon-good_fill
    +
  • + +
  • + +
    about
    +
    #icon-about
    +
  • + +
  • + +
    message_fill
    +
    #icon-message_fill
    +
  • + +
  • + +
    pullright
    +
    #icon-pullright
    +
  • + +
  • + +
    pen
    +
    #icon-pen
    +
  • + +
  • + +
    heart_line
    +
    #icon-heart_line
    +
  • + +
  • + +
    notice
    +
    #icon-notice
    +
  • + +
  • + +
    mark
    +
    #icon-mark
    +
  • + +
  • + +
    people
    +
    #icon-people
    +
  • + +
  • + +
    good_line
    +
    #icon-good_line
    +
  • + +
  • + +
    friends_circle
    +
    #icon-friends_circle
    +
  • + +
  • + +
    pullleft
    +
    #icon-pullleft
    +
  • + +
  • + +
    right
    +
    #icon-right
    +
  • + +
  • + +
    tags
    +
    #icon-tags
    +
  • + +
  • + +
    yes_fill
    +
    #icon-yes_fill
    +
  • + +
  • + +
    warning
    +
    #icon-warning
    +
  • + +
  • + +
    friend
    +
    #icon-friend
    +
  • + +
  • + +
    clover
    +
    #icon-clover
    +
  • + +
  • + +
    timeline
    +
    #icon-timeline
    +
  • + +
  • + +
    heart
    +
    #icon-heart
    +
  • + +
  • + +
    yemian
    +
    #icon-yemian
    +
  • + +
  • + +
    VIP
    +
    #icon-VIP
    +
  • + +
  • + +
    pen_fill
    +
    #icon-pen_fill
    +
  • + +
  • + +
    eye_fill
    +
    #icon-eye_fill
    +
  • + +
  • + +
    eye
    +
    #icon-eye
    +
  • + +
  • + +
    time
    +
    #icon-time
    +
  • + +
  • + +
    home
    +
    #icon-home
    +
  • + +
  • + +
    newmssco
    +
    #icon-newmssco
    +
  • + +
  • + +
    weibo
    +
    #icon-weibo
    +
  • + +
  • + +
    share_out
    +
    #icon-share_out
    +
  • + +
  • + +
    wechat
    +
    #icon-wechat
    +
  • + +
  • + +
    star_line
    +
    #icon-star_line
    +
  • + +
  • + +
    qq
    +
    #icon-qq
    +
  • + +
  • + +
    locate
    +
    #icon-locate
    +
  • + +
  • + +
    calendar
    +
    #icon-calendar
    +
  • + +
  • + +
    douban
    +
    #icon-douban
    +
  • + +
  • + +
    file
    +
    #icon-file
    +
  • + +
  • + +
    link
    +
    #icon-link
    +
  • + +
  • + +
    message
    +
    #icon-message
    +
  • + +
  • + +
    github
    +
    #icon-github
    +
  • + +
  • + +
    more
    +
    #icon-more
    +
  • + +
  • + +
    filebox
    +
    #icon-filebox
    +
  • + +
  • + +
    countdownfill
    +
    #icon-countdownfill
    +
  • + +
  • + +
    camera
    +
    #icon-camera
    +
  • + +
  • + +
    close
    +
    #icon-close
    +
  • + +
  • + +
    download
    +
    #icon-download
    +
  • + +
  • + +
    avatar
    +
    #icon-avatar
    +
  • + +
  • + +
    del
    +
    #icon-del
    +
  • + +
  • + +
    bigvoice
    +
    #icon-bigvoice
    +
  • + +
  • + +
    yes
    +
    #icon-yes
    +
  • + +
  • + +
    shuidi
    +
    #icon-shuidi
    +
  • + +
  • + +
    upload
    +
    #icon-upload
    +
  • + +
  • + +
    star_fill
    +
    #icon-star_fill
    +
  • + +
  • + +
    star
    +
    #icon-star
    +
  • + +
  • + +
    up
    +
    #icon-up
    +
  • + +
  • + +
    search
    +
    #icon-search
    +
  • + +
  • + +
    menu
    +
    #icon-menu
    +
  • + +
  • + +
    share
    +
    #icon-share
    +
  • + +
  • + +
    menu_1
    +
    #icon-menu_1
    +
  • + +
  • + +
    download_1
    +
    #icon-download_1
    +
  • + +
  • + +
    question
    +
    #icon-question
    +
  • + +
+
+

Symbol 引用

+
+ +

这是一种全新的使用方式,应该说这才是未来的主流,也是平台目前推荐的用法。相关介绍可以参考这篇文章 + 这种用法其实是做了一个 SVG 的集合,与另外两种相比具有如下特点:

+
    +
  • 支持多色图标了,不再受单色限制。
  • +
  • 通过一些技巧,支持像字体那样,通过 font-size, color 来调整样式。
  • +
  • 兼容性较差,支持 IE9+,及现代浏览器。
  • +
  • 浏览器渲染 SVG 的性能一般,还不如 png。
  • +
+

使用步骤如下:

+

第一步:引入项目下面生成的 symbol 代码:

+
<script src="./iconfont.js"></script>
+
+

第二步:加入通用 CSS 代码(引入一次就行):

+
<style>
+.icon {
+  width: 1em;
+  height: 1em;
+  vertical-align: -0.15em;
+  fill: currentColor;
+  overflow: hidden;
+}
+</style>
+
+

第三步:挑选相应图标并获取类名,应用于页面:

+
<svg class="icon" aria-hidden="true">
+  <use xlink:href="#icon-xxx"></use>
+</svg>
+
+
+
+ +
+
+ + + diff --git a/public/inc/fonts/iconfont.css b/public/inc/fonts/iconfont.css new file mode 100644 index 0000000..64bbfcb --- /dev/null +++ b/public/inc/fonts/iconfont.css @@ -0,0 +1,283 @@ +@font-face { + font-family: "iconfont"; /* Project id 4923671 */ + src: url('iconfont.woff2?t=1749441731714') format('woff2'), + url('iconfont.woff?t=1749441731714') format('woff'), + url('iconfont.ttf?t=1749441731714') format('truetype'); +} + +.iconfont { + font-family: "iconfont" !important; + font-size: 16px; + font-style: normal; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +.icon-clock:before { + content: "\e602"; +} + +.icon-chat-full:before { + content: "\e603"; +} + +.icon-communityfill:before { + content: "\e605"; +} + +.icon-fire:before { + content: "\e60c"; +} + +.icon-left:before { + content: "\e60d"; +} + +.icon-info:before { + content: "\e611"; +} + +.icon-good_fill:before { + content: "\e614"; +} + +.icon-about:before { + content: "\e617"; +} + +.icon-message_fill:before { + content: "\e618"; +} + +.icon-pullright:before { + content: "\e619"; +} + +.icon-pen:before { + content: "\e63b"; +} + +.icon-heart_line:before { + content: "\e63c"; +} + +.icon-notice:before { + content: "\e63d"; +} + +.icon-mark:before { + content: "\e63e"; +} + +.icon-people:before { + content: "\e63f"; +} + +.icon-good_line:before { + content: "\e640"; +} + +.icon-friends_circle:before { + content: "\e641"; +} + +.icon-pullleft:before { + content: "\e642"; +} + +.icon-right:before { + content: "\e643"; +} + +.icon-tags:before { + content: "\e644"; +} + +.icon-yes_fill:before { + content: "\e645"; +} + +.icon-warning:before { + content: "\e646"; +} + +.icon-friend:before { + content: "\e647"; +} + +.icon-clover:before { + content: "\e648"; +} + +.icon-timeline:before { + content: "\e649"; +} + +.icon-heart:before { + content: "\e64a"; +} + +.icon-yemian:before { + content: "\e64b"; +} + +.icon-VIP:before { + content: "\e64d"; +} + +.icon-pen_fill:before { + content: "\e64e"; +} + +.icon-eye_fill:before { + content: "\e607"; +} + +.icon-eye:before { + content: "\e64f"; +} + +.icon-time:before { + content: "\e616"; +} + +.icon-home:before { + content: "\e650"; +} + +.icon-newmssco:before { + content: "\e651"; +} + +.icon-weibo:before { + content: "\e633"; +} + +.icon-share_out:before { + content: "\e634"; +} + +.icon-wechat:before { + content: "\e635"; +} + +.icon-star_line:before { + content: "\e636"; +} + +.icon-qq:before { + content: "\e637"; +} + +.icon-locate:before { + content: "\e638"; +} + +.icon-calendar:before { + content: "\e639"; +} + +.icon-douban:before { + content: "\e63a"; +} + +.icon-file:before { + content: "\e626"; +} + +.icon-link:before { + content: "\e627"; +} + +.icon-message:before { + content: "\e628"; +} + +.icon-github:before { + content: "\e629"; +} + +.icon-more:before { + content: "\e62a"; +} + +.icon-filebox:before { + content: "\e62b"; +} + +.icon-countdownfill:before { + content: "\e62c"; +} + +.icon-camera:before { + content: "\e62d"; +} + +.icon-close:before { + content: "\e62e"; +} + +.icon-download:before { + content: "\e62f"; +} + +.icon-avatar:before { + content: "\e630"; +} + +.icon-del:before { + content: "\e631"; +} + +.icon-bigvoice:before { + content: "\e632"; +} + +.icon-yes:before { + content: "\e61e"; +} + +.icon-shuidi:before { + content: "\e61c"; +} + +.icon-upload:before { + content: "\e61d"; +} + +.icon-star_fill:before { + content: "\e61f"; +} + +.icon-star:before { + content: "\e620"; +} + +.icon-up:before { + content: "\e621"; +} + +.icon-search:before { + content: "\e61b"; +} + +.icon-menu:before { + content: "\e622"; +} + +.icon-share:before { + content: "\e623"; +} + +.icon-menu_1:before { + content: "\e624"; +} + +.icon-download_1:before { + content: "\e61a"; +} + +.icon-question:before { + content: "\e625"; +} + diff --git a/public/inc/fonts/iconfont.eot b/public/inc/fonts/iconfont.eot new file mode 100644 index 0000000..c2173c8 Binary files /dev/null and b/public/inc/fonts/iconfont.eot differ diff --git a/public/inc/fonts/iconfont.js b/public/inc/fonts/iconfont.js new file mode 100644 index 0000000..9fece75 --- /dev/null +++ b/public/inc/fonts/iconfont.js @@ -0,0 +1 @@ +window._iconfont_svg_string_4923671='',(t=>{var l=(c=(c=document.getElementsByTagName("script"))[c.length-1]).getAttribute("data-injectcss"),c=c.getAttribute("data-disable-injectsvg");if(!c){var q,o,i,m,h,s=function(l,c){c.parentNode.insertBefore(l,c)};if(l&&!t.__iconfont__svg__cssinject__){t.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(l){console&&console.log(l)}}q=function(){var l,c=document.createElement("div");c.innerHTML=t._iconfont_svg_string_4923671,(c=c.getElementsByTagName("svg")[0])&&(c.setAttribute("aria-hidden","true"),c.style.position="absolute",c.style.width=0,c.style.height=0,c.style.overflow="hidden",c=c,(l=document.body).firstChild?s(c,l.firstChild):l.appendChild(c))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(q,0):(o=function(){document.removeEventListener("DOMContentLoaded",o,!1),q()},document.addEventListener("DOMContentLoaded",o,!1)):document.attachEvent&&(i=q,m=t.document,h=!1,e(),m.onreadystatechange=function(){"complete"==m.readyState&&(m.onreadystatechange=null,a())})}function a(){h||(h=!0,i())}function e(){try{m.documentElement.doScroll("left")}catch(l){return void setTimeout(e,50)}a()}})(window); \ No newline at end of file diff --git a/public/inc/fonts/iconfont.json b/public/inc/fonts/iconfont.json new file mode 100644 index 0000000..bad6156 --- /dev/null +++ b/public/inc/fonts/iconfont.json @@ -0,0 +1,478 @@ +{ + "id": "4923671", + "name": "name", + "font_family": "iconfont", + "css_prefix_text": "icon-", + "description": "", + "glyphs": [ + { + "icon_id": "31143915", + "name": "clock", + "font_class": "clock", + "unicode": "e602", + "unicode_decimal": 58882 + }, + { + "icon_id": "31143916", + "name": "chat-full", + "font_class": "chat-full", + "unicode": "e603", + "unicode_decimal": 58883 + }, + { + "icon_id": "31143918", + "name": "communityfill", + "font_class": "communityfill", + "unicode": "e605", + "unicode_decimal": 58885 + }, + { + "icon_id": "31143925", + "name": "fire", + "font_class": "fire", + "unicode": "e60c", + "unicode_decimal": 58892 + }, + { + "icon_id": "31143926", + "name": "left", + "font_class": "left", + "unicode": "e60d", + "unicode_decimal": 58893 + }, + { + "icon_id": "31143930", + "name": "info", + "font_class": "info", + "unicode": "e611", + "unicode_decimal": 58897 + }, + { + "icon_id": "31143933", + "name": "good_fill", + "font_class": "good_fill", + "unicode": "e614", + "unicode_decimal": 58900 + }, + { + "icon_id": "31143936", + "name": "about", + "font_class": "about", + "unicode": "e617", + "unicode_decimal": 58903 + }, + { + "icon_id": "31143937", + "name": "message_fill", + "font_class": "message_fill", + "unicode": "e618", + "unicode_decimal": 58904 + }, + { + "icon_id": "31143938", + "name": "pullright", + "font_class": "pullright", + "unicode": "e619", + "unicode_decimal": 58905 + }, + { + "icon_id": "31143941", + "name": "pen", + "font_class": "pen", + "unicode": "e63b", + "unicode_decimal": 58939 + }, + { + "icon_id": "31143942", + "name": "heart_line", + "font_class": "heart_line", + "unicode": "e63c", + "unicode_decimal": 58940 + }, + { + "icon_id": "31143943", + "name": "notice", + "font_class": "notice", + "unicode": "e63d", + "unicode_decimal": 58941 + }, + { + "icon_id": "31143945", + "name": "mark", + "font_class": "mark", + "unicode": "e63e", + "unicode_decimal": 58942 + }, + { + "icon_id": "31143947", + "name": "people", + "font_class": "people", + "unicode": "e63f", + "unicode_decimal": 58943 + }, + { + "icon_id": "31143949", + "name": "good_line", + "font_class": "good_line", + "unicode": "e640", + "unicode_decimal": 58944 + }, + { + "icon_id": "31143950", + "name": "friends_circle", + "font_class": "friends_circle", + "unicode": "e641", + "unicode_decimal": 58945 + }, + { + "icon_id": "31143951", + "name": "pullleft", + "font_class": "pullleft", + "unicode": "e642", + "unicode_decimal": 58946 + }, + { + "icon_id": "31143955", + "name": "right", + "font_class": "right", + "unicode": "e643", + "unicode_decimal": 58947 + }, + { + "icon_id": "31143963", + "name": "tags", + "font_class": "tags", + "unicode": "e644", + "unicode_decimal": 58948 + }, + { + "icon_id": "31143965", + "name": "yes_fill", + "font_class": "yes_fill", + "unicode": "e645", + "unicode_decimal": 58949 + }, + { + "icon_id": "31143969", + "name": "warning", + "font_class": "warning", + "unicode": "e646", + "unicode_decimal": 58950 + }, + { + "icon_id": "31143970", + "name": "friend", + "font_class": "friend", + "unicode": "e647", + "unicode_decimal": 58951 + }, + { + "icon_id": "31143971", + "name": "clover", + "font_class": "clover", + "unicode": "e648", + "unicode_decimal": 58952 + }, + { + "icon_id": "31145048", + "name": "timeline", + "font_class": "timeline", + "unicode": "e649", + "unicode_decimal": 58953 + }, + { + "icon_id": "31145654", + "name": "heart", + "font_class": "heart", + "unicode": "e64a", + "unicode_decimal": 58954 + }, + { + "icon_id": "31145661", + "name": "yemian", + "font_class": "yemian", + "unicode": "e64b", + "unicode_decimal": 58955 + }, + { + "icon_id": "44317090", + "name": "VIP", + "font_class": "VIP", + "unicode": "e64d", + "unicode_decimal": 58957 + }, + { + "icon_id": "44317097", + "name": "pen_fill", + "font_class": "pen_fill", + "unicode": "e64e", + "unicode_decimal": 58958 + }, + { + "icon_id": "44331906", + "name": "eye_fill", + "font_class": "eye_fill", + "unicode": "e607", + "unicode_decimal": 58887 + }, + { + "icon_id": "44359858", + "name": "eye", + "font_class": "eye", + "unicode": "e64f", + "unicode_decimal": 58959 + }, + { + "icon_id": "44363045", + "name": "time", + "font_class": "time", + "unicode": "e616", + "unicode_decimal": 58902 + }, + { + "icon_id": "44363065", + "name": "home", + "font_class": "home", + "unicode": "e650", + "unicode_decimal": 58960 + }, + { + "icon_id": "44363072", + "name": "newmssco", + "font_class": "newmssco", + "unicode": "e651", + "unicode_decimal": 58961 + }, + { + "icon_id": "44544861", + "name": "weibo", + "font_class": "weibo", + "unicode": "e633", + "unicode_decimal": 58931 + }, + { + "icon_id": "44544854", + "name": "share_out", + "font_class": "share_out", + "unicode": "e634", + "unicode_decimal": 58932 + }, + { + "icon_id": "44544859", + "name": "wechat", + "font_class": "wechat", + "unicode": "e635", + "unicode_decimal": 58933 + }, + { + "icon_id": "44544857", + "name": "star_line", + "font_class": "star_line", + "unicode": "e636", + "unicode_decimal": 58934 + }, + { + "icon_id": "44544849", + "name": "qq", + "font_class": "qq", + "unicode": "e637", + "unicode_decimal": 58935 + }, + { + "icon_id": "44544847", + "name": "locate", + "font_class": "locate", + "unicode": "e638", + "unicode_decimal": 58936 + }, + { + "icon_id": "44544842", + "name": "calendar", + "font_class": "calendar", + "unicode": "e639", + "unicode_decimal": 58937 + }, + { + "icon_id": "44544837", + "name": "douban", + "font_class": "douban", + "unicode": "e63a", + "unicode_decimal": 58938 + }, + { + "icon_id": "44544841", + "name": "file", + "font_class": "file", + "unicode": "e626", + "unicode_decimal": 58918 + }, + { + "icon_id": "44544843", + "name": "link", + "font_class": "link", + "unicode": "e627", + "unicode_decimal": 58919 + }, + { + "icon_id": "44544844", + "name": "message", + "font_class": "message", + "unicode": "e628", + "unicode_decimal": 58920 + }, + { + "icon_id": "44544840", + "name": "github", + "font_class": "github", + "unicode": "e629", + "unicode_decimal": 58921 + }, + { + "icon_id": "44544845", + "name": "more", + "font_class": "more", + "unicode": "e62a", + "unicode_decimal": 58922 + }, + { + "icon_id": "44544839", + "name": "filebox", + "font_class": "filebox", + "unicode": "e62b", + "unicode_decimal": 58923 + }, + { + "icon_id": "44544838", + "name": "countdownfill", + "font_class": "countdownfill", + "unicode": "e62c", + "unicode_decimal": 58924 + }, + { + "icon_id": "44544836", + "name": "camera", + "font_class": "camera", + "unicode": "e62d", + "unicode_decimal": 58925 + }, + { + "icon_id": "44544833", + "name": "close", + "font_class": "close", + "unicode": "e62e", + "unicode_decimal": 58926 + }, + { + "icon_id": "44544835", + "name": "download", + "font_class": "download", + "unicode": "e62f", + "unicode_decimal": 58927 + }, + { + "icon_id": "44544832", + "name": "avatar", + "font_class": "avatar", + "unicode": "e630", + "unicode_decimal": 58928 + }, + { + "icon_id": "44544834", + "name": "del", + "font_class": "del", + "unicode": "e631", + "unicode_decimal": 58929 + }, + { + "icon_id": "44544831", + "name": "bigvoice", + "font_class": "bigvoice", + "unicode": "e632", + "unicode_decimal": 58930 + }, + { + "icon_id": "44544863", + "name": "yes", + "font_class": "yes", + "unicode": "e61e", + "unicode_decimal": 58910 + }, + { + "icon_id": "44544862", + "name": "shuidi", + "font_class": "shuidi", + "unicode": "e61c", + "unicode_decimal": 58908 + }, + { + "icon_id": "44544858", + "name": "upload", + "font_class": "upload", + "unicode": "e61d", + "unicode_decimal": 58909 + }, + { + "icon_id": "44544860", + "name": "star_fill", + "font_class": "star_fill", + "unicode": "e61f", + "unicode_decimal": 58911 + }, + { + "icon_id": "44544855", + "name": "star", + "font_class": "star", + "unicode": "e620", + "unicode_decimal": 58912 + }, + { + "icon_id": "44544856", + "name": "up", + "font_class": "up", + "unicode": "e621", + "unicode_decimal": 58913 + }, + { + "icon_id": "44544853", + "name": "search", + "font_class": "search", + "unicode": "e61b", + "unicode_decimal": 58907 + }, + { + "icon_id": "44544850", + "name": "menu", + "font_class": "menu", + "unicode": "e622", + "unicode_decimal": 58914 + }, + { + "icon_id": "44544852", + "name": "share", + "font_class": "share", + "unicode": "e623", + "unicode_decimal": 58915 + }, + { + "icon_id": "44544851", + "name": "menu_1", + "font_class": "menu_1", + "unicode": "e624", + "unicode_decimal": 58916 + }, + { + "icon_id": "44544846", + "name": "download_1", + "font_class": "download_1", + "unicode": "e61a", + "unicode_decimal": 58906 + }, + { + "icon_id": "44544848", + "name": "question", + "font_class": "question", + "unicode": "e625", + "unicode_decimal": 58917 + } + ] +} diff --git a/public/inc/fonts/iconfont.svg b/public/inc/fonts/iconfont.svg new file mode 100644 index 0000000..6ab1894 --- /dev/null +++ b/public/inc/fonts/iconfont.svg @@ -0,0 +1,188 @@ + + + + + +Created by iconfont + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/inc/fonts/iconfont.ttf b/public/inc/fonts/iconfont.ttf new file mode 100644 index 0000000..af0847e Binary files /dev/null and b/public/inc/fonts/iconfont.ttf differ diff --git a/public/inc/fonts/iconfont.woff b/public/inc/fonts/iconfont.woff new file mode 100644 index 0000000..8cf641a Binary files /dev/null and b/public/inc/fonts/iconfont.woff differ diff --git a/public/inc/fonts/iconfont.woff2 b/public/inc/fonts/iconfont.woff2 new file mode 100644 index 0000000..5cd7088 Binary files /dev/null and b/public/inc/fonts/iconfont.woff2 differ diff --git a/public/inc/images/ico-delete.png b/public/inc/images/ico-delete.png new file mode 100644 index 0000000..08f2493 Binary files /dev/null and b/public/inc/images/ico-delete.png differ diff --git a/public/inc/js/color-picker.min.js b/public/inc/js/color-picker.min.js new file mode 100644 index 0000000..75b6ede --- /dev/null +++ b/public/inc/js/color-picker.min.js @@ -0,0 +1 @@ +(function(f,e){var a='',c='
',b='
',g='';var d={options:{defaultColor:false,change:false,clear:false,hide:true,palettes:true},_create:function(){if(f.browser.msie&&parseInt(f.browser.version,10)<8){return}var h=this;var i=h.element;f.extend(h.options,i.data());h.initialValue=i.val();i.addClass("wp-color-picker").hide().wrap(b);h.wrap=i.parent();h.toggler=f(a).insertBefore(i).css({backgroundColor:h.initialValue}).attr("title",wpColorPickerL10n.pick).attr("data-current",wpColorPickerL10n.current);h.pickerContainer=f(c).insertAfter(i);h.button=f(g);if(h.options.defaultColor){h.button.addClass("wp-picker-default").val(wpColorPickerL10n.defaultString)}else{h.button.addClass("wp-picker-clear").val(wpColorPickerL10n.clear)}i.wrap('').after(h.button);i.iris({target:h.pickerContainer,hide:true,width:255,mode:"hsv",palettes:h.options.palettes,change:function(j,k){h.toggler.css({backgroundColor:k.color.toString()});if(f.isFunction(h.options.change)){h.options.change.call(this,j,k)}}});i.val(h.initialValue);h._addListeners();if(!h.options.hide){h.toggler.click()}},_addListeners:function(){var h=this;h.toggler.click(function(i){i.stopPropagation();h.element.toggle().iris("toggle");h.button.toggleClass("hidden");h.toggler.toggleClass("wp-picker-open");if(h.toggler.hasClass("wp-picker-open")){f("body").on("click",{wrap:h.wrap,toggler:h.toggler},h._bodyListener)}else{f("body").off("click",h._bodyListener)}});h.element.change(function(j){var i=f(this),k=i.val();if(k===""||k==="#"){h.toggler.css("backgroundColor","");if(f.isFunction(h.options.clear)){h.options.clear.call(this,j)}}});h.toggler.on("keyup",function(i){if(i.keyCode===13||i.keyCode===32){i.preventDefault();h.toggler.trigger("click").next().focus()}});h.button.click(function(j){var i=f(this);if(i.hasClass("wp-picker-clear")){h.element.val("");h.toggler.css("backgroundColor","");if(f.isFunction(h.options.clear)){h.options.clear.call(this,j)}}else{if(i.hasClass("wp-picker-default")){h.element.val(h.options.defaultColor).change()}}})},_bodyListener:function(h){if(!h.data.wrap.find(h.target).length){h.data.toggler.click()}},color:function(h){if(h===e){return this.element.iris("option","color")}this.element.iris("option","color",h)},defaultColor:function(h){if(h===e){return this.options.defaultColor}this.options.defaultColor=h}};f.widget("wp.wpColorPicker",d)}(jQuery)); \ No newline at end of file diff --git a/public/inc/js/iris.min.js b/public/inc/js/iris.min.js new file mode 100644 index 0000000..105195d --- /dev/null +++ b/public/inc/js/iris.min.js @@ -0,0 +1,4 @@ +/*! Iris - v0.9.14 - 2012-11-20 +* https://github.com/Automattic/Iris +* Copyright (c) 2012 Matt Wiebe; Licensed GPL */ +(function(e,t){function u(){if(r)i="filter";else{var t=e('
'),n="linear-gradient(top,#fff,#000)";e.each(s,function(e,r){t.css("backgroundImage",r+n);if(t.css("backgroundImage").match("gradient"))return i=e,!1}),e.browser.webkit&&i===!1&&(t.css("background","-webkit-gradient(linear,0% 0%,0% 100%,from(#fff),to(#000))"),t.css("backgroundImage").match("gradient")&&(i="webkit")),t.remove()}}function a(t,n){return t=t==="top"?"top":"left",n=e.isArray(n)?n:Array.prototype.slice.call(arguments,1),i==="webkit"?l(t,n):s[i]+"linear-gradient("+t+", "+n.join(", ")+")"}function f(t,n){t=t==="top"?"top":"left",n=e.isArray(n)?n:Array.prototype.slice.call(arguments,1);var r=t==="top"?0:1,i=e(this),s=n.length-1,o=parseInt(e.browser.version,10)>=8?"-ms-filter":"filter";o="filter";var u=r===1?"left":"top",a=r===1?"right":"bottom",f=r===1?"height":"width",l='
',h="";i.css("position")==="static"&&i.css({position:"relative"}),n=c(n),e.each(n,function(e,t){if(e===s)return!1;var i=n[e+1];if(t.stop===i.stop)return;var o=100-parseFloat(i.stop)+"%";t.octoHex=(new Color(t.color)).toIEOctoHex(),i.octoHex=(new Color(i.color)).toIEOctoHex();var u="progid:DXImageTransform.Microsoft.Gradient(GradientType="+r+", StartColorStr='"+t.octoHex+"', EndColorStr='"+i.octoHex+"')";h+=l.replace("%start%",t.stop).replace("%end%",o).replace("%filter%",u)}),i.find(".iris-ie-gradient-shim").remove(),e(h).prependTo(i)}function l(t,n){var r=[];return t=t==="top"?"0% 0%,0% 100%,":"0% 100%,100% 100%,",n=c(n),e.each(n,function(e,t){r.push("color-stop("+parseFloat(t.stop)/100+", "+t.color+")")}),"-webkit-gradient(linear,"+t+r.join(",")+")"}function c(t){var n=[],r=[],i=[],s=t.length-1;return e.each(t,function(e,t){var i=t,s=!1,o=t.match(/1?[0-9]{1,2}%$/);o&&(i=t.replace(/\s?1?[0-9]{1,2}%$/,""),s=o.shift()),n.push(i),r.push(s)}),r[0]===!1&&(r[0]="0%"),r[s]===!1&&(r[s]="100%"),r=h(r),e.each(r,function(e){i[e]={color:n[e],stop:r[e]}}),i}function h(t){var n=0,r=t.length-1,i=0,s=!1,o,u,a,f;if(t.length<=2||e.inArray(!1,t)<0)return t;while(i"),n=e("
"),r=e.isArray(this.options.palettes)?this.options.palettes:this._palettes;e.each(r,function(e,r){n.clone().data("color",r).css("backgroundColor",r).appendTo(t).height(10).width(10)}),this.picker.append(t)},_paint:function(){var e=this;e._paintDimension("top","strip"),e._paintDimension("top","vert"),e._paintDimension("left","horiz")},_paintDimension:function(e,t){var n=this,r=n.color,i=n.options.mode,s=n._getHSpaceColor(),o=n.controls[t],u=n.options.controls,a;if(t===n.active||n.active==="square"&&t!=="strip")return;switch(u[t]){case"h":if(i==="hsv"){s=r.clone();switch(t){case"horiz":s[u.vert](100);break;case"vert":s[u.horiz](100);break;case"strip":s.setHSpace("hsl")}a=s.toHsl()}else t==="strip"?a={s:s.s,l:s.l}:a={s:100,l:s.l};o.raninbowGradient(e,a);break;case"s":i==="hsv"?t==="vert"?a=[r.clone().a(0).s(0).toCSS("rgba"),r.clone().a(1).s(0).toCSS("rgba")]:t==="strip"?a=[r.clone().s(100).toCSS("hsl"),r.clone().s(0).toCSS("hsl")]:t==="horiz"&&(a=["#fff","hsl("+s.h+",100%,50%)"]):t==="vert"&&n.options.controls.horiz==="h"?a=["hsla(0, 0%, "+s.l+"%, 0)","hsla(0, 0%, "+s.l+"%, 1)"]:a=["hsl("+s.h+",0%,50%)","hsl("+s.h+",100%,50%)"],o.gradient(e,a);break;case"l":t==="strip"?a=["hsl("+s.h+",100%,100%)","hsl("+s.h+", "+s.s+"%,50%)","hsl("+s.h+",100%,0%)"]:a=["#fff","rgba(255,255,255,0) 50%","rgba(0,0,0,0) 50%","rgba(0,0,0,1)"],o.gradient(e,a);break;case"v":t==="strip"?a=[r.clone().v(100).toCSS(),r.clone().v(0).toCSS()]:a=["rgba(0,0,0,0)","#000"],o.gradient(e,a);break;default:}},_getHSpaceColor:function(){return this.options.mode==="hsv"?this.color.toHsv():this.color.toHsl()},_dimensions:function(t){var n=this,r=n.options,i=n.picker.find(".iris-picker-inner"),s=n.controls,o=s.square,u=n.picker.find(".iris-strip"),a="77.5%",f="12%",l=20,c=r.border?r.width-l:r.width,h,p=e.isArray(r.palettes)?r.palettes.length:n._palettes.length,d,v,m;t&&(o.css("width",""),u.css("width",""),n.picker.removeAttr("style")),a=c*(parseFloat(a)/100),f=c*(parseFloat(f)/100),h=r.border?a+l:a,o.width(a).height(a),u.height(a).width(f),n.picker.css({width:r.width,height:h});if(!r.palettes)return;d=a*2/100,m=a-(p-1)*d,v=m/p,n.picker.find(".iris-palette").each(function(t,n){var r=t===0?0:d;e(this).css({width:v,height:v,marginLeft:r})}),n.picker.css("paddingBottom",v+d),u.height(v+d+a)},_addInputListeners:function(e){var t=this,n=100,r=function(n){var r=new Color(e.val()),i=e.val().replace(/^#/,"");e.removeClass("iris-error"),r.error?i!==""&&e.addClass("iris-error"):r.toString()!==t.color.toString()&&(n.type!=="keyup"||!i.match(/^[0-9a-fA-F]{3}$/))&&t._setOption("color",r.toString())};e.on("change",r).on("keyup",t._debounce(r,n))},_initControls:function(){var t=this,n=t.controls,r=n.square,i=t.options.controls,s=t._scale[i.strip];n.stripSlider.slider({orientation:"vertical",max:s,slide:function(e,n){t.active="strip",i.strip==="h"&&(n.value=s-n.value),t.color[i.strip](n.value),t._change.apply(t,arguments)}}),n.squareDrag.draggable({containment:"parent",zIndex:1e3,cursor:"move",drag:function(e,n){t._squareDrag(e,n)},start:function(){r.addClass("iris-dragging"),e(this).addClass("ui-state-focus")},stop:function(){r.removeClass("iris-dragging"),e(this).removeClass("ui-state-focus")}}).on("mousedown mouseup",function(n){n.preventDefault();var r="ui-state-focus";n.type==="mousedown"?(t.picker.find("."+r).removeClass(r).blur(),e(this).addClass(r).focus()):e(this).removeClass(r)}).on("keydown",function(e){var r=n.square,i=n.squareDrag,s=i.position(),o=t.options.width/100;e.altKey&&(o*=10);switch(e.keyCode){case 37:s.left-=o;break;case 38:s.top-=o;break;case 39:s.left+=o;break;case 40:s.top+=o;break;default:return!0}s.left=Math.max(0,Math.min(s.left,r.width())),s.top=Math.max(0,Math.min(s.top,r.height())),i.css(s),t._squareDrag(e,{position:s}),e.preventDefault()}),r.mousedown(function(n){if(n.which!==1)return;if(!e(n.target).is("div"))return;var r=t.controls.square.offset(),i={top:n.pageY-r.top,left:n.pageX-r.left};n.preventDefault(),t._squareDrag(n,{position:i}),n.target=t.controls.squareDrag.get(0),t.controls.squareDrag.css(i).trigger(n)}),t.options.palettes&&t.picker.find(".iris-palette-container").on("click",".iris-palette",function(n){t.color.fromCSS(e(this).data("color")),t.active="external",t._change()}).on("keydown",".iris-palette",function(t){if(t.keyCode!==13&&t.keyCode!==32)return!0;t.stopPropagation(),e(this).click()})},_squareDrag:function(e,t){var n=this,r=n.options.controls,i=n._squareDimensions(),s=Math.round((i.h-t.position.top)/i.h*n._scale[r.vert]),o=n._scale[r.horiz]-Math.round((i.w-t.position.left)/i.w*n._scale[r.horiz]);n.color[r.horiz](o)[r.vert](s),n.active="square",n._change.apply(n,arguments)},_setOption:function(e,t){var n=this.options[e];if(e==="color"){t=""+t;var r=t.replace(/^#/,""),i=(new Color(t)).setHSpace(this.options.mode);i.error||(this.color=i,this.options.color=this.options[e]=this.color.toString(),this.active="external",this._change())}},_squareDimensions:function(e){var n=this.controls.square,r,i;return e!==t&&n.data("dimensions")?n.data("dimensions"):(i=this.controls.squareDrag,r={w:n.width(),h:n.height()},n.data("dimensions",r),r)},_isNonHueControl:function(e,t){return e==="square"&&this.options.controls.strip==="h"?!0:t==="external"||t==="h"&&e==="strip"?!1:!0},_change:function(t,n){var r=this,i=r.controls,s=r._getHSpaceColor(),o=r.color.toString(),u=["square","strip"],a=r.options.controls,f=a[r.active]||"external",l=r.hue;r.active==="strip"?u=[]:r.active!=="external"&&u.pop(),e.each(u,function(e,t){var n;if(t!==r.active)switch(t){case"strip":n=a.strip==="h"?r._scale[a.strip]-s[a.strip]:s[a.strip],i.stripSlider.slider("value",n);break;case"square":var o=r._squareDimensions(),u={left:s[a.horiz]/r._scale[a.horiz]*o.w,top:o.h-s[a.vert]/r._scale[a.vert]*o.h};r.controls.squareDrag.css(u)}}),s.h!==l&&r._isNonHueControl(r.active,f)&&r.color.h(l),r.hue=r.color.h(),r.options.color=r.color.toString(),r._inited&&r._trigger("change",{type:r.active},{color:r.color}),r.element.is(":input")&&!r.color.error&&(r.element.removeClass("iris-error"),r.element.val()!==r.color.toString()&&r.element.val(r.color.toString())),r._paint(),r._inited=!0,r.active=!1},_debounce:function(e,t,n){var r,i;return function(){var s=this,o=arguments,u=function(){r=null,n||(i=e.apply(s,o))},a=n&&!r;return clearTimeout(r),r=setTimeout(u,t),a&&(i=e.apply(s,o)),i}},show:function(){this.picker.show()},hide:function(){this.picker.hide()},toggle:function(){this.picker.toggle()}};e.widget("a8c.iris",p),e('").appendTo("head")})(jQuery),function(e,t){var n=function(e,t){return this instanceof n?this._init(e,t):new n(e,t)};n.fn=n.prototype={_color:0,_alpha:1,error:!1,_hsl:{h:0,s:0,l:0},_hsv:{h:0,s:0,v:0},_hSpace:"hsl",_init:function(e){var n="noop";switch(typeof e){case"object":return e.a!==t&&this.a(e.a),n=e.r!==t?"fromRgb":e.l!==t?"fromHsl":e.v!==t?"fromHsv":n,this[n](e);case"string":return this.fromCSS(e);case"number":return this.fromInt(parseInt(e,10))}return this},_error:function(){return this.error=!0,this},clone:function(){var e=new n(this.toInt()),t=["_alpha","_hSpace","_hsl","_hsv","error"];for(var r=t.length-1;r>=0;r--)e[t[r]]=this[t[r]];return e},setHSpace:function(e){return this._hSpace=e==="hsv"?e:"hsl",this},noop:function(){return this},fromCSS:function(e){var t,n,r=/^(rgb|hs(l|v))a?\(/;this.error=!1,e=e.replace(/^\s+/,"").replace(/\s+$/,"").replace(/;$/,"");if(e.match(r)&&e.match(/\)$/)){n=e.replace(/(\s|%)/g,"").replace(r,"").replace(/,?\);?$/,"").split(",");if(n.length<3)return this._error();if(n.length===4){this.a(parseFloat(n.pop()));if(this.error)return this}for(var i=n.length-1;i>=0;i--){n[i]=parseInt(n[i],10);if(isNaN(n[i]))return this._error()}return e.match(/^rgb/)?this.fromRgb({r:n[0],g:n[1],b:n[2]}):e.match(/^hsv/)?this.fromHsv({h:n[0],s:n[1],v:n[2]}):this.fromHsl({h:n[0],s:n[1],l:n[2]})}return this.fromHex(e)},fromRgb:function(e,n){return typeof e!="object"||e.r===t||e.g===t||e.b===t?this._error():(this.error=!1,this.fromInt(parseInt((e.r<<16)+(e.g<<8)+e.b,10),n))},fromHex:function(e){return e=e.replace(/^#/,"").replace(/^0x/,""),e.length===3&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),this.error=!/^[0-9A-F]{6}$/i.test(e),this.fromInt(parseInt(e,16))},fromHsl:function(e){var n,r,i,s,o,u,a,f;return typeof e!="object"||e.h===t||e.s===t||e.l===t?this._error():(this._hsl=e,this._hSpace="hsl",u=e.h/360,a=e.s/100,f=e.l/100,a===0?n=r=i=f:(s=f<.5?f*(1+a):f+a-f*a,o=2*f-s,n=this.hue2rgb(o,s,u+1/3),r=this.hue2rgb(o,s,u),i=this.hue2rgb(o,s,u-1/3)),this.fromRgb({r:n*255,g:r*255,b:i*255},!0))},fromHsv:function(e){var n,r,i,s,o,u,a,f,l,c,h;if(typeof e!="object"||e.h===t||e.s===t||e.v===t)return this._error();this._hsv=e,this._hSpace="hsv",n=e.h/360,r=e.s/100,i=e.v/100,a=Math.floor(n*6),f=n*6-a,l=i*(1-r),c=i*(1-f*r),h=i*(1-(1-f)*r);switch(a%6){case 0:s=i,o=h,u=l;break;case 1:s=c,o=i,u=l;break;case 2:s=l,o=i,u=h;break;case 3:s=l,o=c,u=i;break;case 4:s=h,o=l,u=i;break;case 5:s=i,o=l,u=c}return this.fromRgb({r:s*255,g:o*255,b:u*255},!0)},fromInt:function(e,n){return this._color=parseInt(e,10),isNaN(this._color)&&(this._color=0),this._color>16777215?this._color=16777215:this._color<0&&(this._color=0),n===t&&(this._hsv.h=this._hsv.s=this._hsl.h=this._hsl.s=0),this},hue2rgb:function(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e},toString:function(){var e=parseInt(this._color,10).toString(16);if(this.error)return"";if(e.length<6)for(var t=6-e.length-1;t>=0;t--)e="0"+e;return"#"+e},toCSS:function(e,t){e=e||"hex",t=parseFloat(t||this._alpha);switch(e){case"rgb":case"rgba":var n=this.toRgb();return t<1?"rgba( "+n.r+", "+n.g+", "+n.b+", "+t+" )":"rgb( "+n.r+", "+n.g+", "+n.b+" )";case"hsl":case"hsla":var r=this.toHsl();return t<1?"hsla( "+r.h+", "+r.s+"%, "+r.l+"%, "+t+" )":"hsl( "+r.h+", "+r.s+"%, "+r.l+"% )";default:return this.toString()}},toRgb:function(){return{r:255&this._color>>16,g:255&this._color>>8,b:255&this._color}},toHsl:function(){var e=this.toRgb(),t=e.r/255,n=e.g/255,r=e.b/255,i=Math.max(t,n,r),s=Math.min(t,n,r),o,u,a=(i+s)/2;if(i===s)o=u=0;else{var f=i-s;u=a>.5?f/(2-i-s):f/(i+s);switch(i){case t:o=(n-r)/f+(nr?(t+.05)/(r+.05):(r+.05)/(t+.05)}throw"getDistanceLuminosityFrom requires a Color object"},getMaxContrastColor:function(){var e=this.toLuminosity(),t=e>=.5?"000000":"ffffff";return new n(t)},getGrayscaleContrastingColor:function(e){if(!e)return this.getMaxContrastColor();var t=e<5?5:e,n=this.getMaxContrastColor();e=n.getDistanceLuminosityFrom(this);if(e<=t)return n;var r=0===n.toInt()?1:-1;while(e>t)n=n.incrementLightness(r),e=n.getDistanceLuminosityFrom(this);return n},getReadableContrastingColor:function(e,r){if(!e instanceof n)return this;var i=r===t?5:r,s=e.getDistanceLuminosityFrom(this),o=e.getMaxContrastColor(),u=o.getDistanceLuminosityFrom(e);if(u<=i)return o;if(s>=i)return this;var a=0===o.toInt()?-1:1;while(sn.range[1]?n.range[1]:r),s[e]=r,this._spaceFunc("from",n.space,s))}},_spaceFunc:function(e,t,n){var r=t||this._hSpace,i=e+r.charAt(0).toUpperCase()+r.substr(1);return this[i](n)}};var r={h:{mod:360},s:{range:[0,100]},l:{space:"hsl",range:[0,100]},v:{space:"hsv",range:[0,100]},r:{space:"rgb",range:[0,255]},g:{space:"rgb",range:[0,255]},b:{space:"rgb",range:[0,255]}};for(var i in r)r.hasOwnProperty(i)&&(n.fn[i]=n.fn._partial(i));e.Color=n}(typeof exports=="object"&&exports||this); \ No newline at end of file diff --git a/public/inc/js/media-uploader.js b/public/inc/js/media-uploader.js new file mode 100644 index 0000000..3112d27 --- /dev/null +++ b/public/inc/js/media-uploader.js @@ -0,0 +1,79 @@ +jQuery(document).ready(function($){ + + var optionsframework_upload; + var optionsframework_selector; + + function optionsframework_add_file(event, selector) { + + var upload = $(".uploaded-file"), frame; + var $el = $(this); + optionsframework_selector = selector; + + event.preventDefault(); + + // If the media frame already exists, reopen it. + if ( optionsframework_upload ) { + optionsframework_upload.open(); + } else { + // Create the media frame. + optionsframework_upload = wp.media.frames.optionsframework_upload = wp.media({ + // Set the title of the modal. + title: $el.data('choose'), + + // Customize the submit button. + button: { + // Set the text of the button. + text: $el.data('update'), + // Tell the button not to close the modal, since we're + // going to refresh the page when the image is selected. + close: false + } + }); + + // When an image is selected, run a callback. + optionsframework_upload.on( 'select', function() { + // Grab the selected attachment. + var attachment = optionsframework_upload.state().get('selection').first(); + optionsframework_upload.close(); + optionsframework_selector.find('.upload').val(attachment.attributes.url); + if ( attachment.attributes.type == 'image' ) { + optionsframework_selector.find('.screenshot').empty().hide().append('Remove').slideDown('fast'); + } + optionsframework_selector.find('.upload-button').unbind().addClass('remove-file').removeClass('upload-button').val(optionsframework_l10n.remove); + optionsframework_selector.find('.of-background-properties').slideDown(); + optionsframework_selector.find('.remove-image, .remove-file').on('click', function() { + optionsframework_remove_file( $(this).parents('.section') ); + }); + }); + + } + + // Finally, open the modal. + optionsframework_upload.open(); + } + + function optionsframework_remove_file(selector) { + selector.find('.remove-image').hide(); + selector.find('.upload').val(''); + selector.find('.of-background-properties').hide(); + selector.find('.screenshot').slideUp(); + selector.find('.remove-file').unbind().addClass('upload-button').removeClass('remove-file').val(optionsframework_l10n.upload); + // We don't display the upload button if .upload-notice is present + // This means the user doesn't have the WordPress 3.5 Media Library Support + if ( $('.section-upload .upload-notice').length > 0 ) { + $('.upload-button').remove(); + } + selector.find('.upload-button').on('click', function(event) { + optionsframework_add_file(event, $(this).parents('.section')); + }); + } + + $('.remove-image, .remove-file').on('click', function() { + optionsframework_remove_file( $(this).parents('.section') ); + }); + + $('.upload-button').click( function( event ) { + optionsframework_add_file(event, $(this).parents('.section')); + }); + +}); \ No newline at end of file diff --git a/public/inc/js/options-custom.js b/public/inc/js/options-custom.js new file mode 100644 index 0000000..522c601 --- /dev/null +++ b/public/inc/js/options-custom.js @@ -0,0 +1,91 @@ +/** + * Prints out the inline javascript needed for the colorpicker and choosing + * the tabs in the panel. + */ + +jQuery(document).ready(function($) { + + // Fade out the save message + $('.fade').delay(1000).fadeOut(1000); + + $('.of-color').wpColorPicker(); + + // Switches option sections + $('.group').hide(); + var active_tab = ''; + if (typeof(localStorage) != 'undefined' ) { + active_tab = localStorage.getItem("active_tab"); + } + if (active_tab != '' && $(active_tab).length ) { + $(active_tab).fadeIn(); + } else { + $('.group:first').fadeIn(); + } + $('.group .collapsed').each(function(){ + $(this).find('input:checked').parent().parent().parent().nextAll().each( + function(){ + if ($(this).hasClass('last')) { + $(this).removeClass('hidden'); + return false; + } + $(this).filter('.hidden').removeClass('hidden'); + }); + }); + if (active_tab != '' && $(active_tab + '-tab').length ) { + $(active_tab + '-tab').addClass('nav-tab-active'); + } + else { + $('.nav-tab-wrapper a:first').addClass('nav-tab-active'); + } + + $('.nav-tab-wrapper a').click(function(evt) { + $('.nav-tab-wrapper a').removeClass('nav-tab-active'); + $(this).addClass('nav-tab-active').blur(); + var clicked_group = $(this).attr('href'); + if (typeof(localStorage) != 'undefined' ) { + localStorage.setItem("active_tab", $(this).attr('href')); + } + $('.group').hide(); + $(clicked_group).fadeIn(); + evt.preventDefault(); + + // Editor Height (needs improvement) + $('.wp-editor-wrap').each(function() { + var editor_iframe = $(this).find('iframe'); + if ( editor_iframe.height() < 30 ) { + editor_iframe.css({'height':'auto'}); + } + }); + + }); + + $('.group .collapsed input:checkbox').click(unhideHidden); + + function unhideHidden(){ + if ($(this).attr('checked')) { + $(this).parent().parent().parent().nextAll().removeClass('hidden'); + } + else { + $(this).parent().parent().parent().nextAll().each( + function(){ + if ($(this).filter('.last').length) { + $(this).addClass('hidden'); + return false; + } + $(this).addClass('hidden'); + }); + + } + } + + // Image Options + $('.of-radio-img-img').click(function(){ + $(this).parent().parent().find('.of-radio-img-img').removeClass('of-radio-img-selected'); + $(this).addClass('of-radio-img-selected'); + }); + + $('.of-radio-img-label').hide(); + $('.of-radio-img-img').show(); + $('.of-radio-img-radio').hide(); + +}); \ No newline at end of file diff --git a/public/js/app.js b/public/js/app.js new file mode 100644 index 0000000..fa9e7a5 --- /dev/null +++ b/public/js/app.js @@ -0,0 +1,1200 @@ +/* + * Siren application js + * @author Louie + * @url http://i94.me + * @date 2016.11.19 + */ +// DOM 查询缓存器 +const getEl = (()=>{ + const cache = new Map(); + return (id)=>{ + if (!cache.has(id) || !document.body.contains(cache.get(id))) { + cache.set(id, document.getElementById(id)); // 自动更新无效缓存 + } + return cache.get(id); + }; +})(); +const SafeStorage = { + get(key) { + try { + return localStorage.getItem(key); + } catch (e) { + return null; + } + }, + set(key, value) { + try { + localStorage.setItem(key, value); + } catch (e) { + return null; + } + } +}; +// 防抖函数 +const debounce = (fn,delay)=>{ + let timer; + return function(...args) { + clearTimeout(timer); + timer = setTimeout(()=>fn.apply(this, args), delay); + }; +}; +// 表情 +function grin(emoji) { + const textarea = getEl("comment"); + // 元素校验 + if (!(textarea instanceof HTMLTextAreaElement)) return; + try { + const startPos = textarea.selectionStart; + const endPos = textarea.selectionEnd; + const wrappedEmoji = `${emoji}`; + // 使用现代文本操作API + textarea.setRangeText(wrappedEmoji, startPos, endPos, 'end'); + // 设置光标 焦点管理 + requestAnimationFrame(()=>{ + textarea.focus(); + const newCursor = startPos + wrappedEmoji.length; + textarea.setSelectionRange(newCursor, newCursor); + }); + // 触发输入事件 + textarea.dispatchEvent(new Event('input',{ + bubbles: true + })); + } catch (error) {} +} + +// baguetteBox Libs +var baguetteBox = function() { + function t(t, n) { + H.transforms = f(); + H.svg = g(); + e(); + j = document.querySelectorAll(t); + for (let i = 0; i < j.length; i++) { + const el = j[i]; + if (n && n.filter) { + A = n.filter; + } + const links = el.getElementsByTagName("a"); + const filteredLinks = []; + for (let k = 0; k < links.length; k++) { + if (A.test(links[k].href)) { + filteredLinks.push(links[k]); + } + } + const o = D.length; + D.push(filteredLinks); + D[o].options = n; + for (let l = 0; l < D[o].length; l++) { + const link = D[o][l]; + link.addEventListener("click", function(event) { + event.preventDefault(); + i(o); + a(l); + }); + } + } + } + + function e() { + const b = document.getElementById("baguetteBox-overlay"); + if (b) { + k = document.getElementById("baguetteBox-slider"); + w = document.getElementById("previous-button"); + C = document.getElementById("next-button"); + T = document.getElementById("close-button"); + } else { + const b = document.createElement("div"); + b.id = "baguetteBox-overlay"; + document.body.appendChild(b); + k = document.createElement("div"); + k.id = "baguetteBox-slider"; + b.appendChild(k); + w = document.createElement("button"); + w.id = "previous-button"; + w.innerHTML = H.svg ? E : "<"; + b.appendChild(w); + C = document.createElement("button"); + C.id = "next-button"; + C.innerHTML = H.svg ? x : ">"; + b.appendChild(C); + T = document.createElement("button"); + T.id = "close-button"; + T.innerHTML = H.svg ? B : "X"; + b.appendChild(T); + w.className = C.className = T.className = "baguetteBox-button"; + n(); + } + } + + function n() { + const b = document.getElementById("baguetteBox-overlay"); + b.addEventListener("click", function(event) { + if (event.target && event.target.nodeName!== "IMG" && event.target.nodeName!== "FIGCAPTION") { + r(); + } + }); + w.addEventListener("click", function(event) { + event.stopPropagation(); + c(); + }); + C.addEventListener("click", function(event) { + event.stopPropagation(); + u(); + }); + T.addEventListener("click", function(event) { + event.stopPropagation(); + r(); + }); + b.addEventListener("touchstart", function(event) { + N = event.changedTouches[0].pageX; + }); + b.addEventListener("touchmove", function(event) { + if (!S) { + event.preventDefault(); + const touch = event.touches[0] || event.changedTouches[0]; + if (touch.pageX - N > 40) { + S = true; + c(); + } else if (touch.pageX - N < -40) { + S = true; + u(); + } + } + }); + b.addEventListener("touchend", function() { + S = false; + }); + document.addEventListener("keydown", function(event) { + switch (event.keyCode) { + case 37: + c(); + break; + case 39: + u(); + break; + case 27: + r(); + break; + } + }); + } + + function i(t) { + if (M!== t) { + M = t; + o(D[t].options); + while (k.firstChild) { + k.removeChild(k.firstChild); + } + X.length = 0; + for (let n = 0; n < D[t].length; n++) { + const e = document.createElement("div"); + e.className = "full-image"; + e.id = "baguette-img-" + n; + X.push(e); + k.appendChild(X[n]); + } + } + } + + function o(t) { + t = t || {}; + for (const e in P) { + I[e] = P[e]; + if (typeof t[e]!== "undefined") { + I[e] = t[e]; + } + } + k.style.transition = k.style.webkitTransition = I.animation === "fadeIn"? "opacity .4s ease" : I.animation === "slideIn"? "" : "none"; + if (I.buttons === "auto") { + if ("ontouchstart" in window || D[M].length === 1) { + I.buttons = false; + } + } + w.style.display = C.style.display = I.buttons? "" : "none"; + } + + function a(t) { + const b = document.getElementById("baguetteBox-overlay"); + if (b.style.display!== "block") { + L = t; + s(L, function() { + p(L); + h(L); + }); + d(); + b.style.display = "block"; + setTimeout(function() { + b.className = "visible"; + if (I.afterShow) { + I.afterShow(); + } + }, 50); + if (I.onChange) { + I.onChange(L, X.length); + } + } + } + + function r() { + const b = document.getElementById("baguetteBox-overlay"); + if (b.style.display!== "none") { + b.className = ""; + setTimeout(function() { + b.style.display = "none"; + if (I.afterHide) { + I.afterHide(); + } + }, 500); + } + } + + function s(t, e) { + const n = X[t]; + if (typeof n!== "undefined") { + if (n.getElementsByTagName("img")[0]) { + if (e) { + e(); + } + return; + } + const imageElement = D[M][t]; + const imageCaption = typeof I.captions === "function"? I.captions.call(D[M], imageElement) : imageElement.getAttribute("data-caption") || imageElement.title; + const imageSrc = l(imageElement); + const i = document.createElement("figure"); + const o = document.createElement("img"); + const a = document.createElement("figcaption"); + n.appendChild(i); + i.innerHTML = '
'; + o.onload = function() { + const n = document.querySelector("#baguette-img-" + t + " .spinner"); + i.removeChild(n); + if (!I.async && e) { + e(); + } + }; + o.setAttribute("src", imageSrc); + i.appendChild(o); + if (I.captions && imageCaption) { + a.innerHTML = imageCaption; + i.appendChild(a); + } + if (I.async && e) { + e(); + } + } + } + + function l(t) { + let e = t.href; + if (t.dataset) { + const n = {}; + for (const i in t.dataset) { + if (i.substring(0, 3) === "at-" &&!isNaN(i.substring(3))) { + n[i.replace("at-", "")] = t.dataset[i]; + } + } + const keys = Object.keys(n).sort(function(t, e) { + return parseInt(t) < parseInt(e)? -1 : 1; + }); + const o = window.innerWidth * window.devicePixelRatio; + let a = 0; + for (; a < keys.length - 1 && keys[a] < o; a++); + e = n[keys[a]] || e; + } + return e; + } + + function u() { + let t; + if (L <= X.length - 2) { + L++; + d(); + p(L); + t = true; + } else if (I.animation) { + k.className = "bounce-from-right"; + setTimeout(function() { + k.className = ""; + }, 400); + t = false; + } + if (I.onChange) { + I.onChange(L, X.length); + } + return t; + } + + function c() { + let t; + if (L >= 1) { + L--; + d(); + h(L); + t = true; + } else if (I.animation) { + k.className = "bounce-from-left"; + setTimeout(function() { + k.className = ""; + }, 400); + t = false; + } + if (I.onChange) { + I.onChange(L, X.length); + } + return t; + } + + function d() { + const t = 100 * -L + "%"; + if (I.animation === "fadeIn") { + k.style.opacity = 0; + setTimeout(function() { + if (H.transforms) { + k.style.transform = k.style.webkitTransform = "translate3d(" + t + ",0,0)"; + } else { + k.style.left = t; + } + k.style.opacity = 1; + }, 400); + } else if (H.transforms) { + k.style.transform = k.style.webkitTransform = "translate3d(" + t + ",0,0)"; + } else { + k.style.left = t; + } + } + + function f() { + const t = document.createElement("div"); + return typeof t.style.perspective!== "undefined" || typeof t.style.webkitPerspective!== "undefined"; + } + + function g() { + const t = document.createElement("div"); + t.innerHTML = ""; + return t.firstChild && t.firstChild.namespaceURI === "http://www.w3.org/2000/svg"; + } + + function p(t) { + if (t - L >= I.preload) { + s(t + 1, function() { + p(t + 1); + }); + } + } + + function h(t) { + if (L - t >= I.preload) { + s(t - 1, function() { + h(t - 1); + }); + } + } + + let b, k, w, C, T, N; + const E = ''; + const x = ''; + const B = ''; + const I = {}; + const P = { + captions: true, + buttons: "auto", + async: false, + preload: 2, + animation: "slideIn", + afterShow: null, + afterHide: null, + onChange: null + }; + const H = {}; + let L = 0; + let M = -1; + let S = false; + const A = /.+\.(gif|jpe?g|png|webp)/i; + let j = []; + let D = []; + let X = []; + + return { + run: t, + showNext: u, + showPrevious: c + }; +}(); + +const home = location.href; +const s = document.getElementById('bgvideo'); + +const Siren = { + // 移动端菜单 + MN: function() { + const iconflat = document.querySelector('.iconflat'); + if (iconflat) { + iconflat.addEventListener('click', function() { + document.body.classList.toggle('navOpen'); + const mainContainer = document.getElementById('main-container'); + const moNav = document.getElementById('mo-nav'); + const openNav = document.querySelector('.openNav'); + if (mainContainer) { + mainContainer.classList.toggle('open'); + } + if (moNav) { + moNav.classList.toggle('open'); + } + if (openNav) { + openNav.classList.toggle('open'); + } + }); + } + }, + + // 移动端菜单自动隐藏 + MNH: function() { + if (document.body.classList.contains('navOpen')) { + document.body.classList.toggle('navOpen'); + const mainContainer = document.getElementById('main-container'); + const moNav = document.getElementById('mo-nav'); + const openNav = document.querySelector('.openNav'); + if (mainContainer) { + mainContainer.classList.toggle('open'); + } + if (moNav) { + moNav.classList.toggle('open'); + } + if (openNav) { + openNav.classList.toggle('open'); + } + } + }, + + // 背景视频 + splay: function() { + const videoBtn = document.getElementById('video-btn'); + if (videoBtn) { + videoBtn.classList.add('video-pause'); + videoBtn.classList.remove('video-play'); + videoBtn.style.display = 'block'; + const videoStu = document.querySelector('.video-stu'); + if (videoStu) { + videoStu.style.bottom = '-100px'; + } + if (s) { + s.play(); + } + } + }, + spause: function() { + const videoBtn = document.getElementById('video-btn'); + if (videoBtn) { + videoBtn.classList.add('video-play'); + videoBtn.classList.remove('video-pause'); + if (s) { + s.pause(); + } + } + }, + liveplay: function() { + if (s && s.oncanplay!== undefined && document.querySelectorAll('.haslive').length > 0) { + if (document.querySelectorAll('.videolive').length > 0) { + Siren.splay(); + } + } + }, + livepause: function() { + if (s && s.oncanplay!== undefined && document.querySelectorAll('.haslive').length > 0) { + Siren.spause(); + const videoStu = document.querySelector('.video-stu'); + if (videoStu) { + videoStu.style.bottom = '0px'; + videoStu.innerHTML = '已暂停 ...'; + } + } + }, + addsource: function() { + const videoStu = document.querySelector('.video-stu'); + if (videoStu) { + videoStu.innerHTML = '正在载入视频 ...'; + videoStu.style.bottom = '0px'; + } + const t = Poi.movies.name.split(","); + const _t = t[Math.floor(Math.random() * t.length)]; + const bgvideo = document.getElementById('bgvideo'); + if (bgvideo) { + bgvideo.setAttribute('src', Poi.movies.url + '/' + _t + '.mp4'); + bgvideo.setAttribute('video-name', _t); + } + }, + LV: function() { + const _btn = document.getElementById('video-btn'); + if (_btn) { + _btn.addEventListener('click', function() { + if (_btn.classList.contains('loadvideo')) { + _btn.classList.add('video-pause'); + _btn.classList.remove('loadvideo'); + _btn.style.display = 'none'; + Siren.addsource(); + if (s) { + s.oncanplay = function() { + Siren.splay(); + const videoAdd = document.getElementById('video-add'); + if (videoAdd) { + videoAdd.style.display = 'block'; + } + _btn.classList.add('videolive'); + _btn.classList.add('haslive'); + }; + } + } else { + if (_btn.classList.contains('video-pause')) { + Siren.spause(); + _btn.classList.remove('videolive'); + const videoStu = document.querySelector('.video-stu'); + if (videoStu) { + videoStu.style.bottom = '0px'; + videoStu.innerHTML = '已暂停 ...'; + } + } else { + Siren.splay(); + _btn.classList.add('videolive'); + } + } + if (s) { + s.onended = function() { + const bgvideo = document.getElementById('bgvideo'); + if (bgvideo) { + bgvideo.setAttribute('src', ''); + } + const videoAdd = document.getElementById('video-add'); + if (videoAdd) { + videoAdd.style.display = 'none'; + } + _btn.classList.add('loadvideo'); + _btn.classList.remove('video-pause'); + _btn.classList.remove('videolive'); + _btn.classList.remove('haslive'); + }; + } + }); + const videoAdd = document.getElementById('video-add'); + if (videoAdd) { + videoAdd.addEventListener('click', function() { + Siren.addsource(); + }); + } + } + }, + + // 自适应窗口高度 + AH: function() { + if (Poi.windowheight === 'auto') { + const mainTitle = document.querySelector('h1.main-title'); + if (mainTitle) { + const _height = window.innerHeight; + const centerbg = document.getElementById('centerbg'); + if (centerbg) { + centerbg.style.height = _height + 'px'; + } + const bgvideo = document.getElementById('bgvideo'); + if (bgvideo) { + bgvideo.style.minHeight = _height + 'px'; + } + window.addEventListener('resize', function() { + Siren.AH(); + }); + } + } else { + const headertop = document.querySelector('.headertop'); + if (headertop) { + headertop.classList.add('headertop-bar'); + } + } + }, + + // 进程 + PE: function() { + const headertop = document.querySelector('.headertop'); + if (headertop) { + const mainTitle = document.querySelector('h1.main-title'); + const blank = document.querySelector('.blank'); + if (mainTitle) { + if (blank) { + blank.style.paddingTop = '0px'; + } + headertop.style.height = 'auto'; + headertop.style.display = 'block'; + if (Poi.movies.live === 'open') { + Siren.liveplay(); + } + } else { + if (blank) { + blank.style.paddingTop = '80px'; + } + headertop.style.height = '0px'; + headertop.style.display = 'none'; + Siren.livepause(); + } + } + }, + + // 点击事件 + CE: function() { + // 显示&隐藏评论 + const commentsHidden = document.querySelector('.comments-hidden'); + const commentsMain = document.querySelector('.comments-main'); + if (commentsHidden) { + commentsHidden.style.display = 'block'; + } + if (commentsMain) { + commentsMain.style.display = 'none'; + } + if (commentsHidden) { + commentsHidden.addEventListener('click', function() { + if (commentsMain) { + commentsMain.style.display = 'block'; + commentsHidden.style.display = 'none'; + } + }); + } + + // 归档页 + const archives = document.querySelectorAll('.archives'); + const archivesTempH3 = document.querySelectorAll('#archives-temp h3'); + if (archives.length > 0) { + for (let i = 1; i < archives.length; i++) { + archives[i].style.display = 'none'; + } + archives[0].style.display = 'block'; + } + if (archivesTempH3.length > 0) { + for (let i = 0; i < archivesTempH3.length; i++) { + archivesTempH3[i].addEventListener('click', function(event) { + event.preventDefault(); + const nextElement = this.nextElementSibling; + if (nextElement) { + if (nextElement.style.display === 'none') { + nextElement.style.display = 'block'; + } else { + nextElement.style.display = 'none'; + } + } + }); + } + } + + // 灯箱 + baguetteBox.run('.entry-content', { + captions: function(element) { + const img = element.getElementsByTagName('img')[0]; + return img? img.alt : ''; + } + }); + + // 搜索框 + const jsToggleSearch = document.querySelector('.js-toggle-search'); + const jsSearch = document.querySelector('.js-search'); + if (jsToggleSearch) { + jsToggleSearch.addEventListener('click', function() { + this.classList.toggle('is-active'); + if (jsSearch) { + jsSearch.classList.toggle('is-visible'); + } + }); + } + const searchClose = document.querySelector('.search_close'); + if (searchClose) { + searchClose.addEventListener('click', function() { + if (jsSearch && jsSearch.classList.contains('is-visible')) { + if (jsToggleSearch) { + jsToggleSearch.classList.toggle('is-active'); + } + jsSearch.classList.toggle('is-visible'); + } + }); + } + + // 导航菜单 + const showNav = document.getElementById('show-nav'); + if (showNav) { + showNav.addEventListener('click', function() { + if (showNav.classList.contains('showNav')) { + showNav.classList.remove('showNav'); + showNav.classList.add('hideNav'); + const nav = document.querySelector('.site-top .lower nav'); + if (nav) { + nav.classList.add('navbar'); + } + } else { + showNav.classList.remove('hideNav'); + showNav.classList.add('showNav'); + const nav = document.querySelector('.site-top .lower nav'); + if (nav) { + nav.classList.remove('navbar'); + } + } + }); + } + + // 过渡动画 + const loading = document.getElementById("loading"); + if (loading) { + loading.addEventListener('click', function() { + loading.style.display = 'none'; + }); + } + + // 打开表情框 + const smliButton = document.querySelector(".smli-button"); + const smiliesBox = document.querySelector(".smilies-box"); + if (smliButton) { + smliButton.addEventListener('click', function() { + if (smiliesBox) { + if (smiliesBox.style.display === 'none') { + smiliesBox.style.display = 'block'; + } else { + smiliesBox.style.display = 'none'; + } + } + }); + } + + const weixin = document.getElementById('weixin'); + const qrcodeOpen = document.getElementById('qrcode-open'); + const blackMask = document.getElementById('black_mask'); + const qrcode = document.getElementById('qrcode'); + if (weixin) { + weixin.addEventListener('click', function() { + if (qrcodeOpen) { + qrcodeOpen.classList.add("demo-open"); + } + if (blackMask) { + blackMask.classList.add("add_mask"); + } + if (qrcode) { + qrcode.innerHTML = ""; + new QRCode('qrcode', { + text: home, + colorDark: 'rgb(85, 85, 85)', + colorLight: '#ffffff', + width: '130', + height: '130', + correctLevel: QRCode.CorrectLevel.H + }); + } + }); + } + if (blackMask) { + blackMask.addEventListener('click', function() { + if (qrcodeOpen) { + qrcodeOpen.classList.remove("demo-open"); + } + if (blackMask) { + blackMask.classList.remove("add_mask"); + } + }); + } + }, + + // 合并返回顶部-导航栏显隐-滚动监听器 + GTNH: function() { + // 返回顶部相关元素 + const rocket = document.querySelector('.rocket'); + const wrapper = document.querySelector('.rocket-wrapper'); + // 导航栏相关元素 + const header = document.querySelector('.site-header'); + + // 安全校验 + if (!rocket || !header) return; + + // 共享状态变量 + let ticking = false; + let lastY = 0; + const headerClassList = header.classList; + + // 合并的滚动监听器 + window.addEventListener('scroll', () => { + if (ticking) return; + ticking = true; + + requestAnimationFrame(() => { + const y = window.scrollY; + + // 任务1: 控制火箭显隐 + wrapper.classList.toggle("rocket-visible", y > 100); + + // 任务2: 更新导航栏状态 + headerClassList.toggle('yya', y > 0); + headerClassList.toggle('gizle', y > 30); + headerClassList.toggle('sabit', y > 30 && y <= lastY); + + lastY = y; + ticking = false; + }); + }, { passive: true }); + + // 火箭点击事件 + wrapper.addEventListener('click', () => { + const startTime = performance.now(); + const startY = window.scrollY; + const viewportHeight = window.innerHeight; + const rocketRect = rocket.getBoundingClientRect(); + + // 计算初始基准位置(考虑当前滚动偏移) + const rocketStartY = rocketRect.top + startY; + + // 禁用 CSS 过渡干扰 + rocket.style.transition = 'none'; + + // 动画循环 + const animate = (currentTime) => { + const timeElapsed = currentTime - startTime; + const progress = Math.min(timeElapsed / 1200, 1); // 总时长 1200ms + + // 同步任务1: 窗口滚动 + const scrollEase = 1 - Math.pow(1 - progress, 4); + window.scrollTo(0, startY * (1 - scrollEase)); + + // 同步任务2: 火箭位移(换算为视口高度的200%) + const rocketOffset = viewportHeight * 2 * progress; + rocket.style.transform = `translate(-50%, calc(-100% - ${rocketOffset}px))`; + + // 继续动画或清理 + if (progress < 1) { + requestAnimationFrame(animate); + } else { + rocket.style.removeProperty('transform'); + rocket.style.removeProperty('transition'); + } + }; + + requestAnimationFrame(animate); + }); + }, + // Ajax评论 + XCS: function() { + const cancel = getEl('cancel-comment-reply-link'); + if (!cancel) return; + const cancelText = cancel.textContent; + // 预缓存常用元素 + ['respond', 'comment_parent', 'comment'].forEach(getEl); + // 创建提示条 + const butterbarHTML = message=> + `

${message}

`; + const notify = message=>{ + // 如果已有提示存在,先移除 + const existing = document.querySelector('.butterBar'); + if (existing) existing.remove(); + // 创建新的提示条 + const wrapper = document.createElement('div'); + wrapper.innerHTML = butterbarHTML(message); + const bar = wrapper.firstChild; + document.body.appendChild(bar); + // 3秒后自动移除 + setTimeout(()=>bar.remove(), 3000) + }; + + // 评论表单移动 + const moveForm = (commId,parentId,respondId)=>{ + const comm = getEl(commId); + const respond = getEl(respondId); + + const parent = getEl('comment_parent'); + if (!respond || !parent) return false; + cancel.textContent = cancelText; + // 创建临时div + let temp = getEl('wp-temp-form-div'); + if (!temp) { + temp = document.createElement('div'); + temp.id = 'wp-temp-form-div'; + temp.style.display = 'none'; + respond.parentNode.insertBefore(temp, respond); + elemCache.set('wp-temp-form-div', temp) // 更新缓存 + } + // 移动表单 + if (!comm) { + parent.value = '0'; + temp.parentNode.insertBefore(respond, temp); + temp.parentNode.removeChild(temp) + } else { + comm.parentNode.insertBefore(respond, comm.nextSibling) + } + // 滚动到表单 + window.scrollTo({ + top: respond.offsetTop - 180, + behavior: 'smooth' + }); + parent.value = parentId; + cancel.style.display = ''; + // 取消事件 + cancel.onclick = function() { + parent.value = '0'; + const temp = getEl('wp-temp-form-div'); + const respond = getEl('respond'); + if (temp && respond && temp.parentNode) { + temp.parentNode.insertBefore(respond, temp); + temp.parentNode.removeChild(temp); + } + this.style.display = 'none'; + this.onclick = null; + return false + }; + try { + getEl('comment')?.focus() + } catch (e) {} + return false + }; + // 评论提交处理 + document.body.addEventListener('submit', debounce(async function(e) { + if (e.target.id !== 'commentform') return; + e.preventDefault(); + // 防止重复提交 + if (e.target.dataset.submitting === 'true') return; + e.target.dataset.submitting = 'true'; + try { + notify("让我看看你是不是在说我坏话!"); + // 获取表单数据 + const formData = new FormData(e.target); + if (!formData.get('comment')?.trim()) { + throw new Error('评论内容不能为空'); + } + formData.append('action', 'ajax_comment'); + // 请求处理 + const controller = new AbortController(); + const timeoutId = setTimeout(()=>controller.abort(), 5000); + const response = await fetch(Poi.ajaxurl, { + method: 'POST', + body: formData, + credentials: 'same-origin', + signal: controller.signal + }); + clearTimeout(timeoutId); + if (!response.ok) { + throw new Error(await response.text() || '评论提交失败'); + } + // 处理响应 + const responseText = await response.text(); + const parser = new DOMParser(); + const tempDoc = parser.parseFromString(responseText, 'text/html'); + // 清空评论框 + document.querySelectorAll('textarea').forEach(t=>t.value = ''); + // 插入评论 + const fragment = document.createDocumentFragment(); + // 解析获取回应 HTML + const container = document.createElement('div'); + container.innerHTML = responseText; + // 尝试找到最外层
  • 标签 + let newComment = container.querySelector('li'); + if (!newComment) { + throw new Error("评论解析失败。"); + } + const parent = getEl('comment_parent')?.value || '0'; + if (parent !== '0') { + // 回复评论 + const parentComment = document.getElementById(`comment-${parent}`); + if (!parentComment) return; + let childrenContainer = parentComment.querySelector('.children'); + if (!childrenContainer) { + childrenContainer = document.createElement('ul'); + childrenContainer.className = 'children'; + parentComment.appendChild(childrenContainer); + } + childrenContainer.insertAdjacentElement('afterbegin', newComment); + } else { + // 新评论 + const list = document.querySelector('.comments-main .commentwrap'); + if (list) { + const method = Poi.order === 'asc' ? 'beforeend' : 'afterbegin'; + list.insertAdjacentElement(method, newComment); + } else { + // list 不存在,插在 respond 之前或之后 + const pos = Poi.formpostion === 'bottom' ? 'beforebegin' : 'afterend'; + getEl('respond').insertAdjacentElement(pos, newComment); + } + } + notify("算了,呈上去了!"); + // 重置状态 + cancel.style.display = 'none'; + cancel.onclick = null; + getEl('comment_parent').value = '0'; + // 处理临时元素 + const temp = getEl('wp-temp-form-div'); + const respond = getEl('respond'); + if (temp && respond && temp.parentNode) { + temp.parentNode.insertBefore(respond, temp); + temp.parentNode.removeChild(temp) + } + } catch (error) { + notify(error.message || '评论提交失败') ; + } finally { + e.target.dataset.submitting = 'false'; + } + }, 200), {passive: false, capture: true}); + // 导出评论方法 + // 不要覆盖WordPress内置的addComment功能 + if (window.addComment) { + // 扩展现有addComment对象,保留原有功能 + const originalMoveForm = window.addComment.moveForm; + window.addComment.createButterbar = notify; + // 有条件地覆盖moveForm,保持兼容性 + if (!originalMoveForm) { + window.addComment.moveForm = moveForm + } + } else { + window.addComment = { + moveForm, + createButterbar: notify + } + } + }, + // Ajax加载文章 + XLS: function() { + document.body.addEventListener('click', function(event) { + if (event.target.matches('#pagination a')) { + const link = event.target; + link.classList.add("loading"); + link.textContent = ""; + fetch(link.href + "#main", { + method: "POST" + }) + .then(response => response.text()) + .then(text => { + const parser = new DOMParser(); + const doc = parser.parseFromString(text, "text/html"); + const result = doc.querySelectorAll("#main .post"); + const nextHref = doc.querySelector("#pagination a")? doc.querySelector("#pagination a").href : undefined; + const main = document.getElementById("main"); + if (main) { + for (let i = 0; i < result.length; i++) { + main.appendChild(result[i]); + result[i].style.display = 'none'; + result[i].style.display = 'block'; + } + } + const paginationLink = document.querySelector("#pagination a"); + if (paginationLink) { + paginationLink.classList.remove("loading"); + paginationLink.textContent = "下一页"; + if (nextHref) { + paginationLink.href = nextHref; + } else { + const pagination = document.getElementById("pagination"); + if (pagination) { + pagination.innerHTML = "别翻了,真的没有了 ..."; + } + } + } + }); + event.preventDefault(); + } + }); + }, + IA: function() { + if (typeof POWERMODE !== 'function') return; + document.addEventListener('focusin', e=>{ + if (e.target.matches('input, textarea, [contenteditable]')) { + e.target.addEventListener('input', POWERMODE); + e.target.addEventListener('focusout', function cleanup() { + this.removeEventListener('input', POWERMODE); + this.removeEventListener('focusout', cleanup) + }) + } + }) + }, + // == 点赞功能模块 == + ZAN: function() { + // 初始化点赞状态 + document.querySelectorAll('.specsZan').forEach(btn=>{ + const id = btn.dataset.id; + if (!id) return; + const key = `${location.pathname}_specs_zan_${id}`; + if (SafeStorage.get(key)) { + btn.querySelector('i')?.classList.replace('icon-heart_line', 'icon-heart'); + btn.classList.add('permanent-done'); + } + }); + document.addEventListener('click', async e => { + const btn = e.target.closest('.specsZan'); + if (!btn) return; + const id = btn.dataset.id; + const key = `${location.pathname}_specs_zan_${id}`; + if (!id || btn.classList.contains('permanent-done')) return; + // UI 更新 + const icon = btn.querySelector('i'); + const countEl = btn.querySelector('.count'); + btn.classList.add('permanent-done'); + if (icon) + icon.classList.replace('icon-heart_line', 'icon-heart'); + if (countEl) { + const count = parseInt(countEl.textContent || '0', 10); + countEl.textContent = count + 1; + } + SafeStorage.set(key, 'true'); + btn.style.pointerEvents = 'none'; + // 发送请求 + try { + await fetch(Poi.ajaxurl, { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded' + }, + body: `action=specs_zan&um_id=${encodeURIComponent(id)}&um_action=ding` + }); + } catch (e) {} + }, { passive: true }); + }, + SFS: function() { + window.addEventListener('scroll', function() { + const htmlHeight = document.body.scrollHeight || document.documentElement.scrollHeight; + const clientHeight = window.innerHeight + 1; + const scrollTop = document.documentElement.scrollTop || document.body.scrollTop; + const pageNext = document.querySelector('#pagination a')? document.querySelector('#pagination a').href : undefined; + const loadKey = document.getElementById("add_post_time"); + // 这里可以添加下拉自动刷新的逻辑 + }); + } +}; + +document.addEventListener('DOMContentLoaded', function() { + Siren.MN(); + Siren.AH(); + Siren.PE(); + Siren.CE(); + Siren.GTNH(); + Siren.XLS(); + Siren.XCS(); + Siren.IA(); + Siren.ZAN(); + Siren.SFS(); + Siren.LV(); +}); + + +/* + * File skip-link-focus-fix.js. + * Helps with accessibility for keyboard only users. + * Learn more: https://git.io/vWdr2 +*/ +var isWebkit = navigator.userAgent.toLowerCase().indexOf('webkit') > -1; +var isOpera = navigator.userAgent.toLowerCase().indexOf('opera') > -1; +var isIe = navigator.userAgent.toLowerCase().indexOf('msie') > -1; + +if ((isWebkit || isOpera || isIe) && document.getElementById && window.addEventListener) { + window.addEventListener('hashchange', function() { + var id = location.hash.substring(1); + var element; + + if (!(/^[A-z0-9_-]+$/.test(id))) { + return; + } + + element = document.getElementById(id); + + if (element) { + if (!(/^(?:a|select|input|button|textarea)$/i.test(element.tagName))) { + element.tabIndex = -1; + } + + element.focus(); + } + }, false); +} + diff --git a/public/js/canvas-nest.min.js b/public/js/canvas-nest.min.js new file mode 100644 index 0000000..2ac8899 --- /dev/null +++ b/public/js/canvas-nest.min.js @@ -0,0 +1,99 @@ +! +function() { + function o(w, v, i) { + return w.getAttribute(v) || i + } + function j(i) { + return document.getElementsByTagName(i) + } + function l() { + var i = j("script"), + w = i.length, + v = i[w - 1]; + return { + l: w, + z: o(v, "zIndex", -1), + o: o(v, "opacity", 0.5), + c: o(v, "color", "92,92,92"), + n: o(v, "count", 99) + } + } + function k() { + r = u.width = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth, + n = u.height = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight + } + function b() { + e.clearRect(0, 0, r, n); + var w = [f].concat(t); + var x, v, A, B, z, y; + t.forEach(function(i) { + i.x += i.xa, + i.y += i.ya, + i.xa *= i.x > r || i.x < 0 ? -1 : 1, + i.ya *= i.y > n || i.y < 0 ? -1 : 1, + e.fillRect(i.x - 0.5, i.y - 0.5, 1, 1); + for (v = 0; v < w.length; v++) { + x = w[v]; + if (i !== x && null !== x.x && null !== x.y) { + B = i.x - x.x, + z = i.y - x.y, + y = B * B + z * z; + y < x.max && (x === f && y >= x.max / 2 && (i.x -= 0.03 * B, i.y -= 0.03 * z), A = (x.max - y) / x.max, e.beginPath(), e.lineWidth = A / 2, e.strokeStyle = "rgba(" + s.c + "," + (A + 0.2) + ")", e.moveTo(i.x, i.y), e.lineTo(x.x, x.y), e.stroke()) + } + } + w.splice(w.indexOf(i), 1) + }), + m(b) + } + var u = document.createElement("canvas"), + s = l(), + c = "c_n" + s.l, + e = u.getContext("2d"), + r, + n, + m = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || + function(i) { + window.setTimeout(i, 1000 / 45) + }, + a = Math.random, + f = { + x: null, + y: null, + max: 10000 + }; + u.id = c; + u.style.cssText = "position:fixed;top:0;left:0;z-index:" + s.z + ";opacity:" + s.o; + j("body")[0].appendChild(u); + k(), + window.onresize = k; + window.onmousemove = function(i) { + i = i || window.event, + f.x = i.clientX, + f.y = i.clientY + }, + window.onmouseout = function() { + f.x = null, + f.y = null + }; + for (var t = [], p = 0; s.n > p; p++) { + var h = a() * r, + g = a() * n, + q = 2 * a() - 1, + d = 2 * a() - 1; + t.push({ + x: h, + y: g, + xa: q, + ya: d, + max: 6000 + }) + } + setTimeout(function() { + b() + }, + 100) +} (); + + + + diff --git a/public/js/customizer.js b/public/js/customizer.js new file mode 100644 index 0000000..12074ea --- /dev/null +++ b/public/js/customizer.js @@ -0,0 +1,46 @@ +/** + * File customizer.js. + * + * Theme Customizer enhancements for a better user experience. + * + * Contains handlers to make Theme Customizer preview reload changes asynchronously. + */ + +( function( $ ) { + + // Site title and description. + wp.customize( 'blogname', function( value ) { + value.bind( function( to ) { + $( '.site-title a' ).text( to ); + } ); + } ); + wp.customize( 'blogdescription', function( value ) { + value.bind( function( to ) { + $( '.site-description' ).text( to ); + } ); + } ); + + // Header text color. + wp.customize( 'header_textcolor', function( value ) { + value.bind( function( to ) { + if ( 'blank' === to ) { + $( '.site-title a, .site-description' ).css( { + 'clip': 'rect(1px, 1px, 1px, 1px)', + 'position': 'absolute' + } ); + } else { + $( '.site-title a, .site-description' ).css( { + 'clip': 'auto', + 'position': 'relative' + } ); + $( '.site-title a, .site-description' ).css( { + 'color': to + } ); + } + } ); + } ); + +} )( jQuery ); + + + diff --git a/public/js/fish.js b/public/js/fish.js new file mode 100644 index 0000000..6fa02bd --- /dev/null +++ b/public/js/fish.js @@ -0,0 +1 @@ +(()=>{const CONFIG={POINT_INTERVAL:5,FISH_COUNT:3,MAX_INTERVAL_COUNT:50,INIT_HEIGHT_RATE:0.5,THRESHOLD:50,WATCH_INTERVAL:200};class Renderer{constructor(){this.init()}init(){this.setParameters();this.bindMethods();this.setup();this.bindEvent();this.render()}setParameters(){this.container=document.getElementById('jsi-flying-fish-container');this.canvas=document.createElement('canvas');this.ctx=this.canvas.getContext('2d');this.container.appendChild(this.canvas);this.points=[];this.fishes=[];this.resizeTimer=null;this.animationFrameId=null}createSurfacePoints(){const count=Math.round(this.width/CONFIG.POINT_INTERVAL);this.pointInterval=this.width/(count-1);for(let i=0;i0){point.setPreviousPoint(this.points[i-1]);this.points[i-1].setNextPoint(point)}this.points[i]=point}}bindMethods(){['handleResize','render','controlStatus','generateEpicenter'].forEach(method=>{this[method]=this[method].bind(this)})}setup(){const rect=this.container.getBoundingClientRect();this.width=rect.width;this.height=rect.height;this.fishCount=Math.ceil(CONFIG.FISH_COUNT*(this.width*this.height)/250000);this.canvas.width=this.width;this.canvas.height=this.height;this.manageFishInstances();this.createSurfacePoints()}manageFishInstances(){const targetCount=Math.max(this.fishCount,this.fishes.length);while(this.fishes.lengththis.setup(),CONFIG.WATCH_INTERVAL)}bindEvent(){const opts={passive:true};window.addEventListener('resize',this.handleResize,opts);window.addEventListener('beforeunload',()=>{window.removeEventListener('resize',this.handleResize);cancelAnimationFrame(this.animationFrameId)})}generateEpicenter(x,y,velocity){if(Math.abs(y-this.height/2)>CONFIG.THRESHOLD)return;const index=Math.round(x/this.pointInterval)|0;if(index>=0&&indexpoint.render(ctx));ctx.lineTo(width,height);ctx.closePath();ctx.fill();ctx.restore()}}class SurfacePoint{static SPRING=0.03;static FRICTION=0.9;static WAVE_SPREAD=0.3;static ACCELERATION=0.01;constructor(renderer){this.renderer=renderer;this.prev=null;this.next=null}init(x){this.x=x;this.baseHeight=this.renderer.height*CONFIG.INIT_HEIGHT_RATE;this.height=this.baseHeight;this.forceY=0;this.forces={prev:0,next:0}}interfere(y,velocity){const direction=(this.renderer.height-this.height-y>=0)?-1:1;this.forceY=this.renderer.height*SurfacePoint.ACCELERATION*direction*Math.abs(velocity)}updateSelf(){this.forceY+=SurfacePoint.SPRING*(this.baseHeight-this.height);this.forceY*=SurfacePoint.FRICTION;this.height+=this.forceY}updateNeighbors(){if(this.prev){this.forces.prev=SurfacePoint.WAVE_SPREAD*(this.height-this.prev.height)}if(this.next){this.forces.next=SurfacePoint.WAVE_SPREAD*(this.height-this.next.height)}}render(ctx){if(this.prev){this.prev.height+=this.forces.prev;this.prev.forceY+=this.forces.prev}if(this.next){this.next.height+=this.forces.next;this.next.forceY+=this.forces.next}ctx.lineTo(this.x,this.renderer.height-this.height)}setPreviousPoint(point){this.prev=point}setNextPoint(point){this.next=point}}class Fish{static GRAVITY=0.4;constructor(renderer){this.renderer=renderer;this.reset()}reset(){this.direction=Math.random()<0.5;this.x=this.direction?this.renderer.width+CONFIG.THRESHOLD:-CONFIG.THRESHOLD;this.vx=this.random(4,10)*(this.direction?-1:1);this.initMovement()}random(min,max){return min+(max-min)*Math.random()}initMovement(){const baseY=this.renderer.height*CONFIG.INIT_HEIGHT_RATE;this.y=this.random(baseY,baseY+this.renderer.height*0.3);this.vy=this.random(-5,-2);this.ay=this.random(-0.2,-0.05);this.theta=0;this.phi=0}update(){const thresholdY=this.renderer.height*CONFIG.INIT_HEIGHT_RATE;this.x+=this.vx;this.y+=this.vy;this.vy+=this.ay;if(this.y0&&this.x>this.renderer.width+CONFIG.THRESHOLD)||(this.vx<0&&this.x<-CONFIG.THRESHOLD)){this.reset()}this.theta=(this.theta+Math.PI/20)%(Math.PI*2);this.phi=(this.phi+Math.PI/30)%(Math.PI*2)}render(ctx){ctx.save();ctx.translate(this.x,this.y);ctx.rotate(Math.PI+Math.atan2(this.vy,this.vx));ctx.scale(1,this.direction?1:-1);ctx.beginPath();ctx.moveTo(-30,0);ctx.bezierCurveTo(-20,15,15,10,40,0);ctx.bezierCurveTo(15,-10,-20,-15,-30,0);ctx.fill();ctx.save();ctx.translate(40,0);ctx.scale(0.9+0.2*Math.sin(this.theta),1);ctx.beginPath();ctx.moveTo(0,0);ctx.quadraticCurveTo(5,10,20,8);ctx.quadraticCurveTo(12,5,10,0);ctx.quadraticCurveTo(12,-5,20,-8);ctx.quadraticCurveTo(5,-10,0,0);ctx.fill();ctx.restore();ctx.save();ctx.translate(-3,0);ctx.rotate(Math.PI/3+Math.PI/10*Math.sin(this.phi));ctx.beginPath();ctx.moveTo(-5,0);ctx.bezierCurveTo(-10,-10,-10,-30,0,-40);ctx.bezierCurveTo(12,-25,8,-10,0,0);ctx.closePath();ctx.fill();ctx.restore();ctx.restore();this.update()}}document.addEventListener('DOMContentLoaded',()=>new Renderer())})(); \ No newline at end of file diff --git a/public/js/html2jpg.js b/public/js/html2jpg.js new file mode 100644 index 0000000..7d21472 --- /dev/null +++ b/public/js/html2jpg.js @@ -0,0 +1,7267 @@ +// JSDocument + +/*! + * html2canvas 1.0.0-alpha.12 + * Copyright (c) 2018 Niklas von Hertzen + * Released under MIT License + */ +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(); + else if(typeof define === 'function' && define.amd) + define([], factory); + else if(typeof exports === 'object') + exports["html2canvas"] = factory(); + else + root["html2canvas"] = factory(); +})(this, function() { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { +/******/ configurable: false, +/******/ enumerable: true, +/******/ get: getter +/******/ }); +/******/ } +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = 27); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +// http://dev.w3.org/csswg/css-color/ + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var HEX3 = /^#([a-f0-9]{3})$/i; +var hex3 = function hex3(value) { + var match = value.match(HEX3); + if (match) { + return [parseInt(match[1][0] + match[1][0], 16), parseInt(match[1][1] + match[1][1], 16), parseInt(match[1][2] + match[1][2], 16), null]; + } + return false; +}; + +var HEX6 = /^#([a-f0-9]{6})$/i; +var hex6 = function hex6(value) { + var match = value.match(HEX6); + if (match) { + return [parseInt(match[1].substring(0, 2), 16), parseInt(match[1].substring(2, 4), 16), parseInt(match[1].substring(4, 6), 16), null]; + } + return false; +}; + +var RGB = /^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/; +var rgb = function rgb(value) { + var match = value.match(RGB); + if (match) { + return [Number(match[1]), Number(match[2]), Number(match[3]), null]; + } + return false; +}; + +var RGBA = /^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d?\.?\d+)\s*\)$/; +var rgba = function rgba(value) { + var match = value.match(RGBA); + if (match && match.length > 4) { + return [Number(match[1]), Number(match[2]), Number(match[3]), Number(match[4])]; + } + return false; +}; + +var fromArray = function fromArray(array) { + return [Math.min(array[0], 255), Math.min(array[1], 255), Math.min(array[2], 255), array.length > 3 ? array[3] : null]; +}; + +var namedColor = function namedColor(name) { + var color = NAMED_COLORS[name.toLowerCase()]; + return color ? color : false; +}; + +var Color = function () { + function Color(value) { + _classCallCheck(this, Color); + + var _ref = Array.isArray(value) ? fromArray(value) : hex3(value) || rgb(value) || rgba(value) || namedColor(value) || hex6(value) || [0, 0, 0, null], + _ref2 = _slicedToArray(_ref, 4), + r = _ref2[0], + g = _ref2[1], + b = _ref2[2], + a = _ref2[3]; + + this.r = r; + this.g = g; + this.b = b; + this.a = a; + } + + _createClass(Color, [{ + key: 'isTransparent', + value: function isTransparent() { + return this.a === 0; + } + }, { + key: 'toString', + value: function toString() { + return this.a !== null && this.a !== 1 ? 'rgba(' + this.r + ',' + this.g + ',' + this.b + ',' + this.a + ')' : 'rgb(' + this.r + ',' + this.g + ',' + this.b + ')'; + } + }]); + + return Color; +}(); + +exports.default = Color; + + +var NAMED_COLORS = { + transparent: [0, 0, 0, 0], + aliceblue: [240, 248, 255, null], + antiquewhite: [250, 235, 215, null], + aqua: [0, 255, 255, null], + aquamarine: [127, 255, 212, null], + azure: [240, 255, 255, null], + beige: [245, 245, 220, null], + bisque: [255, 228, 196, null], + black: [0, 0, 0, null], + blanchedalmond: [255, 235, 205, null], + blue: [0, 0, 255, null], + blueviolet: [138, 43, 226, null], + brown: [165, 42, 42, null], + burlywood: [222, 184, 135, null], + cadetblue: [95, 158, 160, null], + chartreuse: [127, 255, 0, null], + chocolate: [210, 105, 30, null], + coral: [255, 127, 80, null], + cornflowerblue: [100, 149, 237, null], + cornsilk: [255, 248, 220, null], + crimson: [220, 20, 60, null], + cyan: [0, 255, 255, null], + darkblue: [0, 0, 139, null], + darkcyan: [0, 139, 139, null], + darkgoldenrod: [184, 134, 11, null], + darkgray: [169, 169, 169, null], + darkgreen: [0, 100, 0, null], + darkgrey: [169, 169, 169, null], + darkkhaki: [189, 183, 107, null], + darkmagenta: [139, 0, 139, null], + darkolivegreen: [85, 107, 47, null], + darkorange: [255, 140, 0, null], + darkorchid: [153, 50, 204, null], + darkred: [139, 0, 0, null], + darksalmon: [233, 150, 122, null], + darkseagreen: [143, 188, 143, null], + darkslateblue: [72, 61, 139, null], + darkslategray: [47, 79, 79, null], + darkslategrey: [47, 79, 79, null], + darkturquoise: [0, 206, 209, null], + darkviolet: [148, 0, 211, null], + deeppink: [255, 20, 147, null], + deepskyblue: [0, 191, 255, null], + dimgray: [105, 105, 105, null], + dimgrey: [105, 105, 105, null], + dodgerblue: [30, 144, 255, null], + firebrick: [178, 34, 34, null], + floralwhite: [255, 250, 240, null], + forestgreen: [34, 139, 34, null], + fuchsia: [255, 0, 255, null], + gainsboro: [220, 220, 220, null], + ghostwhite: [248, 248, 255, null], + gold: [255, 215, 0, null], + goldenrod: [218, 165, 32, null], + gray: [128, 128, 128, null], + green: [0, 128, 0, null], + greenyellow: [173, 255, 47, null], + grey: [128, 128, 128, null], + honeydew: [240, 255, 240, null], + hotpink: [255, 105, 180, null], + indianred: [205, 92, 92, null], + indigo: [75, 0, 130, null], + ivory: [255, 255, 240, null], + khaki: [240, 230, 140, null], + lavender: [230, 230, 250, null], + lavenderblush: [255, 240, 245, null], + lawngreen: [124, 252, 0, null], + lemonchiffon: [255, 250, 205, null], + lightblue: [173, 216, 230, null], + lightcoral: [240, 128, 128, null], + lightcyan: [224, 255, 255, null], + lightgoldenrodyellow: [250, 250, 210, null], + lightgray: [211, 211, 211, null], + lightgreen: [144, 238, 144, null], + lightgrey: [211, 211, 211, null], + lightpink: [255, 182, 193, null], + lightsalmon: [255, 160, 122, null], + lightseagreen: [32, 178, 170, null], + lightskyblue: [135, 206, 250, null], + lightslategray: [119, 136, 153, null], + lightslategrey: [119, 136, 153, null], + lightsteelblue: [176, 196, 222, null], + lightyellow: [255, 255, 224, null], + lime: [0, 255, 0, null], + limegreen: [50, 205, 50, null], + linen: [250, 240, 230, null], + magenta: [255, 0, 255, null], + maroon: [128, 0, 0, null], + mediumaquamarine: [102, 205, 170, null], + mediumblue: [0, 0, 205, null], + mediumorchid: [186, 85, 211, null], + mediumpurple: [147, 112, 219, null], + mediumseagreen: [60, 179, 113, null], + mediumslateblue: [123, 104, 238, null], + mediumspringgreen: [0, 250, 154, null], + mediumturquoise: [72, 209, 204, null], + mediumvioletred: [199, 21, 133, null], + midnightblue: [25, 25, 112, null], + mintcream: [245, 255, 250, null], + mistyrose: [255, 228, 225, null], + moccasin: [255, 228, 181, null], + navajowhite: [255, 222, 173, null], + navy: [0, 0, 128, null], + oldlace: [253, 245, 230, null], + olive: [128, 128, 0, null], + olivedrab: [107, 142, 35, null], + orange: [255, 165, 0, null], + orangered: [255, 69, 0, null], + orchid: [218, 112, 214, null], + palegoldenrod: [238, 232, 170, null], + palegreen: [152, 251, 152, null], + paleturquoise: [175, 238, 238, null], + palevioletred: [219, 112, 147, null], + papayawhip: [255, 239, 213, null], + peachpuff: [255, 218, 185, null], + peru: [205, 133, 63, null], + pink: [255, 192, 203, null], + plum: [221, 160, 221, null], + powderblue: [176, 224, 230, null], + purple: [128, 0, 128, null], + rebeccapurple: [102, 51, 153, null], + red: [255, 0, 0, null], + rosybrown: [188, 143, 143, null], + royalblue: [65, 105, 225, null], + saddlebrown: [139, 69, 19, null], + salmon: [250, 128, 114, null], + sandybrown: [244, 164, 96, null], + seagreen: [46, 139, 87, null], + seashell: [255, 245, 238, null], + sienna: [160, 82, 45, null], + silver: [192, 192, 192, null], + skyblue: [135, 206, 235, null], + slateblue: [106, 90, 205, null], + slategray: [112, 128, 144, null], + slategrey: [112, 128, 144, null], + + snow: [255, 250, 250, null], + springgreen: [0, 255, 127, null], + steelblue: [70, 130, 180, null], + tan: [210, 180, 140, null], + teal: [0, 128, 128, null], + thistle: [216, 191, 216, null], + tomato: [255, 99, 71, null], + turquoise: [64, 224, 208, null], + violet: [238, 130, 238, null], + wheat: [245, 222, 179, null], + white: [255, 255, 255, null], + whitesmoke: [245, 245, 245, null], + yellow: [255, 255, 0, null], + yellowgreen: [154, 205, 50, null] +}; + +var TRANSPARENT = exports.TRANSPARENT = new Color([0, 0, 0, 0]); + +/***/ }), +/* 1 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var LENGTH_WITH_UNIT = /([\d.]+)(px|r?em|%)/i; + +var LENGTH_TYPE = exports.LENGTH_TYPE = { + PX: 0, + PERCENTAGE: 1 +}; + +var Length = function () { + function Length(value) { + _classCallCheck(this, Length); + + this.type = value.substr(value.length - 1) === '%' ? LENGTH_TYPE.PERCENTAGE : LENGTH_TYPE.PX; + var parsedValue = parseFloat(value); + if (true && isNaN(parsedValue)) { + console.error('Invalid value given for Length: "' + value + '"'); + } + this.value = isNaN(parsedValue) ? 0 : parsedValue; + } + + _createClass(Length, [{ + key: 'isPercentage', + value: function isPercentage() { + return this.type === LENGTH_TYPE.PERCENTAGE; + } + }, { + key: 'getAbsoluteValue', + value: function getAbsoluteValue(parentLength) { + return this.isPercentage() ? parentLength * (this.value / 100) : this.value; + } + }], [{ + key: 'create', + value: function create(v) { + return new Length(v); + } + }]); + + return Length; +}(); + +exports.default = Length; + + +var getRootFontSize = function getRootFontSize(container) { + var parent = container.parent; + return parent ? getRootFontSize(parent) : parseFloat(container.style.font.fontSize); +}; + +var calculateLengthFromValueWithUnit = exports.calculateLengthFromValueWithUnit = function calculateLengthFromValueWithUnit(container, value, unit) { + switch (unit) { + case 'px': + case '%': + return new Length(value + unit); + case 'em': + case 'rem': + var length = new Length(value); + length.value *= unit === 'em' ? parseFloat(container.style.font.fontSize) : getRootFontSize(container); + return length; + default: + // TODO: handle correctly if unknown unit is used + return new Length('0'); + } +}; + +/***/ }), +/* 2 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.parseBoundCurves = exports.calculatePaddingBoxPath = exports.calculateBorderBoxPath = exports.parsePathForBorder = exports.parseDocumentSize = exports.calculateContentBox = exports.calculatePaddingBox = exports.parseBounds = exports.Bounds = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _Vector = __webpack_require__(7); + +var _Vector2 = _interopRequireDefault(_Vector); + +var _BezierCurve = __webpack_require__(32); + +var _BezierCurve2 = _interopRequireDefault(_BezierCurve); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var TOP = 0; +var RIGHT = 1; +var BOTTOM = 2; +var LEFT = 3; + +var H = 0; +var V = 1; + +var Bounds = exports.Bounds = function () { + function Bounds(x, y, w, h) { + _classCallCheck(this, Bounds); + + this.left = x; + this.top = y; + this.width = w; + this.height = h; + } + + _createClass(Bounds, null, [{ + key: 'fromClientRect', + value: function fromClientRect(clientRect, scrollX, scrollY) { + return new Bounds(clientRect.left + scrollX, clientRect.top + scrollY, clientRect.width, clientRect.height); + } + }]); + + return Bounds; +}(); + +var parseBounds = exports.parseBounds = function parseBounds(node, scrollX, scrollY) { + return Bounds.fromClientRect(node.getBoundingClientRect(), scrollX, scrollY); +}; + +var calculatePaddingBox = exports.calculatePaddingBox = function calculatePaddingBox(bounds, borders) { + return new Bounds(bounds.left + borders[LEFT].borderWidth, bounds.top + borders[TOP].borderWidth, bounds.width - (borders[RIGHT].borderWidth + borders[LEFT].borderWidth), bounds.height - (borders[TOP].borderWidth + borders[BOTTOM].borderWidth)); +}; + +var calculateContentBox = exports.calculateContentBox = function calculateContentBox(bounds, padding, borders) { + // TODO support percentage paddings + var paddingTop = padding[TOP].value; + var paddingRight = padding[RIGHT].value; + var paddingBottom = padding[BOTTOM].value; + var paddingLeft = padding[LEFT].value; + + return new Bounds(bounds.left + paddingLeft + borders[LEFT].borderWidth, bounds.top + paddingTop + borders[TOP].borderWidth, bounds.width - (borders[RIGHT].borderWidth + borders[LEFT].borderWidth + paddingLeft + paddingRight), bounds.height - (borders[TOP].borderWidth + borders[BOTTOM].borderWidth + paddingTop + paddingBottom)); +}; + +var parseDocumentSize = exports.parseDocumentSize = function parseDocumentSize(document) { + var body = document.body; + var documentElement = document.documentElement; + + if (!body || !documentElement) { + throw new Error( true ? 'Unable to get document size' : ''); + } + var width = Math.max(Math.max(body.scrollWidth, documentElement.scrollWidth), Math.max(body.offsetWidth, documentElement.offsetWidth), Math.max(body.clientWidth, documentElement.clientWidth)); + + var height = Math.max(Math.max(body.scrollHeight, documentElement.scrollHeight), Math.max(body.offsetHeight, documentElement.offsetHeight), Math.max(body.clientHeight, documentElement.clientHeight)); + + return new Bounds(0, 0, width, height); +}; + +var parsePathForBorder = exports.parsePathForBorder = function parsePathForBorder(curves, borderSide) { + switch (borderSide) { + case TOP: + return createPathFromCurves(curves.topLeftOuter, curves.topLeftInner, curves.topRightOuter, curves.topRightInner); + case RIGHT: + return createPathFromCurves(curves.topRightOuter, curves.topRightInner, curves.bottomRightOuter, curves.bottomRightInner); + case BOTTOM: + return createPathFromCurves(curves.bottomRightOuter, curves.bottomRightInner, curves.bottomLeftOuter, curves.bottomLeftInner); + case LEFT: + default: + return createPathFromCurves(curves.bottomLeftOuter, curves.bottomLeftInner, curves.topLeftOuter, curves.topLeftInner); + } +}; + +var createPathFromCurves = function createPathFromCurves(outer1, inner1, outer2, inner2) { + var path = []; + if (outer1 instanceof _BezierCurve2.default) { + path.push(outer1.subdivide(0.5, false)); + } else { + path.push(outer1); + } + + if (outer2 instanceof _BezierCurve2.default) { + path.push(outer2.subdivide(0.5, true)); + } else { + path.push(outer2); + } + + if (inner2 instanceof _BezierCurve2.default) { + path.push(inner2.subdivide(0.5, true).reverse()); + } else { + path.push(inner2); + } + + if (inner1 instanceof _BezierCurve2.default) { + path.push(inner1.subdivide(0.5, false).reverse()); + } else { + path.push(inner1); + } + + return path; +}; + +var calculateBorderBoxPath = exports.calculateBorderBoxPath = function calculateBorderBoxPath(curves) { + return [curves.topLeftOuter, curves.topRightOuter, curves.bottomRightOuter, curves.bottomLeftOuter]; +}; + +var calculatePaddingBoxPath = exports.calculatePaddingBoxPath = function calculatePaddingBoxPath(curves) { + return [curves.topLeftInner, curves.topRightInner, curves.bottomRightInner, curves.bottomLeftInner]; +}; + +var parseBoundCurves = exports.parseBoundCurves = function parseBoundCurves(bounds, borders, borderRadius) { + var tlh = borderRadius[CORNER.TOP_LEFT][H].getAbsoluteValue(bounds.width); + var tlv = borderRadius[CORNER.TOP_LEFT][V].getAbsoluteValue(bounds.height); + var trh = borderRadius[CORNER.TOP_RIGHT][H].getAbsoluteValue(bounds.width); + var trv = borderRadius[CORNER.TOP_RIGHT][V].getAbsoluteValue(bounds.height); + var brh = borderRadius[CORNER.BOTTOM_RIGHT][H].getAbsoluteValue(bounds.width); + var brv = borderRadius[CORNER.BOTTOM_RIGHT][V].getAbsoluteValue(bounds.height); + var blh = borderRadius[CORNER.BOTTOM_LEFT][H].getAbsoluteValue(bounds.width); + var blv = borderRadius[CORNER.BOTTOM_LEFT][V].getAbsoluteValue(bounds.height); + + var factors = []; + factors.push((tlh + trh) / bounds.width); + factors.push((blh + brh) / bounds.width); + factors.push((tlv + blv) / bounds.height); + factors.push((trv + brv) / bounds.height); + var maxFactor = Math.max.apply(Math, factors); + + if (maxFactor > 1) { + tlh /= maxFactor; + tlv /= maxFactor; + trh /= maxFactor; + trv /= maxFactor; + brh /= maxFactor; + brv /= maxFactor; + blh /= maxFactor; + blv /= maxFactor; + } + + var topWidth = bounds.width - trh; + var rightHeight = bounds.height - brv; + var bottomWidth = bounds.width - brh; + var leftHeight = bounds.height - blv; + + return { + topLeftOuter: tlh > 0 || tlv > 0 ? getCurvePoints(bounds.left, bounds.top, tlh, tlv, CORNER.TOP_LEFT) : new _Vector2.default(bounds.left, bounds.top), + topLeftInner: tlh > 0 || tlv > 0 ? getCurvePoints(bounds.left + borders[LEFT].borderWidth, bounds.top + borders[TOP].borderWidth, Math.max(0, tlh - borders[LEFT].borderWidth), Math.max(0, tlv - borders[TOP].borderWidth), CORNER.TOP_LEFT) : new _Vector2.default(bounds.left + borders[LEFT].borderWidth, bounds.top + borders[TOP].borderWidth), + topRightOuter: trh > 0 || trv > 0 ? getCurvePoints(bounds.left + topWidth, bounds.top, trh, trv, CORNER.TOP_RIGHT) : new _Vector2.default(bounds.left + bounds.width, bounds.top), + topRightInner: trh > 0 || trv > 0 ? getCurvePoints(bounds.left + Math.min(topWidth, bounds.width + borders[LEFT].borderWidth), bounds.top + borders[TOP].borderWidth, topWidth > bounds.width + borders[LEFT].borderWidth ? 0 : trh - borders[LEFT].borderWidth, trv - borders[TOP].borderWidth, CORNER.TOP_RIGHT) : new _Vector2.default(bounds.left + bounds.width - borders[RIGHT].borderWidth, bounds.top + borders[TOP].borderWidth), + bottomRightOuter: brh > 0 || brv > 0 ? getCurvePoints(bounds.left + bottomWidth, bounds.top + rightHeight, brh, brv, CORNER.BOTTOM_RIGHT) : new _Vector2.default(bounds.left + bounds.width, bounds.top + bounds.height), + bottomRightInner: brh > 0 || brv > 0 ? getCurvePoints(bounds.left + Math.min(bottomWidth, bounds.width - borders[LEFT].borderWidth), bounds.top + Math.min(rightHeight, bounds.height + borders[TOP].borderWidth), Math.max(0, brh - borders[RIGHT].borderWidth), brv - borders[BOTTOM].borderWidth, CORNER.BOTTOM_RIGHT) : new _Vector2.default(bounds.left + bounds.width - borders[RIGHT].borderWidth, bounds.top + bounds.height - borders[BOTTOM].borderWidth), + bottomLeftOuter: blh > 0 || blv > 0 ? getCurvePoints(bounds.left, bounds.top + leftHeight, blh, blv, CORNER.BOTTOM_LEFT) : new _Vector2.default(bounds.left, bounds.top + bounds.height), + bottomLeftInner: blh > 0 || blv > 0 ? getCurvePoints(bounds.left + borders[LEFT].borderWidth, bounds.top + leftHeight, Math.max(0, blh - borders[LEFT].borderWidth), blv - borders[BOTTOM].borderWidth, CORNER.BOTTOM_LEFT) : new _Vector2.default(bounds.left + borders[LEFT].borderWidth, bounds.top + bounds.height - borders[BOTTOM].borderWidth) + }; +}; + +var CORNER = { + TOP_LEFT: 0, + TOP_RIGHT: 1, + BOTTOM_RIGHT: 2, + BOTTOM_LEFT: 3 +}; + +var getCurvePoints = function getCurvePoints(x, y, r1, r2, position) { + var kappa = 4 * ((Math.sqrt(2) - 1) / 3); + var ox = r1 * kappa; // control point offset horizontal + var oy = r2 * kappa; // control point offset vertical + var xm = x + r1; // x-middle + var ym = y + r2; // y-middle + + switch (position) { + case CORNER.TOP_LEFT: + return new _BezierCurve2.default(new _Vector2.default(x, ym), new _Vector2.default(x, ym - oy), new _Vector2.default(xm - ox, y), new _Vector2.default(xm, y)); + case CORNER.TOP_RIGHT: + return new _BezierCurve2.default(new _Vector2.default(x, y), new _Vector2.default(x + ox, y), new _Vector2.default(xm, ym - oy), new _Vector2.default(xm, ym)); + case CORNER.BOTTOM_RIGHT: + return new _BezierCurve2.default(new _Vector2.default(xm, y), new _Vector2.default(xm, y + oy), new _Vector2.default(x + ox, ym), new _Vector2.default(x, ym)); + case CORNER.BOTTOM_LEFT: + default: + return new _BezierCurve2.default(new _Vector2.default(xm, ym), new _Vector2.default(xm - ox, ym), new _Vector2.default(x, y + oy), new _Vector2.default(x, y)); + } +}; + +/***/ }), +/* 3 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var contains = exports.contains = function contains(bit, value) { + return (bit & value) !== 0; +}; + +var distance = exports.distance = function distance(a, b) { + return Math.sqrt(a * a + b * b); +}; + +var copyCSSStyles = exports.copyCSSStyles = function copyCSSStyles(style, target) { + // Edge does not provide value for cssText + for (var i = style.length - 1; i >= 0; i--) { + var property = style.item(i); + // Safari shows pseudoelements if content is set + if (property !== 'content') { + target.style.setProperty(property, style.getPropertyValue(property)); + } + } + return target; +}; + +var SMALL_IMAGE = exports.SMALL_IMAGE = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7'; + +/***/ }), +/* 4 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.parseBackgroundImage = exports.parseBackground = exports.calculateBackgroundRepeatPath = exports.calculateBackgroundPosition = exports.calculateBackgroungPositioningArea = exports.calculateBackgroungPaintingArea = exports.calculateGradientBackgroundSize = exports.calculateBackgroundSize = exports.BACKGROUND_ORIGIN = exports.BACKGROUND_CLIP = exports.BACKGROUND_SIZE = exports.BACKGROUND_REPEAT = undefined; + +var _Color = __webpack_require__(0); + +var _Color2 = _interopRequireDefault(_Color); + +var _Length = __webpack_require__(1); + +var _Length2 = _interopRequireDefault(_Length); + +var _Size = __webpack_require__(31); + +var _Size2 = _interopRequireDefault(_Size); + +var _Vector = __webpack_require__(7); + +var _Vector2 = _interopRequireDefault(_Vector); + +var _Bounds = __webpack_require__(2); + +var _padding = __webpack_require__(17); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var BACKGROUND_REPEAT = exports.BACKGROUND_REPEAT = { + REPEAT: 0, + NO_REPEAT: 1, + REPEAT_X: 2, + REPEAT_Y: 3 +}; + +var BACKGROUND_SIZE = exports.BACKGROUND_SIZE = { + AUTO: 0, + CONTAIN: 1, + COVER: 2, + LENGTH: 3 +}; + +var BACKGROUND_CLIP = exports.BACKGROUND_CLIP = { + BORDER_BOX: 0, + PADDING_BOX: 1, + CONTENT_BOX: 2 +}; + +var BACKGROUND_ORIGIN = exports.BACKGROUND_ORIGIN = BACKGROUND_CLIP; + +var AUTO = 'auto'; + +var BackgroundSize = function BackgroundSize(size) { + _classCallCheck(this, BackgroundSize); + + switch (size) { + case 'contain': + this.size = BACKGROUND_SIZE.CONTAIN; + break; + case 'cover': + this.size = BACKGROUND_SIZE.COVER; + break; + case 'auto': + this.size = BACKGROUND_SIZE.AUTO; + break; + default: + this.value = new _Length2.default(size); + } +}; + +var calculateBackgroundSize = exports.calculateBackgroundSize = function calculateBackgroundSize(backgroundImage, image, bounds) { + var width = 0; + var height = 0; + var size = backgroundImage.size; + if (size[0].size === BACKGROUND_SIZE.CONTAIN || size[0].size === BACKGROUND_SIZE.COVER) { + var targetRatio = bounds.width / bounds.height; + var currentRatio = image.width / image.height; + return targetRatio < currentRatio !== (size[0].size === BACKGROUND_SIZE.COVER) ? new _Size2.default(bounds.width, bounds.width / currentRatio) : new _Size2.default(bounds.height * currentRatio, bounds.height); + } + + if (size[0].value) { + width = size[0].value.getAbsoluteValue(bounds.width); + } + + if (size[0].size === BACKGROUND_SIZE.AUTO && size[1].size === BACKGROUND_SIZE.AUTO) { + height = image.height; + } else if (size[1].size === BACKGROUND_SIZE.AUTO) { + height = width / image.width * image.height; + } else if (size[1].value) { + height = size[1].value.getAbsoluteValue(bounds.height); + } + + if (size[0].size === BACKGROUND_SIZE.AUTO) { + width = height / image.height * image.width; + } + + return new _Size2.default(width, height); +}; + +var calculateGradientBackgroundSize = exports.calculateGradientBackgroundSize = function calculateGradientBackgroundSize(backgroundImage, bounds) { + var size = backgroundImage.size; + var width = size[0].value ? size[0].value.getAbsoluteValue(bounds.width) : bounds.width; + var height = size[1].value ? size[1].value.getAbsoluteValue(bounds.height) : size[0].value ? width : bounds.height; + + return new _Size2.default(width, height); +}; + +var AUTO_SIZE = new BackgroundSize(AUTO); + +var calculateBackgroungPaintingArea = exports.calculateBackgroungPaintingArea = function calculateBackgroungPaintingArea(curves, clip) { + switch (clip) { + case BACKGROUND_CLIP.BORDER_BOX: + return (0, _Bounds.calculateBorderBoxPath)(curves); + case BACKGROUND_CLIP.PADDING_BOX: + default: + return (0, _Bounds.calculatePaddingBoxPath)(curves); + } +}; + +var calculateBackgroungPositioningArea = exports.calculateBackgroungPositioningArea = function calculateBackgroungPositioningArea(backgroundOrigin, bounds, padding, border) { + var paddingBox = (0, _Bounds.calculatePaddingBox)(bounds, border); + + switch (backgroundOrigin) { + case BACKGROUND_ORIGIN.BORDER_BOX: + return bounds; + case BACKGROUND_ORIGIN.CONTENT_BOX: + var paddingLeft = padding[_padding.PADDING_SIDES.LEFT].getAbsoluteValue(bounds.width); + var paddingRight = padding[_padding.PADDING_SIDES.RIGHT].getAbsoluteValue(bounds.width); + var paddingTop = padding[_padding.PADDING_SIDES.TOP].getAbsoluteValue(bounds.width); + var paddingBottom = padding[_padding.PADDING_SIDES.BOTTOM].getAbsoluteValue(bounds.width); + return new _Bounds.Bounds(paddingBox.left + paddingLeft, paddingBox.top + paddingTop, paddingBox.width - paddingLeft - paddingRight, paddingBox.height - paddingTop - paddingBottom); + case BACKGROUND_ORIGIN.PADDING_BOX: + default: + return paddingBox; + } +}; + +var calculateBackgroundPosition = exports.calculateBackgroundPosition = function calculateBackgroundPosition(position, size, bounds) { + return new _Vector2.default(position[0].getAbsoluteValue(bounds.width - size.width), position[1].getAbsoluteValue(bounds.height - size.height)); +}; + +var calculateBackgroundRepeatPath = exports.calculateBackgroundRepeatPath = function calculateBackgroundRepeatPath(background, position, size, backgroundPositioningArea, bounds) { + var repeat = background.repeat; + switch (repeat) { + case BACKGROUND_REPEAT.REPEAT_X: + return [new _Vector2.default(Math.round(bounds.left), Math.round(backgroundPositioningArea.top + position.y)), new _Vector2.default(Math.round(bounds.left + bounds.width), Math.round(backgroundPositioningArea.top + position.y)), new _Vector2.default(Math.round(bounds.left + bounds.width), Math.round(size.height + backgroundPositioningArea.top + position.y)), new _Vector2.default(Math.round(bounds.left), Math.round(size.height + backgroundPositioningArea.top + position.y))]; + case BACKGROUND_REPEAT.REPEAT_Y: + return [new _Vector2.default(Math.round(backgroundPositioningArea.left + position.x), Math.round(bounds.top)), new _Vector2.default(Math.round(backgroundPositioningArea.left + position.x + size.width), Math.round(bounds.top)), new _Vector2.default(Math.round(backgroundPositioningArea.left + position.x + size.width), Math.round(bounds.height + bounds.top)), new _Vector2.default(Math.round(backgroundPositioningArea.left + position.x), Math.round(bounds.height + bounds.top))]; + case BACKGROUND_REPEAT.NO_REPEAT: + return [new _Vector2.default(Math.round(backgroundPositioningArea.left + position.x), Math.round(backgroundPositioningArea.top + position.y)), new _Vector2.default(Math.round(backgroundPositioningArea.left + position.x + size.width), Math.round(backgroundPositioningArea.top + position.y)), new _Vector2.default(Math.round(backgroundPositioningArea.left + position.x + size.width), Math.round(backgroundPositioningArea.top + position.y + size.height)), new _Vector2.default(Math.round(backgroundPositioningArea.left + position.x), Math.round(backgroundPositioningArea.top + position.y + size.height))]; + default: + return [new _Vector2.default(Math.round(bounds.left), Math.round(bounds.top)), new _Vector2.default(Math.round(bounds.left + bounds.width), Math.round(bounds.top)), new _Vector2.default(Math.round(bounds.left + bounds.width), Math.round(bounds.height + bounds.top)), new _Vector2.default(Math.round(bounds.left), Math.round(bounds.height + bounds.top))]; + } +}; + +var parseBackground = exports.parseBackground = function parseBackground(style, resourceLoader) { + return { + backgroundColor: new _Color2.default(style.backgroundColor), + backgroundImage: parseBackgroundImages(style, resourceLoader), + backgroundClip: parseBackgroundClip(style.backgroundClip), + backgroundOrigin: parseBackgroundOrigin(style.backgroundOrigin) + }; +}; + +var parseBackgroundClip = function parseBackgroundClip(backgroundClip) { + switch (backgroundClip) { + case 'padding-box': + return BACKGROUND_CLIP.PADDING_BOX; + case 'content-box': + return BACKGROUND_CLIP.CONTENT_BOX; + } + return BACKGROUND_CLIP.BORDER_BOX; +}; + +var parseBackgroundOrigin = function parseBackgroundOrigin(backgroundOrigin) { + switch (backgroundOrigin) { + case 'padding-box': + return BACKGROUND_ORIGIN.PADDING_BOX; + case 'content-box': + return BACKGROUND_ORIGIN.CONTENT_BOX; + } + return BACKGROUND_ORIGIN.BORDER_BOX; +}; + +var parseBackgroundRepeat = function parseBackgroundRepeat(backgroundRepeat) { + switch (backgroundRepeat.trim()) { + case 'no-repeat': + return BACKGROUND_REPEAT.NO_REPEAT; + case 'repeat-x': + case 'repeat no-repeat': + return BACKGROUND_REPEAT.REPEAT_X; + case 'repeat-y': + case 'no-repeat repeat': + return BACKGROUND_REPEAT.REPEAT_Y; + case 'repeat': + return BACKGROUND_REPEAT.REPEAT; + } + + if (true) { + console.error('Invalid background-repeat value "' + backgroundRepeat + '"'); + } + + return BACKGROUND_REPEAT.REPEAT; +}; + +var parseBackgroundImages = function parseBackgroundImages(style, resourceLoader) { + var sources = parseBackgroundImage(style.backgroundImage).map(function (backgroundImage) { + if (backgroundImage.method === 'url') { + var key = resourceLoader.loadImage(backgroundImage.args[0]); + backgroundImage.args = key ? [key] : []; + } + return backgroundImage; + }); + var positions = style.backgroundPosition.split(','); + var repeats = style.backgroundRepeat.split(','); + var sizes = style.backgroundSize.split(','); + + return sources.map(function (source, index) { + var size = (sizes[index] || AUTO).trim().split(' ').map(parseBackgroundSize); + var position = (positions[index] || AUTO).trim().split(' ').map(parseBackgoundPosition); + + return { + source: source, + repeat: parseBackgroundRepeat(typeof repeats[index] === 'string' ? repeats[index] : repeats[0]), + size: size.length < 2 ? [size[0], AUTO_SIZE] : [size[0], size[1]], + position: position.length < 2 ? [position[0], position[0]] : [position[0], position[1]] + }; + }); +}; + +var parseBackgroundSize = function parseBackgroundSize(size) { + return size === 'auto' ? AUTO_SIZE : new BackgroundSize(size); +}; + +var parseBackgoundPosition = function parseBackgoundPosition(position) { + switch (position) { + case 'bottom': + case 'right': + return new _Length2.default('100%'); + case 'left': + case 'top': + return new _Length2.default('0%'); + case 'auto': + return new _Length2.default('0'); + } + return new _Length2.default(position); +}; + +var parseBackgroundImage = exports.parseBackgroundImage = function parseBackgroundImage(image) { + var whitespace = /^\s$/; + var results = []; + + var args = []; + var method = ''; + var quote = null; + var definition = ''; + var mode = 0; + var numParen = 0; + + var appendResult = function appendResult() { + var prefix = ''; + if (method) { + if (definition.substr(0, 1) === '"') { + definition = definition.substr(1, definition.length - 2); + } + + if (definition) { + args.push(definition.trim()); + } + + var prefix_i = method.indexOf('-', 1) + 1; + if (method.substr(0, 1) === '-' && prefix_i > 0) { + prefix = method.substr(0, prefix_i).toLowerCase(); + method = method.substr(prefix_i); + } + method = method.toLowerCase(); + if (method !== 'none') { + results.push({ + prefix: prefix, + method: method, + args: args + }); + } + } + args = []; + method = definition = ''; + }; + + image.split('').forEach(function (c) { + if (mode === 0 && whitespace.test(c)) { + return; + } + switch (c) { + case '"': + if (!quote) { + quote = c; + } else if (quote === c) { + quote = null; + } + break; + case '(': + if (quote) { + break; + } else if (mode === 0) { + mode = 1; + return; + } else { + numParen++; + } + break; + case ')': + if (quote) { + break; + } else if (mode === 1) { + if (numParen === 0) { + mode = 0; + appendResult(); + return; + } else { + numParen--; + } + } + break; + + case ',': + if (quote) { + break; + } else if (mode === 0) { + appendResult(); + return; + } else if (mode === 1) { + if (numParen === 0 && !method.match(/^url$/i)) { + args.push(definition.trim()); + definition = ''; + return; + } + } + break; + } + + if (mode === 0) { + method += c; + } else { + definition += c; + } + }); + + appendResult(); + return results; +}; + +/***/ }), +/* 5 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var PATH = exports.PATH = { + VECTOR: 0, + BEZIER_CURVE: 1, + CIRCLE: 2 +}; + +/***/ }), +/* 6 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _Color = __webpack_require__(0); + +var _Color2 = _interopRequireDefault(_Color); + +var _Util = __webpack_require__(3); + +var _background = __webpack_require__(4); + +var _border = __webpack_require__(12); + +var _borderRadius = __webpack_require__(33); + +var _display = __webpack_require__(34); + +var _float = __webpack_require__(35); + +var _font = __webpack_require__(36); + +var _letterSpacing = __webpack_require__(37); + +var _lineBreak = __webpack_require__(38); + +var _listStyle = __webpack_require__(8); + +var _margin = __webpack_require__(39); + +var _overflow = __webpack_require__(40); + +var _overflowWrap = __webpack_require__(18); + +var _padding = __webpack_require__(17); + +var _position = __webpack_require__(19); + +var _textDecoration = __webpack_require__(11); + +var _textShadow = __webpack_require__(41); + +var _textTransform = __webpack_require__(20); + +var _transform = __webpack_require__(42); + +var _visibility = __webpack_require__(43); + +var _wordBreak = __webpack_require__(44); + +var _zIndex = __webpack_require__(45); + +var _Bounds = __webpack_require__(2); + +var _Input = __webpack_require__(21); + +var _ListItem = __webpack_require__(14); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var INPUT_TAGS = ['INPUT', 'TEXTAREA', 'SELECT']; + +var NodeContainer = function () { + function NodeContainer(node, parent, resourceLoader, index) { + var _this = this; + + _classCallCheck(this, NodeContainer); + + this.parent = parent; + this.tagName = node.tagName; + this.index = index; + this.childNodes = []; + this.listItems = []; + if (typeof node.start === 'number') { + this.listStart = node.start; + } + var defaultView = node.ownerDocument.defaultView; + var scrollX = defaultView.pageXOffset; + var scrollY = defaultView.pageYOffset; + var style = defaultView.getComputedStyle(node, null); + var display = (0, _display.parseDisplay)(style.display); + + var IS_INPUT = node.type === 'radio' || node.type === 'checkbox'; + + var position = (0, _position.parsePosition)(style.position); + + this.style = { + background: IS_INPUT ? _Input.INPUT_BACKGROUND : (0, _background.parseBackground)(style, resourceLoader), + border: IS_INPUT ? _Input.INPUT_BORDERS : (0, _border.parseBorder)(style), + borderRadius: (node instanceof defaultView.HTMLInputElement || node instanceof HTMLInputElement) && IS_INPUT ? (0, _Input.getInputBorderRadius)(node) : (0, _borderRadius.parseBorderRadius)(style), + color: IS_INPUT ? _Input.INPUT_COLOR : new _Color2.default(style.color), + display: display, + float: (0, _float.parseCSSFloat)(style.float), + font: (0, _font.parseFont)(style), + letterSpacing: (0, _letterSpacing.parseLetterSpacing)(style.letterSpacing), + listStyle: display === _display.DISPLAY.LIST_ITEM ? (0, _listStyle.parseListStyle)(style) : null, + lineBreak: (0, _lineBreak.parseLineBreak)(style.lineBreak), + margin: (0, _margin.parseMargin)(style), + opacity: parseFloat(style.opacity), + overflow: INPUT_TAGS.indexOf(node.tagName) === -1 ? (0, _overflow.parseOverflow)(style.overflow) : _overflow.OVERFLOW.HIDDEN, + overflowWrap: (0, _overflowWrap.parseOverflowWrap)(style.overflowWrap ? style.overflowWrap : style.wordWrap), + padding: (0, _padding.parsePadding)(style), + position: position, + textDecoration: (0, _textDecoration.parseTextDecoration)(style), + textShadow: (0, _textShadow.parseTextShadow)(style.textShadow), + textTransform: (0, _textTransform.parseTextTransform)(style.textTransform), + transform: (0, _transform.parseTransform)(style), + visibility: (0, _visibility.parseVisibility)(style.visibility), + wordBreak: (0, _wordBreak.parseWordBreak)(style.wordBreak), + zIndex: (0, _zIndex.parseZIndex)(position !== _position.POSITION.STATIC ? style.zIndex : 'auto') + }; + + if (this.isTransformed()) { + // getBoundingClientRect provides values post-transform, we want them without the transformation + node.style.transform = 'matrix(1,0,0,1,0,0)'; + } + + if (display === _display.DISPLAY.LIST_ITEM) { + var listOwner = (0, _ListItem.getListOwner)(this); + if (listOwner) { + var listIndex = listOwner.listItems.length; + listOwner.listItems.push(this); + this.listIndex = node.hasAttribute('value') && typeof node.value === 'number' ? node.value : listIndex === 0 ? typeof listOwner.listStart === 'number' ? listOwner.listStart : 1 : listOwner.listItems[listIndex - 1].listIndex + 1; + } + } + + // TODO move bound retrieval for all nodes to a later stage? + if (node.tagName === 'IMG') { + node.addEventListener('load', function () { + _this.bounds = (0, _Bounds.parseBounds)(node, scrollX, scrollY); + _this.curvedBounds = (0, _Bounds.parseBoundCurves)(_this.bounds, _this.style.border, _this.style.borderRadius); + }); + } + this.image = getImage(node, resourceLoader); + this.bounds = IS_INPUT ? (0, _Input.reformatInputBounds)((0, _Bounds.parseBounds)(node, scrollX, scrollY)) : (0, _Bounds.parseBounds)(node, scrollX, scrollY); + this.curvedBounds = (0, _Bounds.parseBoundCurves)(this.bounds, this.style.border, this.style.borderRadius); + + if (true) { + this.name = '' + node.tagName.toLowerCase() + (node.id ? '#' + node.id : '') + node.className.toString().split(' ').map(function (s) { + return s.length ? '.' + s : ''; + }).join(''); + } + } + + _createClass(NodeContainer, [{ + key: 'getClipPaths', + value: function getClipPaths() { + var parentClips = this.parent ? this.parent.getClipPaths() : []; + var isClipped = this.style.overflow !== _overflow.OVERFLOW.VISIBLE; + + return isClipped ? parentClips.concat([(0, _Bounds.calculatePaddingBoxPath)(this.curvedBounds)]) : parentClips; + } + }, { + key: 'isInFlow', + value: function isInFlow() { + return this.isRootElement() && !this.isFloating() && !this.isAbsolutelyPositioned(); + } + }, { + key: 'isVisible', + value: function isVisible() { + return !(0, _Util.contains)(this.style.display, _display.DISPLAY.NONE) && this.style.opacity > 0 && this.style.visibility === _visibility.VISIBILITY.VISIBLE; + } + }, { + key: 'isAbsolutelyPositioned', + value: function isAbsolutelyPositioned() { + return this.style.position !== _position.POSITION.STATIC && this.style.position !== _position.POSITION.RELATIVE; + } + }, { + key: 'isPositioned', + value: function isPositioned() { + return this.style.position !== _position.POSITION.STATIC; + } + }, { + key: 'isFloating', + value: function isFloating() { + return this.style.float !== _float.FLOAT.NONE; + } + }, { + key: 'isRootElement', + value: function isRootElement() { + return this.parent === null; + } + }, { + key: 'isTransformed', + value: function isTransformed() { + return this.style.transform !== null; + } + }, { + key: 'isPositionedWithZIndex', + value: function isPositionedWithZIndex() { + return this.isPositioned() && !this.style.zIndex.auto; + } + }, { + key: 'isInlineLevel', + value: function isInlineLevel() { + return (0, _Util.contains)(this.style.display, _display.DISPLAY.INLINE) || (0, _Util.contains)(this.style.display, _display.DISPLAY.INLINE_BLOCK) || (0, _Util.contains)(this.style.display, _display.DISPLAY.INLINE_FLEX) || (0, _Util.contains)(this.style.display, _display.DISPLAY.INLINE_GRID) || (0, _Util.contains)(this.style.display, _display.DISPLAY.INLINE_LIST_ITEM) || (0, _Util.contains)(this.style.display, _display.DISPLAY.INLINE_TABLE); + } + }, { + key: 'isInlineBlockOrInlineTable', + value: function isInlineBlockOrInlineTable() { + return (0, _Util.contains)(this.style.display, _display.DISPLAY.INLINE_BLOCK) || (0, _Util.contains)(this.style.display, _display.DISPLAY.INLINE_TABLE); + } + }]); + + return NodeContainer; +}(); + +exports.default = NodeContainer; + + +var getImage = function getImage(node, resourceLoader) { + if (node instanceof node.ownerDocument.defaultView.SVGSVGElement || node instanceof SVGSVGElement) { + var s = new XMLSerializer(); + return resourceLoader.loadImage('data:image/svg+xml,' + encodeURIComponent(s.serializeToString(node))); + } + switch (node.tagName) { + case 'IMG': + // $FlowFixMe + var img = node; + return resourceLoader.loadImage(img.currentSrc || img.src); + case 'CANVAS': + // $FlowFixMe + var canvas = node; + return resourceLoader.loadCanvas(canvas); + case 'IFRAME': + var iframeKey = node.getAttribute('data-html2canvas-internal-iframe-key'); + if (iframeKey) { + return iframeKey; + } + break; + } + + return null; +}; + +/***/ }), +/* 7 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _Path = __webpack_require__(5); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var Vector = function Vector(x, y) { + _classCallCheck(this, Vector); + + this.type = _Path.PATH.VECTOR; + this.x = x; + this.y = y; + if (true) { + if (isNaN(x)) { + console.error('Invalid x value given for Vector'); + } + if (isNaN(y)) { + console.error('Invalid y value given for Vector'); + } + } +}; + +exports.default = Vector; + +/***/ }), +/* 8 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.parseListStyle = exports.parseListStyleType = exports.LIST_STYLE_TYPE = exports.LIST_STYLE_POSITION = undefined; + +var _background = __webpack_require__(4); + +var LIST_STYLE_POSITION = exports.LIST_STYLE_POSITION = { + INSIDE: 0, + OUTSIDE: 1 +}; + +var LIST_STYLE_TYPE = exports.LIST_STYLE_TYPE = { + NONE: -1, + DISC: 0, + CIRCLE: 1, + SQUARE: 2, + DECIMAL: 3, + CJK_DECIMAL: 4, + DECIMAL_LEADING_ZERO: 5, + LOWER_ROMAN: 6, + UPPER_ROMAN: 7, + LOWER_GREEK: 8, + LOWER_ALPHA: 9, + UPPER_ALPHA: 10, + ARABIC_INDIC: 11, + ARMENIAN: 12, + BENGALI: 13, + CAMBODIAN: 14, + CJK_EARTHLY_BRANCH: 15, + CJK_HEAVENLY_STEM: 16, + CJK_IDEOGRAPHIC: 17, + DEVANAGARI: 18, + ETHIOPIC_NUMERIC: 19, + GEORGIAN: 20, + GUJARATI: 21, + GURMUKHI: 22, + HEBREW: 22, + HIRAGANA: 23, + HIRAGANA_IROHA: 24, + JAPANESE_FORMAL: 25, + JAPANESE_INFORMAL: 26, + KANNADA: 27, + KATAKANA: 28, + KATAKANA_IROHA: 29, + KHMER: 30, + KOREAN_HANGUL_FORMAL: 31, + KOREAN_HANJA_FORMAL: 32, + KOREAN_HANJA_INFORMAL: 33, + LAO: 34, + LOWER_ARMENIAN: 35, + MALAYALAM: 36, + MONGOLIAN: 37, + MYANMAR: 38, + ORIYA: 39, + PERSIAN: 40, + SIMP_CHINESE_FORMAL: 41, + SIMP_CHINESE_INFORMAL: 42, + TAMIL: 43, + TELUGU: 44, + THAI: 45, + TIBETAN: 46, + TRAD_CHINESE_FORMAL: 47, + TRAD_CHINESE_INFORMAL: 48, + UPPER_ARMENIAN: 49, + DISCLOSURE_OPEN: 50, + DISCLOSURE_CLOSED: 51 +}; + +var parseListStyleType = exports.parseListStyleType = function parseListStyleType(type) { + switch (type) { + case 'disc': + return LIST_STYLE_TYPE.DISC; + case 'circle': + return LIST_STYLE_TYPE.CIRCLE; + case 'square': + return LIST_STYLE_TYPE.SQUARE; + case 'decimal': + return LIST_STYLE_TYPE.DECIMAL; + case 'cjk-decimal': + return LIST_STYLE_TYPE.CJK_DECIMAL; + case 'decimal-leading-zero': + return LIST_STYLE_TYPE.DECIMAL_LEADING_ZERO; + case 'lower-roman': + return LIST_STYLE_TYPE.LOWER_ROMAN; + case 'upper-roman': + return LIST_STYLE_TYPE.UPPER_ROMAN; + case 'lower-greek': + return LIST_STYLE_TYPE.LOWER_GREEK; + case 'lower-alpha': + return LIST_STYLE_TYPE.LOWER_ALPHA; + case 'upper-alpha': + return LIST_STYLE_TYPE.UPPER_ALPHA; + case 'arabic-indic': + return LIST_STYLE_TYPE.ARABIC_INDIC; + case 'armenian': + return LIST_STYLE_TYPE.ARMENIAN; + case 'bengali': + return LIST_STYLE_TYPE.BENGALI; + case 'cambodian': + return LIST_STYLE_TYPE.CAMBODIAN; + case 'cjk-earthly-branch': + return LIST_STYLE_TYPE.CJK_EARTHLY_BRANCH; + case 'cjk-heavenly-stem': + return LIST_STYLE_TYPE.CJK_HEAVENLY_STEM; + case 'cjk-ideographic': + return LIST_STYLE_TYPE.CJK_IDEOGRAPHIC; + case 'devanagari': + return LIST_STYLE_TYPE.DEVANAGARI; + case 'ethiopic-numeric': + return LIST_STYLE_TYPE.ETHIOPIC_NUMERIC; + case 'georgian': + return LIST_STYLE_TYPE.GEORGIAN; + case 'gujarati': + return LIST_STYLE_TYPE.GUJARATI; + case 'gurmukhi': + return LIST_STYLE_TYPE.GURMUKHI; + case 'hebrew': + return LIST_STYLE_TYPE.HEBREW; + case 'hiragana': + return LIST_STYLE_TYPE.HIRAGANA; + case 'hiragana-iroha': + return LIST_STYLE_TYPE.HIRAGANA_IROHA; + case 'japanese-formal': + return LIST_STYLE_TYPE.JAPANESE_FORMAL; + case 'japanese-informal': + return LIST_STYLE_TYPE.JAPANESE_INFORMAL; + case 'kannada': + return LIST_STYLE_TYPE.KANNADA; + case 'katakana': + return LIST_STYLE_TYPE.KATAKANA; + case 'katakana-iroha': + return LIST_STYLE_TYPE.KATAKANA_IROHA; + case 'khmer': + return LIST_STYLE_TYPE.KHMER; + case 'korean-hangul-formal': + return LIST_STYLE_TYPE.KOREAN_HANGUL_FORMAL; + case 'korean-hanja-formal': + return LIST_STYLE_TYPE.KOREAN_HANJA_FORMAL; + case 'korean-hanja-informal': + return LIST_STYLE_TYPE.KOREAN_HANJA_INFORMAL; + case 'lao': + return LIST_STYLE_TYPE.LAO; + case 'lower-armenian': + return LIST_STYLE_TYPE.LOWER_ARMENIAN; + case 'malayalam': + return LIST_STYLE_TYPE.MALAYALAM; + case 'mongolian': + return LIST_STYLE_TYPE.MONGOLIAN; + case 'myanmar': + return LIST_STYLE_TYPE.MYANMAR; + case 'oriya': + return LIST_STYLE_TYPE.ORIYA; + case 'persian': + return LIST_STYLE_TYPE.PERSIAN; + case 'simp-chinese-formal': + return LIST_STYLE_TYPE.SIMP_CHINESE_FORMAL; + case 'simp-chinese-informal': + return LIST_STYLE_TYPE.SIMP_CHINESE_INFORMAL; + case 'tamil': + return LIST_STYLE_TYPE.TAMIL; + case 'telugu': + return LIST_STYLE_TYPE.TELUGU; + case 'thai': + return LIST_STYLE_TYPE.THAI; + case 'tibetan': + return LIST_STYLE_TYPE.TIBETAN; + case 'trad-chinese-formal': + return LIST_STYLE_TYPE.TRAD_CHINESE_FORMAL; + case 'trad-chinese-informal': + return LIST_STYLE_TYPE.TRAD_CHINESE_INFORMAL; + case 'upper-armenian': + return LIST_STYLE_TYPE.UPPER_ARMENIAN; + case 'disclosure-open': + return LIST_STYLE_TYPE.DISCLOSURE_OPEN; + case 'disclosure-closed': + return LIST_STYLE_TYPE.DISCLOSURE_CLOSED; + case 'none': + default: + return LIST_STYLE_TYPE.NONE; + } +}; + +var parseListStyle = exports.parseListStyle = function parseListStyle(style) { + var listStyleImage = (0, _background.parseBackgroundImage)(style.getPropertyValue('list-style-image')); + return { + listStyleType: parseListStyleType(style.getPropertyValue('list-style-type')), + listStyleImage: listStyleImage.length ? listStyleImage[0] : null, + listStylePosition: parseListStylePosition(style.getPropertyValue('list-style-position')) + }; +}; + +var parseListStylePosition = function parseListStylePosition(position) { + switch (position) { + case 'inside': + return LIST_STYLE_POSITION.INSIDE; + case 'outside': + default: + return LIST_STYLE_POSITION.OUTSIDE; + } +}; + +/***/ }), +/* 9 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _textTransform = __webpack_require__(20); + +var _TextBounds = __webpack_require__(22); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var TextContainer = function () { + function TextContainer(text, parent, bounds) { + _classCallCheck(this, TextContainer); + + this.text = text; + this.parent = parent; + this.bounds = bounds; + } + + _createClass(TextContainer, null, [{ + key: 'fromTextNode', + value: function fromTextNode(node, parent) { + var text = transform(node.data, parent.style.textTransform); + return new TextContainer(text, parent, (0, _TextBounds.parseTextBounds)(text, parent, node)); + } + }]); + + return TextContainer; +}(); + +exports.default = TextContainer; + + +var CAPITALIZE = /(^|\s|:|-|\(|\))([a-z])/g; + +var transform = function transform(text, _transform) { + switch (_transform) { + case _textTransform.TEXT_TRANSFORM.LOWERCASE: + return text.toLowerCase(); + case _textTransform.TEXT_TRANSFORM.CAPITALIZE: + return text.replace(CAPITALIZE, capitalize); + case _textTransform.TEXT_TRANSFORM.UPPERCASE: + return text.toUpperCase(); + default: + return text; + } +}; + +function capitalize(m, p1, p2) { + if (m.length > 0) { + return p1 + p2.toUpperCase(); + } + + return m; +} + +/***/ }), +/* 10 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _ForeignObjectRenderer = __webpack_require__(23); + +var testRangeBounds = function testRangeBounds(document) { + var TEST_HEIGHT = 123; + + if (document.createRange) { + var range = document.createRange(); + if (range.getBoundingClientRect) { + var testElement = document.createElement('boundtest'); + testElement.style.height = TEST_HEIGHT + 'px'; + testElement.style.display = 'block'; + document.body.appendChild(testElement); + + range.selectNode(testElement); + var rangeBounds = range.getBoundingClientRect(); + var rangeHeight = Math.round(rangeBounds.height); + document.body.removeChild(testElement); + if (rangeHeight === TEST_HEIGHT) { + return true; + } + } + } + + return false; +}; + +// iOS 10.3 taints canvas with base64 images unless crossOrigin = 'anonymous' +var testBase64 = function testBase64(document, src) { + var img = new Image(); + var canvas = document.createElement('canvas'); + var ctx = canvas.getContext('2d'); + + return new Promise(function (resolve) { + // Single pixel base64 image renders fine on iOS 10.3??? + img.src = src; + + var onload = function onload() { + try { + ctx.drawImage(img, 0, 0); + canvas.toDataURL(); + } catch (e) { + return resolve(false); + } + + return resolve(true); + }; + + img.onload = onload; + img.onerror = function () { + return resolve(false); + }; + + if (img.complete === true) { + setTimeout(function () { + onload(); + }, 500); + } + }); +}; + +var testCORS = function testCORS() { + return typeof new Image().crossOrigin !== 'undefined'; +}; + +var testResponseType = function testResponseType() { + return typeof new XMLHttpRequest().responseType === 'string'; +}; + +var testSVG = function testSVG(document) { + var img = new Image(); + var canvas = document.createElement('canvas'); + var ctx = canvas.getContext('2d'); + img.src = 'data:image/svg+xml,'; + + try { + ctx.drawImage(img, 0, 0); + canvas.toDataURL(); + } catch (e) { + return false; + } + return true; +}; + +var isGreenPixel = function isGreenPixel(data) { + return data[0] === 0 && data[1] === 255 && data[2] === 0 && data[3] === 255; +}; + +var testForeignObject = function testForeignObject(document) { + var canvas = document.createElement('canvas'); + var size = 100; + canvas.width = size; + canvas.height = size; + var ctx = canvas.getContext('2d'); + ctx.fillStyle = 'rgb(0, 255, 0)'; + ctx.fillRect(0, 0, size, size); + + var img = new Image(); + var greenImageSrc = canvas.toDataURL(); + img.src = greenImageSrc; + var svg = (0, _ForeignObjectRenderer.createForeignObjectSVG)(size, size, 0, 0, img); + ctx.fillStyle = 'red'; + ctx.fillRect(0, 0, size, size); + + return (0, _ForeignObjectRenderer.loadSerializedSVG)(svg).then(function (img) { + ctx.drawImage(img, 0, 0); + var data = ctx.getImageData(0, 0, size, size).data; + ctx.fillStyle = 'red'; + ctx.fillRect(0, 0, size, size); + + var node = document.createElement('div'); + node.style.backgroundImage = 'url(' + greenImageSrc + ')'; + node.style.height = size + 'px'; + // Firefox 55 does not render inline tags + return isGreenPixel(data) ? (0, _ForeignObjectRenderer.loadSerializedSVG)((0, _ForeignObjectRenderer.createForeignObjectSVG)(size, size, 0, 0, node)) : Promise.reject(false); + }).then(function (img) { + ctx.drawImage(img, 0, 0); + // Edge does not render background-images + return isGreenPixel(ctx.getImageData(0, 0, size, size).data); + }).catch(function (e) { + return false; + }); +}; + +var FEATURES = { + // $FlowFixMe - get/set properties not yet supported + get SUPPORT_RANGE_BOUNDS() { + 'use strict'; + + var value = testRangeBounds(document); + Object.defineProperty(FEATURES, 'SUPPORT_RANGE_BOUNDS', { value: value }); + return value; + }, + // $FlowFixMe - get/set properties not yet supported + get SUPPORT_SVG_DRAWING() { + 'use strict'; + + var value = testSVG(document); + Object.defineProperty(FEATURES, 'SUPPORT_SVG_DRAWING', { value: value }); + return value; + }, + // $FlowFixMe - get/set properties not yet supported + get SUPPORT_BASE64_DRAWING() { + 'use strict'; + + return function (src) { + var _value = testBase64(document, src); + Object.defineProperty(FEATURES, 'SUPPORT_BASE64_DRAWING', { value: function value() { + return _value; + } }); + return _value; + }; + }, + // $FlowFixMe - get/set properties not yet supported + get SUPPORT_FOREIGNOBJECT_DRAWING() { + 'use strict'; + + var value = typeof Array.from === 'function' && typeof window.fetch === 'function' ? testForeignObject(document) : Promise.resolve(false); + Object.defineProperty(FEATURES, 'SUPPORT_FOREIGNOBJECT_DRAWING', { value: value }); + return value; + }, + // $FlowFixMe - get/set properties not yet supported + get SUPPORT_CORS_IMAGES() { + 'use strict'; + + var value = testCORS(); + Object.defineProperty(FEATURES, 'SUPPORT_CORS_IMAGES', { value: value }); + return value; + }, + // $FlowFixMe - get/set properties not yet supported + get SUPPORT_RESPONSE_TYPE() { + 'use strict'; + + var value = testResponseType(); + Object.defineProperty(FEATURES, 'SUPPORT_RESPONSE_TYPE', { value: value }); + return value; + }, + // $FlowFixMe - get/set properties not yet supported + get SUPPORT_CORS_XHR() { + 'use strict'; + + var value = 'withCredentials' in new XMLHttpRequest(); + Object.defineProperty(FEATURES, 'SUPPORT_CORS_XHR', { value: value }); + return value; + } +}; + +exports.default = FEATURES; + +/***/ }), +/* 11 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.parseTextDecoration = exports.TEXT_DECORATION_LINE = exports.TEXT_DECORATION = exports.TEXT_DECORATION_STYLE = undefined; + +var _Color = __webpack_require__(0); + +var _Color2 = _interopRequireDefault(_Color); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var TEXT_DECORATION_STYLE = exports.TEXT_DECORATION_STYLE = { + SOLID: 0, + DOUBLE: 1, + DOTTED: 2, + DASHED: 3, + WAVY: 4 +}; + +var TEXT_DECORATION = exports.TEXT_DECORATION = { + NONE: null +}; + +var TEXT_DECORATION_LINE = exports.TEXT_DECORATION_LINE = { + UNDERLINE: 1, + OVERLINE: 2, + LINE_THROUGH: 3, + BLINK: 4 +}; + +var parseLine = function parseLine(line) { + switch (line) { + case 'underline': + return TEXT_DECORATION_LINE.UNDERLINE; + case 'overline': + return TEXT_DECORATION_LINE.OVERLINE; + case 'line-through': + return TEXT_DECORATION_LINE.LINE_THROUGH; + } + return TEXT_DECORATION_LINE.BLINK; +}; + +var parseTextDecorationLine = function parseTextDecorationLine(line) { + if (line === 'none') { + return null; + } + + return line.split(' ').map(parseLine); +}; + +var parseTextDecorationStyle = function parseTextDecorationStyle(style) { + switch (style) { + case 'double': + return TEXT_DECORATION_STYLE.DOUBLE; + case 'dotted': + return TEXT_DECORATION_STYLE.DOTTED; + case 'dashed': + return TEXT_DECORATION_STYLE.DASHED; + case 'wavy': + return TEXT_DECORATION_STYLE.WAVY; + } + return TEXT_DECORATION_STYLE.SOLID; +}; + +var parseTextDecoration = exports.parseTextDecoration = function parseTextDecoration(style) { + var textDecorationLine = parseTextDecorationLine(style.textDecorationLine ? style.textDecorationLine : style.textDecoration); + if (textDecorationLine === null) { + return TEXT_DECORATION.NONE; + } + + var textDecorationColor = style.textDecorationColor ? new _Color2.default(style.textDecorationColor) : null; + var textDecorationStyle = parseTextDecorationStyle(style.textDecorationStyle); + + return { + textDecorationLine: textDecorationLine, + textDecorationColor: textDecorationColor, + textDecorationStyle: textDecorationStyle + }; +}; + +/***/ }), +/* 12 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.parseBorder = exports.BORDER_SIDES = exports.BORDER_STYLE = undefined; + +var _Color = __webpack_require__(0); + +var _Color2 = _interopRequireDefault(_Color); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var BORDER_STYLE = exports.BORDER_STYLE = { + NONE: 0, + SOLID: 1 +}; + +var BORDER_SIDES = exports.BORDER_SIDES = { + TOP: 0, + RIGHT: 1, + BOTTOM: 2, + LEFT: 3 +}; + +var SIDES = Object.keys(BORDER_SIDES).map(function (s) { + return s.toLowerCase(); +}); + +var parseBorderStyle = function parseBorderStyle(style) { + switch (style) { + case 'none': + return BORDER_STYLE.NONE; + } + return BORDER_STYLE.SOLID; +}; + +var parseBorder = exports.parseBorder = function parseBorder(style) { + return SIDES.map(function (side) { + var borderColor = new _Color2.default(style.getPropertyValue('border-' + side + '-color')); + var borderStyle = parseBorderStyle(style.getPropertyValue('border-' + side + '-style')); + var borderWidth = parseFloat(style.getPropertyValue('border-' + side + '-width')); + return { + borderColor: borderColor, + borderStyle: borderStyle, + borderWidth: isNaN(borderWidth) ? 0 : borderWidth + }; + }); +}; + +/***/ }), +/* 13 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var toCodePoints = exports.toCodePoints = function toCodePoints(str) { + var codePoints = []; + var i = 0; + + var length = str.length; + while (i < length) { + var value = str.charCodeAt(i++); + if (value >= 0xd800 && value <= 0xdbff && i < length) { + var extra = str.charCodeAt(i++); + if ((extra & 0xfc00) === 0xdc00) { + codePoints.push(((value & 0x3ff) << 10) + (extra & 0x3ff) + 0x10000); + } else { + codePoints.push(value); + i--; + } + } else { + codePoints.push(value); + } + } + return codePoints; +}; + +var fromCodePoint = exports.fromCodePoint = function fromCodePoint() { + if (String.fromCodePoint) { + return String.fromCodePoint.apply(String, arguments); + } + + var length = arguments.length; + if (!length) { + return ''; + } + + var codeUnits = []; + + var index = -1; + var result = ''; + while (++index < length) { + var codePoint = arguments.length <= index ? undefined : arguments[index]; + if (codePoint <= 0xffff) { + codeUnits.push(codePoint); + } else { + codePoint -= 0x10000; + codeUnits.push((codePoint >> 10) + 0xd800, codePoint % 0x400 + 0xdc00); + } + if (index + 1 === length || codeUnits.length > 0x4000) { + result += String.fromCharCode.apply(String, codeUnits); + codeUnits.length = 0; + } + } + return result; +}; + +var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; + +// Use a lookup table to find the index. +var lookup = typeof Uint8Array === 'undefined' ? [] : new Uint8Array(256); +for (var i = 0; i < chars.length; i++) { + lookup[chars.charCodeAt(i)] = i; +} + +var decode = exports.decode = function decode(base64) { + var bufferLength = base64.length * 0.75, + len = base64.length, + i = void 0, + p = 0, + encoded1 = void 0, + encoded2 = void 0, + encoded3 = void 0, + encoded4 = void 0; + + if (base64[base64.length - 1] === '=') { + bufferLength--; + if (base64[base64.length - 2] === '=') { + bufferLength--; + } + } + + var buffer = typeof ArrayBuffer !== 'undefined' && typeof Uint8Array !== 'undefined' && typeof Uint8Array.prototype.slice !== 'undefined' ? new ArrayBuffer(bufferLength) : new Array(bufferLength); + var bytes = Array.isArray(buffer) ? buffer : new Uint8Array(buffer); + + for (i = 0; i < len; i += 4) { + encoded1 = lookup[base64.charCodeAt(i)]; + encoded2 = lookup[base64.charCodeAt(i + 1)]; + encoded3 = lookup[base64.charCodeAt(i + 2)]; + encoded4 = lookup[base64.charCodeAt(i + 3)]; + + bytes[p++] = encoded1 << 2 | encoded2 >> 4; + bytes[p++] = (encoded2 & 15) << 4 | encoded3 >> 2; + bytes[p++] = (encoded3 & 3) << 6 | encoded4 & 63; + } + + return buffer; +}; + +var polyUint16Array = exports.polyUint16Array = function polyUint16Array(buffer) { + var length = buffer.length; + var bytes = []; + for (var _i = 0; _i < length; _i += 2) { + bytes.push(buffer[_i + 1] << 8 | buffer[_i]); + } + return bytes; +}; + +var polyUint32Array = exports.polyUint32Array = function polyUint32Array(buffer) { + var length = buffer.length; + var bytes = []; + for (var _i2 = 0; _i2 < length; _i2 += 4) { + bytes.push(buffer[_i2 + 3] << 24 | buffer[_i2 + 2] << 16 | buffer[_i2 + 1] << 8 | buffer[_i2]); + } + return bytes; +}; + +/***/ }), +/* 14 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createCounterText = exports.inlineListItemElement = exports.getListOwner = undefined; + +var _Util = __webpack_require__(3); + +var _NodeContainer = __webpack_require__(6); + +var _NodeContainer2 = _interopRequireDefault(_NodeContainer); + +var _TextContainer = __webpack_require__(9); + +var _TextContainer2 = _interopRequireDefault(_TextContainer); + +var _listStyle = __webpack_require__(8); + +var _Unicode = __webpack_require__(24); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +// Margin between the enumeration and the list item content +var MARGIN_RIGHT = 7; + +var ancestorTypes = ['OL', 'UL', 'MENU']; + +var getListOwner = exports.getListOwner = function getListOwner(container) { + var parent = container.parent; + if (!parent) { + return null; + } + + do { + var isAncestor = ancestorTypes.indexOf(parent.tagName) !== -1; + if (isAncestor) { + return parent; + } + parent = parent.parent; + } while (parent); + + return container.parent; +}; + +var inlineListItemElement = exports.inlineListItemElement = function inlineListItemElement(node, container, resourceLoader) { + var listStyle = container.style.listStyle; + + if (!listStyle) { + return; + } + + var style = node.ownerDocument.defaultView.getComputedStyle(node, null); + var wrapper = node.ownerDocument.createElement('html2canvaswrapper'); + (0, _Util.copyCSSStyles)(style, wrapper); + + wrapper.style.position = 'absolute'; + wrapper.style.bottom = 'auto'; + wrapper.style.display = 'block'; + wrapper.style.letterSpacing = 'normal'; + + switch (listStyle.listStylePosition) { + case _listStyle.LIST_STYLE_POSITION.OUTSIDE: + wrapper.style.left = 'auto'; + wrapper.style.right = node.ownerDocument.defaultView.innerWidth - container.bounds.left - container.style.margin[1].getAbsoluteValue(container.bounds.width) + MARGIN_RIGHT + 'px'; + wrapper.style.textAlign = 'right'; + break; + case _listStyle.LIST_STYLE_POSITION.INSIDE: + wrapper.style.left = container.bounds.left - container.style.margin[3].getAbsoluteValue(container.bounds.width) + 'px'; + wrapper.style.right = 'auto'; + wrapper.style.textAlign = 'left'; + break; + } + + var text = void 0; + var MARGIN_TOP = container.style.margin[0].getAbsoluteValue(container.bounds.width); + var styleImage = listStyle.listStyleImage; + if (styleImage) { + if (styleImage.method === 'url') { + var image = node.ownerDocument.createElement('img'); + image.src = styleImage.args[0]; + wrapper.style.top = container.bounds.top - MARGIN_TOP + 'px'; + wrapper.style.width = 'auto'; + wrapper.style.height = 'auto'; + wrapper.appendChild(image); + } else { + var size = parseFloat(container.style.font.fontSize) * 0.5; + wrapper.style.top = container.bounds.top - MARGIN_TOP + container.bounds.height - 1.5 * size + 'px'; + wrapper.style.width = size + 'px'; + wrapper.style.height = size + 'px'; + wrapper.style.backgroundImage = style.listStyleImage; + } + } else if (typeof container.listIndex === 'number') { + text = node.ownerDocument.createTextNode(createCounterText(container.listIndex, listStyle.listStyleType, true)); + wrapper.appendChild(text); + wrapper.style.top = container.bounds.top - MARGIN_TOP + 'px'; + } + + // $FlowFixMe + var body = node.ownerDocument.body; + body.appendChild(wrapper); + + if (text) { + container.childNodes.push(_TextContainer2.default.fromTextNode(text, container)); + body.removeChild(wrapper); + } else { + // $FlowFixMe + container.childNodes.push(new _NodeContainer2.default(wrapper, container, resourceLoader, 0)); + } +}; + +var ROMAN_UPPER = { + integers: [1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1], + values: ['M', 'CM', 'D', 'CD', 'C', 'XC', 'L', 'XL', 'X', 'IX', 'V', 'IV', 'I'] +}; + +var ARMENIAN = { + integers: [9000, 8000, 7000, 6000, 5000, 4000, 3000, 2000, 1000, 900, 800, 700, 600, 500, 400, 300, 200, 100, 90, 80, 70, 60, 50, 40, 30, 20, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1], + values: ['Ք', 'Փ', 'Ւ', 'Ց', 'Ր', 'Տ', 'Վ', 'Ս', 'Ռ', 'Ջ', 'Պ', 'Չ', 'Ո', 'Շ', 'Ն', 'Յ', 'Մ', 'Ճ', 'Ղ', 'Ձ', 'Հ', 'Կ', 'Ծ', 'Խ', 'Լ', 'Ի', 'Ժ', 'Թ', 'Ը', 'Է', 'Զ', 'Ե', 'Դ', 'Գ', 'Բ', 'Ա'] +}; + +var HEBREW = { + integers: [10000, 9000, 8000, 7000, 6000, 5000, 4000, 3000, 2000, 1000, 400, 300, 200, 100, 90, 80, 70, 60, 50, 40, 30, 20, 19, 18, 17, 16, 15, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1], + values: ['י׳', 'ט׳', 'ח׳', 'ז׳', 'ו׳', 'ה׳', 'ד׳', 'ג׳', 'ב׳', 'א׳', 'ת', 'ש', 'ר', 'ק', 'צ', 'פ', 'ע', 'ס', 'נ', 'מ', 'ל', 'כ', 'יט', 'יח', 'יז', 'טז', 'טו', 'י', 'ט', 'ח', 'ז', 'ו', 'ה', 'ד', 'ג', 'ב', 'א'] +}; + +var GEORGIAN = { + integers: [10000, 9000, 8000, 7000, 6000, 5000, 4000, 3000, 2000, 1000, 900, 800, 700, 600, 500, 400, 300, 200, 100, 90, 80, 70, 60, 50, 40, 30, 20, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1], + values: ['ჵ', 'ჰ', 'ჯ', 'ჴ', 'ხ', 'ჭ', 'წ', 'ძ', 'ც', 'ჩ', 'შ', 'ყ', 'ღ', 'ქ', 'ფ', 'ჳ', 'ტ', 'ს', 'რ', 'ჟ', 'პ', 'ო', 'ჲ', 'ნ', 'მ', 'ლ', 'კ', 'ი', 'თ', 'ჱ', 'ზ', 'ვ', 'ე', 'დ', 'გ', 'ბ', 'ა'] +}; + +var createAdditiveCounter = function createAdditiveCounter(value, min, max, symbols, fallback, suffix) { + if (value < min || value > max) { + return createCounterText(value, fallback, suffix.length > 0); + } + + return symbols.integers.reduce(function (string, integer, index) { + while (value >= integer) { + value -= integer; + string += symbols.values[index]; + } + return string; + }, '') + suffix; +}; + +var createCounterStyleWithSymbolResolver = function createCounterStyleWithSymbolResolver(value, codePointRangeLength, isNumeric, resolver) { + var string = ''; + + do { + if (!isNumeric) { + value--; + } + string = resolver(value) + string; + value /= codePointRangeLength; + } while (value * codePointRangeLength >= codePointRangeLength); + + return string; +}; + +var createCounterStyleFromRange = function createCounterStyleFromRange(value, codePointRangeStart, codePointRangeEnd, isNumeric, suffix) { + var codePointRangeLength = codePointRangeEnd - codePointRangeStart + 1; + + return (value < 0 ? '-' : '') + (createCounterStyleWithSymbolResolver(Math.abs(value), codePointRangeLength, isNumeric, function (codePoint) { + return (0, _Unicode.fromCodePoint)(Math.floor(codePoint % codePointRangeLength) + codePointRangeStart); + }) + suffix); +}; + +var createCounterStyleFromSymbols = function createCounterStyleFromSymbols(value, symbols) { + var suffix = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '. '; + + var codePointRangeLength = symbols.length; + return createCounterStyleWithSymbolResolver(Math.abs(value), codePointRangeLength, false, function (codePoint) { + return symbols[Math.floor(codePoint % codePointRangeLength)]; + }) + suffix; +}; + +var CJK_ZEROS = 1 << 0; +var CJK_TEN_COEFFICIENTS = 1 << 1; +var CJK_TEN_HIGH_COEFFICIENTS = 1 << 2; +var CJK_HUNDRED_COEFFICIENTS = 1 << 3; + +var createCJKCounter = function createCJKCounter(value, numbers, multipliers, negativeSign, suffix, flags) { + if (value < -9999 || value > 9999) { + return createCounterText(value, _listStyle.LIST_STYLE_TYPE.CJK_DECIMAL, suffix.length > 0); + } + var tmp = Math.abs(value); + var string = suffix; + + if (tmp === 0) { + return numbers[0] + string; + } + + for (var digit = 0; tmp > 0 && digit <= 4; digit++) { + var coefficient = tmp % 10; + + if (coefficient === 0 && (0, _Util.contains)(flags, CJK_ZEROS) && string !== '') { + string = numbers[coefficient] + string; + } else if (coefficient > 1 || coefficient === 1 && digit === 0 || coefficient === 1 && digit === 1 && (0, _Util.contains)(flags, CJK_TEN_COEFFICIENTS) || coefficient === 1 && digit === 1 && (0, _Util.contains)(flags, CJK_TEN_HIGH_COEFFICIENTS) && value > 100 || coefficient === 1 && digit > 1 && (0, _Util.contains)(flags, CJK_HUNDRED_COEFFICIENTS)) { + string = numbers[coefficient] + (digit > 0 ? multipliers[digit - 1] : '') + string; + } else if (coefficient === 1 && digit > 0) { + string = multipliers[digit - 1] + string; + } + tmp = Math.floor(tmp / 10); + } + + return (value < 0 ? negativeSign : '') + string; +}; + +var CHINESE_INFORMAL_MULTIPLIERS = '十百千萬'; +var CHINESE_FORMAL_MULTIPLIERS = '拾佰仟萬'; +var JAPANESE_NEGATIVE = 'マイナス'; +var KOREAN_NEGATIVE = '마이너스 '; + +var createCounterText = exports.createCounterText = function createCounterText(value, type, appendSuffix) { + var defaultSuffix = appendSuffix ? '. ' : ''; + var cjkSuffix = appendSuffix ? '、' : ''; + var koreanSuffix = appendSuffix ? ', ' : ''; + switch (type) { + case _listStyle.LIST_STYLE_TYPE.DISC: + return '•'; + case _listStyle.LIST_STYLE_TYPE.CIRCLE: + return '◦'; + case _listStyle.LIST_STYLE_TYPE.SQUARE: + return '◾'; + case _listStyle.LIST_STYLE_TYPE.DECIMAL_LEADING_ZERO: + var string = createCounterStyleFromRange(value, 48, 57, true, defaultSuffix); + return string.length < 4 ? '0' + string : string; + case _listStyle.LIST_STYLE_TYPE.CJK_DECIMAL: + return createCounterStyleFromSymbols(value, '〇一二三四五六七八九', cjkSuffix); + case _listStyle.LIST_STYLE_TYPE.LOWER_ROMAN: + return createAdditiveCounter(value, 1, 3999, ROMAN_UPPER, _listStyle.LIST_STYLE_TYPE.DECIMAL, defaultSuffix).toLowerCase(); + case _listStyle.LIST_STYLE_TYPE.UPPER_ROMAN: + return createAdditiveCounter(value, 1, 3999, ROMAN_UPPER, _listStyle.LIST_STYLE_TYPE.DECIMAL, defaultSuffix); + case _listStyle.LIST_STYLE_TYPE.LOWER_GREEK: + return createCounterStyleFromRange(value, 945, 969, false, defaultSuffix); + case _listStyle.LIST_STYLE_TYPE.LOWER_ALPHA: + return createCounterStyleFromRange(value, 97, 122, false, defaultSuffix); + case _listStyle.LIST_STYLE_TYPE.UPPER_ALPHA: + return createCounterStyleFromRange(value, 65, 90, false, defaultSuffix); + case _listStyle.LIST_STYLE_TYPE.ARABIC_INDIC: + return createCounterStyleFromRange(value, 1632, 1641, true, defaultSuffix); + case _listStyle.LIST_STYLE_TYPE.ARMENIAN: + case _listStyle.LIST_STYLE_TYPE.UPPER_ARMENIAN: + return createAdditiveCounter(value, 1, 9999, ARMENIAN, _listStyle.LIST_STYLE_TYPE.DECIMAL, defaultSuffix); + case _listStyle.LIST_STYLE_TYPE.LOWER_ARMENIAN: + return createAdditiveCounter(value, 1, 9999, ARMENIAN, _listStyle.LIST_STYLE_TYPE.DECIMAL, defaultSuffix).toLowerCase(); + case _listStyle.LIST_STYLE_TYPE.BENGALI: + return createCounterStyleFromRange(value, 2534, 2543, true, defaultSuffix); + case _listStyle.LIST_STYLE_TYPE.CAMBODIAN: + case _listStyle.LIST_STYLE_TYPE.KHMER: + return createCounterStyleFromRange(value, 6112, 6121, true, defaultSuffix); + case _listStyle.LIST_STYLE_TYPE.CJK_EARTHLY_BRANCH: + return createCounterStyleFromSymbols(value, '子丑寅卯辰巳午未申酉戌亥', cjkSuffix); + case _listStyle.LIST_STYLE_TYPE.CJK_HEAVENLY_STEM: + return createCounterStyleFromSymbols(value, '甲乙丙丁戊己庚辛壬癸', cjkSuffix); + case _listStyle.LIST_STYLE_TYPE.CJK_IDEOGRAPHIC: + case _listStyle.LIST_STYLE_TYPE.TRAD_CHINESE_INFORMAL: + return createCJKCounter(value, '零一二三四五六七八九', CHINESE_INFORMAL_MULTIPLIERS, '負', cjkSuffix, CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS); + case _listStyle.LIST_STYLE_TYPE.TRAD_CHINESE_FORMAL: + return createCJKCounter(value, '零壹貳參肆伍陸柒捌玖', CHINESE_FORMAL_MULTIPLIERS, '負', cjkSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS); + case _listStyle.LIST_STYLE_TYPE.SIMP_CHINESE_INFORMAL: + return createCJKCounter(value, '零一二三四五六七八九', CHINESE_INFORMAL_MULTIPLIERS, '负', cjkSuffix, CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS); + case _listStyle.LIST_STYLE_TYPE.SIMP_CHINESE_FORMAL: + return createCJKCounter(value, '零壹贰叁肆伍陆柒捌玖', CHINESE_FORMAL_MULTIPLIERS, '负', cjkSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS); + case _listStyle.LIST_STYLE_TYPE.JAPANESE_INFORMAL: + return createCJKCounter(value, '〇一二三四五六七八九', '十百千万', JAPANESE_NEGATIVE, cjkSuffix, 0); + case _listStyle.LIST_STYLE_TYPE.JAPANESE_FORMAL: + return createCJKCounter(value, '零壱弐参四伍六七八九', '拾百千万', JAPANESE_NEGATIVE, cjkSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS); + case _listStyle.LIST_STYLE_TYPE.KOREAN_HANGUL_FORMAL: + return createCJKCounter(value, '영일이삼사오육칠팔구', '십백천만', KOREAN_NEGATIVE, koreanSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS); + case _listStyle.LIST_STYLE_TYPE.KOREAN_HANJA_INFORMAL: + return createCJKCounter(value, '零一二三四五六七八九', '十百千萬', KOREAN_NEGATIVE, koreanSuffix, 0); + case _listStyle.LIST_STYLE_TYPE.KOREAN_HANJA_FORMAL: + return createCJKCounter(value, '零壹貳參四五六七八九', '拾百千', KOREAN_NEGATIVE, koreanSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS); + case _listStyle.LIST_STYLE_TYPE.DEVANAGARI: + return createCounterStyleFromRange(value, 0x966, 0x96f, true, defaultSuffix); + case _listStyle.LIST_STYLE_TYPE.GEORGIAN: + return createAdditiveCounter(value, 1, 19999, GEORGIAN, _listStyle.LIST_STYLE_TYPE.DECIMAL, defaultSuffix); + case _listStyle.LIST_STYLE_TYPE.GUJARATI: + return createCounterStyleFromRange(value, 0xae6, 0xaef, true, defaultSuffix); + case _listStyle.LIST_STYLE_TYPE.GURMUKHI: + return createCounterStyleFromRange(value, 0xa66, 0xa6f, true, defaultSuffix); + case _listStyle.LIST_STYLE_TYPE.HEBREW: + return createAdditiveCounter(value, 1, 10999, HEBREW, _listStyle.LIST_STYLE_TYPE.DECIMAL, defaultSuffix); + case _listStyle.LIST_STYLE_TYPE.HIRAGANA: + return createCounterStyleFromSymbols(value, 'あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん'); + case _listStyle.LIST_STYLE_TYPE.HIRAGANA_IROHA: + return createCounterStyleFromSymbols(value, 'いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす'); + case _listStyle.LIST_STYLE_TYPE.KANNADA: + return createCounterStyleFromRange(value, 0xce6, 0xcef, true, defaultSuffix); + case _listStyle.LIST_STYLE_TYPE.KATAKANA: + return createCounterStyleFromSymbols(value, 'アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン', cjkSuffix); + case _listStyle.LIST_STYLE_TYPE.KATAKANA_IROHA: + return createCounterStyleFromSymbols(value, 'イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス', cjkSuffix); + case _listStyle.LIST_STYLE_TYPE.LAO: + return createCounterStyleFromRange(value, 0xed0, 0xed9, true, defaultSuffix); + case _listStyle.LIST_STYLE_TYPE.MONGOLIAN: + return createCounterStyleFromRange(value, 0x1810, 0x1819, true, defaultSuffix); + case _listStyle.LIST_STYLE_TYPE.MYANMAR: + return createCounterStyleFromRange(value, 0x1040, 0x1049, true, defaultSuffix); + case _listStyle.LIST_STYLE_TYPE.ORIYA: + return createCounterStyleFromRange(value, 0xb66, 0xb6f, true, defaultSuffix); + case _listStyle.LIST_STYLE_TYPE.PERSIAN: + return createCounterStyleFromRange(value, 0x6f0, 0x6f9, true, defaultSuffix); + case _listStyle.LIST_STYLE_TYPE.TAMIL: + return createCounterStyleFromRange(value, 0xbe6, 0xbef, true, defaultSuffix); + case _listStyle.LIST_STYLE_TYPE.TELUGU: + return createCounterStyleFromRange(value, 0xc66, 0xc6f, true, defaultSuffix); + case _listStyle.LIST_STYLE_TYPE.THAI: + return createCounterStyleFromRange(value, 0xe50, 0xe59, true, defaultSuffix); + case _listStyle.LIST_STYLE_TYPE.TIBETAN: + return createCounterStyleFromRange(value, 0xf20, 0xf29, true, defaultSuffix); + case _listStyle.LIST_STYLE_TYPE.DECIMAL: + default: + return createCounterStyleFromRange(value, 48, 57, true, defaultSuffix); + } +}; + +/***/ }), +/* 15 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _Path = __webpack_require__(5); + +var _textDecoration = __webpack_require__(11); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var addColorStops = function addColorStops(gradient, canvasGradient) { + var maxStop = Math.max.apply(null, gradient.colorStops.map(function (colorStop) { + return colorStop.stop; + })); + var f = 1 / Math.max(1, maxStop); + gradient.colorStops.forEach(function (colorStop) { + canvasGradient.addColorStop(f * colorStop.stop, colorStop.color.toString()); + }); +}; + +var CanvasRenderer = function () { + function CanvasRenderer(canvas) { + _classCallCheck(this, CanvasRenderer); + + this.canvas = canvas ? canvas : document.createElement('canvas'); + } + + _createClass(CanvasRenderer, [{ + key: 'render', + value: function render(options) { + this.ctx = this.canvas.getContext('2d'); + this.options = options; + this.canvas.width = Math.floor(options.width * options.scale); + this.canvas.height = Math.floor(options.height * options.scale); + this.canvas.style.width = options.width + 'px'; + this.canvas.style.height = options.height + 'px'; + + this.ctx.scale(this.options.scale, this.options.scale); + this.ctx.translate(-options.x, -options.y); + this.ctx.textBaseline = 'bottom'; + options.logger.log('Canvas renderer initialized (' + options.width + 'x' + options.height + ' at ' + options.x + ',' + options.y + ') with scale ' + this.options.scale); + } + }, { + key: 'clip', + value: function clip(clipPaths, callback) { + var _this = this; + + if (clipPaths.length) { + this.ctx.save(); + clipPaths.forEach(function (path) { + _this.path(path); + _this.ctx.clip(); + }); + } + + callback(); + + if (clipPaths.length) { + this.ctx.restore(); + } + } + }, { + key: 'drawImage', + value: function drawImage(image, source, destination) { + this.ctx.drawImage(image, source.left, source.top, source.width, source.height, destination.left, destination.top, destination.width, destination.height); + } + }, { + key: 'drawShape', + value: function drawShape(path, color) { + this.path(path); + this.ctx.fillStyle = color.toString(); + this.ctx.fill(); + } + }, { + key: 'fill', + value: function fill(color) { + this.ctx.fillStyle = color.toString(); + this.ctx.fill(); + } + }, { + key: 'getTarget', + value: function getTarget() { + this.canvas.getContext('2d').setTransform(1, 0, 0, 1, 0, 0); + return Promise.resolve(this.canvas); + } + }, { + key: 'path', + value: function path(_path) { + var _this2 = this; + + this.ctx.beginPath(); + if (Array.isArray(_path)) { + _path.forEach(function (point, index) { + var start = point.type === _Path.PATH.VECTOR ? point : point.start; + if (index === 0) { + _this2.ctx.moveTo(start.x, start.y); + } else { + _this2.ctx.lineTo(start.x, start.y); + } + + if (point.type === _Path.PATH.BEZIER_CURVE) { + _this2.ctx.bezierCurveTo(point.startControl.x, point.startControl.y, point.endControl.x, point.endControl.y, point.end.x, point.end.y); + } + }); + } else { + this.ctx.arc(_path.x + _path.radius, _path.y + _path.radius, _path.radius, 0, Math.PI * 2, true); + } + + this.ctx.closePath(); + } + }, { + key: 'rectangle', + value: function rectangle(x, y, width, height, color) { + this.ctx.fillStyle = color.toString(); + this.ctx.fillRect(x, y, width, height); + } + }, { + key: 'renderLinearGradient', + value: function renderLinearGradient(bounds, gradient) { + var linearGradient = this.ctx.createLinearGradient(bounds.left + gradient.direction.x1, bounds.top + gradient.direction.y1, bounds.left + gradient.direction.x0, bounds.top + gradient.direction.y0); + + addColorStops(gradient, linearGradient); + this.ctx.fillStyle = linearGradient; + this.ctx.fillRect(bounds.left, bounds.top, bounds.width, bounds.height); + } + }, { + key: 'renderRadialGradient', + value: function renderRadialGradient(bounds, gradient) { + var _this3 = this; + + var x = bounds.left + gradient.center.x; + var y = bounds.top + gradient.center.y; + + var radialGradient = this.ctx.createRadialGradient(x, y, 0, x, y, gradient.radius.x); + if (!radialGradient) { + return; + } + + addColorStops(gradient, radialGradient); + this.ctx.fillStyle = radialGradient; + + if (gradient.radius.x !== gradient.radius.y) { + // transforms for elliptical radial gradient + var midX = bounds.left + 0.5 * bounds.width; + var midY = bounds.top + 0.5 * bounds.height; + var f = gradient.radius.y / gradient.radius.x; + var invF = 1 / f; + + this.transform(midX, midY, [1, 0, 0, f, 0, 0], function () { + return _this3.ctx.fillRect(bounds.left, invF * (bounds.top - midY) + midY, bounds.width, bounds.height * invF); + }); + } else { + this.ctx.fillRect(bounds.left, bounds.top, bounds.width, bounds.height); + } + } + }, { + key: 'renderRepeat', + value: function renderRepeat(path, image, imageSize, offsetX, offsetY) { + this.path(path); + this.ctx.fillStyle = this.ctx.createPattern(this.resizeImage(image, imageSize), 'repeat'); + this.ctx.translate(offsetX, offsetY); + this.ctx.fill(); + this.ctx.translate(-offsetX, -offsetY); + } + }, { + key: 'renderTextNode', + value: function renderTextNode(textBounds, color, font, textDecoration, textShadows) { + var _this4 = this; + + this.ctx.font = [font.fontStyle, font.fontVariant, font.fontWeight, font.fontSize, font.fontFamily].join(' '); + + textBounds.forEach(function (text) { + _this4.ctx.fillStyle = color.toString(); + if (textShadows && text.text.trim().length) { + textShadows.slice(0).reverse().forEach(function (textShadow) { + _this4.ctx.shadowColor = textShadow.color.toString(); + _this4.ctx.shadowOffsetX = textShadow.offsetX * _this4.options.scale; + _this4.ctx.shadowOffsetY = textShadow.offsetY * _this4.options.scale; + _this4.ctx.shadowBlur = textShadow.blur; + + _this4.ctx.fillText(text.text, text.bounds.left, text.bounds.top + text.bounds.height); + }); + } else { + _this4.ctx.fillText(text.text, text.bounds.left, text.bounds.top + text.bounds.height); + } + + if (textDecoration !== null) { + var textDecorationColor = textDecoration.textDecorationColor || color; + textDecoration.textDecorationLine.forEach(function (textDecorationLine) { + switch (textDecorationLine) { + case _textDecoration.TEXT_DECORATION_LINE.UNDERLINE: + // Draws a line at the baseline of the font + // TODO As some browsers display the line as more than 1px if the font-size is big, + // need to take that into account both in position and size + var _options$fontMetrics$ = _this4.options.fontMetrics.getMetrics(font), + baseline = _options$fontMetrics$.baseline; + + _this4.rectangle(text.bounds.left, Math.round(text.bounds.top + baseline), text.bounds.width, 1, textDecorationColor); + break; + case _textDecoration.TEXT_DECORATION_LINE.OVERLINE: + _this4.rectangle(text.bounds.left, Math.round(text.bounds.top), text.bounds.width, 1, textDecorationColor); + break; + case _textDecoration.TEXT_DECORATION_LINE.LINE_THROUGH: + // TODO try and find exact position for line-through + var _options$fontMetrics$2 = _this4.options.fontMetrics.getMetrics(font), + middle = _options$fontMetrics$2.middle; + + _this4.rectangle(text.bounds.left, Math.ceil(text.bounds.top + middle), text.bounds.width, 1, textDecorationColor); + break; + } + }); + } + }); + } + }, { + key: 'resizeImage', + value: function resizeImage(image, size) { + if (image.width === size.width && image.height === size.height) { + return image; + } + + var canvas = this.canvas.ownerDocument.createElement('canvas'); + canvas.width = size.width; + canvas.height = size.height; + var ctx = canvas.getContext('2d'); + ctx.drawImage(image, 0, 0, image.width, image.height, 0, 0, size.width, size.height); + return canvas; + } + }, { + key: 'setOpacity', + value: function setOpacity(opacity) { + this.ctx.globalAlpha = opacity; + } + }, { + key: 'transform', + value: function transform(offsetX, offsetY, matrix, callback) { + this.ctx.save(); + this.ctx.translate(offsetX, offsetY); + this.ctx.transform(matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5]); + this.ctx.translate(-offsetX, -offsetY); + + callback(); + + this.ctx.restore(); + } + }]); + + return CanvasRenderer; +}(); + +exports.default = CanvasRenderer; + +/***/ }), +/* 16 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var Logger = function () { + function Logger(enabled, id, start) { + _classCallCheck(this, Logger); + + this.enabled = typeof window !== 'undefined' && enabled; + this.start = start ? start : Date.now(); + this.id = id; + } + + _createClass(Logger, [{ + key: 'child', + value: function child(id) { + return new Logger(this.enabled, id, this.start); + } + + // eslint-disable-next-line flowtype/no-weak-types + + }, { + key: 'log', + value: function log() { + if (this.enabled && window.console && window.console.log) { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + Function.prototype.bind.call(window.console.log, window.console).apply(window.console, [Date.now() - this.start + 'ms', this.id ? 'html2canvas (' + this.id + '):' : 'html2canvas:'].concat([].slice.call(args, 0))); + } + } + + // eslint-disable-next-line flowtype/no-weak-types + + }, { + key: 'error', + value: function error() { + if (this.enabled && window.console && window.console.error) { + for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + + Function.prototype.bind.call(window.console.error, window.console).apply(window.console, [Date.now() - this.start + 'ms', this.id ? 'html2canvas (' + this.id + '):' : 'html2canvas:'].concat([].slice.call(args, 0))); + } + } + }]); + + return Logger; +}(); + +exports.default = Logger; + +/***/ }), +/* 17 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.parsePadding = exports.PADDING_SIDES = undefined; + +var _Length = __webpack_require__(1); + +var _Length2 = _interopRequireDefault(_Length); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var PADDING_SIDES = exports.PADDING_SIDES = { + TOP: 0, + RIGHT: 1, + BOTTOM: 2, + LEFT: 3 +}; + +var SIDES = ['top', 'right', 'bottom', 'left']; + +var parsePadding = exports.parsePadding = function parsePadding(style) { + return SIDES.map(function (side) { + return new _Length2.default(style.getPropertyValue('padding-' + side)); + }); +}; + +/***/ }), +/* 18 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var OVERFLOW_WRAP = exports.OVERFLOW_WRAP = { + NORMAL: 0, + BREAK_WORD: 1 +}; + +var parseOverflowWrap = exports.parseOverflowWrap = function parseOverflowWrap(overflow) { + switch (overflow) { + case 'break-word': + return OVERFLOW_WRAP.BREAK_WORD; + case 'normal': + default: + return OVERFLOW_WRAP.NORMAL; + } +}; + +/***/ }), +/* 19 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var POSITION = exports.POSITION = { + STATIC: 0, + RELATIVE: 1, + ABSOLUTE: 2, + FIXED: 3, + STICKY: 4 +}; + +var parsePosition = exports.parsePosition = function parsePosition(position) { + switch (position) { + case 'relative': + return POSITION.RELATIVE; + case 'absolute': + return POSITION.ABSOLUTE; + case 'fixed': + return POSITION.FIXED; + case 'sticky': + return POSITION.STICKY; + } + + return POSITION.STATIC; +}; + +/***/ }), +/* 20 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var TEXT_TRANSFORM = exports.TEXT_TRANSFORM = { + NONE: 0, + LOWERCASE: 1, + UPPERCASE: 2, + CAPITALIZE: 3 +}; + +var parseTextTransform = exports.parseTextTransform = function parseTextTransform(textTransform) { + switch (textTransform) { + case 'uppercase': + return TEXT_TRANSFORM.UPPERCASE; + case 'lowercase': + return TEXT_TRANSFORM.LOWERCASE; + case 'capitalize': + return TEXT_TRANSFORM.CAPITALIZE; + } + + return TEXT_TRANSFORM.NONE; +}; + +/***/ }), +/* 21 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.reformatInputBounds = exports.inlineSelectElement = exports.inlineTextAreaElement = exports.inlineInputElement = exports.getInputBorderRadius = exports.INPUT_BACKGROUND = exports.INPUT_BORDERS = exports.INPUT_COLOR = undefined; + +var _TextContainer = __webpack_require__(9); + +var _TextContainer2 = _interopRequireDefault(_TextContainer); + +var _background = __webpack_require__(4); + +var _border = __webpack_require__(12); + +var _Circle = __webpack_require__(50); + +var _Circle2 = _interopRequireDefault(_Circle); + +var _Vector = __webpack_require__(7); + +var _Vector2 = _interopRequireDefault(_Vector); + +var _Color = __webpack_require__(0); + +var _Color2 = _interopRequireDefault(_Color); + +var _Length = __webpack_require__(1); + +var _Length2 = _interopRequireDefault(_Length); + +var _Bounds = __webpack_require__(2); + +var _TextBounds = __webpack_require__(22); + +var _Util = __webpack_require__(3); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var INPUT_COLOR = exports.INPUT_COLOR = new _Color2.default([42, 42, 42]); +var INPUT_BORDER_COLOR = new _Color2.default([165, 165, 165]); +var INPUT_BACKGROUND_COLOR = new _Color2.default([222, 222, 222]); +var INPUT_BORDER = { + borderWidth: 1, + borderColor: INPUT_BORDER_COLOR, + borderStyle: _border.BORDER_STYLE.SOLID +}; +var INPUT_BORDERS = exports.INPUT_BORDERS = [INPUT_BORDER, INPUT_BORDER, INPUT_BORDER, INPUT_BORDER]; +var INPUT_BACKGROUND = exports.INPUT_BACKGROUND = { + backgroundColor: INPUT_BACKGROUND_COLOR, + backgroundImage: [], + backgroundClip: _background.BACKGROUND_CLIP.PADDING_BOX, + backgroundOrigin: _background.BACKGROUND_ORIGIN.PADDING_BOX +}; + +var RADIO_BORDER_RADIUS = new _Length2.default('50%'); +var RADIO_BORDER_RADIUS_TUPLE = [RADIO_BORDER_RADIUS, RADIO_BORDER_RADIUS]; +var INPUT_RADIO_BORDER_RADIUS = [RADIO_BORDER_RADIUS_TUPLE, RADIO_BORDER_RADIUS_TUPLE, RADIO_BORDER_RADIUS_TUPLE, RADIO_BORDER_RADIUS_TUPLE]; + +var CHECKBOX_BORDER_RADIUS = new _Length2.default('3px'); +var CHECKBOX_BORDER_RADIUS_TUPLE = [CHECKBOX_BORDER_RADIUS, CHECKBOX_BORDER_RADIUS]; +var INPUT_CHECKBOX_BORDER_RADIUS = [CHECKBOX_BORDER_RADIUS_TUPLE, CHECKBOX_BORDER_RADIUS_TUPLE, CHECKBOX_BORDER_RADIUS_TUPLE, CHECKBOX_BORDER_RADIUS_TUPLE]; + +var getInputBorderRadius = exports.getInputBorderRadius = function getInputBorderRadius(node) { + return node.type === 'radio' ? INPUT_RADIO_BORDER_RADIUS : INPUT_CHECKBOX_BORDER_RADIUS; +}; + +var inlineInputElement = exports.inlineInputElement = function inlineInputElement(node, container) { + if (node.type === 'radio' || node.type === 'checkbox') { + if (node.checked) { + var size = Math.min(container.bounds.width, container.bounds.height); + container.childNodes.push(node.type === 'checkbox' ? [new _Vector2.default(container.bounds.left + size * 0.39363, container.bounds.top + size * 0.79), new _Vector2.default(container.bounds.left + size * 0.16, container.bounds.top + size * 0.5549), new _Vector2.default(container.bounds.left + size * 0.27347, container.bounds.top + size * 0.44071), new _Vector2.default(container.bounds.left + size * 0.39694, container.bounds.top + size * 0.5649), new _Vector2.default(container.bounds.left + size * 0.72983, container.bounds.top + size * 0.23), new _Vector2.default(container.bounds.left + size * 0.84, container.bounds.top + size * 0.34085), new _Vector2.default(container.bounds.left + size * 0.39363, container.bounds.top + size * 0.79)] : new _Circle2.default(container.bounds.left + size / 4, container.bounds.top + size / 4, size / 4)); + } + } else { + inlineFormElement(getInputValue(node), node, container, false); + } +}; + +var inlineTextAreaElement = exports.inlineTextAreaElement = function inlineTextAreaElement(node, container) { + inlineFormElement(node.value, node, container, true); +}; + +var inlineSelectElement = exports.inlineSelectElement = function inlineSelectElement(node, container) { + var option = node.options[node.selectedIndex || 0]; + inlineFormElement(option ? option.text || '' : '', node, container, false); +}; + +var reformatInputBounds = exports.reformatInputBounds = function reformatInputBounds(bounds) { + if (bounds.width > bounds.height) { + bounds.left += (bounds.width - bounds.height) / 2; + bounds.width = bounds.height; + } else if (bounds.width < bounds.height) { + bounds.top += (bounds.height - bounds.width) / 2; + bounds.height = bounds.width; + } + return bounds; +}; + +var inlineFormElement = function inlineFormElement(value, node, container, allowLinebreak) { + var body = node.ownerDocument.body; + if (value.length > 0 && body) { + var wrapper = node.ownerDocument.createElement('html2canvaswrapper'); + (0, _Util.copyCSSStyles)(node.ownerDocument.defaultView.getComputedStyle(node, null), wrapper); + wrapper.style.position = 'absolute'; + wrapper.style.left = container.bounds.left + 'px'; + wrapper.style.top = container.bounds.top + 'px'; + if (!allowLinebreak) { + wrapper.style.whiteSpace = 'nowrap'; + } + var text = node.ownerDocument.createTextNode(value); + wrapper.appendChild(text); + body.appendChild(wrapper); + container.childNodes.push(_TextContainer2.default.fromTextNode(text, container)); + body.removeChild(wrapper); + } +}; + +var getInputValue = function getInputValue(node) { + var value = node.type === 'password' ? new Array(node.value.length + 1).join('\u2022') : node.value; + + return value.length === 0 ? node.placeholder || '' : value; +}; + +/***/ }), +/* 22 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.parseTextBounds = exports.TextBounds = undefined; + +var _Bounds = __webpack_require__(2); + +var _textDecoration = __webpack_require__(11); + +var _Feature = __webpack_require__(10); + +var _Feature2 = _interopRequireDefault(_Feature); + +var _Unicode = __webpack_require__(24); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var TextBounds = exports.TextBounds = function TextBounds(text, bounds) { + _classCallCheck(this, TextBounds); + + this.text = text; + this.bounds = bounds; +}; + +var parseTextBounds = exports.parseTextBounds = function parseTextBounds(value, parent, node) { + var letterRendering = parent.style.letterSpacing !== 0; + var textList = letterRendering ? (0, _Unicode.toCodePoints)(value).map(function (i) { + return (0, _Unicode.fromCodePoint)(i); + }) : (0, _Unicode.breakWords)(value, parent); + var length = textList.length; + var defaultView = node.parentNode ? node.parentNode.ownerDocument.defaultView : null; + var scrollX = defaultView ? defaultView.pageXOffset : 0; + var scrollY = defaultView ? defaultView.pageYOffset : 0; + var textBounds = []; + var offset = 0; + for (var i = 0; i < length; i++) { + var text = textList[i]; + if (parent.style.textDecoration !== _textDecoration.TEXT_DECORATION.NONE || text.trim().length > 0) { + if (_Feature2.default.SUPPORT_RANGE_BOUNDS) { + textBounds.push(new TextBounds(text, getRangeBounds(node, offset, text.length, scrollX, scrollY))); + } else { + var replacementNode = node.splitText(text.length); + textBounds.push(new TextBounds(text, getWrapperBounds(node, scrollX, scrollY))); + node = replacementNode; + } + } else if (!_Feature2.default.SUPPORT_RANGE_BOUNDS) { + node = node.splitText(text.length); + } + offset += text.length; + } + return textBounds; +}; + +var getWrapperBounds = function getWrapperBounds(node, scrollX, scrollY) { + var wrapper = node.ownerDocument.createElement('html2canvaswrapper'); + wrapper.appendChild(node.cloneNode(true)); + var parentNode = node.parentNode; + if (parentNode) { + parentNode.replaceChild(wrapper, node); + var bounds = (0, _Bounds.parseBounds)(wrapper, scrollX, scrollY); + if (wrapper.firstChild) { + parentNode.replaceChild(wrapper.firstChild, wrapper); + } + return bounds; + } + return new _Bounds.Bounds(0, 0, 0, 0); +}; + +var getRangeBounds = function getRangeBounds(node, offset, length, scrollX, scrollY) { + var range = node.ownerDocument.createRange(); + range.setStart(node, offset); + range.setEnd(node, offset + length); + return _Bounds.Bounds.fromClientRect(range.getBoundingClientRect(), scrollX, scrollY); +}; + +/***/ }), +/* 23 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var ForeignObjectRenderer = function () { + function ForeignObjectRenderer(element) { + _classCallCheck(this, ForeignObjectRenderer); + + this.element = element; + } + + _createClass(ForeignObjectRenderer, [{ + key: 'render', + value: function render(options) { + var _this = this; + + this.options = options; + this.canvas = document.createElement('canvas'); + this.ctx = this.canvas.getContext('2d'); + this.canvas.width = Math.floor(options.width) * options.scale; + this.canvas.height = Math.floor(options.height) * options.scale; + this.canvas.style.width = options.width + 'px'; + this.canvas.style.height = options.height + 'px'; + + options.logger.log('ForeignObject renderer initialized (' + options.width + 'x' + options.height + ' at ' + options.x + ',' + options.y + ') with scale ' + options.scale); + var svg = createForeignObjectSVG(Math.max(options.windowWidth, options.width) * options.scale, Math.max(options.windowHeight, options.height) * options.scale, options.scrollX * options.scale, options.scrollY * options.scale, this.element); + + return loadSerializedSVG(svg).then(function (img) { + if (options.backgroundColor) { + _this.ctx.fillStyle = options.backgroundColor.toString(); + _this.ctx.fillRect(0, 0, options.width * options.scale, options.height * options.scale); + } + + _this.ctx.drawImage(img, -options.x * options.scale, -options.y * options.scale); + return _this.canvas; + }); + } + }]); + + return ForeignObjectRenderer; +}(); + +exports.default = ForeignObjectRenderer; +var createForeignObjectSVG = exports.createForeignObjectSVG = function createForeignObjectSVG(width, height, x, y, node) { + var xmlns = 'http://www.w3.org/2000/svg'; + var svg = document.createElementNS(xmlns, 'svg'); + var foreignObject = document.createElementNS(xmlns, 'foreignObject'); + svg.setAttributeNS(null, 'width', width); + svg.setAttributeNS(null, 'height', height); + + foreignObject.setAttributeNS(null, 'width', '100%'); + foreignObject.setAttributeNS(null, 'height', '100%'); + foreignObject.setAttributeNS(null, 'x', x); + foreignObject.setAttributeNS(null, 'y', y); + foreignObject.setAttributeNS(null, 'externalResourcesRequired', 'true'); + svg.appendChild(foreignObject); + + foreignObject.appendChild(node); + + return svg; +}; + +var loadSerializedSVG = exports.loadSerializedSVG = function loadSerializedSVG(svg) { + return new Promise(function (resolve, reject) { + var img = new Image(); + img.onload = function () { + return resolve(img); + }; + img.onerror = reject; + + img.src = 'data:image/svg+xml;charset=utf-8,' + encodeURIComponent(new XMLSerializer().serializeToString(svg)); + }); +}; + +/***/ }), +/* 24 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.breakWords = exports.fromCodePoint = exports.toCodePoints = undefined; + +var _cssLineBreak = __webpack_require__(46); + +Object.defineProperty(exports, 'toCodePoints', { + enumerable: true, + get: function get() { + return _cssLineBreak.toCodePoints; + } +}); +Object.defineProperty(exports, 'fromCodePoint', { + enumerable: true, + get: function get() { + return _cssLineBreak.fromCodePoint; + } +}); + +var _overflowWrap = __webpack_require__(18); + +var breakWords = exports.breakWords = function breakWords(str, parent) { + var breaker = (0, _cssLineBreak.LineBreaker)(str, { + lineBreak: parent.style.lineBreak, + wordBreak: parent.style.overflowWrap === _overflowWrap.OVERFLOW_WRAP.BREAK_WORD ? 'break-word' : parent.style.wordBreak + }); + + var words = []; + var bk = void 0; + + while (!(bk = breaker.next()).done) { + words.push(bk.value.slice()); + } + + return words; +}; + +/***/ }), +/* 25 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.FontMetrics = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _Util = __webpack_require__(3); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var SAMPLE_TEXT = 'Hidden Text'; + +var FontMetrics = exports.FontMetrics = function () { + function FontMetrics(document) { + _classCallCheck(this, FontMetrics); + + this._data = {}; + this._document = document; + } + + _createClass(FontMetrics, [{ + key: '_parseMetrics', + value: function _parseMetrics(font) { + var container = this._document.createElement('div'); + var img = this._document.createElement('img'); + var span = this._document.createElement('span'); + + var body = this._document.body; + if (!body) { + throw new Error( true ? 'No document found for font metrics' : ''); + } + + container.style.visibility = 'hidden'; + container.style.fontFamily = font.fontFamily; + container.style.fontSize = font.fontSize; + container.style.margin = '0'; + container.style.padding = '0'; + + body.appendChild(container); + + img.src = _Util.SMALL_IMAGE; + img.width = 1; + img.height = 1; + + img.style.margin = '0'; + img.style.padding = '0'; + img.style.verticalAlign = 'baseline'; + + span.style.fontFamily = font.fontFamily; + span.style.fontSize = font.fontSize; + span.style.margin = '0'; + span.style.padding = '0'; + + span.appendChild(this._document.createTextNode(SAMPLE_TEXT)); + container.appendChild(span); + container.appendChild(img); + var baseline = img.offsetTop - span.offsetTop + 2; + + container.removeChild(span); + container.appendChild(this._document.createTextNode(SAMPLE_TEXT)); + + container.style.lineHeight = 'normal'; + img.style.verticalAlign = 'super'; + + var middle = img.offsetTop - container.offsetTop + 2; + + body.removeChild(container); + + return { baseline: baseline, middle: middle }; + } + }, { + key: 'getMetrics', + value: function getMetrics(font) { + var key = font.fontFamily + ' ' + font.fontSize; + if (this._data[key] === undefined) { + this._data[key] = this._parseMetrics(font); + } + + return this._data[key]; + } + }]); + + return FontMetrics; +}(); + +/***/ }), +/* 26 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.Proxy = undefined; + +var _Feature = __webpack_require__(10); + +var _Feature2 = _interopRequireDefault(_Feature); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var Proxy = exports.Proxy = function Proxy(src, options) { + if (!options.proxy) { + return Promise.reject( true ? 'No proxy defined' : null); + } + var proxy = options.proxy; + + return new Promise(function (resolve, reject) { + var responseType = _Feature2.default.SUPPORT_CORS_XHR && _Feature2.default.SUPPORT_RESPONSE_TYPE ? 'blob' : 'text'; + var xhr = _Feature2.default.SUPPORT_CORS_XHR ? new XMLHttpRequest() : new XDomainRequest(); + xhr.onload = function () { + if (xhr instanceof XMLHttpRequest) { + if (xhr.status === 200) { + if (responseType === 'text') { + resolve(xhr.response); + } else { + var reader = new FileReader(); + // $FlowFixMe + reader.addEventListener('load', function () { + return resolve(reader.result); + }, false); + // $FlowFixMe + reader.addEventListener('error', function (e) { + return reject(e); + }, false); + reader.readAsDataURL(xhr.response); + } + } else { + reject( true ? 'Failed to proxy resource ' + src.substring(0, 256) + ' with status code ' + xhr.status : ''); + } + } else { + resolve(xhr.responseText); + } + }; + + xhr.onerror = reject; + xhr.open('GET', proxy + '?url=' + encodeURIComponent(src) + '&responseType=' + responseType); + + if (responseType !== 'text' && xhr instanceof XMLHttpRequest) { + xhr.responseType = responseType; + } + + if (options.imageTimeout) { + var timeout = options.imageTimeout; + xhr.timeout = timeout; + xhr.ontimeout = function () { + return reject( true ? 'Timed out (' + timeout + 'ms) proxying ' + src.substring(0, 256) : ''); + }; + } + + xhr.send(); + }); +}; + +/***/ }), +/* 27 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + +var _CanvasRenderer = __webpack_require__(15); + +var _CanvasRenderer2 = _interopRequireDefault(_CanvasRenderer); + +var _Logger = __webpack_require__(16); + +var _Logger2 = _interopRequireDefault(_Logger); + +var _Window = __webpack_require__(28); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var html2canvas = function html2canvas(element, conf) { + var config = conf || {}; + var logger = new _Logger2.default(typeof config.logging === 'boolean' ? config.logging : true); + logger.log('html2canvas ' + "1.0.0-alpha.12"); + + if (true && typeof config.onrendered === 'function') { + logger.error('onrendered option is deprecated, html2canvas returns a Promise with the canvas as the value'); + } + + var ownerDocument = element.ownerDocument; + if (!ownerDocument) { + return Promise.reject('Provided element is not within a Document'); + } + var defaultView = ownerDocument.defaultView; + + var defaultOptions = { + async: true, + allowTaint: false, + backgroundColor: '#ffffff', + imageTimeout: 15000, + logging: true, + proxy: null, + removeContainer: true, + foreignObjectRendering: false, + scale: defaultView.devicePixelRatio || 1, + target: new _CanvasRenderer2.default(config.canvas), + useCORS: false, + windowWidth: defaultView.innerWidth, + windowHeight: defaultView.innerHeight, + scrollX: defaultView.pageXOffset, + scrollY: defaultView.pageYOffset + }; + + var result = (0, _Window.renderElement)(element, _extends({}, defaultOptions, config), logger); + + if (true) { + return result.catch(function (e) { + logger.error(e); + throw e; + }); + } + return result; +}; + +html2canvas.CanvasRenderer = _CanvasRenderer2.default; + +module.exports = html2canvas; + +/***/ }), +/* 28 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.renderElement = undefined; + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +var _Logger = __webpack_require__(16); + +var _Logger2 = _interopRequireDefault(_Logger); + +var _NodeParser = __webpack_require__(29); + +var _Renderer = __webpack_require__(51); + +var _Renderer2 = _interopRequireDefault(_Renderer); + +var _ForeignObjectRenderer = __webpack_require__(23); + +var _ForeignObjectRenderer2 = _interopRequireDefault(_ForeignObjectRenderer); + +var _Feature = __webpack_require__(10); + +var _Feature2 = _interopRequireDefault(_Feature); + +var _Bounds = __webpack_require__(2); + +var _Clone = __webpack_require__(54); + +var _Font = __webpack_require__(25); + +var _Color = __webpack_require__(0); + +var _Color2 = _interopRequireDefault(_Color); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var renderElement = exports.renderElement = function renderElement(element, options, logger) { + var ownerDocument = element.ownerDocument; + + var windowBounds = new _Bounds.Bounds(options.scrollX, options.scrollY, options.windowWidth, options.windowHeight); + + // http://www.w3.org/TR/css3-background/#special-backgrounds + var documentBackgroundColor = ownerDocument.documentElement ? new _Color2.default(getComputedStyle(ownerDocument.documentElement).backgroundColor) : _Color.TRANSPARENT; + var bodyBackgroundColor = ownerDocument.body ? new _Color2.default(getComputedStyle(ownerDocument.body).backgroundColor) : _Color.TRANSPARENT; + + var backgroundColor = element === ownerDocument.documentElement ? documentBackgroundColor.isTransparent() ? bodyBackgroundColor.isTransparent() ? options.backgroundColor ? new _Color2.default(options.backgroundColor) : null : bodyBackgroundColor : documentBackgroundColor : options.backgroundColor ? new _Color2.default(options.backgroundColor) : null; + + return (options.foreignObjectRendering ? // $FlowFixMe + _Feature2.default.SUPPORT_FOREIGNOBJECT_DRAWING : Promise.resolve(false)).then(function (supportForeignObject) { + return supportForeignObject ? function (cloner) { + if (true) { + logger.log('Document cloned, using foreignObject rendering'); + } + + return cloner.inlineFonts(ownerDocument).then(function () { + return cloner.resourceLoader.ready(); + }).then(function () { + var renderer = new _ForeignObjectRenderer2.default(cloner.documentElement); + + var defaultView = ownerDocument.defaultView; + var scrollX = defaultView.pageXOffset; + var scrollY = defaultView.pageYOffset; + + var isDocument = element.tagName === 'HTML' || element.tagName === 'BODY'; + + var _ref = isDocument ? (0, _Bounds.parseDocumentSize)(ownerDocument) : (0, _Bounds.parseBounds)(element, scrollX, scrollY), + width = _ref.width, + height = _ref.height, + left = _ref.left, + top = _ref.top; + + return renderer.render({ + backgroundColor: backgroundColor, + logger: logger, + scale: options.scale, + x: typeof options.x === 'number' ? options.x : left, + y: typeof options.y === 'number' ? options.y : top, + width: typeof options.width === 'number' ? options.width : Math.ceil(width), + height: typeof options.height === 'number' ? options.height : Math.ceil(height), + windowWidth: options.windowWidth, + windowHeight: options.windowHeight, + scrollX: options.scrollX, + scrollY: options.scrollY + }); + }); + }(new _Clone.DocumentCloner(element, options, logger, true, renderElement)) : (0, _Clone.cloneWindow)(ownerDocument, windowBounds, element, options, logger, renderElement).then(function (_ref2) { + var _ref3 = _slicedToArray(_ref2, 3), + container = _ref3[0], + clonedElement = _ref3[1], + resourceLoader = _ref3[2]; + + if (true) { + logger.log('Document cloned, using computed rendering'); + } + + var stack = (0, _NodeParser.NodeParser)(clonedElement, resourceLoader, logger); + var clonedDocument = clonedElement.ownerDocument; + + if (backgroundColor === stack.container.style.background.backgroundColor) { + stack.container.style.background.backgroundColor = _Color.TRANSPARENT; + } + + return resourceLoader.ready().then(function (imageStore) { + var fontMetrics = new _Font.FontMetrics(clonedDocument); + if (true) { + logger.log('Starting renderer'); + } + + var defaultView = clonedDocument.defaultView; + var scrollX = defaultView.pageXOffset; + var scrollY = defaultView.pageYOffset; + + var isDocument = clonedElement.tagName === 'HTML' || clonedElement.tagName === 'BODY'; + + var _ref4 = isDocument ? (0, _Bounds.parseDocumentSize)(ownerDocument) : (0, _Bounds.parseBounds)(clonedElement, scrollX, scrollY), + width = _ref4.width, + height = _ref4.height, + left = _ref4.left, + top = _ref4.top; + + var renderOptions = { + backgroundColor: backgroundColor, + fontMetrics: fontMetrics, + imageStore: imageStore, + logger: logger, + scale: options.scale, + x: typeof options.x === 'number' ? options.x : left, + y: typeof options.y === 'number' ? options.y : top, + width: typeof options.width === 'number' ? options.width : Math.ceil(width), + height: typeof options.height === 'number' ? options.height : Math.ceil(height) + }; + + if (Array.isArray(options.target)) { + return Promise.all(options.target.map(function (target) { + var renderer = new _Renderer2.default(target, renderOptions); + return renderer.render(stack); + })); + } else { + var renderer = new _Renderer2.default(options.target, renderOptions); + var canvas = renderer.render(stack); + if (options.removeContainer === true) { + if (container.parentNode) { + container.parentNode.removeChild(container); + } else if (true) { + logger.log('Cannot detach cloned iframe as it is not in the DOM anymore'); + } + } + + return canvas; + } + }); + }); + }); +}; + +/***/ }), +/* 29 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.NodeParser = undefined; + +var _StackingContext = __webpack_require__(30); + +var _StackingContext2 = _interopRequireDefault(_StackingContext); + +var _NodeContainer = __webpack_require__(6); + +var _NodeContainer2 = _interopRequireDefault(_NodeContainer); + +var _TextContainer = __webpack_require__(9); + +var _TextContainer2 = _interopRequireDefault(_TextContainer); + +var _Input = __webpack_require__(21); + +var _ListItem = __webpack_require__(14); + +var _listStyle = __webpack_require__(8); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var NodeParser = exports.NodeParser = function NodeParser(node, resourceLoader, logger) { + if (true) { + logger.log('Starting node parsing'); + } + + var index = 0; + + var container = new _NodeContainer2.default(node, null, resourceLoader, index++); + var stack = new _StackingContext2.default(container, null, true); + + parseNodeTree(node, container, stack, resourceLoader, index); + + if (true) { + logger.log('Finished parsing node tree'); + } + + return stack; +}; + +var IGNORED_NODE_NAMES = ['SCRIPT', 'HEAD', 'TITLE', 'OBJECT', 'BR', 'OPTION']; + +var parseNodeTree = function parseNodeTree(node, parent, stack, resourceLoader, index) { + if (true && index > 50000) { + throw new Error('Recursion error while parsing node tree'); + } + + for (var childNode = node.firstChild, nextNode; childNode; childNode = nextNode) { + nextNode = childNode.nextSibling; + var defaultView = childNode.ownerDocument.defaultView; + if (childNode instanceof defaultView.Text || childNode instanceof Text || defaultView.parent && childNode instanceof defaultView.parent.Text) { + if (childNode.data.trim().length > 0) { + parent.childNodes.push(_TextContainer2.default.fromTextNode(childNode, parent)); + } + } else if (childNode instanceof defaultView.HTMLElement || childNode instanceof HTMLElement || defaultView.parent && childNode instanceof defaultView.parent.HTMLElement) { + if (IGNORED_NODE_NAMES.indexOf(childNode.nodeName) === -1) { + var container = new _NodeContainer2.default(childNode, parent, resourceLoader, index++); + if (container.isVisible()) { + if (childNode.tagName === 'INPUT') { + // $FlowFixMe + (0, _Input.inlineInputElement)(childNode, container); + } else if (childNode.tagName === 'TEXTAREA') { + // $FlowFixMe + (0, _Input.inlineTextAreaElement)(childNode, container); + } else if (childNode.tagName === 'SELECT') { + // $FlowFixMe + (0, _Input.inlineSelectElement)(childNode, container); + } else if (container.style.listStyle && container.style.listStyle.listStyleType !== _listStyle.LIST_STYLE_TYPE.NONE) { + (0, _ListItem.inlineListItemElement)(childNode, container, resourceLoader); + } + + var SHOULD_TRAVERSE_CHILDREN = childNode.tagName !== 'TEXTAREA'; + var treatAsRealStackingContext = createsRealStackingContext(container, childNode); + if (treatAsRealStackingContext || createsStackingContext(container)) { + // for treatAsRealStackingContext:false, any positioned descendants and descendants + // which actually create a new stacking context should be considered part of the parent stacking context + var parentStack = treatAsRealStackingContext || container.isPositioned() ? stack.getRealParentStackingContext() : stack; + var childStack = new _StackingContext2.default(container, parentStack, treatAsRealStackingContext); + parentStack.contexts.push(childStack); + if (SHOULD_TRAVERSE_CHILDREN) { + parseNodeTree(childNode, container, childStack, resourceLoader, index); + } + } else { + stack.children.push(container); + if (SHOULD_TRAVERSE_CHILDREN) { + parseNodeTree(childNode, container, stack, resourceLoader, index); + } + } + } + } + } else if (childNode instanceof defaultView.SVGSVGElement || childNode instanceof SVGSVGElement || defaultView.parent && childNode instanceof defaultView.parent.SVGSVGElement) { + var _container = new _NodeContainer2.default(childNode, parent, resourceLoader, index++); + var _treatAsRealStackingContext = createsRealStackingContext(_container, childNode); + if (_treatAsRealStackingContext || createsStackingContext(_container)) { + // for treatAsRealStackingContext:false, any positioned descendants and descendants + // which actually create a new stacking context should be considered part of the parent stacking context + var _parentStack = _treatAsRealStackingContext || _container.isPositioned() ? stack.getRealParentStackingContext() : stack; + var _childStack = new _StackingContext2.default(_container, _parentStack, _treatAsRealStackingContext); + _parentStack.contexts.push(_childStack); + } else { + stack.children.push(_container); + } + } + } +}; + +var createsRealStackingContext = function createsRealStackingContext(container, node) { + return container.isRootElement() || container.isPositionedWithZIndex() || container.style.opacity < 1 || container.isTransformed() || isBodyWithTransparentRoot(container, node); +}; + +var createsStackingContext = function createsStackingContext(container) { + return container.isPositioned() || container.isFloating(); +}; + +var isBodyWithTransparentRoot = function isBodyWithTransparentRoot(container, node) { + return node.nodeName === 'BODY' && container.parent instanceof _NodeContainer2.default && container.parent.style.background.backgroundColor.isTransparent(); +}; + +/***/ }), +/* 30 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _NodeContainer = __webpack_require__(6); + +var _NodeContainer2 = _interopRequireDefault(_NodeContainer); + +var _position = __webpack_require__(19); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var StackingContext = function () { + function StackingContext(container, parent, treatAsRealStackingContext) { + _classCallCheck(this, StackingContext); + + this.container = container; + this.parent = parent; + this.contexts = []; + this.children = []; + this.treatAsRealStackingContext = treatAsRealStackingContext; + } + + _createClass(StackingContext, [{ + key: 'getOpacity', + value: function getOpacity() { + return this.parent ? this.container.style.opacity * this.parent.getOpacity() : this.container.style.opacity; + } + }, { + key: 'getRealParentStackingContext', + value: function getRealParentStackingContext() { + return !this.parent || this.treatAsRealStackingContext ? this : this.parent.getRealParentStackingContext(); + } + }]); + + return StackingContext; +}(); + +exports.default = StackingContext; + +/***/ }), +/* 31 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var Size = function Size(width, height) { + _classCallCheck(this, Size); + + this.width = width; + this.height = height; +}; + +exports.default = Size; + +/***/ }), +/* 32 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _Path = __webpack_require__(5); + +var _Vector = __webpack_require__(7); + +var _Vector2 = _interopRequireDefault(_Vector); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var lerp = function lerp(a, b, t) { + return new _Vector2.default(a.x + (b.x - a.x) * t, a.y + (b.y - a.y) * t); +}; + +var BezierCurve = function () { + function BezierCurve(start, startControl, endControl, end) { + _classCallCheck(this, BezierCurve); + + this.type = _Path.PATH.BEZIER_CURVE; + this.start = start; + this.startControl = startControl; + this.endControl = endControl; + this.end = end; + } + + _createClass(BezierCurve, [{ + key: 'subdivide', + value: function subdivide(t, firstHalf) { + var ab = lerp(this.start, this.startControl, t); + var bc = lerp(this.startControl, this.endControl, t); + var cd = lerp(this.endControl, this.end, t); + var abbc = lerp(ab, bc, t); + var bccd = lerp(bc, cd, t); + var dest = lerp(abbc, bccd, t); + return firstHalf ? new BezierCurve(this.start, ab, abbc, dest) : new BezierCurve(dest, bccd, cd, this.end); + } + }, { + key: 'reverse', + value: function reverse() { + return new BezierCurve(this.end, this.endControl, this.startControl, this.start); + } + }]); + + return BezierCurve; +}(); + +exports.default = BezierCurve; + +/***/ }), +/* 33 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.parseBorderRadius = undefined; + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +var _Length = __webpack_require__(1); + +var _Length2 = _interopRequireDefault(_Length); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var SIDES = ['top-left', 'top-right', 'bottom-right', 'bottom-left']; + +var parseBorderRadius = exports.parseBorderRadius = function parseBorderRadius(style) { + return SIDES.map(function (side) { + var value = style.getPropertyValue('border-' + side + '-radius'); + + var _value$split$map = value.split(' ').map(_Length2.default.create), + _value$split$map2 = _slicedToArray(_value$split$map, 2), + horizontal = _value$split$map2[0], + vertical = _value$split$map2[1]; + + return typeof vertical === 'undefined' ? [horizontal, horizontal] : [horizontal, vertical]; + }); +}; + +/***/ }), +/* 34 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var DISPLAY = exports.DISPLAY = { + NONE: 1 << 0, + BLOCK: 1 << 1, + INLINE: 1 << 2, + RUN_IN: 1 << 3, + FLOW: 1 << 4, + FLOW_ROOT: 1 << 5, + TABLE: 1 << 6, + FLEX: 1 << 7, + GRID: 1 << 8, + RUBY: 1 << 9, + SUBGRID: 1 << 10, + LIST_ITEM: 1 << 11, + TABLE_ROW_GROUP: 1 << 12, + TABLE_HEADER_GROUP: 1 << 13, + TABLE_FOOTER_GROUP: 1 << 14, + TABLE_ROW: 1 << 15, + TABLE_CELL: 1 << 16, + TABLE_COLUMN_GROUP: 1 << 17, + TABLE_COLUMN: 1 << 18, + TABLE_CAPTION: 1 << 19, + RUBY_BASE: 1 << 20, + RUBY_TEXT: 1 << 21, + RUBY_BASE_CONTAINER: 1 << 22, + RUBY_TEXT_CONTAINER: 1 << 23, + CONTENTS: 1 << 24, + INLINE_BLOCK: 1 << 25, + INLINE_LIST_ITEM: 1 << 26, + INLINE_TABLE: 1 << 27, + INLINE_FLEX: 1 << 28, + INLINE_GRID: 1 << 29 +}; + +var parseDisplayValue = function parseDisplayValue(display) { + switch (display) { + case 'block': + return DISPLAY.BLOCK; + case 'inline': + return DISPLAY.INLINE; + case 'run-in': + return DISPLAY.RUN_IN; + case 'flow': + return DISPLAY.FLOW; + case 'flow-root': + return DISPLAY.FLOW_ROOT; + case 'table': + return DISPLAY.TABLE; + case 'flex': + return DISPLAY.FLEX; + case 'grid': + return DISPLAY.GRID; + case 'ruby': + return DISPLAY.RUBY; + case 'subgrid': + return DISPLAY.SUBGRID; + case 'list-item': + return DISPLAY.LIST_ITEM; + case 'table-row-group': + return DISPLAY.TABLE_ROW_GROUP; + case 'table-header-group': + return DISPLAY.TABLE_HEADER_GROUP; + case 'table-footer-group': + return DISPLAY.TABLE_FOOTER_GROUP; + case 'table-row': + return DISPLAY.TABLE_ROW; + case 'table-cell': + return DISPLAY.TABLE_CELL; + case 'table-column-group': + return DISPLAY.TABLE_COLUMN_GROUP; + case 'table-column': + return DISPLAY.TABLE_COLUMN; + case 'table-caption': + return DISPLAY.TABLE_CAPTION; + case 'ruby-base': + return DISPLAY.RUBY_BASE; + case 'ruby-text': + return DISPLAY.RUBY_TEXT; + case 'ruby-base-container': + return DISPLAY.RUBY_BASE_CONTAINER; + case 'ruby-text-container': + return DISPLAY.RUBY_TEXT_CONTAINER; + case 'contents': + return DISPLAY.CONTENTS; + case 'inline-block': + return DISPLAY.INLINE_BLOCK; + case 'inline-list-item': + return DISPLAY.INLINE_LIST_ITEM; + case 'inline-table': + return DISPLAY.INLINE_TABLE; + case 'inline-flex': + return DISPLAY.INLINE_FLEX; + case 'inline-grid': + return DISPLAY.INLINE_GRID; + } + + return DISPLAY.NONE; +}; + +var setDisplayBit = function setDisplayBit(bit, display) { + return bit | parseDisplayValue(display); +}; + +var parseDisplay = exports.parseDisplay = function parseDisplay(display) { + return display.split(' ').reduce(setDisplayBit, 0); +}; + +/***/ }), +/* 35 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var FLOAT = exports.FLOAT = { + NONE: 0, + LEFT: 1, + RIGHT: 2, + INLINE_START: 3, + INLINE_END: 4 +}; + +var parseCSSFloat = exports.parseCSSFloat = function parseCSSFloat(float) { + switch (float) { + case 'left': + return FLOAT.LEFT; + case 'right': + return FLOAT.RIGHT; + case 'inline-start': + return FLOAT.INLINE_START; + case 'inline-end': + return FLOAT.INLINE_END; + } + return FLOAT.NONE; +}; + +/***/ }), +/* 36 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + + +var parseFontWeight = function parseFontWeight(weight) { + switch (weight) { + case 'normal': + return 400; + case 'bold': + return 700; + } + + var value = parseInt(weight, 10); + return isNaN(value) ? 400 : value; +}; + +var parseFont = exports.parseFont = function parseFont(style) { + var fontFamily = style.fontFamily; + var fontSize = style.fontSize; + var fontStyle = style.fontStyle; + var fontVariant = style.fontVariant; + var fontWeight = parseFontWeight(style.fontWeight); + + return { + fontFamily: fontFamily, + fontSize: fontSize, + fontStyle: fontStyle, + fontVariant: fontVariant, + fontWeight: fontWeight + }; +}; + +/***/ }), +/* 37 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var parseLetterSpacing = exports.parseLetterSpacing = function parseLetterSpacing(letterSpacing) { + if (letterSpacing === 'normal') { + return 0; + } + var value = parseFloat(letterSpacing); + return isNaN(value) ? 0 : value; +}; + +/***/ }), +/* 38 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var LINE_BREAK = exports.LINE_BREAK = { + NORMAL: 'normal', + STRICT: 'strict' +}; + +var parseLineBreak = exports.parseLineBreak = function parseLineBreak(wordBreak) { + switch (wordBreak) { + case 'strict': + return LINE_BREAK.STRICT; + case 'normal': + default: + return LINE_BREAK.NORMAL; + } +}; + +/***/ }), +/* 39 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.parseMargin = undefined; + +var _Length = __webpack_require__(1); + +var _Length2 = _interopRequireDefault(_Length); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var SIDES = ['top', 'right', 'bottom', 'left']; + +var parseMargin = exports.parseMargin = function parseMargin(style) { + return SIDES.map(function (side) { + return new _Length2.default(style.getPropertyValue('margin-' + side)); + }); +}; + +/***/ }), +/* 40 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var OVERFLOW = exports.OVERFLOW = { + VISIBLE: 0, + HIDDEN: 1, + SCROLL: 2, + AUTO: 3 +}; + +var parseOverflow = exports.parseOverflow = function parseOverflow(overflow) { + switch (overflow) { + case 'hidden': + return OVERFLOW.HIDDEN; + case 'scroll': + return OVERFLOW.SCROLL; + case 'auto': + return OVERFLOW.AUTO; + case 'visible': + default: + return OVERFLOW.VISIBLE; + } +}; + +/***/ }), +/* 41 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.parseTextShadow = undefined; + +var _Color = __webpack_require__(0); + +var _Color2 = _interopRequireDefault(_Color); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var NUMBER = /^([+-]|\d|\.)$/i; + +var parseTextShadow = exports.parseTextShadow = function parseTextShadow(textShadow) { + if (textShadow === 'none' || typeof textShadow !== 'string') { + return null; + } + + var currentValue = ''; + var isLength = false; + var values = []; + var shadows = []; + var numParens = 0; + var color = null; + + var appendValue = function appendValue() { + if (currentValue.length) { + if (isLength) { + values.push(parseFloat(currentValue)); + } else { + color = new _Color2.default(currentValue); + } + } + isLength = false; + currentValue = ''; + }; + + var appendShadow = function appendShadow() { + if (values.length && color !== null) { + shadows.push({ + color: color, + offsetX: values[0] || 0, + offsetY: values[1] || 0, + blur: values[2] || 0 + }); + } + values.splice(0, values.length); + color = null; + }; + + for (var i = 0; i < textShadow.length; i++) { + var c = textShadow[i]; + switch (c) { + case '(': + currentValue += c; + numParens++; + break; + case ')': + currentValue += c; + numParens--; + break; + case ',': + if (numParens === 0) { + appendValue(); + appendShadow(); + } else { + currentValue += c; + } + break; + case ' ': + if (numParens === 0) { + appendValue(); + } else { + currentValue += c; + } + break; + default: + if (currentValue.length === 0 && NUMBER.test(c)) { + isLength = true; + } + currentValue += c; + } + } + + appendValue(); + appendShadow(); + + if (shadows.length === 0) { + return null; + } + + return shadows; +}; + +/***/ }), +/* 42 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.parseTransform = undefined; + +var _Length = __webpack_require__(1); + +var _Length2 = _interopRequireDefault(_Length); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var toFloat = function toFloat(s) { + return parseFloat(s.trim()); +}; + +var MATRIX = /(matrix|matrix3d)\((.+)\)/; + +var parseTransform = exports.parseTransform = function parseTransform(style) { + var transform = parseTransformMatrix(style.transform || style.webkitTransform || style.mozTransform || + // $FlowFixMe + style.msTransform || + // $FlowFixMe + style.oTransform); + if (transform === null) { + return null; + } + + return { + transform: transform, + transformOrigin: parseTransformOrigin(style.transformOrigin || style.webkitTransformOrigin || style.mozTransformOrigin || + // $FlowFixMe + style.msTransformOrigin || + // $FlowFixMe + style.oTransformOrigin) + }; +}; + +// $FlowFixMe +var parseTransformOrigin = function parseTransformOrigin(origin) { + if (typeof origin !== 'string') { + var v = new _Length2.default('0'); + return [v, v]; + } + var values = origin.split(' ').map(_Length2.default.create); + return [values[0], values[1]]; +}; + +// $FlowFixMe +var parseTransformMatrix = function parseTransformMatrix(transform) { + if (transform === 'none' || typeof transform !== 'string') { + return null; + } + + var match = transform.match(MATRIX); + if (match) { + if (match[1] === 'matrix') { + var matrix = match[2].split(',').map(toFloat); + return [matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5]]; + } else { + var matrix3d = match[2].split(',').map(toFloat); + return [matrix3d[0], matrix3d[1], matrix3d[4], matrix3d[5], matrix3d[12], matrix3d[13]]; + } + } + return null; +}; + +/***/ }), +/* 43 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var VISIBILITY = exports.VISIBILITY = { + VISIBLE: 0, + HIDDEN: 1, + COLLAPSE: 2 +}; + +var parseVisibility = exports.parseVisibility = function parseVisibility(visibility) { + switch (visibility) { + case 'hidden': + return VISIBILITY.HIDDEN; + case 'collapse': + return VISIBILITY.COLLAPSE; + case 'visible': + default: + return VISIBILITY.VISIBLE; + } +}; + +/***/ }), +/* 44 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var WORD_BREAK = exports.WORD_BREAK = { + NORMAL: 'normal', + BREAK_ALL: 'break-all', + KEEP_ALL: 'keep-all' +}; + +var parseWordBreak = exports.parseWordBreak = function parseWordBreak(wordBreak) { + switch (wordBreak) { + case 'break-all': + return WORD_BREAK.BREAK_ALL; + case 'keep-all': + return WORD_BREAK.KEEP_ALL; + case 'normal': + default: + return WORD_BREAK.NORMAL; + } +}; + +/***/ }), +/* 45 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var parseZIndex = exports.parseZIndex = function parseZIndex(zIndex) { + var auto = zIndex === 'auto'; + return { + auto: auto, + order: auto ? 0 : parseInt(zIndex, 10) + }; +}; + +/***/ }), +/* 46 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _Util = __webpack_require__(13); + +Object.defineProperty(exports, 'toCodePoints', { + enumerable: true, + get: function get() { + return _Util.toCodePoints; + } +}); +Object.defineProperty(exports, 'fromCodePoint', { + enumerable: true, + get: function get() { + return _Util.fromCodePoint; + } +}); + +var _LineBreak = __webpack_require__(47); + +Object.defineProperty(exports, 'LineBreaker', { + enumerable: true, + get: function get() { + return _LineBreak.LineBreaker; + } +}); + +/***/ }), +/* 47 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.LineBreaker = exports.inlineBreakOpportunities = exports.lineBreakAtIndex = exports.codePointsToCharacterClasses = exports.UnicodeTrie = exports.BREAK_ALLOWED = exports.BREAK_NOT_ALLOWED = exports.BREAK_MANDATORY = exports.classes = exports.LETTER_NUMBER_MODIFIER = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +var _Trie = __webpack_require__(48); + +var _linebreakTrie = __webpack_require__(49); + +var _linebreakTrie2 = _interopRequireDefault(_linebreakTrie); + +var _Util = __webpack_require__(13); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var LETTER_NUMBER_MODIFIER = exports.LETTER_NUMBER_MODIFIER = 50; + +// Non-tailorable Line Breaking Classes +var BK = 1; // Cause a line break (after) +var CR = 2; // Cause a line break (after), except between CR and LF +var LF = 3; // Cause a line break (after) +var CM = 4; // Prohibit a line break between the character and the preceding character +var NL = 5; // Cause a line break (after) +var SG = 6; // Do not occur in well-formed text +var WJ = 7; // Prohibit line breaks before and after +var ZW = 8; // Provide a break opportunity +var GL = 9; // Prohibit line breaks before and after +var SP = 10; // Enable indirect line breaks +var ZWJ = 11; // Prohibit line breaks within joiner sequences +// Break Opportunities +var B2 = 12; // Provide a line break opportunity before and after the character +var BA = 13; // Generally provide a line break opportunity after the character +var BB = 14; // Generally provide a line break opportunity before the character +var HY = 15; // Provide a line break opportunity after the character, except in numeric context +var CB = 16; // Provide a line break opportunity contingent on additional information +// Characters Prohibiting Certain Breaks +var CL = 17; // Prohibit line breaks before +var CP = 18; // Prohibit line breaks before +var EX = 19; // Prohibit line breaks before +var IN = 20; // Allow only indirect line breaks between pairs +var NS = 21; // Allow only indirect line breaks before +var OP = 22; // Prohibit line breaks after +var QU = 23; // Act like they are both opening and closing +// Numeric Context +var IS = 24; // Prevent breaks after any and before numeric +var NU = 25; // Form numeric expressions for line breaking purposes +var PO = 26; // Do not break following a numeric expression +var PR = 27; // Do not break in front of a numeric expression +var SY = 28; // Prevent a break before; and allow a break after +// Other Characters +var AI = 29; // Act like AL when the resolvedEAW is N; otherwise; act as ID +var AL = 30; // Are alphabetic characters or symbols that are used with alphabetic characters +var CJ = 31; // Treat as NS or ID for strict or normal breaking. +var EB = 32; // Do not break from following Emoji Modifier +var EM = 33; // Do not break from preceding Emoji Base +var H2 = 34; // Form Korean syllable blocks +var H3 = 35; // Form Korean syllable blocks +var HL = 36; // Do not break around a following hyphen; otherwise act as Alphabetic +var ID = 37; // Break before or after; except in some numeric context +var JL = 38; // Form Korean syllable blocks +var JV = 39; // Form Korean syllable blocks +var JT = 40; // Form Korean syllable blocks +var RI = 41; // Keep pairs together. For pairs; break before and after other classes +var SA = 42; // Provide a line break opportunity contingent on additional, language-specific context analysis +var XX = 43; // Have as yet unknown line breaking behavior or unassigned code positions + +var classes = exports.classes = { + BK: BK, + CR: CR, + LF: LF, + CM: CM, + NL: NL, + SG: SG, + WJ: WJ, + ZW: ZW, + GL: GL, + SP: SP, + ZWJ: ZWJ, + B2: B2, + BA: BA, + BB: BB, + HY: HY, + CB: CB, + CL: CL, + CP: CP, + EX: EX, + IN: IN, + NS: NS, + OP: OP, + QU: QU, + IS: IS, + NU: NU, + PO: PO, + PR: PR, + SY: SY, + AI: AI, + AL: AL, + CJ: CJ, + EB: EB, + EM: EM, + H2: H2, + H3: H3, + HL: HL, + ID: ID, + JL: JL, + JV: JV, + JT: JT, + RI: RI, + SA: SA, + XX: XX +}; + +var BREAK_MANDATORY = exports.BREAK_MANDATORY = '!'; +var BREAK_NOT_ALLOWED = exports.BREAK_NOT_ALLOWED = '×'; +var BREAK_ALLOWED = exports.BREAK_ALLOWED = '÷'; +var UnicodeTrie = exports.UnicodeTrie = (0, _Trie.createTrieFromBase64)(_linebreakTrie2.default); + +var ALPHABETICS = [AL, HL]; +var HARD_LINE_BREAKS = [BK, CR, LF, NL]; +var SPACE = [SP, ZW]; +var PREFIX_POSTFIX = [PR, PO]; +var LINE_BREAKS = HARD_LINE_BREAKS.concat(SPACE); +var KOREAN_SYLLABLE_BLOCK = [JL, JV, JT, H2, H3]; +var HYPHEN = [HY, BA]; + +var codePointsToCharacterClasses = exports.codePointsToCharacterClasses = function codePointsToCharacterClasses(codePoints) { + var lineBreak = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'strict'; + + var types = []; + var indicies = []; + var categories = []; + codePoints.forEach(function (codePoint, index) { + var classType = UnicodeTrie.get(codePoint); + if (classType > LETTER_NUMBER_MODIFIER) { + categories.push(true); + classType -= LETTER_NUMBER_MODIFIER; + } else { + categories.push(false); + } + + if (['normal', 'auto', 'loose'].indexOf(lineBreak) !== -1) { + // U+2010, – U+2013, 〜 U+301C, ゠ U+30A0 + if ([0x2010, 0x2013, 0x301c, 0x30a0].indexOf(codePoint) !== -1) { + indicies.push(index); + return types.push(CB); + } + } + + if (classType === CM || classType === ZWJ) { + // LB10 Treat any remaining combining mark or ZWJ as AL. + if (index === 0) { + indicies.push(index); + return types.push(AL); + } + + // LB9 Do not break a combining character sequence; treat it as if it has the line breaking class of + // the base character in all of the following rules. Treat ZWJ as if it were CM. + var prev = types[index - 1]; + if (LINE_BREAKS.indexOf(prev) === -1) { + indicies.push(indicies[index - 1]); + return types.push(prev); + } + indicies.push(index); + return types.push(AL); + } + + indicies.push(index); + + if (classType === CJ) { + return types.push(lineBreak === 'strict' ? NS : ID); + } + + if (classType === SA) { + return types.push(AL); + } + + if (classType === AI) { + return types.push(AL); + } + + // For supplementary characters, a useful default is to treat characters in the range 10000..1FFFD as AL + // and characters in the ranges 20000..2FFFD and 30000..3FFFD as ID, until the implementation can be revised + // to take into account the actual line breaking properties for these characters. + if (classType === XX) { + if (codePoint >= 0x20000 && codePoint <= 0x2fffd || codePoint >= 0x30000 && codePoint <= 0x3fffd) { + return types.push(ID); + } else { + return types.push(AL); + } + } + + types.push(classType); + }); + + return [indicies, types, categories]; +}; + +var isAdjacentWithSpaceIgnored = function isAdjacentWithSpaceIgnored(a, b, currentIndex, classTypes) { + var current = classTypes[currentIndex]; + if (Array.isArray(a) ? a.indexOf(current) !== -1 : a === current) { + var i = currentIndex; + while (i <= classTypes.length) { + i++; + var next = classTypes[i]; + + if (next === b) { + return true; + } + + if (next !== SP) { + break; + } + } + } + + if (current === SP) { + var _i = currentIndex; + + while (_i > 0) { + _i--; + var prev = classTypes[_i]; + + if (Array.isArray(a) ? a.indexOf(prev) !== -1 : a === prev) { + var n = currentIndex; + while (n <= classTypes.length) { + n++; + var _next = classTypes[n]; + + if (_next === b) { + return true; + } + + if (_next !== SP) { + break; + } + } + } + + if (prev !== SP) { + break; + } + } + } + return false; +}; + +var previousNonSpaceClassType = function previousNonSpaceClassType(currentIndex, classTypes) { + var i = currentIndex; + while (i >= 0) { + var type = classTypes[i]; + if (type === SP) { + i--; + } else { + return type; + } + } + return 0; +}; + +var _lineBreakAtIndex = function _lineBreakAtIndex(codePoints, classTypes, indicies, index, forbiddenBreaks) { + if (indicies[index] === 0) { + return BREAK_NOT_ALLOWED; + } + + var currentIndex = index - 1; + if (Array.isArray(forbiddenBreaks) && forbiddenBreaks[currentIndex] === true) { + return BREAK_NOT_ALLOWED; + } + + var beforeIndex = currentIndex - 1; + var afterIndex = currentIndex + 1; + var current = classTypes[currentIndex]; + + // LB4 Always break after hard line breaks. + // LB5 Treat CR followed by LF, as well as CR, LF, and NL as hard line breaks. + var before = beforeIndex >= 0 ? classTypes[beforeIndex] : 0; + var next = classTypes[afterIndex]; + + if (current === CR && next === LF) { + return BREAK_NOT_ALLOWED; + } + + if (HARD_LINE_BREAKS.indexOf(current) !== -1) { + return BREAK_MANDATORY; + } + + // LB6 Do not break before hard line breaks. + if (HARD_LINE_BREAKS.indexOf(next) !== -1) { + return BREAK_NOT_ALLOWED; + } + + // LB7 Do not break before spaces or zero width space. + if (SPACE.indexOf(next) !== -1) { + return BREAK_NOT_ALLOWED; + } + + // LB8 Break before any character following a zero-width space, even if one or more spaces intervene. + if (previousNonSpaceClassType(currentIndex, classTypes) === ZW) { + return BREAK_ALLOWED; + } + + // LB8a Do not break between a zero width joiner and an ideograph, emoji base or emoji modifier. + if (UnicodeTrie.get(codePoints[currentIndex]) === ZWJ && (next === ID || next === EB || next === EM)) { + return BREAK_NOT_ALLOWED; + } + + // LB11 Do not break before or after Word joiner and related characters. + if (current === WJ || next === WJ) { + return BREAK_NOT_ALLOWED; + } + + // LB12 Do not break after NBSP and related characters. + if (current === GL) { + return BREAK_NOT_ALLOWED; + } + + // LB12a Do not break before NBSP and related characters, except after spaces and hyphens. + if ([SP, BA, HY].indexOf(current) === -1 && next === GL) { + return BREAK_NOT_ALLOWED; + } + + // LB13 Do not break before ‘]’ or ‘!’ or ‘;’ or ‘/’, even after spaces. + if ([CL, CP, EX, IS, SY].indexOf(next) !== -1) { + return BREAK_NOT_ALLOWED; + } + + // LB14 Do not break after ‘[’, even after spaces. + if (previousNonSpaceClassType(currentIndex, classTypes) === OP) { + return BREAK_NOT_ALLOWED; + } + + // LB15 Do not break within ‘”[’, even with intervening spaces. + if (isAdjacentWithSpaceIgnored(QU, OP, currentIndex, classTypes)) { + return BREAK_NOT_ALLOWED; + } + + // LB16 Do not break between closing punctuation and a nonstarter (lb=NS), even with intervening spaces. + if (isAdjacentWithSpaceIgnored([CL, CP], NS, currentIndex, classTypes)) { + return BREAK_NOT_ALLOWED; + } + + // LB17 Do not break within ‘——’, even with intervening spaces. + if (isAdjacentWithSpaceIgnored(B2, B2, currentIndex, classTypes)) { + return BREAK_NOT_ALLOWED; + } + + // LB18 Break after spaces. + if (current === SP) { + return BREAK_ALLOWED; + } + + // LB19 Do not break before or after quotation marks, such as ‘ ” ’. + if (current === QU || next === QU) { + return BREAK_NOT_ALLOWED; + } + + // LB20 Break before and after unresolved CB. + if (next === CB || current === CB) { + return BREAK_ALLOWED; + } + + // LB21 Do not break before hyphen-minus, other hyphens, fixed-width spaces, small kana, and other non-starters, or after acute accents. + if ([BA, HY, NS].indexOf(next) !== -1 || current === BB) { + return BREAK_NOT_ALLOWED; + } + + // LB21a Don't break after Hebrew + Hyphen. + if (before === HL && HYPHEN.indexOf(current) !== -1) { + return BREAK_NOT_ALLOWED; + } + + // LB21b Don’t break between Solidus and Hebrew letters. + if (current === SY && next === HL) { + return BREAK_NOT_ALLOWED; + } + + // LB22 Do not break between two ellipses, or between letters, numbers or exclamations and ellipsis. + if (next === IN && ALPHABETICS.concat(IN, EX, NU, ID, EB, EM).indexOf(current) !== -1) { + return BREAK_NOT_ALLOWED; + } + + // LB23 Do not break between digits and letters. + if (ALPHABETICS.indexOf(next) !== -1 && current === NU || ALPHABETICS.indexOf(current) !== -1 && next === NU) { + return BREAK_NOT_ALLOWED; + } + + // LB23a Do not break between numeric prefixes and ideographs, or between ideographs and numeric postfixes. + if (current === PR && [ID, EB, EM].indexOf(next) !== -1 || [ID, EB, EM].indexOf(current) !== -1 && next === PO) { + return BREAK_NOT_ALLOWED; + } + + // LB24 Do not break between numeric prefix/postfix and letters, or between letters and prefix/postfix. + if (ALPHABETICS.indexOf(current) !== -1 && PREFIX_POSTFIX.indexOf(next) !== -1 || PREFIX_POSTFIX.indexOf(current) !== -1 && ALPHABETICS.indexOf(next) !== -1) { + return BREAK_NOT_ALLOWED; + } + + // LB25 Do not break between the following pairs of classes relevant to numbers: + if ( + // (PR | PO) × ( OP | HY )? NU + [PR, PO].indexOf(current) !== -1 && (next === NU || [OP, HY].indexOf(next) !== -1 && classTypes[afterIndex + 1] === NU) || + // ( OP | HY ) × NU + [OP, HY].indexOf(current) !== -1 && next === NU || + // NU × (NU | SY | IS) + current === NU && [NU, SY, IS].indexOf(next) !== -1) { + return BREAK_NOT_ALLOWED; + } + + // NU (NU | SY | IS)* × (NU | SY | IS | CL | CP) + if ([NU, SY, IS, CL, CP].indexOf(next) !== -1) { + var prevIndex = currentIndex; + while (prevIndex >= 0) { + var type = classTypes[prevIndex]; + if (type === NU) { + return BREAK_NOT_ALLOWED; + } else if ([SY, IS].indexOf(type) !== -1) { + prevIndex--; + } else { + break; + } + } + } + + // NU (NU | SY | IS)* (CL | CP)? × (PO | PR)) + if ([PR, PO].indexOf(next) !== -1) { + var _prevIndex = [CL, CP].indexOf(current) !== -1 ? beforeIndex : currentIndex; + while (_prevIndex >= 0) { + var _type = classTypes[_prevIndex]; + if (_type === NU) { + return BREAK_NOT_ALLOWED; + } else if ([SY, IS].indexOf(_type) !== -1) { + _prevIndex--; + } else { + break; + } + } + } + + // LB26 Do not break a Korean syllable. + if (JL === current && [JL, JV, H2, H3].indexOf(next) !== -1 || [JV, H2].indexOf(current) !== -1 && [JV, JT].indexOf(next) !== -1 || [JT, H3].indexOf(current) !== -1 && next === JT) { + return BREAK_NOT_ALLOWED; + } + + // LB27 Treat a Korean Syllable Block the same as ID. + if (KOREAN_SYLLABLE_BLOCK.indexOf(current) !== -1 && [IN, PO].indexOf(next) !== -1 || KOREAN_SYLLABLE_BLOCK.indexOf(next) !== -1 && current === PR) { + return BREAK_NOT_ALLOWED; + } + + // LB28 Do not break between alphabetics (“at”). + if (ALPHABETICS.indexOf(current) !== -1 && ALPHABETICS.indexOf(next) !== -1) { + return BREAK_NOT_ALLOWED; + } + + // LB29 Do not break between numeric punctuation and alphabetics (“e.g.”). + if (current === IS && ALPHABETICS.indexOf(next) !== -1) { + return BREAK_NOT_ALLOWED; + } + + // LB30 Do not break between letters, numbers, or ordinary symbols and opening or closing parentheses. + if (ALPHABETICS.concat(NU).indexOf(current) !== -1 && next === OP || ALPHABETICS.concat(NU).indexOf(next) !== -1 && current === CP) { + return BREAK_NOT_ALLOWED; + } + + // LB30a Break between two regional indicator symbols if and only if there are an even number of regional + // indicators preceding the position of the break. + if (current === RI && next === RI) { + var i = indicies[currentIndex]; + var count = 1; + while (i > 0) { + i--; + if (classTypes[i] === RI) { + count++; + } else { + break; + } + } + if (count % 2 !== 0) { + return BREAK_NOT_ALLOWED; + } + } + + // LB30b Do not break between an emoji base and an emoji modifier. + if (current === EB && next === EM) { + return BREAK_NOT_ALLOWED; + } + + return BREAK_ALLOWED; +}; + +var lineBreakAtIndex = exports.lineBreakAtIndex = function lineBreakAtIndex(codePoints, index) { + // LB2 Never break at the start of text. + if (index === 0) { + return BREAK_NOT_ALLOWED; + } + + // LB3 Always break at the end of text. + if (index >= codePoints.length) { + return BREAK_MANDATORY; + } + + var _codePointsToCharacte = codePointsToCharacterClasses(codePoints), + _codePointsToCharacte2 = _slicedToArray(_codePointsToCharacte, 2), + indicies = _codePointsToCharacte2[0], + classTypes = _codePointsToCharacte2[1]; + + return _lineBreakAtIndex(codePoints, classTypes, indicies, index); +}; + +var cssFormattedClasses = function cssFormattedClasses(codePoints, options) { + if (!options) { + options = { lineBreak: 'normal', wordBreak: 'normal' }; + } + + var _codePointsToCharacte3 = codePointsToCharacterClasses(codePoints, options.lineBreak), + _codePointsToCharacte4 = _slicedToArray(_codePointsToCharacte3, 3), + indicies = _codePointsToCharacte4[0], + classTypes = _codePointsToCharacte4[1], + isLetterNumber = _codePointsToCharacte4[2]; + + if (options.wordBreak === 'break-all' || options.wordBreak === 'break-word') { + classTypes = classTypes.map(function (type) { + return [NU, AL, SA].indexOf(type) !== -1 ? ID : type; + }); + } + + var forbiddenBreakpoints = options.wordBreak === 'keep-all' ? isLetterNumber.map(function (isLetterNumber, i) { + return isLetterNumber && codePoints[i] >= 0x4e00 && codePoints[i] <= 0x9fff; + }) : null; + + return [indicies, classTypes, forbiddenBreakpoints]; +}; + +var inlineBreakOpportunities = exports.inlineBreakOpportunities = function inlineBreakOpportunities(str, options) { + var codePoints = (0, _Util.toCodePoints)(str); + var output = BREAK_NOT_ALLOWED; + + var _cssFormattedClasses = cssFormattedClasses(codePoints, options), + _cssFormattedClasses2 = _slicedToArray(_cssFormattedClasses, 3), + indicies = _cssFormattedClasses2[0], + classTypes = _cssFormattedClasses2[1], + forbiddenBreakpoints = _cssFormattedClasses2[2]; + + codePoints.forEach(function (codePoint, i) { + output += (0, _Util.fromCodePoint)(codePoint) + (i >= codePoints.length - 1 ? BREAK_MANDATORY : _lineBreakAtIndex(codePoints, classTypes, indicies, i + 1, forbiddenBreakpoints)); + }); + + return output; +}; + +var Break = function () { + function Break(codePoints, lineBreak, start, end) { + _classCallCheck(this, Break); + + this._codePoints = codePoints; + this.required = lineBreak === BREAK_MANDATORY; + this.start = start; + this.end = end; + } + + _createClass(Break, [{ + key: 'slice', + value: function slice() { + return _Util.fromCodePoint.apply(undefined, _toConsumableArray(this._codePoints.slice(this.start, this.end))); + } + }]); + + return Break; +}(); + +var LineBreaker = exports.LineBreaker = function LineBreaker(str, options) { + var codePoints = (0, _Util.toCodePoints)(str); + + var _cssFormattedClasses3 = cssFormattedClasses(codePoints, options), + _cssFormattedClasses4 = _slicedToArray(_cssFormattedClasses3, 3), + indicies = _cssFormattedClasses4[0], + classTypes = _cssFormattedClasses4[1], + forbiddenBreakpoints = _cssFormattedClasses4[2]; + + var length = codePoints.length; + var lastEnd = 0; + var nextIndex = 0; + + return { + next: function next() { + if (nextIndex >= length) { + return { done: true }; + } + var lineBreak = BREAK_NOT_ALLOWED; + while (nextIndex < length && (lineBreak = _lineBreakAtIndex(codePoints, classTypes, indicies, ++nextIndex, forbiddenBreakpoints)) === BREAK_NOT_ALLOWED) {} + + if (lineBreak !== BREAK_NOT_ALLOWED || nextIndex === length) { + var value = new Break(codePoints, lineBreak, lastEnd, nextIndex); + lastEnd = nextIndex; + return { value: value, done: false }; + } + + return { done: true }; + } + }; +}; + +/***/ }), +/* 48 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.Trie = exports.createTrieFromBase64 = exports.UTRIE2_INDEX_2_MASK = exports.UTRIE2_INDEX_2_BLOCK_LENGTH = exports.UTRIE2_OMITTED_BMP_INDEX_1_LENGTH = exports.UTRIE2_INDEX_1_OFFSET = exports.UTRIE2_UTF8_2B_INDEX_2_LENGTH = exports.UTRIE2_UTF8_2B_INDEX_2_OFFSET = exports.UTRIE2_INDEX_2_BMP_LENGTH = exports.UTRIE2_LSCP_INDEX_2_LENGTH = exports.UTRIE2_DATA_MASK = exports.UTRIE2_DATA_BLOCK_LENGTH = exports.UTRIE2_LSCP_INDEX_2_OFFSET = exports.UTRIE2_SHIFT_1_2 = exports.UTRIE2_INDEX_SHIFT = exports.UTRIE2_SHIFT_1 = exports.UTRIE2_SHIFT_2 = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _Util = __webpack_require__(13); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +/** Shift size for getting the index-2 table offset. */ +var UTRIE2_SHIFT_2 = exports.UTRIE2_SHIFT_2 = 5; + +/** Shift size for getting the index-1 table offset. */ +var UTRIE2_SHIFT_1 = exports.UTRIE2_SHIFT_1 = 6 + 5; + +/** + * Shift size for shifting left the index array values. + * Increases possible data size with 16-bit index values at the cost + * of compactability. + * This requires data blocks to be aligned by UTRIE2_DATA_GRANULARITY. + */ +var UTRIE2_INDEX_SHIFT = exports.UTRIE2_INDEX_SHIFT = 2; + +/** + * Difference between the two shift sizes, + * for getting an index-1 offset from an index-2 offset. 6=11-5 + */ +var UTRIE2_SHIFT_1_2 = exports.UTRIE2_SHIFT_1_2 = UTRIE2_SHIFT_1 - UTRIE2_SHIFT_2; + +/** + * The part of the index-2 table for U+D800..U+DBFF stores values for + * lead surrogate code _units_ not code _points_. + * Values for lead surrogate code _points_ are indexed with this portion of the table. + * Length=32=0x20=0x400>>UTRIE2_SHIFT_2. (There are 1024=0x400 lead surrogates.) + */ +var UTRIE2_LSCP_INDEX_2_OFFSET = exports.UTRIE2_LSCP_INDEX_2_OFFSET = 0x10000 >> UTRIE2_SHIFT_2; + +/** Number of entries in a data block. 32=0x20 */ +var UTRIE2_DATA_BLOCK_LENGTH = exports.UTRIE2_DATA_BLOCK_LENGTH = 1 << UTRIE2_SHIFT_2; +/** Mask for getting the lower bits for the in-data-block offset. */ +var UTRIE2_DATA_MASK = exports.UTRIE2_DATA_MASK = UTRIE2_DATA_BLOCK_LENGTH - 1; + +var UTRIE2_LSCP_INDEX_2_LENGTH = exports.UTRIE2_LSCP_INDEX_2_LENGTH = 0x400 >> UTRIE2_SHIFT_2; +/** Count the lengths of both BMP pieces. 2080=0x820 */ +var UTRIE2_INDEX_2_BMP_LENGTH = exports.UTRIE2_INDEX_2_BMP_LENGTH = UTRIE2_LSCP_INDEX_2_OFFSET + UTRIE2_LSCP_INDEX_2_LENGTH; +/** + * The 2-byte UTF-8 version of the index-2 table follows at offset 2080=0x820. + * Length 32=0x20 for lead bytes C0..DF, regardless of UTRIE2_SHIFT_2. + */ +var UTRIE2_UTF8_2B_INDEX_2_OFFSET = exports.UTRIE2_UTF8_2B_INDEX_2_OFFSET = UTRIE2_INDEX_2_BMP_LENGTH; +var UTRIE2_UTF8_2B_INDEX_2_LENGTH = exports.UTRIE2_UTF8_2B_INDEX_2_LENGTH = 0x800 >> 6; /* U+0800 is the first code point after 2-byte UTF-8 */ +/** + * The index-1 table, only used for supplementary code points, at offset 2112=0x840. + * Variable length, for code points up to highStart, where the last single-value range starts. + * Maximum length 512=0x200=0x100000>>UTRIE2_SHIFT_1. + * (For 0x100000 supplementary code points U+10000..U+10ffff.) + * + * The part of the index-2 table for supplementary code points starts + * after this index-1 table. + * + * Both the index-1 table and the following part of the index-2 table + * are omitted completely if there is only BMP data. + */ +var UTRIE2_INDEX_1_OFFSET = exports.UTRIE2_INDEX_1_OFFSET = UTRIE2_UTF8_2B_INDEX_2_OFFSET + UTRIE2_UTF8_2B_INDEX_2_LENGTH; + +/** + * Number of index-1 entries for the BMP. 32=0x20 + * This part of the index-1 table is omitted from the serialized form. + */ + +var UTRIE2_OMITTED_BMP_INDEX_1_LENGTH = exports.UTRIE2_OMITTED_BMP_INDEX_1_LENGTH = 0x10000 >> UTRIE2_SHIFT_1; + +/** Number of entries in an index-2 block. 64=0x40 */ +var UTRIE2_INDEX_2_BLOCK_LENGTH = exports.UTRIE2_INDEX_2_BLOCK_LENGTH = 1 << UTRIE2_SHIFT_1_2; +/** Mask for getting the lower bits for the in-index-2-block offset. */ +var UTRIE2_INDEX_2_MASK = exports.UTRIE2_INDEX_2_MASK = UTRIE2_INDEX_2_BLOCK_LENGTH - 1; + +var createTrieFromBase64 = exports.createTrieFromBase64 = function createTrieFromBase64(base64) { + var buffer = (0, _Util.decode)(base64); + var view32 = Array.isArray(buffer) ? (0, _Util.polyUint32Array)(buffer) : new Uint32Array(buffer); + var view16 = Array.isArray(buffer) ? (0, _Util.polyUint16Array)(buffer) : new Uint16Array(buffer); + var headerLength = 24; + + var index = view16.slice(headerLength / 2, view32[4] / 2); + var data = view32[5] === 2 ? view16.slice((headerLength + view32[4]) / 2) : view32.slice(Math.ceil((headerLength + view32[4]) / 4)); + + return new Trie(view32[0], view32[1], view32[2], view32[3], index, data); +}; + +var Trie = exports.Trie = function () { + function Trie(initialValue, errorValue, highStart, highValueIndex, index, data) { + _classCallCheck(this, Trie); + + this.initialValue = initialValue; + this.errorValue = errorValue; + this.highStart = highStart; + this.highValueIndex = highValueIndex; + this.index = index; + this.data = data; + } + + /** + * Get the value for a code point as stored in the Trie. + * + * @param codePoint the code point + * @return the value + */ + + + _createClass(Trie, [{ + key: 'get', + value: function get(codePoint) { + var ix = void 0; + if (codePoint >= 0) { + if (codePoint < 0x0d800 || codePoint > 0x0dbff && codePoint <= 0x0ffff) { + // Ordinary BMP code point, excluding leading surrogates. + // BMP uses a single level lookup. BMP index starts at offset 0 in the Trie2 index. + // 16 bit data is stored in the index array itself. + ix = this.index[codePoint >> UTRIE2_SHIFT_2]; + ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK); + return this.data[ix]; + } + + if (codePoint <= 0xffff) { + // Lead Surrogate Code Point. A Separate index section is stored for + // lead surrogate code units and code points. + // The main index has the code unit data. + // For this function, we need the code point data. + // Note: this expression could be refactored for slightly improved efficiency, but + // surrogate code points will be so rare in practice that it's not worth it. + ix = this.index[UTRIE2_LSCP_INDEX_2_OFFSET + (codePoint - 0xd800 >> UTRIE2_SHIFT_2)]; + ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK); + return this.data[ix]; + } + + if (codePoint < this.highStart) { + // Supplemental code point, use two-level lookup. + ix = UTRIE2_INDEX_1_OFFSET - UTRIE2_OMITTED_BMP_INDEX_1_LENGTH + (codePoint >> UTRIE2_SHIFT_1); + ix = this.index[ix]; + ix += codePoint >> UTRIE2_SHIFT_2 & UTRIE2_INDEX_2_MASK; + ix = this.index[ix]; + ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK); + return this.data[ix]; + } + if (codePoint <= 0x10ffff) { + return this.data[this.highValueIndex]; + } + } + + // Fall through. The code point is outside of the legal range of 0..0x10ffff. + return this.errorValue; + } + }]); + + return Trie; +}(); + +/***/ }), +/* 49 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = 'KwAAAAAAAAAACA4AIDoAAPAfAAACAAAAAAAIABAAGABAAEgAUABYAF4AZgBeAGYAYABoAHAAeABeAGYAfACEAIAAiACQAJgAoACoAK0AtQC9AMUAXgBmAF4AZgBeAGYAzQDVAF4AZgDRANkA3gDmAOwA9AD8AAQBDAEUARoBIgGAAIgAJwEvATcBPwFFAU0BTAFUAVwBZAFsAXMBewGDATAAiwGTAZsBogGkAawBtAG8AcIBygHSAdoB4AHoAfAB+AH+AQYCDgIWAv4BHgImAi4CNgI+AkUCTQJTAlsCYwJrAnECeQKBAk0CiQKRApkCoQKoArACuALAAsQCzAIwANQC3ALkAjAA7AL0AvwCAQMJAxADGAMwACADJgMuAzYDPgOAAEYDSgNSA1IDUgNaA1oDYANiA2IDgACAAGoDgAByA3YDfgOAAIQDgACKA5IDmgOAAIAAogOqA4AAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAK8DtwOAAIAAvwPHA88D1wPfAyAD5wPsA/QD/AOAAIAABAQMBBIEgAAWBB4EJgQuBDMEIAM7BEEEXgBJBCADUQRZBGEEaQQwADAAcQQ+AXkEgQSJBJEEgACYBIAAoASoBK8EtwQwAL8ExQSAAIAAgACAAIAAgACgAM0EXgBeAF4AXgBeAF4AXgBeANUEXgDZBOEEXgDpBPEE+QQBBQkFEQUZBSEFKQUxBTUFPQVFBUwFVAVcBV4AYwVeAGsFcwV7BYMFiwWSBV4AmgWgBacFXgBeAF4AXgBeAKsFXgCyBbEFugW7BcIFwgXIBcIFwgXQBdQF3AXkBesF8wX7BQMGCwYTBhsGIwYrBjMGOwZeAD8GRwZNBl4AVAZbBl4AXgBeAF4AXgBeAF4AXgBeAF4AXgBeAGMGXgBqBnEGXgBeAF4AXgBeAF4AXgBeAF4AXgB5BoAG4wSGBo4GkwaAAIADHgR5AF4AXgBeAJsGgABGA4AAowarBrMGswagALsGwwbLBjAA0wbaBtoG3QbaBtoG2gbaBtoG2gblBusG8wb7BgMHCwcTBxsHCwcjBysHMAc1BzUHOgdCB9oGSgdSB1oHYAfaBloHaAfaBlIH2gbaBtoG2gbaBtoG2gbaBjUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHbQdeAF4ANQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQd1B30HNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1B4MH2gaKB68EgACAAIAAgACAAIAAgACAAI8HlwdeAJ8HpweAAIAArwe3B14AXgC/B8UHygcwANAH2AfgB4AA6AfwBz4B+AcACFwBCAgPCBcIogEYAR8IJwiAAC8INwg/CCADRwhPCFcIXwhnCEoDGgSAAIAAgABvCHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIhAiLCI4IMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlggwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAANQc1BzUHNQc1BzUHNQc1BzUHNQc1B54INQc1B6II2gaqCLIIugiAAIAAvgjGCIAAgACAAIAAgACAAIAAgACAAIAAywiHAYAA0wiAANkI3QjlCO0I9Aj8CIAAgACAAAIJCgkSCRoJIgknCTYHLwk3CZYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiAAIAAAAFAAXgBeAGAAcABeAHwAQACQAKAArQC9AJ4AXgBeAE0A3gBRAN4A7AD8AMwBGgEAAKcBNwEFAUwBXAF4QkhCmEKnArcCgAHHAsABz4LAAcABwAHAAd+C6ABoAG+C/4LAAcABwAHAAc+DF4MAAcAB54M3gweDV4Nng3eDaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAEeDqABVg6WDqABoQ6gAaABoAHXDvcONw/3DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DncPAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcAB7cPPwlGCU4JMACAAIAAgABWCV4JYQmAAGkJcAl4CXwJgAkwADAAMAAwAIgJgACLCZMJgACZCZ8JowmrCYAAswkwAF4AXgB8AIAAuwkABMMJyQmAAM4JgADVCTAAMAAwADAAgACAAIAAgACAAIAAgACAAIAAqwYWBNkIMAAwADAAMADdCeAJ6AnuCR4E9gkwAP4JBQoNCjAAMACAABUK0wiAAB0KJAosCjQKgAAwADwKQwqAAEsKvQmdCVMKWwowADAAgACAALcEMACAAGMKgABrCjAAMAAwADAAMAAwADAAMAAwADAAMAAeBDAAMAAwADAAMAAwADAAMAAwADAAMAAwAIkEPQFzCnoKiQSCCooKkAqJBJgKoAqkCokEGAGsCrQKvArBCjAAMADJCtEKFQHZCuEK/gHpCvEKMAAwADAAMACAAIwE+QowAIAAPwEBCzAAMAAwADAAMACAAAkLEQswAIAAPwEZCyELgAAOCCkLMAAxCzkLMAAwADAAMAAwADAAXgBeAEELMAAwADAAMAAwADAAMAAwAEkLTQtVC4AAXAtkC4AAiQkwADAAMAAwADAAMAAwADAAbAtxC3kLgAuFC4sLMAAwAJMLlwufCzAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAApwswADAAMACAAIAAgACvC4AAgACAAIAAgACAALcLMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAvwuAAMcLgACAAIAAgACAAIAAyguAAIAAgACAAIAA0QswADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAANkLgACAAIAA4AswADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACJCR4E6AswADAAhwHwC4AA+AsADAgMEAwwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMACAAIAAGAwdDCUMMAAwAC0MNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQw1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHPQwwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADUHNQc1BzUHNQc1BzUHNQc2BzAAMAA5DDUHNQc1BzUHNQc1BzUHNQc1BzUHNQdFDDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAgACAAIAATQxSDFoMMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAF4AXgBeAF4AXgBeAF4AYgxeAGoMXgBxDHkMfwxeAIUMXgBeAI0MMAAwADAAMAAwAF4AXgCVDJ0MMAAwADAAMABeAF4ApQxeAKsMswy7DF4Awgy9DMoMXgBeAF4AXgBeAF4AXgBeAF4AXgDRDNkMeQBqCeAM3Ax8AOYM7Az0DPgMXgBeAF4AXgBeAF4AXgBeAF4AXgBeAF4AXgBeAF4AXgCgAAANoAAHDQ4NFg0wADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAeDSYNMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIAAgACAAIAAgACAAC4NMABeAF4ANg0wADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAD4NRg1ODVYNXg1mDTAAbQ0wADAAMAAwADAAMAAwADAA2gbaBtoG2gbaBtoG2gbaBnUNeg3CBYANwgWFDdoGjA3aBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gaUDZwNpA2oDdoG2gawDbcNvw3HDdoG2gbPDdYN3A3fDeYN2gbsDfMN2gbaBvoN/g3aBgYODg7aBl4AXgBeABYOXgBeACUG2gYeDl4AJA5eACwO2w3aBtoGMQ45DtoG2gbaBtoGQQ7aBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gZJDjUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1B1EO2gY1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQdZDjUHNQc1BzUHNQc1B2EONQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHaA41BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1B3AO2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gY1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1B2EO2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gZJDtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBkkOeA6gAKAAoAAwADAAMAAwAKAAoACgAKAAoACgAKAAgA4wADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAD//wQABAAEAAQABAAEAAQABAAEAA0AAwABAAEAAgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAKABMAFwAeABsAGgAeABcAFgASAB4AGwAYAA8AGAAcAEsASwBLAEsASwBLAEsASwBLAEsAGAAYAB4AHgAeABMAHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAFgAbABIAHgAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABYADQARAB4ABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAUABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAkAFgAaABsAGwAbAB4AHQAdAB4ATwAXAB4ADQAeAB4AGgAbAE8ATwAOAFAAHQAdAB0ATwBPABcATwBPAE8AFgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAFAATwBAAE8ATwBPAEAATwBQAFAATwBQAB4AHgAeAB4AHgAeAB0AHQAdAB0AHgAdAB4ADgBQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgBQAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAkACQAJAAkACQAJAAkABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAFAAHgAeAB4AKwArAFAAUABQAFAAGABQACsAKwArACsAHgAeAFAAHgBQAFAAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUAAeAB4AHgAeAB4AHgArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAYAA0AKwArAB4AHgAbACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAB4ABAAEAB4ABAAEABMABAArACsAKwArACsAKwArACsAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAKwArACsAKwArAFYAVgBWAB4AHgArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AGgAaABoAGAAYAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQAEwAEACsAEwATAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABLAEsASwBLAEsASwBLAEsASwBLABoAGQAZAB4AUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABMAUAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABABQAFAABAAEAB4ABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUAAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAFAABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQAUABQAB4AHgAYABMAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAFAABAAEAAQABAAEAFAABAAEAAQAUAAEAAQABAAEAAQAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArACsAHgArAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAAQABAANAA0ASwBLAEsASwBLAEsASwBLAEsASwAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAKwArACsAUABQAFAAUAArACsABABQAAQABAAEAAQABAAEAAQAKwArAAQABAArACsABAAEAAQAUAArACsAKwArACsAKwArACsABAArACsAKwArAFAAUAArAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAGgAaAFAAUABQAFAAUABMAB4AGwBQAB4AKwArACsABAAEAAQAKwBQAFAAUABQAFAAUAArACsAKwArAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUAArAFAAUAArACsABAArAAQABAAEAAQABAArACsAKwArAAQABAArACsABAAEAAQAKwArACsABAArACsAKwArACsAKwArAFAAUABQAFAAKwBQACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwAEAAQAUABQAFAABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUABQAFAAUAArACsABABQAAQABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQAKwArAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwAeABsAKwArACsAKwArACsAKwBQAAQABAAEAAQABAAEACsABAAEAAQAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwArAAQABAArACsABAAEAAQAKwArACsAKwArACsAKwArAAQABAArACsAKwArAFAAUAArAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwAeAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwAEAFAAKwBQAFAAUABQAFAAUAArACsAKwBQAFAAUAArAFAAUABQAFAAKwArACsAUABQACsAUAArAFAAUAArACsAKwBQAFAAKwArACsAUABQAFAAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAAQABAAEAAQAKwArACsABAAEAAQAKwAEAAQABAAEACsAKwBQACsAKwArACsAKwArAAQAKwArACsAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAB4AHgAeAB4AHgAeABsAHgArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABAArACsAKwArACsAKwArAAQABAArAFAAUABQACsAKwArACsAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAB4AUAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABAArACsAKwArACsAKwArAAQABAArACsAKwArACsAKwArAFAAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABABQAB4AKwArACsAKwBQAFAAUAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQABoAUABQAFAAUABQAFAAKwArAAQABAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQACsAUAArACsAUABQAFAAUABQAFAAUAArACsAKwAEACsAKwArACsABAAEAAQABAAEAAQAKwAEACsABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgAqACsAKwArACsAGwBcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAeAEsASwBLAEsASwBLAEsASwBLAEsADQANACsAKwArACsAKwBcAFwAKwBcACsAKwBcAFwAKwBcACsAKwBcACsAKwArACsAKwArAFwAXABcAFwAKwBcAFwAXABcAFwAXABcACsAXABcAFwAKwBcACsAXAArACsAXABcACsAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgArACoAKgBcACsAKwBcAFwAXABcAFwAKwBcACsAKgAqACoAKgAqACoAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAFwAXABcAFwAUAAOAA4ADgAOAB4ADgAOAAkADgAOAA0ACQATABMAEwATABMACQAeABMAHgAeAB4ABAAEAB4AHgAeAB4AHgAeAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUAANAAQAHgAEAB4ABAAWABEAFgARAAQABABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAAQABAAEAAQABAANAAQABABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsADQANAB4AHgAeAB4AHgAeAAQAHgAeAB4AHgAeAB4AKwAeAB4ADgAOAA0ADgAeAB4AHgAeAB4ACQAJACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqAFwASwBLAEsASwBLAEsASwBLAEsASwANAA0AHgAeAB4AHgBcAFwAXABcAFwAXAAqACoAKgAqAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAKgAqACoAKgAqACoAKgBcAFwAXAAqACoAKgAqAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAXAAqAEsASwBLAEsASwBLAEsASwBLAEsAKgAqACoAKgAqACoAUABQAFAAUABQAFAAKwBQACsAKwArACsAKwBQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQACsAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwAEAAQABAAeAA0AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABYAEQArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAADQANAA0AUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAA0ADQArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQACsABAAEACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoADQANABUAXAANAB4ADQAbAFwAKgArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAB4AHgATABMADQANAA4AHgATABMAHgAEAAQABAAJACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAUABQAFAAUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwAeACsAKwArABMAEwBLAEsASwBLAEsASwBLAEsASwBLAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwBcAFwAXABcAFwAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBcACsAKwArACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEACsAKwAeAB4AXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgArACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgArACsABABLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKgAqACoAKgAqACoAKgBcACoAKgAqACoAKgAqACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAUABQAFAAUABQAFAAUAArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsADQANAB4ADQANAA0ADQAeAB4AHgAeAB4AHgAeAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAHgAeAB4AHgBQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwANAA0ADQANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwBQAFAAUABLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAA0AUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsABAAEAAQAHgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAUABQAFAABABQAFAAUABQAAQABAAEAFAAUAAEAAQABAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAKwBQACsAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAHgAeAB4AHgAeAB4AHgAeAFAAHgAeAB4AUABQAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAKwArAB4AHgAeAB4AHgAeACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAUABQAFAAKwAeAB4AHgAeAB4AHgAeAA4AHgArAA0ADQANAA0ADQANAA0ACQANAA0ADQAIAAQACwAEAAQADQAJAA0ADQAMAB0AHQAeABcAFwAWABcAFwAXABYAFwAdAB0AHgAeABQAFAAUAA0AAQABAAQABAAEAAQABAAJABoAGgAaABoAGgAaABoAGgAeABcAFwAdABUAFQAeAB4AHgAeAB4AHgAYABYAEQAVABUAFQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgANAB4ADQANAA0ADQAeAA0ADQANAAcAHgAeAB4AHgArAAQABAAEAAQABAAEAAQABAAEAAQAUABQACsAKwBPAFAAUABQAFAAUAAeAB4AHgAWABEATwBQAE8ATwBPAE8AUABQAFAAUABQAB4AHgAeABYAEQArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAGwAbABsAGwAbABsAGwAaABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAaABsAGwAbABsAGgAbABsAGgAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgBQABoAHgAdAB4AUAAeABoAHgAeAB4AHgAeAB4AHgAeAB4ATwAeAFAAGwAeAB4AUABQAFAAUABQAB4AHgAeAB0AHQAeAFAAHgBQAB4AUAAeAFAATwBQAFAAHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AUABQAFAAUABPAE8AUABQAFAAUABQAE8AUABQAE8AUABPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBQAFAAUABQAE8ATwBPAE8ATwBPAE8ATwBPAE8AUABQAFAAUABQAFAAUABQAFAAHgAeAFAAUABQAFAATwAeAB4AKwArACsAKwAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAeAB0AHQAeAB4AHgAdAB0AHgAeAB0AHgAeAB4AHQAeAB0AGwAbAB4AHQAeAB4AHgAeAB0AHgAeAB0AHQAdAB0AHgAeAB0AHgAdAB4AHQAdAB0AHQAdAB0AHgAdAB4AHgAeAB4AHgAdAB0AHQAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAdAB4AHgAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB4AHgAdAB0AHQAdAB4AHgAdAB0AHgAeAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAeAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHQAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABQAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAlACUAHgAeAB4AHgAeAB4AHgAeAB4AFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBQAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeAB4AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAdAB0AHQAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAeAB0AHQAeAB4AHgAeAB0AHQAeAB4AHgAeAB0AHQAdAB4AHgAdAB4AHgAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB0AHQAeAB4AHQAeAB4AHgAeAB0AHQAeAB4AHgAeACUAJQAdAB0AJQAeACUAJQAlACAAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAHgAeAB4AHgAdAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB4AHQAdAB0AHgAdACUAHQAdAB4AHQAdAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAHQAdAB0AHQAlAB4AJQAlACUAHQAlACUAHQAdAB0AJQAlAB0AHQAlAB0AHQAlACUAJQAeAB0AHgAeAB4AHgAdAB0AJQAdAB0AHQAdAB0AHQAlACUAJQAlACUAHQAlACUAIAAlAB0AHQAlACUAJQAlACUAJQAlACUAHgAeAB4AJQAlACAAIAAgACAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeABcAFwAXABcAFwAXAB4AEwATACUAHgAeAB4AFgARABYAEQAWABEAFgARABYAEQAWABEAFgARAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARABYAEQAWABEAFgARABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAEAAQABAAeAB4AKwArACsAKwArABMADQANAA0AUAATAA0AUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUAANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAA0ADQANAA0ADQANAA0ADQAeAA0AFgANAB4AHgAXABcAHgAeABcAFwAWABEAFgARABYAEQAWABEADQANAA0ADQATAFAADQANAB4ADQANAB4AHgAeAB4AHgAMAAwADQANAA0AHgANAA0AFgANAA0ADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArAA0AEQARACUAJQBHAFcAVwAWABEAFgARABYAEQAWABEAFgARACUAJQAWABEAFgARABYAEQAWABEAFQAWABEAEQAlAFcAVwBXAFcAVwBXAFcAVwBXAAQABAAEAAQABAAEACUAVwBXAFcAVwA2ACUAJQBXAFcAVwBHAEcAJQAlACUAKwBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBRAFcAUQBXAFEAVwBXAFcAVwBXAFcAUQBXAFcAVwBXAFcAVwBRAFEAKwArAAQABAAVABUARwBHAFcAFQBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBRAFcAVwBXAFcAVwBXAFEAUQBXAFcAVwBXABUAUQBHAEcAVwArACsAKwArACsAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwArACUAJQBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAKwArACUAJQAlACUAKwArACsAKwArACsAKwArACsAKwArACsAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAE8ATwBPAE8ATwBPAE8ATwAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADQATAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABLAEsASwBLAEsASwBLAEsASwBLAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAABAAEAAQABAAeAAQABAAEAAQABAAEAAQABAAEAAQAHgBQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAeAA0ADQANAA0ADQArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAAQAUABQAFAABABQAFAAUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAeAB4AHgAeACsAKwArACsAUABQAFAAUABQAFAAHgAeABoAHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADgAOABMAEwArACsAKwArACsAKwArACsABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUAAeAB4AHgBQAA4AUAArACsAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAB4AWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYACsAKwArAAQAHgAeAB4AHgAeAB4ADQANAA0AHgAeAB4AHgArAFAASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArAB4AHgBcAFwAXABcAFwAKgBcAFwAXABcAFwAXABcAFwAXABcAEsASwBLAEsASwBLAEsASwBLAEsAXABcAFwAXABcACsAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAFAAUABQAAQAUABQAFAAUABQAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAHgANAA0ADQBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAKgAqACoAXABcACoAKgBcAFwAXABcAFwAKgAqAFwAKgBcACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAA0ADQBQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQADQAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAVABVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBUAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVACsAKwArACsAKwArACsAKwArACsAKwArAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAKwArACsAKwBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAKwArACsAKwAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArACsAKwArAFYABABWAFYAVgBWAFYAVgBWAFYAVgBWAB4AVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgArAFYAVgBWAFYAVgArAFYAKwBWAFYAKwBWAFYAKwBWAFYAVgBWAFYAVgBWAFYAVgBWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAEQAWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAaAB4AKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAGAARABEAGAAYABMAEwAWABEAFAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACUAJQAlACUAJQAWABEAFgARABYAEQAWABEAFgARABYAEQAlACUAFgARACUAJQAlACUAJQAlACUAEQAlABEAKwAVABUAEwATACUAFgARABYAEQAWABEAJQAlACUAJQAlACUAJQAlACsAJQAbABoAJQArACsAKwArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAcAKwATACUAJQAbABoAJQAlABYAEQAlACUAEQAlABEAJQBXAFcAVwBXAFcAVwBXAFcAVwBXABUAFQAlACUAJQATACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXABYAJQARACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAWACUAEQAlABYAEQARABYAEQARABUAVwBRAFEAUQBRAFEAUQBRAFEAUQBRAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcARwArACsAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXACsAKwBXAFcAVwBXAFcAVwArACsAVwBXAFcAKwArACsAGgAbACUAJQAlABsAGwArAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAAQAB0AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsADQANAA0AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQBQAFAAUABQACsAKwArACsAUABQAFAAUABQAFAAUABQAA0AUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQACsAKwArAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgBQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwBQAFAAUABQAFAABAAEAAQAKwAEAAQAKwArACsAKwArAAQABAAEAAQAUABQAFAAUAArAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsABAAEAAQAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsADQANAA0ADQANAA0ADQANAB4AKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AUABQAFAAUABQAFAAUABQAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwArACsAUABQAFAAUABQAA0ADQANAA0ADQANABQAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwANAA0ADQANAA0ADQANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQAeAB4AHgAeAB4AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsASwBLAEsASwBLAEsASwBLAEsASwANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAeAA4AUAArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAADQANAB4ADQAeAAQABAAEAB4AKwArAEsASwBLAEsASwBLAEsASwBLAEsAUAAOAFAADQANAA0AKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAA0AHgANAA0AHgAEACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAA0AKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAUAArACsAKwArACsAKwAEACsAKwArACsAKwBQAFAAUABQAFAABAAEACsAKwAEAAQABAAEAAQABAAEACsAKwArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABABQAFAAUABQAA0ADQANAA0AHgBLAEsASwBLAEsASwBLAEsASwBLACsADQArAB4AKwArAAQABAAEAAQAUABQAB4AUAArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEACsAKwAEAAQABAAEAAQABAAEAAQABAAOAA0ADQATABMAHgAeAB4ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0AUABQAFAAUAAEAAQAKwArAAQADQANAB4AUAArACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAKwAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAXABcAA0ADQANACoASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAOAB4ADQANAA0ADQAOAB4ABAArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAFAAUAArACsAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAA0ADQANACsADgAOAA4ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAFAADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAOABMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAArACsAKwAEACsABAAEACsABAAEAAQABAAEAAQABABQAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABIAEgAQwBDAEMAUABQAFAAUABDAFAAUABQAEgAQwBIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABDAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwANAA0AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAANACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQANAB4AHgAeAB4AHgAeAFAAUABQAFAADQAeACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEcARwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwArACsAKwArACsAKwArACsAKwArACsAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQACsAKwAeAAQABAANAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAHgAeAAQABAAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAEAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUAArACsAUAArACsAUABQACsAKwBQAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQACsAUABQAFAAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwAeAB4AUABQAFAAUABQACsAUAArACsAKwBQAFAAUABQAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AKwArAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAEAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAeAB4ADQANAA0ADQAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABAArAAQABAArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAEAAQABAAEAAQABAAEACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAFgAWAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArAFAAKwArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArAFAAKwBQACsAKwArACsAKwArAFAAKwArACsAKwBQACsAUAArAFAAKwBQAFAAUAArAFAAUAArAFAAKwArAFAAKwBQACsAUAArAFAAKwBQACsAUABQACsAUAArACsAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAUABQAFAAUAArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwBQAFAAUAArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAlACUAJQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeACUAJQAlACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeACUAJQAlACUAJQAeACUAJQAlACUAJQAgACAAIAAlACUAIAAlACUAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIQAhACEAIQAhACUAJQAgACAAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIAAgACAAIAAlACUAJQAlACAAJQAgACAAIAAgACAAIAAgACAAIAAlACUAJQAgACUAJQAlACUAIAAgACAAJQAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeACUAHgAlAB4AJQAlACUAJQAlACAAJQAlACUAJQAeACUAHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIAAgACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIAAlACUAJQAlACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAIAAgACAAJQAlACUAIAAgACAAIAAgAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFwAXABcAFQAVABUAHgAeAB4AHgAlACUAJQAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIAAgACAAJQAlACUAJQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAlACAAIAAlACUAJQAlACUAJQAgACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAIAAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsA'; + +/***/ }), +/* 50 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _Path = __webpack_require__(5); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var Circle = function Circle(x, y, radius) { + _classCallCheck(this, Circle); + + this.type = _Path.PATH.CIRCLE; + this.x = x; + this.y = y; + this.radius = radius; + if (true) { + if (isNaN(x)) { + console.error('Invalid x value given for Circle'); + } + if (isNaN(y)) { + console.error('Invalid y value given for Circle'); + } + if (isNaN(radius)) { + console.error('Invalid radius value given for Circle'); + } + } +}; + +exports.default = Circle; + +/***/ }), +/* 51 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _Bounds = __webpack_require__(2); + +var _Font = __webpack_require__(25); + +var _Gradient = __webpack_require__(52); + +var _TextContainer = __webpack_require__(9); + +var _TextContainer2 = _interopRequireDefault(_TextContainer); + +var _background = __webpack_require__(4); + +var _border = __webpack_require__(12); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var Renderer = function () { + function Renderer(target, options) { + _classCallCheck(this, Renderer); + + this.target = target; + this.options = options; + target.render(options); + } + + _createClass(Renderer, [{ + key: 'renderNode', + value: function renderNode(container) { + if (container.isVisible()) { + this.renderNodeBackgroundAndBorders(container); + this.renderNodeContent(container); + } + } + }, { + key: 'renderNodeContent', + value: function renderNodeContent(container) { + var _this = this; + + var callback = function callback() { + if (container.childNodes.length) { + container.childNodes.forEach(function (child) { + if (child instanceof _TextContainer2.default) { + var style = child.parent.style; + _this.target.renderTextNode(child.bounds, style.color, style.font, style.textDecoration, style.textShadow); + } else { + _this.target.drawShape(child, container.style.color); + } + }); + } + + if (container.image) { + var _image = _this.options.imageStore.get(container.image); + if (_image) { + var contentBox = (0, _Bounds.calculateContentBox)(container.bounds, container.style.padding, container.style.border); + var _width = typeof _image.width === 'number' && _image.width > 0 ? _image.width : contentBox.width; + var _height = typeof _image.height === 'number' && _image.height > 0 ? _image.height : contentBox.height; + if (_width > 0 && _height > 0) { + _this.target.clip([(0, _Bounds.calculatePaddingBoxPath)(container.curvedBounds)], function () { + _this.target.drawImage(_image, new _Bounds.Bounds(0, 0, _width, _height), contentBox); + }); + } + } + } + }; + var paths = container.getClipPaths(); + if (paths.length) { + this.target.clip(paths, callback); + } else { + callback(); + } + } + }, { + key: 'renderNodeBackgroundAndBorders', + value: function renderNodeBackgroundAndBorders(container) { + var _this2 = this; + + var HAS_BACKGROUND = !container.style.background.backgroundColor.isTransparent() || container.style.background.backgroundImage.length; + + var hasRenderableBorders = container.style.border.some(function (border) { + return border.borderStyle !== _border.BORDER_STYLE.NONE && !border.borderColor.isTransparent(); + }); + + var callback = function callback() { + var backgroundPaintingArea = (0, _background.calculateBackgroungPaintingArea)(container.curvedBounds, container.style.background.backgroundClip); + + if (HAS_BACKGROUND) { + _this2.target.clip([backgroundPaintingArea], function () { + if (!container.style.background.backgroundColor.isTransparent()) { + _this2.target.fill(container.style.background.backgroundColor); + } + + _this2.renderBackgroundImage(container); + }); + } + + container.style.border.forEach(function (border, side) { + if (border.borderStyle !== _border.BORDER_STYLE.NONE && !border.borderColor.isTransparent()) { + _this2.renderBorder(border, side, container.curvedBounds); + } + }); + }; + + if (HAS_BACKGROUND || hasRenderableBorders) { + var paths = container.parent ? container.parent.getClipPaths() : []; + if (paths.length) { + this.target.clip(paths, callback); + } else { + callback(); + } + } + } + }, { + key: 'renderBackgroundImage', + value: function renderBackgroundImage(container) { + var _this3 = this; + + container.style.background.backgroundImage.slice(0).reverse().forEach(function (backgroundImage) { + if (backgroundImage.source.method === 'url' && backgroundImage.source.args.length) { + _this3.renderBackgroundRepeat(container, backgroundImage); + } else if (/gradient/i.test(backgroundImage.source.method)) { + _this3.renderBackgroundGradient(container, backgroundImage); + } + }); + } + }, { + key: 'renderBackgroundRepeat', + value: function renderBackgroundRepeat(container, background) { + var image = this.options.imageStore.get(background.source.args[0]); + if (image) { + var backgroundPositioningArea = (0, _background.calculateBackgroungPositioningArea)(container.style.background.backgroundOrigin, container.bounds, container.style.padding, container.style.border); + var backgroundImageSize = (0, _background.calculateBackgroundSize)(background, image, backgroundPositioningArea); + var position = (0, _background.calculateBackgroundPosition)(background.position, backgroundImageSize, backgroundPositioningArea); + var _path = (0, _background.calculateBackgroundRepeatPath)(background, position, backgroundImageSize, backgroundPositioningArea, container.bounds); + + var _offsetX = Math.round(backgroundPositioningArea.left + position.x); + var _offsetY = Math.round(backgroundPositioningArea.top + position.y); + this.target.renderRepeat(_path, image, backgroundImageSize, _offsetX, _offsetY); + } + } + }, { + key: 'renderBackgroundGradient', + value: function renderBackgroundGradient(container, background) { + var backgroundPositioningArea = (0, _background.calculateBackgroungPositioningArea)(container.style.background.backgroundOrigin, container.bounds, container.style.padding, container.style.border); + var backgroundImageSize = (0, _background.calculateGradientBackgroundSize)(background, backgroundPositioningArea); + var position = (0, _background.calculateBackgroundPosition)(background.position, backgroundImageSize, backgroundPositioningArea); + var gradientBounds = new _Bounds.Bounds(Math.round(backgroundPositioningArea.left + position.x), Math.round(backgroundPositioningArea.top + position.y), backgroundImageSize.width, backgroundImageSize.height); + + var gradient = (0, _Gradient.parseGradient)(container, background.source, gradientBounds); + if (gradient) { + switch (gradient.type) { + case _Gradient.GRADIENT_TYPE.LINEAR_GRADIENT: + // $FlowFixMe + this.target.renderLinearGradient(gradientBounds, gradient); + break; + case _Gradient.GRADIENT_TYPE.RADIAL_GRADIENT: + // $FlowFixMe + this.target.renderRadialGradient(gradientBounds, gradient); + break; + } + } + } + }, { + key: 'renderBorder', + value: function renderBorder(border, side, curvePoints) { + this.target.drawShape((0, _Bounds.parsePathForBorder)(curvePoints, side), border.borderColor); + } + }, { + key: 'renderStack', + value: function renderStack(stack) { + var _this4 = this; + + if (stack.container.isVisible()) { + var _opacity = stack.getOpacity(); + if (_opacity !== this._opacity) { + this.target.setOpacity(stack.getOpacity()); + this._opacity = _opacity; + } + + var _transform = stack.container.style.transform; + if (_transform !== null) { + this.target.transform(stack.container.bounds.left + _transform.transformOrigin[0].value, stack.container.bounds.top + _transform.transformOrigin[1].value, _transform.transform, function () { + return _this4.renderStackContent(stack); + }); + } else { + this.renderStackContent(stack); + } + } + } + }, { + key: 'renderStackContent', + value: function renderStackContent(stack) { + var _splitStackingContext = splitStackingContexts(stack), + _splitStackingContext2 = _slicedToArray(_splitStackingContext, 5), + negativeZIndex = _splitStackingContext2[0], + zeroOrAutoZIndexOrTransformedOrOpacity = _splitStackingContext2[1], + positiveZIndex = _splitStackingContext2[2], + nonPositionedFloats = _splitStackingContext2[3], + nonPositionedInlineLevel = _splitStackingContext2[4]; + + var _splitDescendants = splitDescendants(stack), + _splitDescendants2 = _slicedToArray(_splitDescendants, 2), + inlineLevel = _splitDescendants2[0], + nonInlineLevel = _splitDescendants2[1]; + + // https://www.w3.org/TR/css-position-3/#painting-order + // 1. the background and borders of the element forming the stacking context. + + + this.renderNodeBackgroundAndBorders(stack.container); + // 2. the child stacking contexts with negative stack levels (most negative first). + negativeZIndex.sort(sortByZIndex).forEach(this.renderStack, this); + // 3. For all its in-flow, non-positioned, block-level descendants in tree order: + this.renderNodeContent(stack.container); + nonInlineLevel.forEach(this.renderNode, this); + // 4. All non-positioned floating descendants, in tree order. For each one of these, + // treat the element as if it created a new stacking context, but any positioned descendants and descendants + // which actually create a new stacking context should be considered part of the parent stacking context, + // not this new one. + nonPositionedFloats.forEach(this.renderStack, this); + // 5. the in-flow, inline-level, non-positioned descendants, including inline tables and inline blocks. + nonPositionedInlineLevel.forEach(this.renderStack, this); + inlineLevel.forEach(this.renderNode, this); + // 6. All positioned, opacity or transform descendants, in tree order that fall into the following categories: + // All positioned descendants with 'z-index: auto' or 'z-index: 0', in tree order. + // For those with 'z-index: auto', treat the element as if it created a new stacking context, + // but any positioned descendants and descendants which actually create a new stacking context should be + // considered part of the parent stacking context, not this new one. For those with 'z-index: 0', + // treat the stacking context generated atomically. + // + // All opacity descendants with opacity less than 1 + // + // All transform descendants with transform other than none + zeroOrAutoZIndexOrTransformedOrOpacity.forEach(this.renderStack, this); + // 7. Stacking contexts formed by positioned descendants with z-indices greater than or equal to 1 in z-index + // order (smallest first) then tree order. + positiveZIndex.sort(sortByZIndex).forEach(this.renderStack, this); + } + }, { + key: 'render', + value: function render(stack) { + var _this5 = this; + + if (this.options.backgroundColor) { + this.target.rectangle(this.options.x, this.options.y, this.options.width, this.options.height, this.options.backgroundColor); + } + this.renderStack(stack); + var target = this.target.getTarget(); + if (true) { + return target.then(function (output) { + _this5.options.logger.log('Render completed'); + return output; + }); + } + return target; + } + }]); + + return Renderer; +}(); + +exports.default = Renderer; + + +var splitDescendants = function splitDescendants(stack) { + var inlineLevel = []; + var nonInlineLevel = []; + + var length = stack.children.length; + for (var i = 0; i < length; i++) { + var child = stack.children[i]; + if (child.isInlineLevel()) { + inlineLevel.push(child); + } else { + nonInlineLevel.push(child); + } + } + return [inlineLevel, nonInlineLevel]; +}; + +var splitStackingContexts = function splitStackingContexts(stack) { + var negativeZIndex = []; + var zeroOrAutoZIndexOrTransformedOrOpacity = []; + var positiveZIndex = []; + var nonPositionedFloats = []; + var nonPositionedInlineLevel = []; + var length = stack.contexts.length; + for (var i = 0; i < length; i++) { + var child = stack.contexts[i]; + if (child.container.isPositioned() || child.container.style.opacity < 1 || child.container.isTransformed()) { + if (child.container.style.zIndex.order < 0) { + negativeZIndex.push(child); + } else if (child.container.style.zIndex.order > 0) { + positiveZIndex.push(child); + } else { + zeroOrAutoZIndexOrTransformedOrOpacity.push(child); + } + } else { + if (child.container.isFloating()) { + nonPositionedFloats.push(child); + } else { + nonPositionedInlineLevel.push(child); + } + } + } + return [negativeZIndex, zeroOrAutoZIndexOrTransformedOrOpacity, positiveZIndex, nonPositionedFloats, nonPositionedInlineLevel]; +}; + +var sortByZIndex = function sortByZIndex(a, b) { + if (a.container.style.zIndex.order > b.container.style.zIndex.order) { + return 1; + } else if (a.container.style.zIndex.order < b.container.style.zIndex.order) { + return -1; + } + + return a.container.index > b.container.index ? 1 : -1; +}; + +/***/ }), +/* 52 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.transformWebkitRadialGradientArgs = exports.parseGradient = exports.RadialGradient = exports.LinearGradient = exports.RADIAL_GRADIENT_SHAPE = exports.GRADIENT_TYPE = undefined; + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +var _NodeContainer = __webpack_require__(6); + +var _NodeContainer2 = _interopRequireDefault(_NodeContainer); + +var _Angle = __webpack_require__(53); + +var _Color = __webpack_require__(0); + +var _Color2 = _interopRequireDefault(_Color); + +var _Length = __webpack_require__(1); + +var _Length2 = _interopRequireDefault(_Length); + +var _Util = __webpack_require__(3); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var SIDE_OR_CORNER = /^(to )?(left|top|right|bottom)( (left|top|right|bottom))?$/i; +var PERCENTAGE_ANGLES = /^([+-]?\d*\.?\d+)% ([+-]?\d*\.?\d+)%$/i; +var ENDS_WITH_LENGTH = /(px)|%|( 0)$/i; +var FROM_TO_COLORSTOP = /^(from|to|color-stop)\((?:([\d.]+)(%)?,\s*)?(.+?)\)$/i; +var RADIAL_SHAPE_DEFINITION = /^\s*(circle|ellipse)?\s*((?:([\d.]+)(px|r?em|%)\s*(?:([\d.]+)(px|r?em|%))?)|closest-side|closest-corner|farthest-side|farthest-corner)?\s*(?:at\s*(?:(left|center|right)|([\d.]+)(px|r?em|%))\s+(?:(top|center|bottom)|([\d.]+)(px|r?em|%)))?(?:\s|$)/i; + +var GRADIENT_TYPE = exports.GRADIENT_TYPE = { + LINEAR_GRADIENT: 0, + RADIAL_GRADIENT: 1 +}; + +var RADIAL_GRADIENT_SHAPE = exports.RADIAL_GRADIENT_SHAPE = { + CIRCLE: 0, + ELLIPSE: 1 +}; + +var LENGTH_FOR_POSITION = { + left: new _Length2.default('0%'), + top: new _Length2.default('0%'), + center: new _Length2.default('50%'), + right: new _Length2.default('100%'), + bottom: new _Length2.default('100%') +}; + +var LinearGradient = exports.LinearGradient = function LinearGradient(colorStops, direction) { + _classCallCheck(this, LinearGradient); + + this.type = GRADIENT_TYPE.LINEAR_GRADIENT; + this.colorStops = colorStops; + this.direction = direction; +}; + +var RadialGradient = exports.RadialGradient = function RadialGradient(colorStops, shape, center, radius) { + _classCallCheck(this, RadialGradient); + + this.type = GRADIENT_TYPE.RADIAL_GRADIENT; + this.colorStops = colorStops; + this.shape = shape; + this.center = center; + this.radius = radius; +}; + +var parseGradient = exports.parseGradient = function parseGradient(container, _ref, bounds) { + var args = _ref.args, + method = _ref.method, + prefix = _ref.prefix; + + if (method === 'linear-gradient') { + return parseLinearGradient(args, bounds, !!prefix); + } else if (method === 'gradient' && args[0] === 'linear') { + // TODO handle correct angle + return parseLinearGradient(['to bottom'].concat(transformObsoleteColorStops(args.slice(3))), bounds, !!prefix); + } else if (method === 'radial-gradient') { + return parseRadialGradient(container, prefix === '-webkit-' ? transformWebkitRadialGradientArgs(args) : args, bounds); + } else if (method === 'gradient' && args[0] === 'radial') { + return parseRadialGradient(container, transformObsoleteColorStops(transformWebkitRadialGradientArgs(args.slice(1))), bounds); + } +}; + +var parseColorStops = function parseColorStops(args, firstColorStopIndex, lineLength) { + var colorStops = []; + + for (var i = firstColorStopIndex; i < args.length; i++) { + var value = args[i]; + var HAS_LENGTH = ENDS_WITH_LENGTH.test(value); + var lastSpaceIndex = value.lastIndexOf(' '); + var _color = new _Color2.default(HAS_LENGTH ? value.substring(0, lastSpaceIndex) : value); + var _stop = HAS_LENGTH ? new _Length2.default(value.substring(lastSpaceIndex + 1)) : i === firstColorStopIndex ? new _Length2.default('0%') : i === args.length - 1 ? new _Length2.default('100%') : null; + colorStops.push({ color: _color, stop: _stop }); + } + + var absoluteValuedColorStops = colorStops.map(function (_ref2) { + var color = _ref2.color, + stop = _ref2.stop; + + var absoluteStop = lineLength === 0 ? 0 : stop ? stop.getAbsoluteValue(lineLength) / lineLength : null; + + return { + color: color, + // $FlowFixMe + stop: absoluteStop + }; + }); + + var previousColorStop = absoluteValuedColorStops[0].stop; + for (var _i = 0; _i < absoluteValuedColorStops.length; _i++) { + if (previousColorStop !== null) { + var _stop2 = absoluteValuedColorStops[_i].stop; + if (_stop2 === null) { + var n = _i; + while (absoluteValuedColorStops[n].stop === null) { + n++; + } + var steps = n - _i + 1; + var nextColorStep = absoluteValuedColorStops[n].stop; + var stepSize = (nextColorStep - previousColorStop) / steps; + for (; _i < n; _i++) { + previousColorStop = absoluteValuedColorStops[_i].stop = previousColorStop + stepSize; + } + } else { + previousColorStop = _stop2; + } + } + } + + return absoluteValuedColorStops; +}; + +var parseLinearGradient = function parseLinearGradient(args, bounds, hasPrefix) { + var angle = (0, _Angle.parseAngle)(args[0]); + var HAS_SIDE_OR_CORNER = SIDE_OR_CORNER.test(args[0]); + var HAS_DIRECTION = HAS_SIDE_OR_CORNER || angle !== null || PERCENTAGE_ANGLES.test(args[0]); + var direction = HAS_DIRECTION ? angle !== null ? calculateGradientDirection( + // if there is a prefix, the 0° angle points due East (instead of North per W3C) + hasPrefix ? angle - Math.PI * 0.5 : angle, bounds) : HAS_SIDE_OR_CORNER ? parseSideOrCorner(args[0], bounds) : parsePercentageAngle(args[0], bounds) : calculateGradientDirection(Math.PI, bounds); + var firstColorStopIndex = HAS_DIRECTION ? 1 : 0; + + // TODO: Fix some inaccuracy with color stops with px values + var lineLength = Math.min((0, _Util.distance)(Math.abs(direction.x0) + Math.abs(direction.x1), Math.abs(direction.y0) + Math.abs(direction.y1)), bounds.width * 2, bounds.height * 2); + + return new LinearGradient(parseColorStops(args, firstColorStopIndex, lineLength), direction); +}; + +var parseRadialGradient = function parseRadialGradient(container, args, bounds) { + var m = args[0].match(RADIAL_SHAPE_DEFINITION); + var shape = m && (m[1] === 'circle' || // explicit shape specification + m[3] !== undefined && m[5] === undefined) // only one radius coordinate + ? RADIAL_GRADIENT_SHAPE.CIRCLE : RADIAL_GRADIENT_SHAPE.ELLIPSE; + var radius = {}; + var center = {}; + + if (m) { + // Radius + if (m[3] !== undefined) { + radius.x = (0, _Length.calculateLengthFromValueWithUnit)(container, m[3], m[4]).getAbsoluteValue(bounds.width); + } + + if (m[5] !== undefined) { + radius.y = (0, _Length.calculateLengthFromValueWithUnit)(container, m[5], m[6]).getAbsoluteValue(bounds.height); + } + + // Position + if (m[7]) { + center.x = LENGTH_FOR_POSITION[m[7].toLowerCase()]; + } else if (m[8] !== undefined) { + center.x = (0, _Length.calculateLengthFromValueWithUnit)(container, m[8], m[9]); + } + + if (m[10]) { + center.y = LENGTH_FOR_POSITION[m[10].toLowerCase()]; + } else if (m[11] !== undefined) { + center.y = (0, _Length.calculateLengthFromValueWithUnit)(container, m[11], m[12]); + } + } + + var gradientCenter = { + x: center.x === undefined ? bounds.width / 2 : center.x.getAbsoluteValue(bounds.width), + y: center.y === undefined ? bounds.height / 2 : center.y.getAbsoluteValue(bounds.height) + }; + var gradientRadius = calculateRadius(m && m[2] || 'farthest-corner', shape, gradientCenter, radius, bounds); + + return new RadialGradient(parseColorStops(args, m ? 1 : 0, Math.min(gradientRadius.x, gradientRadius.y)), shape, gradientCenter, gradientRadius); +}; + +var calculateGradientDirection = function calculateGradientDirection(radian, bounds) { + var width = bounds.width; + var height = bounds.height; + var HALF_WIDTH = width * 0.5; + var HALF_HEIGHT = height * 0.5; + var lineLength = Math.abs(width * Math.sin(radian)) + Math.abs(height * Math.cos(radian)); + var HALF_LINE_LENGTH = lineLength / 2; + + var x0 = HALF_WIDTH + Math.sin(radian) * HALF_LINE_LENGTH; + var y0 = HALF_HEIGHT - Math.cos(radian) * HALF_LINE_LENGTH; + var x1 = width - x0; + var y1 = height - y0; + + return { x0: x0, x1: x1, y0: y0, y1: y1 }; +}; + +var parseTopRight = function parseTopRight(bounds) { + return Math.acos(bounds.width / 2 / ((0, _Util.distance)(bounds.width, bounds.height) / 2)); +}; + +var parseSideOrCorner = function parseSideOrCorner(side, bounds) { + switch (side) { + case 'bottom': + case 'to top': + return calculateGradientDirection(0, bounds); + case 'left': + case 'to right': + return calculateGradientDirection(Math.PI / 2, bounds); + case 'right': + case 'to left': + return calculateGradientDirection(3 * Math.PI / 2, bounds); + case 'top right': + case 'right top': + case 'to bottom left': + case 'to left bottom': + return calculateGradientDirection(Math.PI + parseTopRight(bounds), bounds); + case 'top left': + case 'left top': + case 'to bottom right': + case 'to right bottom': + return calculateGradientDirection(Math.PI - parseTopRight(bounds), bounds); + case 'bottom left': + case 'left bottom': + case 'to top right': + case 'to right top': + return calculateGradientDirection(parseTopRight(bounds), bounds); + case 'bottom right': + case 'right bottom': + case 'to top left': + case 'to left top': + return calculateGradientDirection(2 * Math.PI - parseTopRight(bounds), bounds); + case 'top': + case 'to bottom': + default: + return calculateGradientDirection(Math.PI, bounds); + } +}; + +var parsePercentageAngle = function parsePercentageAngle(angle, bounds) { + var _angle$split$map = angle.split(' ').map(parseFloat), + _angle$split$map2 = _slicedToArray(_angle$split$map, 2), + left = _angle$split$map2[0], + top = _angle$split$map2[1]; + + var ratio = left / 100 * bounds.width / (top / 100 * bounds.height); + + return calculateGradientDirection(Math.atan(isNaN(ratio) ? 1 : ratio) + Math.PI / 2, bounds); +}; + +var findCorner = function findCorner(bounds, x, y, closest) { + var corners = [{ x: 0, y: 0 }, { x: 0, y: bounds.height }, { x: bounds.width, y: 0 }, { x: bounds.width, y: bounds.height }]; + + // $FlowFixMe + return corners.reduce(function (stat, corner) { + var d = (0, _Util.distance)(x - corner.x, y - corner.y); + if (closest ? d < stat.optimumDistance : d > stat.optimumDistance) { + return { + optimumCorner: corner, + optimumDistance: d + }; + } + + return stat; + }, { + optimumDistance: closest ? Infinity : -Infinity, + optimumCorner: null + }).optimumCorner; +}; + +var calculateRadius = function calculateRadius(extent, shape, center, radius, bounds) { + var x = center.x; + var y = center.y; + var rx = 0; + var ry = 0; + + switch (extent) { + case 'closest-side': + // The ending shape is sized so that that it exactly meets the side of the gradient box closest to the gradient’s center. + // If the shape is an ellipse, it exactly meets the closest side in each dimension. + if (shape === RADIAL_GRADIENT_SHAPE.CIRCLE) { + rx = ry = Math.min(Math.abs(x), Math.abs(x - bounds.width), Math.abs(y), Math.abs(y - bounds.height)); + } else if (shape === RADIAL_GRADIENT_SHAPE.ELLIPSE) { + rx = Math.min(Math.abs(x), Math.abs(x - bounds.width)); + ry = Math.min(Math.abs(y), Math.abs(y - bounds.height)); + } + break; + + case 'closest-corner': + // The ending shape is sized so that that it passes through the corner of the gradient box closest to the gradient’s center. + // If the shape is an ellipse, the ending shape is given the same aspect-ratio it would have if closest-side were specified. + if (shape === RADIAL_GRADIENT_SHAPE.CIRCLE) { + rx = ry = Math.min((0, _Util.distance)(x, y), (0, _Util.distance)(x, y - bounds.height), (0, _Util.distance)(x - bounds.width, y), (0, _Util.distance)(x - bounds.width, y - bounds.height)); + } else if (shape === RADIAL_GRADIENT_SHAPE.ELLIPSE) { + // Compute the ratio ry/rx (which is to be the same as for "closest-side") + var c = Math.min(Math.abs(y), Math.abs(y - bounds.height)) / Math.min(Math.abs(x), Math.abs(x - bounds.width)); + var corner = findCorner(bounds, x, y, true); + rx = (0, _Util.distance)(corner.x - x, (corner.y - y) / c); + ry = c * rx; + } + break; + + case 'farthest-side': + // Same as closest-side, except the ending shape is sized based on the farthest side(s) + if (shape === RADIAL_GRADIENT_SHAPE.CIRCLE) { + rx = ry = Math.max(Math.abs(x), Math.abs(x - bounds.width), Math.abs(y), Math.abs(y - bounds.height)); + } else if (shape === RADIAL_GRADIENT_SHAPE.ELLIPSE) { + rx = Math.max(Math.abs(x), Math.abs(x - bounds.width)); + ry = Math.max(Math.abs(y), Math.abs(y - bounds.height)); + } + break; + + case 'farthest-corner': + // Same as closest-corner, except the ending shape is sized based on the farthest corner. + // If the shape is an ellipse, the ending shape is given the same aspect ratio it would have if farthest-side were specified. + if (shape === RADIAL_GRADIENT_SHAPE.CIRCLE) { + rx = ry = Math.max((0, _Util.distance)(x, y), (0, _Util.distance)(x, y - bounds.height), (0, _Util.distance)(x - bounds.width, y), (0, _Util.distance)(x - bounds.width, y - bounds.height)); + } else if (shape === RADIAL_GRADIENT_SHAPE.ELLIPSE) { + // Compute the ratio ry/rx (which is to be the same as for "farthest-side") + var _c = Math.max(Math.abs(y), Math.abs(y - bounds.height)) / Math.max(Math.abs(x), Math.abs(x - bounds.width)); + var _corner = findCorner(bounds, x, y, false); + rx = (0, _Util.distance)(_corner.x - x, (_corner.y - y) / _c); + ry = _c * rx; + } + break; + + default: + // pixel or percentage values + rx = radius.x || 0; + ry = radius.y !== undefined ? radius.y : rx; + break; + } + + return { + x: rx, + y: ry + }; +}; + +var transformWebkitRadialGradientArgs = exports.transformWebkitRadialGradientArgs = function transformWebkitRadialGradientArgs(args) { + var shape = ''; + var radius = ''; + var extent = ''; + var position = ''; + var idx = 0; + + var POSITION = /^(left|center|right|\d+(?:px|r?em|%)?)(?:\s+(top|center|bottom|\d+(?:px|r?em|%)?))?$/i; + var SHAPE_AND_EXTENT = /^(circle|ellipse)?\s*(closest-side|closest-corner|farthest-side|farthest-corner|contain|cover)?$/i; + var RADIUS = /^\d+(px|r?em|%)?(?:\s+\d+(px|r?em|%)?)?$/i; + + var matchStartPosition = args[idx].match(POSITION); + if (matchStartPosition) { + idx++; + } + + var matchShapeExtent = args[idx].match(SHAPE_AND_EXTENT); + if (matchShapeExtent) { + shape = matchShapeExtent[1] || ''; + extent = matchShapeExtent[2] || ''; + if (extent === 'contain') { + extent = 'closest-side'; + } else if (extent === 'cover') { + extent = 'farthest-corner'; + } + idx++; + } + + var matchStartRadius = args[idx].match(RADIUS); + if (matchStartRadius) { + idx++; + } + + var matchEndPosition = args[idx].match(POSITION); + if (matchEndPosition) { + idx++; + } + + var matchEndRadius = args[idx].match(RADIUS); + if (matchEndRadius) { + idx++; + } + + var matchPosition = matchEndPosition || matchStartPosition; + if (matchPosition && matchPosition[1]) { + position = matchPosition[1] + (/^\d+$/.test(matchPosition[1]) ? 'px' : ''); + if (matchPosition[2]) { + position += ' ' + matchPosition[2] + (/^\d+$/.test(matchPosition[2]) ? 'px' : ''); + } + } + + var matchRadius = matchEndRadius || matchStartRadius; + if (matchRadius) { + radius = matchRadius[0]; + if (!matchRadius[1]) { + radius += 'px'; + } + } + + if (position && !shape && !radius && !extent) { + radius = position; + position = ''; + } + + if (position) { + position = 'at ' + position; + } + + return [[shape, extent, radius, position].filter(function (s) { + return !!s; + }).join(' ')].concat(args.slice(idx)); +}; + +var transformObsoleteColorStops = function transformObsoleteColorStops(args) { + return args.map(function (color) { + return color.match(FROM_TO_COLORSTOP); + }) + // $FlowFixMe + .map(function (v, index) { + if (!v) { + return args[index]; + } + + switch (v[1]) { + case 'from': + return v[4] + ' 0%'; + case 'to': + return v[4] + ' 100%'; + case 'color-stop': + if (v[3] === '%') { + return v[4] + ' ' + v[2]; + } + return v[4] + ' ' + parseFloat(v[2]) * 100 + '%'; + } + }); +}; + +/***/ }), +/* 53 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var ANGLE = /([+-]?\d*\.?\d+)(deg|grad|rad|turn)/i; + +var parseAngle = exports.parseAngle = function parseAngle(angle) { + var match = angle.match(ANGLE); + + if (match) { + var value = parseFloat(match[1]); + switch (match[2].toLowerCase()) { + case 'deg': + return Math.PI * value / 180; + case 'grad': + return Math.PI / 200 * value; + case 'rad': + return value; + case 'turn': + return Math.PI * 2 * value; + } + } + + return null; +}; + +/***/ }), +/* 54 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.cloneWindow = exports.DocumentCloner = undefined; + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _Bounds = __webpack_require__(2); + +var _Proxy = __webpack_require__(26); + +var _ResourceLoader = __webpack_require__(55); + +var _ResourceLoader2 = _interopRequireDefault(_ResourceLoader); + +var _Util = __webpack_require__(3); + +var _background = __webpack_require__(4); + +var _CanvasRenderer = __webpack_require__(15); + +var _CanvasRenderer2 = _interopRequireDefault(_CanvasRenderer); + +var _PseudoNodeContent = __webpack_require__(56); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var IGNORE_ATTRIBUTE = 'data-html2canvas-ignore'; + +var DocumentCloner = exports.DocumentCloner = function () { + function DocumentCloner(element, options, logger, copyInline, renderer) { + _classCallCheck(this, DocumentCloner); + + this.referenceElement = element; + this.scrolledElements = []; + this.copyStyles = copyInline; + this.inlineImages = copyInline; + this.logger = logger; + this.options = options; + this.renderer = renderer; + this.resourceLoader = new _ResourceLoader2.default(options, logger, window); + this.pseudoContentData = { + counters: {}, + quoteDepth: 0 + }; + // $FlowFixMe + this.documentElement = this.cloneNode(element.ownerDocument.documentElement); + } + + _createClass(DocumentCloner, [{ + key: 'inlineAllImages', + value: function inlineAllImages(node) { + var _this = this; + + if (this.inlineImages && node) { + var style = node.style; + Promise.all((0, _background.parseBackgroundImage)(style.backgroundImage).map(function (backgroundImage) { + if (backgroundImage.method === 'url') { + return _this.resourceLoader.inlineImage(backgroundImage.args[0]).then(function (img) { + return img && typeof img.src === 'string' ? 'url("' + img.src + '")' : 'none'; + }).catch(function (e) { + if (true) { + _this.logger.log('Unable to load image', e); + } + }); + } + return Promise.resolve('' + backgroundImage.prefix + backgroundImage.method + '(' + backgroundImage.args.join(',') + ')'); + })).then(function (backgroundImages) { + if (backgroundImages.length > 1) { + // TODO Multiple backgrounds somehow broken in Chrome + style.backgroundColor = ''; + } + style.backgroundImage = backgroundImages.join(','); + }); + + if (node instanceof HTMLImageElement) { + this.resourceLoader.inlineImage(node.src).then(function (img) { + if (img && node instanceof HTMLImageElement && node.parentNode) { + var parentNode = node.parentNode; + var clonedChild = (0, _Util.copyCSSStyles)(node.style, img.cloneNode(false)); + parentNode.replaceChild(clonedChild, node); + } + }).catch(function (e) { + if (true) { + _this.logger.log('Unable to load image', e); + } + }); + } + } + } + }, { + key: 'inlineFonts', + value: function inlineFonts(document) { + var _this2 = this; + + return Promise.all(Array.from(document.styleSheets).map(function (sheet) { + if (sheet.href) { + return fetch(sheet.href).then(function (res) { + return res.text(); + }).then(function (text) { + return createStyleSheetFontsFromText(text, sheet.href); + }).catch(function (e) { + if (true) { + _this2.logger.log('Unable to load stylesheet', e); + } + return []; + }); + } + return getSheetFonts(sheet, document); + })).then(function (fonts) { + return fonts.reduce(function (acc, font) { + return acc.concat(font); + }, []); + }).then(function (fonts) { + return Promise.all(fonts.map(function (font) { + return fetch(font.formats[0].src).then(function (response) { + return response.blob(); + }).then(function (blob) { + return new Promise(function (resolve, reject) { + var reader = new FileReader(); + reader.onerror = reject; + reader.onload = function () { + // $FlowFixMe + var result = reader.result; + resolve(result); + }; + reader.readAsDataURL(blob); + }); + }).then(function (dataUri) { + font.fontFace.setProperty('src', 'url("' + dataUri + '")'); + return '@font-face {' + font.fontFace.cssText + ' '; + }); + })); + }).then(function (fontCss) { + var style = document.createElement('style'); + style.textContent = fontCss.join('\n'); + _this2.documentElement.appendChild(style); + }); + } + }, { + key: 'createElementClone', + value: function createElementClone(node) { + var _this3 = this; + + if (this.copyStyles && node instanceof HTMLCanvasElement) { + var img = node.ownerDocument.createElement('img'); + try { + img.src = node.toDataURL(); + return img; + } catch (e) { + if (true) { + this.logger.log('Unable to clone canvas contents, canvas is tainted'); + } + } + } + + if (node instanceof HTMLIFrameElement) { + var tempIframe = node.cloneNode(false); + var iframeKey = generateIframeKey(); + tempIframe.setAttribute('data-html2canvas-internal-iframe-key', iframeKey); + + var _parseBounds = (0, _Bounds.parseBounds)(node, 0, 0), + width = _parseBounds.width, + height = _parseBounds.height; + + this.resourceLoader.cache[iframeKey] = getIframeDocumentElement(node, this.options).then(function (documentElement) { + return _this3.renderer(documentElement, { + async: _this3.options.async, + allowTaint: _this3.options.allowTaint, + backgroundColor: '#ffffff', + canvas: null, + imageTimeout: _this3.options.imageTimeout, + logging: _this3.options.logging, + proxy: _this3.options.proxy, + removeContainer: _this3.options.removeContainer, + scale: _this3.options.scale, + foreignObjectRendering: _this3.options.foreignObjectRendering, + useCORS: _this3.options.useCORS, + target: new _CanvasRenderer2.default(), + width: width, + height: height, + x: 0, + y: 0, + windowWidth: documentElement.ownerDocument.defaultView.innerWidth, + windowHeight: documentElement.ownerDocument.defaultView.innerHeight, + scrollX: documentElement.ownerDocument.defaultView.pageXOffset, + scrollY: documentElement.ownerDocument.defaultView.pageYOffset + }, _this3.logger.child(iframeKey)); + }).then(function (canvas) { + return new Promise(function (resolve, reject) { + var iframeCanvas = document.createElement('img'); + iframeCanvas.onload = function () { + return resolve(canvas); + }; + iframeCanvas.onerror = reject; + iframeCanvas.src = canvas.toDataURL(); + if (tempIframe.parentNode) { + tempIframe.parentNode.replaceChild((0, _Util.copyCSSStyles)(node.ownerDocument.defaultView.getComputedStyle(node), iframeCanvas), tempIframe); + } + }); + }); + return tempIframe; + } + + if (node instanceof HTMLStyleElement && node.sheet && node.sheet.cssRules) { + var css = [].slice.call(node.sheet.cssRules, 0).reduce(function (css, rule) { + try { + if (rule && rule.cssText) { + return css + rule.cssText; + } + return css; + } catch (err) { + _this3.logger.log('Unable to access cssText property', rule.name); + return css; + } + }, ''); + var style = node.cloneNode(false); + style.textContent = css; + return style; + } + + return node.cloneNode(false); + } + }, { + key: 'cloneNode', + value: function cloneNode(node) { + var clone = node.nodeType === Node.TEXT_NODE ? document.createTextNode(node.nodeValue) : this.createElementClone(node); + + var window = node.ownerDocument.defaultView; + var style = node instanceof window.HTMLElement ? window.getComputedStyle(node) : null; + var styleBefore = node instanceof window.HTMLElement ? window.getComputedStyle(node, ':before') : null; + var styleAfter = node instanceof window.HTMLElement ? window.getComputedStyle(node, ':after') : null; + + if (this.referenceElement === node && clone instanceof window.HTMLElement) { + this.clonedReferenceElement = clone; + } + + if (clone instanceof window.HTMLBodyElement) { + createPseudoHideStyles(clone); + } + + var counters = (0, _PseudoNodeContent.parseCounterReset)(style, this.pseudoContentData); + var contentBefore = (0, _PseudoNodeContent.resolvePseudoContent)(node, styleBefore, this.pseudoContentData); + + for (var child = node.firstChild; child; child = child.nextSibling) { + if (child.nodeType !== Node.ELEMENT_NODE || child.nodeName !== 'SCRIPT' && + // $FlowFixMe + !child.hasAttribute(IGNORE_ATTRIBUTE) && (typeof this.options.ignoreElements !== 'function' || + // $FlowFixMe + !this.options.ignoreElements(child))) { + if (!this.copyStyles || child.nodeName !== 'STYLE') { + clone.appendChild(this.cloneNode(child)); + } + } + } + + var contentAfter = (0, _PseudoNodeContent.resolvePseudoContent)(node, styleAfter, this.pseudoContentData); + (0, _PseudoNodeContent.popCounters)(counters, this.pseudoContentData); + + if (node instanceof window.HTMLElement && clone instanceof window.HTMLElement) { + if (styleBefore) { + this.inlineAllImages(inlinePseudoElement(node, clone, styleBefore, contentBefore, PSEUDO_BEFORE)); + } + if (styleAfter) { + this.inlineAllImages(inlinePseudoElement(node, clone, styleAfter, contentAfter, PSEUDO_AFTER)); + } + if (style && this.copyStyles && !(node instanceof HTMLIFrameElement)) { + (0, _Util.copyCSSStyles)(style, clone); + } + this.inlineAllImages(clone); + if (node.scrollTop !== 0 || node.scrollLeft !== 0) { + this.scrolledElements.push([clone, node.scrollLeft, node.scrollTop]); + } + switch (node.nodeName) { + case 'CANVAS': + if (!this.copyStyles) { + cloneCanvasContents(node, clone); + } + break; + case 'TEXTAREA': + case 'SELECT': + clone.value = node.value; + break; + } + } + return clone; + } + }]); + + return DocumentCloner; +}(); + +var getSheetFonts = function getSheetFonts(sheet, document) { + // $FlowFixMe + return (sheet.cssRules ? Array.from(sheet.cssRules) : []).filter(function (rule) { + return rule.type === CSSRule.FONT_FACE_RULE; + }).map(function (rule) { + var src = (0, _background.parseBackgroundImage)(rule.style.getPropertyValue('src')); + var formats = []; + for (var i = 0; i < src.length; i++) { + if (src[i].method === 'url' && src[i + 1] && src[i + 1].method === 'format') { + var a = document.createElement('a'); + a.href = src[i].args[0]; + if (document.body) { + document.body.appendChild(a); + } + + var font = { + src: a.href, + format: src[i + 1].args[0] + }; + formats.push(font); + } + } + + return { + // TODO select correct format for browser), + + formats: formats.filter(function (font) { + return (/^woff/i.test(font.format) + ); + }), + fontFace: rule.style + }; + }).filter(function (font) { + return font.formats.length; + }); +}; + +var createStyleSheetFontsFromText = function createStyleSheetFontsFromText(text, baseHref) { + var doc = document.implementation.createHTMLDocument(''); + var base = document.createElement('base'); + // $FlowFixMe + base.href = baseHref; + var style = document.createElement('style'); + + style.textContent = text; + if (doc.head) { + doc.head.appendChild(base); + } + if (doc.body) { + doc.body.appendChild(style); + } + + return style.sheet ? getSheetFonts(style.sheet, doc) : []; +}; + +var restoreOwnerScroll = function restoreOwnerScroll(ownerDocument, x, y) { + if (ownerDocument.defaultView && (x !== ownerDocument.defaultView.pageXOffset || y !== ownerDocument.defaultView.pageYOffset)) { + ownerDocument.defaultView.scrollTo(x, y); + } +}; + +var cloneCanvasContents = function cloneCanvasContents(canvas, clonedCanvas) { + try { + if (clonedCanvas) { + clonedCanvas.width = canvas.width; + clonedCanvas.height = canvas.height; + var ctx = canvas.getContext('2d'); + var clonedCtx = clonedCanvas.getContext('2d'); + if (ctx) { + clonedCtx.putImageData(ctx.getImageData(0, 0, canvas.width, canvas.height), 0, 0); + } else { + clonedCtx.drawImage(canvas, 0, 0); + } + } + } catch (e) {} +}; + +var inlinePseudoElement = function inlinePseudoElement(node, clone, style, contentItems, pseudoElt) { + if (!style || !style.content || style.content === 'none' || style.content === '-moz-alt-content' || style.display === 'none') { + return; + } + + var anonymousReplacedElement = clone.ownerDocument.createElement('html2canvaspseudoelement'); + (0, _Util.copyCSSStyles)(style, anonymousReplacedElement); + + if (contentItems) { + var len = contentItems.length; + for (var i = 0; i < len; i++) { + var item = contentItems[i]; + switch (item.type) { + case _PseudoNodeContent.PSEUDO_CONTENT_ITEM_TYPE.IMAGE: + var img = clone.ownerDocument.createElement('img'); + img.src = (0, _background.parseBackgroundImage)('url(' + item.value + ')')[0].args[0]; + img.style.opacity = '1'; + anonymousReplacedElement.appendChild(img); + break; + case _PseudoNodeContent.PSEUDO_CONTENT_ITEM_TYPE.TEXT: + anonymousReplacedElement.appendChild(clone.ownerDocument.createTextNode(item.value)); + break; + } + } + } + + anonymousReplacedElement.className = PSEUDO_HIDE_ELEMENT_CLASS_BEFORE + ' ' + PSEUDO_HIDE_ELEMENT_CLASS_AFTER; + clone.className += pseudoElt === PSEUDO_BEFORE ? ' ' + PSEUDO_HIDE_ELEMENT_CLASS_BEFORE : ' ' + PSEUDO_HIDE_ELEMENT_CLASS_AFTER; + if (pseudoElt === PSEUDO_BEFORE) { + clone.insertBefore(anonymousReplacedElement, clone.firstChild); + } else { + clone.appendChild(anonymousReplacedElement); + } + + return anonymousReplacedElement; +}; + +var URL_REGEXP = /^url\((.+)\)$/i; +var PSEUDO_BEFORE = ':before'; +var PSEUDO_AFTER = ':after'; +var PSEUDO_HIDE_ELEMENT_CLASS_BEFORE = '___html2canvas___pseudoelement_before'; +var PSEUDO_HIDE_ELEMENT_CLASS_AFTER = '___html2canvas___pseudoelement_after'; + +var PSEUDO_HIDE_ELEMENT_STYLE = '{\n content: "" !important;\n display: none !important;\n}'; + +var createPseudoHideStyles = function createPseudoHideStyles(body) { + createStyles(body, '.' + PSEUDO_HIDE_ELEMENT_CLASS_BEFORE + PSEUDO_BEFORE + PSEUDO_HIDE_ELEMENT_STYLE + '\n .' + PSEUDO_HIDE_ELEMENT_CLASS_AFTER + PSEUDO_AFTER + PSEUDO_HIDE_ELEMENT_STYLE); +}; + +var createStyles = function createStyles(body, styles) { + var style = body.ownerDocument.createElement('style'); + style.innerHTML = styles; + body.appendChild(style); +}; + +var initNode = function initNode(_ref) { + var _ref2 = _slicedToArray(_ref, 3), + element = _ref2[0], + x = _ref2[1], + y = _ref2[2]; + + element.scrollLeft = x; + element.scrollTop = y; +}; + +var generateIframeKey = function generateIframeKey() { + return Math.ceil(Date.now() + Math.random() * 10000000).toString(16); +}; + +var DATA_URI_REGEXP = /^data:text\/(.+);(base64)?,(.*)$/i; + +var getIframeDocumentElement = function getIframeDocumentElement(node, options) { + try { + return Promise.resolve(node.contentWindow.document.documentElement); + } catch (e) { + return options.proxy ? (0, _Proxy.Proxy)(node.src, options).then(function (html) { + var match = html.match(DATA_URI_REGEXP); + if (!match) { + return Promise.reject(); + } + + return match[2] === 'base64' ? window.atob(decodeURIComponent(match[3])) : decodeURIComponent(match[3]); + }).then(function (html) { + return createIframeContainer(node.ownerDocument, (0, _Bounds.parseBounds)(node, 0, 0)).then(function (cloneIframeContainer) { + var cloneWindow = cloneIframeContainer.contentWindow; + var documentClone = cloneWindow.document; + + documentClone.open(); + documentClone.write(html); + var iframeLoad = iframeLoader(cloneIframeContainer).then(function () { + return documentClone.documentElement; + }); + + documentClone.close(); + return iframeLoad; + }); + }) : Promise.reject(); + } +}; + +var createIframeContainer = function createIframeContainer(ownerDocument, bounds) { + var cloneIframeContainer = ownerDocument.createElement('iframe'); + + cloneIframeContainer.className = 'html2canvas-container'; + cloneIframeContainer.style.visibility = 'hidden'; + cloneIframeContainer.style.position = 'fixed'; + cloneIframeContainer.style.left = '-10000px'; + cloneIframeContainer.style.top = '0px'; + cloneIframeContainer.style.border = '0'; + cloneIframeContainer.width = bounds.width.toString(); + cloneIframeContainer.height = bounds.height.toString(); + cloneIframeContainer.scrolling = 'no'; // ios won't scroll without it + cloneIframeContainer.setAttribute(IGNORE_ATTRIBUTE, 'true'); + if (!ownerDocument.body) { + return Promise.reject( true ? 'Body element not found in Document that is getting rendered' : ''); + } + + ownerDocument.body.appendChild(cloneIframeContainer); + + return Promise.resolve(cloneIframeContainer); +}; + +var iframeLoader = function iframeLoader(cloneIframeContainer) { + var cloneWindow = cloneIframeContainer.contentWindow; + var documentClone = cloneWindow.document; + + return new Promise(function (resolve, reject) { + cloneWindow.onload = cloneIframeContainer.onload = documentClone.onreadystatechange = function () { + var interval = setInterval(function () { + if (documentClone.body.childNodes.length > 0 && documentClone.readyState === 'complete') { + clearInterval(interval); + resolve(cloneIframeContainer); + } + }, 50); + }; + }); +}; + +var cloneWindow = exports.cloneWindow = function cloneWindow(ownerDocument, bounds, referenceElement, options, logger, renderer) { + var cloner = new DocumentCloner(referenceElement, options, logger, false, renderer); + var scrollX = ownerDocument.defaultView.pageXOffset; + var scrollY = ownerDocument.defaultView.pageYOffset; + + return createIframeContainer(ownerDocument, bounds).then(function (cloneIframeContainer) { + var cloneWindow = cloneIframeContainer.contentWindow; + var documentClone = cloneWindow.document; + + /* Chrome doesn't detect relative background-images assigned in inline + )} + {customCss && } + + {enableProgress && } + {enableWebTitle && ( + + )} + + + +
    + {!headFocusOff && ( +
    + +
    + )} + +
    + + + {patternImg && ( +
    +
    +
    + )} + +
    + +
    +
    + +
    +
    +
    +
    +
    +
    + + + +
    +
    +
    +
    +
    + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    + +
    +
    + + {enableFish && ( + <> +
    + + + )} + + {stats && ( +
    + +
    + )} + + {enableCanvas && ( + + )} + + {enableProgress && ( + + )} + +
    + + {/* 注入原主题在 wp_localize_script('app','Poi',...) 中提供的全局变量。 + 缺它会让 app.js 在 Siren.AH() 抛 ReferenceError, + 导致菜单/搜索/表情等事件都注册不上。 */} + + + + + {askyOption('post_share') === 'yes' && ( + + )} + + diff --git a/src/lib/options.ts b/src/lib/options.ts new file mode 100644 index 0000000..92decf2 --- /dev/null +++ b/src/lib/options.ts @@ -0,0 +1,43 @@ +import config from '../../asky.config'; +import type { AskyConfig } from '../../asky.config'; + +/** + * 等价于原 WordPress 主题 `akina_option($id, $default)`: + * - 从 asky.config.ts 中读取对应 key 的值; + * - 如果未设置(undefined/null),返回 `defaultValue`。 + * + * 用法: + * askyOption('admin_des'); + * askyOption('feature1_title', 'feature1'); + */ +export function askyOption( + id: K, + defaultValue?: AskyConfig[K] +): AskyConfig[K] { + const value = config[id]; + if (value === undefined || value === null || value === '') { + return (defaultValue ?? value) as AskyConfig[K]; + } + return value; +} + +/** 直接读取整个配置 */ +export function getConfig(): AskyConfig { + return config; +} + +/** 等价于 PHP `bloginfo($field)` */ +export function bloginfo(field: 'name' | 'description' | 'url' | 'charset' | 'language'): string { + return config.site[field] ?? ''; +} + +/** 把 PHP 主题中常见的 0/1/'0'/'1' 字符串都视作 falsy */ +export function isOptionOn(id: keyof AskyConfig): boolean { + const v = config[id] as unknown; + if (v === true) return true; + if (v === false || v === '' || v === '0' || v === 0 || v === null || v === undefined) return false; + return Boolean(v); +} + +export { config }; +export type { AskyConfig }; diff --git a/src/pages/404.astro b/src/pages/404.astro new file mode 100644 index 0000000..e306523 --- /dev/null +++ b/src/pages/404.astro @@ -0,0 +1,37 @@ +--- +import { bloginfo } from '../lib/options'; + +const lang = bloginfo('language'); +const charset = bloginfo('charset'); +const siteName = bloginfo('name'); +--- + + + + + + + 404 - {siteName} + + + + +
    +
    施主,您要取的经书404了
    + +
    +
    +
    +
    +
    +
      +
    • +
    • +
    +
    +
    + + diff --git a/src/pages/archive.astro b/src/pages/archive.astro new file mode 100644 index 0000000..a7bc289 --- /dev/null +++ b/src/pages/archive.astro @@ -0,0 +1,56 @@ +--- +import BaseLayout from '../layouts/BaseLayout.astro'; +import Header from '../components/Header.astro'; +import Imgbox from '../components/Imgbox.astro'; +import MobileNav from '../components/MobileNav.astro'; +import { getCollection } from 'astro:content'; +import { isOptionOn } from '../lib/options'; + +const all = (await getCollection('posts')).sort( + (a, b) => b.data.date.getTime() - a.data.date.getTime() +); + +const groups = new Map(); +for (const p of all) { + const key = `${p.data.date.getFullYear()}-${String(p.data.date.getMonth() + 1).padStart(2, '0')}`; + if (!groups.has(key)) groups.set(key, []); + groups.get(key)!.push(p); +} +const sortedKeys = [...groups.keys()].sort((a, b) => b.localeCompare(a)); +const showHeader = isOptionOn('patternimg'); +--- + + + +
    + + +
    +
    + {showHeader && ( + + )} + +
    + {sortedKeys.map((key) => ( +
    +

    {key}

    + +
    + ))} +
    +
    +
    + diff --git a/src/pages/index.astro b/src/pages/index.astro new file mode 100644 index 0000000..7758f9e --- /dev/null +++ b/src/pages/index.astro @@ -0,0 +1,67 @@ +--- +import BaseLayout from '../layouts/BaseLayout.astro'; +import Header from '../components/Header.astro'; +import Imgbox from '../components/Imgbox.astro'; +import Notice from '../components/Notice.astro'; +import Feature from '../components/Feature.astro'; +import PostListThumb from '../components/PostListThumb.astro'; +import PostList from '../components/PostList.astro'; +import MobileNav from '../components/MobileNav.astro'; +import { askyOption, isOptionOn } from '../lib/options'; +import { getCollection } from 'astro:content'; + +const all = (await getCollection('posts')).sort( + (a, b) => b.data.date.getTime() - a.data.date.getTime() +); + +const items = all.map((p) => ({ + id: p.id, + permalink: `/posts/${p.slug}`, + title: p.data.title, + date: p.data.date.toISOString(), + excerpt: p.data.description ?? p.body.replace(/[#*`>_\[\]\(\)]/g, '').slice(0, 280), + thumbnail: p.data.thumbnail, + sticky: p.data.sticky +})); + +const showFeature = isOptionOn('top_feature'); +const style = askyOption('post_list_style'); +const isAjax = askyOption('pagenav_style') === 'ajax'; +const autoLoad = askyOption('auto_load_post'); +--- + + + +
    + + + + {showFeature && } + +
    +
    +

    + Posts +

    + {style === 'standard' ? : } +
    + + {isAjax ? ( + <> + +
    + +
    + + ) : ( + + )} +
    + diff --git a/src/pages/posts/[slug].astro b/src/pages/posts/[slug].astro new file mode 100644 index 0000000..821c9a5 --- /dev/null +++ b/src/pages/posts/[slug].astro @@ -0,0 +1,86 @@ +--- +import BaseLayout from '../../layouts/BaseLayout.astro'; +import Header from '../../components/Header.astro'; +import Imgbox from '../../components/Imgbox.astro'; +import MobileNav from '../../components/MobileNav.astro'; +import AuthorProfile from '../../components/AuthorProfile.astro'; +import PostNextPrev from '../../components/PostNextPrev.astro'; +import ShareLike from '../../components/ShareLike.astro'; +import Comments from '../../components/Comments.astro'; +import { isOptionOn } from '../../lib/options'; +import { getCollection } from 'astro:content'; + +export async function getStaticPaths() { + const all = (await getCollection('posts')).sort( + (a, b) => b.data.date.getTime() - a.data.date.getTime() + ); + return all.map((post, i) => ({ + params: { slug: post.slug }, + props: { + post, + prev: all[i + 1] + ? { url: `/posts/${all[i + 1].slug}`, title: all[i + 1].data.title, thumbnail: all[i + 1].data.thumbnail } + : undefined, + next: all[i - 1] + ? { url: `/posts/${all[i - 1].slug}`, title: all[i - 1].data.title, thumbnail: all[i - 1].data.thumbnail } + : undefined + } + })); +} + +const { post, prev, next } = Astro.props; +const { Content } = await post.render(); + +const showPattern = isOptionOn('patternimg'); +const buildTime = post.data.date.toLocaleString('zh-CN'); +const tags = post.data.tags ?? []; +const fullUrl = new URL(`/posts/${post.slug}`, Astro.site ?? 'https://example.com').toString(); +--- + + + +
    + + +
    +
    + + + + + +
    +
    + diff --git a/src/pages/search.astro b/src/pages/search.astro new file mode 100644 index 0000000..2be4acc --- /dev/null +++ b/src/pages/search.astro @@ -0,0 +1,75 @@ +--- +import BaseLayout from '../layouts/BaseLayout.astro'; +import Header from '../components/Header.astro'; +import Imgbox from '../components/Imgbox.astro'; +import MobileNav from '../components/MobileNav.astro'; +import { getCollection } from 'astro:content'; + +const q = (Astro.url.searchParams.get('s') ?? '').trim().toLowerCase(); +const all = await getCollection('posts'); +const results = q + ? all.filter((p) => + p.data.title.toLowerCase().includes(q) || + p.body.toLowerCase().includes(q) || + (p.data.description ?? '').toLowerCase().includes(q) + ) + : []; +--- + + + +
    + + +
    +
    + {q ? ( + results.length > 0 ? ( + <> + + {results.map((p) => ( +
    +
    +

    + {p.data.title} +

    + +
    +
    +

    {p.data.description ?? p.body.slice(0, 200)}

    +
    +
    + ))} + + ) : ( +
    + +
    +

    没有找到你想要的,看看其他的吧。

    +
    + +
    +
    +
    + ) + ) : ( + + )} +
    +
    + diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..629cbe3 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,13 @@ +{ + "extends": "astro/tsconfigs/strict", + "compilerOptions": { + "baseUrl": ".", + "paths": { + "~/*": ["./src/*"], + "@config": ["./asky.config.ts"] + }, + "allowImportingTsExtensions": false + }, + "include": ["./src/**/*", "./asky.config.ts", "./astro.config.mjs"], + "exclude": ["dist", "node_modules"] +}