diff --git a/.obsidian/plugins/obsidian-webpage-export-master/.dockerignore b/.obsidian/plugins/obsidian-webpage-export-master/.dockerignore deleted file mode 100644 index fcfee77b..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/.dockerignore +++ /dev/null @@ -1,37 +0,0 @@ -# vscode -.vscode - -# Intellij -*.iml -.idea - -# npm -node_modules - -# Don't include the compiled main.js file in the repo. -# They should be uploaded to GitHub releases instead. -main.js - -# Exclude sourcemaps -*.map - -# obsidian -data.json - -# Exclude macOS Finder (System Explorer) View States -.DS_Store - -webpage-html-export.zip -app-styles.css -webpage-html-export.code-workspace - -*.bat - -build -dist - - -todo.txt -Dockerfile -vault/ -output/ diff --git a/.obsidian/plugins/obsidian-webpage-export-master/.editorconfig b/.obsidian/plugins/obsidian-webpage-export-master/.editorconfig deleted file mode 100644 index 5fd185c8..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/.editorconfig +++ /dev/null @@ -1,10 +0,0 @@ -# top-most EditorConfig file -root = true - -[*] -charset = utf-8 -end_of_line = lf -insert_final_newline = true -indent_style = tab -indent_size = 4 -tab_width = 4 \ No newline at end of file diff --git a/.obsidian/plugins/obsidian-webpage-export-master/.eslintignore b/.obsidian/plugins/obsidian-webpage-export-master/.eslintignore deleted file mode 100644 index 32909b2e..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/.eslintignore +++ /dev/null @@ -1,2 +0,0 @@ -npm node_modules -build \ No newline at end of file diff --git a/.obsidian/plugins/obsidian-webpage-export-master/.eslintrc b/.obsidian/plugins/obsidian-webpage-export-master/.eslintrc deleted file mode 100644 index 08072905..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/.eslintrc +++ /dev/null @@ -1,23 +0,0 @@ -{ - "root": true, - "parser": "@typescript-eslint/parser", - "env": { "node": true }, - "plugins": [ - "@typescript-eslint" - ], - "extends": [ - "eslint:recommended", - "plugin:@typescript-eslint/eslint-recommended", - "plugin:@typescript-eslint/recommended" - ], - "parserOptions": { - "sourceType": "module" - }, - "rules": { - "no-unused-vars": "off", - "@typescript-eslint/no-unused-vars": ["error", { "args": "none" }], - "@typescript-eslint/ban-ts-comment": "off", - "no-prototype-builtins": "off", - "@typescript-eslint/no-empty-function": "off" - } - } \ No newline at end of file diff --git a/.obsidian/plugins/obsidian-webpage-export-master/.github/FUNDING.yml b/.obsidian/plugins/obsidian-webpage-export-master/.github/FUNDING.yml deleted file mode 100644 index 8c23da0e..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/.github/FUNDING.yml +++ /dev/null @@ -1,13 +0,0 @@ -# These are supported funding model platforms - -github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] -patreon: # Replace with a single Patreon username -open_collective: # Replace with a single Open Collective username -ko_fi: # Replace with a single Ko-fi username -tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel -community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry -liberapay: # Replace with a single Liberapay username -issuehunt: # Replace with a single IssueHunt username -otechie: # Replace with a single Otechie username -lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry -custom: ['https://www.buymeacoffee.com/nathangeorge', 'https://www.paypal.com/donate/?business=HHQBAXQQXT84Q&no_recurring=0&item_name=Hey+%F0%9F%91%8B+I+am+a+Computer+Science+student+working+on+Obsidian+plugins.+Thanks+for+your+support%21¤cy_code=USD'] diff --git a/.obsidian/plugins/obsidian-webpage-export-master/.github/ISSUE_TEMPLATE/bug.yml b/.obsidian/plugins/obsidian-webpage-export-master/.github/ISSUE_TEMPLATE/bug.yml deleted file mode 100644 index 2c63f4b7..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/.github/ISSUE_TEMPLATE/bug.yml +++ /dev/null @@ -1,74 +0,0 @@ -name: Bug Report -description: File a bug report -title: "[Bug]: " -labels: ["bug"] -body: - - type: markdown - attributes: - value: | - Thanks for taking the time to fill out this bug report! - - type: textarea - id: what-happened - attributes: - label: What happened? - description: Also what did you expect to happen? - validations: - required: true - - type: textarea - id: reproduction - attributes: - label: Reproduction - description: Give detailed instructions to reproduce this problem - validations: - required: true - - type: input - id: last-working - attributes: - label: Last Working Version - description: Did this work in a previous version of the plugin? If so which one? - - type: input - id: version - attributes: - label: Version - description: What version of the plugin are you using? - validations: - required: true - - type: input - id: os - attributes: - label: Operating System - validations: - required: true - - type: input - id: ob-version - attributes: - label: Obsidian Version - description: What **current version** and **installer version** is shown in obsidian\'s general settings. - validations: - required: true - - type: dropdown - id: browsers - attributes: - label: Which browsers can you reproduce this in? - description: (optional) - multiple: true - options: - - Firefox - - Chrome - - Chrome IOS - - Safari - - Safari IOS - - Microsoft Edge - - type: textarea - id: logs - attributes: - label: Relevant log output - description: Please click the debug info button in the plugin settings and paste here. (If this is not relevant put N/A) - render: yaml - validations: - required: true - - type: textarea - id: additional - attributes: - label: Additional Info - description: If relevant please include a screenshot of the developer log `Ctrl + Shift + i` diff --git a/.obsidian/plugins/obsidian-webpage-export-master/.github/ISSUE_TEMPLATE/config.yml b/.obsidian/plugins/obsidian-webpage-export-master/.github/ISSUE_TEMPLATE/config.yml deleted file mode 100644 index 9baff7d9..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/.github/ISSUE_TEMPLATE/config.yml +++ /dev/null @@ -1,5 +0,0 @@ -blank_issues_enabled=false -contact_links: - - name: GitHub Disscussions - url: https://github.com/KosmosisDire/obsidian-webpage-export/discussions - about: If you have a question or need help please use create a discussion. Only create an issue for bugs or feature requests. diff --git a/.obsidian/plugins/obsidian-webpage-export-master/.github/ISSUE_TEMPLATE/feature_request.md b/.obsidian/plugins/obsidian-webpage-export-master/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index 11fc491e..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for this project -title: '' -labels: enhancement -assignees: '' - ---- - -**Is your feature request related to a problem? Please describe.** -A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] - -**Describe the solution you'd like** -A clear and concise description of what you want to happen. - -**Describe alternatives you've considered** -A clear and concise description of any alternative solutions or features you've considered. - -**Additional context** -Add any other context or screenshots about the feature request here. diff --git a/.obsidian/plugins/obsidian-webpage-export-master/.github/workflows/beta-autoreply.yaml b/.obsidian/plugins/obsidian-webpage-export-master/.github/workflows/beta-autoreply.yaml deleted file mode 100644 index 2986d2ed..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/.github/workflows/beta-autoreply.yaml +++ /dev/null @@ -1,100 +0,0 @@ -name: Autoreply to Bug Issues -on: - issues: - types: [opened] -jobs: - autoreply-to-bugs: - runs-on: ubuntu-latest - permissions: - issues: write - steps: - - name: Check and Respond to Bug Issues - uses: actions/github-script@v6 - with: - github-token: ${{secrets.GITHUB_TOKEN}} - script: | - const issueBody = context.payload.issue.body; - const issueTitle = context.payload.issue.title; - - // Check if it's a bug issue - if (!issueTitle.toLowerCase().includes('[bug]')) { - console.log('Not a bug issue. Skipping.'); - return; - } - - console.log('Processing bug issue:', issueTitle); - - // Extract version from the issue body - const versionMatch = issueBody ? issueBody.match(/### Version\s*([0-9.b-]+)/) : null; - if (!versionMatch) { - console.log('Version not specified in the issue. Skipping response.'); - return; - } - - const reportedVersion = versionMatch[1]; - console.log('Reported version:', reportedVersion); - - // Fetch the latest beta release - const releases = await github.rest.repos.listReleases({ - owner: context.repo.owner, - repo: context.repo.repo - }); - - const latestBeta = releases.data.find(release => release.prerelease); - if (!latestBeta) { - console.log('No beta release found. Skipping response.'); - return; - } - - const latestBetaVersion = latestBeta.tag_name.replace(/^v/, ''); - console.log('Latest beta version:', latestBetaVersion); - - // Compare versions - if (compareVersions(reportedVersion, latestBetaVersion) >= 0) { - console.log('Reported version is latest or newer. No response needed.'); - return; - } - - // Respond to the issue - const response = `Thank you for reporting this issue. It is possible this issue has already been solved in the latest beta version.\nPlease try updating to the latest beta version of the plugin (${latestBetaVersion}) and see if the issue persists.\n\nYou can find the latest beta release here: ${latestBeta.html_url}.\nInstructions for installing are located in the readme.\n\nIf the problem continues after updating, please let us know, and we'll investigate further.`; - - await github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: response - }); - - console.log('Response posted successfully.'); - - // Updated version comparison function - function compareVersions(v1, v2) { - const parts1 = v1.split(/[.-]/).map(part => isNaN(part) ? part : parseInt(part)); - const parts2 = v2.split(/[.-]/).map(part => isNaN(part) ? part : parseInt(part)); - - const isV1Beta = parts1.some(part => typeof part === 'string' && part.toLowerCase().includes('b')); - const isV2Beta = parts2.some(part => typeof part === 'string' && part.toLowerCase().includes('b')); - - // If one is beta and the other is not, the non-beta version is newer - if (isV1Beta && !isV2Beta) return -1; - if (!isV1Beta && isV2Beta) return 1; - - for (let i = 0; i < Math.max(parts1.length, parts2.length); i++) { - const part1 = parts1[i] || 0; - const part2 = parts2[i] || 0; - - if (part1 === part2) continue; - - if (typeof part1 === 'string' && typeof part2 === 'string') { - return part1.localeCompare(part2); - } else if (typeof part1 === 'string') { - return 1; // Consider string (beta) as newer within same version number - } else if (typeof part2 === 'string') { - return -1; // Consider string (beta) as newer within same version number - } else { - return part1 < part2 ? -1 : 1; - } - } - - return 0; - } diff --git a/.obsidian/plugins/obsidian-webpage-export-master/.github/workflows/beta-release.yaml b/.obsidian/plugins/obsidian-webpage-export-master/.github/workflows/beta-release.yaml deleted file mode 100644 index 276a725a..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/.github/workflows/beta-release.yaml +++ /dev/null @@ -1,118 +0,0 @@ -name: Release Plugin Beta - -on: - push: - tags: - - "*b" - -env: - PLUGIN_NAME: webpage-html-export # Change this to match the id of your plugin. - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Use Node.js - uses: actions/setup-node@v1 - with: - node-version: "20.x" - - - name: Build - id: build - run: | - npm install - npm run build - mkdir ${{ env.PLUGIN_NAME }} - cp main.js manifest.json styles.css ${{ env.PLUGIN_NAME }} - zip -r ${{ env.PLUGIN_NAME }}.zip ${{ env.PLUGIN_NAME }} - ls - echo "::set-output name=tag_name::$(git tag --sort version:refname | tail -n 1)" - - - name: Create Release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - VERSION: ${{ github.ref }} - with: - tag_name: ${{ github.ref }} - release_name: ${{ github.ref }} - draft: false - prerelease: true - - - name: Upload zip file - id: upload-zip - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./${{ env.PLUGIN_NAME }}.zip - asset_name: ${{ env.PLUGIN_NAME }}-${{ steps.build.outputs.tag_name }}.zip - asset_content_type: application/zip - - - name: Upload main.js - id: upload-main - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./main.js - asset_name: main.js - asset_content_type: text/javascript - - - name: Upload manifest.json - id: upload-manifest - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./manifest.json - asset_name: manifest.json - asset_content_type: application/json - - - name: Upload styles.css - id: upload-css - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./styles.css - asset_name: styles.css - asset_content_type: text/css - - docker-image: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - name: Get the version - id: get_version - run: echo ::set-output name=tag_name::$(git tag --sort version:refname | tail -n 1) - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Login to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_TOKEN }} - - - name: Build and push - uses: docker/build-push-action@v4 - with: - platforms: linux/arm64,linux/amd64 - push: true - tags: KosmosisDire/obsidian-webpage-export:beta , KosmosisDire/obsidian-webpage-export:${{ steps.get_version.outputs.tag_name }} - cache-from: type=gha - cache-to: type=gha,mode=max diff --git a/.obsidian/plugins/obsidian-webpage-export-master/.github/workflows/issue-link-label.yaml b/.obsidian/plugins/obsidian-webpage-export-master/.github/workflows/issue-link-label.yaml deleted file mode 100644 index a242e040..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/.github/workflows/issue-link-label.yaml +++ /dev/null @@ -1,82 +0,0 @@ -name: Label Issues with Links - -on: - issues: - types: [opened, edited] - -jobs: - label-issues-with-links: - runs-on: ubuntu-latest - permissions: - issues: write - - steps: - - name: Check for Links and Label Issue - uses: actions/github-script@v6 - with: - github-token: ${{secrets.GITHUB_TOKEN}} - script: | - const issueBody = context.payload.issue.body; - const issueNumber = context.issue.number; - - console.log(`Processing issue #${issueNumber}`); - - // Regular expression to match URLs - const urlRegex = /https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)/gi; - - if (issueBody && urlRegex.test(issueBody)) { - console.log('Link detected in the issue body'); - - try { - await github.rest.issues.addLabels({ - issue_number: issueNumber, - owner: context.repo.owner, - repo: context.repo.repo, - labels: ['has-link'] - }); - console.log('Added "has-link" label to the issue'); - } catch (error) { - if (error.status === 404) { - console.log('Label "has-link" does not exist. Creating it...'); - await github.rest.issues.createLabel({ - owner: context.repo.owner, - repo: context.repo.repo, - name: 'has-link', - color: '0366d6' // You can change this color code as needed - }); - - await github.rest.issues.addLabels({ - issue_number: issueNumber, - owner: context.repo.owner, - repo: context.repo.repo, - labels: ['has-link'] - }); - console.log('Created "has-link" label and added it to the issue'); - } else { - console.error('Error adding label:', error); - } - } - } else { - console.log('No link detected in the issue body'); - - // Check if the label exists and remove it if it does - try { - const labels = await github.rest.issues.listLabelsOnIssue({ - issue_number: issueNumber, - owner: context.repo.owner, - repo: context.repo.repo - }); - - if (labels.data.some(label => label.name === 'has-link')) { - await github.rest.issues.removeLabel({ - issue_number: issueNumber, - owner: context.repo.owner, - repo: context.repo.repo, - name: 'has-link' - }); - console.log('Removed "has-link" label from the issue'); - } - } catch (error) { - console.error('Error checking or removing label:', error); - } - } diff --git a/.obsidian/plugins/obsidian-webpage-export-master/.github/workflows/issue-version-all.yaml b/.obsidian/plugins/obsidian-webpage-export-master/.github/workflows/issue-version-all.yaml deleted file mode 100644 index beaba5bc..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/.github/workflows/issue-version-all.yaml +++ /dev/null @@ -1,83 +0,0 @@ -name: Update All Existing Issue Titles - -on: - workflow_dispatch: - -jobs: - update-issue-titles: - runs-on: ubuntu-latest - permissions: - issues: write - - steps: - - name: Update All Issue Titles - uses: actions/github-script@v6 - with: - github-token: ${{secrets.GITHUB_TOKEN}} - script: | - const perPage = 100; - let page = 1; - let allIssues = []; - - // Fetch all issues - while (true) { - const issues = await github.rest.issues.listForRepo({ - owner: context.repo.owner, - repo: context.repo.repo, - state: 'all', - per_page: perPage, - page: page - }); - - allIssues = allIssues.concat(issues.data); - - if (issues.data.length < perPage) break; - page++; - } - - console.log(`Total issues found: ${allIssues.length}`); - - for (const issue of allIssues) { - const currentTitle = issue.title; - - // Check if the title starts with [Bug] and doesn't already have a version - if (currentTitle.trim().toLowerCase().startsWith('[bug]') && - !currentTitle.match(/^\[Bug\]\s*\[[^\]]+\]/i)) { - - console.log(`Processing issue #${issue.number}: "${currentTitle}"`); - - // Extract version from the issue body, handling null case - let version = 'unknown'; - if (issue.body) { - const versionMatch = issue.body.match(/### Version\s*([0-9.b-]+)/); - if (versionMatch) { - version = versionMatch[1]; - } - } else { - console.log(`Issue #${issue.number} has no body`); - } - - // Remove any existing version tag if present and add new tags - let newTitle = currentTitle.replace(/^\[Bug\]\s*/i, '').trim(); - newTitle = `[Bug] [${version}]${newTitle}`; - - console.log(`New title: "${newTitle}"`); - - try { - await github.rest.issues.update({ - issue_number: issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - title: newTitle - }); - console.log(`Successfully updated issue #${issue.number}`); - } catch (error) { - console.error(`Failed to update issue #${issue.number}`); - console.error(error); - } - } else { - console.log(`Skipping issue #${issue.number}: "${currentTitle}" (already formatted or not a bug)`); - } - } - - console.log('Finished processing all issues'); diff --git a/.obsidian/plugins/obsidian-webpage-export-master/.github/workflows/issue-version.yaml b/.obsidian/plugins/obsidian-webpage-export-master/.github/workflows/issue-version.yaml deleted file mode 100644 index e3c48936..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/.github/workflows/issue-version.yaml +++ /dev/null @@ -1,57 +0,0 @@ -name: Update Issue Title with Version - -on: - issues: - types: [opened] - -jobs: - update-issue-title: - runs-on: ubuntu-latest - permissions: - issues: write - - steps: - - name: Update Issue Title - uses: actions/github-script@v6 - with: - github-token: ${{secrets.GITHUB_TOKEN}} - script: | - const issueNumber = context.issue.number; - const issueBody = context.payload.issue.body; - - console.log('Extracting version from issue body...'); - - // Extract version from the issue body - const versionMatch = issueBody.match(/### Version\s*([0-9.b-]+)/); - const version = versionMatch ? versionMatch[1] : 'unknown'; - - console.log(`Extracted version: ${version}`); - - const currentTitle = context.payload.issue.title; - console.log(`Current title: "${currentTitle}"`); - - // Check if the title starts with [Bug] - if (currentTitle.trim().toLowerCase().startsWith('[bug]')) { - // Remove any existing version tag if present - let newTitle = currentTitle.replace(/^\[Bug\]\s*(\[[^\]]+\]\s*)?/i, '').trim(); - // Add [Bug] and [version] tags with a colon - newTitle = `[Bug] [${version}]${newTitle}`; - - console.log(`New title: "${newTitle}"`); - - try { - await github.rest.issues.update({ - issue_number: issueNumber, - owner: context.repo.owner, - repo: context.repo.repo, - title: newTitle - }); - console.log('Successfully updated issue title'); - } catch (error) { - console.error('Failed to update issue title'); - console.error(error); - core.setFailed('Failed to update issue title'); - } - } else { - console.log('Title does not start with [Bug]. No changes made.'); - } diff --git a/.obsidian/plugins/obsidian-webpage-export-master/.github/workflows/release.yaml b/.obsidian/plugins/obsidian-webpage-export-master/.github/workflows/release.yaml deleted file mode 100644 index 6b13be24..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/.github/workflows/release.yaml +++ /dev/null @@ -1,119 +0,0 @@ -name: Release Obsidian plugin - -on: - push: - tags: - - "*" - - "!*b" - -env: - PLUGIN_NAME: webpage-html-export # Change this to match the id of your plugin. - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Use Node.js - uses: actions/setup-node@v1 - with: - node-version: "14.x" - - - name: Build - id: build - run: | - npm install - npm run build - mkdir ${{ env.PLUGIN_NAME }} - cp main.js manifest.json styles.css ${{ env.PLUGIN_NAME }} - zip -r ${{ env.PLUGIN_NAME }}.zip ${{ env.PLUGIN_NAME }} - ls - echo "::set-output name=tag_name::$(git tag --sort version:refname | tail -n 1)" - - - name: Create Release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - VERSION: ${{ github.ref }} - with: - tag_name: ${{ github.ref }} - release_name: ${{ github.ref }} - draft: false - prerelease: false - - - name: Upload zip file - id: upload-zip - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./${{ env.PLUGIN_NAME }}.zip - asset_name: ${{ env.PLUGIN_NAME }}-${{ steps.build.outputs.tag_name }}.zip - asset_content_type: application/zip - - - name: Upload main.js - id: upload-main - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./main.js - asset_name: main.js - asset_content_type: text/javascript - - - name: Upload manifest.json - id: upload-manifest - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./manifest.json - asset_name: manifest.json - asset_content_type: application/json - - - name: Upload styles.css - id: upload-css - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./styles.css - asset_name: styles.css - asset_content_type: text/css - - docker-image: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - name: Get the version - id: get_version - run: echo ::set-output name=tag_name::$(git tag --sort version:refname | tail -n 1) - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Login to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_TOKEN }} - - - name: Build and push - uses: docker/build-push-action@v4 - with: - platforms: linux/arm64,linux/amd64 - push: true - tags: KosmosisDire/obsidian-webpage-export:latest , KosmosisDire/obsidian-webpage-export:${{ steps.get_version.outputs.tag_name }} - cache-from: type=gha - cache-to: type=gha,mode=max diff --git a/.obsidian/plugins/obsidian-webpage-export-master/.gitignore b/.obsidian/plugins/obsidian-webpage-export-master/.gitignore deleted file mode 100644 index 75735c5b..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/.gitignore +++ /dev/null @@ -1,36 +0,0 @@ -# vscode -.vscode - -# Intellij -*.iml -.idea - -# npm -node_modules - -# Don't include the compiled main.js file in the repo. -# They should be uploaded to GitHub releases instead. -main.js - -# Exclude sourcemaps -*.map - -# obsidian -data.json - -# Exclude macOS Finder (System Explorer) View States -.DS_Store - -webpage-html-export.zip -app-styles.css -webpage-html-export.code-workspace - -*.bat - -build -dist - - -todo.txt -vault/ -output/ diff --git a/.obsidian/plugins/obsidian-webpage-export-master/.npmrc b/.obsidian/plugins/obsidian-webpage-export-master/.npmrc deleted file mode 100644 index b9737525..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/.npmrc +++ /dev/null @@ -1 +0,0 @@ -tag-version-prefix="" \ No newline at end of file diff --git a/.obsidian/plugins/obsidian-webpage-export-master/Dockerfile b/.obsidian/plugins/obsidian-webpage-export-master/Dockerfile deleted file mode 100644 index 39f0b558..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/Dockerfile +++ /dev/null @@ -1,51 +0,0 @@ -FROM node:16-alpine AS Build - -# copy the assets and source code -COPY . /app -WORKDIR /app - -# install dependencies -RUN npm install - -# build the app -RUN npm run build - -FROM ubuntu:20.04 AS Run - -# Set image parameters -ARG OBSIDIAN_VERSION=1.6.7 -ARG DEBIAN_FRONTEND=noninteractive -VOLUME [ "/vault", "/output", "/config.json" ] -ENV TZ=Etc/UTC - -# Install dependencies -RUN apt update -RUN apt install -y python3 python3-pip curl x11vnc xvfb tzdata jq - -# Download the Obsidian package -RUN curl -L "https://github.com/obsidianmd/obsidian-releases/releases/download/v${OBSIDIAN_VERSION}/obsidian_${OBSIDIAN_VERSION}_amd64.deb" -o obsidian.deb - -# Install patcher -RUN pip3 install electron-inject - -# Install Obsidian -RUN apt install -y ./obsidian.deb - -# Copy build output -COPY --from=Build /app/main.js /plugin/main.js -COPY --from=Build /app/styles.css /plugin/styles.css -COPY --from=Build /app/manifest.json /plugin/manifest.json - -# Copy the inject scripts -COPY docker/inject-enable.js /inject-enable.js - -# Copy the run script -COPY docker/run.sh /run.sh -RUN chmod +x /run.sh - -# Set up the vault -RUN mkdir -p /root/.config/obsidian -RUN mkdir /output -RUN echo '{"vaults":{"94349b4f2b2e057a":{"path":"/vault","ts":1715257568671,"open":true}}}' > /root/.config/obsidian/obsidian.json - -CMD xvfb-run /run.sh diff --git a/.obsidian/plugins/obsidian-webpage-export-master/LICENSE b/.obsidian/plugins/obsidian-webpage-export-master/LICENSE deleted file mode 100644 index 11db65ff..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2023 Nathan George - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/.obsidian/plugins/obsidian-webpage-export-master/README.md b/.obsidian/plugins/obsidian-webpage-export-master/README.md deleted file mode 100644 index a2bbad80..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/README.md +++ /dev/null @@ -1,65 +0,0 @@ -# Webpage HTML Export - -Export html from single files, canvas pages, or whole vaults. Direct access to the exported HTML files allows you to publish your digital garden anywhere. Focuses on flexibility, features, and style parity. -Demo / docs: [docs.obsidianweb.net](https://docs.obsidianweb.net/) - -![image](https://github.com/KosmosisDire/obsidian-webpage-export/assets/39423700/b8e227e4-b12c-47fb-b341-5c5c2f092ffa) - -![image](https://github.com/KosmosisDire/obsidian-webpage-export/assets/39423700/06f29e1a-c067-45e7-9882-f9d6aa83776f) - -> [!NOTE] -> Although the plugin is fully functional it is still under development, so there may be frequent large changes between updates that could effect your workflow! Bugs are also not uncommon, please report anything you find, I am working to make the plugin more stable. - -## Features: -- Full text search -- File navigation tree -- Document outline -- Graph view -- Theme toggle -- Optimized for web and mobile -- Most plugins supported (dataview, tasks, etc...) -- Option to export html and dependencies into one single file - -## Using the Plugin -Check out the new docs for details on using the plugin: -https://docs.obsidianweb.net/ - -## Installation - -Install from Obsidian Community Plugins: [Open in Obsidian](https://obsidian.md/plugins?id=webpage-html-export) - -### Manual Installation - -1. Download the `.zip` file from the [Latest Release](https://github.com/KosmosisDire/obsidian-webpage-export/releases/latest), or from any other release version. -2. Unzip into: `{VaultFolder}/.obsidian/plugins/` -3. Reload obsidian - -### Beta Installation - -Either follow the instructions above for a beta release, or: - -1. Install the [BRAT plugin](https://obsidian.md/plugins?id=obsidian42-brat) -2. Open the brat settings -3. Select add beta plugin -4. Enter `https://github.com/KosmosisDire/obsidian-webpage-export` as the repository. -5. Select Add Plugin - -## Contributing - -Only start work on features which have an issue created for them and have been accepted by me! -A contribution guide may come soon. - -## Support This Plugin - -This plugin takes a lot of work to maintain and continue adding features. If you want to fund the continued development of this plugin you can do so here: - - - -or if you prefer paypal: - - - -## Testing - -This project is tested with BrowserStack. -[BrowserStack](https://www.browserstack.com/open-source) offers free web testing to open source projects, but does not support this project in any other way. diff --git a/.obsidian/plugins/obsidian-webpage-export-master/action.yml b/.obsidian/plugins/obsidian-webpage-export-master/action.yml deleted file mode 100644 index d534b378..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/action.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: "Export Obsidian vault to HTML" -description: "Exports the Obsidian vault to HTML" - -inputs: - vault: - description: "Path to the Obsidian vault" - required: true - default: "." - config: - description: "Path to the configuration file" - required: false - version: - description: "Version of the plugin" - required: false - default: "latest" - -outputs: - output: - description: "Path to the output folder" - value: ${{ steps.run-docker.outputs.output }} - -runs: - using: "composite" - - steps: - - name: Run docker container - id: run-docker - shell: bash - - run: | - set +e - - mkdir -p ./.output - - if [ -z "${{ inputs.config }}" ]; then - docker run --rm -v ${{ inputs.vault }}:/vault -v ./.output:/output KosmosisDire/obsidian-webpage-export:${{ inputs.version }} >> ./.log.txt - else - docker run --rm -v ${{ inputs.vault }}:/vault -v ${{ inputs.config }}:/config.json -v ./.output:/output KosmosisDire/obsidian-webpage-export:${{ inputs.version }} >> ./.log.txt - fi - - cat ./.log.txt - - if [ $? -eq 137 ]; then - exit 0 - echo "output=./.output" >> $GITHUB_OUTPUT - fi diff --git a/.obsidian/plugins/obsidian-webpage-export-master/assets/assets.d.ts b/.obsidian/plugins/obsidian-webpage-export-master/assets/assets.d.ts deleted file mode 100644 index 41de9535..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/assets/assets.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -declare module "*.txt.js" { - const value: string - export default value -} - -declare module "*.txt.css" { - const value: string - export default value -} - -declare module "*.txt" { - const value: string - export default value -} - -// binary -declare module "*.wasm" { - const value: Uint8Array - export default value -} - -declare module "*.png" { - const value: Uint8Array - export default value -} - diff --git a/.obsidian/plugins/obsidian-webpage-export-master/assets/deferred.txt.css b/.obsidian/plugins/obsidian-webpage-export-master/assets/deferred.txt.css deleted file mode 100644 index c9dd415e..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/assets/deferred.txt.css +++ /dev/null @@ -1,296 +0,0 @@ -/* Define default values for variables */ -body -{ - --line-width: 40em; - --line-width-adaptive: 40em; - --file-line-width: 40em; - --sidebar-width: min(20em, 80vw); - --collapse-arrow-size: 11px; - --tree-horizontal-spacing: 0.6em; - --tree-vertical-spacing: 0.6em; - --sidebar-margin: 12px; -} - -/*#region Sidebars */ - -.sidebar { - height: 100%; - min-width: calc(var(--sidebar-width) + var(--divider-width-hover)); - max-width: calc(var(--sidebar-width) + var(--divider-width-hover)); - font-size: 14px; - z-index: 10; - - position: relative; - overflow: hidden; - /* overflow: clip; */ - - transition: min-width ease-in-out, max-width ease-in-out; - transition-duration: .2s; - contain: size; -} - -.sidebar-left { - left: 0; -} - -.sidebar-right { - right: 0; -} - -.sidebar.is-collapsed { - min-width: 0; - max-width: 0; -} - -body.floating-sidebars .sidebar { - position: absolute; -} - -.sidebar-content { - height: 100%; - min-width: calc(var(--sidebar-width) - var(--divider-width-hover)); - top: 0; - padding: var(--sidebar-margin); - padding-top: 4em; - line-height: var(--line-height-tight); - background-color: var(--background-secondary); - transition: background-color,border-right,border-left,box-shadow; - transition-duration: var(--color-fade-speed); - transition-timing-function: ease-in-out; - position: absolute; - display: flex; - flex-direction: column; -} - -/* If the sidebar isn't collapsed the content should have the same width as it */ -.sidebar:not(.is-collapsed) .sidebar-content { - min-width: calc(max(100%,var(--sidebar-width)) - 3px); - max-width: calc(max(100%,var(--sidebar-width)) - 3px); -} - -.sidebar-left .sidebar-content -{ - left: 0; - border-top-right-radius: var(--radius-l); - border-bottom-right-radius: var(--radius-l); -} - -.sidebar-right .sidebar-content -{ - right: 0; - border-top-left-radius: var(--radius-l); - border-bottom-left-radius: var(--radius-l); -} - -/* Hide empty sidebars */ -.sidebar:has(.sidebar-content:empty):has(.topbar-content:empty) -{ - display: none; -} - -.sidebar-topbar { - height: 2em; - width: var(--sidebar-width); - top: var(--sidebar-margin); - padding-inline: var(--sidebar-margin); - z-index: 1; - - position: fixed; - display: flex; - align-items: center; - - transition: width ease-in-out; - transition-duration: inherit; -} - -.sidebar.is-collapsed .sidebar-topbar { - width: calc(2.3em + var(--sidebar-margin) * 2); -} - -.sidebar .sidebar-topbar.is-collapsed -{ - width: 0; -} - -.sidebar-left .sidebar-topbar { - left: 0; -} - -.sidebar-right .sidebar-topbar { - right: 0; -} - -.topbar-content { - overflow: hidden; - overflow: clip; - width: 100%; - height: 100%; - display: flex; - align-items: center; - transition: inherit; -} - -.sidebar.is-collapsed .topbar-content { - width: 0; - transition: inherit; -} - -.clickable-icon.sidebar-collapse-icon { - background-color: transparent; - color: var(--icon-color-focused); - padding: 0!important; - margin: 0!important; - height: 100%!important; - width: 2.3em !important; - margin-inline: 0.14em!important; - position: absolute; -} - -.sidebar-left .clickable-icon.sidebar-collapse-icon { - transform: rotateY(180deg); - right: var(--sidebar-margin); -} - -.sidebar-right .clickable-icon.sidebar-collapse-icon { - transform: rotateY(180deg); - left: var(--sidebar-margin); -} - -.clickable-icon.sidebar-collapse-icon svg.svg-icon { - width: 100%; - height: 100%; -} - -.sidebar-section-header -{ - margin: 0 0 1em 0; - text-transform: uppercase; - letter-spacing: 0.06em; - font-weight: 600; -} - -/*#endregion */ - -/*#region Content / Markdown Preview View */ - -body -{ - transition: background-color var(--color-fade-speed) ease-in-out; -} - -.webpage-container { - display: flex; - flex-direction: row; - height: 100%; - width: 100%; - align-items: stretch; - justify-content: center; -} - -.document-container -{ - opacity: 1; - flex-basis: 100%; - max-width: 100%; - width: 100%; - height: 100%; - display: flex; - flex-direction: column; - align-items: center; - transition: opacity 0.2s ease-in-out; - contain: inline-size; -} - -.hide -{ - opacity: 0; - transition: opacity 0.2s ease-in-out; -} - -.document-container > .markdown-preview-view -{ - margin: var(--sidebar-margin); - margin-bottom: 0; - width: 100%; - width: -webkit-fill-available; - width: -moz-available; - width: fill-available; - background-color: var(--background-primary); - transition: background-color var(--color-fade-speed) ease-in-out; - border-top-right-radius: var(--window-radius, var(--radius-m)); - border-top-left-radius: var(--window-radius, var(--radius-m)); - overflow-x: hidden !important; - overflow-y: auto !important; - display: flex !important; - flex-direction: column !important; - align-items: center !important; - contain: inline-size; -} - -.document-container>.markdown-preview-view>.markdown-preview-sizer -{ - padding-bottom: 80vh !important; - width: 100% !important; - max-width: var(--line-width) !important; - flex-basis: var(--line-width) !important; - transition: background-color var(--color-fade-speed) ease-in-out; - contain: inline-size; -} - -.view-content img:not([width]), .markdown-rendered img:not([width]) -{ - max-width: 100%; - outline: none; -} - -/* If the markdown view is displaying a raw file or embed then increase it's size to make everything as large as possible */ -.document-container > .view-content.embed { - display: flex; - padding: 1em; - height: 100%; - width: 100%; - align-items: center; - justify-content: center; -} - -.document-container > .view-content.embed > * -{ - max-width: 100%; - max-height: 100%; - object-fit: contain; -} - -*:has(> :is(.math, table)) { - overflow-x: auto !important; -} - -/* For custom view exports */ -.document-container > .view-content -{ - overflow-x: auto; - contain: content; - padding: 0; - margin: 0; - height: 100%; -} - -/*#endregion */ - -/*#region Loading */ - -.scroll-highlight -{ - position: absolute; - width: 100%; - height: 100%; - pointer-events: none; - z-index: 1000; - background-color: hsla(var(--color-accent-hsl),.25); - opacity: 0; - padding: 1em; - inset: 50%; - translate: -50% -50%; - border-radius: var(--radius-s); -} - -/*#endregion */ diff --git a/.obsidian/plugins/obsidian-webpage-export-master/assets/deferred.txt.js b/.obsidian/plugins/obsidian-webpage-export-master/assets/deferred.txt.js deleted file mode 100644 index 8e8b0927..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/assets/deferred.txt.js +++ /dev/null @@ -1,98 +0,0 @@ -async function loadIncludes() -{ - if (location.protocol != "file:") - { - // replace include tags with the contents of the file - let includeTags = document.querySelectorAll("include"); - for (let i = 0; i < includeTags.length; i++) - { - let includeTag = includeTags[i]; - let includePath = includeTag.getAttribute("src"); - - try - { - const request = await fetch(includePath); - if (!request.ok) - { - console.log("Could not include file: " + includePath); - includeTag?.remove(); - continue; - } - - let includeText = await request.text(); - let docFrag = document.createRange().createContextualFragment(includeText); - let includeChildren = Array.from(docFrag.children); - for (let child of includeChildren) - { - child.classList.add("hide"); - child.style.transition = "opacity 0.5s ease-in-out"; - - setTimeout(() => - { - child.classList.remove("hide"); - }, 10); - }; - - includeTag.before(docFrag); - includeTag.remove(); - - console.log("Included file: " + includePath); - } - catch (e) - { - includeTag?.remove(); - console.log("Could not include file: " + includePath, e); - continue; - } - } - } - else - { - let e = document.querySelectorAll("include"); - if (e.length > 0) - { - var error = document.createElement("div"); - error.id = "error"; - error.textContent = "Web server exports must be hosted on an http / web server to be viewed correctly."; - error.style.position = "fixed"; - error.style.top = "50%"; - error.style.left = "50%"; - error.style.transform = "translate(-50%, -50%)"; - error.style.fontSize = "1.5em"; - error.style.fontWeight = "bold"; - error.style.textAlign = "center"; - document.body.appendChild(error); - document.querySelector(".document-container")?.classList.remove("hide"); - } - } -} - -document.addEventListener("DOMContentLoaded", () => -{ - loadIncludes(); -}); - -let isFileProtocol = location.protocol == "file:"; - -function waitLoadScripts(scriptNames, callback) -{ - let scripts = scriptNames.map(name => document.getElementById(name + "-script")); - let index = 0; - - function loadNext() - { - let script = scripts[index]; - index++; - - if (!script || script.getAttribute('loaded') == "true") // if already loaded - { - if (index < scripts.length) - loadNext(); - } - - if (index < scripts.length) script.addEventListener("load", loadNext); - else callback(); - } - - loadNext(); -} diff --git a/.obsidian/plugins/obsidian-webpage-export-master/assets/graph-render-worker.txt.js b/.obsidian/plugins/obsidian-webpage-export-master/assets/graph-render-worker.txt.js deleted file mode 100644 index 5134b274..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/assets/graph-render-worker.txt.js +++ /dev/null @@ -1,417 +0,0 @@ -// Import Pixi.js library -if( 'function' === typeof importScripts) -{ - importScripts('https://d157l7jdn8e5sf.cloudfront.net/v7.2.0/webworker.js', './tinycolor.js'); - - addEventListener('message', onMessage); - - let app; - let container; - let graphics; - - isDrawing = false; - - let linkCount = 0; - let linkSources = []; - let linkTargets = []; - let nodeCount = 0; - let radii = []; - let labels = []; - let labelFade = []; - let labelWidths = []; - let pixiLabels = []; - let cameraOffset = {x: 0, y: 0}; - let positions = new Float32Array(0); - let linkLength = 0; - let edgePruning = 0; - let colors = - { - background: 0x232323, - link: 0xAAAAAA, - node: 0xCCCCCC, - outline: 0xAAAAAA, - text: 0xFFFFFF, - accent: 0x4023AA - } - - let hoveredNode = -1; - let lastHoveredNode = -1; - let grabbedNode = -1; - let updateAttached = false; - let attachedToGrabbed = []; - let activeNode = -1; - let attachedToActive = []; - - let cameraScale = 1; - let cameraScaleRoot = 1; - - function toScreenSpace(x, y, floor = true) - { - if (floor) - { - return {x: Math.floor((x * cameraScale) + cameraOffset.x), y: Math.floor((y * cameraScale) + cameraOffset.y)}; - } - else - { - return {x: (x * cameraScale) + cameraOffset.x, y: (y * cameraScale) + cameraOffset.y}; - } - } - - function vecToScreenSpace({x, y}, floor = true) - { - return toScreenSpace(x, y, floor); - } - - function toWorldspace(x, y) - { - return {x: (x - cameraOffset.x) / cameraScale, y: (y - cameraOffset.y) / cameraScale}; - } - - function vecToWorldspace({x, y}) - { - return toWorldspace(x, y); - } - - function setCameraCenterWorldspace({x, y}) - { - cameraOffset.x = (canvas.width / 2) - (x * cameraScale); - cameraOffset.y = (canvas.height / 2) - (y * cameraScale); - } - - function getCameraCenterWorldspace() - { - return toWorldspace(canvas.width / 2, canvas.height / 2); - } - - function getNodeScreenRadius(radius) - { - return radius * cameraScaleRoot; - } - - function getNodeWorldspaceRadius(radius) - { - return radius / cameraScaleRoot; - } - - function getPosition(index) - { - return {x: positions[index * 2], y: positions[index * 2 + 1]}; - } - - function mixColors(hexStart, hexEnd, factor) - { - return tinycolor.mix(tinycolor(hexStart.toString(16)), tinycolor(hexEnd.toString(16)), factor).toHexNumber() - } - - function darkenColor(hexColor, factor) - { - return tinycolor(hexColor.toString(16)).darken(factor).toHexNumber(); - } - - function lightenColor(hexColor, factor) - { - return tinycolor(hexColor.toString(16)).lighten(factor).toHexNumber(); - } - - function invertColor(hex, bw) - { - hex = hex.toString(16); // force conversion - // fill extra space up to 6 characters with 0 - while (hex.length < 6) hex = "0" + hex; - - if (hex.indexOf('#') === 0) { - hex = hex.slice(1); - } - // convert 3-digit hex to 6-digits. - if (hex.length === 3) { - hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2]; - } - if (hex.length !== 6) { - throw new Error('Invalid HEX color:' + hex); - } - var r = parseInt(hex.slice(0, 2), 16), - g = parseInt(hex.slice(2, 4), 16), - b = parseInt(hex.slice(4, 6), 16); - if (bw) { - // https://stackoverflow.com/a/3943023/112731 - return (r * 0.299 + g * 0.587 + b * 0.114) > 186 - ? '#000000' - : '#FFFFFF'; - } - // invert color components - r = (255 - r).toString(16); - g = (255 - g).toString(16); - b = (255 - b).toString(16); - // pad each with zeros and return - return "#" + padZero(r) + padZero(g) + padZero(b); - } - - function clamp(value, min, max) - { - return Math.min(Math.max(value, min), max); - } - - function lerp(a, b, t) - { - return a + (b - a) * t; - } - - let hoverFade = 0; - let hoverFadeSpeed = 0.2; - let hoverFontSize = 15; - let normalFontSize = 12; - let fontRatio = hoverFontSize / normalFontSize; - - function showLabel(index, fade, hovered = false) - { - let label = pixiLabels[index]; - if (!label) return; - labelFade[index] = fade; - - if(fade > 0.01) label.visible = true; - else - { - hideLabel(index); - return; - } - - if (hovered) label.style.fontSize = hoverFontSize; - else label.style.fontSize = normalFontSize; - - - let nodePos = vecToScreenSpace(getPosition(index)); - let width = (labelWidths[index] * (hovered ? fontRatio : 1)) / 2; - label.x = nodePos.x - width; - label.y = nodePos.y + getNodeScreenRadius(radii[index]) + 9; - label.alpha = fade; - } - - function hideLabel(index) - { - let label = pixiLabels[index]; - label.visible = false; - } - - function draw() - { - graphics.clear(); - - let topLines = []; - if (updateAttached) - { - attachedToGrabbed = []; - // hoverFade = 0; - } - - if (hoveredNode != -1 || grabbedNode != -1) - { - hoverFade = Math.min(1, hoverFade + hoverFadeSpeed); - } - else - { - hoverFade = Math.max(0, hoverFade - hoverFadeSpeed); - } - - graphics.lineStyle(1, mixColors(colors.link, colors.background, hoverFade * 50), 0.7); - - for (let i = 0; i < linkCount; i++) - { - let target = linkTargets[i]; - let source = linkSources[i]; - - if (hoveredNode == source || hoveredNode == target || ((lastHoveredNode == source || lastHoveredNode == target) && hoverFade != 0)) - { - if (updateAttached && hoveredNode == source) - attachedToGrabbed.push(target); - - else if (updateAttached && hoveredNode == target) - attachedToGrabbed.push(source); - - topLines.push(i); - } - - let startWorld = getPosition(source); - let endWorld = getPosition(target); - - let start = vecToScreenSpace(startWorld); - let end = vecToScreenSpace(endWorld); - - let dist = Math.sqrt(Math.pow(startWorld.x - endWorld.x, 2) + Math.pow(startWorld.y - endWorld.y, 2)); - - if (dist < (radii[source] + radii[target]) * edgePruning) - { - graphics.moveTo(start.x, start.y); - graphics.lineTo(end.x, end.y); - } - } - - let opacity = 1 - (hoverFade * 0.5); - graphics.beginFill(mixColors(colors.node, colors.background, hoverFade * 50), opacity); - graphics.lineStyle(0, 0xffffff); - for (let i = 0; i < nodeCount; i++) - { - let screenRadius = getNodeScreenRadius(radii[i]); - - if (hoveredNode != i) - { - if (screenRadius > 2) - { - - let labelFade = lerp(0, (screenRadius - 4) / 8 - (1/cameraScaleRoot)/6 * 0.9, Math.max(1 - hoverFade, 0.2)); - showLabel(i, labelFade); - } - else - { - hideLabel(i); - } - } - - if (hoveredNode == i || (lastHoveredNode == i && hoverFade != 0) || (hoveredNode != -1 && attachedToGrabbed.includes(i))) continue; - - let pos = vecToScreenSpace(getPosition(i)); - graphics.drawCircle(pos.x, pos.y, screenRadius); - } - - graphics.endFill(); - - - opacity = hoverFade * 0.7; - graphics.lineStyle(1, mixColors(mixColors(colors.link, colors.accent, hoverFade * 100), colors.background, 20), opacity); - - for (let i = 0; i < topLines.length; i++) - { - let target = linkTargets[topLines[i]]; - let source = linkSources[topLines[i]]; - - // draw lines on top when hovered - let start = vecToScreenSpace(getPosition(source)); - let end = vecToScreenSpace(getPosition(target)); - - - graphics.moveTo(start.x, start.y); - graphics.lineTo(end.x, end.y); - } - - if(hoveredNode != -1 || (lastHoveredNode != -1 && hoverFade != 0)) - { - graphics.beginFill(mixColors(colors.node, colors.accent, hoverFade * 20), 0.9); - graphics.lineStyle(0, 0xffffff); - for (let i = 0; i < attachedToGrabbed.length; i++) - { - let point = attachedToGrabbed[i]; - - let pos = vecToScreenSpace(getPosition(point)); - - graphics.drawCircle(pos.x, pos.y, getNodeScreenRadius(radii[point])); - showLabel(point, Math.max(hoverFade * 0.6, labelFade[point])); - } - graphics.endFill(); - - let index = hoveredNode != -1 ? hoveredNode : lastHoveredNode; - - let pos = vecToScreenSpace(getPosition(index)); - graphics.beginFill(mixColors(colors.node, colors.accent, hoverFade * 100), 1); - graphics.lineStyle(hoverFade, mixColors(invertColor(colors.background, true), colors.accent, 50)); - graphics.drawCircle(pos.x, pos.y, getNodeScreenRadius(radii[index])); - graphics.endFill(); - - showLabel(index, Math.max(hoverFade, labelFade[index]), true); - } - - - - updateAttached = false; - - graphics.lineStyle(2, colors.accent); - // draw the active node - if (activeNode != -1) - { - let pos = vecToScreenSpace(getPosition(activeNode)); - graphics.drawCircle(pos.x, pos.y, getNodeScreenRadius(radii[activeNode]) + 4); - - } - } - - function onMessage(event) - { - if(event.data.type == "draw") - { - positions = new Float32Array(event.data.positions); - draw(); - } - else if(event.data.type == "update_camera") - { - cameraOffset = event.data.cameraOffset; - cameraScale = event.data.cameraScale; - cameraScaleRoot = Math.sqrt(cameraScale); - } - else if(event.data.type == "update_interaction") - { - if(hoveredNode != event.data.hoveredNode && event.data.hoveredNode != -1) updateAttached = true; - if(grabbedNode != event.data.grabbedNode && event.data.hoveredNode != -1) updateAttached = true; - - if(event.data.hoveredNode == -1) lastHoveredNode = hoveredNode; - else lastHoveredNode = -1; - - hoveredNode = event.data.hoveredNode; - grabbedNode = event.data.grabbedNode; - } - else if(event.data.type == "resize") - { - app.renderer.resize(event.data.width, event.data.height); - } - else if(event.data.type == "set_active") - { - activeNode = event.data.active; - } - else if(event.data.type == "update_colors") - { - colors = event.data.colors; - - for (let label of pixiLabels) - { - label.style.fill = invertColor(colors.background, true); - } - } - else if(event.data.type == "init") - { - // Extract data from message - linkCount = event.data.linkCount; - linkSources = event.data.linkSources; - linkTargets = event.data.linkTargets; - nodeCount = event.data.nodeCount; - radii = event.data.radii; - labels = event.data.labels; - linkLength = event.data.linkLength; - edgePruning = event.data.edgePruning; - - app = new PIXI.Application({... event.data.options, antialias: true, resolution: 2, backgroundAlpha: 0, transparent: true}); - container = new PIXI.Container(); - graphics = new PIXI.Graphics(); - app.stage.addChild(container); - container.addChild(graphics); - - pixiLabels = []; - for (let i = 0; i < nodeCount; i++) - { - let label = new PIXI.Text(labels[i], {fontFamily : 'Arial', fontSize: 12, fontWeight: "normal", fill : invertColor(colors.background, true), align : 'center', anchor: 0.5}); - pixiLabels.push(label); - labelWidths.push(label.width); - labelFade.push(0); - app.stage.addChild(label); - } - - } - else - { - console.log("Unknown message type sent to graph worker: " + event.data.type); - } - } -} - - - - - - - diff --git a/.obsidian/plugins/obsidian-webpage-export-master/assets/graph-view.txt.js b/.obsidian/plugins/obsidian-webpage-export-master/assets/graph-view.txt.js deleted file mode 100644 index 13eb4ee4..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/assets/graph-view.txt.js +++ /dev/null @@ -1,1036 +0,0 @@ -// -------------------------- GRAPH VIEW -------------------------- -var running = false; -let batchFraction = 1; // how much of the graph to update per frame -let minBatchFraction = 0.3; // batch fraction is updated dynamically, but never goes below this value -let dt = 1; -let targetFPS = 40; -let startingCameraRect = {minX: -1, minY: -1, maxX: 1, maxY: 1}; - -let mouseWorldPos = { x: undefined, y: undefined }; -let scrollVelocity = 0; -let averageFPS = targetFPS * 2; - -let pixiApp = undefined; -let graphRenderer = undefined; - -class GraphAssembly -{ - static nodeCount = 0; - static linkCount = 0; - static hoveredNode = -1; - - static #positionsPtr = 0; - static #positionsByteLength = 0; - static #radiiPtr = 0; - static #linkSourcesPtr = 0; - static #linkTargetsPtr = 0; - - static linkSources = new Int32Array(0); - static linkTargets = new Int32Array(0); - static radii = new Float32Array(0); - static maxRadius = 0; - static averageRadius = 0; - static minRadius = 0; - - /** - * @param {{graphOptions: {attractionForce: number, linkLength: number, repulsionForce: number, centralForce: number, edgePruning: number, minNodeRadius: number, maxNodeRadius: number}, nodeCount: number, linkCount:number, radii: number[], labels: string[], paths: string[], linkSources: number[], linkTargets: number[], linkCounts: number[]}} graphData - */ - static init(graphData) - { - GraphAssembly.nodeCount = graphData.nodeCount; - GraphAssembly.linkCount = graphData.linkCount; - - // create arrays for the data - let positions = new Float32Array(GraphAssembly.nodeCount * 2); - GraphAssembly.radii = new Float32Array(graphData.radii); - GraphAssembly.linkSources = new Int32Array(graphData.linkSources); - GraphAssembly.linkTargets = new Int32Array(graphData.linkTargets); - - // allocate memory on the heap - GraphAssembly.#positionsPtr = Module._malloc(positions.byteLength); - GraphAssembly.#positionsByteLength = positions.byteLength; - GraphAssembly.#radiiPtr = Module._malloc(GraphAssembly.radii.byteLength); - GraphAssembly.#linkSourcesPtr = Module._malloc(GraphAssembly.linkSources.byteLength); - GraphAssembly.#linkTargetsPtr = Module._malloc(GraphAssembly.linkTargets.byteLength); - - GraphAssembly.maxRadius = GraphAssembly.radii.reduce((a, b) => Math.max(a, b)); - GraphAssembly.averageRadius = GraphAssembly.radii.reduce((a, b) => a + b) / GraphAssembly.radii.length; - GraphAssembly.minRadius = GraphAssembly.radii.reduce((a, b) => Math.min(a, b)); - - positions = this.loadState(); - - // copy the data to the heap - Module.HEAP32.set(new Int32Array(positions.buffer), GraphAssembly.#positionsPtr / positions.BYTES_PER_ELEMENT); - Module.HEAP32.set(new Int32Array(GraphAssembly.radii.buffer), GraphAssembly.#radiiPtr / GraphAssembly.radii.BYTES_PER_ELEMENT); - Module.HEAP32.set(new Int32Array(GraphAssembly.linkSources.buffer), GraphAssembly.#linkSourcesPtr / GraphAssembly.linkSources.BYTES_PER_ELEMENT); - Module.HEAP32.set(new Int32Array(GraphAssembly.linkTargets.buffer), GraphAssembly.#linkTargetsPtr / GraphAssembly.linkTargets.BYTES_PER_ELEMENT); - - Module._Init( - GraphAssembly.#positionsPtr, - GraphAssembly.#radiiPtr, - GraphAssembly.#linkSourcesPtr, - GraphAssembly.#linkTargetsPtr, - GraphAssembly.nodeCount, - GraphAssembly.linkCount, - batchFraction, - dt, - graphData.graphOptions.attractionForce, - graphData.graphOptions.linkLength, - graphData.graphOptions.repulsionForce, - graphData.graphOptions.centralForce, - ); - } - - /** - * @returns {Float32Array} - */ - static get positions() - { - return Module.HEAP32.buffer.slice(GraphAssembly.#positionsPtr, GraphAssembly.#positionsPtr + GraphAssembly.#positionsByteLength); - } - - /** - * @param {GraphRenderWorker} renderWorker - * */ - static saveState(renderWorker) - { - // save all rounded to int - localStorage.setItem("positions", JSON.stringify(new Float32Array(GraphAssembly.positions).map(x => Math.round(x)))); - } - - /** - * @returns {Float32Array} - * */ - static loadState() - { - let positionsLoad = localStorage.getItem("positions"); - let positions = null; - if(positionsLoad) positions = new Float32Array(Object.values(JSON.parse(positionsLoad))); - if (!positions || !positionsLoad || positions.length != GraphAssembly.nodeCount * 2) - { - positions = new Float32Array(GraphAssembly.nodeCount * 2); - let spawnRadius = (GraphAssembly.averageRadius * Math.sqrt(GraphAssembly.nodeCount)) * 2; - for (let i = 0; i < GraphAssembly.nodeCount; i++) - { - let distance = (1 - GraphAssembly.radii[i] / GraphAssembly.maxRadius) * spawnRadius; - positions[i * 2] = Math.cos(i/GraphAssembly.nodeCount * 7.41 * 2 * Math.PI) * distance; - positions[i * 2 + 1] = Math.sin(i/GraphAssembly.nodeCount * 7.41 * 2 * Math.PI) * distance; - } - } - - // fit view to positions - let minX = Infinity; - let maxX = -Infinity; - let minY = Infinity; - let maxY = -Infinity; - for (let i = 0; i < GraphAssembly.nodeCount-1; i+=2) - { - let pos = { x: positions[i], y: positions[i + 1] }; - minX = Math.min(minX, pos.x); - maxX = Math.max(maxX, pos.x); - minY = Math.min(minY, pos.y); - maxY = Math.max(maxY, pos.y); - } - - let margin = 50; - - startingCameraRect = { minX: minX - margin, minY: minY - margin, maxX: maxX + margin, maxY: maxY + margin }; - - return positions; - } - - /** - * @param {{x: number, y: number}} mousePosition - * @param {number} grabbedNode - */ - static update(mousePosition, grabbedNode, cameraScale) - { - GraphAssembly.hoveredNode = Module._Update(mousePosition.x, mousePosition.y, grabbedNode, cameraScale); - } - - static free() - { - Module._free(GraphAssembly.#positionsPtr); - Module._free(GraphAssembly.#radiiPtr); - Module._free(GraphAssembly.#linkSourcesPtr); - Module._free(GraphAssembly.#linkTargetsPtr); - Module._FreeMemory(); - } - - /** - * @param {number} value - */ - static set batchFraction(value) - { - Module._SetBatchFractionSize(value); - } - - /** - * @param {number} value - */ - static set attractionForce(value) - { - Module._SetAttractionForce(value); - } - - /** - * @param {number} value - */ - static set repulsionForce(value) - { - Module._SetRepulsionForce(value); - } - - /** - * @param {number} value - */ - static set centralForce(value) - { - Module._SetCentralForce(value); - } - - /** - * @param {number} value - */ - static set linkLength(value) - { - Module._SetLinkLength(value); - } - - /** - * @param {number} value - */ - static set dt(value) - { - Module._SetDt(value); - } -} - -class GraphRenderWorker -{ - #cameraOffset; - #cameraScale; - #hoveredNode; - #grabbedNode; - #colors; - #width; - #height; - - - constructor() - { - this.canvas = document.querySelector("#graph-canvas"); - this.canvasSidebar = undefined; - - try - { - this.canvasSidebar = document.querySelector(".sidebar:has(#graph-canvas)"); - } - catch(e) - { - console.log("Error: " + e + "\n\n Using fallback."); - - let rightSidebar = document.querySelector(".sidebar-right"); - let leftSidebar = document.querySelector(".sidebar-left"); - - this.canvasSidebar = rightSidebar.querySelector("#graph-canvas") ? rightSidebar : leftSidebar; - } - - this.view = this.canvas.transferControlToOffscreen(); - - this.worker = new Worker(new URL("./graph-render-worker.js", import.meta.url)); - - this.#cameraOffset = {x: 0, y: 0}; - this.#cameraScale = 1; - this.#hoveredNode = -1; - this.#grabbedNode = -1; - this.#colors = - { - background: 0x000000, - link: 0x000000, - node: 0x000000, - outline: 0x000000, - text: 0x000000, - accent: 0x000000, - } - this.#width = 0; - this.#height = 0; - - this.cameraOffset = {x: this.canvas.width / 2, y: this.canvas.height / 2}; - this.cameraScale = 1; - this.hoveredNode = -1; - this.grabbedNode = -1; - this.resampleColors(); - - this.#pixiInit(); - - this.width = this.canvas.width; - this.height = this.canvas.height; - - this.autoResizeCanvas(); - - this.fitToRect(startingCameraRect); - } - - #pixiInit() - { - let { width, height } = this.view; - - this.worker.postMessage( - { - type: 'init', - linkCount: GraphAssembly.linkCount, - linkSources: GraphAssembly.linkSources, - linkTargets: GraphAssembly.linkTargets, - nodeCount: GraphAssembly.nodeCount, - radii: GraphAssembly.radii, - labels: graphData.labels, - linkLength: graphData.graphOptions.linkLength, - edgePruning: graphData.graphOptions.edgePruning, - options: { width: width, height: height, view: this.view }, - }, [this.view]); - } - - fitToRect(rect) // {minX, minY, maxX, maxY} - { - let min = {x: rect.minX, y: rect.minY}; - let max = {x: rect.maxX, y: rect.maxY}; - - let width = max.x - min.x; - let height = max.y - min.y; - - let scale = 1/Math.min(width/this.width, height / this.height); - - this.cameraScale = scale; - this.cameraOffset = { x: (this.width / 2) - ((rect.minX + width / 2) * scale), y: (this.height / 2) - ((rect.minY + height / 2) * scale) }; - } - - fitToNodes() - { - this.fitToRect(startingCameraRect); - } - - sampleColor(variable) - { - let testEl = document.createElement('div'); - document.body.appendChild(testEl); - testEl.style.setProperty('display', 'none'); - testEl.style.setProperty('color', 'var(' + variable + ')'); - - let col = getComputedStyle(testEl).color; - let opacity = getComputedStyle(testEl).opacity; - - testEl.remove(); - - function toColorObject(str) - { - var match = str.match(/rgb?\((\d+),\s*(\d+),\s*(\d+)\)/); - return match ? { - red: parseInt(match[1]), - green: parseInt(match[2]), - blue: parseInt(match[3]), - alpha: 1 - } : null - } - - let color = toColorObject(col); - let alpha = parseFloat(opacity); - let result = - { - a: (alpha * color?.alpha ?? 1) ?? 1, - rgb: (color?.red << 16 | color?.green << 8 | color?.blue) ?? 0x888888 - }; - - return result; - }; - - resampleColors() - { - this.colors = - { - background: this.sampleColor('--background-secondary').rgb, - link: this.sampleColor('--graph-line').rgb, - node: this.sampleColor('--graph-node').rgb, - outline: this.sampleColor('--graph-line').rgb, - text: this.sampleColor('--graph-text').rgb, - accent: this.sampleColor('--interactive-accent').rgb, - }; - } - - draw(_positions) - { - this.worker.postMessage( - { - type: 'draw', - positions: _positions, - }, [_positions]); - } - - resizeCanvas(width, height) - { - this.worker.postMessage( - { - type: "resize", - width: width, - height: height, - }); - - this.#width = width; - this.#height = height; - } - - autoResizeCanvas() - { - if (this.width != this.canvas.offsetWidth || this.height != this.canvas.offsetHeight) - { - this.centerCamera(); - this.resizeCanvas(this.canvas.offsetWidth, this.canvas.offsetHeight); - } - } - - centerCamera() - { - this.cameraOffset = { x: this.width / 2, y: this.height / 2 }; - } - - #pixiSetInteraction(hoveredNodeIndex, grabbedNodeIndex) - { - let obj = - { - type: "update_interaction", - hoveredNode: hoveredNodeIndex, - grabbedNode: grabbedNodeIndex, - } - - this.worker.postMessage(obj); - } - - #pixiSetCamera(cameraOffset, cameraScale) - { - this.worker.postMessage( - { - type: "update_camera", - cameraOffset: cameraOffset, - cameraScale: cameraScale, - }); - } - - #pixiSetColors(colors) - { - this.worker.postMessage( - { - type: "update_colors", - colors: colors, - }); - - } - - set cameraOffset(offset) - { - this.#cameraOffset = offset; - this.#pixiSetCamera(offset, this.cameraScale); - } - - set cameraScale(scale) - { - this.#cameraScale = scale; - this.#pixiSetCamera(this.cameraOffset, scale); - } - - get cameraOffset() - { - return this.#cameraOffset; - } - - get cameraScale() - { - return this.#cameraScale; - } - - /** - * @param {number} node - */ - set hoveredNode(node) - { - this.#hoveredNode = node; - this.#pixiSetInteraction(node, this.#grabbedNode); - } - - /** - * @param {number} node - */ - set grabbedNode(node) - { - this.#grabbedNode = node; - this.#pixiSetInteraction(this.#hoveredNode, node); - } - - /** - * @param {number} node - */ - set activeNode(node) - { - this.worker.postMessage( - { - type: 'set_active', - active: node, - }); - } - - get hoveredNode() - { - return this.#hoveredNode; - } - - get grabbedNode() - { - return this.#grabbedNode; - } - - /** - * @param {{ background: number; link: number; node: number; outline: number; text: number; accent: number; }} colors - */ - set colors(colors) - { - this.#colors = colors; - this.#pixiSetColors(colors); - } - - get colors() - { - return this.#colors; - } - - set width(width) - { - this.#width = width; - this.resizeCanvas(width, this.#height); - } - - set height(height) - { - this.#height = height; - this.resizeCanvas(this.#width, height); - } - - get height() - { - return this.#height; - } - - get width() - { - return this.#width; - } - - /** - * @param {number} x - * @param {number} y - * @param {boolean} floor - * @returns {{x: number; y: number;}} - */ - toScreenSpace(x, y, floor = true) - { - if (floor) - { - return {x: Math.floor((x * this.cameraScale) + this.cameraOffset.x), y: Math.floor((y * this.cameraScale) + this.cameraOffset.y)}; - } - else - { - return {x: (x * this.cameraScale) + this.cameraOffset.x, y: (y * this.cameraScale) + this.cameraOffset.y}; - } - } - - /** - * @param {{x: number; y: number;}} vector - * @param {boolean} floor - * @returns {{x: number; y: number;}} - */ - vecToScreenSpace(vector, floor = true) - { - return this.toScreenSpace(vector.x, vector.y, floor); - } - - /** - * @param {number} x - * @param {number} y - * @returns {{x: number; y: number;}} - */ - toWorldspace(x, y) - { - return {x: (x - this.cameraOffset.x) / this.cameraScale, y: (y - this.cameraOffset.y) / this.cameraScale}; - } - - /** - * @param {{x: number; y: number;}} vector - * @returns {{x: number; y: number;}} - */ - vecToWorldspace(vector) - { - return this.toWorldspace(vector.x, vector.y); - } - - setCameraCenterWorldspace({x, y}) - { - this.cameraOffset = {x: (this.width / 2) - (x * this.cameraScale), y: (this.height / 2) - (y * this.cameraScale)}; - } - - getCameraCenterWorldspace() - { - return this.toWorldspace(this.width / 2, this.height / 2); - } -} - -async function initializeGraphView() -{ - if(running) return; - running = true; - - graphData.graphOptions.repulsionForce /= batchFraction; // compensate for batch fraction - pixiApp = new PIXI.Application(); - - console.log("Module Ready"); - GraphAssembly.init(graphData); // graphData is a global variable set in another script - - graphRenderer = new GraphRenderWorker(); - window.graphRenderer = graphRenderer; - - initializeGraphEvents(); - - pixiApp.ticker.maxFPS = targetFPS; - pixiApp.ticker.add(updateGraph); - - setActiveDocument(new URL(window.location.href), false, false); - - setInterval(() => - { - function isHidden(el) { - var style = window.getComputedStyle(el); - return (style.display === 'none') - } - - try - { - var hidden = (graphRenderer.canvasSidebar.classList.contains("is-collapsed")); - } - catch(e) - { - return; - } - - if(running && hidden) - { - running = false; - } - else if (!running && !hidden) - { - running = true; - graphRenderer.autoResizeCanvas(); - graphRenderer.centerCamera(); - } - - }, 1000); -} - -let firstUpdate = true; -function updateGraph() -{ - if(!running) return; - - if (graphRenderer.canvasSidebar.classList.contains("is-collapsed")) return; - - if (firstUpdate) - { - setTimeout(() => graphRenderer?.canvas?.classList.remove("hide"), 500); - firstUpdate = false; - } - - GraphAssembly.update(mouseWorldPos, graphRenderer.grabbedNode, graphRenderer.cameraScale); - - if (GraphAssembly.hoveredNode != graphRenderer.hoveredNode) - { - graphRenderer.hoveredNode = GraphAssembly.hoveredNode; - graphRenderer.canvas.style.cursor = GraphAssembly.hoveredNode == -1 ? "default" : "pointer"; - } - - graphRenderer.autoResizeCanvas(); - graphRenderer.draw(GraphAssembly.positions); - - averageFPS = averageFPS * 0.95 + pixiApp.ticker.FPS * 0.05; - - if (averageFPS < targetFPS * 0.8 && batchFraction > minBatchFraction) - { - batchFraction = Math.max(batchFraction - 0.5 * 1/targetFPS, minBatchFraction); - GraphAssembly.batchFraction = batchFraction; - GraphAssembly.repulsionForce = graphData.graphOptions.repulsionForce / batchFraction; - } - - if (averageFPS > targetFPS * 1.2 && batchFraction < 1) - { - batchFraction = Math.min(batchFraction + 0.5 * 1/targetFPS, 1); - GraphAssembly.batchFraction = batchFraction; - GraphAssembly.repulsionForce = graphData.graphOptions.repulsionForce / batchFraction; - } - - if (scrollVelocity != 0) - { - let cameraCenter = graphRenderer.getCameraCenterWorldspace(); - - if (Math.abs(scrollVelocity) < 0.001) - { - scrollVelocity = 0; - } - - zoomGraphViewAroundPoint(mouseWorldPos, scrollVelocity); - - scrollVelocity *= 0.65; - } -} - -function zoomGraphViewAroundPoint(point, zoom, minScale = 0.15, maxScale = 15.0) -{ - let cameraCenter = graphRenderer.getCameraCenterWorldspace(); - - graphRenderer.cameraScale = Math.max(Math.min(graphRenderer.cameraScale + zoom * graphRenderer.cameraScale, maxScale), minScale); - if(graphRenderer.cameraScale != minScale && graphRenderer.cameraScale != maxScale && scrollVelocity > 0 && mouseWorldPos.x != undefined && mouseWorldPos.y != undefined) - { - let aroundDiff = {x: point.x - cameraCenter.x, y: point.y - cameraCenter.y}; - let movePos = {x: cameraCenter.x + aroundDiff.x * zoom, y: cameraCenter.y + aroundDiff.y * zoom}; - graphRenderer.setCameraCenterWorldspace(movePos); - } - else graphRenderer.setCameraCenterWorldspace(cameraCenter); -} - -function scaleGraphViewAroundPoint(point, scale, minScale = 0.15, maxScale = 15.0) -{ - let cameraCenter = graphRenderer.getCameraCenterWorldspace(); - - let scaleBefore = graphRenderer.cameraScale; - graphRenderer.cameraScale = Math.max(Math.min(scale * graphRenderer.cameraScale, maxScale), minScale); - let diff = (scaleBefore - graphRenderer.cameraScale) / scaleBefore; - if(graphRenderer.cameraScale != minScale && graphRenderer.cameraScale != maxScale && scale != 0) - { - let aroundDiff = {x: point.x - cameraCenter.x, y: point.y - cameraCenter.y}; - let movePos = {x: cameraCenter.x - aroundDiff.x * diff, y: cameraCenter.y - aroundDiff.y * diff}; - graphRenderer.setCameraCenterWorldspace(movePos); - } - else graphRenderer.setCameraCenterWorldspace(cameraCenter); -} - -function initializeGraphEvents() -{ - window.addEventListener('beforeunload', () => - { - running = false; - GraphAssembly.free(); - }); - - let graphExpanded = false; - let lastCanvasWidth = graphRenderer.canvas.width; - window.addEventListener('resize', () => - { - if(graphExpanded) - { - graphRenderer.autoResizeCanvas(); - graphRenderer.centerCamera(); - } - else - { - if (graphRenderer.canvas.width != lastCanvasWidth) - { - graphRenderer.autoResizeCanvas(); - graphRenderer.centerCamera(); - } - } - }); - - let container = document.querySelector(".graph-view-container"); - - function handleOutsideClick(event) - { - if (event.composedPath().includes(container)) - { - return; - } - toggleExpandedGraph(); - } - - function toggleExpandedGraph() - { - let initialWidth = container.clientWidth; - let initialHeight = container.clientHeight; - - // scale and fade out animation: - container.classList.add("scale-down"); - let fadeOutAnimation = container.animate({ opacity: 0 }, {duration: 100, easing: "ease-in", fill: "forwards"}); - fadeOutAnimation.addEventListener("finish", function() - { - container.classList.toggle("expanded"); - - graphRenderer.autoResizeCanvas(); - graphRenderer.centerCamera(); - - let finalWidth = container.clientWidth; - let finalHeight = container.clientHeight; - graphRenderer.cameraScale *= ((finalWidth / initialWidth) + (finalHeight / initialHeight)) / 2; - - container.classList.remove("scale-down"); - container.classList.add("scale-up"); - - updateGraph(); - - let fadeInAnimation = container.animate({ opacity: 1 }, {duration: 200, easing: "ease-out", fill: "forwards"}); - fadeInAnimation.addEventListener("finish", function() - { - container.classList.remove("scale-up"); - }); - }); - - graphExpanded = !graphExpanded; - - if (graphExpanded) document.addEventListener("pointerdown", handleOutsideClick); - else document.removeEventListener("pointerdown", handleOutsideClick); - } - - async function navigateToNode(nodeIndex) - { - if (!graphExpanded) GraphAssembly.saveState(graphRenderer); - else toggleExpandedGraph(); - let url = graphData.paths[nodeIndex]; - if(window.location.pathname.endsWith(graphData.paths[nodeIndex])) return; - await loadDocument(url, true, true); - } - - // Get the mouse position relative to the canvas. - function getPointerPosOnCanvas(event) - { - var rect = graphRenderer.canvas.getBoundingClientRect(); - let pos = getPointerPosition(event); - - return { - x: pos.x - rect.left, - y: pos.y - rect.top - }; - } - - let startPointerPos = { x: 0, y: 0 }; - let pointerPos = { x: 0, y: 0 }; - let lastPointerPos = { x: 0, y: 0 }; - let pointerDelta = { x: 0, y: 0 }; - let dragDisplacement = { x: 0, y: 0 }; - let startDragTime = 0; - let pointerDown = false; - let middleDown = false; - let pointerInside = false; - let graphContainer = document.querySelector(".graph-view-container"); - let firstPointerDownId = -1; - - function handlePointerEnter(enter) - { - let lastDistance = 0; - let startZoom = false; - - function handleMouseMove(move) - { - pointerPos = getPointerPosOnCanvas(move); - mouseWorldPos = graphRenderer.vecToWorldspace(pointerPos); - pointerDelta = { x: pointerPos.x - lastPointerPos.x, y: pointerPos.y - lastPointerPos.y }; - lastPointerPos = pointerPos; - - if (graphRenderer.grabbedNode != -1) dragDisplacement = { x: pointerPos.x - startPointerPos.x, y: pointerPos.y - startPointerPos.y }; - - if (pointerDown && graphRenderer.hoveredNode != -1 && graphRenderer.grabbedNode == -1 && graphRenderer.hoveredNode != graphRenderer.grabbedNode) - { - graphRenderer.grabbedNode = graphRenderer.hoveredNode; - } - - if ((pointerDown && graphRenderer.hoveredNode == -1 && graphRenderer.grabbedNode == -1) || middleDown) - { - graphRenderer.cameraOffset = { x: graphRenderer.cameraOffset.x + pointerDelta.x, y: graphRenderer.cameraOffset.y + pointerDelta.y }; - } - else - { - if (graphRenderer.hoveredNode != -1) graphRenderer.canvas.style.cursor = "pointer"; - else graphRenderer.canvas.style.cursor = "default"; - } - } - - function handleTouchMove(move) - { - if (move.touches?.length == 1) - { - if(startZoom) - { - lastPointerPos = getPointerPosOnCanvas(move); - startZoom = false; - } - - handleMouseMove(move); - return; - } - - // pinch zoom - if (move.touches?.length == 2) - { - let touch1 = getTouchPosition(move.touches[0]); - let touch2 = getTouchPosition(move.touches[1]); - - pointerPos = getPointerPosOnCanvas(move); - pointerDelta = { x: pointerPos.x - lastPointerPos.x, y: pointerPos.y - lastPointerPos.y }; - lastPointerPos = pointerPos; - - let distance = Math.sqrt(Math.pow(touch1.x - touch2.x, 2) + Math.pow(touch1.y - touch2.y, 2)); - - if (!startZoom) - { - startZoom = true; - lastDistance = distance; - pointerDelta = { x: 0, y: 0 }; - mouseWorldPos = { x: undefined, y: undefined}; - graphRenderer.grabbedNode = -1; - graphRenderer.hoveredNode = -1; - } - - let distanceDelta = distance - lastDistance; - let scaleDelta = distanceDelta / lastDistance; - - scaleGraphViewAroundPoint(graphRenderer.vecToWorldspace(pointerPos), 1 + scaleDelta, 0.15, 15.0); - graphRenderer.cameraOffset = { x: graphRenderer.cameraOffset.x + pointerDelta.x, y: graphRenderer.cameraOffset.y + pointerDelta.y }; - - lastDistance = distance; - } - } - - function handlePointerUp(up) - { - document.removeEventListener("pointerup", handlePointerUp); - - let pointerUpTime = Date.now(); - - setTimeout(() => - { - if (pointerDown && graphRenderer.hoveredNode != -1 && Math.abs(dragDisplacement.x) <= 4 && Math.abs(dragDisplacement.y) <= 4 && pointerUpTime - startDragTime < 300) - { - navigateToNode(graphRenderer.hoveredNode); - } - - if (pointerDown && graphRenderer.grabbedNode != -1) - { - graphRenderer.grabbedNode = -1; - } - - if (up.button == 0) pointerDown = false; - if (up.pointerType == "touch" && firstPointerDownId == up.pointerId) - { - firstPointerDownId = -1; - pointerDown = false; - } - if (up.button == 1) middleDown = false; - if (!pointerInside) - { - document.removeEventListener("mousemove", handleMouseMove); - document.removeEventListener("touchmove", handleTouchMove); - } - }, 0); - } - - function handlePointerDown(down) - { - document.addEventListener("pointerup", handlePointerUp); - mouseWorldPos = graphRenderer.vecToWorldspace(pointerPos); - dragDisplacement = { x: 0, y: 0 }; - if (down.button == 0) pointerDown = true; - if (down.pointerType == "touch" && firstPointerDownId == -1) - { - firstPointerDownId = down.pointerId; - pointerDown = true; - } - if (down.button == 1) middleDown = true; - - startPointerPos = pointerPos; - startDragTime = Date.now(); - - if (pointerDown && graphRenderer.hoveredNode != -1) - { - graphRenderer.grabbedNode = graphRenderer.hoveredNode; - } - } - - function handlePointerLeave(leave) - { - setTimeout(() => - { - pointerInside = false; - if (!pointerDown) - { - document.removeEventListener("mousemove", handleMouseMove); - document.removeEventListener("touchmove", handleTouchMove); - mouseWorldPos = { x: undefined, y: undefined }; - } - graphContainer.removeEventListener("pointerdown", handlePointerDown); - graphContainer.removeEventListener("pointerleave", handlePointerLeave); - }, 1); - } - - pointerPos = getPointerPosOnCanvas(enter); - mouseWorldPos = graphRenderer.vecToWorldspace(pointerPos); - lastPointerPos = getPointerPosOnCanvas(enter); - pointerInside = true; - - document.addEventListener("mousemove", handleMouseMove); - document.addEventListener("touchmove", handleTouchMove); - graphContainer.addEventListener("pointerdown", handlePointerDown); - graphContainer.addEventListener("pointerleave", handlePointerLeave); - } - - graphContainer.addEventListener("pointerenter", handlePointerEnter); - - document.querySelector(".graph-expand.graph-icon")?.addEventListener("click", event => - { - event.stopPropagation(); - - toggleExpandedGraph(); - }); - - graphContainer.addEventListener("wheel", function(e) - { - let startingScrollVelocity = 0.09; - let delta = e.deltaY; - if (delta > 0) - { - if(scrollVelocity >= -startingScrollVelocity) - { - scrollVelocity = -startingScrollVelocity; - } - scrollVelocity *= 1.4; - } - else - { - if(scrollVelocity <= startingScrollVelocity) - { - scrollVelocity = startingScrollVelocity; - } - scrollVelocity *= 1.4; - } - }); - - // recenter the graph on double click - graphContainer.addEventListener("dblclick", function(e) - { - graphRenderer.fitToNodes(); - }); - - document.querySelector(".theme-toggle-input")?.addEventListener("change", event => - { - setTimeout(() => graphRenderer.resampleColors(), 0); - }); -} - -window.addEventListener("load", () => -{ - waitLoadScripts(["pixi", "graph-data", "graph-render-worker", "graph-wasm"], () => - { - Module['onRuntimeInitialized'] = initializeGraphView; - setTimeout(() => Module['onRuntimeInitialized'](), 300); - }); -}); diff --git a/.obsidian/plugins/obsidian-webpage-export-master/assets/graph-wasm.txt.js b/.obsidian/plugins/obsidian-webpage-export-master/assets/graph-wasm.txt.js deleted file mode 100644 index 72379806..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/assets/graph-wasm.txt.js +++ /dev/null @@ -1,777 +0,0 @@ - -// Wasm glue -var Module = typeof Module != "undefined" ? Module : {}; -var moduleOverrides = Object.assign({}, Module); -var arguments_ = []; -var thisProgram = "./this.program"; -var quit_ = (status,toThrow)=>{ - throw toThrow -} -; -var ENVIRONMENT_IS_WEB = typeof window == "object"; -var ENVIRONMENT_IS_WORKER = typeof importScripts == "function"; -var ENVIRONMENT_IS_NODE = typeof process == "object" && typeof process.versions == "object" && typeof process.versions.node == "string"; -var scriptDirectory = ""; -function locateFile(path) { - if (Module["locateFile"]) { - return Module["locateFile"](path, scriptDirectory) - } - return scriptDirectory + path -} -var read_, readAsync, readBinary, setWindowTitle; -if (ENVIRONMENT_IS_NODE) { - var fs = require("fs"); - var nodePath = require("path"); - if (ENVIRONMENT_IS_WORKER) { - scriptDirectory = nodePath.dirname(scriptDirectory) + "/" - } else { - scriptDirectory = __dirname + "/" - } - read_ = (filename,binary)=>{ - filename = isFileURI(filename) ? new URL(filename) : nodePath.normalize(filename); - return fs.readFileSync(filename, binary ? undefined : "utf8") - } - ; - readBinary = filename=>{ - var ret = read_(filename, true); - if (!ret.buffer) { - ret = new Uint8Array(ret) - } - return ret - } - ; - readAsync = (filename,onload,onerror)=>{ - filename = isFileURI(filename) ? new URL(filename) : nodePath.normalize(filename); - fs.readFile(filename, function(err, data) { - if (err) - onerror(err); - else - onload(data.buffer) - }) - } - ; - if (!Module["thisProgram"] && process.argv.length > 1) { - thisProgram = process.argv[1].replace(/\\/g, "/") - } - arguments_ = process.argv.slice(2); - if (typeof module != "undefined") { - module["exports"] = Module - } - process.on("uncaughtException", function(ex) { - if (ex !== "unwind" && !(ex instanceof ExitStatus) && !(ex.context instanceof ExitStatus)) { - throw ex - } - }); - var nodeMajor = process.versions.node.split(".")[0]; - if (nodeMajor < 15) { - process.on("unhandledRejection", function(reason) { - throw reason - }) - } - quit_ = (status,toThrow)=>{ - process.exitCode = status; - throw toThrow - } - ; - Module["inspect"] = function() { - return "[Emscripten Module object]" - } -} else if (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) { - if (ENVIRONMENT_IS_WORKER) { - scriptDirectory = self.location.href - } else if (typeof document != "undefined" && document.currentScript) { - scriptDirectory = document.currentScript.src - } - if (scriptDirectory.indexOf("blob:") !== 0) { - scriptDirectory = scriptDirectory.substr(0, scriptDirectory.replace(/[?#].*/, "").lastIndexOf("/") + 1) - } else { - scriptDirectory = "" - } - { - read_ = url=>{ - var xhr = new XMLHttpRequest; - xhr.open("GET", url, false); - xhr.send(null); - return xhr.responseText - } - ; - if (ENVIRONMENT_IS_WORKER) { - readBinary = url=>{ - var xhr = new XMLHttpRequest; - xhr.open("GET", url, false); - xhr.responseType = "arraybuffer"; - xhr.send(null); - return new Uint8Array(xhr.response) - } - } - readAsync = (url,onload,onerror)=>{ - var xhr = new XMLHttpRequest; - xhr.open("GET", url, true); - xhr.responseType = "arraybuffer"; - xhr.onload = ()=>{ - if (xhr.status == 200 || xhr.status == 0 && xhr.response) { - onload(xhr.response); - return - } - onerror() - } - ; - xhr.onerror = onerror; - xhr.send(null) - } - } - setWindowTitle = title=>document.title = title -} else {} -var out = Module["print"] || console.log.bind(console); -var err = Module["printErr"] || console.warn.bind(console); -Object.assign(Module, moduleOverrides); -moduleOverrides = null; -if (Module["arguments"]) - arguments_ = Module["arguments"]; -if (Module["thisProgram"]) - thisProgram = Module["thisProgram"]; -if (Module["quit"]) - quit_ = Module["quit"]; -var wasmBinary; -if (Module["wasmBinary"]) - wasmBinary = Module["wasmBinary"]; -var noExitRuntime = Module["noExitRuntime"] || true; -if (typeof WebAssembly != "object") { - abort("no native wasm support detected") -} -var wasmMemory; -var ABORT = false; -var EXITSTATUS; -var HEAP8, HEAPU8, HEAP16, HEAPU16, HEAP32, HEAPU32, HEAPF32, HEAPF64; -function updateMemoryViews() { - var b = wasmMemory.buffer; - Module["HEAP8"] = HEAP8 = new Int8Array(b); - Module["HEAP16"] = HEAP16 = new Int16Array(b); - Module["HEAP32"] = HEAP32 = new Int32Array(b); - Module["HEAPU8"] = HEAPU8 = new Uint8Array(b); - Module["HEAPU16"] = HEAPU16 = new Uint16Array(b); - Module["HEAPU32"] = HEAPU32 = new Uint32Array(b); - Module["HEAPF32"] = HEAPF32 = new Float32Array(b); - Module["HEAPF64"] = HEAPF64 = new Float64Array(b) -} -var wasmTable; -var __ATPRERUN__ = []; -var __ATINIT__ = []; -var __ATPOSTRUN__ = []; -var runtimeInitialized = false; -function preRun() { - if (Module["preRun"]) { - if (typeof Module["preRun"] == "function") - Module["preRun"] = [Module["preRun"]]; - while (Module["preRun"].length) { - addOnPreRun(Module["preRun"].shift()) - } - } - callRuntimeCallbacks(__ATPRERUN__) -} -function initRuntime() { - runtimeInitialized = true; - callRuntimeCallbacks(__ATINIT__) -} -function postRun() { - if (Module["postRun"]) { - if (typeof Module["postRun"] == "function") - Module["postRun"] = [Module["postRun"]]; - while (Module["postRun"].length) { - addOnPostRun(Module["postRun"].shift()) - } - } - callRuntimeCallbacks(__ATPOSTRUN__) -} -function addOnPreRun(cb) { - __ATPRERUN__.unshift(cb) -} -function addOnInit(cb) { - __ATINIT__.unshift(cb) -} -function addOnPostRun(cb) { - __ATPOSTRUN__.unshift(cb) -} -var runDependencies = 0; -var runDependencyWatcher = null; -var dependenciesFulfilled = null; -function addRunDependency(id) { - runDependencies++; - if (Module["monitorRunDependencies"]) { - Module["monitorRunDependencies"](runDependencies) - } -} -function removeRunDependency(id) { - runDependencies--; - if (Module["monitorRunDependencies"]) { - Module["monitorRunDependencies"](runDependencies) - } - if (runDependencies == 0) { - if (runDependencyWatcher !== null) { - clearInterval(runDependencyWatcher); - runDependencyWatcher = null - } - if (dependenciesFulfilled) { - var callback = dependenciesFulfilled; - dependenciesFulfilled = null; - callback() - } - } -} -function abort(what) { - if (Module["onAbort"]) { - Module["onAbort"](what) - } - what = "Aborted(" + what + ")"; - err(what); - ABORT = true; - EXITSTATUS = 1; - what += ". Build with -sASSERTIONS for more info."; - var e = new WebAssembly.RuntimeError(what); - throw e -} -var dataURIPrefix = "data:application/octet-stream;base64,"; -function isDataURI(filename) { - return filename.startsWith(dataURIPrefix) -} -function isFileURI(filename) { - return filename.startsWith("file://") -} -var wasmBinaryFile; -wasmBinaryFile = "graph-wasm.wasm"; -if (!isDataURI(wasmBinaryFile)) { - wasmBinaryFile = locateFile(wasmBinaryFile) -} -function getBinary(file) { - try { - if (file == wasmBinaryFile && wasmBinary) { - return new Uint8Array(wasmBinary) - } - if (readBinary) { - return readBinary(file) - } - throw "both async and sync fetching of the wasm failed" - } catch (err) { - abort(err) - } -} -function getBinaryPromise(binaryFile) { - if (!wasmBinary && (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER)) { - if (typeof fetch == "function" && !isFileURI(binaryFile)) { - return fetch(binaryFile, { - credentials: "same-origin" - }).then(function(response) { - if (!response["ok"]) { - throw "failed to load wasm binary file at '" + binaryFile + "'" - } - return response["arrayBuffer"]() - }).catch(function() { - return getBinary(binaryFile) - }) - } else { - if (readAsync) { - return new Promise(function(resolve, reject) { - readAsync(binaryFile, function(response) { - resolve(new Uint8Array(response)) - }, reject) - } - ) - } - } - } - return Promise.resolve().then(function() { - return getBinary(binaryFile) - }) -} -function instantiateArrayBuffer(binaryFile, imports, receiver) { - return getBinaryPromise(binaryFile).then(function(binary) { - return WebAssembly.instantiate(binary, imports) - }).then(function(instance) { - return instance - }).then(receiver, function(reason) { - err("failed to asynchronously prepare wasm: " + reason); - abort(reason) - }) -} -function instantiateAsync(binary, binaryFile, imports, callback) { - if (!binary && typeof WebAssembly.instantiateStreaming == "function" && !isDataURI(binaryFile) && !isFileURI(binaryFile) && !ENVIRONMENT_IS_NODE && typeof fetch == "function") { - return fetch(binaryFile, { - credentials: "same-origin" - }).then(function(response) - { - let responseClone = new Response(response.body, { headers: new Headers({"Content-Type": "application/wasm"}) }); - var result = WebAssembly.instantiateStreaming(responseClone, imports); - return result.then(callback, function(reason) { - err("wasm streaming compile failed: " + reason); - err("falling back to ArrayBuffer instantiation"); - return instantiateArrayBuffer(binaryFile, imports, callback) - }) - }) - } else { - return instantiateArrayBuffer(binaryFile, imports, callback) - } -} -function createWasm() { - var info = { - "a": wasmImports - }; - function receiveInstance(instance, module) { - var exports = instance.exports; - Module["asm"] = exports; - wasmMemory = Module["asm"]["f"]; - updateMemoryViews(); - wasmTable = Module["asm"]["r"]; - addOnInit(Module["asm"]["g"]); - removeRunDependency("wasm-instantiate"); - return exports - } - addRunDependency("wasm-instantiate"); - function receiveInstantiationResult(result) { - receiveInstance(result["instance"]) - } - if (Module["instantiateWasm"]) { - try { - return Module["instantiateWasm"](info, receiveInstance) - } catch (e) { - err("Module.instantiateWasm callback failed with error: " + e); - return false - } - } - instantiateAsync(wasmBinary, wasmBinaryFile, info, receiveInstantiationResult); - return {} -} -var tempDouble; -var tempI64; -var ASM_CONSTS = { - 2304: $0=>{ - console.log(UTF8ToString($0)) - } -}; -function ExitStatus(status) { - this.name = "ExitStatus"; - this.message = "Program terminated with exit(" + status + ")"; - this.status = status -} -function callRuntimeCallbacks(callbacks) { - while (callbacks.length > 0) { - callbacks.shift()(Module) - } -} -function getValue(ptr, type="i8") { - if (type.endsWith("*")) - type = "*"; - switch (type) { - case "i1": - return HEAP8[ptr >> 0]; - case "i8": - return HEAP8[ptr >> 0]; - case "i16": - return HEAP16[ptr >> 1]; - case "i32": - return HEAP32[ptr >> 2]; - case "i64": - return HEAP32[ptr >> 2]; - case "float": - return HEAPF32[ptr >> 2]; - case "double": - return HEAPF64[ptr >> 3]; - case "*": - return HEAPU32[ptr >> 2]; - default: - abort("invalid type for getValue: " + type) - } -} -function setValue(ptr, value, type="i8") { - if (type.endsWith("*")) - type = "*"; - switch (type) { - case "i1": - HEAP8[ptr >> 0] = value; - break; - case "i8": - HEAP8[ptr >> 0] = value; - break; - case "i16": - HEAP16[ptr >> 1] = value; - break; - case "i32": - HEAP32[ptr >> 2] = value; - break; - case "i64": - tempI64 = [value >>> 0, (tempDouble = value, - +Math.abs(tempDouble) >= 1 ? tempDouble > 0 ? (Math.min(+Math.floor(tempDouble / 4294967296), 4294967295) | 0) >>> 0 : ~~+Math.ceil((tempDouble - +(~~tempDouble >>> 0)) / 4294967296) >>> 0 : 0)], - HEAP32[ptr >> 2] = tempI64[0], - HEAP32[ptr + 4 >> 2] = tempI64[1]; - break; - case "float": - HEAPF32[ptr >> 2] = value; - break; - case "double": - HEAPF64[ptr >> 3] = value; - break; - case "*": - HEAPU32[ptr >> 2] = value; - break; - default: - abort("invalid type for setValue: " + type) - } -} -function _abort() { - abort("") -} -var readEmAsmArgsArray = []; -function readEmAsmArgs(sigPtr, buf) { - readEmAsmArgsArray.length = 0; - var ch; - buf >>= 2; - while (ch = HEAPU8[sigPtr++]) { - buf += ch != 105 & buf; - readEmAsmArgsArray.push(ch == 105 ? HEAP32[buf] : HEAPF64[buf++ >> 1]); - ++buf - } - return readEmAsmArgsArray -} -function runEmAsmFunction(code, sigPtr, argbuf) { - var args = readEmAsmArgs(sigPtr, argbuf); - return ASM_CONSTS[code].apply(null, args) -} -function _emscripten_asm_const_int(code, sigPtr, argbuf) { - return runEmAsmFunction(code, sigPtr, argbuf) -} -function _emscripten_date_now() { - return Date.now() -} -function _emscripten_memcpy_big(dest, src, num) { - HEAPU8.copyWithin(dest, src, src + num) -} -function getHeapMax() { - return 2147483648 -} -function emscripten_realloc_buffer(size) { - var b = wasmMemory.buffer; - try { - wasmMemory.grow(size - b.byteLength + 65535 >>> 16); - updateMemoryViews(); - return 1 - } catch (e) {} -} -function _emscripten_resize_heap(requestedSize) { - var oldSize = HEAPU8.length; - requestedSize = requestedSize >>> 0; - var maxHeapSize = getHeapMax(); - if (requestedSize > maxHeapSize) { - return false - } - let alignUp = (x,multiple)=>x + (multiple - x % multiple) % multiple; - for (var cutDown = 1; cutDown <= 4; cutDown *= 2) { - var overGrownHeapSize = oldSize * (1 + .2 / cutDown); - overGrownHeapSize = Math.min(overGrownHeapSize, requestedSize + 100663296); - var newSize = Math.min(maxHeapSize, alignUp(Math.max(requestedSize, overGrownHeapSize), 65536)); - var replacement = emscripten_realloc_buffer(newSize); - if (replacement) { - return true - } - } - return false -} -function getCFunc(ident) { - var func = Module["_" + ident]; - return func -} -function writeArrayToMemory(array, buffer) { - HEAP8.set(array, buffer) -} -function lengthBytesUTF8(str) { - var len = 0; - for (var i = 0; i < str.length; ++i) { - var c = str.charCodeAt(i); - if (c <= 127) { - len++ - } else if (c <= 2047) { - len += 2 - } else if (c >= 55296 && c <= 57343) { - len += 4; - ++i - } else { - len += 3 - } - } - return len -} -function stringToUTF8Array(str, heap, outIdx, maxBytesToWrite) { - if (!(maxBytesToWrite > 0)) - return 0; - var startIdx = outIdx; - var endIdx = outIdx + maxBytesToWrite - 1; - for (var i = 0; i < str.length; ++i) { - var u = str.charCodeAt(i); - if (u >= 55296 && u <= 57343) { - var u1 = str.charCodeAt(++i); - u = 65536 + ((u & 1023) << 10) | u1 & 1023 - } - if (u <= 127) { - if (outIdx >= endIdx) - break; - heap[outIdx++] = u - } else if (u <= 2047) { - if (outIdx + 1 >= endIdx) - break; - heap[outIdx++] = 192 | u >> 6; - heap[outIdx++] = 128 | u & 63 - } else if (u <= 65535) { - if (outIdx + 2 >= endIdx) - break; - heap[outIdx++] = 224 | u >> 12; - heap[outIdx++] = 128 | u >> 6 & 63; - heap[outIdx++] = 128 | u & 63 - } else { - if (outIdx + 3 >= endIdx) - break; - heap[outIdx++] = 240 | u >> 18; - heap[outIdx++] = 128 | u >> 12 & 63; - heap[outIdx++] = 128 | u >> 6 & 63; - heap[outIdx++] = 128 | u & 63 - } - } - heap[outIdx] = 0; - return outIdx - startIdx -} -function stringToUTF8(str, outPtr, maxBytesToWrite) { - return stringToUTF8Array(str, HEAPU8, outPtr, maxBytesToWrite) -} -function stringToUTF8OnStack(str) { - var size = lengthBytesUTF8(str) + 1; - var ret = stackAlloc(size); - stringToUTF8(str, ret, size); - return ret -} -var UTF8Decoder = typeof TextDecoder != "undefined" ? new TextDecoder("utf8") : undefined; -function UTF8ArrayToString(heapOrArray, idx, maxBytesToRead) { - var endIdx = idx + maxBytesToRead; - var endPtr = idx; - while (heapOrArray[endPtr] && !(endPtr >= endIdx)) - ++endPtr; - if (endPtr - idx > 16 && heapOrArray.buffer && UTF8Decoder) { - return UTF8Decoder.decode(heapOrArray.subarray(idx, endPtr)) - } - var str = ""; - while (idx < endPtr) { - var u0 = heapOrArray[idx++]; - if (!(u0 & 128)) { - str += String.fromCharCode(u0); - continue - } - var u1 = heapOrArray[idx++] & 63; - if ((u0 & 224) == 192) { - str += String.fromCharCode((u0 & 31) << 6 | u1); - continue - } - var u2 = heapOrArray[idx++] & 63; - if ((u0 & 240) == 224) { - u0 = (u0 & 15) << 12 | u1 << 6 | u2 - } else { - u0 = (u0 & 7) << 18 | u1 << 12 | u2 << 6 | heapOrArray[idx++] & 63 - } - if (u0 < 65536) { - str += String.fromCharCode(u0) - } else { - var ch = u0 - 65536; - str += String.fromCharCode(55296 | ch >> 10, 56320 | ch & 1023) - } - } - return str -} -function UTF8ToString(ptr, maxBytesToRead) { - return ptr ? UTF8ArrayToString(HEAPU8, ptr, maxBytesToRead) : "" -} -function ccall(ident, returnType, argTypes, args, opts) { - var toC = { - "string": str=>{ - var ret = 0; - if (str !== null && str !== undefined && str !== 0) { - ret = stringToUTF8OnStack(str) - } - return ret - } - , - "array": arr=>{ - var ret = stackAlloc(arr.length); - writeArrayToMemory(arr, ret); - return ret - } - }; - function convertReturnValue(ret) { - if (returnType === "string") { - return UTF8ToString(ret) - } - if (returnType === "boolean") - return Boolean(ret); - return ret - } - var func = getCFunc(ident); - var cArgs = []; - var stack = 0; - if (args) { - for (var i = 0; i < args.length; i++) { - var converter = toC[argTypes[i]]; - if (converter) { - if (stack === 0) - stack = stackSave(); - cArgs[i] = converter(args[i]) - } else { - cArgs[i] = args[i] - } - } - } - var ret = func.apply(null, cArgs); - function onDone(ret) { - if (stack !== 0) - stackRestore(stack); - return convertReturnValue(ret) - } - ret = onDone(ret); - return ret -} -function cwrap(ident, returnType, argTypes, opts) { - var numericArgs = !argTypes || argTypes.every(type=>type === "number" || type === "boolean"); - var numericRet = returnType !== "string"; - if (numericRet && numericArgs && !opts) { - return getCFunc(ident) - } - return function() { - return ccall(ident, returnType, argTypes, arguments, opts) - } -} -var wasmImports = { - "b": _abort, - "e": _emscripten_asm_const_int, - "d": _emscripten_date_now, - "c": _emscripten_memcpy_big, - "a": _emscripten_resize_heap -}; -var asm = createWasm(); -var ___wasm_call_ctors = function() { - return (___wasm_call_ctors = Module["asm"]["g"]).apply(null, arguments) -}; -var _SetBatchFractionSize = Module["_SetBatchFractionSize"] = function() { - return (_SetBatchFractionSize = Module["_SetBatchFractionSize"] = Module["asm"]["h"]).apply(null, arguments) -} -; -var _SetAttractionForce = Module["_SetAttractionForce"] = function() { - return (_SetAttractionForce = Module["_SetAttractionForce"] = Module["asm"]["i"]).apply(null, arguments) -} -; -var _SetLinkLength = Module["_SetLinkLength"] = function() { - return (_SetLinkLength = Module["_SetLinkLength"] = Module["asm"]["j"]).apply(null, arguments) -} -; -var _SetRepulsionForce = Module["_SetRepulsionForce"] = function() { - return (_SetRepulsionForce = Module["_SetRepulsionForce"] = Module["asm"]["k"]).apply(null, arguments) -} -; -var _SetCentralForce = Module["_SetCentralForce"] = function() { - return (_SetCentralForce = Module["_SetCentralForce"] = Module["asm"]["l"]).apply(null, arguments) -} -; -var _SetDt = Module["_SetDt"] = function() { - return (_SetDt = Module["_SetDt"] = Module["asm"]["m"]).apply(null, arguments) -} -; -var _Init = Module["_Init"] = function() { - return (_Init = Module["_Init"] = Module["asm"]["n"]).apply(null, arguments) -} -; -var _Update = Module["_Update"] = function() { - return (_Update = Module["_Update"] = Module["asm"]["o"]).apply(null, arguments) -} -; -var _SetPosition = Module["_SetPosition"] = function() { - return (_SetPosition = Module["_SetPosition"] = Module["asm"]["p"]).apply(null, arguments) -} -; -var _FreeMemory = Module["_FreeMemory"] = function() { - return (_FreeMemory = Module["_FreeMemory"] = Module["asm"]["q"]).apply(null, arguments) -} -; -var ___errno_location = function() { - return (___errno_location = Module["asm"]["__errno_location"]).apply(null, arguments) -}; -var _malloc = Module["_malloc"] = function() { - return (_malloc = Module["_malloc"] = Module["asm"]["s"]).apply(null, arguments) -} -; -var _free = Module["_free"] = function() { - return (_free = Module["_free"] = Module["asm"]["t"]).apply(null, arguments) -} -; -var stackSave = function() { - return (stackSave = Module["asm"]["u"]).apply(null, arguments) -}; -var stackRestore = function() { - return (stackRestore = Module["asm"]["v"]).apply(null, arguments) -}; -var stackAlloc = function() { - return (stackAlloc = Module["asm"]["w"]).apply(null, arguments) -}; -var ___cxa_is_pointer_type = function() { - return (___cxa_is_pointer_type = Module["asm"]["__cxa_is_pointer_type"]).apply(null, arguments) -}; -Module["cwrap"] = cwrap; -Module["setValue"] = setValue; -Module["getValue"] = getValue; -var calledRun; -dependenciesFulfilled = function runCaller() { - if (!calledRun) - run(); - if (!calledRun) - dependenciesFulfilled = runCaller -} -; -function run() { - if (runDependencies > 0) { - return - } - preRun(); - if (runDependencies > 0) { - return - } - function doRun() { - if (calledRun) - return; - calledRun = true; - Module["calledRun"] = true; - if (ABORT) - return; - initRuntime(); - if (Module["onRuntimeInitialized"]) - Module["onRuntimeInitialized"](); - postRun() - } - if (Module["setStatus"]) { - Module["setStatus"]("Running..."); - setTimeout(function() { - setTimeout(function() { - Module["setStatus"]("") - }, 1); - doRun() - }, 1) - } else { - doRun() - } -} -if (Module["preInit"]) { - if (typeof Module["preInit"] == "function") - Module["preInit"] = [Module["preInit"]]; - while (Module["preInit"].length > 0) { - Module["preInit"].pop()() - } -} - -try -{ - run(); -} -catch(e) -{ - console.error(e); -} diff --git a/.obsidian/plugins/obsidian-webpage-export-master/assets/graph-wasm.wasm b/.obsidian/plugins/obsidian-webpage-export-master/assets/graph-wasm.wasm deleted file mode 100644 index e94bee22..00000000 Binary files a/.obsidian/plugins/obsidian-webpage-export-master/assets/graph-wasm.wasm and /dev/null differ diff --git a/.obsidian/plugins/obsidian-webpage-export-master/assets/icon.png b/.obsidian/plugins/obsidian-webpage-export-master/assets/icon.png deleted file mode 100644 index 6f994895..00000000 Binary files a/.obsidian/plugins/obsidian-webpage-export-master/assets/icon.png and /dev/null differ diff --git a/.obsidian/plugins/obsidian-webpage-export-master/assets/minisearch.txt.js b/.obsidian/plugins/obsidian-webpage-export-master/assets/minisearch.txt.js deleted file mode 100644 index df2e78e6..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/assets/minisearch.txt.js +++ /dev/null @@ -1,5 +0,0 @@ -/** - * Minified by jsDelivr using Terser v5.19.2. - * Original file: /npm/minisearch@6.3.0/dist/umd/index.js - */ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).MiniSearch=e()}(this,(function(){"use strict";var t=function(){return t=Object.assign||function(t){for(var e,r=1,n=arguments.length;r0&&i[i.length-1])||6!==a[0]&&2!==a[0])){u=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function i(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,o=r.call(t),u=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)u.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return u}"function"==typeof SuppressedError&&SuppressedError;var o,u="KEYS",a="VALUES",s="",l=function(){function t(t,e){var r=t._tree,n=Array.from(r.keys());this.set=t,this._type=e,this._path=n.length>0?[{node:r,keys:n}]:[]}return t.prototype.next=function(){var t=this.dive();return this.backtrack(),t},t.prototype.dive=function(){if(0===this._path.length)return{done:!0,value:void 0};var t=c(this._path),e=t.node,r=t.keys;if(c(r)===s)return{done:!1,value:this.result()};var n=e.get(c(r));return this._path.push({node:n,keys:Array.from(n.keys())}),this.dive()},t.prototype.backtrack=function(){if(0!==this._path.length){var t=c(this._path).keys;t.pop(),t.length>0||(this._path.pop(),this.backtrack())}},t.prototype.key=function(){return this.set._prefix+this._path.map((function(t){var e=t.keys;return c(e)})).filter((function(t){return t!==s})).join("")},t.prototype.value=function(){return c(this._path).node.get(s)},t.prototype.result=function(){switch(this._type){case a:return this.value();case u:return this.key();default:return[this.key(),this.value()]}},t.prototype[Symbol.iterator]=function(){return this},t}(),c=function(t){return t[t.length-1]},h=function(t,e,r,i,o,u,a,l){var c,d,f=u*a;try{t:for(var y=n(t.keys()),v=y.next();!v.done;v=y.next()){var p=v.value;if(p===s){var m=o[f-1];m<=r&&i.set(l,[t.get(p),m])}else{for(var _=u,g=0;gr)continue t}h(t.get(p),e,r,i,o,_,a,l+p)}}}catch(t){c={error:t}}finally{try{v&&!v.done&&(d=y.return)&&d.call(y)}finally{if(c)throw c.error}}},d=function(){function t(t,e){void 0===t&&(t=new Map),void 0===e&&(e=""),this._size=void 0,this._tree=t,this._prefix=e}return t.prototype.atPrefix=function(e){var r,o;if(!e.startsWith(this._prefix))throw new Error("Mismatched prefix");var u=i(f(this._tree,e.slice(this._prefix.length)),2),a=u[0],l=u[1];if(void 0===a){var c=i(g(l),2),h=c[0],d=c[1];try{for(var y=n(h.keys()),v=y.next();!v.done;v=y.next()){var p=v.value;if(p!==s&&p.startsWith(d)){var m=new Map;return m.set(p.slice(d.length),h.get(p)),new t(m,e)}}}catch(t){r={error:t}}finally{try{v&&!v.done&&(o=y.return)&&o.call(y)}finally{if(r)throw r.error}}}return new t(a,e)},t.prototype.clear=function(){this._size=void 0,this._tree.clear()},t.prototype.delete=function(t){return this._size=void 0,p(this._tree,t)},t.prototype.entries=function(){return new l(this,"ENTRIES")},t.prototype.forEach=function(t){var e,r;try{for(var o=n(this),u=o.next();!u.done;u=o.next()){var a=i(u.value,2);t(a[0],a[1],this)}}catch(t){e={error:t}}finally{try{u&&!u.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}},t.prototype.fuzzyGet=function(t,e){return function(t,e,r){var n=new Map;if(void 0===e)return n;for(var i=e.length+1,o=i+r,u=new Uint8Array(o*i).fill(r+1),a=0;a0)throw new Error("Expected documents to be present. Omit the argument to remove all documents.");this._index=new d,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldLength=new Map,this._avgFieldLength=[],this._storedFields=new Map,this._nextId=0}},o.prototype.discard=function(t){var e=this,r=this._idToShortId.get(t);if(null==r)throw new Error("MiniSearch: cannot discard document with ID ".concat(t,": it is not in the index"));this._idToShortId.delete(t),this._documentIds.delete(r),this._storedFields.delete(r),(this._fieldLength.get(r)||[]).forEach((function(t,n){e.removeFieldLength(r,n,e._documentCount,t)})),this._fieldLength.delete(r),this._documentCount-=1,this._dirtCount+=1,this.maybeAutoVacuum()},o.prototype.maybeAutoVacuum=function(){if(!1!==this._options.autoVacuum){var t=this._options.autoVacuum,e=t.minDirtFactor,r=t.minDirtCount,n=t.batchSize,i=t.batchWait;this.conditionalVacuum({batchSize:n,batchWait:i},{minDirtCount:r,minDirtFactor:e})}},o.prototype.discardAll=function(t){var e,r,i=this._options.autoVacuum;try{this._options.autoVacuum=!1;try{for(var o=n(t),u=o.next();!u.done;u=o.next()){var a=u.value;this.discard(a)}}catch(t){e={error:t}}finally{try{u&&!u.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}}finally{this._options.autoVacuum=i}this.maybeAutoVacuum()},o.prototype.replace=function(t){var e=this._options,r=e.idField,n=(0,e.extractField)(t,r);this.discard(n),this.add(t)},o.prototype.vacuum=function(t){return void 0===t&&(t={}),this.conditionalVacuum(t)},o.prototype.conditionalVacuum=function(t,e){var r=this;return this._currentVacuum?(this._enqueuedVacuumConditions=this._enqueuedVacuumConditions&&e,null!=this._enqueuedVacuum||(this._enqueuedVacuum=this._currentVacuum.then((function(){var e=r._enqueuedVacuumConditions;return r._enqueuedVacuumConditions=I,r.performVacuuming(t,e)}))),this._enqueuedVacuum):!1===this.vacuumConditionsMet(e)?Promise.resolve():(this._currentVacuum=this.performVacuuming(t),this._currentVacuum)},o.prototype.performVacuuming=function(t,o){return e(this,void 0,void 0,(function(){var e,u,a,s,l,c,h,d,f,y,v,p,m,_,g,F,x,w,b,A,C,E,z,S,I;return r(this,(function(r){switch(r.label){case 0:if(e=this._dirtCount,!this.vacuumConditionsMet(o))return[3,10];u=t.batchSize||D.batchSize,a=t.batchWait||D.batchWait,s=1,r.label=1;case 1:r.trys.push([1,7,8,9]),l=n(this._index),c=l.next(),r.label=2;case 2:if(c.done)return[3,6];h=i(c.value,2),d=h[0],f=h[1];try{for(E=void 0,y=n(f),v=y.next();!v.done;v=y.next()){p=i(v.value,2),m=p[0],_=p[1];try{for(S=void 0,g=n(_),F=g.next();!F.done;F=g.next())x=i(F.value,1),w=x[0],this._documentIds.has(w)||(_.size<=1?f.delete(m):_.delete(w))}catch(t){S={error:t}}finally{try{F&&!F.done&&(I=g.return)&&I.call(g)}finally{if(S)throw S.error}}}}catch(t){E={error:t}}finally{try{v&&!v.done&&(z=y.return)&&z.call(y)}finally{if(E)throw E.error}}return 0===this._index.get(d).size&&this._index.delete(d),s%u!=0?[3,4]:[4,new Promise((function(t){return setTimeout(t,a)}))];case 3:r.sent(),r.label=4;case 4:s+=1,r.label=5;case 5:return c=l.next(),[3,2];case 6:return[3,9];case 7:return b=r.sent(),A={error:b},[3,9];case 8:try{c&&!c.done&&(C=l.return)&&C.call(l)}finally{if(A)throw A.error}return[7];case 9:this._dirtCount-=e,r.label=10;case 10:return[4,null];case 11:return r.sent(),this._currentVacuum=this._enqueuedVacuum,this._enqueuedVacuum=null,[2]}}))}))},o.prototype.vacuumConditionsMet=function(t){if(null==t)return!0;var e=t.minDirtCount,r=t.minDirtFactor;return e=e||k.minDirtCount,r=r||k.minDirtFactor,this.dirtCount>=e&&this.dirtFactor>=r},Object.defineProperty(o.prototype,"isVacuuming",{get:function(){return null!=this._currentVacuum},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"dirtCount",{get:function(){return this._dirtCount},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"dirtFactor",{get:function(){return this._dirtCount/(1+this._documentCount+this._dirtCount)},enumerable:!1,configurable:!0}),o.prototype.has=function(t){return this._idToShortId.has(t)},o.prototype.getStoredFields=function(t){var e=this._idToShortId.get(t);if(null!=e)return this._storedFields.get(e)},o.prototype.search=function(t,e){var r,u;void 0===e&&(e={});var a=this.executeQuery(t,e),s=[];try{for(var l=n(a),c=l.next();!c.done;c=l.next()){var h=i(c.value,2),d=h[0],f=h[1],y=f.score,v=f.terms,p=f.match,m=v.length||1,_={id:this._documentIds.get(d),score:y*m,terms:Object.keys(p),queryTerms:v,match:p};Object.assign(_,this._storedFields.get(d)),(null==e.filter||e.filter(_))&&s.push(_)}}catch(t){r={error:t}}finally{try{c&&!c.done&&(u=l.return)&&u.call(l)}finally{if(r)throw r.error}}return t===o.wildcard&&null==e.boostDocument&&null==this._options.searchOptions.boostDocument||s.sort(V),s},o.prototype.autoSuggest=function(e,r){var o,u,a,s;void 0===r&&(r={}),r=t(t({},this._options.autoSuggestOptions),r);var l=new Map;try{for(var c=n(this.search(e,r)),h=c.next();!h.done;h=c.next()){var d=h.value,f=d.score,y=(x=d.terms).join(" ");null!=(g=l.get(y))?(g.score+=f,g.count+=1):l.set(y,{score:f,terms:x,count:1})}}catch(t){o={error:t}}finally{try{h&&!h.done&&(u=c.return)&&u.call(c)}finally{if(o)throw o.error}}var v=[];try{for(var p=n(l),m=p.next();!m.done;m=p.next()){var _=i(m.value,2),g=_[0],F=_[1],x=(f=F.score,F.terms),w=F.count;v.push({suggestion:g,terms:x,score:f/w})}}catch(t){a={error:t}}finally{try{m&&!m.done&&(s=p.return)&&s.call(p)}finally{if(a)throw a.error}}return v.sort(V),v},Object.defineProperty(o.prototype,"documentCount",{get:function(){return this._documentCount},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"termCount",{get:function(){return this._index.size},enumerable:!1,configurable:!0}),o.loadJSON=function(t,e){if(null==e)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJS(JSON.parse(t),e)},o.getDefault=function(t){if(E.hasOwnProperty(t))return w(E,t);throw new Error('MiniSearch: unknown option "'.concat(t,'"'))},o.loadJS=function(t,e){var r,u,a,s,l,c,h=t.index,f=t.documentCount,y=t.nextId,v=t.documentIds,p=t.fieldIds,m=t.fieldLength,_=t.averageFieldLength,g=t.storedFields,F=t.dirtCount,x=t.serializationVersion;if(1!==x&&2!==x)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");var w=new o(e);w._documentCount=f,w._nextId=y,w._documentIds=L(v),w._idToShortId=new Map,w._fieldIds=p,w._fieldLength=L(m),w._avgFieldLength=_,w._storedFields=L(g),w._dirtCount=F||0,w._index=new d;try{for(var b=n(w._documentIds),A=b.next();!A.done;A=b.next()){var C=i(A.value,2),E=C[0],z=C[1];w._idToShortId.set(z,E)}}catch(t){r={error:t}}finally{try{A&&!A.done&&(u=b.return)&&u.call(b)}finally{if(r)throw r.error}}try{for(var S=n(h),D=S.next();!D.done;D=S.next()){var I=i(D.value,2),k=I[0],M=I[1],O=new Map;try{for(var V=(l=void 0,n(Object.keys(M))),T=V.next();!T.done;T=V.next()){var j=T.value,B=M[j];1===x&&(B=B.ds),O.set(parseInt(j,10),L(B))}}catch(t){l={error:t}}finally{try{T&&!T.done&&(c=V.return)&&c.call(V)}finally{if(l)throw l.error}}w._index.set(k,O)}}catch(t){a={error:t}}finally{try{D&&!D.done&&(s=S.return)&&s.call(S)}finally{if(a)throw a.error}}return w},o.prototype.executeQuery=function(e,r){var n=this;if(void 0===r&&(r={}),e===o.wildcard)return this.executeWildcardQuery(r);if("string"!=typeof e){var i=t(t(t({},r),e),{queries:void 0}),u=e.queries.map((function(t){return n.executeQuery(t,i)}));return this.combineResults(u,i.combineWith)}var a=this._options,s=a.tokenize,l=a.processTerm,c=a.searchOptions,h=t(t({tokenize:s,processTerm:l},c),r),d=h.tokenize,f=h.processTerm,y=d(e).flatMap((function(t){return f(t)})).filter((function(t){return!!t})).map(C(h)).map((function(t){return n.executeQuerySpec(t,h)}));return this.combineResults(y,h.combineWith)},o.prototype.executeQuerySpec=function(e,r){var o,u,a,s,l,c,h=t(t({},this._options.searchOptions),r),d=(h.fields||this._options.fields).reduce((function(e,r){var n;return t(t({},e),((n={})[r]=w(h.boost,r)||1,n))}),{}),f=h.boostDocument,y=h.weights,v=h.maxFuzzy,p=h.bm25,m=t(t({},z.weights),y),_=m.fuzzy,g=m.prefix,F=this._index.get(e.term),x=this.termResults(e.term,e.term,1,F,d,f,p);if(e.prefix&&(l=this._index.atPrefix(e.term)),e.fuzzy){var b=!0===e.fuzzy?.2:e.fuzzy,A=b<1?Math.min(v,Math.round(e.term.length*b)):b;A&&(c=this._index.fuzzyGet(e.term,A))}if(l)try{for(var C=n(l),E=C.next();!E.done;E=C.next()){var S=i(E.value,2),D=S[0],I=S[1];if(V=D.length-e.term.length){null==c||c.delete(D);var k=g*D.length/(D.length+.3*V);this.termResults(e.term,D,k,I,d,f,p,x)}}}catch(t){o={error:t}}finally{try{E&&!E.done&&(u=C.return)&&u.call(C)}finally{if(o)throw o.error}}if(c)try{for(var M=n(c.keys()),O=M.next();!O.done;O=M.next()){D=O.value;var V,T=i(c.get(D),2),L=T[0];if(V=T[1]){k=_*D.length/(D.length+V);this.termResults(e.term,D,k,L,d,f,p,x)}}}catch(t){a={error:t}}finally{try{O&&!O.done&&(s=M.return)&&s.call(M)}finally{if(a)throw a.error}}return x},o.prototype.executeWildcardQuery=function(e){var r,o,u=new Map,a=t(t({},this._options.searchOptions),e);try{for(var s=n(this._documentIds),l=s.next();!l.done;l=s.next()){var c=i(l.value,2),h=c[0],d=c[1],f=a.boostDocument?a.boostDocument(d,"",this._storedFields.get(h)):1;u.set(h,{score:f,terms:[],match:{}})}}catch(t){r={error:t}}finally{try{l&&!l.done&&(o=s.return)&&o.call(s)}finally{if(r)throw r.error}}return u},o.prototype.combineResults=function(t,e){if(void 0===e&&(e=F),0===t.length)return new Map;var r=e.toLowerCase();return t.reduce(b[r])||new Map},o.prototype.toJSON=function(){var t,e,r,o,u=[];try{for(var a=n(this._index),s=a.next();!s.done;s=a.next()){var l=i(s.value,2),c=l[0],h=l[1],d={};try{for(var f=(r=void 0,n(h)),y=f.next();!y.done;y=f.next()){var v=i(y.value,2),p=v[0],m=v[1];d[p]=Object.fromEntries(m)}}catch(t){r={error:t}}finally{try{y&&!y.done&&(o=f.return)&&o.call(f)}finally{if(r)throw r.error}}u.push([c,d])}}catch(e){t={error:e}}finally{try{s&&!s.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}return{documentCount:this._documentCount,nextId:this._nextId,documentIds:Object.fromEntries(this._documentIds),fieldIds:this._fieldIds,fieldLength:Object.fromEntries(this._fieldLength),averageFieldLength:this._avgFieldLength,storedFields:Object.fromEntries(this._storedFields),dirtCount:this._dirtCount,index:u,serializationVersion:2}},o.prototype.termResults=function(t,e,r,i,o,u,a,s){var l,c,h,d,f;if(void 0===s&&(s=new Map),null==i)return s;try{for(var y=n(Object.keys(o)),v=y.next();!v.done;v=y.next()){var p=v.value,m=o[p],_=this._fieldIds[p],g=i.get(_);if(null!=g){var F=g.size,x=this._avgFieldLength[_];try{for(var b=(h=void 0,n(g.keys())),C=b.next();!C.done;C=b.next()){var E=C.value;if(this._documentIds.has(E)){var z=u?u(this._documentIds.get(E),e,this._storedFields.get(E)):1;if(z){var S=g.get(E),D=this._fieldLength.get(E)[_],I=r*m*z*A(S,F,this._documentCount,D,x,a),k=s.get(E);if(k){k.score+=I,M(k.terms,t);var O=w(k.match,e);O?O.push(p):k.match[e]=[p]}else s.set(E,{score:I,terms:[t],match:(f={},f[e]=[p],f)})}}else this.removeTerm(_,E,e),F-=1}}catch(t){h={error:t}}finally{try{C&&!C.done&&(d=b.return)&&d.call(b)}finally{if(h)throw h.error}}}}}catch(t){l={error:t}}finally{try{v&&!v.done&&(c=y.return)&&c.call(y)}finally{if(l)throw l.error}}return s},o.prototype.addTerm=function(t,e,r){var n=this._index.fetch(r,T),i=n.get(t);if(null==i)(i=new Map).set(e,1),n.set(t,i);else{var o=i.get(e);i.set(e,(o||0)+1)}},o.prototype.removeTerm=function(t,e,r){if(this._index.has(r)){var n=this._index.fetch(r,T),i=n.get(t);null==i||null==i.get(e)?this.warnDocumentChanged(e,t,r):i.get(e)<=1?i.size<=1?n.delete(t):i.delete(e):i.set(e,i.get(e)-1),0===this._index.get(r).size&&this._index.delete(r)}else this.warnDocumentChanged(e,t,r)},o.prototype.warnDocumentChanged=function(t,e,r){var i,o;try{for(var u=n(Object.keys(this._fieldIds)),a=u.next();!a.done;a=u.next()){var s=a.value;if(this._fieldIds[s]===e)return void this._options.logger("warn","MiniSearch: document with ID ".concat(this._documentIds.get(t),' has changed before removal: term "').concat(r,'" was not present in field "').concat(s,'". Removing a document after it has changed can corrupt the index!'),"version_conflict")}}catch(t){i={error:t}}finally{try{a&&!a.done&&(o=u.return)&&o.call(u)}finally{if(i)throw i.error}}},o.prototype.addDocumentId=function(t){var e=this._nextId;return this._idToShortId.set(t,e),this._documentIds.set(e,t),this._documentCount+=1,this._nextId+=1,e},o.prototype.addFields=function(t){for(var e=0;e :not(.print) - { - display: unset !important; - } - - .collapse-indicator - { - display: none !important; - } - - .is-collapsed > element > .collapse-indicator - { - display: unset !important; - } -} - -/*#region Misc Hiding */ - -.mod-header .metadata-container -{ - display: none !important; -} - -/*#endregion */ - -/*#region Transclusions */ - -.markdown-embed .heading-collapse-indicator { - translate: -1em 0; -} - -.markdown-embed.internal-embed.inline-embed .markdown-embed-content, -.markdown-embed.internal-embed.inline-embed .markdown-embed-content .markdown-preview-view -{ - overflow: visible !important; -} - -.markdown-embed-link -{ - display: none !important; -} - -/*#endregion */ - -/*#region Canvas */ - -.canvas-wrapper:not(.mod-readonly) .canvas-node-content.markdown-embed>.markdown-embed-content>.markdown-preview-view -{ - user-select: text !important; -} - -.canvas-card-menu { - display: none; - cursor: default !important; - -} - -.canvas-controls { - display: none; - cursor: default !important; - -} - -.canvas-background -{ - pointer-events: visible !important; - cursor: grab !important; -} - -.canvas-background:active -{ - cursor: grabbing !important; -} - -.canvas-node-connection-point -{ - display: none; - cursor: default !important; - -} - -.canvas-node-content -{ - backface-visibility: visible !important; -} - -.canvas-menu-container { - display: none; -} - -.canvas-node-content-blocker -{ - cursor: pointer !important; -} - -.canvas-wrapper -{ - position: relative; - cursor: default !important; -} - -.canvas-node-resizer -{ - cursor: default !important; -} - -.canvas-node-container -{ - cursor: default !important; -} - -/*#endregion */ - -/*#region Code Copy */ - -/* Make code block copy button fade in and out */ -.markdown-rendered pre:not(:hover) > button.copy-code-button -{ - display: unset; - opacity: 0; -} - -.markdown-rendered pre:hover > button.copy-code-button -{ - opacity: 1; -} - -.markdown-rendered pre button.copy-code-button -{ - transition: opacity 0.2s ease-in-out, width 0.3s ease-in-out, background-color 0.2s ease-in-out; - text-overflow: clip; -} - -.markdown-rendered pre > button.copy-code-button:hover -{ - background-color: var(--interactive-normal); -} - -.markdown-rendered pre > button.copy-code-button:active -{ - background-color: var(--interactive-hover); - box-shadow: var(--input-shadow); - transition: none; -} - -/*#endregion */ - -/*#region Lists */ - -.webpage-container .is-collapsed .list-collapse-indicator svg.svg-icon, -.webpage-container .is-collapsed .collapse-indicator svg.svg-icon -{ - color: var(--collapse-icon-color-collapsed); -} - -/*#endregion */ diff --git a/.obsidian/plugins/obsidian-webpage-export-master/assets/pixi.txt.js b/.obsidian/plugins/obsidian-webpage-export-master/assets/pixi.txt.js deleted file mode 100644 index 972c52c8..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/assets/pixi.txt.js +++ /dev/null @@ -1,1161 +0,0 @@ -var qd=Object.defineProperty,Kd=Object.defineProperties;var Zd=Object.getOwnPropertyDescriptors;var ir=Object.getOwnPropertySymbols;var $h=Object.prototype.hasOwnProperty,jh=Object.prototype.propertyIsEnumerable;var Wh=(m,et,pt)=>et in m?qd(m,et,{enumerable:!0,configurable:!0,writable:!0,value:pt}):m[et]=pt,bt=(m,et)=>{for(var pt in et||(et={}))$h.call(et,pt)&&Wh(m,pt,et[pt]);if(ir)for(var pt of ir(et))jh.call(et,pt)&&Wh(m,pt,et[pt]);return m},Qi=(m,et)=>Kd(m,Zd(et));var zn=(m,et)=>{var pt={};for(var Rt in m)$h.call(m,Rt)&&et.indexOf(Rt)<0&&(pt[Rt]=m[Rt]);if(m!=null&&ir)for(var Rt of ir(m))et.indexOf(Rt)<0&&jh.call(m,Rt)&&(pt[Rt]=m[Rt]);return pt};/*! - * pixi.js - v7.2.4 - * Compiled Thu, 06 Apr 2023 19:36:45 UTC - * - * pixi.js is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - */var PIXI=function(m){var zh;"use strict";var et=(e=>(e[e.WEBGL_LEGACY=0]="WEBGL_LEGACY",e[e.WEBGL=1]="WEBGL",e[e.WEBGL2=2]="WEBGL2",e))(et||{}),pt=(e=>(e[e.UNKNOWN=0]="UNKNOWN",e[e.WEBGL=1]="WEBGL",e[e.CANVAS=2]="CANVAS",e))(pt||{}),Rt=(e=>(e[e.COLOR=16384]="COLOR",e[e.DEPTH=256]="DEPTH",e[e.STENCIL=1024]="STENCIL",e))(Rt||{}),G=(e=>(e[e.NORMAL=0]="NORMAL",e[e.ADD=1]="ADD",e[e.MULTIPLY=2]="MULTIPLY",e[e.SCREEN=3]="SCREEN",e[e.OVERLAY=4]="OVERLAY",e[e.DARKEN=5]="DARKEN",e[e.LIGHTEN=6]="LIGHTEN",e[e.COLOR_DODGE=7]="COLOR_DODGE",e[e.COLOR_BURN=8]="COLOR_BURN",e[e.HARD_LIGHT=9]="HARD_LIGHT",e[e.SOFT_LIGHT=10]="SOFT_LIGHT",e[e.DIFFERENCE=11]="DIFFERENCE",e[e.EXCLUSION=12]="EXCLUSION",e[e.HUE=13]="HUE",e[e.SATURATION=14]="SATURATION",e[e.COLOR=15]="COLOR",e[e.LUMINOSITY=16]="LUMINOSITY",e[e.NORMAL_NPM=17]="NORMAL_NPM",e[e.ADD_NPM=18]="ADD_NPM",e[e.SCREEN_NPM=19]="SCREEN_NPM",e[e.NONE=20]="NONE",e[e.SRC_OVER=0]="SRC_OVER",e[e.SRC_IN=21]="SRC_IN",e[e.SRC_OUT=22]="SRC_OUT",e[e.SRC_ATOP=23]="SRC_ATOP",e[e.DST_OVER=24]="DST_OVER",e[e.DST_IN=25]="DST_IN",e[e.DST_OUT=26]="DST_OUT",e[e.DST_ATOP=27]="DST_ATOP",e[e.ERASE=26]="ERASE",e[e.SUBTRACT=28]="SUBTRACT",e[e.XOR=29]="XOR",e))(G||{}),zt=(e=>(e[e.POINTS=0]="POINTS",e[e.LINES=1]="LINES",e[e.LINE_LOOP=2]="LINE_LOOP",e[e.LINE_STRIP=3]="LINE_STRIP",e[e.TRIANGLES=4]="TRIANGLES",e[e.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",e[e.TRIANGLE_FAN=6]="TRIANGLE_FAN",e))(zt||{}),C=(e=>(e[e.RGBA=6408]="RGBA",e[e.RGB=6407]="RGB",e[e.RG=33319]="RG",e[e.RED=6403]="RED",e[e.RGBA_INTEGER=36249]="RGBA_INTEGER",e[e.RGB_INTEGER=36248]="RGB_INTEGER",e[e.RG_INTEGER=33320]="RG_INTEGER",e[e.RED_INTEGER=36244]="RED_INTEGER",e[e.ALPHA=6406]="ALPHA",e[e.LUMINANCE=6409]="LUMINANCE",e[e.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",e[e.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",e[e.DEPTH_STENCIL=34041]="DEPTH_STENCIL",e))(C||{}),Re=(e=>(e[e.TEXTURE_2D=3553]="TEXTURE_2D",e[e.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",e[e.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",e[e.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",e[e.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",e[e.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",e[e.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",e[e.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",e[e.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",e))(Re||{}),k=(e=>(e[e.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",e[e.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",e[e.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",e[e.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",e[e.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",e[e.UNSIGNED_INT=5125]="UNSIGNED_INT",e[e.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",e[e.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",e[e.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",e[e.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",e[e.BYTE=5120]="BYTE",e[e.SHORT=5122]="SHORT",e[e.INT=5124]="INT",e[e.FLOAT=5126]="FLOAT",e[e.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",e[e.HALF_FLOAT=36193]="HALF_FLOAT",e))(k||{}),ts=(e=>(e[e.FLOAT=0]="FLOAT",e[e.INT=1]="INT",e[e.UINT=2]="UINT",e))(ts||{}),ee=(e=>(e[e.NEAREST=0]="NEAREST",e[e.LINEAR=1]="LINEAR",e))(ee||{}),ie=(e=>(e[e.CLAMP=33071]="CLAMP",e[e.REPEAT=10497]="REPEAT",e[e.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",e))(ie||{}),Wt=(e=>(e[e.OFF=0]="OFF",e[e.POW2=1]="POW2",e[e.ON=2]="ON",e[e.ON_MANUAL=3]="ON_MANUAL",e))(Wt||{}),Nt=(e=>(e[e.NPM=0]="NPM",e[e.UNPACK=1]="UNPACK",e[e.PMA=2]="PMA",e[e.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",e[e.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",e[e.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA",e))(Nt||{}),$t=(e=>(e[e.NO=0]="NO",e[e.YES=1]="YES",e[e.AUTO=2]="AUTO",e[e.BLEND=0]="BLEND",e[e.CLEAR=1]="CLEAR",e[e.BLIT=2]="BLIT",e))($t||{}),es=(e=>(e[e.AUTO=0]="AUTO",e[e.MANUAL=1]="MANUAL",e))(es||{}),Pt=(e=>(e.LOW="lowp",e.MEDIUM="mediump",e.HIGH="highp",e))(Pt||{}),ct=(e=>(e[e.NONE=0]="NONE",e[e.SCISSOR=1]="SCISSOR",e[e.STENCIL=2]="STENCIL",e[e.SPRITE=3]="SPRITE",e[e.COLOR=4]="COLOR",e))(ct||{}),Wn=(e=>(e[e.RED=1]="RED",e[e.GREEN=2]="GREEN",e[e.BLUE=4]="BLUE",e[e.ALPHA=8]="ALPHA",e))(Wn||{}),ht=(e=>(e[e.NONE=0]="NONE",e[e.LOW=2]="LOW",e[e.MEDIUM=4]="MEDIUM",e[e.HIGH=8]="HIGH",e))(ht||{}),jt=(e=>(e[e.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",e[e.ARRAY_BUFFER=34962]="ARRAY_BUFFER",e[e.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",e))(jt||{});const $n={createCanvas:(e,t)=>{const i=document.createElement("canvas");return i.width=e,i.height=t,i},getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>{var e;return(e=document.baseURI)!=null?e:window.location.href},getFontFaceSet:()=>document.fonts,fetch:(e,t)=>fetch(e,t),parseXML:e=>new DOMParser().parseFromString(e,"text/xml")},P={ADAPTER:$n,RESOLUTION:1,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1};var sr=/iPhone/i,jn=/iPod/i,Yn=/iPad/i,qn=/\biOS-universal(?:.+)Mac\b/i,rr=/\bAndroid(?:.+)Mobile\b/i,Kn=/Android/i,Xe=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,is=/Silk/i,ce=/Windows Phone/i,Zn=/\bWindows(?:.+)ARM\b/i,Jn=/BlackBerry/i,Qn=/BB10/i,to=/Opera Mini/i,eo=/\b(CriOS|Chrome)(?:.+)Mobile/i,io=/Mobile(?:.+)Firefox\b/i,so=function(e){return typeof e!="undefined"&&e.platform==="MacIntel"&&typeof e.maxTouchPoints=="number"&&e.maxTouchPoints>1&&typeof MSStream=="undefined"};function Yh(e){return function(t){return t.test(e)}}function ro(e){var t={userAgent:"",platform:"",maxTouchPoints:0};!e&&typeof navigator!="undefined"?t={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof e=="string"?t.userAgent=e:e&&e.userAgent&&(t={userAgent:e.userAgent,platform:e.platform,maxTouchPoints:e.maxTouchPoints||0});var i=t.userAgent,s=i.split("[FBAN");typeof s[1]!="undefined"&&(i=s[0]),s=i.split("Twitter"),typeof s[1]!="undefined"&&(i=s[0]);var r=Yh(i),n={apple:{phone:r(sr)&&!r(ce),ipod:r(jn),tablet:!r(sr)&&(r(Yn)||so(t))&&!r(ce),universal:r(qn),device:(r(sr)||r(jn)||r(Yn)||r(qn)||so(t))&&!r(ce)},amazon:{phone:r(Xe),tablet:!r(Xe)&&r(is),device:r(Xe)||r(is)},android:{phone:!r(ce)&&r(Xe)||!r(ce)&&r(rr),tablet:!r(ce)&&!r(Xe)&&!r(rr)&&(r(is)||r(Kn)),device:!r(ce)&&(r(Xe)||r(is)||r(rr)||r(Kn))||r(/\bokhttp\b/i)},windows:{phone:r(ce),tablet:r(Zn),device:r(ce)||r(Zn)},other:{blackberry:r(Jn),blackberry10:r(Qn),opera:r(to),firefox:r(io),chrome:r(eo),device:r(Jn)||r(Qn)||r(to)||r(io)||r(eo)},any:!1,phone:!1,tablet:!1};return n.any=n.apple.device||n.android.device||n.windows.device||n.other.device,n.phone=n.apple.phone||n.android.phone||n.windows.phone,n.tablet=n.apple.tablet||n.android.tablet||n.windows.tablet,n}const Yt=((zh=ro.default)!=null?zh:ro)(globalThis.navigator);P.RETINA_PREFIX=/@([0-9\.]+)x/,P.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var nr=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function Qd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function or(e,t,i){return i={path:t,exports:{},require:function(s,r){return qh(s,r==null?i.path:r)}},e(i,i.exports),i.exports}function tf(e){return e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ef(e){return e&&Object.prototype.hasOwnProperty.call(e,"default")&&Object.keys(e).length===1?e.default:e}function sf(e){if(e.__esModule)return e;var t=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(e).forEach(function(i){var s=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:function(){return e[i]}})}),t}function qh(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var Ve=or(function(e){"use strict";var t=Object.prototype.hasOwnProperty,i="~";function s(){}Object.create&&(s.prototype=Object.create(null),new s().__proto__||(i=!1));function r(h,l,c){this.fn=h,this.context=l,this.once=c||!1}function n(h,l,c,u,d){if(typeof c!="function")throw new TypeError("The listener must be a function");var f=new r(c,u||h,d),p=i?i+l:l;return h._events[p]?h._events[p].fn?h._events[p]=[h._events[p],f]:h._events[p].push(f):(h._events[p]=f,h._eventsCount++),h}function o(h,l){--h._eventsCount===0?h._events=new s:delete h._events[l]}function a(){this._events=new s,this._eventsCount=0}a.prototype.eventNames=function(){var l=[],c,u;if(this._eventsCount===0)return l;for(u in c=this._events)t.call(c,u)&&l.push(i?u.slice(1):u);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(c)):l},a.prototype.listeners=function(l){var c=i?i+l:l,u=this._events[c];if(!u)return[];if(u.fn)return[u.fn];for(var d=0,f=u.length,p=new Array(f);d80*i){a=l=e[0],h=c=e[1];for(var p=i;pl&&(l=u),d>c&&(c=d);f=Math.max(l-a,c-h),f=f!==0?32767/f:0}return li(n,o,i,a,h,f,0),o}function no(e,t,i,s,r){var n,o;if(r===cr(e,t,i,s)>0)for(n=t;n=t;n-=s)o=ho(n,e[n],e[n+1],o);return o&&rs(o,o.next)&&(ui(o),o=o.next),o}function Ce(e,t){if(!e)return e;t||(t=e);var i=e,s;do if(s=!1,!i.steiner&&(rs(i,i.next)||nt(i.prev,i,i.next)===0)){if(ui(i),i=t=i.prev,i===i.next)break;s=!0}else i=i.next;while(s||i!==t);return t}function li(e,t,i,s,r,n,o){if(!!e){!o&&n&&ol(e,s,r,n);for(var a=e,h,l;e.prev!==e.next;){if(h=e.prev,l=e.next,n?Jh(e,s,r,n):Zh(e)){t.push(h.i/i|0),t.push(e.i/i|0),t.push(l.i/i|0),ui(e),e=l.next,a=l.next;continue}if(e=l,e===a){o?o===1?(e=Qh(Ce(e),t,i),li(e,t,i,s,r,n,2)):o===2&&tl(e,t,i,s,r,n):li(Ce(e),t,i,s,r,n,1);break}}}}function Zh(e){var t=e.prev,i=e,s=e.next;if(nt(t,i,s)>=0)return!1;for(var r=t.x,n=i.x,o=s.x,a=t.y,h=i.y,l=s.y,c=rn?r>o?r:o:n>o?n:o,f=a>h?a>l?a:l:h>l?h:l,p=s.next;p!==t;){if(p.x>=c&&p.x<=d&&p.y>=u&&p.y<=f&&ze(r,a,n,h,o,l,p.x,p.y)&&nt(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function Jh(e,t,i,s){var r=e.prev,n=e,o=e.next;if(nt(r,n,o)>=0)return!1;for(var a=r.x,h=n.x,l=o.x,c=r.y,u=n.y,d=o.y,f=ah?a>l?a:l:h>l?h:l,g=c>u?c>d?c:d:u>d?u:d,v=hr(f,p,t,i,s),b=hr(_,g,t,i,s),y=e.prevZ,x=e.nextZ;y&&y.z>=v&&x&&x.z<=b;){if(y.x>=f&&y.x<=_&&y.y>=p&&y.y<=g&&y!==r&&y!==o&&ze(a,c,h,u,l,d,y.x,y.y)&&nt(y.prev,y,y.next)>=0||(y=y.prevZ,x.x>=f&&x.x<=_&&x.y>=p&&x.y<=g&&x!==r&&x!==o&&ze(a,c,h,u,l,d,x.x,x.y)&&nt(x.prev,x,x.next)>=0))return!1;x=x.nextZ}for(;y&&y.z>=v;){if(y.x>=f&&y.x<=_&&y.y>=p&&y.y<=g&&y!==r&&y!==o&&ze(a,c,h,u,l,d,y.x,y.y)&&nt(y.prev,y,y.next)>=0)return!1;y=y.prevZ}for(;x&&x.z<=b;){if(x.x>=f&&x.x<=_&&x.y>=p&&x.y<=g&&x!==r&&x!==o&&ze(a,c,h,u,l,d,x.x,x.y)&&nt(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function Qh(e,t,i){var s=e;do{var r=s.prev,n=s.next.next;!rs(r,n)&&oo(r,s,s.next,n)&&ci(r,n)&&ci(n,r)&&(t.push(r.i/i|0),t.push(s.i/i|0),t.push(n.i/i|0),ui(s),ui(s.next),s=e=n),s=s.next}while(s!==e);return Ce(s)}function tl(e,t,i,s,r,n){var o=e;do{for(var a=o.next.next;a!==o.prev;){if(o.i!==a.i&&ll(o,a)){var h=ao(o,a);o=Ce(o,o.next),h=Ce(h,h.next),li(o,t,i,s,r,n,0),li(h,t,i,s,r,n,0);return}a=a.next}o=o.next}while(o!==e)}function el(e,t,i,s){var r=[],n,o,a,h,l;for(n=0,o=t.length;n=i.next.y&&i.next.y!==i.y){var a=i.x+(r-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(a<=s&&a>n&&(n=a,o=i.x=i.x&&i.x>=l&&s!==i.x&&ze(ro.x||i.x===o.x&&nl(o,i)))&&(o=i,u=d)),i=i.next;while(i!==h);return o}function nl(e,t){return nt(e.prev,e,t.prev)<0&&nt(t.next,e,e.next)<0}function ol(e,t,i,s){var r=e;do r.z===0&&(r.z=hr(r.x,r.y,t,i,s)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==e);r.prevZ.nextZ=null,r.prevZ=null,al(r)}function al(e){var t,i,s,r,n,o,a,h,l=1;do{for(i=e,e=null,n=null,o=0;i;){for(o++,s=i,a=0,t=0;t0||h>0&&s;)a!==0&&(h===0||!s||i.z<=s.z)?(r=i,i=i.nextZ,a--):(r=s,s=s.nextZ,h--),n?n.nextZ=r:e=r,r.prevZ=n,n=r;i=s}n.nextZ=null,l*=2}while(o>1);return e}function hr(e,t,i,s,r){return e=(e-i)*r|0,t=(t-s)*r|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function hl(e){var t=e,i=e;do(t.x=(e-o)*(n-a)&&(e-o)*(s-a)>=(i-o)*(t-a)&&(i-o)*(n-a)>=(r-o)*(s-a)}function ll(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!cl(e,t)&&(ci(e,t)&&ci(t,e)&&ul(e,t)&&(nt(e.prev,e,t.prev)||nt(e,t.prev,t))||rs(e,t)&&nt(e.prev,e,e.next)>0&&nt(t.prev,t,t.next)>0)}function nt(e,t,i){return(t.y-e.y)*(i.x-t.x)-(t.x-e.x)*(i.y-t.y)}function rs(e,t){return e.x===t.x&&e.y===t.y}function oo(e,t,i,s){var r=os(nt(e,t,i)),n=os(nt(e,t,s)),o=os(nt(i,s,e)),a=os(nt(i,s,t));return!!(r!==n&&o!==a||r===0&&ns(e,i,t)||n===0&&ns(e,s,t)||o===0&&ns(i,e,s)||a===0&&ns(i,t,s))}function ns(e,t,i){return t.x<=Math.max(e.x,i.x)&&t.x>=Math.min(e.x,i.x)&&t.y<=Math.max(e.y,i.y)&&t.y>=Math.min(e.y,i.y)}function os(e){return e>0?1:e<0?-1:0}function cl(e,t){var i=e;do{if(i.i!==e.i&&i.next.i!==e.i&&i.i!==t.i&&i.next.i!==t.i&&oo(i,i.next,e,t))return!0;i=i.next}while(i!==e);return!1}function ci(e,t){return nt(e.prev,e,e.next)<0?nt(e,t,e.next)>=0&&nt(e,e.prev,t)>=0:nt(e,t,e.prev)<0||nt(e,e.next,t)<0}function ul(e,t){var i=e,s=!1,r=(e.x+t.x)/2,n=(e.y+t.y)/2;do i.y>n!=i.next.y>n&&i.next.y!==i.y&&r<(i.next.x-i.x)*(n-i.y)/(i.next.y-i.y)+i.x&&(s=!s),i=i.next;while(i!==e);return s}function ao(e,t){var i=new lr(e.i,e.x,e.y),s=new lr(t.i,t.x,t.y),r=e.next,n=t.prev;return e.next=t,t.prev=e,i.next=r,r.prev=i,s.next=i,i.prev=s,n.next=s,s.prev=n,s}function ho(e,t,i,s){var r=new lr(e,t,i);return s?(r.next=s.next,r.prev=s,s.next.prev=r,s.next=r):(r.prev=r,r.next=r),r}function ui(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function lr(e,t,i){this.i=e,this.x=t,this.y=i,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}ss.deviation=function(e,t,i,s){var r=t&&t.length,n=r?t[0]*i:e.length,o=Math.abs(cr(e,0,n,i));if(r)for(var a=0,h=t.length;a0&&(s+=e[r-1].length,i.holes.push(s))}return i},ar.default=Kh;var dl=or(function(e,t){/*! https://mths.be/punycode v1.3.2 by @mathias */(function(i){var s=t&&!t.nodeType&&t,r=e&&!e.nodeType&&e,n=typeof nr=="object"&&nr;(n.global===n||n.window===n||n.self===n)&&(i=n);var o,a=2147483647,h=36,l=1,c=26,u=38,d=700,f=72,p=128,_="-",g=/^xn--/,v=/[^\x20-\x7E]/,b=/[\x2E\u3002\uFF0E\uFF61]/g,y={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},x=h-l,A=Math.floor,D=String.fromCharCode,R;function E(S){throw RangeError(y[S])}function O(S,X){for(var K=S.length,J=[];K--;)J[K]=X(S[K]);return J}function H(S,X){var K=S.split("@"),J="";K.length>1&&(J=K[0]+"@",S=K[1]),S=S.replace(b,".");var Q=S.split("."),vt=O(Q,X).join(".");return J+vt}function I(S){for(var X=[],K=0,J=S.length,Q,vt;K=55296&&Q<=56319&&K65535&&(X-=65536,K+=D(X>>>10&1023|55296),X=56320|X&1023),K+=D(X),K}).join("")}function w(S){return S-48<10?S-22:S-65<26?S-65:S-97<26?S-97:h}function T(S,X){return S+22+75*(S<26)-((X!=0)<<5)}function W(S,X,K){var J=0;for(S=K?A(S/d):S>>1,S+=A(S/X);S>x*c>>1;J+=h)S=A(S/x);return A(J+(x+1)*S/(S+u))}function q(S){var X=[],K=S.length,J,Q=0,vt=p,ut=f,xt,wt,Ft,Et,rt,dt,ft,he,le;for(xt=S.lastIndexOf(_),xt<0&&(xt=0),wt=0;wt=128&&E("not-basic"),X.push(S.charCodeAt(wt));for(Ft=xt>0?xt+1:0;Ft=K&&E("invalid-input"),ft=w(S.charCodeAt(Ft++)),(ft>=h||ft>A((a-Q)/rt))&&E("overflow"),Q+=ft*rt,he=dt<=ut?l:dt>=ut+c?c:dt-ut,!(ftA(a/le)&&E("overflow"),rt*=le;J=X.length+1,ut=W(Q-Et,J,Et==0),A(Q/J)>a-vt&&E("overflow"),vt+=A(Q/J),Q%=J,X.splice(Q++,0,vt)}return N(X)}function F(S){var X,K,J,Q,vt,ut,xt,wt,Ft,Et,rt,dt=[],ft,he,le,Ji;for(S=I(S),ft=S.length,X=p,K=0,vt=f,ut=0;ut=X&&rtA((a-K)/he)&&E("overflow"),K+=(xt-X)*he,X=xt,ut=0;uta&&E("overflow"),rt==X){for(wt=K,Ft=h;Et=Ft<=vt?l:Ft>=vt+c?c:Ft-vt,!(wt0&&a>o&&(a=o);for(var h=0;h=0?(u=l.substr(0,c),d=l.substr(c+1)):(u=l,d=""),f=decodeURIComponent(u),p=decodeURIComponent(d),fl(r,f)?Array.isArray(r[f])?r[f].push(p):r[f]=[r[f],p]:r[f]=p}return r},di=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}},ml=function(e,t,i,s){return t=t||"&",i=i||"=",e===null&&(e=void 0),typeof e=="object"?Object.keys(e).map(function(r){var n=encodeURIComponent(di(r))+i;return Array.isArray(e[r])?e[r].map(function(o){return n+encodeURIComponent(di(o))}).join(t):n+encodeURIComponent(di(e[r]))}).join(t):s?encodeURIComponent(di(s))+i+encodeURIComponent(di(e)):""},ur=or(function(e,t){"use strict";t.decode=t.parse=pl,t.encode=t.stringify=ml}),lo=fi,co=Rl,_l=Cl,uo=Al,gl=Lt;function Lt(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var yl=/^([a-z0-9.+-]+:)/i,vl=/:[0-9]*$/,xl=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,bl=["<",">",'"',"`"," ","\r",` -`," "],Tl=["{","}","|","\\","^","`"].concat(bl),dr=["'"].concat(Tl),fo=["%","/","?",";","#"].concat(dr),po=["/","?","#"],El=255,mo=/^[+a-z0-9A-Z_-]{0,63}$/,wl=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Sl={javascript:!0,"javascript:":!0},fr={javascript:!0,"javascript:":!0},We={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function fi(e,t,i){if(e&&se.isObject(e)&&e instanceof Lt)return e;var s=new Lt;return s.parse(e,t,i),s}Lt.prototype.parse=function(e,t,i){if(!se.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var s=e.indexOf("?"),r=s!==-1&&s127?A+="x":A+=x[D];if(!A.match(mo)){var E=b.slice(0,f),O=b.slice(f+1),H=x.match(wl);H&&(E.push(H[1]),O.unshift(H[2])),O.length&&(a="/"+O.join(".")+a),this.hostname=E.join(".");break}}}this.hostname.length>El?this.hostname="":this.hostname=this.hostname.toLowerCase(),v||(this.hostname=dl.toASCII(this.hostname));var I=this.port?":"+this.port:"",N=this.hostname||"";this.host=N+I,this.href+=this.host,v&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),a[0]!=="/"&&(a="/"+a))}if(!Sl[c])for(var f=0,y=dr.length;f0?i.host.split("@"):!1;A&&(i.auth=A.shift(),i.host=i.hostname=A.shift())}return i.search=e.search,i.query=e.query,(!se.isNull(i.pathname)||!se.isNull(i.search))&&(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.href=i.format(),i}if(!b.length)return i.pathname=null,i.search?i.path="/"+i.search:i.path=null,i.href=i.format(),i;for(var D=b.slice(-1)[0],R=(i.host||e.host||b.length>1)&&(D==="."||D==="..")||D==="",E=0,O=b.length;O>=0;O--)D=b[O],D==="."?b.splice(O,1):D===".."?(b.splice(O,1),E++):E&&(b.splice(O,1),E--);if(!g&&!v)for(;E--;E)b.unshift("..");g&&b[0]!==""&&(!b[0]||b[0].charAt(0)!=="/")&&b.unshift(""),R&&b.join("/").substr(-1)!=="/"&&b.push("");var H=b[0]===""||b[0]&&b[0].charAt(0)==="/";if(x){i.hostname=i.host=H?"":b.length?b.shift():"";var A=i.host&&i.host.indexOf("@")>0?i.host.split("@"):!1;A&&(i.auth=A.shift(),i.host=i.hostname=A.shift())}return g=g||i.host&&b.length,g&&!H&&b.unshift(""),b.length?i.pathname=b.join("/"):(i.pathname=null,i.path=null),(!se.isNull(i.pathname)||!se.isNull(i.search))&&(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.auth=e.auth||i.auth,i.slashes=i.slashes||e.slashes,i.href=i.format(),i},Lt.prototype.parseHost=function(){var e=this.host,t=vl.exec(e);t&&(t=t[0],t!==":"&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};var rf={parse:lo,resolve:co,resolveObject:_l,format:uo,Url:gl};const _o={parse:lo,format:uo,resolve:co};function qt(e){if(typeof e!="string")throw new TypeError(`Path must be a string. Received ${JSON.stringify(e)}`)}function pi(e){return e.split("?")[0].split("#")[0]}function Il(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Pl(e,t,i){return e.replace(new RegExp(Il(t),"g"),i)}function Ml(e,t){let i="",s=0,r=-1,n=0,o=-1;for(let a=0;a<=e.length;++a){if(a2){const h=i.lastIndexOf("/");if(h!==i.length-1){h===-1?(i="",s=0):(i=i.slice(0,h),s=i.length-1-i.lastIndexOf("/")),r=a,n=0;continue}}else if(i.length===2||i.length===1){i="",s=0,r=a,n=0;continue}}t&&(i.length>0?i+="/..":i="..",s=2)}else i.length>0?i+=`/${e.slice(r+1,a)}`:i=e.slice(r+1,a),s=a-r-1;r=a,n=0}else o===46&&n!==-1?++n:n=-1}return i}const Tt={toPosix(e){return Pl(e,"\\","/")},isUrl(e){return/^https?:/.test(this.toPosix(e))},isDataUrl(e){return/^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(e)},hasProtocol(e){return/^[^/:]+:\//.test(this.toPosix(e))},getProtocol(e){qt(e),e=this.toPosix(e);let t="";const i=/^file:\/\/\//.exec(e),s=/^[^/:]+:\/\//.exec(e),r=/^[^/:]+:\//.exec(e);if(i||s||r){const n=(i==null?void 0:i[0])||(s==null?void 0:s[0])||(r==null?void 0:r[0]);t=n,e=e.slice(n.length)}return t},toAbsolute(e,t,i){if(this.isDataUrl(e))return e;const s=pi(this.toPosix(t!=null?t:P.ADAPTER.getBaseUrl())),r=pi(this.toPosix(i!=null?i:this.rootname(s)));return qt(e),e=this.toPosix(e),e.startsWith("/")?Tt.join(r,e.slice(1)):this.isAbsolute(e)?e:this.join(s,e)},normalize(e){if(e=this.toPosix(e),qt(e),e.length===0)return".";let t="";const i=e.startsWith("/");this.hasProtocol(e)&&(t=this.rootname(e),e=e.slice(t.length));const s=e.endsWith("/");return e=Ml(e,!1),e.length>0&&s&&(e+="/"),i?`/${e}`:t+e},isAbsolute(e){return qt(e),e=this.toPosix(e),this.hasProtocol(e)?!0:e.startsWith("/")},join(...e){var i;if(e.length===0)return".";let t;for(let s=0;s0)if(t===void 0)t=r;else{const n=(i=e[s-1])!=null?i:"";this.extname(n)?t+=`/../${r}`:t+=`/${r}`}}return t===void 0?".":this.normalize(t)},dirname(e){if(qt(e),e.length===0)return".";e=this.toPosix(e);let t=e.charCodeAt(0);const i=t===47;let s=-1,r=!0;const n=this.getProtocol(e),o=e;e=e.slice(n.length);for(let a=e.length-1;a>=1;--a)if(t=e.charCodeAt(a),t===47){if(!r){s=a;break}}else r=!1;return s===-1?i?"/":this.isUrl(o)?n+e:n:i&&s===1?"//":n+e.slice(0,s)},rootname(e){qt(e),e=this.toPosix(e);let t="";if(e.startsWith("/")?t="/":t=this.getProtocol(e),this.isUrl(e)){const i=e.indexOf("/",t.length);i!==-1?t=e.slice(0,i):t=e,t.endsWith("/")||(t+="/")}return t},basename(e,t){qt(e),t&&qt(t),e=pi(this.toPosix(e));let i=0,s=-1,r=!0,n;if(t!==void 0&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return"";let o=t.length-1,a=-1;for(n=e.length-1;n>=0;--n){const h=e.charCodeAt(n);if(h===47){if(!r){i=n+1;break}}else a===-1&&(r=!1,a=n+1),o>=0&&(h===t.charCodeAt(o)?--o===-1&&(s=n):(o=-1,s=a))}return i===s?s=a:s===-1&&(s=e.length),e.slice(i,s)}for(n=e.length-1;n>=0;--n)if(e.charCodeAt(n)===47){if(!r){i=n+1;break}}else s===-1&&(r=!1,s=n+1);return s===-1?"":e.slice(i,s)},extname(e){qt(e),e=pi(this.toPosix(e));let t=-1,i=0,s=-1,r=!0,n=0;for(let o=e.length-1;o>=0;--o){const a=e.charCodeAt(o);if(a===47){if(!r){i=o+1;break}continue}s===-1&&(r=!1,s=o+1),a===46?t===-1?t=o:n!==1&&(n=1):t!==-1&&(n=-1)}return t===-1||s===-1||n===0||n===1&&t===s-1&&t===i+1?"":e.slice(t,s)},parse(e){qt(e);const t={root:"",dir:"",base:"",ext:"",name:""};if(e.length===0)return t;e=pi(this.toPosix(e));let i=e.charCodeAt(0);const s=this.isAbsolute(e);let r;const n="";t.root=this.rootname(e),s||this.hasProtocol(e)?r=1:r=0;let o=-1,a=0,h=-1,l=!0,c=e.length-1,u=0;for(;c>=r;--c){if(i=e.charCodeAt(c),i===47){if(!l){a=c+1;break}continue}h===-1&&(l=!1,h=c+1),i===46?o===-1?o=c:u!==1&&(u=1):o!==-1&&(u=-1)}return o===-1||h===-1||u===0||u===1&&o===h-1&&o===a+1?h!==-1&&(a===0&&s?t.base=t.name=e.slice(1,h):t.base=t.name=e.slice(a,h)):(a===0&&s?(t.name=e.slice(1,o),t.base=e.slice(1,h)):(t.name=e.slice(a,o),t.base=e.slice(a,h)),t.ext=e.slice(o,h)),t.dir=this.dirname(e),n&&(t.dir=n+t.dir),t},sep:"/",delimiter:":"},go={};function z(e,t,i=3){if(go[t])return;let s=new Error().stack;typeof s=="undefined"?console.warn("PixiJS Deprecation Warning: ",`${t} -Deprecated since v${e}`):(s=s.split(` -`).splice(i).join(` -`),console.groupCollapsed?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",`${t} -Deprecated since v${e}`),console.warn(s),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",`${t} -Deprecated since v${e}`),console.warn(s))),go[t]=!0}function Bl(){z("7.0.0","skipHello is deprecated, please use settings.RENDER_OPTIONS.hello")}function Dl(){z("7.0.0",`sayHello is deprecated, please use Renderer's "hello" option`)}let pr;function yo(){return typeof pr=="undefined"&&(pr=function(){var i;const t={stencil:!0,failIfMajorPerformanceCaveat:P.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!P.ADAPTER.getWebGLRenderingContext())return!1;const s=P.ADAPTER.createCanvas();let r=s.getContext("webgl",t)||s.getContext("experimental-webgl",t);const n=!!((i=r==null?void 0:r.getContextAttributes())!=null&&i.stencil);if(r){const o=r.getExtension("WEBGL_lose_context");o&&o.loseContext()}return r=null,n}catch(s){return!1}}()),pr}var Fl={grad:.9,turn:360,rad:360/(2*Math.PI)},ue=function(e){return typeof e=="string"?e.length>0:typeof e=="number"},mt=function(e,t,i){return t===void 0&&(t=0),i===void 0&&(i=Math.pow(10,t)),Math.round(i*e)/i+0},Ot=function(e,t,i){return t===void 0&&(t=0),i===void 0&&(i=1),e>i?i:e>t?e:t},vo=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},xo=function(e){return{r:Ot(e.r,0,255),g:Ot(e.g,0,255),b:Ot(e.b,0,255),a:Ot(e.a)}},mr=function(e){return{r:mt(e.r),g:mt(e.g),b:mt(e.b),a:mt(e.a,3)}},Nl=/^#([0-9a-f]{3,8})$/i,as=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},bo=function(e){var t=e.r,i=e.g,s=e.b,r=e.a,n=Math.max(t,i,s),o=n-Math.min(t,i,s),a=o?n===t?(i-s)/o:n===i?2+(s-t)/o:4+(t-i)/o:0;return{h:60*(a<0?a+6:a),s:n?o/n*100:0,v:n/255*100,a:r}},To=function(e){var t=e.h,i=e.s,s=e.v,r=e.a;t=t/360*6,i/=100,s/=100;var n=Math.floor(t),o=s*(1-i),a=s*(1-(t-n)*i),h=s*(1-(1-t+n)*i),l=n%6;return{r:255*[s,a,o,o,h,s][l],g:255*[h,s,s,a,o,o][l],b:255*[o,o,h,s,s,a][l],a:r}},Eo=function(e){return{h:vo(e.h),s:Ot(e.s,0,100),l:Ot(e.l,0,100),a:Ot(e.a)}},wo=function(e){return{h:mt(e.h),s:mt(e.s),l:mt(e.l),a:mt(e.a,3)}},So=function(e){return To((i=(t=e).s,{h:t.h,s:(i*=((s=t.l)<50?s:100-s)/100)>0?2*i/(s+i)*100:0,v:s+i,a:t.a}));var t,i,s},mi=function(e){return{h:(t=bo(e)).h,s:(r=(200-(i=t.s))*(s=t.v)/100)>0&&r<200?i*s/100/(r<=100?r:200-r)*100:0,l:r/2,a:t.a};var t,i,s,r},Ll=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Ol=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Ul=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,kl=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,_r={string:[[function(e){var t=Nl.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?mt(parseInt(e[3]+e[3],16)/255,2):1}:e.length===6||e.length===8?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:e.length===8?mt(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=Ul.exec(e)||kl.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:xo({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=Ll.exec(e)||Ol.exec(e);if(!t)return null;var i,s,r=Eo({h:(i=t[1],s=t[2],s===void 0&&(s="deg"),Number(i)*(Fl[s]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return So(r)},"hsl"]],object:[[function(e){var t=e.r,i=e.g,s=e.b,r=e.a,n=r===void 0?1:r;return ue(t)&&ue(i)&&ue(s)?xo({r:Number(t),g:Number(i),b:Number(s),a:Number(n)}):null},"rgb"],[function(e){var t=e.h,i=e.s,s=e.l,r=e.a,n=r===void 0?1:r;if(!ue(t)||!ue(i)||!ue(s))return null;var o=Eo({h:Number(t),s:Number(i),l:Number(s),a:Number(n)});return So(o)},"hsl"],[function(e){var t=e.h,i=e.s,s=e.v,r=e.a,n=r===void 0?1:r;if(!ue(t)||!ue(i)||!ue(s))return null;var o=function(a){return{h:vo(a.h),s:Ot(a.s,0,100),v:Ot(a.v,0,100),a:Ot(a.a)}}({h:Number(t),s:Number(i),v:Number(s),a:Number(n)});return To(o)},"hsv"]]},Ao=function(e,t){for(var i=0;i=.5},e.prototype.toHex=function(){return t=mr(this.rgba),i=t.r,s=t.g,r=t.b,o=(n=t.a)<1?as(mt(255*n)):"","#"+as(i)+as(s)+as(r)+o;var t,i,s,r,n,o},e.prototype.toRgb=function(){return mr(this.rgba)},e.prototype.toRgbString=function(){return t=mr(this.rgba),i=t.r,s=t.g,r=t.b,(n=t.a)<1?"rgba("+i+", "+s+", "+r+", "+n+")":"rgb("+i+", "+s+", "+r+")";var t,i,s,r,n},e.prototype.toHsl=function(){return wo(mi(this.rgba))},e.prototype.toHslString=function(){return t=wo(mi(this.rgba)),i=t.h,s=t.s,r=t.l,(n=t.a)<1?"hsla("+i+", "+s+"%, "+r+"%, "+n+")":"hsl("+i+", "+s+"%, "+r+"%)";var t,i,s,r,n},e.prototype.toHsv=function(){return t=bo(this.rgba),{h:mt(t.h),s:mt(t.s),v:mt(t.v),a:mt(t.a,3)};var t},e.prototype.invert=function(){return re({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},e.prototype.saturate=function(t){return t===void 0&&(t=.1),re(gr(this.rgba,t))},e.prototype.desaturate=function(t){return t===void 0&&(t=.1),re(gr(this.rgba,-t))},e.prototype.grayscale=function(){return re(gr(this.rgba,-1))},e.prototype.lighten=function(t){return t===void 0&&(t=.1),re(Co(this.rgba,t))},e.prototype.darken=function(t){return t===void 0&&(t=.1),re(Co(this.rgba,-t))},e.prototype.rotate=function(t){return t===void 0&&(t=15),this.hue(this.hue()+t)},e.prototype.alpha=function(t){return typeof t=="number"?re({r:(i=this.rgba).r,g:i.g,b:i.b,a:t}):mt(this.rgba.a,3);var i},e.prototype.hue=function(t){var i=mi(this.rgba);return typeof t=="number"?re({h:t,s:i.s,l:i.l,a:i.a}):mt(i.h)},e.prototype.isEqual=function(t){return this.toHex()===re(t).toHex()},e}(),re=function(e){return e instanceof hs?e:new hs(e)},Io=[],Gl=function(e){e.forEach(function(t){Io.indexOf(t)<0&&(t(hs,_r),Io.push(t))})},of=function(){return new hs({r:255*Math.random(),g:255*Math.random(),b:255*Math.random()})};function Hl(e,t){var i={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},s={};for(var r in i)s[i[r]]=r;var n={};e.prototype.toName=function(o){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var a,h,l=s[this.toHex()];if(l)return l;if(o!=null&&o.closest){var c=this.toRgb(),u=1/0,d="black";if(!n.length)for(var f in i)n[f]=new e(i[f]).toRgb();for(var p in i){var _=(a=c,h=n[p],Math.pow(a.r-h.r,2)+Math.pow(a.g-h.g,2)+Math.pow(a.b-h.b,2));_r===t[n]);if(e!==null&&t!==null){const r=Object.keys(e),n=Object.keys(t);return r.length!==n.length?!1:r.every(o=>e[o]===t[o])}return e===t}toRgba(){const[e,t,i,s]=this._components;return{r:e,g:t,b:i,a:s}}toRgb(){const[e,t,i]=this._components;return{r:e,g:t,b:i}}toRgbaString(){const[e,t,i]=this.toUint8RgbArray();return`rgba(${e},${t},${i},${this.alpha})`}toUint8RgbArray(e){const[t,i,s]=this._components;return e=e!=null?e:[],e[0]=Math.round(t*255),e[1]=Math.round(i*255),e[2]=Math.round(s*255),e}toRgbArray(e){e=e!=null?e:[];const[t,i,s]=this._components;return e[0]=t,e[1]=i,e[2]=s,e}toNumber(){return this._int}toLittleEndianNumber(){const e=this._int;return(e>>16)+(e&65280)+((e&255)<<16)}multiply(e){const[t,i,s,r]=$e.temp.setValue(e)._components;return this._components[0]*=t,this._components[1]*=i,this._components[2]*=s,this._components[3]*=r,this.refreshInt(),this._value=null,this}premultiply(e,t=!0){return t&&(this._components[0]*=e,this._components[1]*=e,this._components[2]*=e),this._components[3]=e,this.refreshInt(),this._value=null,this}toPremultiplied(e,t=!0){if(e===1)return(255<<24)+this._int;if(e===0)return t?0:this._int;let i=this._int>>16&255,s=this._int>>8&255,r=this._int&255;return t&&(i=i*e+.5|0,s=s*e+.5|0,r=r*e+.5|0),(e*255<<24)+(i<<16)+(s<<8)+r}toHex(){const e=this._int.toString(16);return`#${"000000".substring(0,6-e.length)+e}`}toHexa(){const t=Math.round(this._components[3]*255).toString(16);return this.toHex()+"00".substring(0,2-t.length)+t}setAlpha(e){return this._components[3]=this._clamp(e),this}round(e){const[t,i,s]=this._components;return this._components[0]=Math.round(t*e)/e,this._components[1]=Math.round(i*e)/e,this._components[2]=Math.round(s*e)/e,this.refreshInt(),this._value=null,this}toArray(e){e=e!=null?e:[];const[t,i,s,r]=this._components;return e[0]=t,e[1]=i,e[2]=s,e[3]=r,e}normalize(e){let t,i,s,r;if((typeof e=="number"||e instanceof Number)&&e>=0&&e<=16777215){const n=e;t=(n>>16&255)/255,i=(n>>8&255)/255,s=(n&255)/255,r=1}else if((Array.isArray(e)||e instanceof Float32Array)&&e.length>=3&&e.length<=4)e=this._clamp(e),[t,i,s,r=1]=e;else if((e instanceof Uint8Array||e instanceof Uint8ClampedArray)&&e.length>=3&&e.length<=4)e=this._clamp(e,0,255),[t,i,s,r=255]=e,t/=255,i/=255,s/=255,r/=255;else if(typeof e=="string"||typeof e=="object"){if(typeof e=="string"){const o=$e.HEX_PATTERN.exec(e);o&&(e=`#${o[2]}`)}const n=re(e);n.isValid()&&({r:t,g:i,b:s,a:r}=n.rgba,t/=255,i/=255,s/=255)}if(t!==void 0)this._components[0]=t,this._components[1]=i,this._components[2]=s,this._components[3]=r,this.refreshInt();else throw new Error(`Unable to convert color ${e}`)}refreshInt(){this._clamp(this._components);const[e,t,i]=this._components;this._int=(e*255<<16)+(t*255<<8)+(i*255|0)}_clamp(e,t=0,i=1){return typeof e=="number"?Math.min(Math.max(e,t),i):(e.forEach((s,r)=>{e[r]=Math.min(Math.max(s,t),i)}),e)}};let j=$e;j.shared=new $e,j.temp=new $e,j.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;function Xl(e,t=[]){return z("7.2.0","utils.hex2rgb is deprecated, use Color#toRgbArray instead"),j.shared.setValue(e).toRgbArray(t)}function Po(e){return z("7.2.0","utils.hex2string is deprecated, use Color#toHex instead"),j.shared.setValue(e).toHex()}function Vl(e){return z("7.2.0","utils.string2hex is deprecated, use Color#toNumber instead"),j.shared.setValue(e).toNumber()}function Mo(e){return z("7.2.0","utils.rgb2hex is deprecated, use Color#toNumber instead"),j.shared.setValue(e).toNumber()}function zl(){const e=[],t=[];for(let s=0;s<32;s++)e[s]=s,t[s]=s;e[G.NORMAL_NPM]=G.NORMAL,e[G.ADD_NPM]=G.ADD,e[G.SCREEN_NPM]=G.SCREEN,t[G.NORMAL]=G.NORMAL_NPM,t[G.ADD]=G.ADD_NPM,t[G.SCREEN]=G.SCREEN_NPM;const i=[];return i.push(t),i.push(e),i}const vr=zl();function xr(e,t){return vr[t?1:0][e]}function Wl(e,t,i,s=!0){return z("7.2.0","utils.premultiplyRgba has moved to Color.premultiply"),j.shared.setValue(e).premultiply(t,s).toArray(i!=null?i:new Float32Array(4))}function $l(e,t){return z("7.2.0","utils.premultiplyTint has moved to Color.toPremultiplied"),j.shared.setValue(e).toPremultiplied(t)}function jl(e,t,i,s=!0){return z("7.2.0","utils.premultiplyTintToRgba has moved to Color.premultiply"),j.shared.setValue(e).premultiply(t,s).toArray(i!=null?i:new Float32Array(4))}const Bo=/^\s*data:(?:([\w-]+)\/([\w+.-]+))?(?:;charset=([\w-]+))?(?:;(base64))?,(.*)/i;function Do(e,t=null){const i=e*6;if(t=t||new Uint16Array(i),t.length!==i)throw new Error(`Out buffer length is incorrect, got ${t.length} and expected ${i}`);for(let s=0,r=0;s>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e+1}function br(e){return!(e&e-1)&&!!e}function Tr(e){let t=(e>65535?1:0)<<4;e>>>=t;let i=(e>255?1:0)<<3;return e>>>=i,t|=i,i=(e>15?1:0)<<2,e>>>=i,t|=i,i=(e>3?1:0)<<1,e>>>=i,t|=i,t|e>>1}function Ie(e,t,i){const s=e.length;let r;if(t>=s||i===0)return;i=t+i>s?s-t:i;const n=s-i;for(r=t;r(e.Renderer="renderer",e.Application="application",e.RendererSystem="renderer-webgl-system",e.RendererPlugin="renderer-webgl-plugin",e.CanvasRendererSystem="renderer-canvas-system",e.CanvasRendererPlugin="renderer-canvas-plugin",e.Asset="asset",e.LoadParser="load-parser",e.ResolveParser="resolve-parser",e.CacheParser="cache-parser",e.DetectionParser="detection-parser",e))(M||{});const wr=e=>{if(typeof e=="function"||typeof e=="object"&&e.extension){if(!e.extension)throw new Error("Extension class must have an extension object");const t=typeof e.extension!="object"?{type:e.extension}:e.extension;e=Qi(bt({},t),{ref:e})}if(typeof e=="object")e=bt({},e);else throw new Error("Invalid extension type");return typeof e.type=="string"&&(e.type=[e.type]),e},Ho=(e,t)=>{var i;return(i=wr(e).priority)!=null?i:t},U={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...e){return e.map(wr).forEach(t=>{t.type.forEach(i=>{var s,r;return(r=(s=this._removeHandlers)[i])==null?void 0:r.call(s,t)})}),this},add(...e){return e.map(wr).forEach(t=>{t.type.forEach(i=>{const s=this._addHandlers,r=this._queue;s[i]?s[i](t):(r[i]=r[i]||[],r[i].push(t))})}),this},handle(e,t,i){const s=this._addHandlers,r=this._removeHandlers;if(s[e]||r[e])throw new Error(`Extension type ${e} already has a handler`);s[e]=t,r[e]=i;const n=this._queue;return n[e]&&(n[e].forEach(o=>t(o)),delete n[e]),this},handleByMap(e,t){return this.handle(e,i=>{t[i.name]=i.ref},i=>{delete t[i.name]})},handleByList(e,t,i=-1){return this.handle(e,s=>{t.includes(s.ref)||(t.push(s.ref),t.sort((r,n)=>Ho(n,i)-Ho(r,i)))},s=>{const r=t.indexOf(s.ref);r!==-1&&t.splice(r,1)})}};class ds{constructor(t){typeof t=="number"?this.rawBinaryData=new ArrayBuffer(t):t instanceof Uint8Array?this.rawBinaryData=t.buffer:this.rawBinaryData=t,this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData)}get int8View(){return this._int8View||(this._int8View=new Int8Array(this.rawBinaryData)),this._int8View}get uint8View(){return this._uint8View||(this._uint8View=new Uint8Array(this.rawBinaryData)),this._uint8View}get int16View(){return this._int16View||(this._int16View=new Int16Array(this.rawBinaryData)),this._int16View}get uint16View(){return this._uint16View||(this._uint16View=new Uint16Array(this.rawBinaryData)),this._uint16View}get int32View(){return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View}view(t){return this[`${t}View`]}destroy(){this.rawBinaryData=null,this._int8View=null,this._uint8View=null,this._int16View=null,this._uint16View=null,this._int32View=null,this.uint32View=null,this.float32View=null}static sizeOf(t){switch(t){case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;default:throw new Error(`${t} isn't a valid view type`)}}}const ec=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(` -`);function ic(e){let t="";for(let i=0;i0&&(t+=` -else `),i=0;--s){const r=fs[s];if(r.test&&r.test(e,i))return new r(e,t)}throw new Error("Unrecognized source type to auto-detect Resource")}class Bt{constructor(t){this.items=[],this._name=t,this._aliasCount=0}emit(t,i,s,r,n,o,a,h){if(arguments.length>8)throw new Error("max arguments reached");const{name:l,items:c}=this;this._aliasCount++;for(let u=0,d=c.length;u0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))}add(t){return t[this._name]&&(this.ensureNonAliasedItems(),this.remove(t),this.items.push(t)),this}remove(t){const i=this.items.indexOf(t);return i!==-1&&(this.ensureNonAliasedItems(),this.items.splice(i,1)),this}contains(t){return this.items.includes(t)}removeAll(){return this.ensureNonAliasedItems(),this.items.length=0,this}destroy(){this.removeAll(),this.items=null,this._name=null}get empty(){return this.items.length===0}get name(){return this._name}}Object.defineProperties(Bt.prototype,{dispatch:{value:Bt.prototype.emit},run:{value:Bt.prototype.emit}});class je{constructor(t=0,i=0){this._width=t,this._height=i,this.destroyed=!1,this.internal=!1,this.onResize=new Bt("setRealSize"),this.onUpdate=new Bt("update"),this.onError=new Bt("onError")}bind(t){this.onResize.add(t),this.onUpdate.add(t),this.onError.add(t),(this._width||this._height)&&this.onResize.emit(this._width,this._height)}unbind(t){this.onResize.remove(t),this.onUpdate.remove(t),this.onError.remove(t)}resize(t,i){(t!==this._width||i!==this._height)&&(this._width=t,this._height=i,this.onResize.emit(t,i))}get valid(){return!!this._width&&!!this._height}update(){this.destroyed||this.onUpdate.emit()}load(){return Promise.resolve(this)}get width(){return this._width}get height(){return this._height}style(t,i,s){return!1}dispose(){}destroy(){this.destroyed||(this.destroyed=!0,this.dispose(),this.onError.removeAll(),this.onError=null,this.onResize.removeAll(),this.onResize=null,this.onUpdate.removeAll(),this.onUpdate=null)}static test(t,i){return!1}}class Ye extends je{constructor(t,i){const{width:s,height:r}=i||{};if(!s||!r)throw new Error("BufferResource width or height invalid");super(s,r),this.data=t}upload(t,i,s){const r=t.gl;r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i.alphaMode===Nt.UNPACK);const n=i.realWidth,o=i.realHeight;return s.width===n&&s.height===o?r.texSubImage2D(i.target,0,0,0,n,o,i.format,s.type,this.data):(s.width=n,s.height=o,r.texImage2D(i.target,0,s.internalFormat,n,o,0,i.format,s.type,this.data)),!0}dispose(){this.data=null}static test(t){return t instanceof Float32Array||t instanceof Uint8Array||t instanceof Uint32Array}}const sc={scaleMode:ee.NEAREST,format:C.RGBA,alphaMode:Nt.NPM},qe=class extends Ve{constructor(e=null,t=null){super(),t=Object.assign({},qe.defaultOptions,t);const{alphaMode:i,mipmap:s,anisotropicLevel:r,scaleMode:n,width:o,height:a,wrapMode:h,format:l,type:c,target:u,resolution:d,resourceOptions:f}=t;e&&!(e instanceof je)&&(e=Mr(e,f),e.internal=!0),this.resolution=d||P.RESOLUTION,this.width=Math.round((o||0)*this.resolution)/this.resolution,this.height=Math.round((a||0)*this.resolution)/this.resolution,this._mipmap=s,this.anisotropicLevel=r,this._wrapMode=h,this._scaleMode=n,this.format=l,this.type=c,this.target=u,this.alphaMode=i,this.uid=xe(),this.touched=0,this.isPowerOfTwo=!1,this._refreshPOT(),this._glTextures={},this.dirtyId=0,this.dirtyStyleId=0,this.cacheId=null,this.valid=o>0&&a>0,this.textureCacheIds=[],this.destroyed=!1,this.resource=null,this._batchEnabled=0,this._batchLocation=0,this.parentTextureArray=null,this.setResource(e)}get realWidth(){return Math.round(this.width*this.resolution)}get realHeight(){return Math.round(this.height*this.resolution)}get mipmap(){return this._mipmap}set mipmap(e){this._mipmap!==e&&(this._mipmap=e,this.dirtyStyleId++)}get scaleMode(){return this._scaleMode}set scaleMode(e){this._scaleMode!==e&&(this._scaleMode=e,this.dirtyStyleId++)}get wrapMode(){return this._wrapMode}set wrapMode(e){this._wrapMode!==e&&(this._wrapMode=e,this.dirtyStyleId++)}setStyle(e,t){let i;return e!==void 0&&e!==this.scaleMode&&(this.scaleMode=e,i=!0),t!==void 0&&t!==this.mipmap&&(this.mipmap=t,i=!0),i&&this.dirtyStyleId++,this}setSize(e,t,i){return i=i||this.resolution,this.setRealSize(e*i,t*i,i)}setRealSize(e,t,i){return this.resolution=i||this.resolution,this.width=Math.round(e)/this.resolution,this.height=Math.round(t)/this.resolution,this._refreshPOT(),this.update(),this}_refreshPOT(){this.isPowerOfTwo=br(this.realWidth)&&br(this.realHeight)}setResolution(e){const t=this.resolution;return t===e?this:(this.resolution=e,this.valid&&(this.width=Math.round(this.width*t)/e,this.height=Math.round(this.height*t)/e,this.emit("update",this)),this._refreshPOT(),this)}setResource(e){if(this.resource===e)return this;if(this.resource)throw new Error("Resource can be set only once");return e.bind(this),this.resource=e,this}update(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))}onError(e){this.emit("error",this,e)}destroy(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete Mt[this.cacheId],delete St[this.cacheId],this.cacheId=null),this.dispose(),qe.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0}dispose(){this.emit("dispose",this)}castToBaseTexture(){return this}static from(e,t,i=P.STRICT_TEXTURE_CACHE){const s=typeof e=="string";let r=null;if(s)r=e;else{if(!e._pixiId){const o=(t==null?void 0:t.pixiIdPrefix)||"pixiid";e._pixiId=`${o}_${xe()}`}r=e._pixiId}let n=Mt[r];if(s&&i&&!n)throw new Error(`The cacheId "${r}" does not exist in BaseTextureCache.`);return n||(n=new qe(e,t),n.cacheId=r,qe.addToCache(n,r)),n}static fromBuffer(e,t,i,s){e=e||new Float32Array(t*i*4);const r=new Ye(e,{width:t,height:i}),n=e instanceof Float32Array?k.FLOAT:k.UNSIGNED_BYTE;return new qe(r,Object.assign({},sc,{type:n},s))}static addToCache(e,t){t&&(e.textureCacheIds.includes(t)||e.textureCacheIds.push(t),Mt[t]&&Mt[t]!==e&&console.warn(`BaseTexture added to the cache with an id [${t}] that already had an entry`),Mt[t]=e)}static removeFromCache(e){if(typeof e=="string"){const t=Mt[e];if(t){const i=t.textureCacheIds.indexOf(e);return i>-1&&t.textureCacheIds.splice(i,1),delete Mt[e],t}}else if(e!=null&&e.textureCacheIds){for(let t=0;t1){for(let u=0;u(e[e.POLY=0]="POLY",e[e.RECT=1]="RECT",e[e.CIRC=2]="CIRC",e[e.ELIP=3]="ELIP",e[e.RREC=4]="RREC",e))(_t||{});class Y{constructor(t=0,i=0){this.x=0,this.y=0,this.x=t,this.y=i}clone(){return new Y(this.x,this.y)}copyFrom(t){return this.set(t.x,t.y),this}copyTo(t){return t.set(this.x,this.y),t}equals(t){return t.x===this.x&&t.y===this.y}set(t=0,i=t){return this.x=t,this.y=i,this}toString(){return`[@pixi/math:Point x=${this.x} y=${this.y}]`}}const ms=[new Y,new Y,new Y,new Y];class ${constructor(t=0,i=0,s=0,r=0){this.x=Number(t),this.y=Number(i),this.width=Number(s),this.height=Number(r),this.type=_t.RECT}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}static get EMPTY(){return new $(0,0,0,0)}clone(){return new $(this.x,this.y,this.width,this.height)}copyFrom(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyTo(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t}contains(t,i){return this.width<=0||this.height<=0?!1:t>=this.x&&t=this.y&&it.right?t.right:this.right)<=E)return!1;const H=this.yt.bottom?t.bottom:this.bottom)>H}const s=this.left,r=this.right,n=this.top,o=this.bottom;if(r<=s||o<=n)return!1;const a=ms[0].set(t.left,t.top),h=ms[1].set(t.left,t.bottom),l=ms[2].set(t.right,t.top),c=ms[3].set(t.right,t.bottom);if(l.x<=a.x||h.y<=a.y)return!1;const u=Math.sign(i.a*i.d-i.b*i.c);if(u===0||(i.apply(a,a),i.apply(h,h),i.apply(l,l),i.apply(c,c),Math.max(a.x,h.x,l.x,c.x)<=s||Math.min(a.x,h.x,l.x,c.x)>=r||Math.max(a.y,h.y,l.y,c.y)<=n||Math.min(a.y,h.y,l.y,c.y)>=o))return!1;const d=u*(h.y-a.y),f=u*(a.x-h.x),p=d*s+f*n,_=d*r+f*n,g=d*s+f*o,v=d*r+f*o;if(Math.max(p,_,g,v)<=d*a.x+f*a.y||Math.min(p,_,g,v)>=d*c.x+f*c.y)return!1;const b=u*(a.y-l.y),y=u*(l.x-a.x),x=b*s+y*n,A=b*r+y*n,D=b*s+y*o,R=b*r+y*o;return!(Math.max(x,A,D,R)<=b*a.x+y*a.y||Math.min(x,A,D,R)>=b*c.x+y*c.y)}pad(t=0,i=t){return this.x-=t,this.y-=i,this.width+=t*2,this.height+=i*2,this}fit(t){const i=Math.max(this.x,t.x),s=Math.min(this.x+this.width,t.x+t.width),r=Math.max(this.y,t.y),n=Math.min(this.y+this.height,t.y+t.height);return this.x=i,this.width=Math.max(s-i,0),this.y=r,this.height=Math.max(n-r,0),this}ceil(t=1,i=.001){const s=Math.ceil((this.x+this.width-i)*t)/t,r=Math.ceil((this.y+this.height-i)*t)/t;return this.x=Math.floor((this.x+i)*t)/t,this.y=Math.floor((this.y+i)*t)/t,this.width=s-this.x,this.height=r-this.y,this}enlarge(t){const i=Math.min(this.x,t.x),s=Math.max(this.x+this.width,t.x+t.width),r=Math.min(this.y,t.y),n=Math.max(this.y+this.height,t.y+t.height);return this.x=i,this.width=s-i,this.y=r,this.height=n-r,this}toString(){return`[@pixi/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}}class _s{constructor(t=0,i=0,s=0){this.x=t,this.y=i,this.radius=s,this.type=_t.CIRC}clone(){return new _s(this.x,this.y,this.radius)}contains(t,i){if(this.radius<=0)return!1;const s=this.radius*this.radius;let r=this.x-t,n=this.y-i;return r*=r,n*=n,r+n<=s}getBounds(){return new $(this.x-this.radius,this.y-this.radius,this.radius*2,this.radius*2)}toString(){return`[@pixi/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`}}class gs{constructor(t=0,i=0,s=0,r=0){this.x=t,this.y=i,this.width=s,this.height=r,this.type=_t.ELIP}clone(){return new gs(this.x,this.y,this.width,this.height)}contains(t,i){if(this.width<=0||this.height<=0)return!1;let s=(t-this.x)/this.width,r=(i-this.y)/this.height;return s*=s,r*=r,s+r<=1}getBounds(){return new $(this.x-this.width,this.y-this.height,this.width,this.height)}toString(){return`[@pixi/math:Ellipse x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}}class Pe{constructor(...t){let i=Array.isArray(t[0])?t[0]:t;if(typeof i[0]!="number"){const s=[];for(let r=0,n=i.length;ri!=c>i&&t<(l-a)*((i-h)/(c-h))+a&&(s=!s)}return s}toString(){return`[@pixi/math:PolygoncloseStroke=${this.closeStroke}points=${this.points.reduce((t,i)=>`${t}, ${i}`,"")}]`}}class ys{constructor(t=0,i=0,s=0,r=0,n=20){this.x=t,this.y=i,this.width=s,this.height=r,this.radius=n,this.type=_t.RREC}clone(){return new ys(this.x,this.y,this.width,this.height,this.radius)}contains(t,i){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&i>=this.y&&i<=this.y+this.height){const s=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(i>=this.y+s&&i<=this.y+this.height-s||t>=this.x+s&&t<=this.x+this.width-s)return!0;let r=t-(this.x+s),n=i-(this.y+s);const o=s*s;if(r*r+n*n<=o||(r=t-(this.x+this.width-s),r*r+n*n<=o)||(n=i-(this.y+this.height-s),r*r+n*n<=o)||(r=t-(this.x+s),r*r+n*n<=o))return!0}return!1}toString(){return`[@pixi/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`}}class tt{constructor(t=1,i=0,s=0,r=1,n=0,o=0){this.array=null,this.a=t,this.b=i,this.c=s,this.d=r,this.tx=n,this.ty=o}fromArray(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]}set(t,i,s,r,n,o){return this.a=t,this.b=i,this.c=s,this.d=r,this.tx=n,this.ty=o,this}toArray(t,i){this.array||(this.array=new Float32Array(9));const s=i||this.array;return t?(s[0]=this.a,s[1]=this.b,s[2]=0,s[3]=this.c,s[4]=this.d,s[5]=0,s[6]=this.tx,s[7]=this.ty,s[8]=1):(s[0]=this.a,s[1]=this.c,s[2]=this.tx,s[3]=this.b,s[4]=this.d,s[5]=this.ty,s[6]=0,s[7]=0,s[8]=1),s}apply(t,i){i=i||new Y;const s=t.x,r=t.y;return i.x=this.a*s+this.c*r+this.tx,i.y=this.b*s+this.d*r+this.ty,i}applyInverse(t,i){i=i||new Y;const s=1/(this.a*this.d+this.c*-this.b),r=t.x,n=t.y;return i.x=this.d*s*r+-this.c*s*n+(this.ty*this.c-this.tx*this.d)*s,i.y=this.a*s*n+-this.b*s*r+(-this.ty*this.a+this.tx*this.b)*s,i}translate(t,i){return this.tx+=t,this.ty+=i,this}scale(t,i){return this.a*=t,this.d*=i,this.c*=t,this.b*=i,this.tx*=t,this.ty*=i,this}rotate(t){const i=Math.cos(t),s=Math.sin(t),r=this.a,n=this.c,o=this.tx;return this.a=r*i-this.b*s,this.b=r*s+this.b*i,this.c=n*i-this.d*s,this.d=n*s+this.d*i,this.tx=o*i-this.ty*s,this.ty=o*s+this.ty*i,this}append(t){const i=this.a,s=this.b,r=this.c,n=this.d;return this.a=t.a*i+t.b*r,this.b=t.a*s+t.b*n,this.c=t.c*i+t.d*r,this.d=t.c*s+t.d*n,this.tx=t.tx*i+t.ty*r+this.tx,this.ty=t.tx*s+t.ty*n+this.ty,this}setTransform(t,i,s,r,n,o,a,h,l){return this.a=Math.cos(a+l)*n,this.b=Math.sin(a+l)*n,this.c=-Math.sin(a-h)*o,this.d=Math.cos(a-h)*o,this.tx=t-(s*this.a+r*this.c),this.ty=i-(s*this.b+r*this.d),this}prepend(t){const i=this.tx;if(t.a!==1||t.b!==0||t.c!==0||t.d!==1){const s=this.a,r=this.c;this.a=s*t.a+this.b*t.c,this.b=s*t.b+this.b*t.d,this.c=r*t.a+this.d*t.c,this.d=r*t.b+this.d*t.d}return this.tx=i*t.a+this.ty*t.c+t.tx,this.ty=i*t.b+this.ty*t.d+t.ty,this}decompose(t){const i=this.a,s=this.b,r=this.c,n=this.d,o=t.pivot,a=-Math.atan2(-r,n),h=Math.atan2(s,i),l=Math.abs(a+h);return l<1e-5||Math.abs(yi-l)<1e-5?(t.rotation=h,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=a,t.skew.y=h),t.scale.x=Math.sqrt(i*i+s*s),t.scale.y=Math.sqrt(r*r+n*n),t.position.x=this.tx+(o.x*i+o.y*r),t.position.y=this.ty+(o.x*s+o.y*n),t}invert(){const t=this.a,i=this.b,s=this.c,r=this.d,n=this.tx,o=t*r-i*s;return this.a=r/o,this.b=-i/o,this.c=-s/o,this.d=t/o,this.tx=(s*this.ty-r*n)/o,this.ty=-(t*this.ty-i*n)/o,this}identity(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this}clone(){const t=new tt;return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t}copyTo(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t}copyFrom(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this}toString(){return`[@pixi/math:Matrix a=${this.a} b=${this.b} c=${this.c} d=${this.d} tx=${this.tx} ty=${this.ty}]`}static get IDENTITY(){return new tt}static get TEMP_MATRIX(){return new tt}}const Me=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],Be=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],De=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],Fe=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],Dr=[],$o=[],vs=Math.sign;function lc(){for(let e=0;e<16;e++){const t=[];Dr.push(t);for(let i=0;i<16;i++){const s=vs(Me[e]*Me[i]+De[e]*Be[i]),r=vs(Be[e]*Me[i]+Fe[e]*Be[i]),n=vs(Me[e]*De[i]+De[e]*Fe[i]),o=vs(Be[e]*De[i]+Fe[e]*Fe[i]);for(let a=0;a<16;a++)if(Me[a]===s&&Be[a]===r&&De[a]===n&&Fe[a]===o){t.push(a);break}}}for(let e=0;e<16;e++){const t=new tt;t.set(Me[e],Be[e],De[e],Fe[e],0,0),$o.push(t)}}lc();const it={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:e=>Me[e],uY:e=>Be[e],vX:e=>De[e],vY:e=>Fe[e],inv:e=>e&8?e&15:-e&7,add:(e,t)=>Dr[e][t],sub:(e,t)=>Dr[e][it.inv(t)],rotate180:e=>e^4,isVertical:e=>(e&3)===2,byDirection:(e,t)=>Math.abs(e)*2<=Math.abs(t)?t>=0?it.S:it.N:Math.abs(t)*2<=Math.abs(e)?e>0?it.E:it.W:t>0?e>0?it.SE:it.SW:e>0?it.NE:it.NW,matrixAppendRotationInv:(e,t,i=0,s=0)=>{const r=$o[it.inv(t)];r.tx=i,r.ty=s,e.append(r)}};class me{constructor(t,i,s=0,r=0){this._x=s,this._y=r,this.cb=t,this.scope=i}clone(t=this.cb,i=this.scope){return new me(t,i,this._x,this._y)}set(t=0,i=t){return(this._x!==t||this._y!==i)&&(this._x=t,this._y=i,this.cb.call(this.scope)),this}copyFrom(t){return(this._x!==t.x||this._y!==t.y)&&(this._x=t.x,this._y=t.y,this.cb.call(this.scope)),this}copyTo(t){return t.set(this._x,this._y),t}equals(t){return t.x===this._x&&t.y===this._y}toString(){return`[@pixi/math:ObservablePoint x=${0} y=${0} scope=${this.scope}]`}get x(){return this._x}set x(t){this._x!==t&&(this._x=t,this.cb.call(this.scope))}get y(){return this._y}set y(t){this._y!==t&&(this._y=t,this.cb.call(this.scope))}}const jo=class{constructor(){this.worldTransform=new tt,this.localTransform=new tt,this.position=new me(this.onChange,this,0,0),this.scale=new me(this.onChange,this,1,1),this.pivot=new me(this.onChange,this,0,0),this.skew=new me(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0}onChange(){this._localID++}updateSkew(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this._localID++}toString(){return`[@pixi/math:Transform position=(${this.position.x}, ${this.position.y}) rotation=${this.rotation} scale=(${this.scale.x}, ${this.scale.y}) skew=(${this.skew.x}, ${this.skew.y}) ]`}updateLocalTransform(){const e=this.localTransform;this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale.x,e.b=this._sx*this.scale.x,e.c=this._cy*this.scale.y,e.d=this._sy*this.scale.y,e.tx=this.position.x-(this.pivot.x*e.a+this.pivot.y*e.c),e.ty=this.position.y-(this.pivot.x*e.b+this.pivot.y*e.d),this._currentLocalID=this._localID,this._parentID=-1)}updateTransform(e){const t=this.localTransform;if(this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale.x,t.b=this._sx*this.scale.x,t.c=this._cy*this.scale.y,t.d=this._sy*this.scale.y,t.tx=this.position.x-(this.pivot.x*t.a+this.pivot.y*t.c),t.ty=this.position.y-(this.pivot.x*t.b+this.pivot.y*t.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==e._worldID){const i=e.worldTransform,s=this.worldTransform;s.a=t.a*i.a+t.b*i.c,s.b=t.a*i.b+t.b*i.d,s.c=t.c*i.a+t.d*i.c,s.d=t.c*i.b+t.d*i.d,s.tx=t.tx*i.a+t.ty*i.c+i.tx,s.ty=t.tx*i.b+t.ty*i.d+i.ty,this._parentID=e._worldID,this._worldID++}}setFromMatrix(e){e.decompose(this),this._localID++}get rotation(){return this._rotation}set rotation(e){this._rotation!==e&&(this._rotation=e,this.updateSkew())}};let vi=jo;vi.IDENTITY=new jo;var cc=`varying vec2 vTextureCoord; - -uniform sampler2D uSampler; - -void main(void){ - gl_FragColor *= texture2D(uSampler, vTextureCoord); -}`,uc=`attribute vec2 aVertexPosition; -attribute vec2 aTextureCoord; - -uniform mat3 projectionMatrix; - -varying vec2 vTextureCoord; - -void main(void){ - gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); - vTextureCoord = aTextureCoord; -} -`;function Yo(e,t,i){const s=e.createShader(t);return e.shaderSource(s,i),e.compileShader(s),s}function Fr(e){const t=new Array(e);for(let i=0;ie.type==="float"&&e.size===1&&!e.isArray,code:e=>` - if(uv["${e}"] !== ud["${e}"].value) - { - ud["${e}"].value = uv["${e}"] - gl.uniform1f(ud["${e}"].location, uv["${e}"]) - } - `},{test:(e,t)=>(e.type==="sampler2D"||e.type==="samplerCube"||e.type==="sampler2DArray")&&e.size===1&&!e.isArray&&(t==null||t.castToBaseTexture!==void 0),code:e=>`t = syncData.textureCount++; - - renderer.texture.bind(uv["${e}"], t); - - if(ud["${e}"].value !== t) - { - ud["${e}"].value = t; - gl.uniform1i(ud["${e}"].location, t); -; // eslint-disable-line max-len - }`},{test:(e,t)=>e.type==="mat3"&&e.size===1&&!e.isArray&&t.a!==void 0,code:e=>` - gl.uniformMatrix3fv(ud["${e}"].location, false, uv["${e}"].toArray(true)); - `,codeUbo:e=>` - var ${e}_matrix = uv.${e}.toArray(true); - - data[offset] = ${e}_matrix[0]; - data[offset+1] = ${e}_matrix[1]; - data[offset+2] = ${e}_matrix[2]; - - data[offset + 4] = ${e}_matrix[3]; - data[offset + 5] = ${e}_matrix[4]; - data[offset + 6] = ${e}_matrix[5]; - - data[offset + 8] = ${e}_matrix[6]; - data[offset + 9] = ${e}_matrix[7]; - data[offset + 10] = ${e}_matrix[8]; - `},{test:(e,t)=>e.type==="vec2"&&e.size===1&&!e.isArray&&t.x!==void 0,code:e=>` - cv = ud["${e}"].value; - v = uv["${e}"]; - - if(cv[0] !== v.x || cv[1] !== v.y) - { - cv[0] = v.x; - cv[1] = v.y; - gl.uniform2f(ud["${e}"].location, v.x, v.y); - }`,codeUbo:e=>` - v = uv.${e}; - - data[offset] = v.x; - data[offset+1] = v.y; - `},{test:e=>e.type==="vec2"&&e.size===1&&!e.isArray,code:e=>` - cv = ud["${e}"].value; - v = uv["${e}"]; - - if(cv[0] !== v[0] || cv[1] !== v[1]) - { - cv[0] = v[0]; - cv[1] = v[1]; - gl.uniform2f(ud["${e}"].location, v[0], v[1]); - } - `},{test:(e,t)=>e.type==="vec4"&&e.size===1&&!e.isArray&&t.width!==void 0,code:e=>` - cv = ud["${e}"].value; - v = uv["${e}"]; - - if(cv[0] !== v.x || cv[1] !== v.y || cv[2] !== v.width || cv[3] !== v.height) - { - cv[0] = v.x; - cv[1] = v.y; - cv[2] = v.width; - cv[3] = v.height; - gl.uniform4f(ud["${e}"].location, v.x, v.y, v.width, v.height) - }`,codeUbo:e=>` - v = uv.${e}; - - data[offset] = v.x; - data[offset+1] = v.y; - data[offset+2] = v.width; - data[offset+3] = v.height; - `},{test:(e,t)=>e.type==="vec4"&&e.size===1&&!e.isArray&&t.red!==void 0,code:e=>` - cv = ud["${e}"].value; - v = uv["${e}"]; - - if(cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue || cv[3] !== v.alpha) - { - cv[0] = v.red; - cv[1] = v.green; - cv[2] = v.blue; - cv[3] = v.alpha; - gl.uniform4f(ud["${e}"].location, v.red, v.green, v.blue, v.alpha) - }`,codeUbo:e=>` - v = uv.${e}; - - data[offset] = v.red; - data[offset+1] = v.green; - data[offset+2] = v.blue; - data[offset+3] = v.alpha; - `},{test:(e,t)=>e.type==="vec3"&&e.size===1&&!e.isArray&&t.red!==void 0,code:e=>` - cv = ud["${e}"].value; - v = uv["${e}"]; - - if(cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue || cv[3] !== v.a) - { - cv[0] = v.red; - cv[1] = v.green; - cv[2] = v.blue; - - gl.uniform3f(ud["${e}"].location, v.red, v.green, v.blue) - }`,codeUbo:e=>` - v = uv.${e}; - - data[offset] = v.red; - data[offset+1] = v.green; - data[offset+2] = v.blue; - `},{test:e=>e.type==="vec4"&&e.size===1&&!e.isArray,code:e=>` - cv = ud["${e}"].value; - v = uv["${e}"]; - - if(cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) - { - cv[0] = v[0]; - cv[1] = v[1]; - cv[2] = v[2]; - cv[3] = v[3]; - - gl.uniform4f(ud["${e}"].location, v[0], v[1], v[2], v[3]) - }`}],dc={float:` - if (cv !== v) - { - cu.value = v; - gl.uniform1f(location, v); - }`,vec2:` - if (cv[0] !== v[0] || cv[1] !== v[1]) - { - cv[0] = v[0]; - cv[1] = v[1]; - - gl.uniform2f(location, v[0], v[1]) - }`,vec3:` - if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) - { - cv[0] = v[0]; - cv[1] = v[1]; - cv[2] = v[2]; - - gl.uniform3f(location, v[0], v[1], v[2]) - }`,vec4:` - if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) - { - cv[0] = v[0]; - cv[1] = v[1]; - cv[2] = v[2]; - cv[3] = v[3]; - - gl.uniform4f(location, v[0], v[1], v[2], v[3]); - }`,int:` - if (cv !== v) - { - cu.value = v; - - gl.uniform1i(location, v); - }`,ivec2:` - if (cv[0] !== v[0] || cv[1] !== v[1]) - { - cv[0] = v[0]; - cv[1] = v[1]; - - gl.uniform2i(location, v[0], v[1]); - }`,ivec3:` - if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) - { - cv[0] = v[0]; - cv[1] = v[1]; - cv[2] = v[2]; - - gl.uniform3i(location, v[0], v[1], v[2]); - }`,ivec4:` - if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) - { - cv[0] = v[0]; - cv[1] = v[1]; - cv[2] = v[2]; - cv[3] = v[3]; - - gl.uniform4i(location, v[0], v[1], v[2], v[3]); - }`,uint:` - if (cv !== v) - { - cu.value = v; - - gl.uniform1ui(location, v); - }`,uvec2:` - if (cv[0] !== v[0] || cv[1] !== v[1]) - { - cv[0] = v[0]; - cv[1] = v[1]; - - gl.uniform2ui(location, v[0], v[1]); - }`,uvec3:` - if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) - { - cv[0] = v[0]; - cv[1] = v[1]; - cv[2] = v[2]; - - gl.uniform3ui(location, v[0], v[1], v[2]); - }`,uvec4:` - if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) - { - cv[0] = v[0]; - cv[1] = v[1]; - cv[2] = v[2]; - cv[3] = v[3]; - - gl.uniform4ui(location, v[0], v[1], v[2], v[3]); - }`,bool:` - if (cv !== v) - { - cu.value = v; - gl.uniform1i(location, v); - }`,bvec2:` - if (cv[0] != v[0] || cv[1] != v[1]) - { - cv[0] = v[0]; - cv[1] = v[1]; - - gl.uniform2i(location, v[0], v[1]); - }`,bvec3:` - if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) - { - cv[0] = v[0]; - cv[1] = v[1]; - cv[2] = v[2]; - - gl.uniform3i(location, v[0], v[1], v[2]); - }`,bvec4:` - if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) - { - cv[0] = v[0]; - cv[1] = v[1]; - cv[2] = v[2]; - cv[3] = v[3]; - - gl.uniform4i(location, v[0], v[1], v[2], v[3]); - }`,mat2:"gl.uniformMatrix2fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",sampler2D:` - if (cv !== v) - { - cu.value = v; - - gl.uniform1i(location, v); - }`,samplerCube:` - if (cv !== v) - { - cu.value = v; - - gl.uniform1i(location, v); - }`,sampler2DArray:` - if (cv !== v) - { - cu.value = v; - - gl.uniform1i(location, v); - }`},fc={float:"gl.uniform1fv(location, v)",vec2:"gl.uniform2fv(location, v)",vec3:"gl.uniform3fv(location, v)",vec4:"gl.uniform4fv(location, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat2:"gl.uniformMatrix2fv(location, false, v)",int:"gl.uniform1iv(location, v)",ivec2:"gl.uniform2iv(location, v)",ivec3:"gl.uniform3iv(location, v)",ivec4:"gl.uniform4iv(location, v)",uint:"gl.uniform1uiv(location, v)",uvec2:"gl.uniform2uiv(location, v)",uvec3:"gl.uniform3uiv(location, v)",uvec4:"gl.uniform4uiv(location, v)",bool:"gl.uniform1iv(location, v)",bvec2:"gl.uniform2iv(location, v)",bvec3:"gl.uniform3iv(location, v)",bvec4:"gl.uniform4iv(location, v)",sampler2D:"gl.uniform1iv(location, v)",samplerCube:"gl.uniform1iv(location, v)",sampler2DArray:"gl.uniform1iv(location, v)"};function pc(e,t){var s;const i=[` - var v = null; - var cv = null; - var cu = null; - var t = 0; - var gl = renderer.gl; - `];for(const r in e.uniforms){const n=t[r];if(!n){(s=e.uniforms[r])!=null&&s.group&&(e.uniforms[r].ubo?i.push(` - renderer.shader.syncUniformBufferGroup(uv.${r}, '${r}'); - `):i.push(` - renderer.shader.syncUniformGroup(uv.${r}, syncData); - `));continue}const o=e.uniforms[r];let a=!1;for(let h=0;h=et.WEBGL2&&(t=e.getContext("webgl2",{})),t||(t=e.getContext("webgl",{})||e.getContext("experimental-webgl",{}),t?t.getExtension("WEBGL_draw_buffers"):t=null),Ke=t}return Ke}let xs;function mc(){if(!xs){xs=Pt.MEDIUM;const e=Zo();e&&e.getShaderPrecisionFormat&&(xs=e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision?Pt.HIGH:Pt.MEDIUM)}return xs}function Jo(e,t){const i=e.getShaderSource(t).split(` -`).map((l,c)=>`${c}: ${l}`),s=e.getShaderInfoLog(t),r=s.split(` -`),n={},o=r.map(l=>parseFloat(l.replace(/^ERROR\: 0\:([\d]+)\:.*$/,"$1"))).filter(l=>l&&!n[l]?(n[l]=!0,!0):!1),a=[""];o.forEach(l=>{i[l-1]=`%c${i[l-1]}%c`,a.push("background: #FF0000; color:#FFFFFF; font-size: 10px","font-size: 10px")});const h=i.join(` -`);a[0]=h,console.error(s),console.groupCollapsed("click to view full shader code"),console.warn(...a),console.groupEnd()}function _c(e,t,i,s){e.getProgramParameter(t,e.LINK_STATUS)||(e.getShaderParameter(i,e.COMPILE_STATUS)||Jo(e,i),e.getShaderParameter(s,e.COMPILE_STATUS)||Jo(e,s),console.error("PixiJS Error: Could not initialize shader."),e.getProgramInfoLog(t)!==""&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",e.getProgramInfoLog(t)))}const gc={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,uint:1,uvec2:2,uvec3:3,uvec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function Qo(e){return gc[e]}let bs=null;const ta={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",UNSIGNED_INT:"uint",UNSIGNED_INT_VEC2:"uvec2",UNSIGNED_INT_VEC3:"uvec3",UNSIGNED_INT_VEC4:"uvec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",INT_SAMPLER_2D:"sampler2D",UNSIGNED_INT_SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",INT_SAMPLER_CUBE:"samplerCube",UNSIGNED_INT_SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray",INT_SAMPLER_2D_ARRAY:"sampler2DArray",UNSIGNED_INT_SAMPLER_2D_ARRAY:"sampler2DArray"};function ea(e,t){if(!bs){const i=Object.keys(ta);bs={};for(let s=0;s0&&(i+=` -else `),sthis.size&&this.flush(),this._vertexCount+=e.vertexData.length/2,this._indexCount+=e.indices.length,this._bufferedTextures[this._bufferSize]=e._texture.baseTexture,this._bufferedElements[this._bufferSize++]=e)}buildTexturesAndDrawCalls(){const{_bufferedTextures:e,maxTextures:t}=this,i=Zt._textureArrayPool,s=this.renderer.batch,r=this._tempBoundTextures,n=this.renderer.textureGC.count;let o=++V._globalBatch,a=0,h=i[0],l=0;s.copyBoundTextures(r,t);for(let c=0;c=t&&(s.boundArray(h,r,o,t),this.buildDrawCalls(h,l,c),l=c,h=i[++a],++o),u._batchEnabled=o,u.touched=n,h.elements[h.count++]=u)}h.count>0&&(s.boundArray(h,r,o,t),this.buildDrawCalls(h,l,this._bufferSize),++a,++o);for(let c=0;c0);for(let p=0;p=0;--r)t[r]=s[r]||null,t[r]&&(t[r]._batchLocation=r)}boundArray(t,i,s,r){const{elements:n,ids:o,count:a}=t;let h=0;for(let l=0;l=0&&u=et.WEBGL2&&(s=t.getContext("webgl2",i)),s)this.webGLVersion=2;else if(this.webGLVersion=1,s=t.getContext("webgl",i)||t.getContext("experimental-webgl",i),!s)throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=s,this.getExtensions(),this.gl}getExtensions(){const{gl:t}=this,i={loseContext:t.getExtension("WEBGL_lose_context"),anisotropicFiltering:t.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),s3tc:t.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:t.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:t.getExtension("WEBGL_compressed_texture_etc"),etc1:t.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:t.getExtension("WEBGL_compressed_texture_atc"),astc:t.getExtension("WEBGL_compressed_texture_astc")};this.webGLVersion===1?Object.assign(this.extensions,i,{drawBuffers:t.getExtension("WEBGL_draw_buffers"),depthTexture:t.getExtension("WEBGL_depth_texture"),vertexArrayObject:t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:t.getExtension("OES_element_index_uint"),floatTexture:t.getExtension("OES_texture_float"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),textureHalfFloat:t.getExtension("OES_texture_half_float"),textureHalfFloatLinear:t.getExtension("OES_texture_half_float_linear")}):this.webGLVersion===2&&Object.assign(this.extensions,i,{colorBufferFloat:t.getExtension("EXT_color_buffer_float")})}handleContextLost(t){t.preventDefault(),setTimeout(()=>{this.gl.isContextLost()&&this.extensions.loseContext&&this.extensions.loseContext.restoreContext()},0)}handleContextRestored(){this.renderer.runners.contextChange.emit(this.gl)}destroy(){const t=this.renderer.view;this.renderer=null,t.removeEventListener!==void 0&&(t.removeEventListener("webglcontextlost",this.handleContextLost),t.removeEventListener("webglcontextrestored",this.handleContextRestored)),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()}postrender(){this.renderer.objectRenderer.renderingToScreen&&this.gl.flush()}validateContext(t){const i=t.getContextAttributes(),s="WebGL2RenderingContext"in globalThis&&t instanceof globalThis.WebGL2RenderingContext;s&&(this.webGLVersion=2),i&&!i.stencil&&console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly");const r=s||!!t.getExtension("OES_element_index_uint");this.supports.uint32Indices=r,r||console.warn("Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly")}}wi.defaultOptions={context:null,antialias:!1,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:"default"},wi.extension={type:M.RendererSystem,name:"context"},U.add(wi);class Ac extends Ye{upload(t,i,s){const r=t.gl;r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i.alphaMode===Nt.UNPACK);const n=i.realWidth,o=i.realHeight;return s.width===n&&s.height===o?r.texSubImage2D(i.target,0,0,0,n,o,i.format,s.type,this.data):(s.width=n,s.height=o,r.texImage2D(i.target,0,s.internalFormat,n,o,0,i.format,s.type,this.data)),!0}}class ws{constructor(t,i){this.width=Math.round(t||100),this.height=Math.round(i||100),this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new Bt("disposeFramebuffer"),this.multisample=ht.NONE}get colorTexture(){return this.colorTextures[0]}addColorTexture(t=0,i){return this.colorTextures[t]=i||new V(null,{scaleMode:ee.NEAREST,resolution:1,mipmap:Wt.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this}addDepthTexture(t){return this.depthTexture=t||new V(new Ac(null,{width:this.width,height:this.height}),{scaleMode:ee.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:Wt.OFF,format:C.DEPTH_COMPONENT,type:k.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this}enableDepth(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this}enableStencil(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this}resize(t,i){if(t=Math.round(t),i=Math.round(i),!(t===this.width&&i===this.height)){this.width=t,this.height=i,this.dirtyId++,this.dirtySize++;for(let s=0;s{const r=this.source;this.url=r.src;const n=()=>{this.destroyed||(r.onload=null,r.onerror=null,this.resize(r.width,r.height),this._load=null,this.createBitmap?i(this.process()):i(this))};r.complete&&r.src?n():(r.onload=n,r.onerror=o=>{s(o),this.onError.emit(o)})}),this._load)}process(){const t=this.source;if(this._process!==null)return this._process;if(this.bitmap!==null||!globalThis.createImageBitmap)return Promise.resolve(this);const i=globalThis.createImageBitmap,s=!t.crossOrigin||t.crossOrigin==="anonymous";return this._process=fetch(t.src,{mode:s?"cors":"no-cors"}).then(r=>r.blob()).then(r=>i(r,0,0,t.width,t.height,{premultiplyAlpha:this.alphaMode===null||this.alphaMode===Nt.UNPACK?"premultiply":"none"})).then(r=>this.destroyed?Promise.reject():(this.bitmap=r,this.update(),this._process=null,Promise.resolve(this))),this._process}upload(t,i,s){if(typeof this.alphaMode=="number"&&(i.alphaMode=this.alphaMode),!this.createBitmap)return super.upload(t,i,s);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(super.upload(t,i,s,this.bitmap),!this.preserveBitmap){let r=!0;const n=i._glTextures;for(const o in n){const a=n[o];if(a!==s&&a.dirtyId!==i.dirtyId){r=!1;break}}r&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0}dispose(){this.source.onload=null,this.source.onerror=null,super.dispose(),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null}static test(t){return typeof HTMLImageElement!="undefined"&&(typeof t=="string"||t instanceof HTMLImageElement)}}class Ur{constructor(){this.x0=0,this.y0=0,this.x1=1,this.y1=0,this.x2=1,this.y2=1,this.x3=0,this.y3=1,this.uvsFloat32=new Float32Array(8)}set(t,i,s){const r=i.width,n=i.height;if(s){const o=t.width/2/r,a=t.height/2/n,h=t.x/r+o,l=t.y/n+a;s=it.add(s,it.NW),this.x0=h+o*it.uX(s),this.y0=l+a*it.uY(s),s=it.add(s,2),this.x1=h+o*it.uX(s),this.y1=l+a*it.uY(s),s=it.add(s,2),this.x2=h+o*it.uX(s),this.y2=l+a*it.uY(s),s=it.add(s,2),this.x3=h+o*it.uX(s),this.y3=l+a*it.uY(s)}else this.x0=t.x/r,this.y0=t.y/n,this.x1=(t.x+t.width)/r,this.y1=t.y/n,this.x2=(t.x+t.width)/r,this.y2=(t.y+t.height)/n,this.x3=t.x/r,this.y3=(t.y+t.height)/n;this.uvsFloat32[0]=this.x0,this.uvsFloat32[1]=this.y0,this.uvsFloat32[2]=this.x1,this.uvsFloat32[3]=this.y1,this.uvsFloat32[4]=this.x2,this.uvsFloat32[5]=this.y2,this.uvsFloat32[6]=this.x3,this.uvsFloat32[7]=this.y3}toString(){return`[@pixi/core:TextureUvs x0=${this.x0} y0=${this.y0} x1=${this.x1} y1=${this.y1} x2=${this.x2} y2=${this.y2} x3=${this.x3} y3=${this.y3}]`}}const oa=new Ur;function Ss(e){e.destroy=function(){},e.on=function(){},e.once=function(){},e.emit=function(){}}class B extends Ve{constructor(t,i,s,r,n,o,a){if(super(),this.noFrame=!1,i||(this.noFrame=!0,i=new $(0,0,1,1)),t instanceof B&&(t=t.baseTexture),this.baseTexture=t,this._frame=i,this.trim=r,this.valid=!1,this._uvs=oa,this.uvMatrix=null,this.orig=s||i,this._rotate=Number(n||0),n===!0)this._rotate=2;else if(this._rotate%2!==0)throw new Error("attempt to use diamond-shaped UVs. If you are sure, set rotation manually");this.defaultAnchor=o?new Y(o.x,o.y):new Y(0,0),this.defaultBorders=a,this._updateID=0,this.textureCacheIds=[],t.valid?this.noFrame?t.valid&&this.onBaseTextureUpdated(t):this.frame=i:t.once("loaded",this.onBaseTextureUpdated,this),this.noFrame&&t.on("update",this.onBaseTextureUpdated,this)}update(){this.baseTexture.resource&&this.baseTexture.resource.update()}onBaseTextureUpdated(t){if(this.noFrame){if(!this.baseTexture.valid)return;this._frame.width=t.width,this._frame.height=t.height,this.valid=!0,this.updateUvs()}else this.frame=this._frame;this.emit("update",this)}destroy(t){if(this.baseTexture){if(t){const{resource:i}=this.baseTexture;(i==null?void 0:i.url)&&St[i.url]&&B.removeFromCache(i.url),this.baseTexture.destroy()}this.baseTexture.off("loaded",this.onBaseTextureUpdated,this),this.baseTexture.off("update",this.onBaseTextureUpdated,this),this.baseTexture=null}this._frame=null,this._uvs=null,this.trim=null,this.orig=null,this.valid=!1,B.removeFromCache(this),this.textureCacheIds=null}clone(){var r;const t=this._frame.clone(),i=this._frame===this.orig?t:this.orig.clone(),s=new B(this.baseTexture,!this.noFrame&&t,i,(r=this.trim)==null?void 0:r.clone(),this.rotate,this.defaultAnchor,this.defaultBorders);return this.noFrame&&(s._frame=t),s}updateUvs(){this._uvs===oa&&(this._uvs=new Ur),this._uvs.set(this._frame,this.baseTexture,this.rotate),this._updateID++}static from(t,i={},s=P.STRICT_TEXTURE_CACHE){const r=typeof t=="string";let n=null;if(r)n=t;else if(t instanceof V){if(!t.cacheId){const a=(i==null?void 0:i.pixiIdPrefix)||"pixiid";t.cacheId=`${a}-${xe()}`,V.addToCache(t,t.cacheId)}n=t.cacheId}else{if(!t._pixiId){const a=(i==null?void 0:i.pixiIdPrefix)||"pixiid";t._pixiId=`${a}_${xe()}`}n=t._pixiId}let o=St[n];if(r&&s&&!o)throw new Error(`The cacheId "${n}" does not exist in TextureCache.`);return!o&&!(t instanceof V)?(i.resolution||(i.resolution=fe(t)),o=new B(new V(t,i)),o.baseTexture.cacheId=n,V.addToCache(o.baseTexture,n),B.addToCache(o,n)):!o&&t instanceof V&&(o=new B(t),B.addToCache(o,n)),o}static fromURL(t,i){const s=Object.assign({autoLoad:!1},i==null?void 0:i.resourceOptions),r=B.from(t,Object.assign({resourceOptions:s},i),!1),n=r.baseTexture.resource;return r.baseTexture.valid?Promise.resolve(r):n.load().then(()=>Promise.resolve(r))}static fromBuffer(t,i,s,r){return new B(V.fromBuffer(t,i,s,r))}static fromLoader(t,i,s,r){const n=new V(t,Object.assign({scaleMode:V.defaultOptions.scaleMode,resolution:fe(i)},r)),{resource:o}=n;o instanceof Or&&(o.url=i);const a=new B(n);return s||(s=i),V.addToCache(a.baseTexture,s),B.addToCache(a,s),s!==i&&(V.addToCache(a.baseTexture,i),B.addToCache(a,i)),a.baseTexture.valid?Promise.resolve(a):new Promise(h=>{a.baseTexture.once("loaded",()=>h(a))})}static addToCache(t,i){i&&(t.textureCacheIds.includes(i)||t.textureCacheIds.push(i),St[i]&&St[i]!==t&&console.warn(`Texture added to the cache with an id [${i}] that already had an entry`),St[i]=t)}static removeFromCache(t){if(typeof t=="string"){const i=St[t];if(i){const s=i.textureCacheIds.indexOf(t);return s>-1&&i.textureCacheIds.splice(s,1),delete St[t],i}}else if(t!=null&&t.textureCacheIds){for(let i=0;ithis.baseTexture.width,a=s+n>this.baseTexture.height;if(o||a){const h=o&&a?"and":"or",l=`X: ${i} + ${r} = ${i+r} > ${this.baseTexture.width}`,c=`Y: ${s} + ${n} = ${s+n} > ${this.baseTexture.height}`;throw new Error(`Texture Error: frame does not fit inside the base Texture dimensions: ${l} ${h} ${c}`)}this.valid=r&&n&&this.baseTexture.valid,!this.trim&&!this.rotate&&(this.orig=t),this.valid&&this.updateUvs()}get rotate(){return this._rotate}set rotate(t){this._rotate=t,this.valid&&this.updateUvs()}get width(){return this.orig.width}get height(){return this.orig.height}castToBaseTexture(){return this.baseTexture}static get EMPTY(){return B._EMPTY||(B._EMPTY=new B(new V),Ss(B._EMPTY),Ss(B._EMPTY.baseTexture)),B._EMPTY}static get WHITE(){if(!B._WHITE){const t=P.ADAPTER.createCanvas(16,16),i=t.getContext("2d");t.width=16,t.height=16,i.fillStyle="white",i.fillRect(0,0,16,16),B._WHITE=new B(V.from(t)),Ss(B._WHITE),Ss(B._WHITE.baseTexture)}return B._WHITE}}class be extends B{constructor(t,i){super(t,i),this.valid=!0,this.filterFrame=null,this.filterPoolKey=null,this.updateUvs()}get framebuffer(){return this.baseTexture.framebuffer}get multisample(){return this.framebuffer.multisample}set multisample(t){this.framebuffer.multisample=t}resize(t,i,s=!0){const r=this.baseTexture.resolution,n=Math.round(t*r)/r,o=Math.round(i*r)/r;this.valid=n>0&&o>0,this._frame.width=this.orig.width=n,this._frame.height=this.orig.height=o,s&&this.baseTexture.resize(n,o),this.updateUvs()}setResolution(t){const{baseTexture:i}=this;i.resolution!==t&&(i.setResolution(t),this.resize(i.width,i.height,!1))}static create(t){return new be(new Lr(t))}}class kr{constructor(t){this.texturePool={},this.textureOptions=t||{},this.enableFullScreen=!1,this._pixelsWidth=0,this._pixelsHeight=0}createTexture(t,i,s=ht.NONE){const r=new Lr(Object.assign({width:t,height:i,resolution:1,multisample:s},this.textureOptions));return new be(r)}getOptimalTexture(t,i,s=1,r=ht.NONE){let n;t=Math.ceil(t*s-1e-6),i=Math.ceil(i*s-1e-6),!this.enableFullScreen||t!==this._pixelsWidth||i!==this._pixelsHeight?(t=_i(t),i=_i(i),n=((t&65535)<<16|i&65535)>>>0,r>1&&(n+=r*4294967296)):n=r>1?-r:-1,this.texturePool[n]||(this.texturePool[n]=[]);let o=this.texturePool[n].pop();return o||(o=this.createTexture(t,i,r)),o.filterPoolKey=n,o.setResolution(s),o}getFilterTexture(t,i,s){const r=this.getOptimalTexture(t.width,t.height,i||t.resolution,s||ht.NONE);return r.filterFrame=t.filterFrame,r}returnTexture(t){const i=t.filterPoolKey;t.filterFrame=null,this.texturePool[i].push(t)}returnFilterTexture(t){this.returnTexture(t)}clear(t){if(t=t!==!1,t)for(const i in this.texturePool){const s=this.texturePool[i];if(s)for(let r=0;r0&&t.height>0;for(const i in this.texturePool){if(!(Number(i)<0))continue;const s=this.texturePool[i];if(s)for(let r=0;r1&&(c=this.getOptimalFilterTexture(l.width,l.height,i.resolution),c.filterFrame=l.filterFrame),s[u].apply(this,l,c,$t.CLEAR,i);const d=l;l=c,c=d}s[u].apply(this,l,h.renderTexture,$t.BLEND,i),u>1&&i.multisample>1&&this.returnFilterTexture(i.renderTexture),this.returnFilterTexture(l),this.returnFilterTexture(c)}i.clear(),this.statePool.push(i)}bindAndClear(t,i=$t.CLEAR){const{renderTexture:s,state:r}=this.renderer;if(t===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.projection.transform=this.activeState.transform:this.renderer.projection.transform=null,t!=null&&t.filterFrame){const o=this.tempRect;o.x=0,o.y=0,o.width=t.filterFrame.width,o.height=t.filterFrame.height,s.bind(t,t.filterFrame,o)}else t!==this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?s.bind(t):this.renderer.renderTexture.bind(t,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame);const n=r.stateId&1||this.forceClear;(i===$t.CLEAR||i===$t.BLIT&&n)&&this.renderer.framebuffer.clear(0,0,0,0)}applyFilter(t,i,s,r){const n=this.renderer;n.state.set(t.state),this.bindAndClear(s,r),t.uniforms.uSampler=i,t.uniforms.filterGlobals=this.globalUniforms,n.shader.bind(t),t.legacy=!!t.program.attributeData.aTextureCoord,t.legacy?(this.quadUv.map(i._frame,i.filterFrame),n.geometry.bind(this.quadUv),n.geometry.draw(zt.TRIANGLES)):(n.geometry.bind(this.quad),n.geometry.draw(zt.TRIANGLE_STRIP))}calculateSpriteMatrix(t,i){const{sourceFrame:s,destinationFrame:r}=this.activeState,{orig:n}=i._texture,o=t.set(r.width,0,0,r.height,s.x,s.y),a=i.worldTransform.copyTo(tt.TEMP_MATRIX);return a.invert(),o.prepend(a),o.scale(1/n.width,1/n.height),o.translate(i.anchor.x,i.anchor.y),o}destroy(){this.renderer=null,this.texturePool.clear(!1)}getOptimalFilterTexture(t,i,s=1,r=ht.NONE){return this.texturePool.getOptimalTexture(t,i,s,r)}getFilterTexture(t,i,s){if(typeof t=="number"){const n=t;t=i,i=n}t=t||this.activeState.renderTexture;const r=this.texturePool.getOptimalTexture(t.width,t.height,i||t.resolution,s||ht.NONE);return r.filterFrame=t.filterFrame,r}returnFilterTexture(t){this.texturePool.returnTexture(t)}emptyPool(){this.texturePool.clear(!0)}resize(){this.texturePool.setScreenSize(this.renderer.view)}transformAABB(t,i){const s=As[0],r=As[1],n=As[2],o=As[3];s.set(i.left,i.top),r.set(i.left,i.bottom),n.set(i.right,i.top),o.set(i.right,i.bottom),t.apply(s,s),t.apply(r,r),t.apply(n,n),t.apply(o,o);const a=Math.min(s.x,r.x,n.x,o.x),h=Math.min(s.y,r.y,n.y,o.y),l=Math.max(s.x,r.x,n.x,o.x),c=Math.max(s.y,r.y,n.y,o.y);i.x=a,i.y=h,i.width=l-a,i.height=c-h}roundFrame(t,i,s,r,n){if(!(t.width<=0||t.height<=0||s.width<=0||s.height<=0)){if(n){const{a:o,b:a,c:h,d:l}=n;if((Math.abs(a)>1e-4||Math.abs(h)>1e-4)&&(Math.abs(o)>1e-4||Math.abs(l)>1e-4))return}n=n?Hr.copyFrom(n):Hr.identity(),n.translate(-s.x,-s.y).scale(r.width/s.width,r.height/s.height).translate(r.x,r.y),this.transformAABB(n,t),t.ceil(i),this.transformAABB(n.invert(),t)}}}Xr.extension={type:M.RendererSystem,name:"filter"},U.add(Xr);class la{constructor(t){this.framebuffer=t,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=ht.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0}}const Rc=new $;class Vr{constructor(t){this.renderer=t,this.managedFramebuffers=[],this.unknownFramebuffer=new ws(10,10),this.msaaSamples=null}contextChange(){this.disposeAll(!0);const t=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new $,this.hasMRT=!0,this.writeDepthTexture=!0,this.renderer.context.webGLVersion===1){let i=this.renderer.context.extensions.drawBuffers,s=this.renderer.context.extensions.depthTexture;P.PREFER_ENV===et.WEBGL_LEGACY&&(i=null,s=null),i?t.drawBuffers=r=>i.drawBuffersWEBGL(r):(this.hasMRT=!1,t.drawBuffers=()=>{}),s||(this.writeDepthTexture=!1)}else this.msaaSamples=t.getInternalformatParameter(t.RENDERBUFFER,t.RGBA8,t.SAMPLES)}bind(t,i,s=0){const{gl:r}=this;if(t){const n=t.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(t);this.current!==t&&(this.current=t,r.bindFramebuffer(r.FRAMEBUFFER,n.framebuffer)),n.mipLevel!==s&&(t.dirtyId++,t.dirtyFormat++,n.mipLevel=s),n.dirtyId!==t.dirtyId&&(n.dirtyId=t.dirtyId,n.dirtyFormat!==t.dirtyFormat?(n.dirtyFormat=t.dirtyFormat,n.dirtySize=t.dirtySize,this.updateFramebuffer(t,s)):n.dirtySize!==t.dirtySize&&(n.dirtySize=t.dirtySize,this.resizeFramebuffer(t)));for(let o=0;o>s,a=i.height>>s,h=o/i.width;this.setViewport(i.x*h,i.y*h,o,a)}else{const o=t.width>>s,a=t.height>>s;this.setViewport(0,0,o,a)}}else this.current&&(this.current=null,r.bindFramebuffer(r.FRAMEBUFFER,null)),i?this.setViewport(i.x,i.y,i.width,i.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)}setViewport(t,i,s,r){const n=this.viewport;t=Math.round(t),i=Math.round(i),s=Math.round(s),r=Math.round(r),(n.width!==s||n.height!==r||n.x!==t||n.y!==i)&&(n.x=t,n.y=i,n.width=s,n.height=r,this.gl.viewport(t,i,s,r))}get size(){return this.current?{x:0,y:0,width:this.current.width,height:this.current.height}:{x:0,y:0,width:this.renderer.width,height:this.renderer.height}}clear(t,i,s,r,n=Rt.COLOR|Rt.DEPTH){const{gl:o}=this;o.clearColor(t,i,s,r),o.clear(n)}initFramebuffer(t){const{gl:i}=this,s=new la(i.createFramebuffer());return s.multisample=this.detectSamples(t.multisample),t.glFramebuffers[this.CONTEXT_UID]=s,this.managedFramebuffers.push(t),t.disposeRunner.add(this),s}resizeFramebuffer(t){const{gl:i}=this,s=t.glFramebuffers[this.CONTEXT_UID];s.stencil&&(i.bindRenderbuffer(i.RENDERBUFFER,s.stencil),s.msaaBuffer?i.renderbufferStorageMultisample(i.RENDERBUFFER,s.multisample,i.DEPTH24_STENCIL8,t.width,t.height):i.renderbufferStorage(i.RENDERBUFFER,i.DEPTH_STENCIL,t.width,t.height));const r=t.colorTextures;let n=r.length;i.drawBuffers||(n=Math.min(n,1));for(let o=0;o1&&this.canMultisampleFramebuffer(t)?r.msaaBuffer=r.msaaBuffer||s.createRenderbuffer():r.msaaBuffer&&(s.deleteRenderbuffer(r.msaaBuffer),r.msaaBuffer=null,r.blitFramebuffer&&(r.blitFramebuffer.dispose(),r.blitFramebuffer=null));const a=[];for(let h=0;h1&&s.drawBuffers(a),t.depthTexture&&this.writeDepthTexture){const l=t.depthTexture;this.renderer.texture.bind(l,0),s.framebufferTexture2D(s.FRAMEBUFFER,s.DEPTH_ATTACHMENT,s.TEXTURE_2D,l._glTextures[this.CONTEXT_UID].texture,i)}(t.stencil||t.depth)&&!(t.depthTexture&&this.writeDepthTexture)?(r.stencil=r.stencil||s.createRenderbuffer(),s.bindRenderbuffer(s.RENDERBUFFER,r.stencil),r.msaaBuffer?s.renderbufferStorageMultisample(s.RENDERBUFFER,r.multisample,s.DEPTH24_STENCIL8,t.width,t.height):s.renderbufferStorage(s.RENDERBUFFER,s.DEPTH_STENCIL,t.width,t.height),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_STENCIL_ATTACHMENT,s.RENDERBUFFER,r.stencil)):r.stencil&&(s.deleteRenderbuffer(r.stencil),r.stencil=null)}canMultisampleFramebuffer(t){return this.renderer.context.webGLVersion!==1&&t.colorTextures.length<=1&&!t.depthTexture}detectSamples(t){const{msaaSamples:i}=this;let s=ht.NONE;if(t<=1||i===null)return s;for(let r=0;r=0&&this.managedFramebuffers.splice(n,1),t.disposeRunner.remove(this),i||(r.deleteFramebuffer(s.framebuffer),s.msaaBuffer&&r.deleteRenderbuffer(s.msaaBuffer),s.stencil&&r.deleteRenderbuffer(s.stencil)),s.blitFramebuffer&&this.disposeFramebuffer(s.blitFramebuffer,i)}disposeAll(t){const i=this.managedFramebuffers;this.managedFramebuffers=[];for(let s=0;ss.createVertexArrayOES(),t.bindVertexArray=r=>s.bindVertexArrayOES(r),t.deleteVertexArray=r=>s.deleteVertexArrayOES(r)):(this.hasVao=!1,t.createVertexArray=()=>null,t.bindVertexArray=()=>null,t.deleteVertexArray=()=>null)}if(i.webGLVersion!==2){const s=t.getExtension("ANGLE_instanced_arrays");s?(t.vertexAttribDivisor=(r,n)=>s.vertexAttribDivisorANGLE(r,n),t.drawElementsInstanced=(r,n,o,a,h)=>s.drawElementsInstancedANGLE(r,n,o,a,h),t.drawArraysInstanced=(r,n,o,a)=>s.drawArraysInstancedANGLE(r,n,o,a)):this.hasInstance=!1}this.canUseUInt32ElementIndex=i.webGLVersion===2||!!i.extensions.uint32ElementIndex}bind(t,i){i=i||this.renderer.shader.shader;const{gl:s}=this;let r=t.glVertexArrayObjects[this.CONTEXT_UID],n=!1;r||(this.managedGeometries[t.id]=t,t.disposeRunner.add(this),t.glVertexArrayObjects[this.CONTEXT_UID]=r={},n=!0);const o=r[i.program.id]||this.initGeometryVao(t,i,n);this._activeGeometry=t,this._activeVao!==o&&(this._activeVao=o,this.hasVao?s.bindVertexArray(o):this.activateVao(t,i.program)),this.updateBuffers()}reset(){this.unbind()}updateBuffers(){const t=this._activeGeometry,i=this.renderer.buffer;for(let s=0;s0?this.maskStack[this.maskStack.length-1]._colorMask:15;s!==i&&this.renderer.gl.colorMask((s&1)!==0,(s&2)!==0,(s&4)!==0,(s&8)!==0)}destroy(){this.renderer=null}}$r.extension={type:M.RendererSystem,name:"mask"},U.add($r);class fa{constructor(t){this.renderer=t,this.maskStack=[],this.glConst=0}getStackLength(){return this.maskStack.length}setMaskStack(t){const{gl:i}=this.renderer,s=this.getStackLength();this.maskStack=t;const r=this.getStackLength();r!==s&&(r===0?i.disable(this.glConst):(i.enable(this.glConst),this._useCurrent()))}_useCurrent(){}destroy(){this.renderer=null,this.maskStack=null}}const pa=new tt,ma=[],Cs=class extends fa{constructor(e){super(e),this.glConst=P.ADAPTER.getWebGLRenderingContext().SCISSOR_TEST}getStackLength(){const e=this.maskStack[this.maskStack.length-1];return e?e._scissorCounter:0}calcScissorRect(e){var o;if(e._scissorRectLocal)return;const t=e._scissorRect,{maskObject:i}=e,{renderer:s}=this,r=s.renderTexture,n=i.getBounds(!0,(o=ma.pop())!=null?o:new $);this.roundFrameToPixels(n,r.current?r.current.resolution:s.resolution,r.sourceFrame,r.destinationFrame,s.projection.transform),t&&n.fit(t),e._scissorRectLocal=n}static isMatrixRotated(e){if(!e)return!1;const{a:t,b:i,c:s,d:r}=e;return(Math.abs(i)>1e-4||Math.abs(s)>1e-4)&&(Math.abs(t)>1e-4||Math.abs(r)>1e-4)}testScissor(e){const{maskObject:t}=e;if(!t.isFastRect||!t.isFastRect()||Cs.isMatrixRotated(t.worldTransform)||Cs.isMatrixRotated(this.renderer.projection.transform))return!1;this.calcScissorRect(e);const i=e._scissorRectLocal;return i.width>0&&i.height>0}roundFrameToPixels(e,t,i,s,r){Cs.isMatrixRotated(r)||(r=r?pa.copyFrom(r):pa.identity(),r.translate(-i.x,-i.y).scale(s.width/i.width,s.height/i.height).translate(s.x,s.y),this.renderer.filter.transformAABB(r,e),e.fit(s),e.x=Math.round(e.x*t),e.y=Math.round(e.y*t),e.width=Math.round(e.width*t),e.height=Math.round(e.height*t))}push(e){e._scissorRectLocal||this.calcScissorRect(e);const{gl:t}=this.renderer;e._scissorRect||t.enable(t.SCISSOR_TEST),e._scissorCounter++,e._scissorRect=e._scissorRectLocal,this._useCurrent()}pop(e){const{gl:t}=this.renderer;e&&ma.push(e._scissorRectLocal),this.getStackLength()>0?this._useCurrent():t.disable(t.SCISSOR_TEST)}_useCurrent(){const e=this.maskStack[this.maskStack.length-1]._scissorRect;let t;this.renderer.renderTexture.current?t=e.y:t=this.renderer.height-e.height-e.y,this.renderer.gl.scissor(e.x,t,e.width,e.height)}};let jr=Cs;jr.extension={type:M.RendererSystem,name:"scissor"},U.add(jr);class Yr extends fa{constructor(t){super(t),this.glConst=P.ADAPTER.getWebGLRenderingContext().STENCIL_TEST}getStackLength(){const t=this.maskStack[this.maskStack.length-1];return t?t._stencilCounter:0}push(t){const i=t.maskObject,{gl:s}=this.renderer,r=t._stencilCounter;r===0&&(this.renderer.framebuffer.forceStencil(),s.clearStencil(0),s.clear(s.STENCIL_BUFFER_BIT),s.enable(s.STENCIL_TEST)),t._stencilCounter++;const n=t._colorMask;n!==0&&(t._colorMask=0,s.colorMask(!1,!1,!1,!1)),s.stencilFunc(s.EQUAL,r,4294967295),s.stencilOp(s.KEEP,s.KEEP,s.INCR),i.renderable=!0,i.render(this.renderer),this.renderer.batch.flush(),i.renderable=!1,n!==0&&(t._colorMask=n,s.colorMask((n&1)!==0,(n&2)!==0,(n&4)!==0,(n&8)!==0)),this._useCurrent()}pop(t){const i=this.renderer.gl;if(this.getStackLength()===0)i.disable(i.STENCIL_TEST);else{const s=this.maskStack.length!==0?this.maskStack[this.maskStack.length-1]:null,r=s?s._colorMask:15;r!==0&&(s._colorMask=0,i.colorMask(!1,!1,!1,!1)),i.stencilOp(i.KEEP,i.KEEP,i.DECR),t.renderable=!0,t.render(this.renderer),this.renderer.batch.flush(),t.renderable=!1,r!==0&&(s._colorMask=r,i.colorMask((r&1)!==0,(r&2)!==0,(r&4)!==0,(r&8)!==0)),this._useCurrent()}}_useCurrent(){const t=this.renderer.gl;t.stencilFunc(t.EQUAL,this.getStackLength(),4294967295),t.stencilOp(t.KEEP,t.KEEP,t.KEEP)}}Yr.extension={type:M.RendererSystem,name:"stencil"},U.add(Yr);class qr{constructor(t){this.renderer=t,this.plugins={},Object.defineProperties(this.plugins,{extract:{enumerable:!1,get(){return z("7.0.0","renderer.plugins.extract has moved to renderer.extract"),t.extract}},prepare:{enumerable:!1,get(){return z("7.0.0","renderer.plugins.prepare has moved to renderer.prepare"),t.prepare}},interaction:{enumerable:!1,get(){return z("7.0.0","renderer.plugins.interaction has been deprecated, use renderer.events"),t.events}}})}init(){const t=this.rendererPlugins;for(const i in t)this.plugins[i]=new t[i](this.renderer)}destroy(){for(const t in this.plugins)this.plugins[t].destroy(),this.plugins[t]=null}}qr.extension={type:[M.RendererSystem,M.CanvasRendererSystem],name:"_plugin"},U.add(qr);class Kr{constructor(t){this.renderer=t,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new tt,this.transform=null}update(t,i,s,r){this.destinationFrame=t||this.destinationFrame||this.defaultFrame,this.sourceFrame=i||this.sourceFrame||t,this.calculateProjection(this.destinationFrame,this.sourceFrame,s,r),this.transform&&this.projectionMatrix.append(this.transform);const n=this.renderer;n.globalUniforms.uniforms.projectionMatrix=this.projectionMatrix,n.globalUniforms.update(),n.shader.shader&&n.shader.syncUniformGroup(n.shader.shader.uniforms.globals)}calculateProjection(t,i,s,r){const n=this.projectionMatrix,o=r?-1:1;n.identity(),n.a=1/i.width*2,n.d=o*(1/i.height*2),n.tx=-1-i.x*n.a,n.ty=-o-i.y*n.d}setTransform(t){}destroy(){this.renderer=null}}Kr.extension={type:M.RendererSystem,name:"projection"},U.add(Kr);const Pc=new vi;class Zr{constructor(t){this.renderer=t,this._tempMatrix=new tt}generateTexture(t,i){const h=i||{},{region:s}=h,r=zn(h,["region"]),n=s||t.getLocalBounds(null,!0);n.width===0&&(n.width=1),n.height===0&&(n.height=1);const o=be.create(bt({width:n.width,height:n.height},r));this._tempMatrix.tx=-n.x,this._tempMatrix.ty=-n.y;const a=t.transform;return t.transform=Pc,this.renderer.render(t,{renderTexture:o,transform:this._tempMatrix,skipUpdateTransform:!!t.parent,blit:!0}),t.transform=a,o}destroy(){}}Zr.extension={type:[M.RendererSystem,M.CanvasRendererSystem],name:"textureGenerator"},U.add(Zr);const Le=new $,Si=new $;class Jr{constructor(t){this.renderer=t,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new $,this.destinationFrame=new $,this.viewportFrame=new $}contextChange(){var i;const t=(i=this.renderer)==null?void 0:i.gl.getContextAttributes();this._rendererPremultipliedAlpha=!!(t&&t.alpha&&t.premultipliedAlpha)}bind(t=null,i,s){const r=this.renderer;this.current=t;let n,o,a;t?(n=t.baseTexture,a=n.resolution,i||(Le.width=t.frame.width,Le.height=t.frame.height,i=Le),s||(Si.x=t.frame.x,Si.y=t.frame.y,Si.width=i.width,Si.height=i.height,s=Si),o=n.framebuffer):(a=r.resolution,i||(Le.width=r._view.screen.width,Le.height=r._view.screen.height,i=Le),s||(s=Le,s.width=i.width,s.height=i.height));const h=this.viewportFrame;h.x=s.x*a,h.y=s.y*a,h.width=s.width*a,h.height=s.height*a,t||(h.y=r.view.height-(h.y+h.height)),h.ceil(),this.renderer.framebuffer.bind(o,h),this.renderer.projection.update(s,i,a,!o),t?this.renderer.mask.setMaskStack(n.maskStack):this.renderer.mask.setMaskStack(this.defaultMaskStack),this.sourceFrame.copyFrom(i),this.destinationFrame.copyFrom(s)}clear(t,i){const s=this.current?this.current.baseTexture.clear:this.renderer.background.backgroundColor,r=j.shared.setValue(t||s);(this.current&&this.current.baseTexture.alphaMode>0||!this.current&&this._rendererPremultipliedAlpha)&&r.premultiply(r.alpha);const n=this.destinationFrame,o=this.current?this.current.baseTexture:this.renderer._view.screen,a=n.width!==o.width||n.height!==o.height;if(a){let{x:h,y:l,width:c,height:u}=this.viewportFrame;h=Math.round(h),l=Math.round(l),c=Math.round(c),u=Math.round(u),this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),this.renderer.gl.scissor(h,l,c,u)}this.renderer.framebuffer.clear(r.red,r.green,r.blue,r.alpha,i),a&&this.renderer.scissor.pop()}resize(){this.bind(null)}reset(){this.bind(null)}destroy(){this.renderer=null}}Jr.extension={type:M.RendererSystem,name:"renderTexture"},U.add(Jr);class Mc{}class _a{constructor(t,i){this.program=t,this.uniformData=i,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBufferBindings={}}destroy(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBufferBindings=null,this.program=null}}function Bc(e,t){const i={},s=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES);for(let r=0;rc>u?1:-1);for(let c=0;c({data:n,offset:0,dataLen:0,dirty:0}));let i=0,s=0,r=0;for(let n=0;n1&&(i=Math.max(i,16)*o.data.size),o.dataLen=i,s%i!==0&&s<16){const a=s%i%16;s+=a,r+=a}s+i>16?(r=Math.ceil(r/16)*16,o.offset=r,r+=i,s=i):(o.offset=r,s+=i,r+=i)}return r=Math.ceil(r/16)*16,{uboElements:t,size:r}}function xa(e,t){const i=[];for(const s in e)t[s]&&i.push(t[s]);return i.sort((s,r)=>s.index-r.index),i}function ba(e,t){if(!e.autoManage)return{size:0,syncFunc:Fc};const i=xa(e.uniforms,t),{uboElements:s,size:r}=va(i),n=[` - var v = null; - var v2 = null; - var cv = null; - var t = 0; - var gl = renderer.gl - var index = 0; - var data = buffer.data; - `];for(let o=0;o1){const u=Qo(a.data.type),d=Math.max(ya[a.data.type]/16,1),f=u/d,p=(4-f%4)%4;n.push(` - cv = ud.${l}.value; - v = uv.${l}; - offset = ${a.offset/4}; - - t = 0; - - for(var i=0; i < ${a.data.size*d}; i++) - { - for(var j = 0; j < ${f}; j++) - { - data[offset++] = v[t++]; - } - offset += ${p}; - } - - `)}else{const u=Nc[a.data.type];n.push(` - cv = ud.${l}.value; - v = uv.${l}; - offset = ${a.offset/4}; - ${u}; - `)}}return n.push(` - renderer.buffer.update(buffer); - `),{size:r,syncFunc:new Function("ud","uv","renderer","syncData","buffer",n.join(` -`))}}let Lc=0;const Is={textureCount:0,uboCount:0};class Qr{constructor(t){this.destroyed=!1,this.renderer=t,this.systemCheck(),this.gl=null,this.shader=null,this.program=null,this.cache={},this._uboCache={},this.id=Lc++}systemCheck(){if(!sa())throw new Error("Current environment does not allow unsafe-eval, please use @pixi/unsafe-eval module to enable support.")}contextChange(t){this.gl=t,this.reset()}bind(t,i){t.disposeRunner.add(this),t.uniforms.globals=this.renderer.globalUniforms;const s=t.program,r=s.glPrograms[this.renderer.CONTEXT_UID]||this.generateProgram(t);return this.shader=t,this.program!==s&&(this.program=s,this.gl.useProgram(r.program)),i||(Is.textureCount=0,Is.uboCount=0,this.syncUniformGroup(t.uniformGroup,Is)),r}setUniforms(t){const i=this.shader.program,s=i.glPrograms[this.renderer.CONTEXT_UID];i.syncUniforms(s.uniformData,t,this.renderer)}syncUniformGroup(t,i){const s=this.getGlProgram();(!t.static||t.dirtyId!==s.uniformDirtyGroups[t.id])&&(s.uniformDirtyGroups[t.id]=t.dirtyId,this.syncUniforms(t,s,i))}syncUniforms(t,i,s){(t.syncUniforms[this.shader.program.id]||this.createSyncGroups(t))(i.uniformData,t.uniforms,this.renderer,s)}createSyncGroups(t){const i=this.getSignature(t,this.shader.program.uniformData,"u");return this.cache[i]||(this.cache[i]=pc(t,this.shader.program.uniformData)),t.syncUniforms[this.shader.program.id]=this.cache[i],t.syncUniforms[this.shader.program.id]}syncUniformBufferGroup(t,i){const s=this.getGlProgram();if(!t.static||t.dirtyId!==0||!s.uniformGroups[t.id]){t.dirtyId=0;const r=s.uniformGroups[t.id]||this.createSyncBufferGroup(t,s,i);t.buffer.update(),r(s.uniformData,t.uniforms,this.renderer,Is,t.buffer)}this.renderer.buffer.bindBufferBase(t.buffer,s.uniformBufferBindings[i])}createSyncBufferGroup(t,i,s){const{gl:r}=this.renderer;this.renderer.buffer.bind(t.buffer);const n=this.gl.getUniformBlockIndex(i.program,s);i.uniformBufferBindings[s]=this.shader.uniformBindCount,r.uniformBlockBinding(i.program,n,this.shader.uniformBindCount),this.shader.uniformBindCount++;const o=this.getSignature(t,this.shader.program.uniformData,"ubo");let a=this._uboCache[o];if(a||(a=this._uboCache[o]=ba(t,this.shader.program.uniformData)),t.autoManage){const h=new Float32Array(a.size/4);t.buffer.update(h)}return i.uniformGroups[t.id]=a.syncFunc,i.uniformGroups[t.id]}getSignature(t,i,s){const r=t.uniforms,n=[`${s}-`];for(const o in r)n.push(o),i[o]&&n.push(i[o].type);return n.join("-")}getGlProgram(){return this.shader?this.shader.program.glPrograms[this.renderer.CONTEXT_UID]:null}generateProgram(t){const i=this.gl,s=t.program,r=ga(i,s);return s.glPrograms[this.renderer.CONTEXT_UID]=r,r}reset(){this.program=null,this.shader=null}disposeShader(t){this.shader===t&&(this.shader=null)}destroy(){this.renderer=null,this.destroyed=!0}}Qr.extension={type:M.RendererSystem,name:"shader"},U.add(Qr);class Ai{constructor(t){this.renderer=t}run(t){const{renderer:i}=this;i.runners.init.emit(i.options),t.hello&&console.log(`PixiJS 7.2.4 - ${i.rendererLogId} - https://pixijs.com`),i.resize(i.screen.width,i.screen.height)}destroy(){}}Ai.defaultOptions={hello:!1},Ai.extension={type:[M.RendererSystem,M.CanvasRendererSystem],name:"startup"},U.add(Ai);function Oc(e,t=[]){return t[G.NORMAL]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[G.ADD]=[e.ONE,e.ONE],t[G.MULTIPLY]=[e.DST_COLOR,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA],t[G.SCREEN]=[e.ONE,e.ONE_MINUS_SRC_COLOR,e.ONE,e.ONE_MINUS_SRC_ALPHA],t[G.OVERLAY]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[G.DARKEN]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[G.LIGHTEN]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[G.COLOR_DODGE]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[G.COLOR_BURN]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[G.HARD_LIGHT]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[G.SOFT_LIGHT]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[G.DIFFERENCE]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[G.EXCLUSION]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[G.HUE]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[G.SATURATION]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[G.COLOR]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[G.LUMINOSITY]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[G.NONE]=[0,0],t[G.NORMAL_NPM]=[e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA],t[G.ADD_NPM]=[e.SRC_ALPHA,e.ONE,e.ONE,e.ONE],t[G.SCREEN_NPM]=[e.SRC_ALPHA,e.ONE_MINUS_SRC_COLOR,e.ONE,e.ONE_MINUS_SRC_ALPHA],t[G.SRC_IN]=[e.DST_ALPHA,e.ZERO],t[G.SRC_OUT]=[e.ONE_MINUS_DST_ALPHA,e.ZERO],t[G.SRC_ATOP]=[e.DST_ALPHA,e.ONE_MINUS_SRC_ALPHA],t[G.DST_OVER]=[e.ONE_MINUS_DST_ALPHA,e.ONE],t[G.DST_IN]=[e.ZERO,e.SRC_ALPHA],t[G.DST_OUT]=[e.ZERO,e.ONE_MINUS_SRC_ALPHA],t[G.DST_ATOP]=[e.ONE_MINUS_DST_ALPHA,e.SRC_ALPHA],t[G.XOR]=[e.ONE_MINUS_DST_ALPHA,e.ONE_MINUS_SRC_ALPHA],t[G.SUBTRACT]=[e.ONE,e.ONE,e.ONE,e.ONE,e.FUNC_REVERSE_SUBTRACT,e.FUNC_ADD],t}const Uc=0,kc=1,Gc=2,Hc=3,Xc=4,Vc=5,tn=class{constructor(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode=G.NONE,this._blendEq=!1,this.map=[],this.map[Uc]=this.setBlend,this.map[kc]=this.setOffset,this.map[Gc]=this.setCullFace,this.map[Hc]=this.setDepthTest,this.map[Xc]=this.setFrontFace,this.map[Vc]=this.setDepthMask,this.checks=[],this.defaultState=new ne,this.defaultState.blend=!0}contextChange(e){this.gl=e,this.blendModes=Oc(e),this.set(this.defaultState),this.reset()}set(e){if(e=e||this.defaultState,this.stateId!==e.data){let t=this.stateId^e.data,i=0;for(;t;)t&1&&this.map[i].call(this,!!(e.data&1<>1,i++;this.stateId=e.data}for(let t=0;tt.systems[n]),s=[...i,...Object.keys(t.systems).filter(n=>!i.includes(n))];for(const n of s)this.addSystem(t.systems[n],n)}addRunners(...t){t.forEach(i=>{this.runners[i]=new Bt(i)})}addSystem(t,i){const s=new t(this);if(this[i])throw new Error(`Whoops! The name "${i}" is already in use`);this[i]=s,this._systemsHash[i]=s;for(const r in this.runners)this.runners[r].add(s);return this}emitWithCustomOptions(t,i){const s=Object.keys(this._systemsHash);t.items.forEach(r=>{const n=s.find(o=>this._systemsHash[o]===r);r[t.name](i[n])})}destroy(){Object.values(this.runners).forEach(t=>{t.destroy()}),this._systemsHash={}}}const Ps=class{constructor(e){this.renderer=e,this.count=0,this.checkCount=0,this.maxIdle=Ps.defaultMaxIdle,this.checkCountMax=Ps.defaultCheckCountMax,this.mode=Ps.defaultMode}postrender(){!this.renderer.objectRenderer.renderingToScreen||(this.count++,this.mode!==es.MANUAL&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())))}run(){const e=this.renderer.texture,t=e.managedTextures;let i=!1;for(let s=0;sthis.maxIdle&&(e.destroyTexture(r,!0),t[s]=null,i=!0)}if(i){let s=0;for(let r=0;r=0;s--)this.unload(e.children[s])}destroy(){this.renderer=null}};let Ht=Ps;Ht.defaultMode=es.AUTO,Ht.defaultMaxIdle=3600,Ht.defaultCheckCountMax=600,Ht.extension={type:M.RendererSystem,name:"textureGC"},U.add(Ht);class Ms{constructor(t){this.texture=t,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=k.UNSIGNED_BYTE,this.internalFormat=C.RGBA,this.samplerType=0}}function zc(e){let t;return"WebGL2RenderingContext"in globalThis&&e instanceof globalThis.WebGL2RenderingContext?t={[k.UNSIGNED_BYTE]:{[C.RGBA]:e.RGBA8,[C.RGB]:e.RGB8,[C.RG]:e.RG8,[C.RED]:e.R8,[C.RGBA_INTEGER]:e.RGBA8UI,[C.RGB_INTEGER]:e.RGB8UI,[C.RG_INTEGER]:e.RG8UI,[C.RED_INTEGER]:e.R8UI,[C.ALPHA]:e.ALPHA,[C.LUMINANCE]:e.LUMINANCE,[C.LUMINANCE_ALPHA]:e.LUMINANCE_ALPHA},[k.BYTE]:{[C.RGBA]:e.RGBA8_SNORM,[C.RGB]:e.RGB8_SNORM,[C.RG]:e.RG8_SNORM,[C.RED]:e.R8_SNORM,[C.RGBA_INTEGER]:e.RGBA8I,[C.RGB_INTEGER]:e.RGB8I,[C.RG_INTEGER]:e.RG8I,[C.RED_INTEGER]:e.R8I},[k.UNSIGNED_SHORT]:{[C.RGBA_INTEGER]:e.RGBA16UI,[C.RGB_INTEGER]:e.RGB16UI,[C.RG_INTEGER]:e.RG16UI,[C.RED_INTEGER]:e.R16UI,[C.DEPTH_COMPONENT]:e.DEPTH_COMPONENT16},[k.SHORT]:{[C.RGBA_INTEGER]:e.RGBA16I,[C.RGB_INTEGER]:e.RGB16I,[C.RG_INTEGER]:e.RG16I,[C.RED_INTEGER]:e.R16I},[k.UNSIGNED_INT]:{[C.RGBA_INTEGER]:e.RGBA32UI,[C.RGB_INTEGER]:e.RGB32UI,[C.RG_INTEGER]:e.RG32UI,[C.RED_INTEGER]:e.R32UI,[C.DEPTH_COMPONENT]:e.DEPTH_COMPONENT24},[k.INT]:{[C.RGBA_INTEGER]:e.RGBA32I,[C.RGB_INTEGER]:e.RGB32I,[C.RG_INTEGER]:e.RG32I,[C.RED_INTEGER]:e.R32I},[k.FLOAT]:{[C.RGBA]:e.RGBA32F,[C.RGB]:e.RGB32F,[C.RG]:e.RG32F,[C.RED]:e.R32F,[C.DEPTH_COMPONENT]:e.DEPTH_COMPONENT32F},[k.HALF_FLOAT]:{[C.RGBA]:e.RGBA16F,[C.RGB]:e.RGB16F,[C.RG]:e.RG16F,[C.RED]:e.R16F},[k.UNSIGNED_SHORT_5_6_5]:{[C.RGB]:e.RGB565},[k.UNSIGNED_SHORT_4_4_4_4]:{[C.RGBA]:e.RGBA4},[k.UNSIGNED_SHORT_5_5_5_1]:{[C.RGBA]:e.RGB5_A1},[k.UNSIGNED_INT_2_10_10_10_REV]:{[C.RGBA]:e.RGB10_A2,[C.RGBA_INTEGER]:e.RGB10_A2UI},[k.UNSIGNED_INT_10F_11F_11F_REV]:{[C.RGB]:e.R11F_G11F_B10F},[k.UNSIGNED_INT_5_9_9_9_REV]:{[C.RGB]:e.RGB9_E5},[k.UNSIGNED_INT_24_8]:{[C.DEPTH_STENCIL]:e.DEPTH24_STENCIL8},[k.FLOAT_32_UNSIGNED_INT_24_8_REV]:{[C.DEPTH_STENCIL]:e.DEPTH32F_STENCIL8}}:t={[k.UNSIGNED_BYTE]:{[C.RGBA]:e.RGBA,[C.RGB]:e.RGB,[C.ALPHA]:e.ALPHA,[C.LUMINANCE]:e.LUMINANCE,[C.LUMINANCE_ALPHA]:e.LUMINANCE_ALPHA},[k.UNSIGNED_SHORT_5_6_5]:{[C.RGB]:e.RGB},[k.UNSIGNED_SHORT_4_4_4_4]:{[C.RGBA]:e.RGBA},[k.UNSIGNED_SHORT_5_5_5_1]:{[C.RGBA]:e.RGBA}},t}class sn{constructor(t){this.renderer=t,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new V,this.hasIntegerTextures=!1}contextChange(){const t=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=zc(t);const i=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=i;for(let r=0;r=0;--n){const o=i[n];o&&o._glTextures[r].samplerType!==ts.FLOAT&&this.renderer.texture.unbind(o)}}initTexture(t){const i=new Ms(this.gl.createTexture());return i.dirtyId=-1,t._glTextures[this.CONTEXT_UID]=i,this.managedTextures.push(t),t.on("dispose",this.destroyTexture,this),i}initTextureType(t,i){var s,r;i.internalFormat=(r=(s=this.internalFormats[t.type])==null?void 0:s[t.format])!=null?r:t.format,this.webGLVersion===2&&t.type===k.HALF_FLOAT?i.type=this.gl.HALF_FLOAT:i.type=t.type}updateTexture(t){var r;const i=t._glTextures[this.CONTEXT_UID];if(!i)return;const s=this.renderer;if(this.initTextureType(t,i),(r=t.resource)!=null&&r.upload(s,t,i))i.samplerType!==ts.FLOAT&&(this.hasIntegerTextures=!0);else{const n=t.realWidth,o=t.realHeight,a=s.gl;(i.width!==n||i.height!==o||i.dirtyId<0)&&(i.width=n,i.height=o,a.texImage2D(t.target,0,i.internalFormat,n,o,0,t.format,i.type,null))}t.dirtyStyleId!==i.dirtyStyleId&&this.updateTextureStyle(t),i.dirtyId=t.dirtyId}destroyTexture(t,i){const{gl:s}=this;if(t=t.castToBaseTexture(),t._glTextures[this.CONTEXT_UID]&&(this.unbind(t),s.deleteTexture(t._glTextures[this.CONTEXT_UID].texture),t.off("dispose",this.destroyTexture,this),delete t._glTextures[this.CONTEXT_UID],!i)){const r=this.managedTextures.indexOf(t);r!==-1&&Ie(this.managedTextures,r,1)}}updateTextureStyle(t){var s;const i=t._glTextures[this.CONTEXT_UID];!i||((t.mipmap===Wt.POW2||this.webGLVersion!==2)&&!t.isPowerOfTwo?i.mipmap=!1:i.mipmap=t.mipmap>=1,this.webGLVersion!==2&&!t.isPowerOfTwo?i.wrapMode=ie.CLAMP:i.wrapMode=t.wrapMode,(s=t.resource)!=null&&s.style(this.renderer,t,i)||this.setStyle(t,i),i.dirtyStyleId=t.dirtyStyleId)}setStyle(t,i){const s=this.gl;if(i.mipmap&&t.mipmap!==Wt.ON_MANUAL&&s.generateMipmap(t.target),s.texParameteri(t.target,s.TEXTURE_WRAP_S,i.wrapMode),s.texParameteri(t.target,s.TEXTURE_WRAP_T,i.wrapMode),i.mipmap){s.texParameteri(t.target,s.TEXTURE_MIN_FILTER,t.scaleMode===ee.LINEAR?s.LINEAR_MIPMAP_LINEAR:s.NEAREST_MIPMAP_NEAREST);const r=this.renderer.context.extensions.anisotropicFiltering;if(r&&t.anisotropicLevel>0&&t.scaleMode===ee.LINEAR){const n=Math.min(t.anisotropicLevel,s.getParameter(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT));s.texParameterf(t.target,r.TEXTURE_MAX_ANISOTROPY_EXT,n)}}else s.texParameteri(t.target,s.TEXTURE_MIN_FILTER,t.scaleMode===ee.LINEAR?s.LINEAR:s.NEAREST);s.texParameteri(t.target,s.TEXTURE_MAG_FILTER,t.scaleMode===ee.LINEAR?s.LINEAR:s.NEAREST)}destroy(){this.renderer=null}}sn.extension={type:M.RendererSystem,name:"texture"},U.add(sn);class rn{constructor(t){this.renderer=t}contextChange(){this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID}bind(t){const{gl:i,CONTEXT_UID:s}=this,r=t._glTransformFeedbacks[s]||this.createGLTransformFeedback(t);i.bindTransformFeedback(i.TRANSFORM_FEEDBACK,r)}unbind(){const{gl:t}=this;t.bindTransformFeedback(t.TRANSFORM_FEEDBACK,null)}beginTransformFeedback(t,i){const{gl:s,renderer:r}=this;i&&r.shader.bind(i),s.beginTransformFeedback(t)}endTransformFeedback(){const{gl:t}=this;t.endTransformFeedback()}createGLTransformFeedback(t){const{gl:i,renderer:s,CONTEXT_UID:r}=this,n=i.createTransformFeedback();t._glTransformFeedbacks[r]=n,i.bindTransformFeedback(i.TRANSFORM_FEEDBACK,n);for(let o=0;o(e[e.INTERACTION=50]="INTERACTION",e[e.HIGH=25]="HIGH",e[e.NORMAL=0]="NORMAL",e[e.LOW=-25]="LOW",e[e.UTILITY=-50]="UTILITY",e))(ge||{});class nn{constructor(t,i=null,s=0,r=!1){this.next=null,this.previous=null,this._destroyed=!1,this.fn=t,this.context=i,this.priority=s,this.once=r}match(t,i=null){return this.fn===t&&this.context===i}emit(t){this.fn&&(this.context?this.fn.call(this.context,t):this.fn(t));const i=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),i}connect(t){this.previous=t,t.next&&(t.next.previous=this),this.next=t.next,t.next=this}destroy(t=!1){this._destroyed=!0,this.fn=null,this.context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);const i=this.next;return this.next=t?null:i,this.previous=null,i}}const Dt=class{constructor(){this.autoStart=!1,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=!1,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=!1,this._lastFrame=-1,this._head=new nn(null,null,1/0),this.deltaMS=1/Dt.targetFPMS,this.elapsedMS=1/Dt.targetFPMS,this._tick=e=>{this._requestId=null,this.started&&(this.update(e),this.started&&this._requestId===null&&this._head.next&&(this._requestId=requestAnimationFrame(this._tick)))}}_requestIfNeeded(){this._requestId===null&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))}_cancelIfNeeded(){this._requestId!==null&&(cancelAnimationFrame(this._requestId),this._requestId=null)}_startIfPossible(){this.started?this._requestIfNeeded():this.autoStart&&this.start()}add(e,t,i=ge.NORMAL){return this._addListener(new nn(e,t,i))}addOnce(e,t,i=ge.NORMAL){return this._addListener(new nn(e,t,i,!0))}_addListener(e){let t=this._head.next,i=this._head;if(!t)e.connect(i);else{for(;t;){if(e.priority>t.priority){e.connect(i);break}i=t,t=t.next}e.previous||e.connect(i)}return this._startIfPossible(),this}remove(e,t){let i=this._head.next;for(;i;)i.match(e,t)?i=i.destroy():i=i.next;return this._head.next||this._cancelIfNeeded(),this}get count(){if(!this._head)return 0;let e=0,t=this._head;for(;t=t.next;)e++;return e}start(){this.started||(this.started=!0,this._requestIfNeeded())}stop(){this.started&&(this.started=!1,this._cancelIfNeeded())}destroy(){if(!this._protected){this.stop();let e=this._head.next;for(;e;)e=e.destroy(!0);this._head.destroy(),this._head=null}}update(e=performance.now()){let t;if(e>this.lastTime){if(t=this.elapsedMS=e-this.lastTime,t>this._maxElapsedMS&&(t=this._maxElapsedMS),t*=this.speed,this._minElapsedMS){const r=e-this._lastFrame|0;if(r{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?lt.shared:new lt,t.autoStart&&this.start()}static destroy(){if(this._ticker){const t=this._ticker;this.ticker=null,t.destroy()}}}on.extension=M.Application,U.add(on);const Ea=[];U.handleByList(M.Renderer,Ea);function wa(e){for(const t of Ea)if(t.test(e))return new t(e);throw new Error("Unable to auto-detect a suitable renderer.")}var Wc=`attribute vec2 aVertexPosition; -attribute vec2 aTextureCoord; - -uniform mat3 projectionMatrix; - -varying vec2 vTextureCoord; - -void main(void) -{ - gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); - vTextureCoord = aTextureCoord; -}`,$c=`attribute vec2 aVertexPosition; - -uniform mat3 projectionMatrix; - -varying vec2 vTextureCoord; - -uniform vec4 inputSize; -uniform vec4 outputFrame; - -vec4 filterVertexPosition( void ) -{ - vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy; - - return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0); -} - -vec2 filterTextureCoord( void ) -{ - return aVertexPosition * (outputFrame.zw * inputSize.zw); -} - -void main(void) -{ - gl_Position = filterVertexPosition(); - vTextureCoord = filterTextureCoord(); -} -`;const Sa=Wc,an=$c;class hn{constructor(t){this.renderer=t}contextChange(t){let i;if(this.renderer.context.webGLVersion===1){const s=t.getParameter(t.FRAMEBUFFER_BINDING);t.bindFramebuffer(t.FRAMEBUFFER,null),i=t.getParameter(t.SAMPLES),t.bindFramebuffer(t.FRAMEBUFFER,s)}else{const s=t.getParameter(t.DRAW_FRAMEBUFFER_BINDING);t.bindFramebuffer(t.DRAW_FRAMEBUFFER,null),i=t.getParameter(t.SAMPLES),t.bindFramebuffer(t.DRAW_FRAMEBUFFER,s)}i>=ht.HIGH?this.multisample=ht.HIGH:i>=ht.MEDIUM?this.multisample=ht.MEDIUM:i>=ht.LOW?this.multisample=ht.LOW:this.multisample=ht.NONE}destroy(){}}hn.extension={type:M.RendererSystem,name:"_multisample"},U.add(hn);class jc{constructor(t){this.buffer=t||null,this.updateID=-1,this.byteLength=-1,this.refCount=0}}class ln{constructor(t){this.renderer=t,this.managedBuffers={},this.boundBufferBases={}}destroy(){this.renderer=null}contextChange(){this.disposeAll(!0),this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID}bind(t){const{gl:i,CONTEXT_UID:s}=this,r=t._glBuffers[s]||this.createGLBuffer(t);i.bindBuffer(t.type,r.buffer)}unbind(t){const{gl:i}=this;i.bindBuffer(t,null)}bindBufferBase(t,i){const{gl:s,CONTEXT_UID:r}=this;if(this.boundBufferBases[i]!==t){const n=t._glBuffers[r]||this.createGLBuffer(t);this.boundBufferBases[i]=t,s.bindBufferBase(s.UNIFORM_BUFFER,i,n.buffer)}}bindBufferRange(t,i,s){const{gl:r,CONTEXT_UID:n}=this;s=s||0;const o=t._glBuffers[n]||this.createGLBuffer(t);r.bindBufferRange(r.UNIFORM_BUFFER,i||0,o.buffer,s*256,256)}update(t){const{gl:i,CONTEXT_UID:s}=this,r=t._glBuffers[s]||this.createGLBuffer(t);if(t._updateID!==r.updateID)if(r.updateID=t._updateID,i.bindBuffer(t.type,r.buffer),r.byteLength>=t.data.byteLength)i.bufferSubData(t.type,0,t.data);else{const n=t.static?i.STATIC_DRAW:i.DYNAMIC_DRAW;r.byteLength=t.data.byteLength,i.bufferData(t.type,t.data,n)}}dispose(t,i){if(!this.managedBuffers[t.id])return;delete this.managedBuffers[t.id];const s=t._glBuffers[this.CONTEXT_UID],r=this.gl;t.disposeRunner.remove(this),s&&(i||r.deleteBuffer(s.buffer),delete t._glBuffers[this.CONTEXT_UID])}disposeAll(t){const i=Object.keys(this.managedBuffers);for(let s=0;ss.resource).filter(s=>s).map(s=>s.load());return this._load=Promise.all(i).then(()=>{const{realWidth:s,realHeight:r}=this.items[0];return this.resize(s,r),Promise.resolve(this)}),this._load}}class Aa extends dn{constructor(t,i){const{width:s,height:r}=i||{};let n,o;Array.isArray(t)?(n=t,o=t.length):o=t,super(o,{width:s,height:r}),n&&this.initFromArray(n,i)}addBaseTextureAt(t,i){if(t.resource)this.addResourceAt(t.resource,i);else throw new Error("ArrayResource does not support RenderTexture");return this}bind(t){super.bind(t),t.target=Re.TEXTURE_2D_ARRAY}upload(t,i,s){const{length:r,itemDirtyIds:n,items:o}=this,{gl:a}=t;s.dirtyId<0&&a.texImage3D(a.TEXTURE_2D_ARRAY,0,s.internalFormat,this._width,this._height,r,0,i.format,s.type,null);for(let h=0;h0)if(e.resource)this.addResourceAt(e.resource,t);else throw new Error("CubeResource does not support copying of renderTexture.");else e.target=Re.TEXTURE_CUBE_MAP_POSITIVE_X+t,e.parentTextureArray=this.baseTexture,this.items[t]=e;return e.valid&&!this.valid&&this.resize(e.realWidth,e.realHeight),this.items[t]=e,this}upload(e,t,i){const s=this.itemDirtyIds;for(let r=0;r{if(this.url===null){t(this);return}try{const s=await P.ADAPTER.fetch(this.url,{mode:this.crossOrigin?"cors":"no-cors"});if(this.destroyed)return;const r=await s.blob();if(this.destroyed)return;const n=await createImageBitmap(r,{premultiplyAlpha:this.alphaMode===null||this.alphaMode===Nt.UNPACK?"premultiply":"none"});if(this.destroyed)return;this.source=n,this.update(),t(this)}catch(s){if(this.destroyed)return;i(s),this.onError.emit(s)}}),this._load)}upload(t,i,s){return this.source instanceof ImageBitmap?(typeof this.alphaMode=="number"&&(i.alphaMode=this.alphaMode),super.upload(t,i,s)):(this.load(),!1)}dispose(){this.source instanceof ImageBitmap&&this.source.close(),super.dispose(),this._load=null}static test(t){return!!globalThis.createImageBitmap&&typeof ImageBitmap!="undefined"&&(typeof t=="string"||t instanceof ImageBitmap)}static get EMPTY(){var t;return Ue._EMPTY=(t=Ue._EMPTY)!=null?t:P.ADAPTER.createCanvas(0,0),Ue._EMPTY}}const Bs=class extends _e{constructor(e,t){t=t||{},super(P.ADAPTER.createCanvas()),this._width=0,this._height=0,this.svg=e,this.scale=t.scale||1,this._overrideWidth=t.width,this._overrideHeight=t.height,this._resolve=null,this._crossorigin=t.crossorigin,this._load=null,t.autoLoad!==!1&&this.load()}load(){return this._load?this._load:(this._load=new Promise(e=>{if(this._resolve=()=>{this.resize(this.source.width,this.source.height),e(this)},Bs.SVG_XML.test(this.svg.trim())){if(!btoa)throw new Error("Your browser doesn't support base64 conversions.");this.svg=`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(this.svg)))}`}this._loadSvg()}),this._load)}_loadSvg(){const e=new Image;_e.crossOrigin(e,this.svg,this._crossorigin),e.src=this.svg,e.onerror=t=>{!this._resolve||(e.onerror=null,this.onError.emit(t))},e.onload=()=>{if(!this._resolve)return;const t=e.width,i=e.height;if(!t||!i)throw new Error("The SVG image must have width and height defined (in pixels), canvas API needs them.");let s=t*this.scale,r=i*this.scale;(this._overrideWidth||this._overrideHeight)&&(s=this._overrideWidth||this._overrideHeight/i*t,r=this._overrideHeight||this._overrideWidth/t*i),s=Math.round(s),r=Math.round(r);const n=this.source;n.width=s,n.height=r,n._pixiId=`canvas_${xe()}`,n.getContext("2d").drawImage(e,0,0,t,i,0,0,s,r),this._resolve(),this._resolve=null}}static getSize(e){const t=Bs.SVG_SIZE.exec(e),i={};return t&&(i[t[1]]=Math.round(parseFloat(t[3])),i[t[5]]=Math.round(parseFloat(t[7]))),i}dispose(){super.dispose(),this._resolve=null,this._crossorigin=null}static test(e,t){return t==="svg"||typeof e=="string"&&e.startsWith("data:image/svg+xml")||typeof e=="string"&&Bs.SVG_XML.test(e)}};let Je=Bs;Je.SVG_XML=/^(<\?xml[^?]+\?>)?\s*()]*-->)?\s*\]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;const pn=class extends _e{constructor(e,t){if(t=t||{},!(e instanceof HTMLVideoElement)){const i=document.createElement("video");i.setAttribute("preload","auto"),i.setAttribute("webkit-playsinline",""),i.setAttribute("playsinline",""),typeof e=="string"&&(e=[e]);const s=e[0].src||e[0];_e.crossOrigin(i,s,t.crossorigin);for(let r=0;r{this.valid?t(this):(this._resolve=t,e.load())}),this._load}_onError(e){this.source.removeEventListener("error",this._onError,!0),this.onError.emit(e)}_isSourcePlaying(){const e=this.source;return!e.paused&&!e.ended&&this._isSourceReady()}_isSourceReady(){return this.source.readyState>2}_onPlayStart(){this.valid||this._onCanPlay(),this.autoUpdate&&!this._isConnectedToTicker&&(lt.shared.add(this.update,this),this._isConnectedToTicker=!0)}_onPlayStop(){this._isConnectedToTicker&&(lt.shared.remove(this.update,this),this._isConnectedToTicker=!1)}_onCanPlay(){const e=this.source;e.removeEventListener("canplay",this._onCanPlay),e.removeEventListener("canplaythrough",this._onCanPlay);const t=this.valid;this.resize(e.videoWidth,e.videoHeight),!t&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&e.play()}dispose(){this._isConnectedToTicker&&(lt.shared.remove(this.update,this),this._isConnectedToTicker=!1);const e=this.source;e&&(e.removeEventListener("error",this._onError,!0),e.pause(),e.src="",e.load()),super.dispose()}get autoUpdate(){return this._autoUpdate}set autoUpdate(e){e!==this._autoUpdate&&(this._autoUpdate=e,!this._autoUpdate&&this._isConnectedToTicker?(lt.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._isSourcePlaying()&&(lt.shared.add(this.update,this),this._isConnectedToTicker=!0))}get updateFPS(){return this._updateFPS}set updateFPS(e){e!==this._updateFPS&&(this._updateFPS=e)}static test(e,t){return globalThis.HTMLVideoElement&&e instanceof HTMLVideoElement||pn.TYPES.includes(t)}};let Ds=pn;Ds.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],Ds.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"},fs.push(Ue,Or,Ra,Ds,Je,Ye,fn,Aa);class Yc{constructor(){this._glTransformFeedbacks={},this.buffers=[],this.disposeRunner=new Bt("disposeTransformFeedback")}bindBuffer(t,i){this.buffers[t]=i}destroy(){this.disposeRunner.emit(this,!1)}}const qc="7.2.4";class Ii{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null,this.updateID=-1}isEmpty(){return this.minX>this.maxX||this.minY>this.maxY}clear(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}getRectangle(t){return this.minX>this.maxX||this.minY>this.maxY?$.EMPTY:(t=t||new $(0,0,1,1),t.x=this.minX,t.y=this.minY,t.width=this.maxX-this.minX,t.height=this.maxY-this.minY,t)}addPoint(t){this.minX=Math.min(this.minX,t.x),this.maxX=Math.max(this.maxX,t.x),this.minY=Math.min(this.minY,t.y),this.maxY=Math.max(this.maxY,t.y)}addPointMatrix(t,i){const{a:s,b:r,c:n,d:o,tx:a,ty:h}=t,l=s*i.x+n*i.y+a,c=r*i.x+o*i.y+h;this.minX=Math.min(this.minX,l),this.maxX=Math.max(this.maxX,l),this.minY=Math.min(this.minY,c),this.maxY=Math.max(this.maxY,c)}addQuad(t){let i=this.minX,s=this.minY,r=this.maxX,n=this.maxY,o=t[0],a=t[1];i=or?o:r,n=a>n?a:n,o=t[2],a=t[3],i=or?o:r,n=a>n?a:n,o=t[4],a=t[5],i=or?o:r,n=a>n?a:n,o=t[6],a=t[7],i=or?o:r,n=a>n?a:n,this.minX=i,this.minY=s,this.maxX=r,this.maxY=n}addFrame(t,i,s,r,n){this.addFrameMatrix(t.worldTransform,i,s,r,n)}addFrameMatrix(t,i,s,r,n){const o=t.a,a=t.b,h=t.c,l=t.d,c=t.tx,u=t.ty;let d=this.minX,f=this.minY,p=this.maxX,_=this.maxY,g=o*i+h*s+c,v=a*i+l*s+u;d=gp?g:p,_=v>_?v:_,g=o*r+h*s+c,v=a*r+l*s+u,d=gp?g:p,_=v>_?v:_,g=o*i+h*n+c,v=a*i+l*n+u,d=gp?g:p,_=v>_?v:_,g=o*r+h*n+c,v=a*r+l*n+u,d=gp?g:p,_=v>_?v:_,this.minX=d,this.minY=f,this.maxX=p,this.maxY=_}addVertexData(t,i,s){let r=this.minX,n=this.minY,o=this.maxX,a=this.maxY;for(let h=i;ho?l:o,a=c>a?c:a}this.minX=r,this.minY=n,this.maxX=o,this.maxY=a}addVertices(t,i,s,r){this.addVerticesMatrix(t.worldTransform,i,s,r)}addVerticesMatrix(t,i,s,r,n=0,o=n){const a=t.a,h=t.b,l=t.c,c=t.d,u=t.tx,d=t.ty;let f=this.minX,p=this.minY,_=this.maxX,g=this.maxY;for(let v=s;vr?t.maxX:r,this.maxY=t.maxY>n?t.maxY:n}addBoundsMask(t,i){const s=t.minX>i.minX?t.minX:i.minX,r=t.minY>i.minY?t.minY:i.minY,n=t.maxXl?n:l,this.maxY=o>c?o:c}}addBoundsMatrix(t,i){this.addFrameMatrix(i,t.minX,t.minY,t.maxX,t.maxY)}addBoundsArea(t,i){const s=t.minX>i.x?t.minX:i.x,r=t.minY>i.y?t.minY:i.y,n=t.maxXl?n:l,this.maxY=o>c?o:c}}pad(t=0,i=t){this.isEmpty()||(this.minX-=t,this.maxX+=t,this.minY-=i,this.maxY+=i)}addFramePad(t,i,s,r,n,o){t-=n,i-=o,s+=n,r+=o,this.minX=this.minXs?this.maxX:s,this.minY=this.minYr?this.maxY:r}}class st extends Ve{constructor(){super(),this.tempDisplayObjectParent=null,this.transform=new vi,this.alpha=1,this.visible=!0,this.renderable=!0,this.cullable=!1,this.cullArea=null,this.parent=null,this.worldAlpha=1,this._lastSortedIndex=0,this._zIndex=0,this.filterArea=null,this.filters=null,this._enabledFilters=null,this._bounds=new Ii,this._localBounds=null,this._boundsID=0,this._boundsRect=null,this._localBoundsRect=null,this._mask=null,this._maskRefCount=0,this._destroyed=!1,this.isSprite=!1,this.isMask=!1}static mixin(t){const i=Object.keys(t);for(let s=0;s1)for(let t=0;tthis.children.length)throw new Error(`${e}addChildAt: The index ${t} supplied is out of bounds ${this.children.length}`);return e.parent&&e.parent.removeChild(e),e.parent=this,this.sortDirty=!0,e.transform._parentID=-1,this.children.splice(t,0,e),this._boundsID++,this.onChildrenChange(t),e.emit("added",this),this.emit("childAdded",e,this,t),e}swapChildren(e,t){if(e===t)return;const i=this.getChildIndex(e),s=this.getChildIndex(t);this.children[i]=t,this.children[s]=e,this.onChildrenChange(i=this.children.length)throw new Error(`The index ${t} supplied is out of bounds ${this.children.length}`);const i=this.getChildIndex(e);Ie(this.children,i,1),this.children.splice(t,0,e),this.onChildrenChange(t)}getChildAt(e){if(e<0||e>=this.children.length)throw new Error(`getChildAt: Index (${e}) does not exist.`);return this.children[e]}removeChild(...e){if(e.length>1)for(let t=0;t0&&r<=s){n=this.children.splice(i,r);for(let o=0;o1&&this.children.sort(Zc),this.sortDirty=!1}updateTransform(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(let e=0,t=this.children.length;e0&&t.height>0))return;let i,s;this.cullArea?(i=this.cullArea,s=this.worldTransform):this._render!==mn.prototype._render&&(i=this.getBounds(!0));const r=e.projection.transform;if(r&&(s?(s=Kc.copyFrom(s),s.prepend(r)):s=r),i&&t.intersects(i,s))this._render(e);else if(this.cullArea)return;for(let n=0,o=this.children.length;n=r&&Pi.x=n&&Pi.y=i&&(o=e-a-1),h=h.replace("%value%",t[o].toString()),r+=h,r+=` -`}return s=s.replace("%blur%",r),s=s.replace("%size%",e.toString()),s}const ru=` - attribute vec2 aVertexPosition; - - uniform mat3 projectionMatrix; - - uniform float strength; - - varying vec2 vBlurTexCoords[%size%]; - - uniform vec4 inputSize; - uniform vec4 outputFrame; - - vec4 filterVertexPosition( void ) - { - vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy; - - return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0); - } - - vec2 filterTextureCoord( void ) - { - return aVertexPosition * (outputFrame.zw * inputSize.zw); - } - - void main(void) - { - gl_Position = filterVertexPosition(); - - vec2 textureCoord = filterTextureCoord(); - %blur% - }`;function nu(e,t){const i=Math.ceil(e/2);let s=ru,r="",n;t?n="vBlurTexCoords[%index%] = textureCoord + vec2(%sampleIndex% * strength, 0.0);":n="vBlurTexCoords[%index%] = textureCoord + vec2(0.0, %sampleIndex% * strength);";for(let o=0;o 0.0) { - c.rgb /= c.a; - } - - vec4 result; - - result.r = (m[0] * c.r); - result.r += (m[1] * c.g); - result.r += (m[2] * c.b); - result.r += (m[3] * c.a); - result.r += m[4]; - - result.g = (m[5] * c.r); - result.g += (m[6] * c.g); - result.g += (m[7] * c.b); - result.g += (m[8] * c.a); - result.g += m[9]; - - result.b = (m[10] * c.r); - result.b += (m[11] * c.g); - result.b += (m[12] * c.b); - result.b += (m[13] * c.a); - result.b += m[14]; - - result.a = (m[15] * c.r); - result.a += (m[16] * c.g); - result.a += (m[17] * c.b); - result.a += (m[18] * c.a); - result.a += m[19]; - - vec3 rgb = mix(c.rgb, result.rgb, uAlpha); - - // Premultiply alpha again. - rgb *= result.a; - - gl_FragColor = vec4(rgb, result.a); -} -`;class Ns extends gt{constructor(){const t={m:new Float32Array([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]),uAlpha:1};super(an,ou,t),this.alpha=1}_loadMatrix(t,i=!1){let s=t;i&&(this._multiply(s,this.uniforms.m,t),s=this._colorMatrix(s)),this.uniforms.m=s}_multiply(t,i,s){return t[0]=i[0]*s[0]+i[1]*s[5]+i[2]*s[10]+i[3]*s[15],t[1]=i[0]*s[1]+i[1]*s[6]+i[2]*s[11]+i[3]*s[16],t[2]=i[0]*s[2]+i[1]*s[7]+i[2]*s[12]+i[3]*s[17],t[3]=i[0]*s[3]+i[1]*s[8]+i[2]*s[13]+i[3]*s[18],t[4]=i[0]*s[4]+i[1]*s[9]+i[2]*s[14]+i[3]*s[19]+i[4],t[5]=i[5]*s[0]+i[6]*s[5]+i[7]*s[10]+i[8]*s[15],t[6]=i[5]*s[1]+i[6]*s[6]+i[7]*s[11]+i[8]*s[16],t[7]=i[5]*s[2]+i[6]*s[7]+i[7]*s[12]+i[8]*s[17],t[8]=i[5]*s[3]+i[6]*s[8]+i[7]*s[13]+i[8]*s[18],t[9]=i[5]*s[4]+i[6]*s[9]+i[7]*s[14]+i[8]*s[19]+i[9],t[10]=i[10]*s[0]+i[11]*s[5]+i[12]*s[10]+i[13]*s[15],t[11]=i[10]*s[1]+i[11]*s[6]+i[12]*s[11]+i[13]*s[16],t[12]=i[10]*s[2]+i[11]*s[7]+i[12]*s[12]+i[13]*s[17],t[13]=i[10]*s[3]+i[11]*s[8]+i[12]*s[13]+i[13]*s[18],t[14]=i[10]*s[4]+i[11]*s[9]+i[12]*s[14]+i[13]*s[19]+i[14],t[15]=i[15]*s[0]+i[16]*s[5]+i[17]*s[10]+i[18]*s[15],t[16]=i[15]*s[1]+i[16]*s[6]+i[17]*s[11]+i[18]*s[16],t[17]=i[15]*s[2]+i[16]*s[7]+i[17]*s[12]+i[18]*s[17],t[18]=i[15]*s[3]+i[16]*s[8]+i[17]*s[13]+i[18]*s[18],t[19]=i[15]*s[4]+i[16]*s[9]+i[17]*s[14]+i[18]*s[19]+i[19],t}_colorMatrix(t){const i=new Float32Array(t);return i[4]/=255,i[9]/=255,i[14]/=255,i[19]/=255,i}brightness(t,i){const s=[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0,0,0,0,1,0];this._loadMatrix(s,i)}tint(t,i){const[s,r,n]=j.shared.setValue(t).toArray(),o=[s,0,0,0,0,0,r,0,0,0,0,0,n,0,0,0,0,0,1,0];this._loadMatrix(o,i)}greyscale(t,i){const s=[t,t,t,0,0,t,t,t,0,0,t,t,t,0,0,0,0,0,1,0];this._loadMatrix(s,i)}blackAndWhite(t){const i=[.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0];this._loadMatrix(i,t)}hue(t,i){t=(t||0)/180*Math.PI;const s=Math.cos(t),r=Math.sin(t),n=Math.sqrt,o=1/3,a=n(o),h=s+(1-s)*o,l=o*(1-s)-a*r,c=o*(1-s)+a*r,u=o*(1-s)+a*r,d=s+o*(1-s),f=o*(1-s)-a*r,p=o*(1-s)-a*r,_=o*(1-s)+a*r,g=s+o*(1-s),v=[h,l,c,0,0,u,d,f,0,0,p,_,g,0,0,0,0,0,1,0];this._loadMatrix(v,i)}contrast(t,i){const s=(t||0)+1,r=-.5*(s-1),n=[s,0,0,0,r,0,s,0,0,r,0,0,s,0,r,0,0,0,1,0];this._loadMatrix(n,i)}saturate(t=0,i){const s=t*2/3+1,r=(s-1)*-.5,n=[s,r,r,0,0,r,s,r,0,0,r,r,s,0,0,0,0,0,1,0];this._loadMatrix(n,i)}desaturate(){this.saturate(-1)}negative(t){const i=[-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0];this._loadMatrix(i,t)}sepia(t){const i=[.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0];this._loadMatrix(i,t)}technicolor(t){const i=[1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0];this._loadMatrix(i,t)}polaroid(t){const i=[1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0];this._loadMatrix(i,t)}toBGR(t){const i=[0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0];this._loadMatrix(i,t)}kodachrome(t){const i=[1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0];this._loadMatrix(i,t)}browni(t){const i=[.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0];this._loadMatrix(i,t)}vintage(t){const i=[.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0];this._loadMatrix(i,t)}colorTone(t,i,s,r,n){t=t||.2,i=i||.15,s=s||16770432,r=r||3375104;const o=j.shared,[a,h,l]=o.setValue(s).toArray(),[c,u,d]=o.setValue(r).toArray(),f=[.3,.59,.11,0,0,a,h,l,t,0,c,u,d,i,0,a-c,h-u,l-d,0,0];this._loadMatrix(f,n)}night(t,i){t=t||.1;const s=[t*-2,-t,0,0,0,-t,0,t,0,0,0,t,t*2,0,0,0,0,0,1,0];this._loadMatrix(s,i)}predator(t,i){const s=[11.224130630493164*t,-4.794486999511719*t,-2.8746118545532227*t,0*t,.40342438220977783*t,-3.6330697536468506*t,9.193157196044922*t,-2.951810836791992*t,0*t,-1.316135048866272*t,-3.2184197902679443*t,-4.2375030517578125*t,7.476448059082031*t,0*t,.8044459223747253*t,0,0,0,1,0];this._loadMatrix(s,i)}lsd(t){const i=[2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0];this._loadMatrix(i,t)}reset(){const t=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0];this._loadMatrix(t,!1)}get matrix(){return this.uniforms.m}set matrix(t){this.uniforms.m=t}get alpha(){return this.uniforms.uAlpha}set alpha(t){this.uniforms.uAlpha=t}}Ns.prototype.grayscale=Ns.prototype.greyscale;var au=`varying vec2 vFilterCoord; -varying vec2 vTextureCoord; - -uniform vec2 scale; -uniform mat2 rotation; -uniform sampler2D uSampler; -uniform sampler2D mapSampler; - -uniform highp vec4 inputSize; -uniform vec4 inputClamp; - -void main(void) -{ - vec4 map = texture2D(mapSampler, vFilterCoord); - - map -= 0.5; - map.xy = scale * inputSize.zw * (rotation * map.xy); - - gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), inputClamp.xy, inputClamp.zw)); -} -`,hu=`attribute vec2 aVertexPosition; - -uniform mat3 projectionMatrix; -uniform mat3 filterMatrix; - -varying vec2 vTextureCoord; -varying vec2 vFilterCoord; - -uniform vec4 inputSize; -uniform vec4 outputFrame; - -vec4 filterVertexPosition( void ) -{ - vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy; - - return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0); -} - -vec2 filterTextureCoord( void ) -{ - return aVertexPosition * (outputFrame.zw * inputSize.zw); -} - -void main(void) -{ - gl_Position = filterVertexPosition(); - vTextureCoord = filterTextureCoord(); - vFilterCoord = ( filterMatrix * vec3( vTextureCoord, 1.0) ).xy; -} -`;class Ba extends gt{constructor(t,i){const s=new tt;t.renderable=!1,super(hu,au,{mapSampler:t._texture,filterMatrix:s,scale:{x:1,y:1},rotation:new Float32Array([1,0,0,1])}),this.maskSprite=t,this.maskMatrix=s,i==null&&(i=20),this.scale=new Y(i,i)}apply(t,i,s,r){this.uniforms.filterMatrix=t.calculateSpriteMatrix(this.maskMatrix,this.maskSprite),this.uniforms.scale.x=this.scale.x,this.uniforms.scale.y=this.scale.y;const n=this.maskSprite.worldTransform,o=Math.sqrt(n.a*n.a+n.b*n.b),a=Math.sqrt(n.c*n.c+n.d*n.d);o!==0&&a!==0&&(this.uniforms.rotation[0]=n.a/o,this.uniforms.rotation[1]=n.b/o,this.uniforms.rotation[2]=n.c/a,this.uniforms.rotation[3]=n.d/a),t.applyFilter(this,i,s,r)}get map(){return this.uniforms.mapSampler}set map(t){this.uniforms.mapSampler=t}}var lu=`varying vec2 v_rgbNW; -varying vec2 v_rgbNE; -varying vec2 v_rgbSW; -varying vec2 v_rgbSE; -varying vec2 v_rgbM; - -varying vec2 vFragCoord; -uniform sampler2D uSampler; -uniform highp vec4 inputSize; - - -/** - Basic FXAA implementation based on the code on geeks3d.com with the - modification that the texture2DLod stuff was removed since it's - unsupported by WebGL. - - -- - - From: - https://github.com/mitsuhiko/webgl-meincraft - - Copyright (c) 2011 by Armin Ronacher. - - Some rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - - * The names of the contributors may not be used to endorse or - promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef FXAA_REDUCE_MIN -#define FXAA_REDUCE_MIN (1.0/ 128.0) -#endif -#ifndef FXAA_REDUCE_MUL -#define FXAA_REDUCE_MUL (1.0 / 8.0) -#endif -#ifndef FXAA_SPAN_MAX -#define FXAA_SPAN_MAX 8.0 -#endif - -//optimized version for mobile, where dependent -//texture reads can be a bottleneck -vec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 inverseVP, - vec2 v_rgbNW, vec2 v_rgbNE, - vec2 v_rgbSW, vec2 v_rgbSE, - vec2 v_rgbM) { - vec4 color; - vec3 rgbNW = texture2D(tex, v_rgbNW).xyz; - vec3 rgbNE = texture2D(tex, v_rgbNE).xyz; - vec3 rgbSW = texture2D(tex, v_rgbSW).xyz; - vec3 rgbSE = texture2D(tex, v_rgbSE).xyz; - vec4 texColor = texture2D(tex, v_rgbM); - vec3 rgbM = texColor.xyz; - vec3 luma = vec3(0.299, 0.587, 0.114); - float lumaNW = dot(rgbNW, luma); - float lumaNE = dot(rgbNE, luma); - float lumaSW = dot(rgbSW, luma); - float lumaSE = dot(rgbSE, luma); - float lumaM = dot(rgbM, luma); - float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE))); - float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE))); - - mediump vec2 dir; - dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE)); - dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE)); - - float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) * - (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN); - - float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce); - dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX), - max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX), - dir * rcpDirMin)) * inverseVP; - - vec3 rgbA = 0.5 * ( - texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz + - texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz); - vec3 rgbB = rgbA * 0.5 + 0.25 * ( - texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz + - texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz); - - float lumaB = dot(rgbB, luma); - if ((lumaB < lumaMin) || (lumaB > lumaMax)) - color = vec4(rgbA, texColor.a); - else - color = vec4(rgbB, texColor.a); - return color; -} - -void main() { - - vec4 color; - - color = fxaa(uSampler, vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM); - - gl_FragColor = color; -} -`,cu=` -attribute vec2 aVertexPosition; - -uniform mat3 projectionMatrix; - -varying vec2 v_rgbNW; -varying vec2 v_rgbNE; -varying vec2 v_rgbSW; -varying vec2 v_rgbSE; -varying vec2 v_rgbM; - -varying vec2 vFragCoord; - -uniform vec4 inputSize; -uniform vec4 outputFrame; - -vec4 filterVertexPosition( void ) -{ - vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy; - - return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0); -} - -void texcoords(vec2 fragCoord, vec2 inverseVP, - out vec2 v_rgbNW, out vec2 v_rgbNE, - out vec2 v_rgbSW, out vec2 v_rgbSE, - out vec2 v_rgbM) { - v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP; - v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP; - v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP; - v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP; - v_rgbM = vec2(fragCoord * inverseVP); -} - -void main(void) { - - gl_Position = filterVertexPosition(); - - vFragCoord = aVertexPosition * outputFrame.zw; - - texcoords(vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM); -} -`;class Da extends gt{constructor(){super(cu,lu)}}var uu=`precision highp float; - -varying vec2 vTextureCoord; -varying vec4 vColor; - -uniform float uNoise; -uniform float uSeed; -uniform sampler2D uSampler; - -float rand(vec2 co) -{ - return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453); -} - -void main() -{ - vec4 color = texture2D(uSampler, vTextureCoord); - float randomValue = rand(gl_FragCoord.xy * uSeed); - float diff = (randomValue - 0.5) * uNoise; - - // Un-premultiply alpha before applying the color matrix. See issue #3539. - if (color.a > 0.0) { - color.rgb /= color.a; - } - - color.r += diff; - color.g += diff; - color.b += diff; - - // Premultiply alpha again. - color.rgb *= color.a; - - gl_FragColor = color; -} -`;class Fa extends gt{constructor(t=.5,i=Math.random()){super(an,uu,{uNoise:0,uSeed:0}),this.noise=t,this.seed=i}get noise(){return this.uniforms.uNoise}set noise(t){this.uniforms.uNoise=t}get seed(){return this.uniforms.uSeed}set seed(t){this.uniforms.uSeed=t}}const _n={AlphaFilter:Pa,BlurFilter:Ma,BlurFilterPass:Fs,ColorMatrixFilter:Ns,DisplacementFilter:Ba,FXAAFilter:Da,NoiseFilter:Fa};Object.entries(_n).forEach(([e,t])=>{Object.defineProperty(_n,e,{get(){return t}})});class du{constructor(){this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this.tickerAdded=!1,this._pauseUpdate=!0}init(t){this.removeTickerListener(),this.events=t,this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this.tickerAdded=!1,this._pauseUpdate=!0}get pauseUpdate(){return this._pauseUpdate}set pauseUpdate(t){this._pauseUpdate=t}addTickerListener(){this.tickerAdded||!this.domElement||(lt.system.add(this.tickerUpdate,this,ge.INTERACTION),this.tickerAdded=!0)}removeTickerListener(){!this.tickerAdded||(lt.system.remove(this.tickerUpdate,this),this.tickerAdded=!1)}pointerMoved(){this._didMove=!0}update(){if(!this.domElement||this._pauseUpdate)return;if(this._didMove){this._didMove=!1;return}const t=this.events.rootPointerEvent;this.events.supportsTouchEvents&&t.pointerType==="touch"||globalThis.document.dispatchEvent(new PointerEvent("pointermove",{clientX:t.clientX,clientY:t.clientY}))}tickerUpdate(t){this._deltaTime+=t,!(this._deltaTimes.priority-r.priority)}dispatchEvent(t,i){t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,i),this.dispatch.emit(i||t.type,t)}mapEvent(t){if(!this.rootTarget)return;const i=this.mappingTable[t.type];if(i)for(let s=0,r=i.length;s=0;r--)if(t.currentTarget=s[r],this.notifyTarget(t,i),t.propagationStopped||t.propagationImmediatelyStopped)return}}all(t,i,s=this._allInteractiveElements){if(s.length===0)return;t.eventPhase=t.BUBBLING_PHASE;const r=Array.isArray(i)?i:[i];for(let n=s.length-1;n>=0;n--)r.forEach(o=>{t.currentTarget=s[n],this.notifyTarget(t,o)})}propagationPath(t){const i=[t];for(let s=0;s=0;u--){const d=c[u],f=this.hitTestMoveRecursive(d,this._isInteractive(i)?i:d.eventMode,s,r,n,o||n(t,s));if(f){if(f.length>0&&!f[f.length-1].parent)continue;const p=t.isInteractive();(f.length>0||p)&&(p&&this._allInteractiveElements.push(t),f.push(t)),this._hitElements.length===0&&(this._hitElements=f),a=!0}}}const h=this._isInteractive(i),l=t.isInteractive();return l&&l&&this._allInteractiveElements.push(t),o||this._hitElements.length>0?null:a?this._hitElements:h&&!n(t,s)&&r(t,s)?l?[t]:[]:null}hitTestRecursive(t,i,s,r,n){if(this._interactivePrune(t)||n(t,s))return null;if((t.eventMode==="dynamic"||i==="dynamic")&&(Te.pauseUpdate=!1),t.interactiveChildren&&t.children){const h=t.children;for(let l=h.length-1;l>=0;l--){const c=h[l],u=this.hitTestRecursive(c,this._isInteractive(i)?i:c.eventMode,s,r,n);if(u){if(u.length>0&&!u[u.length-1].parent)continue;const d=t.isInteractive();return(u.length>0||d)&&u.push(t),u}}}const o=this._isInteractive(i),a=t.isInteractive();return o&&r(t,s)?a?[t]:[]:null}_isInteractive(t){return t==="static"||t==="dynamic"}_interactivePrune(t){return!!(!t||t.isMask||!t.visible||!t.renderable||t.eventMode==="none"||t.eventMode==="passive"&&!t.interactiveChildren||t.isMask)}hitPruneFn(t,i){var s;if(t.hitArea&&(t.worldTransform.applyInverse(i,gn),!t.hitArea.contains(gn.x,gn.y)))return!0;if(t._mask){const r=t._mask.isMaskData?t._mask.maskObject:t._mask;if(r&&!((s=r.containsPoint)!=null&&s.call(r,i)))return!0}return!1}hitTestFn(t,i){return t.eventMode==="passive"?!1:t.hitArea?!0:t.containsPoint?t.containsPoint(i):!1}notifyTarget(t,i){var n,o;i=i!=null?i:t.type;const s=`on${i}`;(o=(n=t.currentTarget)[s])==null||o.call(n,t);const r=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?`${i}capture`:i;this.notifyListeners(t,r),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,i)}mapPointerDown(t){if(!(t instanceof Xt)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const i=this.createPointerEvent(t);if(this.dispatchEvent(i,"pointerdown"),i.pointerType==="touch")this.dispatchEvent(i,"touchstart");else if(i.pointerType==="mouse"||i.pointerType==="pen"){const r=i.button===2;this.dispatchEvent(i,r?"rightdown":"mousedown")}const s=this.trackingData(t.pointerId);s.pressTargetsByButton[t.button]=i.composedPath(),this.freeEvent(i)}mapPointerMove(t){var h,l,c;if(!(t instanceof Xt)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}this._allInteractiveElements.length=0,this._hitElements.length=0,this._isPointerMoveEvent=!0;const i=this.createPointerEvent(t);this._isPointerMoveEvent=!1;const s=i.pointerType==="mouse"||i.pointerType==="pen",r=this.trackingData(t.pointerId),n=this.findMountedTarget(r.overTargets);if(((h=r.overTargets)==null?void 0:h.length)>0&&n!==i.target){const u=t.type==="mousemove"?"mouseout":"pointerout",d=this.createPointerEvent(t,u,n);if(this.dispatchEvent(d,"pointerout"),s&&this.dispatchEvent(d,"mouseout"),!i.composedPath().includes(n)){const f=this.createPointerEvent(t,"pointerleave",n);for(f.eventPhase=f.AT_TARGET;f.target&&!i.composedPath().includes(f.target);)f.currentTarget=f.target,this.notifyTarget(f),s&&this.notifyTarget(f,"mouseleave"),f.target=f.target.parent;this.freeEvent(f)}this.freeEvent(d)}if(n!==i.target){const u=t.type==="mousemove"?"mouseover":"pointerover",d=this.clonePointerEvent(i,u);this.dispatchEvent(d,"pointerover"),s&&this.dispatchEvent(d,"mouseover");let f=n==null?void 0:n.parent;for(;f&&f!==this.rootTarget.parent&&f!==i.target;)f=f.parent;if(!f||f===this.rootTarget.parent){const _=this.clonePointerEvent(i,"pointerenter");for(_.eventPhase=_.AT_TARGET;_.target&&_.target!==n&&_.target!==this.rootTarget.parent;)_.currentTarget=_.target,this.notifyTarget(_),s&&this.notifyTarget(_,"mouseenter"),_.target=_.target.parent;this.freeEvent(_)}this.freeEvent(d)}const o=[],a=(l=this.enableGlobalMoveEvents)!=null?l:!0;this.moveOnAll?o.push("pointermove"):this.dispatchEvent(i,"pointermove"),a&&o.push("globalpointermove"),i.pointerType==="touch"&&(this.moveOnAll?o.splice(1,0,"touchmove"):this.dispatchEvent(i,"touchmove"),a&&o.push("globaltouchmove")),s&&(this.moveOnAll?o.splice(1,0,"mousemove"):this.dispatchEvent(i,"mousemove"),a&&o.push("globalmousemove"),this.cursor=(c=i.target)==null?void 0:c.cursor),o.length>0&&this.all(i,o),this._allInteractiveElements.length=0,this._hitElements.length=0,r.overTargets=i.composedPath(),this.freeEvent(i)}mapPointerOver(t){var o;if(!(t instanceof Xt)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const i=this.trackingData(t.pointerId),s=this.createPointerEvent(t),r=s.pointerType==="mouse"||s.pointerType==="pen";this.dispatchEvent(s,"pointerover"),r&&this.dispatchEvent(s,"mouseover"),s.pointerType==="mouse"&&(this.cursor=(o=s.target)==null?void 0:o.cursor);const n=this.clonePointerEvent(s,"pointerenter");for(n.eventPhase=n.AT_TARGET;n.target&&n.target!==this.rootTarget.parent;)n.currentTarget=n.target,this.notifyTarget(n),r&&this.notifyTarget(n,"mouseenter"),n.target=n.target.parent;i.overTargets=s.composedPath(),this.freeEvent(s),this.freeEvent(n)}mapPointerOut(t){if(!(t instanceof Xt)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const i=this.trackingData(t.pointerId);if(i.overTargets){const s=t.pointerType==="mouse"||t.pointerType==="pen",r=this.findMountedTarget(i.overTargets),n=this.createPointerEvent(t,"pointerout",r);this.dispatchEvent(n),s&&this.dispatchEvent(n,"mouseout");const o=this.createPointerEvent(t,"pointerleave",r);for(o.eventPhase=o.AT_TARGET;o.target&&o.target!==this.rootTarget.parent;)o.currentTarget=o.target,this.notifyTarget(o),s&&this.notifyTarget(o,"mouseleave"),o.target=o.target.parent;i.overTargets=null,this.freeEvent(n),this.freeEvent(o)}this.cursor=null}mapPointerUp(t){if(!(t instanceof Xt)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const i=performance.now(),s=this.createPointerEvent(t);if(this.dispatchEvent(s,"pointerup"),s.pointerType==="touch")this.dispatchEvent(s,"touchend");else if(s.pointerType==="mouse"||s.pointerType==="pen"){const a=s.button===2;this.dispatchEvent(s,a?"rightup":"mouseup")}const r=this.trackingData(t.pointerId),n=this.findMountedTarget(r.pressTargetsByButton[t.button]);let o=n;if(n&&!s.composedPath().includes(n)){let a=n;for(;a&&!s.composedPath().includes(a);){if(s.currentTarget=a,this.notifyTarget(s,"pointerupoutside"),s.pointerType==="touch")this.notifyTarget(s,"touchendoutside");else if(s.pointerType==="mouse"||s.pointerType==="pen"){const h=s.button===2;this.notifyTarget(s,h?"rightupoutside":"mouseupoutside")}a=a.parent}delete r.pressTargetsByButton[t.button],o=a}if(o){const a=this.clonePointerEvent(s,"click");a.target=o,a.path=null,r.clicksByButton[t.button]||(r.clicksByButton[t.button]={clickCount:0,target:a.target,timeStamp:i});const h=r.clicksByButton[t.button];if(h.target===a.target&&i-h.timeStamp<200?++h.clickCount:h.clickCount=1,h.target=a.target,h.timeStamp=i,a.detail=h.clickCount,a.pointerType==="mouse"){const l=a.button===2;this.dispatchEvent(a,l?"rightclick":"click")}else a.pointerType==="touch"&&this.dispatchEvent(a,"tap");this.dispatchEvent(a,"pointertap"),this.freeEvent(a)}this.freeEvent(s)}mapPointerUpOutside(t){if(!(t instanceof Xt)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const i=this.trackingData(t.pointerId),s=this.findMountedTarget(i.pressTargetsByButton[t.button]),r=this.createPointerEvent(t);if(s){let n=s;for(;n;)r.currentTarget=n,this.notifyTarget(r,"pointerupoutside"),r.pointerType==="touch"?this.notifyTarget(r,"touchendoutside"):(r.pointerType==="mouse"||r.pointerType==="pen")&&this.notifyTarget(r,r.button===2?"rightupoutside":"mouseupoutside"),n=n.parent;delete i.pressTargetsByButton[t.button]}this.freeEvent(r)}mapWheel(t){if(!(t instanceof ke)){console.warn("EventBoundary cannot map a non-wheel event as a wheel event");return}const i=this.createWheelEvent(t);this.dispatchEvent(i),this.freeEvent(i)}findMountedTarget(t){if(!t)return null;let i=t[0];for(let s=1;s(i==="globalMove"&&(this.rootBoundary.enableGlobalMoveEvents=s),t[i]=s,!0)}),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOverOut=this.onPointerOverOut.bind(this),this.onWheel=this.onWheel.bind(this)}static get defaultEventMode(){return this._defaultEventMode}init(e){var s,r;const{view:t,resolution:i}=this.renderer;this.setTargetElement(t),this.resolution=i,yn._defaultEventMode=(s=e.eventMode)!=null?s:"auto",Object.assign(this.features,(r=e.eventFeatures)!=null?r:{}),this.rootBoundary.enableGlobalMoveEvents=this.features.globalMove}resolutionChange(e){this.resolution=e}destroy(){this.setTargetElement(null),this.renderer=null}setCursor(e){e=e||"default";let t=!0;if(globalThis.OffscreenCanvas&&this.domElement instanceof OffscreenCanvas&&(t=!1),this.currentCursor===e)return;this.currentCursor=e;const i=this.cursorStyles[e];if(i)switch(typeof i){case"string":t&&(this.domElement.style.cursor=i);break;case"function":i(e);break;case"object":t&&Object.assign(this.domElement.style,i);break}else t&&typeof e=="string"&&!Object.prototype.hasOwnProperty.call(this.cursorStyles,e)&&(this.domElement.style.cursor=e)}get pointer(){return this.rootPointerEvent}onPointerDown(e){if(!this.features.click||(this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,this.supportsTouchEvents&&e.pointerType==="touch"))return;const t=this.normalizeToPointerData(e);this.autoPreventDefault&&t[0].isNormalized&&(e.cancelable||!("cancelable"in e))&&e.preventDefault();for(let i=0,s=t.length;i0&&(t=e.composedPath()[0]);const i=t!==this.domElement?"outside":"",s=this.normalizeToPointerData(e);for(let r=0,n=s.length;r{this._isMobileAccessibility=!0,this.activate(),this.destroyTouchHook()}),document.body.appendChild(t),this._hookDiv=t}destroyTouchHook(){!this._hookDiv||(document.body.removeChild(this._hookDiv),this._hookDiv=null)}activate(){var t;this._isActive||(this._isActive=!0,globalThis.document.addEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown,!1),this.renderer.on("postrender",this.update,this),(t=this.renderer.view.parentNode)==null||t.appendChild(this.div))}deactivate(){var t;!this._isActive||this._isMobileAccessibility||(this._isActive=!1,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.addEventListener("keydown",this._onKeyDown,!1),this.renderer.off("postrender",this.update),(t=this.div.parentNode)==null||t.removeChild(this.div))}updateAccessibleObjects(t){if(!t.visible||!t.accessibleChildren)return;t.accessible&&t.isInteractive()&&(t._accessibleActive||this.addChild(t),t.renderId=this.renderId);const i=t.children;if(i)for(let s=0;s title : ${t.title}
tabIndex: ${t.tabIndex}`}capHitArea(t){t.x<0&&(t.width+=t.x,t.x=0),t.y<0&&(t.height+=t.y,t.y=0);const{width:i,height:s}=this.renderer;t.x+t.width>i&&(t.width=i-t.x),t.y+t.height>s&&(t.height=s-t.y)}addChild(t){let i=this.pool.pop();i||(i=document.createElement("button"),i.style.width=`${Ls}px`,i.style.height=`${Ls}px`,i.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",i.style.position="absolute",i.style.zIndex=ka.toString(),i.style.borderStyle="none",navigator.userAgent.toLowerCase().includes("chrome")?i.setAttribute("aria-live","off"):i.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?i.setAttribute("aria-relevant","additions"):i.setAttribute("aria-relevant","text"),i.addEventListener("click",this._onClick.bind(this)),i.addEventListener("focus",this._onFocus.bind(this)),i.addEventListener("focusout",this._onFocusOut.bind(this))),i.style.pointerEvents=t.accessiblePointerEvents,i.type=t.accessibleType,t.accessibleTitle&&t.accessibleTitle!==null?i.title=t.accessibleTitle:(!t.accessibleHint||t.accessibleHint===null)&&(i.title=`displayObject ${t.tabIndex}`),t.accessibleHint&&t.accessibleHint!==null&&i.setAttribute("aria-label",t.accessibleHint),this.debug&&this.updateDebugHTML(i),t._accessibleActive=!0,t._accessibleDiv=i,i.displayObject=t,this.children.push(t),this.div.appendChild(t._accessibleDiv),t._accessibleDiv.tabIndex=t.tabIndex}_dispatchEvent(t,i){const{displayObject:s}=t.target,r=this.renderer.events.rootBoundary,n=Object.assign(new Qe(r),{target:s});r.rootTarget=this.renderer.lastObjectRendered,i.forEach(o=>r.dispatchEvent(n,o))}_onClick(t){this._dispatchEvent(t,["click","pointertap","tap"])}_onFocus(t){t.target.getAttribute("aria-live")||t.target.setAttribute("aria-live","assertive"),this._dispatchEvent(t,["mouseover"])}_onFocusOut(t){t.target.getAttribute("aria-live")||t.target.setAttribute("aria-live","polite"),this._dispatchEvent(t,["mouseout"])}_onKeyDown(t){t.keyCode===gu&&this.activate()}_onMouseMove(t){t.movementX===0&&t.movementY===0||this.deactivate()}destroy(){this.destroyTouchHook(),this.div=null,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown),this.pool=null,this.children=null,this.renderer=null}}vn.extension={name:"accessibility",type:[M.RendererPlugin,M.CanvasRendererPlugin]},U.add(vn);const xn=class{constructor(e){this.stage=new Ct,e=Object.assign({forceCanvas:!1},e),this.renderer=wa(e),xn._plugins.forEach(t=>{t.init.call(this,e)})}render(){this.renderer.render(this.stage)}get view(){return this.renderer.view}get screen(){return this.renderer.screen}destroy(e,t){const i=xn._plugins.slice(0);i.reverse(),i.forEach(s=>{s.destroy.call(this)}),this.stage.destroy(t),this.stage=null,this.renderer.destroy(e),this.renderer=null}};let bn=xn;bn._plugins=[],U.handleByList(M.Application,bn._plugins);class Tn{static init(t){Object.defineProperty(this,"resizeTo",{set(i){globalThis.removeEventListener("resize",this.queueResize),this._resizeTo=i,i&&(globalThis.addEventListener("resize",this.queueResize),this.resize())},get(){return this._resizeTo}}),this.queueResize=()=>{!this._resizeTo||(this.cancelResize(),this._resizeId=requestAnimationFrame(()=>this.resize()))},this.cancelResize=()=>{this._resizeId&&(cancelAnimationFrame(this._resizeId),this._resizeId=null)},this.resize=()=>{if(!this._resizeTo)return;this.cancelResize();let i,s;if(this._resizeTo===globalThis.window)i=globalThis.innerWidth,s=globalThis.innerHeight;else{const{clientWidth:r,clientHeight:n}=this._resizeTo;i=r,s=n}this.renderer.resize(i,s),this.render()},this._resizeId=null,this._resizeTo=null,this.resizeTo=t.resizeTo||null}static destroy(){globalThis.removeEventListener("resize",this.queueResize),this.cancelResize(),this.cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null}}Tn.extension=M.Application,U.add(Tn);const Ha={loader:M.LoadParser,resolver:M.ResolveParser,cache:M.CacheParser,detection:M.DetectionParser};U.handle(M.Asset,e=>{const t=e.ref;Object.entries(Ha).filter(([i])=>!!t[i]).forEach(([i,s])=>{var r;return U.add(Object.assign(t[i],{extension:(r=t[i].extension)!=null?r:s}))})},e=>{const t=e.ref;Object.keys(Ha).filter(i=>!!t[i]).forEach(i=>U.remove(t[i]))});class Eu{constructor(t,i=!1){this._loader=t,this._assetList=[],this._isLoading=!1,this._maxConcurrent=1,this.verbose=i}add(t){t.forEach(i=>{this._assetList.push(i)}),this.verbose&&console.log("[BackgroundLoader] assets: ",this._assetList),this._isActive&&!this._isLoading&&this._next()}async _next(){if(this._assetList.length&&this._isActive){this._isLoading=!0;const t=[],i=Math.min(this._assetList.length,this._maxConcurrent);for(let s=0;s(Array.isArray(e)||(e=[e]),t?e.map(i=>typeof i=="string"?t(i):i):e),Os=(e,t)=>{const i=t.split("?")[1];return i&&(e+=`?${i}`),e};function Xa(e,t,i,s,r){const n=t[i];for(let o=0;o{const o=n.substring(1,n.length-1).split(",");r.push(o)}),Xa(e,r,0,i,s)}else s.push(e);return s}const Bi=e=>!Array.isArray(e);class wu{constructor(){this._parsers=[],this._cache=new Map,this._cacheMap=new Map}reset(){this._cacheMap.clear(),this._cache.clear()}has(t){return this._cache.has(t)}get(t){const i=this._cache.get(t);return i||console.warn(`[Assets] Asset id ${t} was not found in the Cache`),i}set(t,i){const s=oe(t);let r;for(let a=0;a{r[a]=i}));const n=Object.keys(r),o={cacheKeys:n,keys:s};if(s.forEach(a=>{this._cacheMap.set(a,o)}),n.forEach(a=>{this._cache.has(a)&&this._cache.get(a)!==i&&console.warn("[Cache] already has key:",a),this._cache.set(a,r[a])}),i instanceof B){const a=i;s.forEach(h=>{a.baseTexture!==B.EMPTY.baseTexture&&V.addToCache(a.baseTexture,h),B.addToCache(a,h)})}}remove(t){if(this._cacheMap.get(t),!this._cacheMap.has(t)){console.warn(`[Assets] Asset id ${t} was not found in the Cache`);return}const i=this._cacheMap.get(t);i.cacheKeys.forEach(r=>{this._cache.delete(r)}),i.keys.forEach(r=>{this._cacheMap.delete(r)})}get parsers(){return this._parsers}}const ii=new wu;class Su{constructor(){this._parsers=[],this._parsersValidated=!1,this.parsers=new Proxy(this._parsers,{set:(t,i,s)=>(this._parsersValidated=!1,t[i]=s,!0)}),this.promiseCache={}}reset(){this._parsersValidated=!1,this.promiseCache={}}_getLoadPromiseAndParser(t,i){const s={promise:null,parser:null};return s.promise=(async()=>{var o,a;let r=null,n=null;if(i.loadParser&&(n=this._parserHash[i.loadParser],n||console.warn(`[Assets] specified load parser "${i.loadParser}" not found while loading ${t}`)),!n){for(let h=0;h({src:l})),a=o.length,h=o.map(async l=>{const c=Tt.toAbsolute(l.src);if(!r[l.src])try{this.promiseCache[c]||(this.promiseCache[c]=this._getLoadPromiseAndParser(c,l)),r[l.src]=await this.promiseCache[c].promise,i&&i(++s/a)}catch(u){throw delete this.promiseCache[c],delete r[l.src],new Error(`[Loader.load] Failed to load ${c}. -${u}`)}});return await Promise.all(h),n?r[o[0].src]:r}async unload(t){const s=oe(t,r=>({src:r})).map(async r=>{var a,h;const n=Tt.toAbsolute(r.src),o=this.promiseCache[n];if(o){const l=await o.promise;(h=(a=o.parser)==null?void 0:a.unload)==null||h.call(a,l,r,this),delete this.promiseCache[n]}});await Promise.all(s)}_validateParsers(){this._parsersValidated=!0,this._parserHash=this._parsers.filter(t=>t.name).reduce((t,i)=>(t[i.name]&&console.warn(`[Assets] loadParser name conflict "${i.name}"`),Qi(bt({},t),{[i.name]:i})),{})}}var Jt=(e=>(e[e.Low=0]="Low",e[e.Normal=1]="Normal",e[e.High=2]="High",e))(Jt||{});const Au=".json",Ru="application/json",za={extension:{type:M.LoadParser,priority:Jt.Low},name:"loadJson",test(e){return ei(e,Ru)||Ee(e,Au)},async load(e){return await(await P.ADAPTER.fetch(e)).json()}};U.add(za);const Cu=".txt",Iu="text/plain",Wa={name:"loadTxt",extension:{type:M.LoadParser,priority:Jt.Low},test(e){return ei(e,Iu)||Ee(e,Cu)},async load(e){return await(await P.ADAPTER.fetch(e)).text()}};U.add(Wa);const Pu=["normal","bold","100","200","300","400","500","600","700","800","900"],Mu=[".ttf",".otf",".woff",".woff2"],Bu=["font/ttf","font/otf","font/woff","font/woff2"],Du=/^(--|-?[A-Z_])[0-9A-Z_-]*$/i;function $a(e){const t=Tt.extname(e),r=Tt.basename(e,t).replace(/(-|_)/g," ").toLowerCase().split(" ").map(a=>a.charAt(0).toUpperCase()+a.slice(1));let n=r.length>0;for(const a of r)if(!a.match(Du)){n=!1;break}let o=r.join(" ");return n||(o=`"${o.replace(/[\\"]/g,"\\$&")}"`),o}const ja={extension:{type:M.LoadParser,priority:Jt.Low},name:"loadWebFont",test(e){return ei(e,Bu)||Ee(e,Mu)},async load(e,t){var s,r,n,o,a,h;const i=P.ADAPTER.getFontFaceSet();if(i){const l=[],c=(r=(s=t.data)==null?void 0:s.family)!=null?r:$a(e),u=(a=(o=(n=t.data)==null?void 0:n.weights)==null?void 0:o.filter(f=>Pu.includes(f)))!=null?a:["normal"],d=(h=t.data)!=null?h:{};for(let f=0;fP.ADAPTER.getFontFaceSet().delete(t))}};U.add(ja);let Ya=0,En;const Fu={id:"checkImageBitmap",code:` - async function checkImageBitmap() - { - try - { - if (typeof createImageBitmap !== 'function') return false; - - const response = await fetch('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+ip1sAAAAASUVORK5CYII='); - const imageBlob = await response.blob(); - const imageBitmap = await createImageBitmap(imageBlob); - - return imageBitmap.width === 1 && imageBitmap.height === 1; - } - catch (e) - { - return false; - } - } - checkImageBitmap().then((result) => { self.postMessage(result); }); - `},Nu={id:"loadImageBitmap",code:` - async function loadImageBitmap(url) - { - const response = await fetch(url); - - if (!response.ok) - { - throw new Error(\`[WorkerManager.loadImageBitmap] Failed to fetch \${url}: \` - + \`\${response.status} \${response.statusText}\`); - } - - const imageBlob = await response.blob(); - const imageBitmap = await createImageBitmap(imageBlob); - - return imageBitmap; - } - self.onmessage = async (event) => - { - try - { - const imageBitmap = await loadImageBitmap(event.data.data[0]); - - self.postMessage({ - data: imageBitmap, - uuid: event.data.uuid, - id: event.data.id, - }, [imageBitmap]); - } - catch(e) - { - self.postMessage({ - error: e, - uuid: event.data.uuid, - id: event.data.id, - }); - } - };`};let wn;class Lu{constructor(){this._initialized=!1,this._createdWorkers=0,this.workerPool=[],this.queue=[],this.resolveHash={}}isImageBitmapSupported(){return this._isImageBitmapSupported!==void 0?this._isImageBitmapSupported:(this._isImageBitmapSupported=new Promise(t=>{const i=URL.createObjectURL(new Blob([Fu.code],{type:"application/javascript"})),s=new Worker(i);s.addEventListener("message",r=>{s.terminate(),URL.revokeObjectURL(i),t(r.data)})}),this._isImageBitmapSupported)}loadImageBitmap(t){return this._run("loadImageBitmap",[t])}async _initWorkers(){this._initialized||(this._initialized=!0)}getWorker(){En===void 0&&(En=navigator.hardwareConcurrency||4);let t=this.workerPool.pop();return!t&&this._createdWorkers{this.complete(i.data),this.returnWorker(i.target),this.next()})),t}returnWorker(t){this.workerPool.push(t)}complete(t){t.error!==void 0?this.resolveHash[t.uuid].reject(t.error):this.resolveHash[t.uuid].resolve(t.data),this.resolveHash[t.uuid]=null}async _run(t,i){await this._initWorkers();const s=new Promise((r,n)=>{this.queue.push({id:t,arguments:i,resolve:r,reject:n})});return this.next(),s}next(){if(!this.queue.length)return;const t=this.getWorker();if(!t)return;const i=this.queue.pop(),s=i.id;this.resolveHash[Ya]={resolve:i.resolve,reject:i.reject},t.postMessage({data:i.arguments,uuid:Ya++,id:s})}}const qa=new Lu;function Di(e,t,i){const s=new B(e);return s.baseTexture.on("dispose",()=>{delete t.promiseCache[i]}),s}const Ou=[".jpeg",".jpg",".png",".webp",".avif"],Uu=["image/jpeg","image/png","image/webp","image/avif"];async function Ka(e){const t=await P.ADAPTER.fetch(e);if(!t.ok)throw new Error(`[loadImageBitmap] Failed to fetch ${e}: ${t.status} ${t.statusText}`);const i=await t.blob();return await createImageBitmap(i)}const Fi={name:"loadTextures",extension:{type:M.LoadParser,priority:Jt.High},config:{preferWorkers:!0,preferCreateImageBitmap:!0,crossOrigin:"anonymous"},test(e){return ei(e,Uu)||Ee(e,Ou)},async load(e,t,i){let s=null;globalThis.createImageBitmap&&this.config.preferCreateImageBitmap?this.config.preferWorkers&&await qa.isImageBitmapSupported()?s=await qa.loadImageBitmap(e):s=await Ka(e):s=await new Promise(n=>{s=new Image,s.crossOrigin=this.config.crossOrigin,s.src=e,s.complete?n(s):s.onload=()=>{n(s)}});const r=new V(s,bt({resolution:fe(e)},t.data));return r.resource.src=e,Di(r,i,e)},unload(e){e.destroy(!0)}};U.add(Fi);const ku=".svg",Gu="image/svg+xml",Za={extension:{type:M.LoadParser,priority:Jt.High},name:"loadSVG",test(e){return ei(e,Gu)||Ee(e,ku)},async testParse(e){return Je.test(e)},async parse(e,t,i){var o;const s=new Je(e,(o=t==null?void 0:t.data)==null?void 0:o.resourceOptions);await s.load();const r=new V(s,bt({resolution:fe(e)},t==null?void 0:t.data));return r.resource.src=e,Di(r,i,e)},async load(e,t){return(await P.ADAPTER.fetch(e)).text()},unload:Fi.unload};U.add(Za);class Hu{constructor(){this._defaultBundleIdentifierOptions={connector:"-",createBundleAssetId:(t,i)=>`${t}${this._bundleIdConnector}${i}`,extractAssetIdFromBundle:(t,i)=>i.replace(`${t}${this._bundleIdConnector}`,"")},this._bundleIdConnector=this._defaultBundleIdentifierOptions.connector,this._createBundleAssetId=this._defaultBundleIdentifierOptions.createBundleAssetId,this._extractAssetIdFromBundle=this._defaultBundleIdentifierOptions.extractAssetIdFromBundle,this._assetMap={},this._preferredOrder=[],this._parsers=[],this._resolverHash={},this._bundles={}}setBundleIdentifier(t){var i,s,r;if(this._bundleIdConnector=(i=t.connector)!=null?i:this._bundleIdConnector,this._createBundleAssetId=(s=t.createBundleAssetId)!=null?s:this._createBundleAssetId,this._extractAssetIdFromBundle=(r=t.extractAssetIdFromBundle)!=null?r:this._extractAssetIdFromBundle,this._extractAssetIdFromBundle("foo",this._createBundleAssetId("foo","bar"))!=="bar")throw new Error("[Resolver] GenerateBundleAssetId are not working correctly")}prefer(...t){t.forEach(i=>{this._preferredOrder.push(i),i.priority||(i.priority=Object.keys(i.params))}),this._resolverHash={}}set basePath(t){this._basePath=t}get basePath(){return this._basePath}set rootPath(t){this._rootPath=t}get rootPath(){return this._rootPath}get parsers(){return this._parsers}reset(){this.setBundleIdentifier(this._defaultBundleIdentifierOptions),this._assetMap={},this._preferredOrder=[],this._resolverHash={},this._rootPath=null,this._basePath=null,this._manifest=null,this._bundles={},this._defaultSearchParams=null}setDefaultSearchParams(t){if(typeof t=="string")this._defaultSearchParams=t;else{const i=t;this._defaultSearchParams=Object.keys(i).map(s=>`${encodeURIComponent(s)}=${encodeURIComponent(i[s])}`).join("&")}}addManifest(t){this._manifest&&console.warn("[Resolver] Manifest already exists, this will be overwritten"),this._manifest=t,t.bundles.forEach(i=>{this.addBundle(i.name,i.assets)})}addBundle(t,i){const s=[];Array.isArray(i)?i.forEach(r=>{if(typeof r.name=="string"){const n=this._createBundleAssetId(t,r.name);s.push(n),this.add([r.name,n],r.srcs,r.data)}else{const n=r.name.map(o=>this._createBundleAssetId(t,o));n.forEach(o=>{s.push(o)}),this.add([...r.name,...n],r.srcs)}}):Object.keys(i).forEach(r=>{s.push(this._createBundleAssetId(t,r)),this.add([r,this._createBundleAssetId(t,r)],i[r])}),this._bundles[t]=s}add(t,i,s){const r=oe(t);r.forEach(o=>{this.hasKey(o)&&console.warn(`[Resolver] already has key: ${o} overwriting`)}),Array.isArray(i)||(typeof i=="string"?i=Va(i):i=[i]);const n=i.map(o=>{var h;let a=o;if(typeof o=="string"){let l=!1;for(let c=0;c{this._assetMap[o]=n})}resolveBundle(t){const i=Bi(t);t=oe(t);const s={};return t.forEach(r=>{const n=this._bundles[r];if(n){const o=this.resolve(n),a={};for(const h in o){const l=o[h];a[this._extractAssetIdFromBundle(r,h)]=l}s[r]=a}}),i?s[t[0]]:s}resolveUrl(t){const i=this.resolve(t);if(typeof t!="string"){const s={};for(const r in i)s[r]=i[r].src;return s}return i.src}resolve(t){const i=Bi(t);t=oe(t);const s={};return t.forEach(r=>{var n;if(!this._resolverHash[r])if(this._assetMap[r]){let o=this._assetMap[r];const a=this._getPreferredOrder(o),h=o[0];a==null||a.priority.forEach(l=>{a.params[l].forEach(c=>{const u=o.filter(d=>d[l]?d[l]===c:!1);u.length&&(o=u)})}),this._resolverHash[r]=(n=o[0])!=null?n:h}else{let o=r;(this._basePath||this._rootPath)&&(o=Tt.toAbsolute(o,this._basePath,this._rootPath)),o=this._appendDefaultSearchParams(o),this._resolverHash[r]={src:o}}s[r]=this._resolverHash[r]}),i?s[t[0]]:s}hasKey(t){return!!this._assetMap[t]}hasBundle(t){return!!this._bundles[t]}_getPreferredOrder(t){for(let i=0;in.params.format.includes(s.format));if(r)return r}return this._preferredOrder[0]}_appendDefaultSearchParams(t){if(!this._defaultSearchParams)return t;const i=/\?/.test(t)?"&":"?";return`${t}${i}${this._defaultSearchParams}`}}class Ja{constructor(){this._detections=[],this._initialized=!1,this.resolver=new Hu,this.loader=new Su,this.cache=ii,this._backgroundLoader=new Eu(this.loader),this._backgroundLoader.active=!0,this.reset()}async init(t={}){var n,o,a,h;if(this._initialized){console.warn("[Assets]AssetManager already initialized, did you load before calling this Asset.init()?");return}if(this._initialized=!0,t.defaultSearchParams&&this.resolver.setDefaultSearchParams(t.defaultSearchParams),t.basePath&&(this.resolver.basePath=t.basePath),t.bundleIdentifier&&this.resolver.setBundleIdentifier(t.bundleIdentifier),t.manifest){let l=t.manifest;typeof l=="string"&&(l=await this.load(l)),this.resolver.addManifest(l)}const i=(o=(n=t.texturePreference)==null?void 0:n.resolution)!=null?o:1,s=typeof i=="number"?[i]:i;let r=[];if((a=t.texturePreference)!=null&&a.format){const l=(h=t.texturePreference)==null?void 0:h.format;r=typeof l=="string"?[l]:l;for(const c of this._detections)await c.test()||(r=await c.remove(r))}else for(const l of this._detections)await l.test()&&(r=await l.add(r));this.resolver.prefer({params:{format:r,resolution:s}}),t.preferences&&this.setPreferences(t.preferences)}add(t,i,s){this.resolver.add(t,i,s)}async load(t,i){this._initialized||await this.init();const s=Bi(t),r=oe(t).map(a=>typeof a!="string"?(this.resolver.add(a.src,a),a.src):(this.resolver.hasKey(a)||this.resolver.add(a,a),a)),n=this.resolver.resolve(r),o=await this._mapLoadToResolve(n,i);return s?o[r[0]]:o}addBundle(t,i){this.resolver.addBundle(t,i)}async loadBundle(t,i){this._initialized||await this.init();let s=!1;typeof t=="string"&&(s=!0,t=[t]);const r=this.resolver.resolveBundle(t),n={},o=Object.keys(r);let a=0,h=0;const l=()=>{i==null||i(++a/h)},c=o.map(u=>{const d=r[u];return h+=Object.keys(d).length,this._mapLoadToResolve(d,l).then(f=>{n[u]=f})});return await Promise.all(c),s?n[t[0]]:n}async backgroundLoad(t){this._initialized||await this.init(),typeof t=="string"&&(t=[t]);const i=this.resolver.resolve(t);this._backgroundLoader.add(Object.values(i))}async backgroundLoadBundle(t){this._initialized||await this.init(),typeof t=="string"&&(t=[t]);const i=this.resolver.resolveBundle(t);Object.values(i).forEach(s=>{this._backgroundLoader.add(Object.values(s))})}reset(){this.resolver.reset(),this.loader.reset(),this.cache.reset(),this._initialized=!1}get(t){if(typeof t=="string")return ii.get(t);const i={};for(let s=0;s{const l=n[a.src],c=[a.src];a.alias&&c.push(...a.alias),o[r[h]]=l,ii.set(c,l)}),o}async unload(t){this._initialized||await this.init();const i=oe(t).map(r=>typeof r!="string"?r.src:r),s=this.resolver.resolve(i);await this._unloadFromResolved(s)}async unloadBundle(t){this._initialized||await this.init(),t=oe(t);const i=this.resolver.resolveBundle(t),s=Object.keys(i).map(r=>this._unloadFromResolved(i[r]));await Promise.all(s)}async _unloadFromResolved(t){const i=Object.values(t);i.forEach(s=>{ii.remove(s.src)}),await this.loader.unload(i)}get detections(){return this._detections}get preferWorkers(){return Fi.config.preferWorkers}set preferWorkers(t){z("7.2.0","Assets.prefersWorkers is deprecated, use Assets.setPreferences({ preferWorkers: true }) instead."),this.setPreferences({preferWorkers:t})}setPreferences(t){this.loader.parsers.forEach(i=>{!i.config||Object.keys(i.config).filter(s=>s in t).forEach(s=>{i.config[s]=t[s]})})}}const Ni=new Ja;U.handleByList(M.LoadParser,Ni.loader.parsers).handleByList(M.ResolveParser,Ni.resolver.parsers).handleByList(M.CacheParser,Ni.cache.parsers).handleByList(M.DetectionParser,Ni.detections);const Qa={extension:M.CacheParser,test:e=>Array.isArray(e)&&e.every(t=>t instanceof B),getCacheableAssets:(e,t)=>{const i={};return e.forEach(s=>{t.forEach((r,n)=>{i[s+(n===0?"":n+1)]=r})}),i}};U.add(Qa);const th={extension:{type:M.DetectionParser,priority:1},test:async()=>{if(!globalThis.createImageBitmap)return!1;const e="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A=",t=await P.ADAPTER.fetch(e).then(i=>i.blob());return createImageBitmap(t).then(()=>!0,()=>!1)},add:async e=>[...e,"avif"],remove:async e=>e.filter(t=>t!=="avif")};U.add(th);const eh={extension:{type:M.DetectionParser,priority:0},test:async()=>{if(!globalThis.createImageBitmap)return!1;const e="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA=",t=await P.ADAPTER.fetch(e).then(i=>i.blob());return createImageBitmap(t).then(()=>!0,()=>!1)},add:async e=>[...e,"webp"],remove:async e=>e.filter(t=>t!=="webp")};U.add(eh);const ih=["png","jpg","jpeg"],sh={extension:{type:M.DetectionParser,priority:-1},test:()=>Promise.resolve(!0),add:async e=>[...e,...ih],remove:async e=>e.filter(t=>!ih.includes(t))};U.add(sh);const rh={extension:M.ResolveParser,test:Fi.test,parse:e=>{var t,i;return{resolution:parseFloat((i=(t=P.RETINA_PREFIX.exec(e))==null?void 0:t[1])!=null?i:"1"),format:e.split(".").pop(),src:e}}};U.add(rh);var It=(e=>(e[e.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",e[e.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",e[e.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",e[e.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",e[e.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=35917]="COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT",e[e.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT=35918]="COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT",e[e.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=35919]="COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT",e[e.COMPRESSED_SRGB_S3TC_DXT1_EXT=35916]="COMPRESSED_SRGB_S3TC_DXT1_EXT",e[e.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",e[e.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",e[e.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",e[e.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",e[e.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",e[e.COMPRESSED_RGBA8_ETC2_EAC=37496]="COMPRESSED_RGBA8_ETC2_EAC",e[e.COMPRESSED_SRGB8_ETC2=37493]="COMPRESSED_SRGB8_ETC2",e[e.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37497]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",e[e.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37494]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",e[e.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37495]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",e[e.COMPRESSED_RGB_PVRTC_4BPPV1_IMG=35840]="COMPRESSED_RGB_PVRTC_4BPPV1_IMG",e[e.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG=35842]="COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",e[e.COMPRESSED_RGB_PVRTC_2BPPV1_IMG=35841]="COMPRESSED_RGB_PVRTC_2BPPV1_IMG",e[e.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG=35843]="COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",e[e.COMPRESSED_RGB_ETC1_WEBGL=36196]="COMPRESSED_RGB_ETC1_WEBGL",e[e.COMPRESSED_RGB_ATC_WEBGL=35986]="COMPRESSED_RGB_ATC_WEBGL",e[e.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL=35986]="COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",e[e.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL=34798]="COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL",e[e.COMPRESSED_RGBA_ASTC_4x4_KHR=37808]="COMPRESSED_RGBA_ASTC_4x4_KHR",e))(It||{});const Li={[33776]:.5,[33777]:.5,[33778]:1,[33779]:1,[35916]:.5,[35917]:.5,[35918]:1,[35919]:1,[37488]:.5,[37489]:.5,[37490]:1,[37491]:1,[37492]:.5,[37496]:1,[37493]:.5,[37497]:1,[37494]:.5,[37495]:.5,[35840]:.5,[35842]:.5,[35841]:.25,[35843]:.25,[36196]:.5,[35986]:.5,[35986]:1,[34798]:1,[37808]:1};let ve,si;function nh(){si={s3tc:ve.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:ve.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:ve.getExtension("WEBGL_compressed_texture_etc"),etc1:ve.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:ve.getExtension("WEBGL_compressed_texture_pvrtc")||ve.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:ve.getExtension("WEBGL_compressed_texture_atc"),astc:ve.getExtension("WEBGL_compressed_texture_astc")}}const oh={extension:{type:M.DetectionParser,priority:2},test:async()=>{const t=P.ADAPTER.createCanvas().getContext("webgl");return t?(ve=t,!0):(console.warn("WebGL not available for compressed textures."),!1)},add:async e=>{si||nh();const t=[];for(const i in si)!si[i]||t.push(i);return[...t,...e]},remove:async e=>(si||nh(),e.filter(t=>!(t in si)))};U.add(oh);class ah extends Ye{constructor(t,i={width:1,height:1,autoLoad:!0}){let s,r;typeof t=="string"?(s=t,r=new Uint8Array):(s=null,r=t),super(r,i),this.origin=s,this.buffer=r?new ds(r):null,this._load=null,this.loaded=!1,this.origin!==null&&i.autoLoad!==!1&&this.load(),this.origin===null&&this.buffer&&(this._load=Promise.resolve(this),this.loaded=!0,this.onBlobLoaded(this.buffer.rawBinaryData))}onBlobLoaded(t){}load(){return this._load?this._load:(this._load=fetch(this.origin).then(t=>t.blob()).then(t=>t.arrayBuffer()).then(t=>(this.data=new Uint32Array(t),this.buffer=new ds(t),this.loaded=!0,this.onBlobLoaded(t),this.update(),this)),this._load)}}class we extends ah{constructor(t,i){super(t,i),this.format=i.format,this.levels=i.levels||1,this._width=i.width,this._height=i.height,this._extension=we._formatToExtension(this.format),(i.levelBuffers||this.buffer)&&(this._levelBuffers=i.levelBuffers||we._createLevelBuffers(t instanceof Uint8Array?t:this.buffer.uint8View,this.format,this.levels,4,4,this.width,this.height))}upload(t,i,s){const r=t.gl;if(!t.context.extensions[this._extension])throw new Error(`${this._extension} textures are not supported on the current machine`);if(!this._levelBuffers)return!1;for(let o=0,a=this.levels;o=33776&&t<=33779)return"s3tc";if(t>=37488&&t<=37497)return"etc";if(t>=35840&&t<=35843)return"pvrtc";if(t>=36196)return"etc1";if(t>=35986&&t<=34798)return"atc";throw new Error("Invalid (compressed) texture format given!")}static _createLevelBuffers(t,i,s,r,n,o,a){const h=new Array(s);let l=t.byteOffset,c=o,u=a,d=c+r-1&~(r-1),f=u+n-1&~(n-1),p=d*f*Li[i];for(let _=0;_1?c:d,levelHeight:s>1?u:f,levelBuffer:new Uint8Array(t.buffer,l,p)},l+=p,c=c>>1||1,u=u>>1||1,d=c+r-1&~(r-1),f=u+n-1&~(n-1),p=d*f*Li[i];return h}}const Sn=4,Us=124,Xu=32,hh=20,Vu=542327876,ks={SIZE:1,FLAGS:2,HEIGHT:3,WIDTH:4,MIPMAP_COUNT:7,PIXEL_FORMAT:19},zu={SIZE:0,FLAGS:1,FOURCC:2,RGB_BITCOUNT:3,R_BIT_MASK:4,G_BIT_MASK:5,B_BIT_MASK:6,A_BIT_MASK:7},Gs={DXGI_FORMAT:0,RESOURCE_DIMENSION:1,MISC_FLAG:2,ARRAY_SIZE:3,MISC_FLAGS2:4};var Wu=(e=>(e[e.DXGI_FORMAT_UNKNOWN=0]="DXGI_FORMAT_UNKNOWN",e[e.DXGI_FORMAT_R32G32B32A32_TYPELESS=1]="DXGI_FORMAT_R32G32B32A32_TYPELESS",e[e.DXGI_FORMAT_R32G32B32A32_FLOAT=2]="DXGI_FORMAT_R32G32B32A32_FLOAT",e[e.DXGI_FORMAT_R32G32B32A32_UINT=3]="DXGI_FORMAT_R32G32B32A32_UINT",e[e.DXGI_FORMAT_R32G32B32A32_SINT=4]="DXGI_FORMAT_R32G32B32A32_SINT",e[e.DXGI_FORMAT_R32G32B32_TYPELESS=5]="DXGI_FORMAT_R32G32B32_TYPELESS",e[e.DXGI_FORMAT_R32G32B32_FLOAT=6]="DXGI_FORMAT_R32G32B32_FLOAT",e[e.DXGI_FORMAT_R32G32B32_UINT=7]="DXGI_FORMAT_R32G32B32_UINT",e[e.DXGI_FORMAT_R32G32B32_SINT=8]="DXGI_FORMAT_R32G32B32_SINT",e[e.DXGI_FORMAT_R16G16B16A16_TYPELESS=9]="DXGI_FORMAT_R16G16B16A16_TYPELESS",e[e.DXGI_FORMAT_R16G16B16A16_FLOAT=10]="DXGI_FORMAT_R16G16B16A16_FLOAT",e[e.DXGI_FORMAT_R16G16B16A16_UNORM=11]="DXGI_FORMAT_R16G16B16A16_UNORM",e[e.DXGI_FORMAT_R16G16B16A16_UINT=12]="DXGI_FORMAT_R16G16B16A16_UINT",e[e.DXGI_FORMAT_R16G16B16A16_SNORM=13]="DXGI_FORMAT_R16G16B16A16_SNORM",e[e.DXGI_FORMAT_R16G16B16A16_SINT=14]="DXGI_FORMAT_R16G16B16A16_SINT",e[e.DXGI_FORMAT_R32G32_TYPELESS=15]="DXGI_FORMAT_R32G32_TYPELESS",e[e.DXGI_FORMAT_R32G32_FLOAT=16]="DXGI_FORMAT_R32G32_FLOAT",e[e.DXGI_FORMAT_R32G32_UINT=17]="DXGI_FORMAT_R32G32_UINT",e[e.DXGI_FORMAT_R32G32_SINT=18]="DXGI_FORMAT_R32G32_SINT",e[e.DXGI_FORMAT_R32G8X24_TYPELESS=19]="DXGI_FORMAT_R32G8X24_TYPELESS",e[e.DXGI_FORMAT_D32_FLOAT_S8X24_UINT=20]="DXGI_FORMAT_D32_FLOAT_S8X24_UINT",e[e.DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS=21]="DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS",e[e.DXGI_FORMAT_X32_TYPELESS_G8X24_UINT=22]="DXGI_FORMAT_X32_TYPELESS_G8X24_UINT",e[e.DXGI_FORMAT_R10G10B10A2_TYPELESS=23]="DXGI_FORMAT_R10G10B10A2_TYPELESS",e[e.DXGI_FORMAT_R10G10B10A2_UNORM=24]="DXGI_FORMAT_R10G10B10A2_UNORM",e[e.DXGI_FORMAT_R10G10B10A2_UINT=25]="DXGI_FORMAT_R10G10B10A2_UINT",e[e.DXGI_FORMAT_R11G11B10_FLOAT=26]="DXGI_FORMAT_R11G11B10_FLOAT",e[e.DXGI_FORMAT_R8G8B8A8_TYPELESS=27]="DXGI_FORMAT_R8G8B8A8_TYPELESS",e[e.DXGI_FORMAT_R8G8B8A8_UNORM=28]="DXGI_FORMAT_R8G8B8A8_UNORM",e[e.DXGI_FORMAT_R8G8B8A8_UNORM_SRGB=29]="DXGI_FORMAT_R8G8B8A8_UNORM_SRGB",e[e.DXGI_FORMAT_R8G8B8A8_UINT=30]="DXGI_FORMAT_R8G8B8A8_UINT",e[e.DXGI_FORMAT_R8G8B8A8_SNORM=31]="DXGI_FORMAT_R8G8B8A8_SNORM",e[e.DXGI_FORMAT_R8G8B8A8_SINT=32]="DXGI_FORMAT_R8G8B8A8_SINT",e[e.DXGI_FORMAT_R16G16_TYPELESS=33]="DXGI_FORMAT_R16G16_TYPELESS",e[e.DXGI_FORMAT_R16G16_FLOAT=34]="DXGI_FORMAT_R16G16_FLOAT",e[e.DXGI_FORMAT_R16G16_UNORM=35]="DXGI_FORMAT_R16G16_UNORM",e[e.DXGI_FORMAT_R16G16_UINT=36]="DXGI_FORMAT_R16G16_UINT",e[e.DXGI_FORMAT_R16G16_SNORM=37]="DXGI_FORMAT_R16G16_SNORM",e[e.DXGI_FORMAT_R16G16_SINT=38]="DXGI_FORMAT_R16G16_SINT",e[e.DXGI_FORMAT_R32_TYPELESS=39]="DXGI_FORMAT_R32_TYPELESS",e[e.DXGI_FORMAT_D32_FLOAT=40]="DXGI_FORMAT_D32_FLOAT",e[e.DXGI_FORMAT_R32_FLOAT=41]="DXGI_FORMAT_R32_FLOAT",e[e.DXGI_FORMAT_R32_UINT=42]="DXGI_FORMAT_R32_UINT",e[e.DXGI_FORMAT_R32_SINT=43]="DXGI_FORMAT_R32_SINT",e[e.DXGI_FORMAT_R24G8_TYPELESS=44]="DXGI_FORMAT_R24G8_TYPELESS",e[e.DXGI_FORMAT_D24_UNORM_S8_UINT=45]="DXGI_FORMAT_D24_UNORM_S8_UINT",e[e.DXGI_FORMAT_R24_UNORM_X8_TYPELESS=46]="DXGI_FORMAT_R24_UNORM_X8_TYPELESS",e[e.DXGI_FORMAT_X24_TYPELESS_G8_UINT=47]="DXGI_FORMAT_X24_TYPELESS_G8_UINT",e[e.DXGI_FORMAT_R8G8_TYPELESS=48]="DXGI_FORMAT_R8G8_TYPELESS",e[e.DXGI_FORMAT_R8G8_UNORM=49]="DXGI_FORMAT_R8G8_UNORM",e[e.DXGI_FORMAT_R8G8_UINT=50]="DXGI_FORMAT_R8G8_UINT",e[e.DXGI_FORMAT_R8G8_SNORM=51]="DXGI_FORMAT_R8G8_SNORM",e[e.DXGI_FORMAT_R8G8_SINT=52]="DXGI_FORMAT_R8G8_SINT",e[e.DXGI_FORMAT_R16_TYPELESS=53]="DXGI_FORMAT_R16_TYPELESS",e[e.DXGI_FORMAT_R16_FLOAT=54]="DXGI_FORMAT_R16_FLOAT",e[e.DXGI_FORMAT_D16_UNORM=55]="DXGI_FORMAT_D16_UNORM",e[e.DXGI_FORMAT_R16_UNORM=56]="DXGI_FORMAT_R16_UNORM",e[e.DXGI_FORMAT_R16_UINT=57]="DXGI_FORMAT_R16_UINT",e[e.DXGI_FORMAT_R16_SNORM=58]="DXGI_FORMAT_R16_SNORM",e[e.DXGI_FORMAT_R16_SINT=59]="DXGI_FORMAT_R16_SINT",e[e.DXGI_FORMAT_R8_TYPELESS=60]="DXGI_FORMAT_R8_TYPELESS",e[e.DXGI_FORMAT_R8_UNORM=61]="DXGI_FORMAT_R8_UNORM",e[e.DXGI_FORMAT_R8_UINT=62]="DXGI_FORMAT_R8_UINT",e[e.DXGI_FORMAT_R8_SNORM=63]="DXGI_FORMAT_R8_SNORM",e[e.DXGI_FORMAT_R8_SINT=64]="DXGI_FORMAT_R8_SINT",e[e.DXGI_FORMAT_A8_UNORM=65]="DXGI_FORMAT_A8_UNORM",e[e.DXGI_FORMAT_R1_UNORM=66]="DXGI_FORMAT_R1_UNORM",e[e.DXGI_FORMAT_R9G9B9E5_SHAREDEXP=67]="DXGI_FORMAT_R9G9B9E5_SHAREDEXP",e[e.DXGI_FORMAT_R8G8_B8G8_UNORM=68]="DXGI_FORMAT_R8G8_B8G8_UNORM",e[e.DXGI_FORMAT_G8R8_G8B8_UNORM=69]="DXGI_FORMAT_G8R8_G8B8_UNORM",e[e.DXGI_FORMAT_BC1_TYPELESS=70]="DXGI_FORMAT_BC1_TYPELESS",e[e.DXGI_FORMAT_BC1_UNORM=71]="DXGI_FORMAT_BC1_UNORM",e[e.DXGI_FORMAT_BC1_UNORM_SRGB=72]="DXGI_FORMAT_BC1_UNORM_SRGB",e[e.DXGI_FORMAT_BC2_TYPELESS=73]="DXGI_FORMAT_BC2_TYPELESS",e[e.DXGI_FORMAT_BC2_UNORM=74]="DXGI_FORMAT_BC2_UNORM",e[e.DXGI_FORMAT_BC2_UNORM_SRGB=75]="DXGI_FORMAT_BC2_UNORM_SRGB",e[e.DXGI_FORMAT_BC3_TYPELESS=76]="DXGI_FORMAT_BC3_TYPELESS",e[e.DXGI_FORMAT_BC3_UNORM=77]="DXGI_FORMAT_BC3_UNORM",e[e.DXGI_FORMAT_BC3_UNORM_SRGB=78]="DXGI_FORMAT_BC3_UNORM_SRGB",e[e.DXGI_FORMAT_BC4_TYPELESS=79]="DXGI_FORMAT_BC4_TYPELESS",e[e.DXGI_FORMAT_BC4_UNORM=80]="DXGI_FORMAT_BC4_UNORM",e[e.DXGI_FORMAT_BC4_SNORM=81]="DXGI_FORMAT_BC4_SNORM",e[e.DXGI_FORMAT_BC5_TYPELESS=82]="DXGI_FORMAT_BC5_TYPELESS",e[e.DXGI_FORMAT_BC5_UNORM=83]="DXGI_FORMAT_BC5_UNORM",e[e.DXGI_FORMAT_BC5_SNORM=84]="DXGI_FORMAT_BC5_SNORM",e[e.DXGI_FORMAT_B5G6R5_UNORM=85]="DXGI_FORMAT_B5G6R5_UNORM",e[e.DXGI_FORMAT_B5G5R5A1_UNORM=86]="DXGI_FORMAT_B5G5R5A1_UNORM",e[e.DXGI_FORMAT_B8G8R8A8_UNORM=87]="DXGI_FORMAT_B8G8R8A8_UNORM",e[e.DXGI_FORMAT_B8G8R8X8_UNORM=88]="DXGI_FORMAT_B8G8R8X8_UNORM",e[e.DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM=89]="DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM",e[e.DXGI_FORMAT_B8G8R8A8_TYPELESS=90]="DXGI_FORMAT_B8G8R8A8_TYPELESS",e[e.DXGI_FORMAT_B8G8R8A8_UNORM_SRGB=91]="DXGI_FORMAT_B8G8R8A8_UNORM_SRGB",e[e.DXGI_FORMAT_B8G8R8X8_TYPELESS=92]="DXGI_FORMAT_B8G8R8X8_TYPELESS",e[e.DXGI_FORMAT_B8G8R8X8_UNORM_SRGB=93]="DXGI_FORMAT_B8G8R8X8_UNORM_SRGB",e[e.DXGI_FORMAT_BC6H_TYPELESS=94]="DXGI_FORMAT_BC6H_TYPELESS",e[e.DXGI_FORMAT_BC6H_UF16=95]="DXGI_FORMAT_BC6H_UF16",e[e.DXGI_FORMAT_BC6H_SF16=96]="DXGI_FORMAT_BC6H_SF16",e[e.DXGI_FORMAT_BC7_TYPELESS=97]="DXGI_FORMAT_BC7_TYPELESS",e[e.DXGI_FORMAT_BC7_UNORM=98]="DXGI_FORMAT_BC7_UNORM",e[e.DXGI_FORMAT_BC7_UNORM_SRGB=99]="DXGI_FORMAT_BC7_UNORM_SRGB",e[e.DXGI_FORMAT_AYUV=100]="DXGI_FORMAT_AYUV",e[e.DXGI_FORMAT_Y410=101]="DXGI_FORMAT_Y410",e[e.DXGI_FORMAT_Y416=102]="DXGI_FORMAT_Y416",e[e.DXGI_FORMAT_NV12=103]="DXGI_FORMAT_NV12",e[e.DXGI_FORMAT_P010=104]="DXGI_FORMAT_P010",e[e.DXGI_FORMAT_P016=105]="DXGI_FORMAT_P016",e[e.DXGI_FORMAT_420_OPAQUE=106]="DXGI_FORMAT_420_OPAQUE",e[e.DXGI_FORMAT_YUY2=107]="DXGI_FORMAT_YUY2",e[e.DXGI_FORMAT_Y210=108]="DXGI_FORMAT_Y210",e[e.DXGI_FORMAT_Y216=109]="DXGI_FORMAT_Y216",e[e.DXGI_FORMAT_NV11=110]="DXGI_FORMAT_NV11",e[e.DXGI_FORMAT_AI44=111]="DXGI_FORMAT_AI44",e[e.DXGI_FORMAT_IA44=112]="DXGI_FORMAT_IA44",e[e.DXGI_FORMAT_P8=113]="DXGI_FORMAT_P8",e[e.DXGI_FORMAT_A8P8=114]="DXGI_FORMAT_A8P8",e[e.DXGI_FORMAT_B4G4R4A4_UNORM=115]="DXGI_FORMAT_B4G4R4A4_UNORM",e[e.DXGI_FORMAT_P208=116]="DXGI_FORMAT_P208",e[e.DXGI_FORMAT_V208=117]="DXGI_FORMAT_V208",e[e.DXGI_FORMAT_V408=118]="DXGI_FORMAT_V408",e[e.DXGI_FORMAT_SAMPLER_FEEDBACK_MIN_MIP_OPAQUE=119]="DXGI_FORMAT_SAMPLER_FEEDBACK_MIN_MIP_OPAQUE",e[e.DXGI_FORMAT_SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE=120]="DXGI_FORMAT_SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE",e[e.DXGI_FORMAT_FORCE_UINT=121]="DXGI_FORMAT_FORCE_UINT",e))(Wu||{}),$u=(e=>(e[e.DDS_DIMENSION_TEXTURE1D=2]="DDS_DIMENSION_TEXTURE1D",e[e.DDS_DIMENSION_TEXTURE2D=3]="DDS_DIMENSION_TEXTURE2D",e[e.DDS_DIMENSION_TEXTURE3D=6]="DDS_DIMENSION_TEXTURE3D",e))($u||{});const ju=1,Yu=2,qu=4,Ku=64,Zu=512,Ju=131072,Qu=827611204,td=861165636,ed=894720068,id=808540228,sd=4,rd={[Qu]:It.COMPRESSED_RGBA_S3TC_DXT1_EXT,[td]:It.COMPRESSED_RGBA_S3TC_DXT3_EXT,[ed]:It.COMPRESSED_RGBA_S3TC_DXT5_EXT},nd={[70]:It.COMPRESSED_RGBA_S3TC_DXT1_EXT,[71]:It.COMPRESSED_RGBA_S3TC_DXT1_EXT,[73]:It.COMPRESSED_RGBA_S3TC_DXT3_EXT,[74]:It.COMPRESSED_RGBA_S3TC_DXT3_EXT,[76]:It.COMPRESSED_RGBA_S3TC_DXT5_EXT,[77]:It.COMPRESSED_RGBA_S3TC_DXT5_EXT,[72]:It.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,[75]:It.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,[78]:It.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT};function lh(e){const t=new Uint32Array(e);if(t[0]!==Vu)throw new Error("Invalid DDS file magic word");const s=new Uint32Array(e,0,Us/Uint32Array.BYTES_PER_ELEMENT),r=s[ks.HEIGHT],n=s[ks.WIDTH],o=s[ks.MIPMAP_COUNT],a=new Uint32Array(e,ks.PIXEL_FORMAT*Uint32Array.BYTES_PER_ELEMENT,Xu/Uint32Array.BYTES_PER_ELEMENT),h=a[ju];if(h&qu){const l=a[zu.FOURCC];if(l!==id){const y=rd[l],x=Sn+Us,A=new Uint8Array(e,x);return[new we(A,{format:y,width:n,height:r,levels:o})]}const c=Sn+Us,u=new Uint32Array(t.buffer,c,hh/Uint32Array.BYTES_PER_ELEMENT),d=u[Gs.DXGI_FORMAT],f=u[Gs.RESOURCE_DIMENSION],p=u[Gs.MISC_FLAG],_=u[Gs.ARRAY_SIZE],g=nd[d];if(g===void 0)throw new Error(`DDSParser cannot parse texture data with DXGI format ${d}`);if(p===sd)throw new Error("DDSParser does not support cubemap textures");if(f===6)throw new Error("DDSParser does not supported 3D texture data");const v=new Array,b=Sn+Us+hh;if(_===1)v.push(new Uint8Array(e,b));else{const y=Li[g];let x=0,A=n,D=r;for(let E=0;E>>1,D=D>>>1}let R=b;for(let E=0;E<_;E++)v.push(new Uint8Array(e,R,x)),R+=x}return v.map(y=>new we(y,{format:g,width:n,height:r,levels:o}))}throw h&Ku?new Error("DDSParser does not support uncompressed texture data."):h&Zu?new Error("DDSParser does not supported YUV uncompressed texture data."):h&Ju?new Error("DDSParser does not support single-channel (lumninance) texture data!"):h&Yu?new Error("DDSParser does not support single-channel (alpha) texture data!"):new Error("DDSParser failed to load a texture file due to an unknown reason!")}const ch=[171,75,84,88,32,49,49,187,13,10,26,10],od=67305985,Qt={FILE_IDENTIFIER:0,ENDIANNESS:12,GL_TYPE:16,GL_TYPE_SIZE:20,GL_FORMAT:24,GL_INTERNAL_FORMAT:28,GL_BASE_INTERNAL_FORMAT:32,PIXEL_WIDTH:36,PIXEL_HEIGHT:40,PIXEL_DEPTH:44,NUMBER_OF_ARRAY_ELEMENTS:48,NUMBER_OF_FACES:52,NUMBER_OF_MIPMAP_LEVELS:56,BYTES_OF_KEY_VALUE_DATA:60},An=64,Rn={[k.UNSIGNED_BYTE]:1,[k.UNSIGNED_SHORT]:2,[k.INT]:4,[k.UNSIGNED_INT]:4,[k.FLOAT]:4,[k.HALF_FLOAT]:8},uh={[C.RGBA]:4,[C.RGB]:3,[C.RG]:2,[C.RED]:1,[C.LUMINANCE]:1,[C.LUMINANCE_ALPHA]:2,[C.ALPHA]:1},dh={[k.UNSIGNED_SHORT_4_4_4_4]:2,[k.UNSIGNED_SHORT_5_5_5_1]:2,[k.UNSIGNED_SHORT_5_6_5]:2};function fh(e,t,i=!1){const s=new DataView(t);if(!ad(e,s))return null;const r=s.getUint32(Qt.ENDIANNESS,!0)===od,n=s.getUint32(Qt.GL_TYPE,r),o=s.getUint32(Qt.GL_FORMAT,r),a=s.getUint32(Qt.GL_INTERNAL_FORMAT,r),h=s.getUint32(Qt.PIXEL_WIDTH,r),l=s.getUint32(Qt.PIXEL_HEIGHT,r)||1,c=s.getUint32(Qt.PIXEL_DEPTH,r)||1,u=s.getUint32(Qt.NUMBER_OF_ARRAY_ELEMENTS,r)||1,d=s.getUint32(Qt.NUMBER_OF_FACES,r),f=s.getUint32(Qt.NUMBER_OF_MIPMAP_LEVELS,r),p=s.getUint32(Qt.BYTES_OF_KEY_VALUE_DATA,r);if(l===0||c!==1)throw new Error("Only 2D textures are supported");if(d!==1)throw new Error("CubeTextures are not supported by KTXLoader yet!");if(u!==1)throw new Error("WebGL does not support array textures");const _=4,g=4,v=h+3&-4,b=l+3&-4,y=new Array(u);let x=h*l;n===0&&(x=v*b);let A;if(n!==0?Rn[n]?A=Rn[n]*uh[o]:A=dh[n]:A=Li[a],A===void 0)throw new Error("Unable to resolve the pixel format stored in the *.ktx file!");const D=i?ld(s,p,r):null;let E=x*A,O=h,H=l,I=v,N=b,w=An+p;for(let T=0;T1||n!==0?O:I,levelHeight:f>1||n!==0?H:N,levelBuffer:new Uint8Array(t,q,E)},q+=E}w+=W+4,w=w%4!==0?w+4-w%4:w,O=O>>1||1,H=H>>1||1,I=O+_-1&~(_-1),N=H+g-1&~(g-1),E=I*N*A}return n!==0?{uncompressed:y.map(T=>{let W=T[0].levelBuffer,q=!1;return n===k.FLOAT?W=new Float32Array(T[0].levelBuffer.buffer,T[0].levelBuffer.byteOffset,T[0].levelBuffer.byteLength/4):n===k.UNSIGNED_INT?(q=!0,W=new Uint32Array(T[0].levelBuffer.buffer,T[0].levelBuffer.byteOffset,T[0].levelBuffer.byteLength/4)):n===k.INT&&(q=!0,W=new Int32Array(T[0].levelBuffer.buffer,T[0].levelBuffer.byteOffset,T[0].levelBuffer.byteLength/4)),{resource:new Ye(W,{width:T[0].levelWidth,height:T[0].levelHeight}),type:n,format:q?hd(o):o}}),kvData:D}:{compressed:y.map(T=>new we(null,{format:a,width:h,height:l,levels:f,levelBuffers:T})),kvData:D}}function ad(e,t){for(let i=0;it-r){console.error("KTXLoader: keyAndValueByteSize out of bounds");break}let h=0;for(;h{const h=new V(a,bt({mipmap:Wt.OFF,alphaMode:Nt.NO_PREMULTIPLIED_ALPHA,resolution:fe(e)},t.data));return Di(h,i,e)});return o.length===1?o[0]:o},unload(e){Array.isArray(e)?e.forEach(t=>t.destroy(!0)):e.destroy(!0)}};U.add(ph);const mh={extension:{type:M.LoadParser,priority:Jt.High},name:"loadKTX",test(e){return Ee(e,".ktx")},async load(e,t,i){const r=await(await P.ADAPTER.fetch(e)).arrayBuffer(),{compressed:n,uncompressed:o,kvData:a}=fh(e,r),h=n!=null?n:o,l=bt({mipmap:Wt.OFF,alphaMode:Nt.NO_PREMULTIPLIED_ALPHA,resolution:fe(e)},t.data),c=h.map(u=>{h===o&&Object.assign(l,{type:u.type,format:u.format});const d=new V(u,l);return d.ktxKeyValueData=a,Di(d,i,e)});return c.length===1?c[0]:c},unload(e){Array.isArray(e)?e.forEach(t=>t.destroy(!0)):e.destroy(!0)}};U.add(mh);const _h={extension:M.ResolveParser,test:e=>{const i=e.split("?")[0].split(".").pop();return["basis","ktx","dds"].includes(i)},parse:e=>{var s,r,n,o;if(e.split("?")[0].split(".").pop()==="ktx"){const a=[".s3tc.ktx",".s3tc_sRGB.ktx",".etc.ktx",".etc1.ktx",".pvrt.ktx",".atc.ktx",".astc.ktx"];if(a.some(h=>e.endsWith(h)))return{resolution:parseFloat((r=(s=P.RETINA_PREFIX.exec(e))==null?void 0:s[1])!=null?r:"1"),format:a.find(h=>e.endsWith(h)),src:e}}return{resolution:parseFloat((o=(n=P.RETINA_PREFIX.exec(e))==null?void 0:n[1])!=null?o:"1"),format:e.split(".").pop(),src:e}}};U.add(_h);const cd=new $,ud=4,Oi=class{constructor(e){this.renderer=e}async image(e,t,i){const s=new Image;return s.src=await this.base64(e,t,i),s}async base64(e,t,i){const s=this.canvas(e);if(s.toBlob!==void 0)return new Promise((r,n)=>{s.toBlob(o=>{if(!o){n(new Error("ICanvas.toBlob failed!"));return}const a=new FileReader;a.onload=()=>r(a.result),a.onerror=n,a.readAsDataURL(o)},t,i)});if(s.toDataURL!==void 0)return s.toDataURL(t,i);if(s.convertToBlob!==void 0){const r=await s.convertToBlob({type:t,quality:i});return new Promise((n,o)=>{const a=new FileReader;a.onload=()=>n(a.result),a.onerror=o,a.readAsDataURL(r)})}throw new Error("Extract.base64() requires ICanvas.toDataURL, ICanvas.toBlob, or ICanvas.convertToBlob to be implemented")}canvas(e,t){const{pixels:i,width:s,height:r,flipY:n}=this._rawPixels(e,t);n&&Oi._flipY(i,s,r),Oi._unpremultiplyAlpha(i);const o=new No(s,r,1),a=new ImageData(new Uint8ClampedArray(i.buffer),s,r);return o.context.putImageData(a,0,0),o.canvas}pixels(e,t){const{pixels:i,width:s,height:r,flipY:n}=this._rawPixels(e,t);return n&&Oi._flipY(i,s,r),Oi._unpremultiplyAlpha(i),i}_rawPixels(e,t){const i=this.renderer;if(!i)throw new Error("The Extract has already been destroyed");let s,r=!1,n,o=!1;if(e&&(e instanceof be?n=e:(n=i.generateTexture(e,{resolution:i.resolution,multisample:i.multisample}),o=!0)),n){if(s=n.baseTexture.resolution,t=t!=null?t:n.frame,r=!1,!o){i.renderTexture.bind(n);const u=n.framebuffer.glFramebuffers[i.CONTEXT_UID];u.blitFramebuffer&&i.framebuffer.bind(u.blitFramebuffer)}}else s=i.resolution,t||(t=cd,t.width=i.width/s,t.height=i.height/s),r=!0,i.renderTexture.bind();const a=Math.round(t.width*s),h=Math.round(t.height*s),l=new Uint8Array(ud*a*h),c=i.gl;return c.readPixels(Math.round(t.x*s),Math.round(t.y*s),a,h,c.RGBA,c.UNSIGNED_BYTE,l),o&&(n==null||n.destroy(!0)),{pixels:l,width:a,height:h,flipY:r}}destroy(){this.renderer=null}static _flipY(e,t,i){const s=t<<2,r=i>>1,n=new Uint8Array(s);for(let o=0;o=0&&a>=0&&r>=0&&n>=0)){t.length=0;return}const h=Math.ceil(2.3*Math.sqrt(o+a)),l=h*8+(r?4:0)+(n?4:0);if(t.length=l,l===0)return;if(h===0){t.length=8,t[0]=t[6]=i+r,t[1]=t[3]=s+n,t[2]=t[4]=i-r,t[5]=t[7]=s-n;return}let c=0,u=h*4+(r?2:0)+2,d=u,f=l;{const p=r+o,_=n,g=i+p,v=i-p,b=s+_;if(t[c++]=g,t[c++]=b,t[--u]=b,t[--u]=v,n){const y=s-_;t[d++]=v,t[d++]=y,t[--f]=y,t[--f]=g}}for(let p=1;p0||t&&s<=0){const r=i/2;for(let n=r+r%2;n=6){gh(i,!1);const o=[];for(let l=0;l=0&&n>=0&&o.push(i,s,i+r,s,i+r,s+n,i,s+n)},triangulate(e,t){const i=e.points,s=t.points;if(i.length===0)return;const r=s.length/2;s.push(i[0],i[1],i[2],i[3],i[6],i[7],i[4],i[5]),t.indices.push(r,r+1,r+2,r+1,r+2,r+3)}},vh={build(e){Ui.build(e)},triangulate(e,t){Ui.triangulate(e,t)}};var Vt=(e=>(e.MITER="miter",e.BEVEL="bevel",e.ROUND="round",e))(Vt||{}),Se=(e=>(e.BUTT="butt",e.ROUND="round",e.SQUARE="square",e))(Se||{});const Ae={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount(e,t=20){if(!this.adaptive||!e||isNaN(e))return t;let i=Math.ceil(e/this.maxLength);return ithis.maxSegments&&(i=this.maxSegments),i}},dd=Ae;class Pn{static curveTo(t,i,s,r,n,o){const a=o[o.length-2],l=o[o.length-1]-i,c=a-t,u=r-i,d=s-t,f=Math.abs(l*d-c*u);if(f<1e-8||n===0)return(o[o.length-2]!==t||o[o.length-1]!==i)&&o.push(t,i),null;const p=l*l+c*c,_=u*u+d*d,g=l*u+c*d,v=n*Math.sqrt(p)/f,b=n*Math.sqrt(_)/f,y=v*g/p,x=b*g/_,A=v*d+b*c,D=v*u+b*l,R=c*(b+y),E=l*(b+y),O=d*(v+x),H=u*(v+x),I=Math.atan2(E-D,R-A),N=Math.atan2(H-D,O-A);return{cx:A+t,cy:D+i,radius:n,startAngle:I,endAngle:N,anticlockwise:c*u>d*l}}static arc(t,i,s,r,n,o,a,h,l){const c=a-o,u=Ae._segmentsCount(Math.abs(c)*n,Math.ceil(Math.abs(c)/yi)*40),d=c/(u*2),f=d*2,p=Math.cos(d),_=Math.sin(d),g=u-1,v=g%1/g;for(let b=0;b<=g;++b){const y=b+v*b,x=d+o+f*y,A=Math.cos(x),D=-Math.sin(x);l.push((p*A+_*D)*n+s,(p*-D+_*A)*n+r)}}}class xh{constructor(){this.reset()}begin(t,i,s){this.reset(),this.style=t,this.start=i,this.attribStart=s}end(t,i){this.attribSize=i-this.attribStart,this.size=t-this.start}reset(){this.style=null,this.size=0,this.start=0,this.attribStart=0,this.attribSize=0}}class Hs{static curveLength(t,i,s,r,n,o,a,h){let c=0,u=0,d=0,f=0,p=0,_=0,g=0,v=0,b=0,y=0,x=0,A=t,D=i;for(let R=1;R<=10;++R)u=R/10,d=u*u,f=d*u,p=1-u,_=p*p,g=_*p,v=g*t+3*_*u*s+3*p*d*n+f*a,b=g*i+3*_*u*r+3*p*d*o+f*h,y=A-v,x=D-b,A=v,D=b,c+=Math.sqrt(y*y+x*x);return c}static curveTo(t,i,s,r,n,o,a){const h=a[a.length-2],l=a[a.length-1];a.length-=2;const c=Ae._segmentsCount(Hs.curveLength(h,l,t,i,s,r,n,o));let u=0,d=0,f=0,p=0,_=0;a.push(h,l);for(let g=1,v=0;g<=c;++g)v=g/c,u=1-v,d=u*u,f=d*u,p=v*v,_=p*v,a.push(f*h+3*d*v*t+3*u*p*s+_*n,f*l+3*d*v*i+3*u*p*r+_*o)}}function bh(e,t,i,s,r,n,o,a){const h=e-i*r,l=t-s*r,c=e+i*n,u=t+s*n;let d,f;o?(d=s,f=-i):(d=-s,f=i);const p=h+d,_=l+f,g=c+d,v=u+f;return a.push(p,_,g,v),2}function Ge(e,t,i,s,r,n,o,a){const h=i-e,l=s-t;let c=Math.atan2(h,l),u=Math.atan2(r-e,n-t);a&&cu&&(u+=Math.PI*2);let d=c;const f=u-c,p=Math.abs(f),_=Math.sqrt(h*h+l*l),g=(15*p*Math.sqrt(_)/Math.PI>>0)+1,v=f/g;if(d+=v,a){o.push(e,t,i,s);for(let b=1,y=d;b=0&&(n.join===Vt.ROUND?d+=Ge(y,x,y-R*w,x-E*w,y-O*w,x-H*w,c,!1)+4:d+=2,c.push(y-O*T,x-H*T,y+O*w,x+H*w));continue}const vt=(-R+v)*(-E+x)-(-R+y)*(-E+b),ut=(-O+A)*(-H+x)-(-O+y)*(-H+D),xt=(Z*ut-S*vt)/J,wt=(X*vt-at*ut)/J,Ft=(xt-y)*(xt-y)+(wt-x)*(wt-x),Et=y+(xt-y)*w,rt=x+(wt-x)*w,dt=y-(xt-y)*T,ft=x-(wt-x)*T,he=Math.min(Z*Z+at*at,S*S+X*X),le=Q?w:T,Ji=he+le*le*_,Yd=Ft<=Ji;let er=n.join;if(er===Vt.MITER&&Ft/_>g&&(er=Vt.BEVEL),Yd)switch(er){case Vt.MITER:{c.push(Et,rt,dt,ft);break}case Vt.BEVEL:{Q?c.push(Et,rt,y+R*T,x+E*T,Et,rt,y+O*T,x+H*T):c.push(y-R*w,x-E*w,dt,ft,y-O*w,x-H*w,dt,ft),d+=2;break}case Vt.ROUND:{Q?(c.push(Et,rt,y+R*T,x+E*T),d+=Ge(y,x,y+R*T,x+E*T,y+O*T,x+H*T,c,!0)+4,c.push(Et,rt,y+O*T,x+H*T)):(c.push(y-R*w,x-E*w,dt,ft),d+=Ge(y,x,y-R*w,x-E*w,y-O*w,x-H*w,c,!1)+4,c.push(y-O*w,x-H*w,dt,ft));break}}else{switch(c.push(y-R*w,x-E*w,y+R*T,x+E*T),er){case Vt.MITER:{Q?c.push(dt,ft,dt,ft):c.push(Et,rt,Et,rt),d+=2;break}case Vt.ROUND:{Q?d+=Ge(y,x,y+R*T,x+E*T,y+O*T,x+H*T,c,!0)+2:d+=Ge(y,x,y-R*w,x-E*w,y-O*w,x-H*w,c,!1)+2;break}}c.push(y-O*w,x-H*w,y+O*T,x+H*T),d+=2}}v=s[(u-2)*2],b=s[(u-2)*2+1],y=s[(u-1)*2],x=s[(u-1)*2+1],R=-(b-x),E=v-y,I=Math.sqrt(R*R+E*E),R/=I,E/=I,R*=p,E*=p,c.push(y-R*w,x-E*w,y+R*T,x+E*T),h||(n.cap===Se.ROUND?d+=Ge(y-R*(w-T)*.5,x-E*(w-T)*.5,y-R*w,x-E*w,y+R*T,x+E*T,c,!1)+2:n.cap===Se.SQUARE&&(d+=bh(y,x,R,E,w,T,!1,c)));const W=t.indices,q=Ae.epsilon*Ae.epsilon;for(let F=f;F0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this}drawShape(e,t=null,i=null,s=null){const r=new Gi(e,t,i,s);return this.graphicsData.push(r),this.dirty++,this}drawHole(e,t=null){if(!this.graphicsData.length)return null;const i=new Gi(e,null,null,t),s=this.graphicsData[this.graphicsData.length-1];return i.lineStyle=s.lineStyle,s.holes.push(i),this.dirty++,this}destroy(){super.destroy();for(let e=0;e0&&(i=this.batches[this.batches.length-1],s=i.style);for(let a=this.shapeIndex;a65535;this.indicesUint16&&this.indices.length===this.indicesUint16.length&&o===this.indicesUint16.BYTES_PER_ELEMENT>2?this.indicesUint16.set(this.indices):this.indicesUint16=o?new Uint32Array(this.indices):new Uint16Array(this.indices),this.batchable=this.isBatchable(),this.batchable?this.packBatches():this.buildDrawCalls()}_compareStyles(e,t){return!(!e||!t||e.texture.baseTexture!==t.texture.baseTexture||e.color+e.alpha!==t.color+t.alpha||!!e.native!=!!t.native)}validateBatching(){if(this.dirty===this.cacheDirty||!this.graphicsData.length)return!1;for(let e=0,t=this.graphicsData.length;e65535*2)return!1;const e=this.batches;for(let t=0;t0&&(s=ki.pop(),s||(s=new ps,s.texArray=new Es),this.drawCalls.push(s)),s.start=l,s.size=0,s.texArray.count=0,s.type=h),p.touched=1,p._batchEnabled=e,p._batchLocation=r,p.wrapMode=ie.REPEAT,s.texArray.elements[s.texArray.count++]=p,r++)),s.size+=u.size,l+=u.size,o=p._batchLocation,this.addColors(t,f.color,f.alpha,u.attribSize,u.attribStart),this.addTextureIds(i,o,u.attribSize,u.attribStart)}V._globalBatch=e,this.packAttributes()}packAttributes(){const e=this.points,t=this.uvs,i=this.colors,s=this.textureIds,r=new ArrayBuffer(e.length*3*4),n=new Float32Array(r),o=new Uint32Array(r);let a=0;for(let h=0;h0&&e.alpha>0;return i?(e.matrix&&(e.matrix=e.matrix.clone(),e.matrix.invert()),Object.assign(this._lineStyle,{visible:i},e)):this._lineStyle.reset(),this}startPoly(){if(this.currentPath){const e=this.currentPath.points,t=this.currentPath.points.length;t>2&&(this.drawShape(this.currentPath),this.currentPath=new Pe,this.currentPath.closeStroke=!1,this.currentPath.points.push(e[t-2],e[t-1]))}else this.currentPath=new Pe,this.currentPath.closeStroke=!1}finishPoly(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)}moveTo(e,t){return this.startPoly(),this.currentPath.points[0]=e,this.currentPath.points[1]=t,this}lineTo(e,t){this.currentPath||this.moveTo(0,0);const i=this.currentPath.points,s=i[i.length-2],r=i[i.length-1];return(s!==e||r!==t)&&i.push(e,t),this}_initCurve(e=0,t=0){this.currentPath?this.currentPath.points.length===0&&(this.currentPath.points=[e,t]):this.moveTo(e,t)}quadraticCurveTo(e,t,i,s){this._initCurve();const r=this.currentPath.points;return r.length===0&&this.moveTo(0,0),Xs.curveTo(e,t,i,s,r),this}bezierCurveTo(e,t,i,s,r,n){return this._initCurve(),Hs.curveTo(e,t,i,s,r,n,this.currentPath.points),this}arcTo(e,t,i,s,r){this._initCurve(e,t);const n=this.currentPath.points,o=Pn.curveTo(e,t,i,s,r,n);if(o){const{cx:a,cy:h,radius:l,startAngle:c,endAngle:u,anticlockwise:d}=o;this.arc(a,h,l,c,u,d)}return this}arc(e,t,i,s,r,n=!1){if(s===r)return this;if(!n&&r<=s?r+=yi:n&&s<=r&&(s+=yi),r-s===0)return this;const a=e+Math.cos(s)*i,h=t+Math.sin(s)*i,l=this._geometry.closePointEps;let c=this.currentPath?this.currentPath.points:null;if(c){const u=Math.abs(c[c.length-2]-a),d=Math.abs(c[c.length-1]-h);u0;return i?(e.matrix&&(e.matrix=e.matrix.clone(),e.matrix.invert()),Object.assign(this._fillStyle,{visible:i},e)):this._fillStyle.reset(),this}endFill(){return this.finishPoly(),this._fillStyle.reset(),this}drawRect(e,t,i,s){return this.drawShape(new $(e,t,i,s))}drawRoundedRect(e,t,i,s,r){return this.drawShape(new ys(e,t,i,s,r))}drawCircle(e,t,i){return this.drawShape(new _s(e,t,i))}drawEllipse(e,t,i,s){return this.drawShape(new gs(e,t,i,s))}drawPolygon(...e){let t,i=!0;const s=e[0];s.points?(i=s.closeStroke,t=s.points):Array.isArray(e[0])?t=e[0]:t=e;const r=new Pe(t);return r.closeStroke=i,this.drawShape(r),this}drawShape(e){return this._holeMode?this._geometry.drawHole(e,this._matrix):this._geometry.drawShape(e,this._fillStyle.clone(),this._lineStyle.clone(),this._matrix),this}clear(){return this._geometry.clear(),this._lineStyle.reset(),this._fillStyle.reset(),this._boundsID++,this._matrix=null,this._holeMode=!1,this.currentPath=null,this}isFastRect(){const e=this._geometry.graphicsData;return e.length===1&&e[0].shape.type===_t.RECT&&!e[0].matrix&&!e[0].holes.length&&!(e[0].lineStyle.visible&&e[0].lineStyle.width)}_render(e){this.finishPoly();const t=this._geometry;t.updateBatches(),t.batchable?(this.batchDirty!==t.batchDirty&&this._populateBatches(),this._renderBatched(e)):(e.batch.flush(),this._renderDirect(e))}_populateBatches(){const e=this._geometry,t=this.blendMode,i=e.batches.length;this.batchTint=-1,this._transformID=-1,this.batchDirty=e.batchDirty,this.batches.length=i,this.vertexData=new Float32Array(e.points);for(let s=0;s0){const p=h.x-t[d].x,_=h.y-t[d].y,g=Math.sqrt(p*p+_*_);h=t[d],a+=g/l}else a=d/(c-1);n[f]=a,n[f+1]=0,n[f+2]=a,n[f+3]=1}let u=0;for(let d=0;d0?this.textureScale*this._width/2:this._width/2;for(let l=0;l1&&(d=1);const f=Math.sqrt(r*r+n*n);f<1e-6?(r=0,n=0):(r/=f,n/=f,r*=h,n*=h),o[u]=c.x+r,o[u+1]=c.y+n,o[u+2]=c.x-r,o[u+3]=c.y-n,i=c}this.buffers[0].update()}update(){this.textureScale>0?this.build():this.updateVertices()}}class Ch extends He{constructor(t,i,s){const r=new Ah(t.width,t.height,i,s),n=new ni(B.WHITE);super(r,n),this.texture=t,this.autoResize=!0}textureUpdated(){this._textureID=this.shader.texture._updateID;const t=this.geometry,{width:i,height:s}=this.shader.texture;this.autoResize&&(t.width!==i||t.height!==s)&&(t.width=this.shader.texture.width,t.height=this.shader.texture.height,t.build())}set texture(t){this.shader.texture!==t&&(this.shader.texture=t,this._textureID=-1,t.baseTexture.valid?this.textureUpdated():t.once("update",this.textureUpdated,this))}get texture(){return this.shader.texture}_render(t){this._textureID!==this.shader.texture._updateID&&this.textureUpdated(),super._render(t)}destroy(t){this.shader.texture.off("update",this.textureUpdated,this),super.destroy(t)}}const $s=10;class yd extends Ch{constructor(t,i,s,r,n){var o,a,h,l,c,u,d,f;super(B.WHITE,4,4),this._origWidth=t.orig.width,this._origHeight=t.orig.height,this._width=this._origWidth,this._height=this._origHeight,this._leftWidth=(a=i!=null?i:(o=t.defaultBorders)==null?void 0:o.left)!=null?a:$s,this._rightWidth=(l=r!=null?r:(h=t.defaultBorders)==null?void 0:h.right)!=null?l:$s,this._topHeight=(u=s!=null?s:(c=t.defaultBorders)==null?void 0:c.top)!=null?u:$s,this._bottomHeight=(f=n!=null?n:(d=t.defaultBorders)==null?void 0:d.bottom)!=null?f:$s,this.texture=t}textureUpdated(){this._textureID=this.shader.texture._updateID,this._refresh()}get vertices(){return this.geometry.getBuffer("aVertexPosition").data}set vertices(t){this.geometry.getBuffer("aVertexPosition").data=t}updateHorizontalVertices(){const t=this.vertices,i=this._getMinScale();t[9]=t[11]=t[13]=t[15]=this._topHeight*i,t[17]=t[19]=t[21]=t[23]=this._height-this._bottomHeight*i,t[25]=t[27]=t[29]=t[31]=this._height}updateVerticalVertices(){const t=this.vertices,i=this._getMinScale();t[2]=t[10]=t[18]=t[26]=this._leftWidth*i,t[4]=t[12]=t[20]=t[28]=this._width-this._rightWidth*i,t[6]=t[14]=t[22]=t[30]=this._width}_getMinScale(){const t=this._leftWidth+this._rightWidth,i=this._width>t?1:this._width/t,s=this._topHeight+this._bottomHeight,r=this._height>s?1:this._height/s;return Math.min(i,r)}get width(){return this._width}set width(t){this._width=t,this._refresh()}get height(){return this._height}set height(t){this._height=t,this._refresh()}get leftWidth(){return this._leftWidth}set leftWidth(t){this._leftWidth=t,this._refresh()}get rightWidth(){return this._rightWidth}set rightWidth(t){this._rightWidth=t,this._refresh()}get topHeight(){return this._topHeight}set topHeight(t){this._topHeight=t,this._refresh()}get bottomHeight(){return this._bottomHeight}set bottomHeight(t){this._bottomHeight=t,this._refresh()}_refresh(){const t=this.texture,i=this.geometry.buffers[1].data;this._origWidth=t.orig.width,this._origHeight=t.orig.height;const s=1/this._origWidth,r=1/this._origHeight;i[0]=i[8]=i[16]=i[24]=0,i[1]=i[3]=i[5]=i[7]=0,i[6]=i[14]=i[22]=i[30]=1,i[25]=i[27]=i[29]=i[31]=1,i[2]=i[10]=i[18]=i[26]=s*this._leftWidth,i[4]=i[12]=i[20]=i[28]=1-s*this._rightWidth,i[9]=i[11]=i[13]=i[15]=r*this._topHeight,i[17]=i[19]=i[21]=i[23]=1-r*this._bottomHeight,this.updateHorizontalVertices(),this.updateVerticalVertices(),this.geometry.buffers[0].update(),this.geometry.buffers[1].update()}}class vd extends He{constructor(t=B.EMPTY,i,s,r,n){const o=new Vi(i,s,r);o.getBuffer("aVertexPosition").static=!1;const a=new ni(t);super(o,a,null,n),this.autoUpdate=!0}get vertices(){return this.geometry.getBuffer("aVertexPosition").data}set vertices(t){this.geometry.getBuffer("aVertexPosition").data=t}_render(t){this.autoUpdate&&this.geometry.getBuffer("aVertexPosition").update(),super._render(t)}}class xd extends He{constructor(t,i,s=0){const r=new Rh(t.height,i,s),n=new ni(t);s>0&&(t.baseTexture.wrapMode=ie.REPEAT),super(r,n),this.autoUpdate=!0}_render(t){const i=this.geometry;(this.autoUpdate||i._width!==this.shader.texture.height)&&(i._width=this.shader.texture.height,i.update()),super._render(t)}}class bd extends Ct{constructor(t=1500,i,s=16384,r=!1){super();const n=16384;s>n&&(s=n),this._properties=[!1,!0,!1,!1,!1],this._maxSize=t,this._batchSize=s,this._buffers=null,this._bufferUpdateIDs=[],this._updateID=0,this.interactiveChildren=!1,this.blendMode=G.NORMAL,this.autoResize=r,this.roundPixels=!0,this.baseTexture=null,this.setProperties(i),this._tintColor=new j(0),this.tintRgb=new Float32Array(3),this.tint=16777215}setProperties(t){t&&(this._properties[0]="vertices"in t||"scale"in t?!!t.vertices||!!t.scale:this._properties[0],this._properties[1]="position"in t?!!t.position:this._properties[1],this._properties[2]="rotation"in t?!!t.rotation:this._properties[2],this._properties[3]="uvs"in t?!!t.uvs:this._properties[3],this._properties[4]="tint"in t||"alpha"in t?!!t.tint||!!t.alpha:this._properties[4])}updateTransform(){this.displayObjectUpdateTransform()}get tint(){return this._tintColor.value}set tint(t){this._tintColor.setValue(t),this._tintColor.toRgbArray(this.tintRgb)}render(t){!this.visible||this.worldAlpha<=0||!this.children.length||!this.renderable||(this.baseTexture||(this.baseTexture=this.children[0]._texture.baseTexture,this.baseTexture.valid||this.baseTexture.once("update",()=>this.onChildrenChange(0))),t.batch.setObjectRenderer(t.plugins.particle),t.plugins.particle.render(this))}onChildrenChange(t){const i=Math.floor(t/this._batchSize);for(;this._bufferUpdateIDs.lengths&&!t.autoResize&&(o=s);let a=t._buffers;a||(a=t._buffers=this.generateBuffers(t));const h=i[0]._texture.baseTexture,l=h.alphaMode>0;this.state.blendMode=xr(t.blendMode,l),n.state.set(this.state);const c=n.gl,u=t.worldTransform.copyTo(this.tempMatrix);u.prepend(n.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=u.toArray(!0),this.shader.uniforms.uColor=j.shared.setValue(t.tintRgb).premultiply(t.worldAlpha,l).toArray(this.shader.uniforms.uColor),this.shader.uniforms.uSampler=h,this.renderer.shader.bind(this.shader);let d=!1;for(let f=0,p=0;fr&&(_=r),p>=a.length&&a.push(this._generateOneMoreBuffer(t));const g=a[p];g.uploadDynamic(i,f,_);const v=t._bufferUpdateIDs[p]||0;d=d||g._updateID0);r[o]=l,r[o+n]=l,r[o+n*2]=l,r[o+n*3]=l,o+=n*4}}destroy(){super.destroy(),this.shader&&(this.shader.destroy(),this.shader=null),this.tempMatrix=null}}Ln.extension={name:"particle",type:M.RendererPlugin},U.add(Ln);var zi=(e=>(e[e.LINEAR_VERTICAL=0]="LINEAR_VERTICAL",e[e.LINEAR_HORIZONTAL=1]="LINEAR_HORIZONTAL",e))(zi||{});const js={willReadFrequently:!0},L=class{static get experimentalLetterSpacingSupported(){let e=L._experimentalLetterSpacingSupported;if(e!==void 0){const t=P.ADAPTER.getCanvasRenderingContext2D().prototype;e=L._experimentalLetterSpacingSupported="letterSpacing"in t||"textLetterSpacing"in t}return e}constructor(e,t,i,s,r,n,o,a,h){this.text=e,this.style=t,this.width=i,this.height=s,this.lines=r,this.lineWidths=n,this.lineHeight=o,this.maxLineWidth=a,this.fontProperties=h}static measureText(e,t,i,s=L._canvas){i=i==null?t.wordWrap:i;const r=t.toFontString(),n=L.measureFont(r);n.fontSize===0&&(n.fontSize=t.fontSize,n.ascent=t.fontSize);const o=s.getContext("2d",js);o.font=r;const h=(i?L.wordWrap(e,t,s):e).split(/(?:\r\n|\r|\n)/),l=new Array(h.length);let c=0;for(let p=0;p0&&(s?r-=t:r+=(L.graphemeSegmenter(e).length-1)*t),r}static wordWrap(e,t,i=L._canvas){const s=i.getContext("2d",js);let r=0,n="",o="";const a=Object.create(null),{letterSpacing:h,whiteSpace:l}=t,c=L.collapseSpaces(l),u=L.collapseNewlines(l);let d=!c;const f=t.wordWrapWidth+h,p=L.tokenize(e);for(let _=0;_f)if(n!==""&&(o+=L.addLine(n),n="",r=0),L.canBreakWords(g,t.breakWords)){const b=L.wordWrapSplit(g);for(let y=0;yf&&(o+=L.addLine(n),d=!1,n="",r=0),n+=x,r+=R}}else{n.length>0&&(o+=L.addLine(n),n="",r=0);const b=_===p.length-1;o+=L.addLine(g,!b),d=!1,n="",r=0}else v+r>f&&(d=!1,o+=L.addLine(n),n="",r=0),(n.length>0||!L.isBreakingSpace(g)||d)&&(n+=g,r+=v)}return o+=L.addLine(n,!1),o}static addLine(e,t=!0){return e=L.trimRight(e),e=t?`${e} -`:e,e}static getFromCache(e,t,i,s){let r=i[e];return typeof r!="number"&&(r=L._measureText(e,t,s)+t,i[e]=r),r}static collapseSpaces(e){return e==="normal"||e==="pre-line"}static collapseNewlines(e){return e==="normal"}static trimRight(e){if(typeof e!="string")return"";for(let t=e.length-1;t>=0;t--){const i=e[t];if(!L.isBreakingSpace(i))break;e=e.slice(0,-1)}return e}static isNewline(e){return typeof e!="string"?!1:L._newlines.includes(e.charCodeAt(0))}static isBreakingSpace(e,t){return typeof e!="string"?!1:L._breakingSpaces.includes(e.charCodeAt(0))}static tokenize(e){const t=[];let i="";if(typeof e!="string")return t;for(let s=0;so;--u){for(let p=0;p{if(typeof(Intl==null?void 0:Intl.Segmenter)=="function"){const e=new Intl.Segmenter;return t=>[...e.segment(t)].map(i=>i.segment)}return e=>[...e]})(),yt.experimentalLetterSpacing=!1,yt._fonts={},yt._newlines=[10,13],yt._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288];const wd=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Wi=class{constructor(e){this.styleID=0,this.reset(),Un(this,e,e)}clone(){const e={};return Un(e,this,Wi.defaultStyle),new Wi(e)}reset(){Un(this,Wi.defaultStyle,Wi.defaultStyle)}get align(){return this._align}set align(e){this._align!==e&&(this._align=e,this.styleID++)}get breakWords(){return this._breakWords}set breakWords(e){this._breakWords!==e&&(this._breakWords=e,this.styleID++)}get dropShadow(){return this._dropShadow}set dropShadow(e){this._dropShadow!==e&&(this._dropShadow=e,this.styleID++)}get dropShadowAlpha(){return this._dropShadowAlpha}set dropShadowAlpha(e){this._dropShadowAlpha!==e&&(this._dropShadowAlpha=e,this.styleID++)}get dropShadowAngle(){return this._dropShadowAngle}set dropShadowAngle(e){this._dropShadowAngle!==e&&(this._dropShadowAngle=e,this.styleID++)}get dropShadowBlur(){return this._dropShadowBlur}set dropShadowBlur(e){this._dropShadowBlur!==e&&(this._dropShadowBlur=e,this.styleID++)}get dropShadowColor(){return this._dropShadowColor}set dropShadowColor(e){const t=On(e);this._dropShadowColor!==t&&(this._dropShadowColor=t,this.styleID++)}get dropShadowDistance(){return this._dropShadowDistance}set dropShadowDistance(e){this._dropShadowDistance!==e&&(this._dropShadowDistance=e,this.styleID++)}get fill(){return this._fill}set fill(e){const t=On(e);this._fill!==t&&(this._fill=t,this.styleID++)}get fillGradientType(){return this._fillGradientType}set fillGradientType(e){this._fillGradientType!==e&&(this._fillGradientType=e,this.styleID++)}get fillGradientStops(){return this._fillGradientStops}set fillGradientStops(e){Sd(this._fillGradientStops,e)||(this._fillGradientStops=e,this.styleID++)}get fontFamily(){return this._fontFamily}set fontFamily(e){this.fontFamily!==e&&(this._fontFamily=e,this.styleID++)}get fontSize(){return this._fontSize}set fontSize(e){this._fontSize!==e&&(this._fontSize=e,this.styleID++)}get fontStyle(){return this._fontStyle}set fontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.styleID++)}get fontVariant(){return this._fontVariant}set fontVariant(e){this._fontVariant!==e&&(this._fontVariant=e,this.styleID++)}get fontWeight(){return this._fontWeight}set fontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.styleID++)}get letterSpacing(){return this._letterSpacing}set letterSpacing(e){this._letterSpacing!==e&&(this._letterSpacing=e,this.styleID++)}get lineHeight(){return this._lineHeight}set lineHeight(e){this._lineHeight!==e&&(this._lineHeight=e,this.styleID++)}get leading(){return this._leading}set leading(e){this._leading!==e&&(this._leading=e,this.styleID++)}get lineJoin(){return this._lineJoin}set lineJoin(e){this._lineJoin!==e&&(this._lineJoin=e,this.styleID++)}get miterLimit(){return this._miterLimit}set miterLimit(e){this._miterLimit!==e&&(this._miterLimit=e,this.styleID++)}get padding(){return this._padding}set padding(e){this._padding!==e&&(this._padding=e,this.styleID++)}get stroke(){return this._stroke}set stroke(e){const t=On(e);this._stroke!==t&&(this._stroke=t,this.styleID++)}get strokeThickness(){return this._strokeThickness}set strokeThickness(e){this._strokeThickness!==e&&(this._strokeThickness=e,this.styleID++)}get textBaseline(){return this._textBaseline}set textBaseline(e){this._textBaseline!==e&&(this._textBaseline=e,this.styleID++)}get trim(){return this._trim}set trim(e){this._trim!==e&&(this._trim=e,this.styleID++)}get whiteSpace(){return this._whiteSpace}set whiteSpace(e){this._whiteSpace!==e&&(this._whiteSpace=e,this.styleID++)}get wordWrap(){return this._wordWrap}set wordWrap(e){this._wordWrap!==e&&(this._wordWrap=e,this.styleID++)}get wordWrapWidth(){return this._wordWrapWidth}set wordWrapWidth(e){this._wordWrapWidth!==e&&(this._wordWrapWidth=e,this.styleID++)}toFontString(){const e=typeof this.fontSize=="number"?`${this.fontSize}px`:this.fontSize;let t=this.fontFamily;Array.isArray(this.fontFamily)||(t=this.fontFamily.split(","));for(let i=t.length-1;i>=0;i--){let s=t[i].trim();!/([\"\'])[^\'\"]+\1/.test(s)&&!wd.includes(s)&&(s=`"${s}"`),t[i]=s}return`${this.fontStyle} ${this.fontVariant} ${this.fontWeight} ${e} ${t.join(",")}`}};let ae=Wi;ae.defaultStyle={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:zi.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",leading:0,letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100};function On(e){const t=j.shared;return Array.isArray(e)?e.map(i=>t.setValue(i).toHex()):t.setValue(e).toHex()}function Sd(e,t){if(!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length)return!1;for(let i=0;i0&&f>p&&(_=(p+f)/2);const g=p+u,v=i.lineHeight*(d+1);let b=g;d+10}}function Rd(e,t){var s;let i=!1;if((s=e==null?void 0:e._textures)!=null&&s.length){for(let r=0;r{!this.queue||this.prepareItems()},this.registerFindHook(Bd),this.registerFindHook(Dd),this.registerFindHook(Rd),this.registerFindHook(Cd),this.registerFindHook(Id),this.registerUploadHook(Pd),this.registerUploadHook(Md)}upload(e){return new Promise(t=>{e&&this.add(e),this.queue.length?(this.completes.push(t),this.ticking||(this.ticking=!0,lt.system.addOnce(this.tick,this,ge.UTILITY))):t()})}tick(){setTimeout(this.delayedTick,0)}prepareItems(){for(this.limiter.beginFrame();this.queue.length&&this.limiter.allowedToUpload();){const e=this.queue[0];let t=!1;if(e&&!e._destroyed){for(let i=0,s=this.uploadHooks.length;i=0;t--)this.add(e.children[t]);return this}destroy(){this.ticking&<.system.remove(this.tick,this),this.ticking=!1,this.addHooks=null,this.uploadHooks=null,this.renderer=null,this.completes=null,this.queue=null,this.limiter=null,this.uploadHookHelper=null}};let $i=Mh;$i.uploadsPerFrame=4,Object.defineProperties(P,{UPLOADS_PER_FRAME:{get(){return $i.uploadsPerFrame},set(e){z("7.1.0","settings.UPLOADS_PER_FRAME is deprecated, use prepare.BasePrepare.uploadsPerFrame"),$i.uploadsPerFrame=e}}});function Bh(e,t){return t instanceof V?(t._glTextures[e.CONTEXT_UID]||e.texture.bind(t),!0):!1}function Fd(e,t){if(!(t instanceof Xi))return!1;const{geometry:i}=t;t.finishPoly(),i.updateBatches();const{batches:s}=i;for(let r=0;r=this._durations[this.currentFrame];)r-=this._durations[this.currentFrame]*n,this._currentTime+=n;this._currentTime+=r/this._durations[this.currentFrame]}else this._currentTime+=i;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):s!==this.currentFrame&&(this.loop&&this.onLoop&&(this.animationSpeed>0&&this.currentFrames)&&this.onLoop(),this.updateTexture())}updateTexture(){const t=this.currentFrame;this._previousFrame!==t&&(this._previousFrame=t,this._texture=this._textures[t],this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this.uvs=this._texture._uvs.uvsFloat32,this.updateAnchor&&this._anchor.copyFrom(this._texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame))}destroy(t){this.stop(),super.destroy(t),this.onComplete=null,this.onFrameChange=null,this.onLoop=null}static fromFrames(t){const i=[];for(let s=0;sthis.totalFrames-1)throw new Error(`[AnimatedSprite]: Invalid frame index value ${t}, expected to be between 0 and totalFrames ${this.totalFrames}.`);const i=this.currentFrame;this._currentTime=t,i!==this.currentFrame&&this.updateTexture()}get playing(){return this._playing}get autoUpdate(){return this._autoUpdate}set autoUpdate(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isConnectedToTicker?(lt.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._playing&&(lt.shared.add(this.update,this),this._isConnectedToTicker=!0))}}const ji=new Y;class Hn extends ye{constructor(t,i=100,s=100){super(t),this.tileTransform=new vi,this._width=i,this._height=s,this.uvMatrix=this.texture.uvMatrix||new Rs(t),this.pluginName="tilingSprite",this.uvRespectAnchor=!1}get clampMargin(){return this.uvMatrix.clampMargin}set clampMargin(t){this.uvMatrix.clampMargin=t,this.uvMatrix.update(!0)}get tileScale(){return this.tileTransform.scale}set tileScale(t){this.tileTransform.scale.copyFrom(t)}get tilePosition(){return this.tileTransform.position}set tilePosition(t){this.tileTransform.position.copyFrom(t)}_onTextureUpdate(){this.uvMatrix&&(this.uvMatrix.texture=this._texture),this._cachedTint=16777215}_render(t){const i=this._texture;!i||!i.valid||(this.tileTransform.updateLocalTransform(),this.uvMatrix.update(),t.batch.setObjectRenderer(t.plugins[this.pluginName]),t.plugins[this.pluginName].render(this))}_calculateBounds(){const t=this._width*-this._anchor._x,i=this._height*-this._anchor._y,s=this._width*(1-this._anchor._x),r=this._height*(1-this._anchor._y);this._bounds.addFrame(this.transform,t,i,s,r)}getLocalBounds(t){return this.children.length===0?(this._bounds.minX=this._width*-this._anchor._x,this._bounds.minY=this._height*-this._anchor._y,this._bounds.maxX=this._width*(1-this._anchor._x),this._bounds.maxY=this._height*(1-this._anchor._y),t||(this._localBoundsRect||(this._localBoundsRect=new $),t=this._localBoundsRect),this._bounds.getRectangle(t)):super.getLocalBounds.call(this,t)}containsPoint(t){this.worldTransform.applyInverse(t,ji);const i=this._width,s=this._height,r=-i*this.anchor._x;if(ji.x>=r&&ji.x=n&&ji.y1?Kt.from(Ud,Od,i):Kt.from(Dh,kd,i)}render(t){const i=this.renderer,s=this.quad;let r=s.vertices;r[0]=r[6]=t._width*-t.anchor.x,r[1]=r[3]=t._height*-t.anchor.y,r[2]=r[4]=t._width*(1-t.anchor.x),r[5]=r[7]=t._height*(1-t.anchor.y);const n=t.uvRespectAnchor?t.anchor.x:0,o=t.uvRespectAnchor?t.anchor.y:0;r=s.uvs,r[0]=r[6]=-n,r[1]=r[3]=-o,r[2]=r[4]=1-n,r[5]=r[7]=1-o,s.invalidate();const a=t._texture,h=a.baseTexture,l=h.alphaMode>0,c=t.tileTransform.localTransform,u=t.uvMatrix;let d=h.isPowerOfTwo&&a.frame.width===h.width&&a.frame.height===h.height;d&&(h._glTextures[i.CONTEXT_UID]?d=h.wrapMode!==ie.CLAMP:h.wrapMode===ie.CLAMP&&(h.wrapMode=ie.REPEAT));const f=d?this.simpleShader:this.shader,p=a.width,_=a.height,g=t._width,v=t._height;Ks.set(c.a*p/g,c.b*p/v,c.c*_/g,c.d*_/v,c.tx/g,c.ty/v),Ks.invert(),d?Ks.prepend(u.mapCoord):(f.uniforms.uMapCoord=u.mapCoord.toArray(!0),f.uniforms.uClampFrame=u.uClampFrame,f.uniforms.uClampOffset=u.uClampOffset),f.uniforms.uTransform=Ks.toArray(!0),f.uniforms.uColor=j.shared.setValue(t.tint).premultiply(t.worldAlpha,l).toArray(f.uniforms.uColor),f.uniforms.translationMatrix=t.transform.worldTransform.toArray(!0),f.uniforms.uSampler=a,i.shader.bind(f),i.geometry.bind(s),this.state.blendMode=xr(t.blendMode,l),i.state.set(this.state),i.geometry.draw(this.renderer.gl.TRIANGLES,6,0)}}Xn.extension={name:"tilingSprite",type:M.RendererPlugin},U.add(Xn);const Yi=class{constructor(e,t,i=null){this.linkedSheets=[],this._texture=e instanceof B?e:null,this.baseTexture=e instanceof V?e:this._texture.baseTexture,this.textures={},this.animations={},this.data=t;const s=this.baseTexture.resource;this.resolution=this._updateResolution(i||(s?s.url:null)),this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}_updateResolution(e=null){const{scale:t}=this.data.meta;let i=fe(e,null);return i===null&&(i=parseFloat(t!=null?t:"1")),i!==1&&this.baseTexture.setResolution(i),i}parse(){return new Promise(e=>{this._callback=e,this._batchIndex=0,this._frameKeys.length<=Yi.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()})}_processFrames(e){let t=e;const i=Yi.BATCH_SIZE;for(;t-e{this._batchIndex*Yi.BATCH_SIZE{s[r]=t}),Object.keys(t.textures).forEach(r=>{s[r]=t.textures[r]}),!i){const r=Tt.dirname(e[0]);t.linkedSheets.forEach((n,o)=>{const a=Fh([`${r}/${t.data.meta.related_multi_packs[o]}`],n,!0);Object.assign(s,a)})}return s}const Nh={extension:M.Asset,cache:{test:e=>e instanceof Zs,getCacheableAssets:(e,t)=>Fh(e,t,!1)},resolver:{test:e=>{const i=e.split("?")[0].split("."),s=i.pop(),r=i.pop();return s==="json"&&Hd.includes(r)},parse:e=>{var i,s;const t=e.split(".");return{resolution:parseFloat((s=(i=P.RETINA_PREFIX.exec(e))==null?void 0:i[1])!=null?s:"1"),format:t[t.length-2],src:e}}},loader:{name:"spritesheetLoader",extension:{type:M.LoadParser,priority:Jt.Normal},async testParse(e,t){return Tt.extname(t.src).toLowerCase()===".json"&&!!e.frames},async parse(e,t,i){var l,c;let s=Tt.dirname(t.src);s&&s.lastIndexOf("/")!==s.length-1&&(s+="/");let r=s+e.meta.image;r=Os(r,t.src);const o=(await i.load([r]))[r],a=new Zs(o.baseTexture,e,t.src);await a.parse();const h=(l=e==null?void 0:e.meta)==null?void 0:l.related_multi_packs;if(Array.isArray(h)){const u=[];for(const f of h){if(typeof f!="string")continue;let p=s+f;(c=t.data)!=null&&c.ignoreMultiPack||(p=Os(p,t.src),u.push(i.load({src:p,data:{ignoreMultiPack:!0}})))}const d=await Promise.all(u);a.linkedSheets=d,d.forEach(f=>{f.linkedSheets=[a].concat(a.linkedSheets.filter(p=>p!==f))})}return a},unload(e){e.destroy(!0)}}};U.add(Nh);class qi{constructor(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[],this.distanceField=[]}}class Ki{static test(t){return typeof t=="string"&&t.startsWith("info face=")}static parse(t){const i=t.match(/^[a-z]+\s+.+$/gm),s={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[],distanceField:[]};for(const n in i){const o=i[n].match(/^[a-z]+/gm)[0],a=i[n].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),h={};for(const l in a){const c=a[l].split("="),u=c[0],d=c[1].replace(/"/gm,""),f=parseFloat(d),p=isNaN(f)?d:f;h[u]=p}s[o].push(h)}const r=new qi;return s.info.forEach(n=>r.info.push({face:n.face,size:parseInt(n.size,10)})),s.common.forEach(n=>r.common.push({lineHeight:parseInt(n.lineHeight,10)})),s.page.forEach(n=>r.page.push({id:parseInt(n.id,10),file:n.file})),s.char.forEach(n=>r.char.push({id:parseInt(n.id,10),page:parseInt(n.page,10),x:parseInt(n.x,10),y:parseInt(n.y,10),width:parseInt(n.width,10),height:parseInt(n.height,10),xoffset:parseInt(n.xoffset,10),yoffset:parseInt(n.yoffset,10),xadvance:parseInt(n.xadvance,10)})),s.kerning.forEach(n=>r.kerning.push({first:parseInt(n.first,10),second:parseInt(n.second,10),amount:parseInt(n.amount,10)})),s.distanceField.forEach(n=>r.distanceField.push({distanceRange:parseInt(n.distanceRange,10),fieldType:n.fieldType})),r}}class Js{static test(t){const i=t;return"getElementsByTagName"in i&&i.getElementsByTagName("page").length&&i.getElementsByTagName("info")[0].getAttribute("face")!==null}static parse(t){const i=new qi,s=t.getElementsByTagName("info"),r=t.getElementsByTagName("common"),n=t.getElementsByTagName("page"),o=t.getElementsByTagName("char"),a=t.getElementsByTagName("kerning"),h=t.getElementsByTagName("distanceField");for(let l=0;l")?Js.test(P.ADAPTER.parseXML(t)):!1}static parse(t){return Js.parse(P.ADAPTER.parseXML(t))}}const Vn=[Ki,Js,Qs];function Lh(e){for(let t=0;t=a-I*n){if(p===0)throw new Error(`[BitmapFont] textureHeight ${a}px is too small (fontFamily: '${c.fontFamily}', fontSize: ${c.fontSize}px, char: '${E}')`);--R,_=null,g=null,v=null,p=0,f=0,b=0;continue}if(b=Math.max(I+O.fontProperties.descent,b),N*n+f>=u){if(f===0)throw new Error(`[BitmapFont] textureWidth ${o}px is too small (fontFamily: '${c.fontFamily}', fontSize: ${c.fontSize}px, char: '${E}')`);--R,p+=b*n,p=Math.ceil(p),f=0,b=0;continue}Vd(_,g,O,f,p,n,c);const w=tr(O.text);d.char.push({id:w,page:x.length-1,x:f/n,y:p/n,width:N,height:I,xoffset:0,yoffset:0,xadvance:H-(c.dropShadow?c.dropShadowDistance:0)-(c.stroke?c.strokeThickness:0)}),f+=(N+2*r)*n,f=Math.ceil(f)}for(let R=0,E=l.length;R 0.99) {\r - alpha = 1.0;\r - }\r -\r - // Gamma correction for coverage-like alpha\r - float luma = dot(uColor.rgb, vec3(0.299, 0.587, 0.114));\r - float gamma = mix(1.0, 1.0 / 2.2, luma);\r - float coverage = pow(uColor.a * alpha, gamma); \r -\r - // NPM Textures, NPM outputs\r - gl_FragColor = vec4(uColor.rgb, coverage);\r -}\r -`,$d=`// Mesh material default fragment\r -attribute vec2 aVertexPosition;\r -attribute vec2 aTextureCoord;\r -\r -uniform mat3 projectionMatrix;\r -uniform mat3 translationMatrix;\r -uniform mat3 uTextureMatrix;\r -\r -varying vec2 vTextureCoord;\r -\r -void main(void)\r -{\r - gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\r -\r - vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;\r -}\r -`;const Uh=[],kh=[],Gh=[],Hh=class extends Ct{constructor(e,t={}){super();const{align:i,tint:s,maxWidth:r,letterSpacing:n,fontName:o,fontSize:a}=Object.assign({},Hh.styleDefaults,t);if(!At.available[o])throw new Error(`Missing BitmapFont "${o}"`);this._activePagesMeshData=[],this._textWidth=0,this._textHeight=0,this._align=i,this._tintColor=new j(s),this._font=void 0,this._fontName=o,this._fontSize=a,this.text=e,this._maxWidth=r,this._maxLineHeight=0,this._letterSpacing=n,this._anchor=new me(()=>{this.dirty=!0},this,0,0),this._roundPixels=P.ROUND_PIXELS,this.dirty=!0,this._resolution=P.RESOLUTION,this._autoResolution=!0,this._textureCache={}}updateText(){var H;const e=At.available[this._fontName],t=this.fontSize,i=t/e.size,s=new Y,r=[],n=[],o=[],a=this._text.replace(/(?:\r\n|\r)/g,` -`)||" ",h=Oh(a),l=this._maxWidth*e.size/t,c=e.distanceFieldType==="none"?Uh:kh;let u=null,d=0,f=0,p=0,_=-1,g=0,v=0,b=0,y=0;for(let I=0;I0&&s.x>l&&(++v,Ie(r,1+_-v,1+I-_),I=_,_=-1,n.push(g),o.push(r.length>0?r[r.length-1].prevSpaces:0),f=Math.max(f,g),p++,s.x=0,s.y+=e.lineHeight,u=null,y=0)}const x=h[h.length-1];x!=="\r"&&x!==` -`&&(/(?:\s)/.test(x)&&(d=g),n.push(d),f=Math.max(f,d),o.push(-1));const A=[];for(let I=0;I<=p;I++){let N=0;this._align==="right"?N=f-n[I]:this._align==="center"?N=(f-n[I])/2:this._align==="justify"&&(N=o[I]<0?0:(f-n[I])/o[I]),A.push(N)}const D=r.length,R={},E=[],O=this._activePagesMeshData;c.push(...O);for(let I=0;I6*w)||N.vertices.lengtht[r.mesh.texture.baseTexture.uid]).forEach(r=>{r.mesh.texture=B.EMPTY});for(const r in t)t[r].destroy(),delete t[r];this._font=null,this._tintColor=null,this._textureCache=null,super.destroy(e)}};let Xh=Hh;Xh.styleDefaults={align:"left",tint:16777215,maxWidth:0,letterSpacing:0};const jd=[".xml",".fnt"],Vh={extension:{type:M.LoadParser,priority:Jt.Normal},name:"loadBitmapFont",test(e){return jd.includes(Tt.extname(e).toLowerCase())},async testParse(e){return Ki.test(e)||Qs.test(e)},async parse(e,t,i){const s=Ki.test(e)?Ki.parse(e):Qs.parse(e),{src:r}=t,{page:n}=s,o=[];for(let l=0;la[l]);return At.install(s,h,!0)},async load(e,t){return(await P.ADAPTER.fetch(e)).text()},unload(e){e.destroy()}};U.add(Vh);const oi=class extends ae{constructor(){super(...arguments),this._fonts=[],this._overrides=[],this._stylesheet="",this.fontsDirty=!1}static from(e){return new oi(Object.keys(oi.defaultOptions).reduce((t,i)=>Qi(bt({},t),{[i]:e[i]}),{}))}cleanFonts(){this._fonts.length>0&&(this._fonts.forEach(e=>{URL.revokeObjectURL(e.src),e.refs--,e.refs===0&&(e.fontFace&&document.fonts.delete(e.fontFace),delete oi.availableFonts[e.originalUrl])}),this.fontFamily="Arial",this._fonts.length=0,this.styleID++,this.fontsDirty=!0)}loadFont(e,t={}){const{availableFonts:i}=oi;if(i[e]){const s=i[e];return this._fonts.push(s),s.refs++,this.styleID++,this.fontsDirty=!0,Promise.resolve()}return P.ADAPTER.fetch(e).then(s=>s.blob()).then(async s=>new Promise((r,n)=>{const o=URL.createObjectURL(s),a=new FileReader;a.onload=()=>r([o,a.result]),a.onerror=n,a.readAsDataURL(s)})).then(async([s,r])=>{const n=Object.assign({family:Tt.basename(e,Tt.extname(e)),weight:"normal",style:"normal",src:s,dataSrc:r,refs:1,originalUrl:e,fontFace:null},t);i[e]=n,this._fonts.push(n),this.styleID++;const o=new FontFace(n.family,`url(${n.src})`,{weight:n.weight,style:n.style});n.fontFace=o,await o.load(),document.fonts.add(o),await document.fonts.ready,this.styleID++,this.fontsDirty=!0})}addOverride(...e){const t=e.filter(i=>!this._overrides.includes(i));t.length>0&&(this._overrides.push(...t),this.styleID++)}removeOverride(...e){const t=e.filter(i=>this._overrides.includes(i));t.length>0&&(this._overrides=this._overrides.filter(i=>!t.includes(i)),this.styleID++)}toCSS(e){return[`transform: scale(${e})`,"transform-origin: top left","display: inline-block",`color: ${this.normalizeColor(this.fill)}`,`font-size: ${this.fontSize}px`,`font-family: ${this.fontFamily}`,`font-weight: ${this.fontWeight}`,`font-style: ${this.fontStyle}`,`font-variant: ${this.fontVariant}`,`letter-spacing: ${this.letterSpacing}px`,`text-align: ${this.align}`,`padding: ${this.padding}px`,`white-space: ${this.whiteSpace}`,...this.lineHeight?[`line-height: ${this.lineHeight}px`]:[],...this.wordWrap?[`word-wrap: ${this.breakWords?"break-all":"break-word"}`,`max-width: ${this.wordWrapWidth}px`]:[],...this.strokeThickness?[`-webkit-text-stroke-width: ${this.strokeThickness}px`,`-webkit-text-stroke-color: ${this.normalizeColor(this.stroke)}`,`text-stroke-width: ${this.strokeThickness}px`,`text-stroke-color: ${this.normalizeColor(this.stroke)}`,"paint-order: stroke"]:[],...this.dropShadow?[this.dropShadowToCSS()]:[],...this._overrides].join(";")}toGlobalCSS(){return this._fonts.reduce((e,t)=>`${e} - @font-face { - font-family: "${t.family}"; - src: url('${t.dataSrc}'); - font-weight: ${t.weight}; - font-style: ${t.style}; - }`,this._stylesheet)}get stylesheet(){return this._stylesheet}set stylesheet(e){this._stylesheet!==e&&(this._stylesheet=e,this.styleID++)}normalizeColor(e){return Array.isArray(e)&&(e=Mo(e)),typeof e=="number"?Po(e):e}dropShadowToCSS(){let e=this.normalizeColor(this.dropShadowColor);const t=this.dropShadowAlpha,i=Math.round(Math.cos(this.dropShadowAngle)*this.dropShadowDistance),s=Math.round(Math.sin(this.dropShadowAngle)*this.dropShadowDistance);e.startsWith("#")&&t<1&&(e+=(t*255|0).toString(16).padStart(2,"0"));const r=`${i}px ${s}px`;return this.dropShadowBlur>0?`text-shadow: ${r} ${this.dropShadowBlur}px ${e}`:`text-shadow: ${r} ${e}`}reset(){Object.assign(this,oi.defaultOptions)}onBeforeDraw(){const{fontsDirty:e}=this;return this.fontsDirty=!1,this.isSafari&&this._fonts.length>0&&e?new Promise(t=>setTimeout(t,100)):Promise.resolve()}get isSafari(){const{userAgent:e}=P.ADAPTER.getNavigator();return/^((?!chrome|android).)*safari/i.test(e)}set fillGradientStops(e){console.warn("[HTMLTextStyle] fillGradientStops is not supported by HTMLText")}get fillGradientStops(){return super.fillGradientStops}set fillGradientType(e){console.warn("[HTMLTextStyle] fillGradientType is not supported by HTMLText")}get fillGradientType(){return super.fillGradientType}set miterLimit(e){console.warn("[HTMLTextStyle] miterLimit is not supported by HTMLText")}get miterLimit(){return super.miterLimit}set trim(e){console.warn("[HTMLTextStyle] trim is not supported by HTMLText")}get trim(){return super.trim}set textBaseline(e){console.warn("[HTMLTextStyle] textBaseline is not supported by HTMLText")}get textBaseline(){return super.textBaseline}set leading(e){console.warn("[HTMLTextStyle] leading is not supported by HTMLText")}get leading(){return super.leading}set lineJoin(e){console.warn("[HTMLTextStyle] lineJoin is not supported by HTMLText")}get lineJoin(){return super.lineJoin}};let ai=oi;ai.availableFonts={},ai.defaultOptions={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,padding:0,stroke:"black",strokeThickness:0,whiteSpace:"normal",wordWrap:!1,wordWrapWidth:100};const hi=class extends ye{constructor(e="",t={}){var c;super(B.EMPTY),this._text=null,this._style=null,this._autoResolution=!0,this._loading=!1,this.localStyleID=-1,this.dirty=!1,this.ownsStyle=!1;const i=new Image,s=B.from(i,{scaleMode:P.SCALE_MODE,resourceOptions:{autoLoad:!1}});s.orig=new $,s.trim=new $,this.texture=s;const r="http://www.w3.org/2000/svg",n="http://www.w3.org/1999/xhtml",o=document.createElementNS(r,"svg"),a=document.createElementNS(r,"foreignObject"),h=document.createElementNS(n,"div"),l=document.createElementNS(n,"style");a.setAttribute("width","10000"),a.setAttribute("height","10000"),a.style.overflow="hidden",o.appendChild(a),this.maxWidth=hi.defaultMaxWidth,this.maxHeight=hi.defaultMaxHeight,this._domElement=h,this._styleElement=l,this._svgRoot=o,this._foreignObject=a,this._foreignObject.appendChild(l),this._foreignObject.appendChild(h),this._image=i,this._loadImage=new Image,this._autoResolution=hi.defaultAutoResolution,this._resolution=(c=hi.defaultResolution)!=null?c:P.RESOLUTION,this.text=e,this.style=t}measureText(e){var a,h;const{text:t,style:i,resolution:s}=Object.assign({text:this._text,style:this._style,resolution:this._resolution},e);Object.assign(this._domElement,{innerHTML:t,style:i.toCSS(s)}),this._styleElement.textContent=i.toGlobalCSS(),document.body.appendChild(this._svgRoot);const r=this._domElement.getBoundingClientRect();this._svgRoot.remove();const n=Math.min(this.maxWidth,Math.ceil(r.width)),o=Math.min(this.maxHeight,Math.ceil(r.height));return this._svgRoot.setAttribute("width",n.toString()),this._svgRoot.setAttribute("height",o.toString()),t!==this._text&&(this._domElement.innerHTML=this._text),i!==this._style&&(Object.assign(this._domElement,{style:(a=this._style)==null?void 0:a.toCSS(s)}),this._styleElement.textContent=(h=this._style)==null?void 0:h.toGlobalCSS()),{width:n+i.padding*2,height:o+i.padding*2}}async updateText(e=!0){const{style:t,_image:i,_loadImage:s}=this;if(this.localStyleID!==t.styleID&&(this.dirty=!0,this.localStyleID=t.styleID),!this.dirty&&e)return;const{width:r,height:n}=this.measureText();i.width=s.width=Math.ceil(Math.max(1,r)),i.height=s.height=Math.ceil(Math.max(1,n)),this._loading||(this._loading=!0,await new Promise(o=>{s.onload=async()=>{await t.onBeforeDraw(),this._loading=!1,i.src=s.src,s.onload=null,s.src="",this.updateTexture(),o()};const a=new XMLSerializer().serializeToString(this._svgRoot);s.src=`data:image/svg+xml;charset=utf8,${encodeURIComponent(a)}`}))}get source(){return this._image}updateTexture(){const{style:e,texture:t,_image:i,resolution:s}=this,{padding:r}=e,{baseTexture:n}=t;t.trim.width=t._frame.width=i.width/s,t.trim.height=t._frame.height=i.height/s,t.trim.x=-r,t.trim.y=-r,t.orig.width=t._frame.width-r*2,t.orig.height=t._frame.height-r*2,this._onTextureUpdate(),n.setRealSize(i.width,i.height,s),this.dirty=!1}_render(e){this._autoResolution&&this._resolution!==e.resolution&&(this._resolution=e.resolution,this.dirty=!0),this.updateText(!0),super._render(e)}_renderCanvas(e){this._autoResolution&&this._resolution!==e.resolution&&(this._resolution=e.resolution,this.dirty=!0),this.updateText(!0),super._renderCanvas(e)}getLocalBounds(e){return this.updateText(!0),super.getLocalBounds(e)}_calculateBounds(){this.updateText(!0),this.calculateVertices(),this._bounds.addQuad(this.vertexData)}_onStyleChange(){this.dirty=!0}destroy(e){var i,s,r,n,o;typeof e=="boolean"&&(e={children:e}),e=Object.assign({},hi.defaultDestroyOptions,e),super.destroy(e);const t=null;this.ownsStyle&&((i=this._style)==null||i.cleanFonts()),this._style=t,(s=this._svgRoot)==null||s.remove(),this._svgRoot=t,(r=this._domElement)==null||r.remove(),this._domElement=t,(n=this._foreignObject)==null||n.remove(),this._foreignObject=t,(o=this._styleElement)==null||o.remove(),this._styleElement=t,this._loadImage.src="",this._loadImage.onload=null,this._loadImage=t,this._image.src="",this._image=t}get width(){return this.updateText(!0),Math.abs(this.scale.x)*this._image.width/this.resolution}set width(e){this.updateText(!0);const t=de(this.scale.x)||1;this.scale.x=t*e/this._image.width/this.resolution,this._width=e}get height(){return this.updateText(!0),Math.abs(this.scale.y)*this._image.height/this.resolution}set height(e){this.updateText(!0);const t=de(this.scale.y)||1;this.scale.y=t*e/this._image.height/this.resolution,this._height=e}get style(){return this._style}set style(e){this._style!==e&&(e=e||{},e instanceof ai?(this.ownsStyle=!1,this._style=e):e instanceof ae?(console.warn("[HTMLText] Cloning TextStyle, if this is not what you want, use HTMLTextStyle"),this.ownsStyle=!0,this._style=ai.from(e)):(this.ownsStyle=!0,this._style=new ai(e)),this.localStyleID=-1,this.dirty=!0)}get text(){return this._text}set text(e){e=String(e===""||e===null||e===void 0?" ":e),e=this.sanitiseText(e),this._text!==e&&(this._text=e,this.dirty=!0)}get resolution(){return this._resolution}set resolution(e){this._autoResolution=!1,this._resolution!==e&&(this._resolution=e,this.dirty=!0)}sanitiseText(e){return e.replace(/

/gi,"
").replace(/
/gi,"
").replace(/ /gi," ")}};let Zi=hi;return Zi.defaultDestroyOptions={texture:!0,children:!1,baseTexture:!0},Zi.defaultMaxWidth=2024,Zi.defaultMaxHeight=2024,Zi.defaultAutoResolution=!0,m.ALPHA_MODES=Nt,m.AbstractMultiResource=dn,m.AccessibilityManager=vn,m.AlphaFilter=Pa,m.AnimatedSprite=qs,m.Application=bn,m.ArrayResource=Aa,m.Assets=Ni,m.AssetsClass=Ja,m.Attribute=gi,m.BLEND_MODES=G,m.BUFFER_BITS=Rt,m.BUFFER_TYPE=jt,m.BackgroundSystem=Ei,m.BaseImageResource=_e,m.BasePrepare=$i,m.BaseRenderTexture=Lr,m.BaseTexture=V,m.BatchDrawCall=ps,m.BatchGeometry=Br,m.BatchRenderer=Gt,m.BatchShaderGenerator=ra,m.BatchSystem=Nr,m.BatchTextureArray=Es,m.BitmapFont=At,m.BitmapFontData=qi,m.BitmapText=Xh,m.BlobResource=ah,m.BlurFilter=Ma,m.BlurFilterPass=Fs,m.Bounds=Ii,m.BrowserAdapter=$n,m.Buffer=ot,m.BufferResource=Ye,m.BufferSystem=ln,m.CLEAR_MODES=$t,m.COLOR_MASK_BITS=Wn,m.Cache=ii,m.CanvasResource=Ra,m.Circle=_s,m.Color=j,m.ColorMatrixFilter=Ns,m.CompressedTextureResource=we,m.Container=Ct,m.ContextSystem=wi,m.CountLimiter=Ph,m.CubeResource=fn,m.DEG_TO_RAD=Wo,m.DRAW_MODES=zt,m.DisplacementFilter=Ba,m.DisplayObject=st,m.ENV=et,m.Ellipse=gs,m.EventBoundary=Na,m.EventSystem=ti,m.ExtensionType=M,m.Extract=Cn,m.FORMATS=C,m.FORMATS_TO_COMPONENTS=uh,m.FXAAFilter=Da,m.FederatedDisplayObject=Oa,m.FederatedEvent=Qe,m.FederatedMouseEvent=Mi,m.FederatedPointerEvent=Xt,m.FederatedWheelEvent=ke,m.FillStyle=Hi,m.Filter=gt,m.FilterState=ha,m.FilterSystem=Xr,m.Framebuffer=ws,m.FramebufferSystem=Vr,m.GC_MODES=es,m.GLFramebuffer=la,m.GLProgram=_a,m.GLTexture=Ms,m.GRAPHICS_CURVES=dd,m.GenerateTextureSystem=Zr,m.Geometry=pe,m.GeometrySystem=Wr,m.Graphics=Xi,m.GraphicsData=Gi,m.GraphicsGeometry=Dn,m.HTMLText=Zi,m.HTMLTextStyle=ai,m.IGLUniformData=Mc,m.INSTALLED=fs,m.INTERNAL_FORMATS=It,m.INTERNAL_FORMAT_TO_BYTES_PER_PIXEL=Li,m.ImageBitmapResource=Ue,m.ImageResource=Or,m.LINE_CAP=Se,m.LINE_JOIN=Vt,m.LineStyle=zs,m.LoaderParserPriority=Jt,m.MASK_TYPES=ct,m.MIPMAP_MODES=Wt,m.MSAA_QUALITY=ht,m.MaskData=da,m.MaskSystem=$r,m.Matrix=tt,m.Mesh=He,m.MeshBatchUvs=Eh,m.MeshGeometry=Vi,m.MeshMaterial=ni,m.MultisampleSystem=hn,m.NineSlicePlane=yd,m.NoiseFilter=Fa,m.ObjectRenderer=bi,m.ObjectRendererSystem=cn,m.ObservablePoint=me,m.PI_2=yi,m.PRECISION=Pt,m.ParticleContainer=bd,m.ParticleRenderer=Ln,m.PlaneGeometry=Ah,m.PluginSystem=qr,m.Point=Y,m.Polygon=Pe,m.Prepare=Gn,m.Program=Ut,m.ProjectionSystem=Kr,m.Quad=aa,m.QuadUv=Gr,m.RAD_TO_DEG=zo,m.RENDERER_TYPE=pt,m.Rectangle=$,m.RenderTexture=be,m.RenderTexturePool=kr,m.RenderTextureSystem=Jr,m.Renderer=Oe,m.ResizePlugin=Tn,m.Resource=je,m.RopeGeometry=Rh,m.RoundedRectangle=ys,m.Runner=Bt,m.SAMPLER_TYPES=ts,m.SCALE_MODES=ee,m.SHAPES=_t,m.SVGResource=Je,m.ScissorSystem=jr,m.Shader=Kt,m.ShaderSystem=Qr,m.SimpleMesh=vd,m.SimplePlane=Ch,m.SimpleRope=xd,m.Sprite=ye,m.SpriteMaskFilter=ua,m.Spritesheet=Zs,m.StartupSystem=Ai,m.State=ne,m.StateSystem=en,m.StencilSystem=Yr,m.SystemManager=Ta,m.TARGETS=Re,m.TEXT_GRADIENT=zi,m.TYPES=k,m.TYPES_TO_BYTES_PER_COMPONENT=Rn,m.TYPES_TO_BYTES_PER_PIXEL=dh,m.TemporaryDisplayObject=Ca,m.Text=Ys,m.TextFormat=Ki,m.TextMetrics=yt,m.TextStyle=ae,m.Texture=B,m.TextureGCSystem=Ht,m.TextureMatrix=Rs,m.TextureSystem=sn,m.TextureUvs=Ur,m.Ticker=lt,m.TickerPlugin=on,m.TilingSprite=Hn,m.TilingSpriteRenderer=Xn,m.TimeLimiter=Ld,m.Transform=vi,m.TransformFeedback=Yc,m.TransformFeedbackSystem=rn,m.UPDATE_PRIORITY=ge,m.UniformGroup=kt,m.VERSION=qc,m.VideoResource=Ds,m.ViewSystem=Ri,m.ViewableBuffer=ds,m.WRAP_MODES=ie,m.XMLFormat=Js,m.XMLStringFormat=Qs,m.accessibleTarget=Ua,m.autoDetectFormat=Lh,m.autoDetectRenderer=wa,m.autoDetectResource=Mr,m.cacheTextureArray=Qa,m.checkDataUrl=ei,m.checkExtension=Ee,m.checkMaxIfStatementsInShader=Xo,m.convertToList=oe,m.copySearchParams=Os,m.createStringVariations=Va,m.createTexture=Di,m.createUBOElements=va,m.curves=Ae,m.defaultFilterVertex=an,m.defaultVertex=Sa,m.detectAvif=th,m.detectCompressedTextures=oh,m.detectDefaults=sh,m.detectWebp=eh,m.extensions=U,m.filters=_n,m.generateProgram=ga,m.generateUniformBufferSync=ba,m.getFontFamilyName=$a,m.getTestContext=Zo,m.getUBOData=xa,m.graphicsUtils=md,m.groupD8=it,m.isMobile=Yt,m.isSingleItem=Bi,m.loadBitmapFont=Vh,m.loadDDS=ph,m.loadImageBitmap=Ka,m.loadJson=za,m.loadKTX=mh,m.loadSVG=Za,m.loadTextures=Fi,m.loadTxt=Wa,m.loadWebFont=ja,m.parseDDS=lh,m.parseKTX=fh,m.resolveCompressedTextureUrl=_h,m.resolveTextureUrl=rh,m.settings=P,m.spritesheetAsset=Nh,m.uniformParsers=Ne,m.unsafeEvalSupported=sa,m.utils=tc,Object.defineProperty(m,"__esModule",{value:!0}),m}({}); -//# sourceMappingURL=pixi.min.js.map diff --git a/.obsidian/plugins/obsidian-webpage-export-master/assets/plugin-styles.txt.css b/.obsidian/plugins/obsidian-webpage-export-master/assets/plugin-styles.txt.css deleted file mode 100644 index 7c2b775e..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/assets/plugin-styles.txt.css +++ /dev/null @@ -1,1316 +0,0 @@ -/*#region Variables */ -body -{ - --color-fade-speed: 0.2s; -} - -/*#endregion */ - -/*#region Tree */ - -/* Base tree */ - -.tree-container -{ - position: relative; - height: 100%; - width: auto; - margin-top: 3em; - margin-bottom: 0; -} - -.tree-container .tree-header -{ - display: flex; - flex-direction: row; - align-items: center; - position: absolute; - top: -3em; -} - -.tree-container .tree-header .sidebar-section-header -{ - margin-block: 1em; - white-space: nowrap; -} - -.tree-container:has(.tree-scroll-area:empty) -{ - display: none; -} - -body .webpage-container .tree-container .tree-scroll-area -{ - width: 100%; - height: 100%; - max-height: 100%; - overflow-y: auto; - border-radius: 0; - position: absolute; - margin: 0; - background-color: transparent; -} - -.tree-container .tree-item -{ - display: flex; - flex-direction: column; - align-items: flex-start; - padding: 0; - padding-block: 1px; - overflow: hidden !important; - flex: none; -} - -.tree-container .tree-item-children -{ - padding: 0; - margin: 0; - border-left: none; - width: 100%; -} - -.tree-item-title > * -{ - padding: 0; - margin: 0; - overflow: hidden; - display: inline; - text-overflow: ellipsis; -} - -.tree-container .tree-item-icon * -{ - color: var(--text-muted); - font-family: emoji; -} - -.tree-container .tree-item-icon :is(svg,img) -{ - -webkit-mask-image-repeat: no-repeat; - -webkit-mask-image-position: center; - max-width: 1.3em; - height: 100%; -} - -/* Skip outer wrappers around icons */ -.tree-container .tree-item-icon *:has(svg) -{ - display: contents !important; -} - -.tree-container .tree-item-icon -{ - min-width: 1.6em; - max-width: 1.6em; - margin-left: 2px; - display: flex; - align-items: center; - justify-content: flex-start; -} - -.tree-container .tree-item.mod-active > .tree-link > .tree-item-contents -{ - color: var(--interactive-accent); -} - -.tree-container .tree-link { - position: relative; - display: flex; - flex-direction: row; - align-items: center; - flex-wrap: wrap; - - border-radius: var(--radius-s); - color: var(--nav-item-color); - text-decoration-line: none; - - width: -webkit-fill-available; - width: -moz-available; - width: fill-available; - - margin-left: var(--tree-horizontal-spacing); -} - -.tree-container .tree-link:active -{ - color: var(--nav-item-color-active); -} - -.tree-container .tree-item-contents -{ - width: 100%; - height: 100%; - margin: 0 !important; - padding: 0 !important; - font-size: unset !important; - padding-left: calc(var(--tree-horizontal-spacing) * 2 + var(--collapse-arrow-size)) !important; - border-radius: var(--radius-s); - - display: flex !important; - flex-direction: row !important; - align-items: center !important; - - color: var(--nav-item-color); - transition: background-color .1s; -} - -.tree-container .tree-item-title { - overflow: hidden; - text-overflow: ellipsis !important; - text-wrap: nowrap !important; - white-space: nowrap !important; - position: relative !important; - border: none !important; - - width: 100%; - width: -webkit-fill-available; - width: -moz-available; - width: fill-available; - - background-color: transparent !important; - padding-top: calc(var(--tree-vertical-spacing)/ 2) !important; - padding-bottom: calc(var(--tree-vertical-spacing)/ 2) !important; - margin: 0 !important; - left: 0 !important; - right: 0 !important; - top: 0 !important; - bottom: 0 !important; -} - -.tree-container .tree-item-title::after -{ - right: 0; - position: absolute !important; - margin-right: 0.5em !important; -} - -/* Find tree contents in folders with no other folders in them */ -.tree-container .mod-tree-folder:not(:has(.mod-tree-folder)) .mod-tree-file > .tree-link > .tree-item-contents -{ - padding-left: calc(var(--tree-horizontal-spacing) * 2) !important; -} - -.tree-container .collapse-icon { - translate: calc(0px - var(--collapse-arrow-size) - var(--tree-horizontal-spacing) * 2) 0; - position: absolute; - height: 100%; - padding: var(--tree-horizontal-spacing); -} - -.tree-container .tree-item.mod-tree-folder > .tree-link > .collapse-icon -{ - width: 100%; -} - -.collapse-icon:hover -{ - color: var(--nav-item-color-hover); -} - -.tree-container .clickable-icon -{ - width: 3.2em; - height: 2.2em; -} - -.tree-container .tree-item.is-collapsed > .tree-link > .tree-item-contents > .collapse-icon > svg -{ - transition: transform 0.1s ease-in-out; - transform: rotate(-90deg); -} - -.tree-container .tree-item-contents:hover -{ - color: var(--nav-item-color-hover); -} - -.filtered-out -{ - display: none !important; -} - -/* Indentation guide */ - -.tree-container > .tree-scroll-area > * .tree-item -{ - margin-left: calc(var(--tree-horizontal-spacing) * 2 + var(--collapse-arrow-size)/2); - -} -.tree-container > .tree-scroll-area > * .tree-item -{ - border-left: var(--nav-indentation-guide-width) solid var(--nav-indentation-guide-color); -} - -.tree-container .tree-scroll-area > * > * > .tree-item -{ - margin-left: calc(var(--tree-horizontal-spacing) + var(--collapse-arrow-size)/2); -} - -.tree-container:not(.mod-nav-indicator) .tree-scroll-area .tree-item -{ - border-color: transparent !important; -} - -.tree-container .tree-item.mod-active -{ - border-color: var(--interactive-accent) !important; - box-shadow: 2px 0px 0px 0px var(--interactive-accent) inset; - transition: box-shadow 0.4s ease-in-out; -} - - -.tree-container .tree-item:hover:not(.mod-active):not(.mod-collapsible):not(:has(.tree-item:hover)):not(.mod-root > * > *) /* Hover */ -{ - border-left: var(--nav-indentation-guide-width) solid var(--nav-item-color-hover); -} - -.tree-container .tree-link:hover, .tree-container .mod-active > .tree-link -{ - background-color: var(--nav-item-background-hover); - cursor: pointer; -} - -.webpage-container .tree-container .tree-item:not(.mod-collapsible) > .tree-item-children > .tree-item > .tree-link, -.webpage-container .tree-container > .tree-scroll-area > .tree-item > .tree-link -{ - margin-left: 0 !important; -} - -/* Special */ - -.tree-container.outline-tree .tree-item[data-depth='1'] > .tree-link > .tree-item-contents -{ - font-weight: 900; - font-size: 1.1em; - margin-left: 0; - padding-left: 1em; -} - -.nav-folder.mod-root .nav-folder>.nav-folder-children -{ - padding: 0 !important; - margin: 0 !important; - border: none !important; -} - -.nav-file -{ - border-radius: 0 !important; -} - -.nav-folder.mod-root .nav-folder > .nav-folder-children -{ - border-radius: var(--radius-s) !important;; -} - -.webpage-container .nav-file-tag -{ - margin-right: 1em; -} - -.nav-file-title-content, .nav-folder-title-content -{ - margin-bottom: unset !important; - display: unset !important; - border-radius: unset !important; - cursor: unset !important; - font-size: unset !important; - font-weight: unset !important; - line-height: unset !important; - padding: unset !important; -} - -/*#endregion */ - -/*#region Headers */ - -#webpage-icon :is(svg, img) -{ - width: 100%; - height: 100%; - box-shadow: none !important; - border: none !important; - border-radius: 0 !important; - stroke: currentColor; -} - -#webpage-icon *:has(:is(svg, img)) -{ - display: contents !important; -} - -#webpage-icon:has(:is(svg, img)) -{ - font-size: 40px; - width: 40px; - height: 40px; -} - -#webpage-icon { - font-size: 40px; - margin-bottom: 8px; - font-family: emoji; - width: fit-content; -} - -body.show-inline-title .page-title -{ - font-weight: var(--inline-title-weight); - font-size: var(--inline-title-size); - font-style: var(--inline-title-style); - font-variant: var(--inline-title-variant); - font-family: var(--inline-title-font); - letter-spacing: -0.015em; - color: var(--inline-title-color); -} - -.heading -{ - position: relative; -} - -.heading-wrapper.is-collapsed > .heading::after -{ - content: "..." !important; - display: inline-block !important; - position: absolute !important; - margin: 0 !important; - padding: 0 !important; - margin-left: 0.3em !important; - color: var(--text-muted); -} - -.heading-wrapper -{ - transition: height ease-in-out, margin-bottom ease-in-out; - transition-duration: 0.2s; - display: flex; - flex-direction: column; - position: relative; -} - -/* high specificity in order to override other style */ -html > body > .webpage-container > .document-container > .markdown-preview-view > .markdown-preview-sizer > div -{ - margin-inline: 0 !important; - margin: 0 !important; - padding: 0 !important; - width: 100%; - max-width: 100%; -} - -.markdown-rendered .heading-wrapper:has(> .heading-children > div:last-child > :is(p,pre,table,ul,ol)) + .heading-wrapper > .heading:first-child -{ - margin-top: var(--heading-spacing); -} - -.heading-children -{ - transition: height ease-in-out, margin-bottom ease-in-out; - transition-duration: 0.2s; - display: flow; - position: relative; - contain: inline-size; -} - -.heading-children.is-collapsed -{ - padding-top: 0em; -} - -.heading-wrapper.is-collapsed > .heading-children, .heading-wrapper.is-animating > .heading-children -{ - overflow: hidden; overflow: clip; -} - -.heading-wrapper > .heading > .heading-after -{ - display: none; -} - -.heading-wrapper.is-collapsed > .heading > .heading-after -{ - display: inline-block; - margin-left: 0.3em; - opacity: 0.4; - font-size: 1em; - cursor: auto; - user-select: none; -} - -.heading-wrapper.is-hidden > * -{ - display: none; -} - -.heading-wrapper.is-hidden -{ - visibility: hidden; -} - -.collapse-icon:not(.list-collapse-indicator) svg.svg-icon { - color: var(--nav-collapse-icon-color); - width: var(--collapse-arrow-size); - height: var(--collapse-arrow-size); - transition: transform 100ms ease-in-out 0s; - stroke-width: 4px; - min-width: 10px; - min-height: 10px; -} - -div.is-collapsed > * > .heading-collapse-indicator.collapse-icon > svg -{ - transition: transform 0.1s ease-in-out; - transform: rotate(-90deg); -} - -.heading-wrapper .heading-collapse-indicator -{ - opacity: 0; - transition: opacity 0.15s ease-in-out; - position: absolute; - z-index: 1; - padding: 0 !important; - padding-left: 40px !important; - padding-right: 40px !important; - left: -40px !important; -} - -.heading:hover > .heading-collapse-indicator, -.heading-wrapper .heading-collapse-indicator:hover -{ - opacity: 1; -} - -.heading-wrapper-span -{ - position: absolute; - width: 200vw; - height: calc(100% + var(--p-spacing) * 2); - top: calc(0px - var(--p-spacing)); - left: -100vw; - z-index: -1; -} - -.markdown-embed .markdown-embed-content .markdown-preview-view .heading-wrapper-span -{ - width: 100%; -} - -/*#endregion */ - -/*#region Theme Toggle */ - -.theme-toggle-container { - --toggle-width: 3.5em; - --toggle-height: 1.75em; - --border-radius: calc(var(--toggle-height) / 2); - --handle-width: calc(var(--toggle-height) * 0.65); - --handle-radius: calc(var(--handle-width) / 2); - --handle-margin: calc((var(--toggle-height) / 2.0) - var(--handle-radius)); - --handle-translation: calc(var(--toggle-width) - var(--handle-width) - (var(--handle-margin) * 2)); - - display: inline-block; - cursor: pointer; -} - -.sidebar-section-header, .clickable-icon -{ - transition: color var(--color-fade-speed) ease-in-out; -} - -/* animation to expand width, move handle, then contract width */ -@keyframes toggle-slide-right -{ - 0% - { - width: var(--handle-width); - transform: translateX(0); - } - 50% - { - width: calc(var(--toggle-width) * 0.5); - } - 90% - { - width: var(--handle-width); - } - 100% - { - transform: translateX(var(--handle-translation)); - } -} - -@keyframes toggle-slide-left -{ - 0% - { - width: var(--handle-width); - transform: translateX(calc(var(--handle-translation) - ((var(--toggle-width) * 0.33) - var(--handle-width)))); - } - 70% - { - width: calc(var(--toggle-width) * 0.5); - } - 100% - { - width: var(--handle-width); - transform: translateX(0); - } -} - -/* just exapnd and contract */ -@keyframes toggle-expand-right -{ - 0% - { - width: var(--handle-width); - } - 100% - { - width: calc(var(--toggle-width) * 0.33); - } -} - -@keyframes toggle-expand-left -{ - 0% - { - width: var(--handle-width); - transform: translateX(var(--handle-translation)); - } - 100% - { - width: calc(var(--toggle-width) * 0.33); - transform: translateX(calc(var(--handle-translation) - ((var(--toggle-width) * 0.33) - var(--handle-width)))); - } -} - -@keyframes toggle-contract -{ - 0% - { - width: calc(var(--toggle-width) * 0.33); - } - 100% - { - width: var(--handle-width); - } -} - -.theme-toggle-input { - display: none; - z-index: 1000; -} - -/* Fill in dark mode / default */ -.toggle-background { - position: relative; - width: var(--toggle-width); - height: var(--toggle-height); - border-radius: var(--border-radius); - background-color: var(--background-modifier-border); - - transition: background-color var(--color-fade-speed); - z-index: 1000; - - animation-duration: 0.2s; -} - -/* Handle default */ -.toggle-background::before -{ - content: ""; - position: absolute; - left: var(--handle-margin); - top: var(--handle-margin); - height: var(--handle-width); - width: var(--handle-width); - - border-radius: var(--handle-radius); - background-color: var(--text-normal); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.2); - animation: toggle-slide-left ease-in-out normal both; - animation-duration: inherit; - z-index: 1000; -} - -/* handle light*/ -.theme-toggle-input:checked ~ .toggle-background::before -{ - animation: toggle-slide-right ease-in-out normal both; - animation-duration: inherit; -} - -.theme-toggle-input:active ~ .toggle-background::before -{ - animation: toggle-expand-right ease-in-out normal both; - animation-duration: inherit; -} - -.theme-toggle-input:active:checked ~ .toggle-background::before -{ - animation: toggle-expand-left ease-in-out normal both; - animation-duration: inherit; -} - -/* sun moon icon icon default */ -.toggle-background::after -{ - content: ""; - position: absolute; - right: var(--handle-margin); - top: calc(var(--handle-margin)); - height: var(--handle-width); - width: var(--handle-width); - transition: transform 0.3s; - background: url('data:image/svg+xml,') - no-repeat center center; - transform: scale(0.9); -} - -/* sun moon icon icon light */ -.theme-toggle-input:checked ~ .toggle-background::after -{ - transform: translateX(calc(var(--handle-translation) * -1)) scale(0.9); - background: url('data:image/svg+xml,') - no-repeat center center; -} - -/*#endregion */ - -/*#region Graph View */ - -.graph-view-wrapper -{ - --graph-view-max-height: 35vh; -} - -#graph-canvas -{ - width: 100%; - height: 100%; - aspect-ratio: 1; - transition: opacity 0.2s ease-in-out; -} - -.graph-view-container.expanded -{ - position: fixed; - width: 90%; - height: 90%; - max-height: unset; - right: 5%; - top: 5%; - background-color: var(--background-secondary); - z-index: 100; -} - -body:is(.is-phone, .is-tablet) .graph-view-container.expanded -{ - width: 95%; - height: 95%; - right: 2.5%; - top: 2.5%; -} - -.graph-view-container -{ - position: relative; - width: 100%; - aspect-ratio: 1; - max-height: var(--graph-view-max-height); - display: flex; - transition: background-color var(--color-fade-speed) ease-in-out; - touch-action: none; - border: 1px solid var(--modal-border-color); - border-radius: var(--modal-radius); - overflow: hidden; -} - -.graph-icon -{ - cursor: pointer; - color: var(--text-muted); -} - -.graph-view-container .graph-icon>svg { - width: 24px; - height: 24px; - - background-color: var(--color-base-00); - outline-width: 6px; - outline-color: var(--color-base-00); - outline-offset: -1px; - outline-style: solid; - border-radius: 100px; - margin: 10px; - - transition: outline-color, background-color; - transition-timing-function: ease-in-out; - transition-duration: var(--color-fade-speed); -} - -.graph-view-placeholder -{ - padding: 0; - width: 100%; - aspect-ratio: 1; - max-height: var(--graph-view-max-height); - position: relative; - flex: none; -} - -.graph-view-placeholder:has(.expanded) -{ - border-radius: var(--modal-radius); - border: 1px solid var(--modal-border-color); -} - -.scale-down -{ - transition: transform 0.2s ease-in-out; - transform: scale(0.9); -} - -.scale-up -{ - transition: transform 0.2s ease-in-out; - transform: scale(1); -} - -.graph-expand -{ - position: absolute; - top: 5px; - right: 5px; -} - - - -/*#endregion */ - -/*#region Canvas */ - -body :is(.canvas-node-container, .canvas-wrapper) -{ - cursor: unset !important; -} - -.canvas -{ - translate: 0 0; - scale: 1 1; - will-change: translate, scale; -} - -.canvas-controls -{ - display: none; - cursor: default !important; -} - -.canvas-card-menu -{ - display: none; - cursor: default !important; -} - -.canvas-node-content-blocker -{ - pointer-events: none; -} - -/*#endregion */ - -/*#region Phone */ - -body.is-phone .sidebar -{ - font-size: 1.15em; - --tree-vertical-spacing: 0.9em; - --sidebar-width: 85vw !important; -} - -body.is-phone -{ - --collapse-arrow-size: 13px; - --tree-vertical-spacing: 0.8em; - --tree-horizontal-spacing: 0.5em; -} - -body.is-phone .heading-wrapper .heading-collapse-indicator -{ - transition: transform 0.2s ease-in-out 0.2s; -} - -/*#endregion */ - -/*#region Loading */ - -.loading-icon -{ - --width: 80px; - --height: 80px; - - display: inline-block; - position: fixed; - left: calc(50% - var(--width) / 2); - top: calc(50% - var(--height) / 2); - width: var(--width); - height: var(--height); - - opacity: 0; - transition: opacity 0.5s ease-in-out; - pointer-events: none; -} - -.loading-icon.show -{ - opacity: 1; -} - -.loading-icon div { - position: absolute; - top: 33px; - width: 13px; - height: 13px; - border-radius: 50%; - background: var(--interactive-accent); - animation-timing-function: cubic-bezier(0, 1, 1, 0); -} - -.loading-icon div:nth-child(1) { - left: 8px; - animation: lds-ellipsis1 0.6s infinite; -} - -.loading-icon div:nth-child(2) { - left: 8px; - animation: lds-ellipsis2 0.6s infinite; -} - -.loading-icon div:nth-child(3) { - left: 32px; - animation: lds-ellipsis2 0.6s infinite; -} - -.loading-icon div:nth-child(4) { - left: 56px; - animation: lds-ellipsis3 0.6s infinite; -} - -.loading-icon:not(.show) div -{ - animation-play-state: paused; -} - -@keyframes lds-ellipsis1 { - 0% { - transform: scale(0); - } - - 100% { - transform: scale(1); - } -} - -@keyframes lds-ellipsis3 { - 0% { - transform: scale(1); - } - - 100% { - transform: scale(0); - } -} - -@keyframes lds-ellipsis2 { - 0% { - transform: translate(0, 0); - } - - 100% { - transform: translate(24px, 0); - } -} - -/*#endregion */ - -/*#region Media Queries */ - -@media print -{ - body .webpage-container .document-container * - { - overflow: visible !important; - overflow-y: visible !important; - overflow-x: visible !important; - } - - html body.publish :is(.sidebar, script, style, include) - { - display: none !important; - } - - :root, html body.publish > :is(.webpage-container, .document-container, .markdown-preview-view):not(script, style, include) - { - display: contents !important; - } - - :root, html body.publish .document-container > .markdown-preview-view - { - background-color: transparent !important; - } - - body - { - display: inline !important; - background: var(--background-primary); - } - - .document-container > .markdown-preview-view > .markdown-preview-sizer - { - padding: 0 !important; - margin: 0 !important; - padding: var(--file-margins) !important; - padding-bottom: 0 !important; - } - - html body.publish :is(.document-container, .markdown-preview-view) - { - margin: 0 !important; - padding: 0 !important; - } - - -} - -/*#endregion */ - -/*#region Search */ - -.tree-hint-label -{ - font-size: var(--font-smallest); - color: var(--text-accent); - width: 100%; - width: -webkit-fill-available; - width: -moz-available; - width: fill-available; - white-space: pre-wrap; - text-decoration-line: none; -} - -.tree-hint-label:hover -{ - text-decoration-line: underline; -} - -.tree-hint-container -{ - width: 100%; - padding-left: calc(var(--tree-horizontal-spacing) * 2 + var(--collapse-arrow-size)); - padding-bottom: calc(var(--tree-vertical-spacing) / 2); - display: flex; - flex-direction: column; -} - -/* find hints inside folders with no other folders in them */ -.tree-container .mod-tree-folder:not(:has(.mod-tree-folder)) .mod-tree-file > .tree-link > .tree-hint-container -{ - padding-left: calc(var(--tree-horizontal-spacing) * 2); -} - -.tree-item-contents:has(.tree-item-icon) + .tree-hint-container -{ - margin-left: calc(1.6em + 2px); -} - -a.tree-hint-label:hover -{ - text-decoration-line: underline; -} - -.search-mark -{ - margin: 0 !important; - padding: 0 !important; - scroll-margin: 2em !important; -} - -.search-input-container:has(+ #search-results) > input[type="search"] -{ - border-bottom-left-radius: 0; - border-bottom-right-radius: 0; -} - -input[type=search] { - box-shadow: none!important; - height: 2.5em; - font-size: 1em; - transition: background, background-color, border; - transition-duration: var(--color-fade-speed); - transition-timing-function: ease-in-out; -} - -.search-input-container -{ - width: 100% !important; -} - -.search-input-container::before -{ - mask-image: url("data:image/svg+xml,"); - mask-repeat: no-repeat; - top: 50%; - transform: translateY(-50%); -} - -/*#endregion */ - -/*#region Sidebar Resize */ - -.sidebar .sidebar-handle:hover ~ .sidebar-content, .sidebar.is-resizing .sidebar-content -{ - box-shadow: 0 0 0 var(--divider-width-hover) var(--divider-color-hover); -} - -.sidebar-handle { - width: min(max(calc(var(--sidebar-margin) / 2.0), 3px), 12px); - height: calc(100vh - 2 * var(--radius-l)); - margin-top: var(--radius-l); - margin-bottom: var(--radius-l); - top: 0; - position: absolute; - cursor: ew-resize; - z-index: 1; - transition: background-color .2s ease-in-out; -} - -.sidebar-left .sidebar-handle { - right: 0; -} - -.sidebar-right .sidebar-handle { - left: 0; -} - - - -/*#endregion */ - -/* Themes */ - -/*#region General */ - -.nav-folder-children .nav-folder-title-content::before -{ - margin-right: 0.5em; -} - -.tree-item::before -{ - margin-left: calc(var(--tree-horizontal-spacing) - 0.3em); -} - -.tree-item-contents:has(.tree-item-icon) .tree-item-title::before, -.tree-item-contents:has(.tree-item-icon)::before, -.tree-item:has(.tree-item-contents > .tree-item-icon)::before -{ - display: none !important; -} - -/*#endregion */ - -/*#region AnuPpuccin */ - -/* AnuPpuccin rainbow indent support */ -.anp-simple-rainbow-color-toggle.anp-simple-rainbow-indentation-toggle .tree-container.file-tree .tree-item -{ - border-color: rgba(var(--rainbow-folder-color), 0.5); -} - -/* AnuPpuccin folder icon support */ -.anp-collapse-folders .tree-container .tree-item .collapse-icon -{ - -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 27 24' fill='none' stroke='currentColor' stroke-linejoin='round' stroke-linecap='round' stroke-width='2'%3E%3Cpath d='M6 14l1.45-2.9A2 2 0 0 1 9.24 10H22a2 2 0 0 1 1.94 2.5l-1.55 6a2 2 0 0 1-1.94 1.5H4a2 2 0 0 1-2-2V5c0-1.1.9-2 2-2h3.93a2 2 0 0 1 1.66.9l.82 1.2a2 2 0 0 0 1.66.9H20a2 2 0 0 1 2 2v2'/%3E%3C/svg%3E%0A"); - mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 27 24' fill='none' stroke='currentColor' stroke-linejoin='round' stroke-linecap='round' stroke-width='2'%3E%3Cpath d='M6 14l1.45-2.9A2 2 0 0 1 9.24 10H22a2 2 0 0 1 1.94 2.5l-1.55 6a2 2 0 0 1-1.94 1.5H4a2 2 0 0 1-2-2V5c0-1.1.9-2 2-2h3.93a2 2 0 0 1 1.66.9l.82 1.2a2 2 0 0 0 1.66.9H20a2 2 0 0 1 2 2v2'/%3E%3C/svg%3E%0A"); - -webkit-mask-repeat: no-repeat; - mask-repeat: no-repeat; - - background-color: currentColor; - display: flex; - flex-basis: 100%; - height: 16px; - width: 17px; -} - -.anp-collapse-folders .tree-container .tree-item.is-collapsed .collapse-icon -{ - -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 27 24' fill='none' stroke='currentColor' stroke-linejoin='round' stroke-linecap='round' stroke-width='2'%3E%3Cpath d='M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2z'/%3E%3Cpath d='M2 10h20' /%3E%3C/svg%3E%0A"); - mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 27 24' fill='none' stroke='currentColor' stroke-linejoin='round' stroke-linecap='round' stroke-width='2'%3E%3Cpath d='M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2z'/%3E%3Cpath d='M2 10h20' /%3E%3C/svg%3E%0A"); -} - -.anp-file-icons .nav-file .nav-file-title::before -{ - -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z'/%3E%3Cpath d='M14 2v6h6'/%3E%3C/svg%3E%0A"); - mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z'/%3E%3Cpath d='M14 2v6h6'/%3E%3C/svg%3E%0A"); - -webkit-mask-repeat: no-repeat; - mask-repeat: no-repeat; - background-color: currentColor; - content: ""; - display: flex; - flex-shrink: 0; - height: var(--size-4-4); - margin-left: calc(-1 * var(--size-4-5)); - opacity: var(--icon-opacity); - position: absolute; - width: var(--size-4-4); -} - -.anp-collapse-folders .tree-container .tree-item .collapse-icon:hover -{ - color: currentColor; -} - -.anp-collapse-folders .tree-container .tree-item .collapse-icon svg -{ - display: none; -} - -/*#endregion */ - -/* Plugins: */ - -/*#region Kanban */ - -.document-container .kanban-plugin -{ - position: absolute; - padding: 0; - margin: 0; - height: 100%; -} - -.document-container .kanban-plugin -{ - font-family: var(--font-text, var(--default-font)); - font-size: .875rem; - line-height: var(--line-height-tight); - width: unset; - overflow-y: unset; - overflow-wrap: unset; - color: unset; - user-select: unset; - -webkit-user-select: unset; -} - -.document-container .kanban-plugin__item-button-wrapper, .kanban-plugin__lane-grip, .kanban-plugin__lane-settings-button.clickable-icon, .kanban-plugin__item-postfix-button.clickable-icon -{ - display: none; -} - -/*#endregion */ - -/*#region Excalidraw */ - -.excalidraw-svg rect, .excalidraw-plugin rect -{ - fill: transparent; -} - -/** Preserve mask fill **/ -.excalidraw-plugin mask rect[fill="#fff"], -.excalidraw-svg mask rect[fill="#fff"], -.excalidraw-plugin mask rect[fill="#ffffff"], -.excalidraw-svg mask rect[fill="#ffffff"]{ - fill: #ffffff; -} -.excalidraw-plugin mask rect[fill="#000"], -.excalidraw-svg mask rect[fill="#000"], -.excalidraw-plugin mask rect[fill="#000000"], -.excalidraw-svg mask rect[fill="#000000"]{ - fill: #000000; -} - -body.theme-dark .excalidraw-svg svg.dark, body.theme-dark .excalidraw-plugin svg.dark, -body.theme-light .excalidraw-svg svg.light, body.theme-light .excalidraw-plugin svg.light -{ - filter: invert(93%) hue-rotate(180deg); -} - - -.excalidraw-plugin > svg -{ - width: 100%; - height: 100%; -} - -.excalidraw-plugin -{ - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - - height: 100%; - width: 100%; - - padding: 10px; -} - -/*#endregion */ - -/*#region Obsidian Columns Plugin */ -.columnParent { - display: flex; - padding: 15px 20px; - flex-wrap: wrap; - gap: 20px; -} - -.columnParent { - white-space: normal; -} - -.columnChild { - flex-grow: 1; - flex-basis: 0px; -} -/*#endregion */ - -/*#region Banners */ - -.obsidian-banner .lock-button -{ - display: none; -} - -.markdown-preview-view:has(.obsidian-banner-wrapper) -{ - padding-top: 0 !important; -} - -/*#endregion */ - -/*#region Mind Map */ - -.view-content:has(.mm-mindmap) -{ - overflow-y: none; -} - -.view-content .mm-mindmap -{ - transform: scale(1); - translate: -4000px -4000px; - top: 70%; - left: 50%; - position: absolute; - overflow: hidden; - width: 100vw; -} - -/*#endregion */ diff --git a/.obsidian/plugins/obsidian-webpage-export-master/assets/theme-load.txt.js b/.obsidian/plugins/obsidian-webpage-export-master/assets/theme-load.txt.js deleted file mode 100644 index 96d7c796..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/assets/theme-load.txt.js +++ /dev/null @@ -1,16 +0,0 @@ -let theme = localStorage.getItem("theme") || (window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light"); -if (theme == "dark") -{ - document.body.classList.add("theme-dark"); - document.body.classList.remove("theme-light"); -} -else -{ - document.body.classList.add("theme-light"); - document.body.classList.remove("theme-dark"); -} - -if (window.innerWidth < 480) document.body.classList.add("is-phone"); -else if (window.innerWidth < 768) document.body.classList.add("is-tablet"); -else if (window.innerWidth < 1024) document.body.classList.add("is-small-screen"); -else document.body.classList.add("is-large-screen"); diff --git a/.obsidian/plugins/obsidian-webpage-export-master/assets/third-party-styles-blacklist.txt b/.obsidian/plugins/obsidian-webpage-export-master/assets/third-party-styles-blacklist.txt deleted file mode 100644 index dd77843d..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/assets/third-party-styles-blacklist.txt +++ /dev/null @@ -1,36 +0,0 @@ -advanced-pdf-export -custom-classes -file-tree-alternative -homepage -OA-file-hider -obsidian-asciimath -obsidian-discordrpc -obsidian-dynamic-background -obsidian-dynamic-toc -obsidian-excel-to-markdown-table -obsidian-full-calendar -obsidian-graphviz -obsidian-latex -obsidian-latex-suite -obsidian-minimal-settings -obsidian-plantuml -obsidian-prozen -obsidian-statusbar-pomo -obsidian-style-settings -obsidian-underline -settings-search -surfing -table-editor-obsidian -text-snippets-obsidian -webpage-html-export -lapel -obsidian-regex-replace -templater-obsidian -editing-toolbar -obsidian-admonition -obsidian-banners -obsidian-charts -obsidian-excalidraw-plugin -obsidian42-brat -obsidian-icon-folder -vscode-editor diff --git a/.obsidian/plugins/obsidian-webpage-export-master/assets/tinycolor.txt.js b/.obsidian/plugins/obsidian-webpage-export-master/assets/tinycolor.txt.js deleted file mode 100644 index f756e663..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/assets/tinycolor.txt.js +++ /dev/null @@ -1 +0,0 @@ -function w3color(t, e) { return this instanceof w3color ? "object" == typeof t ? t : void (this.attachValues(toColorObject(t)), e && (e.style.backgroundColor = this.toRgbString())) : new w3color(t, e) } function toColorObject(t) { var e, r, n, $, a, s, o, f, h, u, l, c = [], b = [], d = []; if (e = (t = w3trim(t.toLowerCase())).substr(0, 1).toUpperCase(), r = t.substr(1), f = 1, "R" != e && "Y" != e && "G" != e && "C" != e && "B" != e && "M" != e && "W" != e || isNaN(r) || (6 != t.length || -1 != t.indexOf(",")) && (t = "ncol(" + t + ")"), 3 == t.length || 6 == t.length || isNaN(t) || (t = "ncol(" + t + ")"), t.indexOf(",") > 0 && -1 == t.indexOf("(") && (t = "ncol(" + t + ")"), "rgb" == t.substr(0, 3) || "hsl" == t.substr(0, 3) || "hwb" == t.substr(0, 3) || "ncol" == t.substr(0, 4) || "cmyk" == t.substr(0, 4)) { if ("ncol" == t.substr(0, 4) ? (4 == t.split(",").length && -1 == t.indexOf("ncola") && (t = t.replace("ncol", "ncola")), n = "ncol", t = t.substr(4)) : "cmyk" == t.substr(0, 4) ? (n = "cmyk", t = t.substr(4)) : (n = t.substr(0, 3), t = t.substr(3)), $ = 3, s = !1, "a" == t.substr(0, 1).toLowerCase() ? ($ = 4, s = !0, t = t.substr(1)) : "cmyk" == n && ($ = 4, 5 == t.split(",").length && ($ = 5, s = !0)), c = (t = (t = t.replace("(", "")).replace(")", "")).split(","), "rgb" == n) { if (c.length != $) return emptyObject(); for (a = 0; a < $; a++) { if (("" == c[a] || " " == c[a]) && (c[a] = "0"), c[a].indexOf("%") > -1 && (c[a] = c[a].replace("%", ""), c[a] = Number(c[a] / 100), a < 3 && (c[a] = Math.round(255 * c[a]))), isNaN(c[a])) return emptyObject(); parseInt(c[a]) > 255 && (c[a] = 255), a < 3 && (c[a] = parseInt(c[a])), 3 == a && Number(c[a]) > 1 && (c[a] = 1) } l = { r: c[0], g: c[1], b: c[2] }, !0 == s && (f = Number(c[3])) } if ("hsl" == n || "hwb" == n || "ncol" == n) { for (; c.length < $;)c.push("0"); for (("hsl" == n || "hwb" == n) && parseInt(c[0]) >= 360 && (c[0] = 0), a = 1; a < $; a++) { if (c[a].indexOf("%") > -1) { if (c[a] = c[a].replace("%", ""), c[a] = Number(c[a]), isNaN(c[a])) return emptyObject(); c[a] = c[a] / 100 } else c[a] = Number(c[a]); Number(c[a]) > 1 && (c[a] = 1), 0 > Number(c[a]) && (c[a] = 0) } "hsl" == n && (l = hslToRgb(c[0], c[1], c[2]), h = Number(c[0]), u = Number(c[1])), "hwb" == n && (l = hwbToRgb(c[0], c[1], c[2])), "ncol" == n && (l = ncolToRgb(c[0], c[1], c[2])), !0 == s && (f = Number(c[3])) } if ("cmyk" == n) { for (; c.length < $;)c.push("0"); for (a = 0; a < $; a++) { if (c[a].indexOf("%") > -1) { if (c[a] = c[a].replace("%", ""), c[a] = Number(c[a]), isNaN(c[a])) return emptyObject(); c[a] = c[a] / 100 } else c[a] = Number(c[a]); Number(c[a]) > 1 && (c[a] = 1), 0 > Number(c[a]) && (c[a] = 0) } l = cmykToRgb(c[0], c[1], c[2], c[3]), !0 == s && (f = Number(c[4])) } } else if ("ncs" == t.substr(0, 3)) l = ncsToRgb(t); else { for (a = 0, o = !1, b = getColorArr("names"); a < b.length; a++)if (t.toLowerCase() == b[a].toLowerCase()) { d = getColorArr("hexs"), o = !0, l = { r: parseInt(d[a].substr(0, 2), 16), g: parseInt(d[a].substr(2, 2), 16), b: parseInt(d[a].substr(4, 2), 16) }; break } if (!1 == o) { for (3 == (t = t.replace("#", "")).length && (t = t.substr(0, 1) + t.substr(0, 1) + t.substr(1, 1) + t.substr(1, 1) + t.substr(2, 1) + t.substr(2, 1)), a = 0; a < t.length; a++)if (!isHex(t.substr(a, 1))) return emptyObject(); for (a = 0, c[0] = parseInt(t.substr(0, 2), 16), c[1] = parseInt(t.substr(2, 2), 16), c[2] = parseInt(t.substr(4, 2), 16); a < 3; a++)if (isNaN(c[a])) return emptyObject(); l = { r: c[0], g: c[1], b: c[2] } } } return colorObject(l, f, h, u) } function colorObject(t, e, r, n) { var $, a, s, o, f, h, u; return t ? (null === e && (e = 1), $ = rgbToHsl(t.r, t.g, t.b), a = rgbToHwb(t.r, t.g, t.b), s = rgbToCmyk(t.r, t.g, t.b), h = r || $.h, u = n || $.s, o = hueToNcol(h), f = roundDecimals(f = { red: t.r, green: t.g, blue: t.b, hue: h, sat: u, lightness: $.l, whiteness: a.w, blackness: a.b, cyan: s.c, magenta: s.m, yellow: s.y, black: s.k, ncol: o, opacity: e, valid: !0 })) : emptyObject() } function emptyObject() { return { red: 0, green: 0, blue: 0, hue: 0, sat: 0, lightness: 0, whiteness: 0, blackness: 0, cyan: 0, magenta: 0, yellow: 0, black: 0, ncol: "R", opacity: 1, valid: !1 } } function getColorArr(t) { return "names" == t ? ["AliceBlue", "AntiqueWhite", "Aqua", "Aquamarine", "Azure", "Beige", "Bisque", "Black", "BlanchedAlmond", "Blue", "BlueViolet", "Brown", "BurlyWood", "CadetBlue", "Chartreuse", "Chocolate", "Coral", "CornflowerBlue", "Cornsilk", "Crimson", "Cyan", "DarkBlue", "DarkCyan", "DarkGoldenRod", "DarkGray", "DarkGrey", "DarkGreen", "DarkKhaki", "DarkMagenta", "DarkOliveGreen", "DarkOrange", "DarkOrchid", "DarkRed", "DarkSalmon", "DarkSeaGreen", "DarkSlateBlue", "DarkSlateGray", "DarkSlateGrey", "DarkTurquoise", "DarkViolet", "DeepPink", "DeepSkyBlue", "DimGray", "DimGrey", "DodgerBlue", "FireBrick", "FloralWhite", "ForestGreen", "Fuchsia", "Gainsboro", "GhostWhite", "Gold", "GoldenRod", "Gray", "Grey", "Green", "GreenYellow", "HoneyDew", "HotPink", "IndianRed", "Indigo", "Ivory", "Khaki", "Lavender", "LavenderBlush", "LawnGreen", "LemonChiffon", "LightBlue", "LightCoral", "LightCyan", "LightGoldenRodYellow", "LightGray", "LightGrey", "LightGreen", "LightPink", "LightSalmon", "LightSeaGreen", "LightSkyBlue", "LightSlateGray", "LightSlateGrey", "LightSteelBlue", "LightYellow", "Lime", "LimeGreen", "Linen", "Magenta", "Maroon", "MediumAquaMarine", "MediumBlue", "MediumOrchid", "MediumPurple", "MediumSeaGreen", "MediumSlateBlue", "MediumSpringGreen", "MediumTurquoise", "MediumVioletRed", "MidnightBlue", "MintCream", "MistyRose", "Moccasin", "NavajoWhite", "Navy", "OldLace", "Olive", "OliveDrab", "Orange", "OrangeRed", "Orchid", "PaleGoldenRod", "PaleGreen", "PaleTurquoise", "PaleVioletRed", "PapayaWhip", "PeachPuff", "Peru", "Pink", "Plum", "PowderBlue", "Purple", "RebeccaPurple", "Red", "RosyBrown", "RoyalBlue", "SaddleBrown", "Salmon", "SandyBrown", "SeaGreen", "SeaShell", "Sienna", "Silver", "SkyBlue", "SlateBlue", "SlateGray", "SlateGrey", "Snow", "SpringGreen", "SteelBlue", "Tan", "Teal", "Thistle", "Tomato", "Turquoise", "Violet", "Wheat", "White", "WhiteSmoke", "Yellow", "YellowGreen"] : "hexs" == t ? ["f0f8ff", "faebd7", "00ffff", "7fffd4", "f0ffff", "f5f5dc", "ffe4c4", "000000", "ffebcd", "0000ff", "8a2be2", "a52a2a", "deb887", "5f9ea0", "7fff00", "d2691e", "ff7f50", "6495ed", "fff8dc", "dc143c", "00ffff", "00008b", "008b8b", "b8860b", "a9a9a9", "a9a9a9", "006400", "bdb76b", "8b008b", "556b2f", "ff8c00", "9932cc", "8b0000", "e9967a", "8fbc8f", "483d8b", "2f4f4f", "2f4f4f", "00ced1", "9400d3", "ff1493", "00bfff", "696969", "696969", "1e90ff", "b22222", "fffaf0", "228b22", "ff00ff", "dcdcdc", "f8f8ff", "ffd700", "daa520", "808080", "808080", "008000", "adff2f", "f0fff0", "ff69b4", "cd5c5c", "4b0082", "fffff0", "f0e68c", "e6e6fa", "fff0f5", "7cfc00", "fffacd", "add8e6", "f08080", "e0ffff", "fafad2", "d3d3d3", "d3d3d3", "90ee90", "ffb6c1", "ffa07a", "20b2aa", "87cefa", "778899", "778899", "b0c4de", "ffffe0", "00ff00", "32cd32", "faf0e6", "ff00ff", "800000", "66cdaa", "0000cd", "ba55d3", "9370db", "3cb371", "7b68ee", "00fa9a", "48d1cc", "c71585", "191970", "f5fffa", "ffe4e1", "ffe4b5", "ffdead", "000080", "fdf5e6", "808000", "6b8e23", "ffa500", "ff4500", "da70d6", "eee8aa", "98fb98", "afeeee", "db7093", "ffefd5", "ffdab9", "cd853f", "ffc0cb", "dda0dd", "b0e0e6", "800080", "663399", "ff0000", "bc8f8f", "4169e1", "8b4513", "fa8072", "f4a460", "2e8b57", "fff5ee", "a0522d", "c0c0c0", "87ceeb", "6a5acd", "708090", "708090", "fffafa", "00ff7f", "4682b4", "d2b48c", "008080", "d8bfd8", "ff6347", "40e0d0", "ee82ee", "f5deb3", "ffffff", "f5f5f5", "ffff00", "9acd32"] : void 0 } function roundDecimals(t) { return t.red = Number(t.red.toFixed(0)), t.green = Number(t.green.toFixed(0)), t.blue = Number(t.blue.toFixed(0)), t.hue = Number(t.hue.toFixed(0)), t.sat = Number(t.sat.toFixed(2)), t.lightness = Number(t.lightness.toFixed(2)), t.whiteness = Number(t.whiteness.toFixed(2)), t.blackness = Number(t.blackness.toFixed(2)), t.cyan = Number(t.cyan.toFixed(2)), t.magenta = Number(t.magenta.toFixed(2)), t.yellow = Number(t.yellow.toFixed(2)), t.black = Number(t.black.toFixed(2)), t.ncol = t.ncol.substr(0, 1) + Math.round(Number(t.ncol.substr(1))), t.opacity = Number(t.opacity.toFixed(2)), t } function hslToRgb(t, e, r) { var n, $, a, s, o; return t /= 60, $ = r <= .5 ? r * (e + 1) : r + e - r * e, a = 255 * hueToRgb(n = 2 * r - $, $, t + 2), { r: a, g: s = 255 * hueToRgb(n, $, t), b: o = 255 * hueToRgb(n, $, t - 2) } } function hueToRgb(t, e, r) { return (r < 0 && (r += 6), r >= 6 && (r -= 6), r < 1) ? (e - t) * r + t : r < 3 ? e : r < 4 ? (e - t) * (4 - r) + t : t } function hwbToRgb(t, e, r) { var n, $, a, s = []; for ($ = hslToRgb(t, 1, .5), s[0] = $.r / 255, s[1] = $.g / 255, s[2] = $.b / 255, (a = e + r) > 1 && (e = Number((e / a).toFixed(2)), r = Number((r / a).toFixed(2))), n = 0; n < 3; n++)s[n] *= 1 - e - r, s[n] += e, s[n] = Number(255 * s[n]); return { r: s[0], g: s[1], b: s[2] } } function cmykToRgb(t, e, r, n) { var $, a, s; return $ = 255 - 255 * Math.min(1, t * (1 - n) + n), { r: $, g: a = 255 - 255 * Math.min(1, e * (1 - n) + n), b: s = 255 - 255 * Math.min(1, r * (1 - n) + n) } } function ncolToRgb(t, e, r) { var n, $, a; if (a = t, isNaN(t.substr(0, 1))) { if (n = t.substr(0, 1).toUpperCase(), "" == ($ = t.substr(1)) && ($ = 0), isNaN($ = Number($))) return !1; "R" == n && (a = 0 + .6 * $), "Y" == n && (a = 60 + .6 * $), "G" == n && (a = 120 + .6 * $), "C" == n && (a = 180 + .6 * $), "B" == n && (a = 240 + .6 * $), "M" == n && (a = 300 + .6 * $), "W" == n && (a = 0, e = 1 - $ / 100, r = $ / 100) } return hwbToRgb(a, e, r) } function hueToNcol(t) { for (; t >= 360;)t -= 360; return t < 60 ? "R" + t / .6 : t < 120 ? "Y" + (t - 60) / .6 : t < 180 ? "G" + (t - 120) / .6 : t < 240 ? "C" + (t - 180) / .6 : t < 300 ? "B" + (t - 240) / .6 : t < 360 ? "M" + (t - 300) / .6 : void 0 } function ncsToRgb(t) { var e, r, n, $, a, s, o, f, h, u, l, c, b, d, g, _, m, p; return -1 == (t = (t = (t = (t = (t = w3trim(t).toUpperCase()).replace("(", "")).replace(")", "")).replace("NCS", "NCS ")).replace(/ /g, " ")).indexOf("NCS") && (t = "NCS " + t), null !== (t = t.match(/^(?:NCS|NCS\sS)\s(\d{2})(\d{2})-(N|[A-Z])(\d{2})?([A-Z])?$/)) && (e = parseInt(t[1], 10), r = parseInt(t[2], 10), ("N" == (n = t[3]) || "Y" == n || "R" == n || "B" == n || "G" == n) && ($ = parseInt(t[4], 10) || 0, "N" !== n ? (a = 1.05 * e - 5.25, s = r, "Y" === n && $ <= 60 ? o = 1 : "Y" === n && $ > 60 || "R" === n && $ <= 80 ? o = (Math.sqrt(14884 - Math.pow(f = "Y" === n ? $ - 60 : $ + 40, 2)) - 22) / 100 : "R" === n && $ > 80 || "B" === n ? o = 0 : "G" === n && (o = (Math.sqrt(33800 - Math.pow(f = $ - 170, 2)) - 70) / 100), "Y" === n && $ <= 80 ? h = 0 : "Y" === n && $ > 80 || "R" === n && $ <= 60 ? h = (104 - Math.sqrt(11236 - Math.pow(f = "Y" === n ? $ - 80 + 20.5 : $ + 20 + 20.5, 2))) / 100 : "R" === n && $ > 60 || "B" === n && $ <= 80 ? h = (Math.sqrt(1e4 - Math.pow(f = "R" === n ? $ - 60 - 60 : $ + 40 - 60, 2)) - 10) / 100 : "B" === n && $ > 80 || "G" === n && $ <= 40 ? h = (122 - Math.sqrt(19881 - Math.pow(f = "B" === n ? $ - 80 - 131 : $ + 20 - 131, 2))) / 100 : "G" === n && $ > 40 && (h = 0), "Y" === n ? green1 = (85 - .85 * $) / 100 : "R" === n && $ <= 60 ? green1 = 0 : "R" === n && $ > 60 ? green1 = (67.5 - Math.sqrt(5776 - Math.pow(f = $ - 60 + 35, 2))) / 100 : "B" === n && $ <= 60 ? green1 = (6.5 + Math.sqrt(7044.5 - Math.pow(f = 1 * $ - 68.5, 2))) / 100 : "B" === n && $ > 60 || "G" === n && $ <= 60 ? green1 = .9 : "G" === n && $ > 60 && (green1 = (90 - 1 / 8 * (f = $ - 60)) / 100), u = ((f = (o + green1 + h) / 3) - o) * (100 - s) / 100 + o, l = (f - green1) * (100 - s) / 100 + green1, c = (f - h) * (100 - s) / 100 + h, d = 1 / (b = u > l && u > c ? u : l > u && l > c ? l : c > u && c > l ? c : (u + l + c) / 3), _ = parseInt(u * d * (100 - a) / 100 * 255, 10), m = parseInt(l * d * (100 - a) / 100 * 255, 10), p = parseInt(c * d * (100 - a) / 100 * 255, 10), _ > 255 && (_ = 255), m > 255 && (m = 255), p > 255 && (p = 255), _ < 0 && (_ = 0), m < 0 && (m = 0), p < 0 && (p = 0)) : ((g = parseInt((1 - e / 100) * 255, 10)) > 255 && (g = 255), g < 0 && (g = 0), _ = g, m = g, p = g), { r: _, g: m, b: p })) } function rgbToHsl(t, e, r) { var n, $, a, s, o, f, h, u = []; for (a = 0, u[0] = t / 255, u[1] = e / 255, u[2] = r / 255, n = u[0], $ = u[0], f = 0; a < u.length - 1; a++)u[a + 1] <= n && (n = u[a + 1]), u[a + 1] >= $ && ($ = u[a + 1], f = a + 1); return 0 == f && (h = (u[1] - u[2]) / ($ - n)), 1 == f && (h = 2 + (u[2] - u[0]) / ($ - n)), 2 == f && (h = 4 + (u[0] - u[1]) / ($ - n)), isNaN(h) && (h = 0), (h *= 60) < 0 && (h += 360), s = (n + $) / 2, { h: h, s: o = n == $ ? 0 : s < .5 ? ($ - n) / ($ + n) : ($ - n) / (2 - $ - n), l: s } } function rgbToHwb(t, e, r) { var n, $, a; return t /= 255, e /= 255, r /= 255, n = 0 == (chroma = (max = Math.max(t, e, r)) - (min = Math.min(t, e, r))) ? 0 : t == max ? (e - r) / chroma % 6 * 360 : e == max ? ((r - t) / chroma + 2) % 6 * 360 : ((t - e) / chroma + 4) % 6 * 360, { h: n, w: $ = min, b: a = 1 - max } } function rgbToCmyk(t, e, r) { var n, $, a, s; return t /= 255, e /= 255, r /= 255, 1 == (s = 1 - (max = Math.max(t, e, r))) ? (n = 0, $ = 0, a = 0) : (n = (1 - t - s) / (1 - s), $ = (1 - e - s) / (1 - s), a = (1 - r - s) / (1 - s)), { c: n, m: $, y: a, k: s } } function toHex(t) { for (var e = t.toString(16); e.length < 2;)e = "0" + e; return e } function cl(t) { console.log(t) } function w3trim(t) { return t.replace(/^\s+|\s+$/g, "") } function isHex(t) { return "0123456789ABCDEFabcdef".indexOf(t) > -1 } function w3SetColorsByAttribute() { var t, e, r; for (e = 0, t = document.getElementsByTagName("*"); e < t.length; e++)(r = t[e].getAttribute("data-w3-color")) && (t[e].style.backgroundColor = w3color(r).toRgbString()) } !function (t, e) { "object" == typeof exports && "undefined" != typeof module ? module.exports = e() : "function" == typeof define && define.amd ? define(e) : (t = "undefined" != typeof globalThis ? globalThis : t || self).tinycolor = e() }(this, function () { "use strict"; function t(e) { return (t = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t })(e) } var e = /^\s+/, r = /\s+$/; function n($, a) { if (a = a || {}, ($ = $ || "") instanceof n) return $; if (!(this instanceof n)) return new n($, a); var s, o, f, h, u, l, c, b, d, g, _, m, p, y, v, S, R, H, B, T, O, L, M, q = (s = $, o = { r: 0, g: 0, b: 0 }, f = 1, h = null, u = null, l = null, c = !1, b = !1, "string" == typeof s && (s = function t(n) { n = n.replace(e, "").replace(r, "").toLowerCase(); var $, a = !1; if (k[n]) n = k[n], a = !0; else if ("transparent" == n) return { r: 0, g: 0, b: 0, a: 0, format: "name" }; return ($ = F.rgb.exec(n)) ? { r: $[1], g: $[2], b: $[3] } : ($ = F.rgba.exec(n)) ? { r: $[1], g: $[2], b: $[3], a: $[4] } : ($ = F.hsl.exec(n)) ? { h: $[1], s: $[2], l: $[3] } : ($ = F.hsla.exec(n)) ? { h: $[1], s: $[2], l: $[3], a: $[4] } : ($ = F.hsv.exec(n)) ? { h: $[1], s: $[2], v: $[3] } : ($ = F.hsva.exec(n)) ? { h: $[1], s: $[2], v: $[3], a: $[4] } : ($ = F.hex8.exec(n)) ? { r: A($[1]), g: A($[2]), b: A($[3]), a: G($[4]), format: a ? "name" : "hex8" } : ($ = F.hex6.exec(n)) ? { r: A($[1]), g: A($[2]), b: A($[3]), format: a ? "name" : "hex" } : ($ = F.hex4.exec(n)) ? { r: A($[1] + "" + $[1]), g: A($[2] + "" + $[2]), b: A($[3] + "" + $[3]), a: G($[4] + "" + $[4]), format: a ? "name" : "hex8" } : !!($ = F.hex3.exec(n)) && { r: A($[1] + "" + $[1]), g: A($[2] + "" + $[2]), b: A($[3] + "" + $[3]), format: a ? "name" : "hex" } }(s)), "object" == t(s) && (D(s.r) && D(s.g) && D(s.b) ? (o = (d = s.r, g = s.g, _ = s.b, { r: 255 * x(d, 255), g: 255 * x(g, 255), b: 255 * x(_, 255) }), c = !0, b = "%" === String(s.r).substr(-1) ? "prgb" : "rgb") : D(s.h) && D(s.s) && D(s.v) ? (h = C(s.s), u = C(s.v), o = (m = s.h, p = h, y = u, m = 6 * x(m, 360), p = x(p, 100), y = x(y, 100), v = Math.floor(m), S = m - v, R = y * (1 - p), H = y * (1 - S * p), B = y * (1 - (1 - S) * p), T = v % 6, O = [y, H, R, R, B, y][T], L = [B, y, y, H, R, R][T], M = [R, R, B, y, y, H][T], { r: 255 * O, g: 255 * L, b: 255 * M }), c = !0, b = "hsv") : D(s.h) && D(s.s) && D(s.l) && (h = C(s.s), l = C(s.l), o = function t(e, r, n) { var $, a, s; function o(t, e, r) { return (r < 0 && (r += 1), r > 1 && (r -= 1), r < 1 / 6) ? t + (e - t) * 6 * r : r < .5 ? e : r < 2 / 3 ? t + (e - t) * (2 / 3 - r) * 6 : t } if (e = x(e, 360), r = x(r, 100), n = x(n, 100), 0 === r) $ = a = s = n; else { var f = n < .5 ? n * (1 + r) : n + r - n * r, h = 2 * n - f; $ = o(h, f, e + 1 / 3), a = o(h, f, e), s = o(h, f, e - 1 / 3) } return { r: 255 * $, g: 255 * a, b: 255 * s } }(s.h, h, l), c = !0, b = "hsl"), s.hasOwnProperty("a") && (f = s.a)), f = w(f), { ok: c, format: s.format || b, r: Math.min(255, Math.max(o.r, 0)), g: Math.min(255, Math.max(o.g, 0)), b: Math.min(255, Math.max(o.b, 0)), a: f }); this._originalInput = $, this._r = q.r, this._g = q.g, this._b = q.b, this._a = q.a, this._roundA = Math.round(100 * this._a) / 100, this._format = a.format || q.format, this._gradientType = a.gradientType, this._r < 1 && (this._r = Math.round(this._r)), this._g < 1 && (this._g = Math.round(this._g)), this._b < 1 && (this._b = Math.round(this._b)), this._ok = q.ok } function $(t, e, r) { t = x(t, 255), e = x(e, 255), r = x(r, 255); var n, $, a = Math.max(t, e, r), s = Math.min(t, e, r), o = (a + s) / 2; if (a == s) n = $ = 0; else { var f = a - s; switch ($ = o > .5 ? f / (2 - a - s) : f / (a + s), a) { case t: n = (e - r) / f + (e < r ? 6 : 0); break; case e: n = (r - t) / f + 2; break; case r: n = (t - e) / f + 4 }n /= 6 } return { h: n, s: $, l: o } } function a(t, e, r) { t = x(t, 255), e = x(e, 255), r = x(r, 255); var n, $, a = Math.max(t, e, r), s = Math.min(t, e, r), o = a - s; if ($ = 0 === a ? 0 : o / a, a == s) n = 0; else { switch (a) { case t: n = (e - r) / o + (e < r ? 6 : 0); break; case e: n = (r - t) / o + 2; break; case r: n = (t - e) / o + 4 }n /= 6 } return { h: n, s: $, v: a } } function s(t, e, r, n) { var $ = [R(Math.round(t).toString(16)), R(Math.round(e).toString(16)), R(Math.round(r).toString(16))]; return n && $[0].charAt(0) == $[0].charAt(1) && $[1].charAt(0) == $[1].charAt(1) && $[2].charAt(0) == $[2].charAt(1) ? $[0].charAt(0) + $[1].charAt(0) + $[2].charAt(0) : $.join("") } function o(t, e, r, n) { return [R(H(n)), R(Math.round(t).toString(16)), R(Math.round(e).toString(16)), R(Math.round(r).toString(16))].join("") } function f(t, e) { e = 0 === e ? 0 : e || 10; var r = n(t).toHsl(); return r.s -= e / 100, r.s = S(r.s), n(r) } function h(t, e) { e = 0 === e ? 0 : e || 10; var r = n(t).toHsl(); return r.s += e / 100, r.s = S(r.s), n(r) } function u(t) { return n(t).desaturate(100) } function l(t, e) { e = 0 === e ? 0 : e || 10; var r = n(t).toHsl(); return r.l += e / 100, r.l = S(r.l), n(r) } function c(t, e) { e = 0 === e ? 0 : e || 10; var r = n(t).toRgb(); return r.r = Math.max(0, Math.min(255, r.r - Math.round(-(255 * (e / 100))))), r.g = Math.max(0, Math.min(255, r.g - Math.round(-(255 * (e / 100))))), r.b = Math.max(0, Math.min(255, r.b - Math.round(-(255 * (e / 100))))), n(r) } function b(t, e) { e = 0 === e ? 0 : e || 10; var r = n(t).toHsl(); return r.l -= e / 100, r.l = S(r.l), n(r) } function d(t, e) { var r = n(t).toHsl(), $ = (r.h + e) % 360; return r.h = $ < 0 ? 360 + $ : $, n(r) } function g(t) { var e = n(t).toHsl(); return e.h = (e.h + 180) % 360, n(e) } function _(t, e) { if (isNaN(e) || e <= 0) throw Error("Argument to polyad must be a positive number"); for (var r = n(t).toHsl(), $ = [n(t)], a = 360 / e, s = 1; s < e; s++)$.push(n({ h: (r.h + s * a) % 360, s: r.s, l: r.l })); return $ } function m(t) { var e = n(t).toHsl(), r = e.h; return [n(t), n({ h: (r + 72) % 360, s: e.s, l: e.l }), n({ h: (r + 216) % 360, s: e.s, l: e.l })] } function p(t, e, r) { e = e || 6, r = r || 30; var $ = n(t).toHsl(), a = 360 / r, s = [n(t)]; for ($.h = ($.h - (a * e >> 1) + 720) % 360; --e;)$.h = ($.h + a) % 360, s.push(n($)); return s } function y(t, e) { e = e || 6; for (var r = n(t).toHsv(), $ = r.h, a = r.s, s = r.v, o = [], f = 1 / e; e--;)o.push(n({ h: $, s: a, v: s })), s = (s + f) % 1; return o } n.prototype = { isDark: function t() { return 128 > this.getBrightness() }, isLight: function t() { return !this.isDark() }, isValid: function t() { return this._ok }, getOriginalInput: function t() { return this._originalInput }, getFormat: function t() { return this._format }, getAlpha: function t() { return this._a }, getBrightness: function t() { var e = this.toRgb(); return (299 * e.r + 587 * e.g + 114 * e.b) / 1e3 }, getLuminance: function t() { var e, r, n, $, a, s, o = this.toRgb(); return e = o.r / 255, r = o.g / 255, n = o.b / 255, $ = e <= .03928 ? e / 12.92 : Math.pow((e + .055) / 1.055, 2.4), .2126 * $ + .7152 * (a = r <= .03928 ? r / 12.92 : Math.pow((r + .055) / 1.055, 2.4)) + .0722 * (s = n <= .03928 ? n / 12.92 : Math.pow((n + .055) / 1.055, 2.4)) }, setAlpha: function t(e) { return this._a = w(e), this._roundA = Math.round(100 * this._a) / 100, this }, toHsv: function t() { var e = a(this._r, this._g, this._b); return { h: 360 * e.h, s: e.s, v: e.v, a: this._a } }, toHsvString: function t() { var e = a(this._r, this._g, this._b), r = Math.round(360 * e.h), n = Math.round(100 * e.s), $ = Math.round(100 * e.v); return 1 == this._a ? "hsv(" + r + ", " + n + "%, " + $ + "%)" : "hsva(" + r + ", " + n + "%, " + $ + "%, " + this._roundA + ")" }, toHsl: function t() { var e = $(this._r, this._g, this._b); return { h: 360 * e.h, s: e.s, l: e.l, a: this._a } }, toHslString: function t() { var e = $(this._r, this._g, this._b), r = Math.round(360 * e.h), n = Math.round(100 * e.s), a = Math.round(100 * e.l); return 1 == this._a ? "hsl(" + r + ", " + n + "%, " + a + "%)" : "hsla(" + r + ", " + n + "%, " + a + "%, " + this._roundA + ")" }, toHex: function t(e) { return s(this._r, this._g, this._b, e) }, toHexString: function t(e) { return "#" + this.toHex(e) }, toHexNumber: function t() { return Number("0x" + this.toHex()) }, toHex8: function t(e) { var r, n, $, a, s, o; return r = this._r, n = this._g, $ = this._b, a = this._a, s = e, o = [R(Math.round(r).toString(16)), R(Math.round(n).toString(16)), R(Math.round($).toString(16)), R(H(a))], s && o[0].charAt(0) == o[0].charAt(1) && o[1].charAt(0) == o[1].charAt(1) && o[2].charAt(0) == o[2].charAt(1) && o[3].charAt(0) == o[3].charAt(1) ? o[0].charAt(0) + o[1].charAt(0) + o[2].charAt(0) + o[3].charAt(0) : o.join("") }, toHex8String: function t(e) { return "#" + this.toHex8(e) }, toRgb: function t() { return { r: Math.round(this._r), g: Math.round(this._g), b: Math.round(this._b), a: this._a } }, toRgbString: function t() { return 1 == this._a ? "rgb(" + Math.round(this._r) + ", " + Math.round(this._g) + ", " + Math.round(this._b) + ")" : "rgba(" + Math.round(this._r) + ", " + Math.round(this._g) + ", " + Math.round(this._b) + ", " + this._roundA + ")" }, toPercentageRgb: function t() { return { r: Math.round(100 * x(this._r, 255)) + "%", g: Math.round(100 * x(this._g, 255)) + "%", b: Math.round(100 * x(this._b, 255)) + "%", a: this._a } }, toPercentageRgbString: function t() { return 1 == this._a ? "rgb(" + Math.round(100 * x(this._r, 255)) + "%, " + Math.round(100 * x(this._g, 255)) + "%, " + Math.round(100 * x(this._b, 255)) + "%)" : "rgba(" + Math.round(100 * x(this._r, 255)) + "%, " + Math.round(100 * x(this._g, 255)) + "%, " + Math.round(100 * x(this._b, 255)) + "%, " + this._roundA + ")" }, toName: function t() { return 0 === this._a ? "transparent" : !(this._a < 1) && !!v[s(this._r, this._g, this._b, !0)] }, toFilter: function t(e) { var r = "#" + o(this._r, this._g, this._b, this._a), $ = r, a = this._gradientType ? "GradientType = 1, " : ""; if (e) { var s = n(e); $ = "#" + o(s._r, s._g, s._b, s._a) } return "progid:DXImageTransform.Microsoft.gradient(" + a + "startColorstr=" + r + ",endColorstr=" + $ + ")" }, toString: function t(e) { var r = !!e; e = e || this._format; var n = !1, $ = this._a < 1 && this._a >= 0; return !r && $ && ("hex" === e || "hex6" === e || "hex3" === e || "hex4" === e || "hex8" === e || "name" === e) ? "name" === e && 0 === this._a ? this.toName() : this.toRgbString() : ("rgb" === e && (n = this.toRgbString()), "prgb" === e && (n = this.toPercentageRgbString()), ("hex" === e || "hex6" === e) && (n = this.toHexString()), "hex3" === e && (n = this.toHexString(!0)), "hex4" === e && (n = this.toHex8String(!0)), "hex8" === e && (n = this.toHex8String()), "name" === e && (n = this.toName()), "hsl" === e && (n = this.toHslString()), "hsv" === e && (n = this.toHsvString()), n || this.toHexString()) }, clone: function t() { return n(this.toString()) }, _applyModification: function t(e, r) { var n = e.apply(null, [this].concat([].slice.call(r))); return this._r = n._r, this._g = n._g, this._b = n._b, this.setAlpha(n._a), this }, lighten: function t() { return this._applyModification(l, arguments) }, brighten: function t() { return this._applyModification(c, arguments) }, darken: function t() { return this._applyModification(b, arguments) }, desaturate: function t() { return this._applyModification(f, arguments) }, saturate: function t() { return this._applyModification(h, arguments) }, greyscale: function t() { return this._applyModification(u, arguments) }, spin: function t() { return this._applyModification(d, arguments) }, _applyCombination: function t(e, r) { return e.apply(null, [this].concat([].slice.call(r))) }, analogous: function t() { return this._applyCombination(p, arguments) }, complement: function t() { return this._applyCombination(g, arguments) }, monochromatic: function t() { return this._applyCombination(y, arguments) }, splitcomplement: function t() { return this._applyCombination(m, arguments) }, triad: function t() { return this._applyCombination(_, [3]) }, tetrad: function t() { return this._applyCombination(_, [4]) } }, n.fromRatio = function (e, r) { if ("object" == t(e)) { var $ = {}; for (var a in e) e.hasOwnProperty(a) && ("a" === a ? $[a] = e[a] : $[a] = C(e[a])); e = $ } return n(e, r) }, n.equals = function (t, e) { return !!t && !!e && n(t).toRgbString() == n(e).toRgbString() }, n.random = function () { return n.fromRatio({ r: Math.random(), g: Math.random(), b: Math.random() }) }, n.mix = function (t, e, r) { r = 0 === r ? 0 : r || 50; var $ = n(t).toRgb(), a = n(e).toRgb(), s = r / 100; return n({ r: (a.r - $.r) * s + $.r, g: (a.g - $.g) * s + $.g, b: (a.b - $.b) * s + $.b, a: (a.a - $.a) * s + $.a }) }, n.readability = function (t, e) { var r = n(t), $ = n(e); return (Math.max(r.getLuminance(), $.getLuminance()) + .05) / (Math.min(r.getLuminance(), $.getLuminance()) + .05) }, n.isReadable = function (t, e, r) { var $, a, s, o, f, h = n.readability(t, e); switch (a = !1, ($ = (s = r, o = ((s = s || { level: "AA", size: "small" }).level || "AA").toUpperCase(), f = (s.size || "small").toLowerCase(), "AA" !== o && "AAA" !== o && (o = "AA"), "small" !== f && "large" !== f && (f = "small"), { level: o, size: f })).level + $.size) { case "AAsmall": case "AAAlarge": a = h >= 4.5; break; case "AAlarge": a = h >= 3; break; case "AAAsmall": a = h >= 7 }return a }, n.mostReadable = function (t, e, r) { var $, a, s, o, f = null, h = 0; a = (r = r || {}).includeFallbackColors, s = r.level, o = r.size; for (var u = 0; u < e.length; u++)($ = n.readability(t, e[u])) > h && (h = $, f = n(e[u])); return n.isReadable(t, f, { level: s, size: o }) || !a ? f : (r.includeFallbackColors = !1, n.mostReadable(t, ["#fff", "#000"], r)) }; var k = n.names = { aliceblue: "f0f8ff", antiquewhite: "faebd7", aqua: "0ff", aquamarine: "7fffd4", azure: "f0ffff", beige: "f5f5dc", bisque: "ffe4c4", black: "000", blanchedalmond: "ffebcd", blue: "00f", blueviolet: "8a2be2", brown: "a52a2a", burlywood: "deb887", burntsienna: "ea7e5d", cadetblue: "5f9ea0", chartreuse: "7fff00", chocolate: "d2691e", coral: "ff7f50", cornflowerblue: "6495ed", cornsilk: "fff8dc", crimson: "dc143c", cyan: "0ff", darkblue: "00008b", darkcyan: "008b8b", darkgoldenrod: "b8860b", darkgray: "a9a9a9", darkgreen: "006400", darkgrey: "a9a9a9", darkkhaki: "bdb76b", darkmagenta: "8b008b", darkolivegreen: "556b2f", darkorange: "ff8c00", darkorchid: "9932cc", darkred: "8b0000", darksalmon: "e9967a", darkseagreen: "8fbc8f", darkslateblue: "483d8b", darkslategray: "2f4f4f", darkslategrey: "2f4f4f", darkturquoise: "00ced1", darkviolet: "9400d3", deeppink: "ff1493", deepskyblue: "00bfff", dimgray: "696969", dimgrey: "696969", dodgerblue: "1e90ff", firebrick: "b22222", floralwhite: "fffaf0", forestgreen: "228b22", fuchsia: "f0f", gainsboro: "dcdcdc", ghostwhite: "f8f8ff", gold: "ffd700", goldenrod: "daa520", gray: "808080", green: "008000", greenyellow: "adff2f", grey: "808080", honeydew: "f0fff0", hotpink: "ff69b4", indianred: "cd5c5c", indigo: "4b0082", ivory: "fffff0", khaki: "f0e68c", lavender: "e6e6fa", lavenderblush: "fff0f5", lawngreen: "7cfc00", lemonchiffon: "fffacd", lightblue: "add8e6", lightcoral: "f08080", lightcyan: "e0ffff", lightgoldenrodyellow: "fafad2", lightgray: "d3d3d3", lightgreen: "90ee90", lightgrey: "d3d3d3", lightpink: "ffb6c1", lightsalmon: "ffa07a", lightseagreen: "20b2aa", lightskyblue: "87cefa", lightslategray: "789", lightslategrey: "789", lightsteelblue: "b0c4de", lightyellow: "ffffe0", lime: "0f0", limegreen: "32cd32", linen: "faf0e6", magenta: "f0f", maroon: "800000", mediumaquamarine: "66cdaa", mediumblue: "0000cd", mediumorchid: "ba55d3", mediumpurple: "9370db", mediumseagreen: "3cb371", mediumslateblue: "7b68ee", mediumspringgreen: "00fa9a", mediumturquoise: "48d1cc", mediumvioletred: "c71585", midnightblue: "191970", mintcream: "f5fffa", mistyrose: "ffe4e1", moccasin: "ffe4b5", navajowhite: "ffdead", navy: "000080", oldlace: "fdf5e6", olive: "808000", olivedrab: "6b8e23", orange: "ffa500", orangered: "ff4500", orchid: "da70d6", palegoldenrod: "eee8aa", palegreen: "98fb98", paleturquoise: "afeeee", palevioletred: "db7093", papayawhip: "ffefd5", peachpuff: "ffdab9", peru: "cd853f", pink: "ffc0cb", plum: "dda0dd", powderblue: "b0e0e6", purple: "800080", rebeccapurple: "663399", red: "f00", rosybrown: "bc8f8f", royalblue: "4169e1", saddlebrown: "8b4513", salmon: "fa8072", sandybrown: "f4a460", seagreen: "2e8b57", seashell: "fff5ee", sienna: "a0522d", silver: "c0c0c0", skyblue: "87ceeb", slateblue: "6a5acd", slategray: "708090", slategrey: "708090", snow: "fffafa", springgreen: "00ff7f", steelblue: "4682b4", tan: "d2b48c", teal: "008080", thistle: "d8bfd8", tomato: "ff6347", turquoise: "40e0d0", violet: "ee82ee", wheat: "f5deb3", white: "fff", whitesmoke: "f5f5f5", yellow: "ff0", yellowgreen: "9acd32" }, v = n.hexNames = function t(e) { var r = {}; for (var n in e) e.hasOwnProperty(n) && (r[e[n]] = n); return r }(k); function w(t) { return (isNaN(t = parseFloat(t)) || t < 0 || t > 1) && (t = 1), t } function x(t, e) { r = t, "string" == typeof r && -1 != r.indexOf(".") && 1 === parseFloat(r) && (t = "100%"); var r, n, $ = (n = t, "string" == typeof n && -1 != n.indexOf("%")); return (t = Math.min(e, Math.max(0, parseFloat(t))), $ && (t = parseInt(t * e, 10) / 100), 1e-6 > Math.abs(t - e)) ? 1 : t % e / parseFloat(e) } function S(t) { return Math.min(1, Math.max(0, t)) } function A(t) { return parseInt(t, 16) } function R(t) { return 1 == t.length ? "0" + t : "" + t } function C(t) { return t <= 1 && (t = 100 * t + "%"), t } function H(t) { return Math.round(255 * parseFloat(t)).toString(16) } function G(t) { return A(t) / 255 } var B, T, O, F = (T = "[\\s|\\(]+(" + (B = "(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)") + ")[,|\\s]+(" + B + ")[,|\\s]+(" + B + ")\\s*\\)?", O = "[\\s|\\(]+(" + B + ")[,|\\s]+(" + B + ")[,|\\s]+(" + B + ")[,|\\s]+(" + B + ")\\s*\\)?", { CSS_UNIT: RegExp(B), rgb: RegExp("rgb" + T), rgba: RegExp("rgba" + O), hsl: RegExp("hsl" + T), hsla: RegExp("hsla" + O), hsv: RegExp("hsv" + T), hsva: RegExp("hsva" + O), hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/, hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/ }); function D(t) { return !!F.CSS_UNIT.exec(t) } return n }), w3color.prototype = { toRgbString: function () { return "rgb(" + this.red + ", " + this.green + ", " + this.blue + ")" }, toRgbaString: function () { return "rgba(" + this.red + ", " + this.green + ", " + this.blue + ", " + this.opacity + ")" }, toHwbString: function () { return "hwb(" + this.hue + ", " + Math.round(100 * this.whiteness) + "%, " + Math.round(100 * this.blackness) + "%)" }, toHwbStringDecimal: function () { return "hwb(" + this.hue + ", " + this.whiteness + ", " + this.blackness + ")" }, toHwbaString: function () { return "hwba(" + this.hue + ", " + Math.round(100 * this.whiteness) + "%, " + Math.round(100 * this.blackness) + "%, " + this.opacity + ")" }, toHslString: function () { return "hsl(" + this.hue + ", " + Math.round(100 * this.sat) + "%, " + Math.round(100 * this.lightness) + "%)" }, toHslStringDecimal: function () { return "hsl(" + this.hue + ", " + this.sat + ", " + this.lightness + ")" }, toHslaString: function () { return "hsla(" + this.hue + ", " + Math.round(100 * this.sat) + "%, " + Math.round(100 * this.lightness) + "%, " + this.opacity + ")" }, toCmykString: function () { return "cmyk(" + Math.round(100 * this.cyan) + "%, " + Math.round(100 * this.magenta) + "%, " + Math.round(100 * this.yellow) + "%, " + Math.round(100 * this.black) + "%)" }, toCmykStringDecimal: function () { return "cmyk(" + this.cyan + ", " + this.magenta + ", " + this.yellow + ", " + this.black + ")" }, toNcolString: function () { return this.ncol + ", " + Math.round(100 * this.whiteness) + "%, " + Math.round(100 * this.blackness) + "%" }, toNcolStringDecimal: function () { return this.ncol + ", " + this.whiteness + ", " + this.blackness }, toNcolaString: function () { return this.ncol + ", " + Math.round(100 * this.whiteness) + "%, " + Math.round(100 * this.blackness) + "%, " + this.opacity }, toName: function () { var t, e, r, n = getColorArr("hexs"); for (i = 0; i < n.length; i++)if (t = parseInt(n[i].substr(0, 2), 16), e = parseInt(n[i].substr(2, 2), 16), r = parseInt(n[i].substr(4, 2), 16), this.red == t && this.green == e && this.blue == r) return getColorArr("names")[i]; return "" }, toHexString: function () { var t = toHex(this.red), e = toHex(this.green), r = toHex(this.blue); return "#" + t + e + r }, toRgb: function () { return { r: this.red, g: this.green, b: this.blue, a: this.opacity } }, toHsl: function () { return { h: this.hue, s: this.sat, l: this.lightness, a: this.opacity } }, toHwb: function () { return { h: this.hue, w: this.whiteness, b: this.blackness, a: this.opacity } }, toCmyk: function () { return { c: this.cyan, m: this.magenta, y: this.yellow, k: this.black, a: this.opacity } }, toNcol: function () { return { ncol: this.ncol, w: this.whiteness, b: this.blackness, a: this.opacity } }, isDark: function (t) { return (299 * this.red + 587 * this.green + 114 * this.blue) / 1e3 < (t || 128) }, saturate: function (t) { var e, r, n; e = t / 100 || .1, this.sat += e, this.sat > 1 && (this.sat = 1), n = colorObject(r = hslToRgb(this.hue, this.sat, this.lightness), this.opacity, this.hue, this.sat), this.attachValues(n) }, desaturate: function (t) { var e, r, n; e = t / 100 || .1, this.sat -= e, this.sat < 0 && (this.sat = 0), n = colorObject(r = hslToRgb(this.hue, this.sat, this.lightness), this.opacity, this.hue, this.sat), this.attachValues(n) }, lighter: function (t) { var e, r, n; e = t / 100 || .1, this.lightness += e, this.lightness > 1 && (this.lightness = 1), n = colorObject(r = hslToRgb(this.hue, this.sat, this.lightness), this.opacity, this.hue, this.sat), this.attachValues(n) }, darker: function (t) { var e, r, n; e = t / 100 || .1, this.lightness -= e, this.lightness < 0 && (this.lightness = 0), n = colorObject(r = hslToRgb(this.hue, this.sat, this.lightness), this.opacity, this.hue, this.sat), this.attachValues(n) }, attachValues: function (t) { this.red = t.red, this.green = t.green, this.blue = t.blue, this.hue = t.hue, this.sat = t.sat, this.lightness = t.lightness, this.whiteness = t.whiteness, this.blackness = t.blackness, this.cyan = t.cyan, this.magenta = t.magenta, this.yellow = t.yellow, this.black = t.black, this.ncol = t.ncol, this.opacity = t.opacity, this.valid = t.valid } }; diff --git a/.obsidian/plugins/obsidian-webpage-export-master/assets/tsconfig.json b/.obsidian/plugins/obsidian-webpage-export-master/assets/tsconfig.json deleted file mode 100644 index 840ae7d2..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/assets/tsconfig.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "compilerOptions": { - "target": "ES2015", - "module": "ES2015", - "moduleResolution": "node", - "sourceMap": true, - "skipLibCheck": true, - }, - "include": ["webpage.ts"] - -} \ No newline at end of file diff --git a/.obsidian/plugins/obsidian-webpage-export-master/assets/webpage.ts b/.obsidian/plugins/obsidian-webpage-export-master/assets/webpage.ts deleted file mode 100644 index b44e867c..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/assets/webpage.ts +++ /dev/null @@ -1,309 +0,0 @@ - -class Website -{ - public static website: Website; - public static isLoaded: boolean = false; - public static loadedDocument: WebpageDocument | null = null; - public static bodyEl: HTMLElement; - public static webpageEl: HTMLElement; - - public static async init() - { - Website.website = new Website(); - window.addEventListener("load", () => Website.onInit()); - } - - private static onInit() - { - let docEl = document.querySelector(".document-container") as HTMLElement; - this.loadedDocument = new WebpageDocument(docEl, Website.website, DocumentType.Markdown); - - this.bodyEl = document.body as HTMLElement; - this.webpageEl = document.querySelector(".webpage-container") as HTMLElement; - - this.bodyEl.classList.toggle("loading", false); - this.bodyEl.classList.toggle("loaded", true); - this.isLoaded = true; - console.log("loaded"); - } -} - -Website.init(); - -class Header -{ - public level: number; - public id: string; - public text: string; - public isCollapsed: boolean; - public isVisible: boolean = true; - public parent: Header | null; - public childHeaders: Header[]; - public children: HTMLElement[]; - public nextHeader: Header | null; - public previousHeader: Header | null; - - public wrapperEl: HTMLElement; - public headingEl: HTMLHeadingElement; - public childrenEl: HTMLElement; - public collapseEl: HTMLElement | null; - public containingSizer: HTMLElement | null; - - public document: WebpageDocument; - - constructor(wrapperEl: HTMLElement, document: WebpageDocument) - { - this.wrapperEl = wrapperEl; - this.headingEl = wrapperEl.querySelector(".heading") as HTMLHeadingElement; - this.childrenEl = wrapperEl.querySelector(".heading-children") as HTMLElement; - this.collapseEl = wrapperEl.querySelector(".heading-collapse-indicator"); - this.containingSizer = wrapperEl.closest(".markdown-preview-sizer") ?? wrapperEl.closest(".view-content"); - - if (this.headingEl == null || this.childrenEl == null) throw new Error("Invalid header element"); - - this.level = parseInt(this.headingEl.tagName.substring(1)); - this.id = this.headingEl.id; - this.text = this.headingEl.textContent ?? ""; - this.isCollapsed = this.wrapperEl.classList.contains("is-collapsed"); - - this.document = document; - this.document.headers.push(this); - - this.childHeaders = []; - this.children = []; - this.childrenEl.childNodes.forEach((child) => - { - if (child instanceof HTMLElement) - { - if(child.classList.contains("heading-wrapper")) - { - let header = new Header(child, document); - header.parent = this; - this.childHeaders.push(header); - } - - this.children.push(child); - } - }); - - if (this.parent) - { - let index = this.parent.childHeaders.indexOf(this); - this.previousHeader = this.parent.childHeaders[index - 1] ?? null; - this.nextHeader = this.parent.childHeaders[index + 1] ?? null; - } - - let localThis = this; - - this.collapseEl?.addEventListener("click", function () - { - localThis.toggle(); - }); - } - - private collapseTimeout: number | null = null; - private collapseHeight: number = 0; - private forceShown: boolean = false; - public async collapse(collapse: boolean, openParents = true, instant = false) - { - if (openParents && !collapse) - { - if (this.parent) this.parent.collapse(false, true, instant); - } - - let needsChange = this.isCollapsed != collapse; - if (!needsChange) - { - // if opening show the header - if (!collapse && this.document?.documentType == DocumentType.Canvas) this.show(true); - return; - } - - - if (this.collapseTimeout) - { - clearTimeout(this.collapseTimeout); - this.childrenEl.style.transitionDuration = ""; - this.childrenEl.style.height = ""; - this.wrapperEl.classList.toggle("is-animating", false); - } - - - if (collapse) - { - this.collapseHeight = this.childrenEl.offsetHeight + parseFloat(this.children[this.children.length - 1]?.style.marginBottom || "0"); - - // show all sibling headers after this one - // this is so that when the header slides down you aren't left with a blank space - let next = this.nextHeader; - while (next && this.document.documentType == DocumentType.Canvas) - { - let localNext = next; - - // force show the sibling header for 500ms while this one is collapsing - localNext.show(false, true, true); - setTimeout(function() - { - localNext.forceShown = false; - }, 500); - - next = next.nextHeader; - } - } - - let height = this.collapseHeight; - this.childrenEl.style.height = height + "px"; - - // if opening show the header - if (!collapse && this.document.documentType == DocumentType.Canvas) this.show(true); - - this.isCollapsed = collapse; - - if (instant) - { - console.log("instant"); - this.childrenEl.style.transitionDuration = "0s"; - this.wrapperEl.classList.toggle("is-collapsed", collapse); - this.childrenEl.style.height = ""; - this.childrenEl.style.transitionDuration = ""; - - let newTotalHeight = Array.from(this.containingSizer?.children ?? []).reduce((acc, cur: HTMLElement) => acc + cur.offsetHeight, 0); - if(this.containingSizer) this.containingSizer.style.minHeight = newTotalHeight + "px"; - - return; - } - - // get the length of the height transition on heading container and wait for that time before not displaying the contents - let transitionDuration: string | number = getComputedStyle(this.childrenEl).transitionDuration; - if (transitionDuration.endsWith("s")) transitionDuration = parseFloat(transitionDuration); - else if (transitionDuration.endsWith("ms")) transitionDuration = parseFloat(transitionDuration) / 1000; - else transitionDuration = 0; - - // multiply the duration by the height so that the transition is the same speed regardless of the height of the header - let transitionDurationMod = Math.min(transitionDuration * Math.sqrt(height) / 16, 0.5); // longest transition is 0.5s - this.childrenEl.style.transitionDuration = `${transitionDurationMod}s`; - - - if (collapse) this.childrenEl.style.height = "0px"; - else this.childrenEl.style.height = height + "px"; - this.wrapperEl.classList.toggle("is-animating", true); - this.wrapperEl.classList.toggle("is-collapsed", collapse); - - let localThis = this; - - setTimeout(function() - { - localThis.childrenEl.style.transitionDuration = ""; - if(!collapse) localThis.childrenEl.style.height = ""; - localThis.wrapperEl.classList.toggle("is-animating", false); - - let newTotalHeight = Array.from(localThis.containingSizer?.children ?? []).reduce((acc, cur: HTMLElement) => acc + cur.offsetHeight, 0); - if(localThis.containingSizer) localThis.containingSizer.style.minHeight = newTotalHeight + "px"; - - }, transitionDurationMod * 1000); - } - - /**Restores a hidden header back to it's normal function */ - public show(showParents:boolean = false, showChildren:boolean = false, forceStay:boolean = false) - { - if (forceStay) this.forceShown = true; - - if (showParents) - { - if (this.parent) this.parent.show(true, false, forceStay); - } - - if (showChildren) - { - this.childHeaders.forEach((header) => - { - header.show(false, true, forceStay); - }); - } - - if(this.isVisible || this.isCollapsed) return; - - - this.wrapperEl.classList.toggle("is-hidden", false); - this.wrapperEl.style.height = ""; - this.wrapperEl.style.visibility = ""; - this.isVisible = true; - } - - public toggle(openParents = true) - { - this.collapse(!this.isCollapsed, openParents); - } - - /**Hides everything in a header and then makes the header div take up the same space as the header element */ - public hide() - { - if(this.forceShown) return; - if(!this.isVisible || this.isCollapsed) return; - if(this.wrapperEl.style.display == "none") return; - - let height = this.wrapperEl.offsetHeight; - this.wrapperEl.classList.toggle("is-hidden", true); - if (height != 0) this.wrapperEl.style.height = height + "px"; - this.wrapperEl.style.visibility = "hidden"; - this.isVisible = false; - } -} - -class Tree -{ - -} - -class TreeItem -{ - -} - -class Canvas -{ - -} - -class Sidebar -{ - -} - -class SidebarGutter -{ - -} - -export enum DocumentType -{ - Markdown, - Canvas, - Embed, - Excalidraw, - Kanban, - Other -} - -class WebpageDocument -{ - public headers: Header[]; - public website: Website; - public documentType: DocumentType; - public documentEl: HTMLElement; - - public constructor(documentEl: HTMLElement, website: Website, documentType: DocumentType) - { - this.documentEl = documentEl; - this.website = website; - this.documentType = documentType; - - this.headers = []; - // only create top level headers, because headers create their own children - this.documentEl.querySelectorAll(".heading-wrapper:not(:is(.heading-children .heading-wrapper))").forEach((headerEl) => - { - new Header(headerEl as HTMLElement, this); // headers add themselves to the document - }); - } - -} diff --git a/.obsidian/plugins/obsidian-webpage-export-master/assets/website.txt.js b/.obsidian/plugins/obsidian-webpage-export-master/assets/website.txt.js deleted file mode 100644 index 90c3399f..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/assets/website.txt.js +++ /dev/null @@ -1,2709 +0,0 @@ -//#region ----------------- Initializations ----------------- - -let loadedURL = new URL(window.location.href); -let absoluteBasePath = undefined; -let relativeBasePath = undefined; -let relativePathname = undefined; - -let webpageContainer; -let documentContainer; -let viewContent; - -let leftSidebar; -let rightSidebar; -let sidebarCollapseIcons; -let sidebarGutters; -let sidebars; -let sidebarDefaultWidth; -let sidebarTargetWidth; -let contentTargetWidth; - -let themeToggle; -let searchInput; - -let fileTree; -let outlineTree; -let fileTreeItems; -let outlineTreeItems; - -let canvasWrapper; -let canvas; -let canvasNodes; -let canvasBackground; -let canvasBackgroundPattern; -let focusedCanvasNode; - -let loadingIcon; -let isOffline = false; - -let collapseIconUp = ["m7 15 5 5 5-5", "m7 9 5-5 5 5"]; // path 1, path 2 - svg paths -let collapseIconDown = ["m7 20 5-5 5 5", "m7 4 5 5 5-5"]; // path 1, path 2 - svg paths - -let isTouchDevice = isTouchCapable(); - -let documentType; // "markdown" | "canvas" | "embed" | "custom" | "none" -let embedType; // "img" | "video" | "audio" | "embed" | "none" -let customType; // "kanban" | "excalidraw" | "none" -let deviceSize; // "large-screen" | "small screen" | "tablet" | "phone" - -let fullyInitialized = false; - -async function initGlobalObjects() -{ - if(window.location.protocol != "file:") - { - await loadIncludes(); - } - - - - loadingIcon = document.createElement("div"); - loadingIcon.classList.add("loading-icon"); - document.body.appendChild(loadingIcon); - loadingIcon.innerHTML = `
`; - - webpageContainer = document.querySelector(".webpage-container"); - documentContainer = document.querySelector(".document-container"); - leftSidebar = document.querySelector(".sidebar-left"); - rightSidebar = document.querySelector(".sidebar-right"); - - fileTree = document.querySelector(".file-tree"); - outlineTree = document.querySelector(".outline-tree"); - fileTreeItems = Array.from(document.querySelectorAll(".tree-container.file-tree .tree-item")); - - sidebars = [] - sidebarGutters = [] - sidebarCollapseIcons = [] - if (leftSidebar && rightSidebar) - { - sidebarCollapseIcons = Array.from(document.querySelectorAll(".sidebar-collapse-icon")); - sidebarGutters = [sidebarCollapseIcons[0].parentElement, sidebarCollapseIcons[1].parentElement]; - sidebars = [sidebarGutters[0].parentElement, sidebarGutters[1].parentElement]; - } - - themeToggle = document.querySelector(".theme-toggle-input"); -} - -async function initializePage() -{ - focusedCanvasNode = null; - canvasWrapper = document.querySelector(".canvas-wrapper") ?? canvasWrapper; - canvas = document.querySelector(".canvas") ?? canvas; - - let canvasNodesTemp = document.querySelectorAll(".canvas-node"); - canvasNodes = canvasNodesTemp.length > 0 ? canvasNodesTemp : canvasNodes; - - canvasBackground = document.querySelector(".canvas-background") ?? canvasBackground; - canvasBackgroundPattern = document.querySelector(".canvas-background pattern") ?? canvasBackgroundPattern; - viewContent = document.querySelector(".document-container > .view-content") ?? document.querySelector(".document-container > .markdown-preview-view") ?? viewContent; - outlineTreeItems = Array.from(document.querySelectorAll(".tree-container.outline-tree .tree-item")); - - if(!fullyInitialized) - { - if (window.location.protocol == "file:") initializeForFileProtocol(); - await initGlobalObjects(); - initializeDocumentTypes(document); - setupSidebars(); - setupThemeToggle(); - await setupSearch(); - setupRootPath(document); - - sidebarDefaultWidth = await getComputedPixelValue("--sidebar-width"); - contentTargetWidth = await getComputedPixelValue("--line-width") * 0.9; - - window.addEventListener('resize', () => onResize()); - onResize(); - } - - setTimeout(() => documentContainer.classList.remove("hide")); - - // hide the right sidebar when viewing specific file types - if (rightSidebar && (embedType == "video" || embedType == "embed" || customType == "excalidraw" || customType == "kanban" || documentType == "canvas")) - { - if(!rightSidebar.collapsed) - { - rightSidebar.temporaryCollapse(); - } - } - else - { - // if the right sidebar was temporarily collapsed and it is still collapsed, uncollapse it - if (rightSidebar && rightSidebar.temporarilyCollapsed && rightSidebar.collapsed) - { - rightSidebar.collapse(false); - rightSidebar.temporarilyCollapsed = false; - } - } - - parseURLParams(); - relativePathname = getVaultRelativePath(loadedURL.href); -} - -function initializePageEvents(setupOnNode) -{ - if (!setupOnNode) return; - setupHeaders(setupOnNode); - setupTrees(setupOnNode); - setupLists(setupOnNode); - setupCallouts(setupOnNode); - setupCheckboxes(setupOnNode); - setupCanvas(setupOnNode); - setupCodeblocks(setupOnNode); - setupLinks(setupOnNode); - setupScroll(setupOnNode); -} - -function initializeDocumentTypes(fromDocument) -{ - if (fromDocument.querySelector(".document-container > .markdown-preview-view")) documentType = "markdown"; - else if (fromDocument.querySelector(".canvas-wrapper")) documentType = "canvas"; - else - { - documentType = "custom"; - if (fromDocument.querySelector(".kanban-plugin")) customType = "kanban"; - else if (fromDocument.querySelector(".excalidraw-plugin")) customType = "excalidraw"; - } -} - -function initializeForFileProtocol() -{ - let graphEl = document.querySelector(".graph-view-placeholder"); - if(graphEl) - { - console.log("Running locally, skipping graph view initialization and hiding graph."); - graphEl.style.display = "none"; - graphEl.previousElementSibling.style.display = "none"; // hide the graph's header - } -} - -window.onload = async function() -{ - await initializePage(); - initializePageEvents(document); - setActiveDocument(loadedURL, true, false, false); - fullyInitialized = true; -}; - -window.onpopstate = function(event) -{ - event.preventDefault(); - event.stopPropagation(); - - if (document.body.classList.contains("floating-sidebars") && (!leftSidebar.collapsed || !rightSidebar.collapsed)) - { - leftSidebar.collapse(true); - rightSidebar.collapse(true); - return; - } - - loadDocument(getURLPath(), false, true); - console.log("Popped state: " + getURLPath()); -} - -//#endregion - -//#region ----------------- Resize ----------------- - -function onEndResize() -{ - document.body.classList.toggle("resizing", false); -} - -function onStartResize() -{ - document.body.classList.toggle("resizing", true); -} - -let lastScreenWidth = undefined; -let isResizing = false; -let checkStillResizingTimeout = undefined; -function onResize(isInitial = false) -{ - if (!isResizing) - { - onStartResize(); - isResizing = true; - } - - function widthNowInRange(low, high) - { - let w = window.innerWidth; - return (w > low && w < high && lastScreenWidth == undefined) || ((w > low && w < high) && (lastScreenWidth <= low || lastScreenWidth >= high)); - } - - function widthNowGreaterThan(value) - { - let w = window.innerWidth; - return (w > value && lastScreenWidth == undefined) || (w > value && lastScreenWidth < value); - } - - function widthNowLessThan(value) - { - let w = window.innerWidth; - return (w < value && lastScreenWidth == undefined) || (w < value && lastScreenWidth > value); - } - - if (widthNowGreaterThan(contentTargetWidth + sidebarDefaultWidth * 2) || widthNowGreaterThan(1025)) - { - deviceSize = "large-screen"; - document.body.classList.toggle("floating-sidebars", false); - document.body.classList.toggle("is-large-screen", true); - document.body.classList.toggle("is-small-screen", false); - document.body.classList.toggle("is-tablet", false); - document.body.classList.toggle("is-phone", false); - sidebars.forEach(function (sidebar) { sidebar.collapse(false) }); - sidebarGutters.forEach(function (gutter) { gutter.collapse(false) }); - } - else if (widthNowInRange((contentTargetWidth + sidebarDefaultWidth) * 1, contentTargetWidth + sidebarDefaultWidth * 2) || widthNowInRange(769, 1024)) - { - deviceSize = "small screen"; - document.body.classList.toggle("floating-sidebars", false); - document.body.classList.toggle("is-large-screen", false); - document.body.classList.toggle("is-small-screen", true); - document.body.classList.toggle("is-tablet", false); - document.body.classList.toggle("is-phone", false); - sidebarGutters.forEach(function (gutter) { gutter.collapse(false) }); - - if (leftSidebar && rightSidebar && !leftSidebar.collapsed) - { - rightSidebar.collapse(true); - } - } - else if (widthNowInRange(sidebarDefaultWidth * 2, (contentTargetWidth + sidebarDefaultWidth) * 1) || widthNowInRange(481, 768)) - { - deviceSize = "tablet"; - document.body.classList.toggle("floating-sidebars", true); - document.body.classList.toggle("is-large-screen", false); - document.body.classList.toggle("is-small-screen", false); - document.body.classList.toggle("is-tablet", true); - document.body.classList.toggle("is-phone", false); - sidebarGutters.forEach(function (gutter) { gutter.collapse(false) }); - - if (leftSidebar && rightSidebar && !leftSidebar.collapsed) - { - rightSidebar.collapse(true); - } - - if(leftSidebar && !fullyInitialized) leftSidebar.collapse(true); - } - else if (widthNowLessThan(sidebarDefaultWidth * 2) || widthNowLessThan(480)) - { - deviceSize = "phone"; - document.body.classList.toggle("floating-sidebars", true); - document.body.classList.toggle("is-large-screen", false); - document.body.classList.toggle("is-small-screen", false); - document.body.classList.toggle("is-tablet", false); - document.body.classList.toggle("is-phone", true); - sidebars.forEach(function (sidebar) { sidebar.collapse(true) }); - sidebarGutters.forEach(function (gutter) { gutter.collapse(false) }); - } - - lastScreenWidth = window.innerWidth; - - if (checkStillResizingTimeout != undefined) clearTimeout(checkStillResizingTimeout); - - // wait a little bit of time and if the width is still the same then we are done resizing - let screenWidthSnapshot = window.innerWidth; - checkStillResizingTimeout = setTimeout(function () - { - if (window.innerWidth == screenWidthSnapshot) - { - checkStillResizingTimeout = undefined; - isResizing = false; - onEndResize(); - } - }, 200); - -} - -// #endregion - -//#region ----------------- Helper Functions ----------------- - -function clamp(value, min, max) -{ - return Math.min(Math.max(value, min), max); -} - -async function delay(ms) -{ - return new Promise(resolve => setTimeout(resolve, ms)); -} - -async function waitUntil(condition, interval = 100, timeout = 2000) -{ - return new Promise(resolve => - { - let intervalId = 0; - - let timeoutId = setTimeout(() => - { - clearInterval(intervalId); - resolve(); - }, timeout); - - intervalId = setInterval(() => - { - if (condition()) - { - clearInterval(intervalId); - clearTimeout(timeoutId); - resolve(); - } - }, interval); - }); -} - -/**Gets the bounding rect of a given element*/ -function getElBounds(El) -{ - let elRect = El.getBoundingClientRect(); - - let x = elRect.x; - let y = elRect.y; - let width = elRect.width; - let height = elRect.height; - let centerX = elRect.x + elRect.width / 2; - let centerY = elRect.y + elRect.height / 2; - - return { x: x, y: y, width: width, height: height, minX: x, minY: y, maxX: x + width, maxY: y + height, centerX: centerX, centerY: centerY }; -} - -async function getComputedPixelValue(variableName) -{ - const tempElement = document.createElement('div'); - document.body.appendChild(tempElement); - tempElement.style.position = 'absolute'; - tempElement.style.width = `var(${variableName})`; - - await new Promise(resolve => setTimeout(resolve, 10)); - - const computedWidth = window.getComputedStyle(tempElement).width; - tempElement.remove(); - - return parseFloat(computedWidth); -} - -function getPointerPosition(event) -{ - let touches = event.touches ? Array.from(event.touches) : []; - let x = touches.length > 0 ? (touches.reduce((acc, cur) => acc + cur.clientX, 0) / event.touches.length) : event.clientX; - let y = touches.length > 0 ? (touches.reduce((acc, cur) => acc + cur.clientY, 0) / event.touches.length) : event.clientY; - return {x: x, y: y}; -} - -function getTouchPosition(touch) -{ - return {x: touch.clientX, y: touch.clientY}; -} - -function getAllChildrenRecursive(element) -{ - let children = []; - - for (let i = 0; i < element.children.length; i++) { - const child = element.children[i]; - children.push(child); - children = children.concat(getAllChildrenRecursive(child)); - } - - return children; -} - -function isMobile() -{ - let check = false; - (function(a){if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4))) check = true;})(navigator.userAgent||navigator.vendor||window.opera); - return check; -} - -function isTouchCapable() -{ - return (('ontouchstart' in window) || - (navigator.maxTouchPoints > 0) || - (navigator.msMaxTouchPoints > 0)); -} - -function downloadBlob(blob, name = 'file.txt') { - if ( - window.navigator && - window.navigator.msSaveOrOpenBlob - ) return window.navigator.msSaveOrOpenBlob(blob); - - // For other browsers: - // Create a link pointing to the ObjectURL containing the blob. - const data = window.URL.createObjectURL(blob); - - const link = document.createElement('a'); - link.href = data; - link.download = name; - - // this is necessary as link.click() does not work on the latest firefox - link.dispatchEvent( - new MouseEvent('click', { - bubbles: true, - cancelable: true, - view: window - }) - ); - - setTimeout(() => { - // For Firefox it is necessary to delay revoking the ObjectURL - window.URL.revokeObjectURL(data); - link.remove(); - }, 100); -} - -function extentionToTag(extention) -{ - if (["png", "jpg", "jpeg", "svg", "gif", "bmp", "ico"].includes(extention)) return "img"; - if (["mp4", "mov", "avi", "webm", "mpeg"].includes(extention)) return "video"; - if (["mp3", "wav", "ogg", "aac"].includes(extention)) return "audio"; - if (["pdf"].includes(extention)) return "embed"; - return; -} - -let slideUp = (target, duration=500) => { - - target.style.transitionProperty = 'height, margin, padding'; - target.style.transitionDuration = duration + 'ms'; - target.style.boxSizing = 'border-box'; - target.style.height = target.offsetHeight + 'px'; - target.offsetHeight; - target.style.overflow = 'hidden'; - target.style.height = 0; - target.style.paddingTop = 0; - target.style.paddingBottom = 0; - target.style.marginTop = 0; - target.style.marginBottom = 0; - window.setTimeout(async () => { - target.style.display = 'none'; - target.style.removeProperty('height'); - target.style.removeProperty('padding-top'); - target.style.removeProperty('padding-bottom'); - target.style.removeProperty('margin-top'); - target.style.removeProperty('margin-bottom'); - target.style.removeProperty('overflow'); - target.style.removeProperty('transition-duration'); - target.style.removeProperty('transition-property'); - }, duration); -} - -let slideUpAll = (targets, duration=500) => { - - targets.forEach(async target => { - if (!target) return; - target.style.transitionProperty = 'height, margin, padding'; - target.style.transitionDuration = duration + 'ms'; - target.style.boxSizing = 'border-box'; - target.style.height = target.offsetHeight + 'px'; - target.offsetHeight; - target.style.overflow = 'hidden'; - target.style.height = 0; - target.style.paddingTop = 0; - target.style.paddingBottom = 0; - target.style.marginTop = 0; - target.style.marginBottom = 0; - }); - - window.setTimeout(async () => { - targets.forEach(async target => { - if (!target) return; - target.style.display = 'none'; - target.style.removeProperty('height'); - target.style.removeProperty('padding-top'); - target.style.removeProperty('padding-bottom'); - target.style.removeProperty('margin-top'); - target.style.removeProperty('margin-bottom'); - target.style.removeProperty('overflow'); - target.style.removeProperty('transition-duration'); - target.style.removeProperty('transition-property'); - }); - }, duration); -} - -let slideDown = (target, duration=500) => { - target.style.removeProperty('display'); - let display = window.getComputedStyle(target).display; - if (display === 'none') display = 'block'; - target.style.display = display; - let height = target.offsetHeight; - target.style.overflow = 'hidden'; - target.style.height = 0; - target.style.paddingTop = 0; - target.style.paddingBottom = 0; - target.style.marginTop = 0; - target.style.marginBottom = 0; - target.offsetHeight; - target.style.boxSizing = 'border-box'; - target.style.transitionProperty = "height, margin, padding"; - target.style.transitionDuration = duration + 'ms'; - target.style.height = height + 'px'; - target.style.removeProperty('padding-top'); - target.style.removeProperty('padding-bottom'); - target.style.removeProperty('margin-top'); - target.style.removeProperty('margin-bottom'); - window.setTimeout(async () => { - target.style.removeProperty('height'); - target.style.removeProperty('overflow'); - target.style.removeProperty('transition-duration'); - target.style.removeProperty('transition-property'); - }, duration); -} - -let slideDownAll = (targets, duration=500) => { - - targets.forEach(async target => { - if (!target) return; - target.style.removeProperty('display'); - let display = window.getComputedStyle(target).display; - if (display === 'none') display = 'block'; - target.style.display = display; - let height = target.offsetHeight; - target.style.overflow = 'hidden'; - target.style.height = 0; - target.style.paddingTop = 0; - target.style.paddingBottom = 0; - target.style.marginTop = 0; - target.style.marginBottom = 0; - target.offsetHeight; - target.style.boxSizing = 'border-box'; - target.style.transitionProperty = "height, margin, padding"; - target.style.transitionDuration = duration + 'ms'; - target.style.height = height + 'px'; - target.style.removeProperty('padding-top'); - target.style.removeProperty('padding-bottom'); - target.style.removeProperty('margin-top'); - target.style.removeProperty('margin-bottom'); - }); - - window.setTimeout( async () => { - targets.forEach(async target => { - if (!target) return; - target.style.removeProperty('height'); - target.style.removeProperty('overflow'); - target.style.removeProperty('transition-duration'); - target.style.removeProperty('transition-property'); - }); - }, duration); -} - -var slideToggle = (target, duration = 500) => { - if (window.getComputedStyle(target).display === 'none') { - return slideDown(target, duration); - } else { - return slideUp(target, duration); - } -} - -var slideToggleAll = (targets, duration = 500) => { - if (window.getComputedStyle(targets[0]).display === 'none') { - return slideDownAll(targets, duration); - } else { - return slideUpAll(targets, duration); - } -} - -function getURLExtention(url) -{ - return url.split(".").pop().split("?")[0].split("#")[0].toLowerCase().trim(); -} - -//#endregion - -//#region ----------------- Loading & Paths ----------------- - -let transferDocument = document.implementation.createHTMLDocument(); -let loading = false; -async function loadDocument(url, changeURL, showInTree) -{ - url = decodeURI(url); - if (loading) - { - console.log("Already loading document."); - return; - } - - loading = true; - let newLoadedURL = new URL(url, absoluteBasePath); - relativePathname = getVaultRelativePath(newLoadedURL.href); - console.log("Loading document: ", newLoadedURL.pathname); - - if (newLoadedURL.pathname == loadedURL?.pathname ?? "") - { - console.log("Document already loaded."); - loadedURL = newLoadedURL; - setActiveDocument(loadedURL, false, false); - await initializePage(); - loading = false; - return; - } - - loadedURL = newLoadedURL; - let pathname = loadedURL.pathname; - - await showLoading(true); - - let response; - try { response = await fetch(pathname); } - catch (error) - { - window.location.assign(pathname); - loading = false; - return; - } - - if (response.ok) - { - setActiveDocument(loadedURL, showInTree, changeURL); - let extention = getURLExtention(url); - if (extention == "/") extention = "html"; // if no extention assume it is html - - documentType = "none"; - embedType = "none"; - customType = "none"; - - if(extention == "html") - { - let html = (await response.text()).replaceAll("", "").replaceAll("", "").replaceAll("", ""); - transferDocument.write(html); - - setupRootPath(transferDocument); - initializeDocumentTypes(transferDocument); - - // copy document content into DOM - let newDocumentEl = transferDocument.querySelector(".document-container"); - documentContainer.innerHTML = newDocumentEl.innerHTML; - - // copy the outline tree into the DOM - let newOutline = transferDocument.querySelector(".outline-tree"); - if (outlineTree && newOutline) outlineTree.innerHTML = newOutline.innerHTML; - - document.title = transferDocument.title; - transferDocument.close(); - } - else - { - documentType = "embed"; - - embedType = extentionToTag(extention); - - if(embedType != undefined) - { - let media = document.createElement(embedType); - media.controls = true; - media.src = url; - - media.style.maxWidth = "100%"; - if(embedType == "embed") - { - media.style.width = "100%"; - media.style.height = "100%"; - } - - media.style.objectFit = "contain"; - - viewContent.innerHTML = ""; - viewContent.setAttribute("class", "view-content embed"); - viewContent.appendChild(media); - - if (document.querySelector(".outline-tree")) - document.querySelector(".outline-tree").innerHTML = ""; - - document.title = url.split("/").pop(); - } - else // just download the file - { - let blob = await response.blob(); - downloadBlob(blob, url.split("/").pop()); - } - } - - await initializePage(); - initializePageEvents(documentContainer); - initializePageEvents(outlineTree); - } - else - { - pageNotFound(viewContent); - } - - await showLoading(false); - loading = false; - - return; -} - -function setActiveDocument(url, showInTree, changeURL, animate = true) -{ - let relativePath = getVaultRelativePath(url.href); - let decodedRelativePath = decodeURI(relativePath); - let searchlessHeaderlessPath = decodedRelativePath.split("#")[0].split("?")[0].replace("\"", "\\\"").replace("\'", "\\\'"); - - if (searchlessHeaderlessPath == "/" || searchlessHeaderlessPath == "") searchlessHeaderlessPath = "index.html"; - - // switch active file in file tree - let oldActiveTreeItem = document.querySelector(".file-tree .tree-item.mod-active"); - let newActiveTreeItem = document.querySelector(`.file-tree .tree-item:has(>.tree-link[href^="${searchlessHeaderlessPath}"])`); - if(newActiveTreeItem && !newActiveTreeItem.isEqualNode(oldActiveTreeItem)) - { - oldActiveTreeItem?.classList.remove("mod-active"); - newActiveTreeItem.classList.add("mod-active"); - if(showInTree) scrollIntoView(newActiveTreeItem, {block: "center", inline: "nearest"}, animate); - } - - // set the active file in the graph view - if(typeof graphData != 'undefined' && window.graphRenderer) - { - let activeNode = graphData?.paths.findIndex(function(item) { return item.endsWith(searchlessHeaderlessPath); }) ?? -1; - - if(activeNode >= 0) - { - window.graphRenderer.activeNode = activeNode; - } - } - - console.log("Active document: " + changeURL); - - if(changeURL && window.location.protocol != "file:") - { - window.history.pushState({ path: relativePath }, '', relativePath); - console.log("Pushed state: " + relativePath); - } -} - -function parseURLParams() -{ - const highlightParam = loadedURL.searchParams.get('mark'); - const searchParam = loadedURL.searchParams.get('query'); - const hashParam = decodeURI(loadedURL.hash); - - if (highlightParam) - { - searchCurrentDocument(highlightParam); - } - - if (searchParam) - { - search(searchParam); - } - - if (hashParam) - { - const headingTarget = document.getElementById(hashParam.substring(1)); - if (headingTarget) - { - scrollIntoView(headingTarget, { behavior: "smooth", block: "start"}); - } - else - { - console.log("Heading not found: " + hashParam); - } - } -} - -async function showLoading(loading) -{ - documentContainer.style.transitionDuration = ""; - loadingIcon.classList.toggle("show", loading); - documentContainer.classList.toggle("hide", loading); - if(loading) - { - // position loading icon in the center of the screen - let viewBounds = getViewBounds(); - loadingIcon.style.left = (viewBounds.centerX - loadingIcon.offsetWidth / 2) + "px"; - loadingIcon.style.top = (viewBounds.centerY - loadingIcon.offsetHeight / 2) + "px"; - - // hide the left sidebar if on phone - if (deviceSize == "phone") leftSidebar.collapse(true); - } - - await delay(200); -} - -function pageNotFound(viewContent) -{ - viewContent.innerHTML = - ` -
-
-

Page Not Found

-
-
- `; - - if (document.querySelector(".outline-tree")) - document.querySelector(".outline-tree").innerHTML = ""; - - console.log("Page not found: " + absoluteBasePath + loadedURL.pathname); - let newRootPath = getURLRootPath(absoluteBasePath + loadedURL.pathname); - relativeBasePath = newRootPath; - document.querySelector("base").href = newRootPath; - - document.title = "Page Not Found"; -} - -function setupRootPath(fromDocument) -{ - let rootEl = fromDocument.getElementById("root-path"); - if (!rootEl) return; - let basePath = rootEl.getAttribute("root-path"); - let newBase = document.createElement("base"); - newBase.href = basePath; - console.log("Setting root path: " + basePath); - document.querySelector("base").replaceWith(newBase); - document.querySelector("#root-path").setAttribute("root-path", basePath); - relativeBasePath = basePath; - absoluteBasePath = new URL(basePath, window.location.href).href; -} - -function getURLPath(url = window.location.pathname) -{ - if (absoluteBasePath == undefined) setupRootPath(document); - let pathname = url.replace(absoluteBasePath, ""); - return pathname; -} - -function getURLRootPath(url = window.location.pathname) -{ - let path = getURLPath(url); - let splitPath = path.split("/"); - let rootPath = ""; - for (let i = 0; i < splitPath.length - 1; i++) - { - rootPath += "../"; - } - return rootPath; -} - -function getVaultRelativePath(absolutePath) -{ - return absolutePath.replace(absoluteBasePath, "") -} - -//#endregion - -//#region ----------------- Headers ----------------- - -function setupHeaders(setupOnNode) -{ - setupOnNode.querySelectorAll(".heading-collapse-indicator").forEach(function (element) - { - element.addEventListener("click", function () - { - toggleTreeHeaderOpen(element.parentElement.parentElement, true); - }); - }); - - setupOnNode.querySelectorAll(".heading-wrapper").forEach(function (element) - { - element.collapsed = false; - element.childrenContainer = element.querySelector(".heading-children"); - element.parentHeader = element.parentElement.parentElement; - element.headerElement = element.querySelector(".heading"); - - element.markdownPreviewSizer = getHeaderSizerEl(element); - element.collapse = function (collapse, openParents = true, instant = false) { collapseHeader(element, collapse, openParents, instant) }; - element.toggleCollapse = function (openParents = true) { toggleTreeHeaderOpen(element, openParents) }; - element.hide = function () { hideHeader(element) }; - element.show = function (parents = false, children = false, forceStay = false) { showHeader(element, parents, children, forceStay) }; - }); - - setupOnNode.querySelectorAll(".heading").forEach(function (element) - { - element.headingWrapper = element.parentElement; - }); -} - -function isHeadingWrapper(headingWrapper) -{ - if (!headingWrapper) return false; - return headingWrapper.classList.contains("heading-wrapper"); -} - -function getHeaderSizerEl(headingWrapper) -{ - // go up the tree until we find a markdown-preview-sizer - let parent = headingWrapper; - while (parent && !parent.classList.contains("markdown-preview-sizer")) parent = parent.parentElement; - - if (parent) return parent; - else return; -} - -async function collapseHeader(headingWrapper, collapse, openParents = true, instant = false) -{ - let collapseContainer = headingWrapper.childrenContainer; - - if (openParents && !collapse) - { - let parent = headingWrapper.parentHeader; - if (isHeadingWrapper(parent)) parent.collapse(false, true, instant); - } - - let needsChange = headingWrapper.classList.contains("is-collapsed") != collapse; - if (!needsChange) - { - // if opening show the header - if (!collapse && documentType == "canvas") headingWrapper.show(true); - return; - } - - - if (headingWrapper.timeout) - { - clearTimeout(headingWrapper.timeout); - collapseContainer.style.transitionDuration = ""; - collapseContainer.style.height = ""; - headingWrapper.classList.toggle("is-animating", false); - } - - - if (collapse) - { - headingWrapper.collapseHeight = collapseContainer.offsetHeight + parseFloat(collapseContainer.lastChild?.marginBottom || 0); - - // show all sibling headers after this one - // this is so that when the header slides down you aren't left with a blank space - let next = headingWrapper.nextElementSibling; - while (next && documentType == "canvas") - { - let localNext = next; - - // force show the sibling header for 500ms while this one is collapsing - if (isHeadingWrapper(localNext)) localNext.show(false, true, true); - setTimeout(function() - { - localNext.forceShown = false; - }, 500); - - next = next.nextElementSibling; - } - } - - let height = headingWrapper.collapseHeight; - collapseContainer.style.height = height + "px"; - - // if opening show the header - if (!collapse && documentType == "canvas") headingWrapper.show(true); - - headingWrapper.collapsed = collapse; - - function adjustSizerHeight(customHeight = undefined) - { - if (customHeight != undefined) headingWrapper.markdownPreviewSizer.style.minHeight = customHeight + "px"; - else - { - let newTotalHeight = Array.from(headingWrapper.markdownPreviewSizer.children).reduce((acc, cur) => acc + cur.offsetHeight, 0); - headingWrapper.markdownPreviewSizer.style.minHeight = newTotalHeight + "px"; - } - } - - if (instant) - { - collapseContainer.style.transitionDuration = "0s"; - headingWrapper.classList.toggle("is-collapsed", collapse); - collapseContainer.style.height = ""; - collapseContainer.style.transitionDuration = ""; - adjustSizerHeight() - return; - } - - // get the length of the height transition on heading container and wait for that time before not displaying the contents - let transitionDuration = getComputedStyle(collapseContainer).transitionDuration; - if (transitionDuration.endsWith("s")) transitionDuration = parseFloat(transitionDuration); - else if (transitionDuration.endsWith("ms")) transitionDuration = parseFloat(transitionDuration) / 1000; - else transitionDuration = 0; - - // multiply the duration by the height so that the transition is the same speed regardless of the height of the header - let transitionDurationMod = Math.min(transitionDuration * Math.sqrt(height) / 16, 0.5); // longest transition is 0.5s - collapseContainer.style.transitionDuration = `${transitionDurationMod}s`; - - - if (collapse) collapseContainer.style.height = "0px"; - else collapseContainer.style.height = height + "px"; - headingWrapper.classList.toggle("is-animating", true); - headingWrapper.classList.toggle("is-collapsed", collapse); - - if (headingWrapper.markdownPreviewSizer.closest(".markdown-embed")) // dont change the size of transcluded docments - { - adjustSizerHeight(collapse ? 0 : undefined); - } - - setTimeout(function() - { - collapseContainer.style.transitionDuration = ""; - if(!collapse) collapseContainer.style.height = ""; - headingWrapper.classList.toggle("is-animating", false); - - adjustSizerHeight() - - }, transitionDurationMod * 1000); -} - -function toggleTreeHeaderOpen(headingWrapper, openParents = true) -{ - headingWrapper.collapse(!headingWrapper.collapsed, openParents); -} - -/**Hides everything in a header and then makes the header div take up the same space as the header element */ -function hideHeader(headingWrapper) -{ - if(headingWrapper.forceShown) return; - if(headingWrapper.classList.contains("is-hidden") || headingWrapper.classList.contains("is-collapsed")) return; - if(getComputedStyle(headingWrapper).display == "none") return; - - let height = headingWrapper.offsetHeight; - headingWrapper.classList.toggle("is-hidden", true); - if (height != 0) headingWrapper.style.height = height + "px"; - headingWrapper.style.visibility = "hidden"; -} - -/**Restores a hidden header back to it's normal function */ -function showHeader(headingWrapper, showParents = true, showChildren = false, forceStayShown = false) -{ - if (forceStayShown) headingWrapper.forceShown = true; - - if (showParents) - { - let parent = headingWrapper.parentHeader; - if (isHeadingWrapper(parent)) parent.show(true, false, forceStayShown); - } - - if (showChildren) - { - let children = headingWrapper.querySelectorAll(".heading-wrapper"); - children.forEach(function(child) { child.show(false, true, forceStayShown); }); - } - - if(!headingWrapper.classList.contains("is-hidden") || headingWrapper.classList.contains("is-collapsed")) return; - - - headingWrapper.classList.toggle("is-hidden", false); - headingWrapper.style.height = ""; - headingWrapper.style.visibility = ""; -} - -//#endregion - -//#region ----------------- Trees ----------------- - -function setupTrees(setupOnNode) -{ - - setupOnNode.querySelectorAll(".collapse-tree-button").forEach(function(button) - { - button.treeRoot = button.closest(".tree-container"); - button.icon = button.firstChild; - button.icon.innerHTML = ""; - - button.setIcon = function(collapse) - { - button.icon.children[0].setAttribute("d", collapse ? collapseIconUp[0] : collapseIconDown[0]); - button.icon.children[1].setAttribute("d", collapse ? collapseIconUp[1] : collapseIconDown[1]); - } - button.collapse = function(collapse) - { - let treeItems = button.treeRoot.classList.contains("file-tree") ? fileTreeItems : outlineTreeItems; - setTreeCollapsedAll(treeItems, collapse); - button.setIcon(collapse); - button.collapsed = collapse; - }; - button.toggleCollapse = function() { button.collapse(!button.collapsed); }; - button.toggleState = function(state) - { - if (state === undefined) state = !button.collapsed; - button.collapsed = state; - button.setIcon(state); - }; - - button.addEventListener("click", function(event) - { - event.preventDefault(); - event.stopPropagation(); - button.toggleCollapse(); - return false; - }); - - // if any outline items are unncollapsed, toggle collapse all button state - let treeItems = button.treeRoot.classList.contains("file-tree") ? fileTreeItems : outlineTreeItems; - if (treeItems.some(item => !item.classList.contains("is-collapsed") && item.classList.contains("mod-collapsible"))) - { - button.toggleState(false); - } - }); - - let fileTreeClick = Array.from(setupOnNode.querySelectorAll(".tree-container.file-tree .tree-item:has(.collapse-icon) > .tree-link")); - let outlineTreeClick = Array.from(setupOnNode.querySelectorAll(".tree-container.outline-tree .tree-item:has(.collapse-icon) > .tree-link .collapse-icon")); - let collapsable = Array.from(fileTreeClick).concat(Array.from(outlineTreeClick)); - - for (let item of collapsable) - { - let closestItem = item?.closest(".tree-item"); - if (closestItem && item) item?.addEventListener("click", function(event) - { - event.preventDefault(); - event.stopPropagation(); - toggleTreeCollapsed(closestItem); - }); - } - -} - -async function setTreeCollapsed(element, collapsed, animate = true, openParents = true) -{ - if (!element.classList.contains("mod-collapsible")) - element = element.closest(".mod-collapsible"); - - if (!element || !element.classList.contains("mod-collapsible")) - { - return; - } - - if (element.classList.contains("is-collapsed") == collapsed) - { - return; - } - - if (openParents) - { - let parent = element.parentElement.closest(".mod-collapsible"); - if (parent) await setTreeCollapsed(parent, false, animate, openParents); - } - - let children = element.querySelector(".tree-item-children"); - - if (collapsed) - { - element.classList.add("is-collapsed"); - if(animate) slideUp(children, 100); - else children.style.display = "none"; - } - else - { - element.classList.remove("is-collapsed"); - if(animate) slideDown(children, 100); - else children.style.display = ""; - - // make close all button collapse the tree instead of opening it if it's already open - let treeContainer = element.closest(".tree-container"); - if (treeContainer) - { - let collapseButton = treeContainer.querySelector(".collapse-tree-button"); - if (collapseButton) collapseButton.toggleState(false); - } - } - -} - -async function setTreeCollapsedAll(elements, collapsed, animate = true) -{ - let childrenList = []; - elements.forEach(async element => - { - if (!element || !element.classList.contains("mod-collapsible")) return; - - let children = element.querySelector(".tree-item-children"); - - if (collapsed) - { - element.classList.add("is-collapsed"); - } - else - { - element.classList.remove("is-collapsed"); - } - - childrenList.push(children); - }); - - if (collapsed) - { - if(animate) slideUpAll(childrenList, 100); - else childrenList.forEach(async (children) => - { - if(children) children.style.display = "none"; - }); - } - else - { - if(animate) slideDownAll(childrenList, 100); - else childrenList.forEach(async (children) => - { - if(children) children.style.display = ""; - }); - } -} - -function toggleTreeCollapsed(element) -{ - element = element.closest(".tree-item"); - if (!element) return; - setTreeCollapsed(element, !element.classList.contains("is-collapsed")); -} - -function toggleTreeCollapsedAll(elements) -{ - if (!elements) return; - setTreeCollapsedAll(elements, !elements[0].classList.contains("is-collapsed")); -} - -function getFileTreeItemFromPath(path) -{ - return document.querySelector(`.file-tree .tree-item:has(> .tree-link[href^="${path}"])`); -} - -// hide all files and folder except the ones in the list (show parents of shown files) -async function filterFileTree(showPathList, hintLabelLists, query, openFileTree = true) -{ - if (openFileTree) await setTreeCollapsedAll(fileTreeItems, false, false); - // hide all files and folders - let allItems = Array.from(document.querySelectorAll(".file-tree .tree-item:not(.filtered-out)")); - for await (let item of allItems) - { - item.classList.add("filtered-out"); - } - - await removeTreeHintLabels(); - - for (let i = 0; i < showPathList.length; i++) - { - let path = showPathList[i]; - let hintLabels = hintLabelLists[i]; - - let treeItem = getFileTreeItemFromPath(path); - if (treeItem) - { - // show the file and it's parent tree items - treeItem.classList.remove("filtered-out"); - let itemLink = treeItem.querySelector(".tree-link"); - if(itemLink) itemLink.href = path + "?mark=" + query; - let parent = treeItem.parentElement.closest(".tree-item"); - - while (parent) - { - parent.classList.remove("filtered-out"); - parent = parent.parentElement.closest(".tree-item"); - } - - if (hintLabels.length > 0) - { - let treeLink = treeItem.querySelector(".tree-link"); - let hintContainer = treeLink.appendChild(document.createElement("div")); - hintContainer.classList.add("tree-hint-container"); - - function createHintLabel(text, link) - { - text = text.trim(); - if (text == "") return; - - let hintLabelEl = document.createElement("a"); - hintLabelEl.classList.add("tree-hint-label"); - hintLabelEl.classList.add("internal-link"); - hintLabelEl.textContent = text; - hintLabelEl.href = decodeURI(link).replaceAll(" ", "_"); - hintContainer.appendChild(hintLabelEl); - } - - // create the hint labels - for (let label of hintLabels) - { - createHintLabel(label, path + "#" + label); - } - - setupLinks(hintContainer); - } - } - } -} - -async function clearFileTreeFilter(closeFileTree = true) -{ - await removeTreeHintLabels(); - - let filteredItems = document.querySelectorAll(".file-tree .filtered-out"); - for await (let item of filteredItems) - { - item.classList.remove("filtered-out"); - } - - let markItems = document.querySelectorAll(".file-tree .tree-link[href*='?mark=']"); - for await (let item of markItems) - { - let href = item.href.split("?")[0]; - href = getVaultRelativePath(href); - item.href = href; - } - - if (closeFileTree) await setTreeCollapsedAll(fileTreeItems, true, false); -} - -async function removeTreeHintLabels() -{ - let hintLabels = document.querySelectorAll(".tree-hint-container"); - for await (let item of hintLabels) - { - item.remove(); - } -} - -function sortFileTreeDocuments(sortByFunction) -{ - let treeItems = Array.from(document.querySelectorAll(".file-tree .tree-item.mod-tree-file:not(.filtered-out)")); - treeItems.sort(sortByFunction); - - // sort the files within their parent folders - for (let i = 1; i < treeItems.length; i++) - { - let item = treeItems[i]; - let lastItem = treeItems[i - 1]; - if (item.parentElement == lastItem.parentElement) - { - lastItem.after(item); - } - } - - // sort the folders using their contents - let folders = Array.from(document.querySelectorAll(".file-tree .tree-item.mod-tree-folder:not(.filtered-out)")); - folders.sort(function (a, b) - { - let aFirst = a.querySelector(".tree-item.mod-tree-file:not(.filtered-out)"); - let bFirst = b.querySelector(".tree-item.mod-tree-file:not(.filtered-out)"); - return treeItems.indexOf(aFirst) - treeItems.indexOf(bFirst); - }); - - // sort the folders within their parent folders - for (let i = 1; i < folders.length; i++) - { - let item = folders[i]; - - let foundPlace = false; - // iterate backwards until we find an item with the same parent - for (let j = i - 1; j >= 0; j--) - { - let lastItem = folders[j]; - if (item.parentElement == lastItem.parentElement) - { - lastItem.after(item); - foundPlace = true; - break; - } - } - - // if we didn't find an item with the same parent, move it to the top - if (!foundPlace) - { - item.parentElement.prepend(item); - } - } -} - -function sortFileTree(sortByFunction) -{ - let treeItems = Array.from(document.querySelectorAll(".file-tree .tree-item.mod-tree-file:not(.filtered-out)")); - treeItems.sort(sortByFunction); - - // sort the files within their parent folders - for (let i = 1; i < treeItems.length; i++) - { - let item = treeItems[i]; - let lastItem = treeItems[i - 1]; - if (item.parentElement == lastItem.parentElement) - { - lastItem.after(item); - } - } - - // sort the folders using their contents - let folders = Array.from(document.querySelectorAll(".file-tree .tree-item.mod-tree-folder:not(.filtered-out)")); - folders.sort(sortByFunction); - - // sort the folders within their parent folders - for (let i = 1; i < folders.length; i++) - { - let item = folders[i]; - - let foundPlace = false; - // iterate backwards until we find an item with the same parent - for (let j = i - 1; j >= 0; j--) - { - let lastItem = folders[j]; - if (item.parentElement == lastItem.parentElement) - { - lastItem.after(item); - foundPlace = true; - break; - } - } - - // if we didn't find an item with the same parent, move it to the top - if (!foundPlace) - { - item.parentElement.prepend(item); - } - } -} - -function sortFileTreeAlphabetically(reverse = false) -{ - sortFileTree(function (a, b) - { - const aTitle = a.querySelector(".tree-item-title"); - const bTitle = b.querySelector(".tree-item-title"); - if (!aTitle || !bTitle) return 0; - const aName = aTitle.textContent.toLowerCase(); - const bName = bTitle.textContent.toLowerCase(); - return aName.localeCompare(bName, undefined, { numeric: true }) * (reverse ? -1 : 1); - }); -} - -//#endregion - -//#region ----------------- Lists ----------------- - -function setupLists(setupOnNode) -{ - let listCollpaseIcons = Array.from(setupOnNode.querySelectorAll(".list-collapse-indicator")); - for (let i = 0; i < listCollpaseIcons.length; i++) - { - let icon = listCollpaseIcons[i]; - icon.addEventListener("click", function (event) - { - let listItem = icon.closest("li"); - if (listItem) - { - listItem.classList.toggle("is-collapsed"); - icon.classList.toggle("is-collapsed"); - } - }); - } -} - -//#endregion - -//#region ----------------- Canvas ----------------- - - -function setupCanvas(setupOnNode) -{ - if(documentType != "canvas" || !setupOnNode.querySelector(".canvas-wrapper")) return; - - // initialize canvas tranformations - setupOnNode.querySelector(".canvas")?.setAttribute("style", "translate: 0px 1px; scale: 1;"); - - let nodeBounds = getNodesBounds(); - setViewCenter(nodeBounds.centerX, nodeBounds.centerY); - - // let nodes be focused when hovered over - setupOnNode.querySelectorAll(".canvas-node-container").forEach(function (element) - { - var parent = element.parentElement; - - function onEnter(event) - { - parent.classList.toggle("is-focused"); - - if (focusedCanvasNode != null && focusedCanvasNode != parent) - { - focusedCanvasNode.classList.remove("is-focused"); - focusedCanvasNode.querySelector(".canvas-node-container").style.display = ""; - } - - focusedCanvasNode = parent; - - parent.addEventListener("mouseleave", onLeave); - parent.addEventListener("touchend", onLeave); - } - - function onLeave(event) - { - if (focusedCanvasNode) - { - focusedCanvasNode.classList.remove("is-focused"); - focusedCanvasNode = null; - } - - parent.removeEventListener("mouseleave", onLeave); - parent.removeEventListener("touchend", onLeave); - } - - element.addEventListener("mouseenter", onEnter); - element.addEventListener("touchstart", onEnter); - }); - - // make nodes fit to view when double clicked - setupOnNode.querySelectorAll(".canvas-node").forEach(function (element) - { - element.addEventListener("dblclick", function (event) - { - fitViewToNode(element); - }); - }); - - // make whole canvas fit to view when double clicked on background - setupOnNode.querySelectorAll(".canvas-background").forEach(function (element) - { - element.addEventListener("dblclick", function (event) - { - fitViewToCanvas(); - }); - }); - - // make canvas draggable / panable - canvasWrapper.addEventListener("mousedown", canvasWrapperMouseDownHandler); - canvasWrapper.addEventListener("touchstart", canvasWrapperMouseDownHandler); - let scrollInterferance = false; - function canvasWrapperMouseDownHandler(mouseDownEv) - { - let touchesDown = mouseDownEv.touches ?? []; - - scrollInterferance = false; - - // if there is already one tough down we don't want to start another mouse down event - // extra fingers are already being handled in the move event below - if (touchesDown.length > 1) return; - - if (mouseDownEv.button == 1 || mouseDownEv.button == 0 || touchesDown.length > 0) - { - let lastPointerPos = getPointerPosition(mouseDownEv); - let startZoom = false; - let lastDistance = 0; - let lastTouchCount = touchesDown.length; - - let mouseMoveHandler = function (mouseMoveEv) - { - let touchesMove = mouseMoveEv.touches ?? []; - - let pointer = getPointerPosition(mouseMoveEv); - - if (lastTouchCount != touchesMove.length) - { - lastPointerPos = pointer; - lastTouchCount = touchesMove.length; - } - - let deltaX = pointer.x - lastPointerPos.x; - let deltaY = pointer.y - lastPointerPos.y; - - if ((mouseDownEv.button == 1 || touchesMove.length == 1) && focusedCanvasNode) - { - let mouseHoriz = Math.abs(deltaX) > Math.abs(deltaY * 1.5); - let mouseVert = Math.abs(deltaY) > Math.abs(deltaX * 1.5); - - // only skip if the focused node can be scrolled in the direction of mouse movement - let sizer = focusedCanvasNode.querySelector(".markdown-preview-sizer"); - if(sizer) - { - let scrollableVert = sizer.scrollHeight > sizer.parentElement.clientHeight + 1; - let scrollableHoriz = sizer.scrollWidth > sizer.parentElement.clientWidth + 1; - - if (((mouseHoriz && scrollableHoriz) || (mouseVert && scrollableVert)) && (window?.navigator?.platform?.startsWith("Win") ?? true)) - { - scrollInterferance = true; - } - else - { - scrollInterferance = false; - } - } - } - - if (mouseDownEv.button == 0 && focusedCanvasNode) - { - if (focusedCanvasNode.querySelector(".canvas-node-content").textContent.trim() != "") - { - scrollInterferance = true; - } - } - - - if (!scrollInterferance) - { - translateCanvas(deltaX, deltaY); - lastPointerPos = pointer; - } - - if (touchesMove.length == 2) - { - let touchCenter = getPointerPosition(mouseMoveEv, false); - let touch1 = getTouchPosition(mouseMoveEv.touches[0]); - let touch2 = getTouchPosition(mouseMoveEv.touches[1]); - let distance = Math.sqrt(Math.pow(touch1.x - touch2.x, 2) + Math.pow(touch1.y - touch2.y, 2)); - - if (!startZoom) - { - startZoom = true; - lastDistance = distance; - } - - let distanceDelta = distance - lastDistance; - let scaleDelta = distanceDelta / lastDistance; - - scaleCanvasAroundPoint(1 + scaleDelta, touchCenter.x, touchCenter.y); - - lastDistance = distance; - } - }; - - let mouseUpHandler = function (mouseUpEv) - { - document.body.removeEventListener("mousemove", mouseMoveHandler); - document.body.removeEventListener("mouseup", mouseUpHandler); - document.body.removeEventListener("mouseenter", mouseEnterHandler); - document.body.removeEventListener("touchmove", mouseMoveHandler); - document.body.removeEventListener("touchend", mouseUpHandler); - document.body.removeEventListener("touchcancel", mouseUpHandler); - scrollInterferance = false; - }; - - let mouseEnterHandler = function (mouseEnterEv) - { - if (mouseEnterEv.buttons == 1 || mouseEnterEv.buttons == 4) return; - - mouseUpHandler(mouseEnterEv); - } - - document.body.addEventListener("mousemove", mouseMoveHandler); - document.body.addEventListener("mouseup", mouseUpHandler); - document.body.addEventListener("mouseenter", mouseEnterHandler); - document.body.addEventListener("touchmove", mouseMoveHandler); - document.body.addEventListener("touchend", mouseUpHandler); - document.body.addEventListener("touchcancel", mouseUpHandler); - } - } - - // get mouse position on the canvas - let mouseX = 0; - let mouseY = 0; - canvasWrapper.addEventListener("mousemove", function (event) - { - let pointer = getPointerPosition(event); - mouseX = pointer.x; - mouseY = pointer.y; - }); - - let scale = 1; - let speed = 0; - let instant = false; - // make canvas zoomable - canvasWrapper.addEventListener("wheel", function (event) - { - if (focusedCanvasNode) - { - // only skip if the focused node can be scrolled - let sizer = focusedCanvasNode.querySelector(".markdown-preview-sizer"); - if(sizer && sizer.scrollHeight > sizer.parentElement.clientHeight) return; - } - - event.preventDefault(); - event.stopPropagation(); - - if(instant) - { - let scale = 1; - scale -= event.deltaY / 700 * scale; - scale = clamp(scale, 0.1, 10); - let viewBounds = getViewBounds(); - scaleCanvasAroundPoint(scale, viewBounds.centerX, viewBounds.centerY); - } - else - { - let isFirstFrame = speed == 0; - speed -= (event.deltaY / 200); - const maxSpeed = 0.14 * scale; - speed = clamp(speed, -maxSpeed, maxSpeed); - if (isFirstFrame) requestAnimationFrame(scrollAnimation); - } - }); - - let dt = 0; - let lastTime = 0; - let averageDt = 0; - function scrollAnimation(currentTime) - { - dt = currentTime - lastTime; - if (lastTime == 0) dt = 30; - lastTime = currentTime; - - averageDt = dt * 0.05 + averageDt * 0.95; - - if (averageDt > 50) - { - console.log("Scrolling too slow, turning on instant scroll"); - instant = true; - return; - } - - let oldScale = scale; - scale += speed * (dt / 1000) * 30; - scale = clamp(scale, 0.1, 10); - - let viewBounds = getViewBounds(); - scaleCanvasAroundPoint(scale / oldScale, mouseX, mouseY); - - speed *= 0.4; - if (Math.abs(speed) < 0.01) - { - speed = 0; - lastTime = 0; - } - else requestAnimationFrame(scrollAnimation); - } - - // fit all nodes to view on initialization after centering the camera - // after any animations have possibly played - setTimeout(fitViewToCanvas, 300); -} - -/**Gets the bounding rect of the voew-content or markdown-preview-sizer*/ -function getViewBounds() -{ - let viewContentRect = viewContent.getBoundingClientRect(); - - let minX = viewContentRect.x; - let minY = viewContentRect.y; - let maxX = viewContentRect.x + viewContentRect.width; - let maxY = viewContentRect.y + viewContentRect.height; - let centerX = viewContentRect.x + viewContentRect.width / 2; - let centerY = viewContentRect.y + viewContentRect.height / 2; - - return { x: minX, y: minY, width: maxX - minX, height: maxY - minY, minX: minX, minY: minY, maxX: maxX, maxY: maxY, centerX: centerX, centerY: centerY }; -} - -/**Gets the bounding rect of all nodes in the canvas*/ -function getNodesBounds() -{ - let minX = Infinity; - let minY = Infinity; - let maxX = -Infinity; - let maxY = -Infinity; - - canvasNodes.forEach(function (node) - { - let nodeRect = node.getBoundingClientRect(); - - if (nodeRect.x < minX) minX = nodeRect.x; - if (nodeRect.y < minY) minY = nodeRect.y; - if (nodeRect.x + nodeRect.width > maxX) maxX = nodeRect.x + nodeRect.width; - if (nodeRect.y + nodeRect.height > maxY) maxY = nodeRect.y + nodeRect.height; - - }); - - let x = minX; - let y = minY; - let width = maxX - minX; - let height = maxY - minY; - let centerX = minX + width / 2; - let centerY = minY + height / 2; - - return { x: x, y: y, width: width, height: height, minX: minX, minY: minY, maxX: maxX, maxY: maxY, centerX: centerX, centerY: centerY }; -} - -function getCanvasBounds() -{ - let canvasRect = canvas.getBoundingClientRect(); - - let x = canvasRect.x; - let y = canvasRect.y; - let width = canvasRect.width; - let height = canvasRect.height; - let centerX = canvasRect.x + canvasRect.width / 2; - let centerY = canvasRect.y + canvasRect.height / 2; - - return { x: x, y: y, width: width, height: height, minX: x, minY: y, maxX: x + width, maxY: y + height, centerX: centerX, centerY: centerY }; -} - -/**Sets the relative scale of the canvas around a point*/ -function scaleCanvasAroundPoint(scaleBy, aroundPointX, aroundPointY) -{ - let canvasBounds = getCanvasBounds(); - - let xCenterToTarget = aroundPointX - canvasBounds.x; - let yCenterToTarget = aroundPointY - canvasBounds.y; - - let xCenterPin = canvasBounds.x + xCenterToTarget * scaleBy; - let yCenterPin = canvasBounds.y + yCenterToTarget * scaleBy; - - let offsetX = aroundPointX - xCenterPin; - let offsetY = aroundPointY - yCenterPin; - - scaleCanvas(scaleBy); - translateCanvas(offsetX, offsetY); - return { x: offsetX, y: offsetY }; -} - -/**Sets the relative scale of the canvas*/ -function scaleCanvas(scaleBy) -{ - let newScale = Math.max(scaleBy * canvas.style.scale, 0.001); - canvas.style.scale = newScale; - canvasWrapper.style.setProperty("--zoom-multiplier", (1/(Math.sqrt(newScale))) ); -} - -/**Sets the relative translation of the canvas*/ -function translateCanvas(x, y) -{ - let translate = canvas.style.translate; - let split = translate.split(" "); - let translateX = split.length > 0 ? parseFloat(translate.split(" ")[0].trim()) : 0; - let translateY = split.length > 1 ? parseFloat(translate.split(" ")[1].trim()) : translateX; - - canvas.style.translate = `${translateX + x}px ${translateY + y}px`; -} - -/**Sets the absolute center of the view*/ -function setViewCenter(x, y) -{ - let viewContentRect = getViewBounds(); - let deltaX = viewContentRect.centerX - x; - let deltaY = viewContentRect.centerY - y; - - translateCanvas(deltaX, deltaY); -} - -function getCanvasTranslation() -{ - let translate = canvas.style.translate; - let split = translate.split(" "); - let translateX = split.length > 0 ? parseFloat(translate.split(" ")[0].trim()) : 0; - let translateY = split.length > 1 ? parseFloat(translate.split(" ")[1].trim()) : translateX; - - return { x: translateX, y: translateY }; -} - -/**Sets the absolute scale of the canvas background pattern*/ -function scaleCanvasBackground(scaleBy) -{ - let scaleX = scaleBy * canvasBackgroundPattern.getAttribute("width"); - let scaleY = scaleBy * canvasBackgroundPattern.getAttribute("height"); - - canvasBackgroundPattern.setAttribute("width", scaleX); - canvasBackgroundPattern.setAttribute("height", scaleY); -} - -/**Sets the absolute translation of the canvas background pattern*/ -function translateCanvasBackground(x, y) -{ - canvasBackgroundPattern.setAttribute("x", x + canvasBackgroundPattern.getAttribute("x")); - canvasBackgroundPattern.setAttribute("y", y + canvasBackgroundPattern.getAttribute("y")); -} - -/**Fits the view to contain the given node*/ -function fitViewToNode(node) -{ - let nodeRect = getElBounds(node); - let viewContentRect = getViewBounds(); - let canvasBounds = getCanvasBounds(); - - let scale = 0.8 * Math.min(viewContentRect.width/nodeRect.width, viewContentRect.height/nodeRect.height); - - let canvasX = canvasBounds.x; - let canvasY = canvasBounds.y; - - let canvToNodeX = (nodeRect.centerX - canvasX) * scale; - let canvToNodeY = (nodeRect.centerY - canvasY) * scale; - - let newNodeX = canvasX + canvToNodeX; - let newNodeY = canvasY + canvToNodeY; - - let deltaX = viewContentRect.centerX - newNodeX; - let deltaY = viewContentRect.centerY - newNodeY; - - nodeRect = getElBounds(node); - - canvas.style.transition = "scale 0.5s cubic-bezier(0.5, -0.1, 0.5, 1.1), translate 0.5s cubic-bezier(0.5, -0.1, 0.5, 1.1)"; - scaleCanvas(scale); - translateCanvas(deltaX, deltaY); - - setTimeout(function() - { - canvas.style.transition = ""; - }, 550); -} - -/**Fits the view to contain all nodes in the graph*/ -function fitViewToCanvas() -{ - let nodesRect = getNodesBounds(); - let viewContentRect = getViewBounds(); - let canvasBounds = getCanvasBounds(); - - let scale = 0.8 * Math.min(viewContentRect.width/nodesRect.width, viewContentRect.height/nodesRect.height); - - let canvasX = canvasBounds.x; - let canvasY = canvasBounds.y; - - let canvToNodeX = (nodesRect.centerX - canvasX) * scale; - let canvToNodeY = (nodesRect.centerY - canvasY) * scale; - - let newNodeX = canvasX + canvToNodeX; - let newNodeY = canvasY + canvToNodeY; - - let deltaX = viewContentRect.centerX - newNodeX; - let deltaY = viewContentRect.centerY - newNodeY; - - canvas.style.transition = "scale 0.5s cubic-bezier(0.5, -0.1, 0.5, 1.1), translate 0.5s cubic-bezier(0.5, -0.1, 0.5, 1.1)"; - scaleCanvas(scale); - translateCanvas(deltaX, deltaY); - - setTimeout(function() - { - canvas.style.transition = ""; - }, 550); -} - -//#endregion - -//#region ----------------- Callouts ----------------- - -function setupCallouts(setupOnNode) -{ - // MAKE CALLOUTS COLLAPSIBLE - // if the callout title is clicked, toggle the display of .callout-content - setupOnNode.querySelectorAll(".callout.is-collapsible .callout-title").forEach(function (element) - { - element.addEventListener("click", function () - { - var parent = this.parentElement; - - parent.classList.toggle("is-collapsed"); - element.querySelector(".callout-fold").classList.toggle("is-collapsed"); - - slideToggle(parent.querySelector(".callout-content"), 100); - }); - }); - -} - -//#endregion - -//#region ----------------- Checkboxes ----------------- - -function setupCheckboxes(setupOnNode) -{ - // Fix checkboxed toggling .is-checked - setupOnNode.querySelectorAll(".task-list-item-checkbox").forEach(function (element) - { - element.addEventListener("click", function () - { - var parent = this.parentElement; - parent.classList.toggle("is-checked"); - parent.setAttribute("data-task", parent.classList.contains("is-checked") ? "x" : " "); - }); - }); - - setupOnNode.querySelectorAll(`.plugin-tasks-list-item input[type="checkbox"]`).forEach(function(checkbox) - { - checkbox.checked = checkbox.parentElement.classList.contains("is-checked"); - }); - - setupOnNode.querySelectorAll('.kanban-plugin__item.is-complete').forEach(function(checkbox) - { - checkbox.querySelector('input[type="checkbox"]').checked = true; - }); -} - -//#endregion - -//#region ----------------- Code Blocks ----------------- - -function setupCodeblocks(setupOnNode) -{ - // make code snippet block copy button copy the code to the clipboard - setupOnNode.querySelectorAll(".copy-code-button").forEach(function (element) - { - element.addEventListener("click", function () - { - var code = this.parentElement.querySelector("code").textContent; - navigator.clipboard.writeText(code); - this.textContent = "Copied!"; - // set a timeout to change the text back - setTimeout(function () - { - setupOnNode.querySelectorAll(".copy-code-button").forEach(function (button) - { - button.textContent = "Copy"; - }); - }, 2000); - }); - }); -} - -//#endregion - -//#region ----------------- Links ----------------- - -function setupLinks(setupOnNode) -{ - setupOnNode.querySelectorAll(".internal-link, a.tag, .tree-link, .footnote-link").forEach(function(link) - { - link.addEventListener("click", function(event) - { - let target = link.getAttribute("href"); - - event.preventDefault(); - event.stopPropagation(); - - if(!target) - { - console.log("No target found for link"); - return; - } - - let relativePathnameStrip = relativePathname.split("#")[0].split("?")[0]; - - if(target.startsWith("#") || target.startsWith("?")) target = relativePathnameStrip + target; - - loadDocument(target, true, !link.classList.contains("tree-link")); - }); - }); -} - -//#endregion - -//#region ----------------- Sidebars ----------------- - -function setupSidebars() -{ - if (!rightSidebar || !leftSidebar) return; - - //#region sidebar object references - sidebarCollapseIcons[0].otherIcon = sidebarCollapseIcons[1]; - sidebarCollapseIcons[1].otherIcon = sidebarCollapseIcons[0]; - sidebarCollapseIcons[0].gutter = sidebarGutters[0]; - sidebarCollapseIcons[1].gutter = sidebarGutters[1]; - sidebarCollapseIcons[0].sidebar = sidebars[0]; - sidebarCollapseIcons[1].sidebar = sidebars[1]; - sidebarGutters[0].otherGutter = sidebarGutters[1]; - sidebarGutters[1].otherGutter = sidebarGutters[0]; - sidebarGutters[0].collapseIcon = sidebarCollapseIcons[0]; - sidebarGutters[1].collapseIcon = sidebarCollapseIcons[1]; - sidebars[0].otherSidebar = sidebars[1]; - sidebars[1].otherSidebar = sidebars[0]; - sidebars[0].gutter = sidebarGutters[0]; - sidebars[1].gutter = sidebarGutters[1]; - //#endregion - - sidebars.forEach(function (sidebar) - { - sidebar.collapsed = sidebar.classList.contains("is-collapsed"); - sidebar.collapse = function (collapsed = true) - { - if (!collapsed && this.temporarilyCollapsed && deviceSize == "large-screen") this.gutter.collapse(true); - - - if (!collapsed && document.body.classList.contains("floating-sidebars")) - { - function clickOutsideCollapse(event) - { - // don't allow bubbling into sidebar - if (event.target.closest(".sidebar")) return; - - sidebar.collapse(true); - document.body.removeEventListener("click", clickOutsideCollapse); - } - - document.body.addEventListener("click", clickOutsideCollapse); - } - - // if there isn't enough space for both sidebars then close the other one - if (deviceSize == "phone") - { - if (!collapsed) sidebar.otherSidebar.fullCollapse(true, true); - if (collapsed) sidebar.gutter.otherGutter.collapse(false, true); - } - - if (deviceSize == "tablet") - { - if (!collapsed) sidebar.otherSidebar.collapse(true); - } - - this.classList.toggle("is-collapsed", collapsed); - this.collapsed = collapsed; - } - sidebar.temporaryCollapse = function (collapsed = true) - { - this.temporarilyCollapsed = true; - this.collapse(true); - this.gutter.collapse(false); - this.collapsed = collapsed; - } - sidebar.fullCollapse = function (collapsed = true, force = false) - { - this.collapse(collapsed); - this.gutter.collapse(true, force); - this.collapsed = collapsed; - } - sidebar.toggleCollapse = function () - { - this.collapse(!this.collapsed); - } - sidebar.toggleFullCollapse = function () - { - this.fullCollapse(!this.collapsed); - } - }); - - sidebarGutters.forEach(function (gutter) - { - gutter.collapsed = gutter.classList.contains("is-collapsed"); - gutter.collapse = function (collapsed, force = false) - { - if(!force) return; - - this.classList.toggle("is-collapsed", collapsed); - this.collapsed = collapsed; - } - gutter.toggleCollapse = function () - { - this.collapse(!this.collapsed); - } - }); - - sidebarCollapseIcons.forEach(function (icon) - { - icon.addEventListener("click", function (event) - { - event.stopPropagation(); - icon.sidebar.toggleCollapse(); - }); - }); - - if (!isMobile()) setupSidebarResize(); -} - -function setupSidebarResize() -{ - let leftHandle = document.querySelector('.sidebar-left .sidebar-handle'); - let rightHandle = document.querySelector('.sidebar-right .sidebar-handle'); - if (!leftHandle || !rightHandle) return; - let resizingSidebar = null; - - let minResizeWidth = parseFloat(getComputedStyle(leftHandle.parentElement).fontSize) * 15; - let collapseWidth = minResizeWidth / 4.0; - - let rightWidth = localStorage.getItem('sidebar-right-width'); - let leftWidth = localStorage.getItem('sidebar-left-width'); - if (rightWidth) document.querySelector('.sidebar-right').style.setProperty('--sidebar-width', rightWidth); - if (leftWidth) document.querySelector('.sidebar-left').style.setProperty('--sidebar-width', leftWidth); - - function resizeMove(e) - { - if (!resizingSidebar) return; - - let isLeft = resizingSidebar.classList.contains("sidebar-left"); - var distance = isLeft ? e.clientX : window.innerWidth - e.clientX; - var newWidth = `min(max(${distance}px, 15em), 40vw)`; // 15em is minResizeWidth - - if (distance < collapseWidth) - { - resizingSidebar.collapse(true); - resizingSidebar.style.removeProperty('transition-duration'); - } - else - { - resizingSidebar.collapse(false); - resizingSidebar.style.setProperty('--sidebar-width', newWidth); - if (distance > minResizeWidth) resizingSidebar.style.transitionDuration = "0s"; - } - } - - function handleClick(e) - { - resizingSidebar = e.target.closest('.sidebar'); - resizingSidebar.classList.add('is-resizing'); - document.addEventListener('pointermove', resizeMove); - document.addEventListener('pointerup', function () - { - document.removeEventListener('pointermove', resizeMove); - var finalWidth = getComputedStyle(resizingSidebar).getPropertyValue('--sidebar-width'); - - let isLeft = resizingSidebar.classList.contains("sidebar-left"); - localStorage.setItem(isLeft ? 'sidebar-left-width' : 'sidebar-right-width', finalWidth); - resizingSidebar.classList.remove('is-resizing'); - resizingSidebar.style.removeProperty('transition-duration'); - }); - } - - leftHandle.addEventListener('pointerdown', handleClick); - rightHandle.addEventListener('pointerdown', handleClick); - - // reset sidebar width on double click - function resetSidebarEvent(e) - { - let sidebar = e.target.closest('.sidebar'); - if (sidebar) - { - sidebar.style.removeProperty('transition-duration'); - sidebar.style.removeProperty('--sidebar-width'); - let isLeft = sidebar.classList.contains("sidebar-left"); - localStorage.removeItem(isLeft ? 'sidebar-left-width' : 'sidebar-right-width'); - } - } - - leftHandle.addEventListener('dblclick', resetSidebarEvent); - rightHandle.addEventListener('dblclick', resetSidebarEvent); -} - -/**Get the computed target sidebar width in px*/ -function getSidebarWidthProp() -{ - return getComputedPixelValue("--sidebar-width"); -} - -//#endregion - -//#region ----------------- Theme ----------------- - -function setupThemeToggle() -{ - if (!themeToggle) return; - - if (localStorage.getItem("theme") != null) - { - setThemeToggle(localStorage.getItem("theme") == "light"); - } - - // set initial toggle state based on body theme class - if (document.body.classList.contains("theme-light")) - { - setThemeToggle(true); - } - else - { - setThemeToggle(false); - } - - function setThemeToggle(state, instant = false) - { - - themeToggle.checked = state; - - if (instant) - { - var oldTransition = document.body.style.transition; - document.body.style.transition = "none"; - } - - if(!themeToggle.classList.contains("is-checked") && state) - { - themeToggle.classList.add("is-checked"); - } - else if (themeToggle.classList.contains("is-checked") && !state) - { - themeToggle.classList.remove("is-checked"); - } - - if(!state) - { - if (document.body.classList.contains("theme-light")) - { - document.body.classList.remove("theme-light"); - } - - if (!document.body.classList.contains("theme-dark")) - { - document.body.classList.add("theme-dark"); - } - } - else - { - if (document.body.classList.contains("theme-dark")) - { - document.body.classList.remove("theme-dark"); - } - - if (!document.body.classList.contains("theme-light")) - { - document.body.classList.add("theme-light"); - } - } - - if (instant) - { - setTimeout(function() - { - document.body.style.transition = oldTransition; - }, 100); - } - - localStorage.setItem("theme", state ? "light" : "dark"); - } - - document.querySelector(".theme-toggle-input")?.addEventListener("change", event => - { - let newVal = !(localStorage.getItem("theme") == "light"); - console.log("Theme toggle changed to: " + newVal); - setThemeToggle(newVal); - }); -} - -//#endregion - -//#region ----------------- Scroll ----------------- - -let flashElement = null; -let flashAnimation = null; -function scrollIntoView(element, options, animate = true) -{ - setTreeCollapsed(element, false, animate); - - const flashTiming = - { - duration: 1500, - iterations: 1, - delay: 300, - }; - - const flashAnimationData = - [ - { opacity: 0 }, - { opacity: 0.8 }, - { opacity: 0.8 }, - { opacity: 0.8 }, - { opacity: 0.8 }, - { opacity: 0.8 }, - { opacity: 0 }, - ]; - - if(flashElement) - { - flashElement.remove(); - flashAnimation.cancel(); - } - - flashElement = document.createElement("div"); - flashElement.classList.add("scroll-highlight"); - element.appendChild(flashElement); - - if(options) flashElement.scrollIntoView({ behavior: animate ? "smooth" : "auto", ...options }); - else flashElement.scrollIntoView({ behavior: animate ? "smooth" : "auto" }); - - var savePos = element.style.position; - element.style.position = "relative"; - - flashAnimation = flashElement.animate(flashAnimationData, flashTiming); - flashAnimation.onfinish = function() - { - flashElement.remove(); - element.style.position = savePos; - } -} - -function setupScroll(setupOnNode) -{ - // hide elements clipped by scrollable areas in markdown-preview-view elements - if(documentType != "canvas") return; - - let markdownViews = Array.from(setupOnNode.querySelectorAll(".markdown-preview-view")); - let nextMarkdownViewId = 0; - - let marginMultiplier = 0.1; - let maxMargin = 150; - let margin = 0; - - markdownViews.forEach(async function (view) - { - console.log("Setting up markdown view"); - let headers = Array.from(view.querySelectorAll(".heading-wrapper")); - - view.updateVisibleWindowMarkdown = function updateVisibleWindowMarkdown(allowVirtualization = true, allowDevirtualization = true) - { - let scrollBounds = view.getBoundingClientRect(); - margin = Math.min(scrollBounds.height * marginMultiplier, maxMargin); - let scrollBoundsTop = scrollBounds.top - margin; - let scrollBoundsBottom = scrollBounds.bottom + margin; - - async function updateHeader(header) - { - let bounds = header?.getBoundingClientRect(); - - if (!bounds) return; - - let isClipped = (bounds.top < scrollBoundsTop && bounds.bottom < scrollBoundsTop) || (bounds.top > scrollBoundsBottom && bounds.bottom > scrollBoundsBottom); - - if (isClipped && allowVirtualization) - { - header.hide(); - } - else if (!isClipped && allowDevirtualization) - { - header.show(); - } - } - - for (let i = 0; i < headers.length; i++) - { - let h = headers[i]; - if(h) updateHeader(h); - } - } - - let lastScrollTop = 0; - view.addEventListener("scroll", function() - { - if (Math.abs(view.scrollTop - lastScrollTop) > margin / 3) - { - view.updateVisibleWindowMarkdown(false, true); - } - - lastScrollTop = view.scrollTop; - }); - }); - - async function periodicUpdate() - { - if(markdownViews.length > 0) - { - markdownViews[nextMarkdownViewId].updateVisibleWindowMarkdown(); - nextMarkdownViewId = (nextMarkdownViewId + 1) % markdownViews.length; - } - } - - setInterval(periodicUpdate, 200); -} - -//#endregion - -//#region ----------------- Plugins ----------------- - -// Excalidraw -function setupExcalidraw(setupOnNode) -{ - setupOnNode.querySelectorAll(".excalidraw-svg svg").forEach(function (svg) - { - let isLight = svg.querySelector("rect").getAttribute("fill") > "#7F7F7F"; - svg.classList.add(isLight ? "light" : "dark"); - }); -} - - -//#endregion - -//#region ----------------- Search ----------------- - -// search box -let index; -let searchResults; - -async function setupSearch() -{ - if (isFileProtocol) return; - searchInput = document.querySelector('input[type="search"]'); - if (!searchInput) return; - - const indexResp = await fetch('lib/search-index.json'); - const indexJSON = await indexResp.text(); - index = MiniSearch.loadJSON(indexJSON, { fields: ['title', 'path', 'tags', 'headers'] }); - - const inputClear = document.querySelector('.search-input-clear-button'); - - inputClear.addEventListener('click', (event) => - { - search(""); - }); - - searchInput.addEventListener('input', (event) => - { - const query = event.target.value ?? ""; - - if (startsWithAny(query, ["#", "tag:", "title:", "name:", "header:", "H:"])) - { - searchInput.style.color = "var(--text-accent)"; - } - else - { - searchInput.style.color = ""; - } - - search(query); - }); - - searchResults = document.createElement('div'); - searchResults.setAttribute('id', 'search-results'); -} - -async function search(query) -{ - searchInput.value = query; - - // parse special query filters - let searchFields = ['title', 'content', 'tags', 'headers', 'path']; - if (query.startsWith("#")) searchFields = ['tags', 'headers']; - if (query.startsWith("tag:")) - { - query = query.substring(query.indexOf(":") + 1); - searchFields = ['tags']; - } - if (startsWithAny(query, ["title:", "name:"])) - { - query = query.substring(query.indexOf(":") + 1); - searchFields = ['title']; - } - if (startsWithAny(query, ["header:", "H:"])) - { - query = query.substring(query.indexOf(":") + 1); - searchFields = ['headers']; - } - if (startsWithAny(query, ["path:"])) - { - query = query.substring(query.indexOf(":") + 1); - searchFields = ['path']; - } - - if (query.length >= 1) - { - const results = index.search(query, { prefix: true, fuzzy: 0.3, boost: { title: 4, headers: 3, tags: 2, path: 1 }, fields: searchFields }); - // search through the file tree and hide documents that don't match the search - let showPaths = []; - let hintLabels = []; - for (let result of results) - { - // only show the most relevant results - if (((result.score < results[0].score * 0.33 || showPaths.length > 12) && showPaths.length > 3) || result.score < results[0].score * 0.1) break; - showPaths.push(result.path); - - let hints = []; - let breakEarly = false; - for (match in result.match) - { - if (result.match[match].includes("headers")) - { - for (let header of result.headers) - { - if (header.toLowerCase().includes(match.toLowerCase())) - { - hints.push(header); - if (query.toLowerCase() != match.toLowerCase()) - { - breakEarly = true; - break; - } - } - } - } - - if (breakEarly) break; - } - - hintLabels.push(hints); - } - - let fileTree = document.querySelector(".file-tree"); - if (fileTree) - { - // filter the file tree and sort it by the order of the search results - filterFileTree(showPaths, hintLabels, query).then(() => - sortFileTreeDocuments((a, b) => - { - if (!a || !b) return 0; - let aPath = getVaultRelativePath(a.firstChild.href); - let bPath = getVaultRelativePath(b.firstChild.href); - return showPaths.findIndex((path) => aPath.startsWith(path)) - showPaths.findIndex((path) => bPath.startsWith(path)); - })); - } - else - { - const list = document.createElement('div'); - results.slice(0, 10).forEach(result => { - - const item = document.createElement('div'); - item.classList.add('search-result'); - - const link = document.createElement('a'); - link.classList.add('tree-link'); - - const searchURL = result.path + '?mark=' + encodeURIComponent(query); - link.setAttribute('href', searchURL); - link.appendChild(document.createTextNode(result.title)); - item.appendChild(link); - list.append(item); - }); - - searchResults.replaceChildren(list); - searchInput.parentElement.after(searchResults); - initializePageEvents(searchResults); - } - - } - else - { - if (searchResults && searchResults.parentElement) searchResults.parentNode.removeChild(searchResults); - clearCurrentDocumentSearch(); - if (fileTree) clearFileTreeFilter().then(() => sortFileTreeAlphabetically()); - } - -} - -function startsWithAny(string, prefixes) -{ - for (let i = 0; i < prefixes.length; i++) - { - if (string.startsWith(prefixes[i])) return true; - } - - return false; -} - -async function searchCurrentDocument(query) -{ - clearCurrentDocumentSearch(); - const textNodes = getTextNodes(document.querySelector(".markdown-preview-sizer") ?? documentContainer); - - textNodes.forEach(async node => - { - const content = node.nodeValue; - const newContent = content.replace(new RegExp(query, 'gi'), match => `${match}`); - - if (newContent !== content) - { - const tempDiv = document.createElement('div'); - tempDiv.innerHTML = newContent; - - const newNodes = Array.from(tempDiv.childNodes); - - newNodes.forEach(newNode => - { - if (newNode.nodeType != Node.TEXT_NODE) - { - newNode.setAttribute('class', 'search-mark'); - - } - node.parentNode.insertBefore(newNode, node); - }); - - node.parentNode.removeChild(node); - } - }); - - let firstMark = document.querySelector(".search-mark"); - - // wait for page to fade in - setTimeout(() => - { - if(firstMark) scrollIntoView(firstMark, { behavior: "smooth", block: "start" }); - }, 500); -} - -function clearCurrentDocumentSearch() -{ - document.querySelectorAll(".search-mark").forEach(node => - { - node.outerHTML = node.innerHTML; - }); -} - -function getTextNodes(element) -{ - const textNodes = []; - const walker = document.createTreeWalker(element, NodeFilter.SHOW_TEXT, null, false); - - let node; - while (node = walker.nextNode()) { - textNodes.push(node); - } - - return textNodes; -} - -//#endregion diff --git a/.obsidian/plugins/obsidian-webpage-export-master/docker-compose.yaml b/.obsidian/plugins/obsidian-webpage-export-master/docker-compose.yaml deleted file mode 100644 index b4af00f4..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/docker-compose.yaml +++ /dev/null @@ -1,12 +0,0 @@ -services: - web: - build: . - ports: - - "5900:5900" - - volumes: - - ./vault:/vault - - ./output:/output - - ./data.json:/config.json - - dns: 8.8.8.8 diff --git a/.obsidian/plugins/obsidian-webpage-export-master/docker/inject-enable.js b/.obsidian/plugins/obsidian-webpage-export-master/docker/inject-enable.js deleted file mode 100644 index 0e3d889f..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/docker/inject-enable.js +++ /dev/null @@ -1,22 +0,0 @@ -setTimeout(async () => { - await this.app.plugins.setEnable(true); - - await this.app.plugins.enablePlugin('webpage-html-export'); - - const plugin = await this.app.plugins.getPlugin('webpage-html-export'); - - try { - await plugin.exportDocker(); - } catch(_) { - const temp = plugin.settings.exportPath; - plugin.settings.exportPath = '/output'; - - await this.app.commands.commands['webpage-html-export:export-html-vault'].callback() - - plugin.settings.exportPath = temp; - } - - const process = require('child_process'); - - process.exec('pkill -9 1'); -}, 5000); diff --git a/.obsidian/plugins/obsidian-webpage-export-master/docker/run.sh b/.obsidian/plugins/obsidian-webpage-export-master/docker/run.sh deleted file mode 100644 index 7909ab9a..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/docker/run.sh +++ /dev/null @@ -1,14 +0,0 @@ -# Copy the plugin and config to the vault, inject script and start Obsidian on startup -mkdir -p /vault/.obsidian/plugins/webpage-html-export - -if [ -f /config.json ]; then cp /config.json /vault/.obsidian/plugins/webpage-html-export/data.json; fi - -if [ ! -f /vault/.obsidian/plugins/webpage-html-export/main.js ]; then - cp /plugin/* /vault/.obsidian/plugins/webpage-html-export/ -else - sed -i 's|callback: () => {|callback: async () => {|1' /vault/.obsidian/plugins/webpage-html-export/main.js - sed -i 's|HTMLExporter.export(true)|await HTMLExporter.export(true)|1' /vault/.obsidian/plugins/webpage-html-export/main.js -fi - -python3 -m electron_inject -r /inject-enable.js - obsidian --remote-allow-origins=* --no-sandbox --no-xshm --disable-dev-shm-usage --disable-gpu --disable-software-rasterizer --remote-debugging-port=37941 -x11vnc -forever -nopw -create diff --git a/.obsidian/plugins/obsidian-webpage-export-master/esbuild.config.mjs b/.obsidian/plugins/obsidian-webpage-export-master/esbuild.config.mjs deleted file mode 100644 index bd21e3d3..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/esbuild.config.mjs +++ /dev/null @@ -1,50 +0,0 @@ -import esbuild from "esbuild"; -import process from "process"; -import builtins from 'builtin-modules' - -const banner = -`/* -THIS IS A GENERATED/BUNDLED FILE BY ESBUILD -if you want to view the source, please visit the github repository of this plugin -*/ -`; - -const prod = (process.argv[2] === 'production'); - -esbuild.build({ - loader: { - '.txt.js': 'text', - '.txt.css': 'text', - '.wasm': 'binary', - '.png': 'binary', - }, - banner: { - js: banner, - }, - entryPoints: ['./scripts/main.ts'], - bundle: true, - external: [ - 'obsidian', - 'electron', - '@codemirror/autocomplete', - '@codemirror/collab', - '@codemirror/commands', - '@codemirror/language', - '@codemirror/lint', - '@codemirror/search', - '@codemirror/state', - '@codemirror/view', - '@lezer/common', - '@lezer/highlight', - '@lezer/lr', - 'node:buffer', - 'node:stream', - ...builtins], - format: 'cjs', - watch: !prod, - target: 'es2018', - logLevel: "info", - sourcemap: prod ? false : 'inline', - treeShaking: true, - outfile: 'main.js' -}).catch(() => process.exit(1)); diff --git a/.obsidian/plugins/obsidian-webpage-export-master/manifest-beta.json b/.obsidian/plugins/obsidian-webpage-export-master/manifest-beta.json deleted file mode 100644 index fca93ec3..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/manifest-beta.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "id": "webpage-html-export", - "name": "Webpage HTML Export", - "version": "1.9.0-3b", - "minAppVersion": "1.6.0", - "description": "Export full websites or html documents from single files, canvas pages, or whole vaults. Similar to obsidian's publish or digital garden, but with direct access to the exported HTML. Focuses on flexibility, features, and style parity.", - "author": "Nathan George", - "authorUrl": "https://github.com/KosmosisDire/obsidian-webpage-export", - "isDesktopOnly": true, - "fundingUrl": "https://www.buymeacoffee.com/nathangeorge", - "updateNote": "" -} diff --git a/.obsidian/plugins/obsidian-webpage-export-master/manifest.json b/.obsidian/plugins/obsidian-webpage-export-master/manifest.json deleted file mode 100644 index 0896a71a..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/manifest.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "id": "webpage-html-export", - "name": "Webpage HTML Export", - "version": "1.8.01", - "minAppVersion": "1.4.0", - "description": "Export html from single files, canvas pages, or whole vaults. Direct access to the exported HTML files allows you to publish your digital garden anywhere. Focuses on flexibility, features, and style parity.", - "author": "Nathan George", - "authorUrl": "https://github.com/KosmosisDire/obsidian-webpage-export", - "isDesktopOnly": true, - "fundingUrl": "https://www.buymeacoffee.com/nathangeorge", - "updateNote": "This is a quick patch to fix the style issue\ncaused by the obsidian 1.5.8 update.\nIt is not newer than the current 1.8.1 beta." -} diff --git a/.obsidian/plugins/obsidian-webpage-export-master/package-lock.json b/.obsidian/plugins/obsidian-webpage-export-master/package-lock.json deleted file mode 100644 index 8defd56d..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/package-lock.json +++ /dev/null @@ -1,5567 +0,0 @@ -{ - "name": "obsidian-webpage-export", - "version": "1.3.2", - "lockfileVersion": 2, - "requires": true, - "packages": { - "": { - "name": "obsidian-webpage-export", - "version": "1.3.2", - "license": "GPL-3.0", - "dependencies": { - "file-type": "^19.0.0", - "html-minifier-terser": "^7.2.0", - "mime": "^3.0.0", - "minisearch": "^6.3.0", - "rss": "^1.2.2", - "upath": "^2.0.1" - }, - "devDependencies": { - "@types/node": "^16.11.6", - "@types/rss": "^0.0.32", - "@typescript-eslint/eslint-plugin": "5.29.0", - "@typescript-eslint/parser": "5.29.0", - "builtin-modules": "3.3.0", - "electron": "^26.1.0", - "esbuild": "0.14.47", - "obsidian": "^1.4.11", - "tslib": "2.4.0", - "typescript": "4.7.4" - } - }, - "node_modules/@codemirror/state": { - "version": "6.1.2", - "resolved": "https://registry.npmjs.org/@codemirror/state/-/state-6.1.2.tgz", - "integrity": "sha512-Mxff85Hp5va+zuj+H748KbubXjrinX/k28lj43H14T2D0+4kuvEFIEIO7hCEcvBT8ubZyIelt9yGOjj2MWOEQA==", - "dev": true, - "peer": true - }, - "node_modules/@codemirror/view": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.4.0.tgz", - "integrity": "sha512-Kv32b6Tn7QVwFbj/EDswTLSocjk5kgggF6zzBFAL4o4hZ/vmtFD155+EjH1pVlbfoDyVC2M6SedPsMrwYscgNg==", - "dev": true, - "peer": true, - "dependencies": { - "@codemirror/state": "^6.0.0", - "style-mod": "^4.0.0", - "w3c-keyname": "^2.2.4" - } - }, - "node_modules/@electron/get": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@electron/get/-/get-2.0.3.tgz", - "integrity": "sha512-Qkzpg2s9GnVV2I2BjRksUi43U5e6+zaQMcjoJy0C+C5oxaKl+fmckGDQFtRpZpZV0NQekuZZ+tGz7EA9TVnQtQ==", - "dev": true, - "dependencies": { - "debug": "^4.1.1", - "env-paths": "^2.2.0", - "fs-extra": "^8.1.0", - "got": "^11.8.5", - "progress": "^2.0.3", - "semver": "^6.2.0", - "sumchecker": "^3.0.1" - }, - "engines": { - "node": ">=12" - }, - "optionalDependencies": { - "global-agent": "^3.0.0" - } - }, - "node_modules/@electron/get/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/@eslint/eslintrc": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.3.tgz", - "integrity": "sha512-uj3pT6Mg+3t39fvLrj8iuCIJ38zKO9FpGtJ4BBJebJhEwjoT+KLVNCcHT5QC9NGRIEi7fZ0ZR8YRb884auB4Lg==", - "dev": true, - "peer": true, - "dependencies": { - "ajv": "^6.12.4", - "debug": "^4.3.2", - "espree": "^9.4.0", - "globals": "^13.15.0", - "ignore": "^5.2.0", - "import-fresh": "^3.2.1", - "js-yaml": "^4.1.0", - "minimatch": "^3.1.2", - "strip-json-comments": "^3.1.1" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/@humanwhocodes/config-array": { - "version": "0.11.7", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.7.tgz", - "integrity": "sha512-kBbPWzN8oVMLb0hOUYXhmxggL/1cJE6ydvjDIGi9EnAGUyA7cLVKQg+d/Dsm+KZwx2czGHrCmMVLiyg8s5JPKw==", - "dev": true, - "peer": true, - "dependencies": { - "@humanwhocodes/object-schema": "^1.2.1", - "debug": "^4.1.1", - "minimatch": "^3.0.5" - }, - "engines": { - "node": ">=10.10.0" - } - }, - "node_modules/@humanwhocodes/module-importer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", - "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", - "dev": true, - "peer": true, - "engines": { - "node": ">=12.22" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/nzakas" - } - }, - "node_modules/@humanwhocodes/object-schema": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", - "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", - "dev": true, - "peer": true - }, - "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", - "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", - "dependencies": { - "@jridgewell/set-array": "^1.0.1", - "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.9" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", - "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/set-array": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", - "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/source-map": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.5.tgz", - "integrity": "sha512-UTYAUj/wviwdsMfzoSJspJxbkH5o1snzwX0//0ENX1u/55kkZZkcTZP6u9bwKGkv+dkk9at4m1Cpt0uY80kcpQ==", - "dependencies": { - "@jridgewell/gen-mapping": "^0.3.0", - "@jridgewell/trace-mapping": "^0.3.9" - } - }, - "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.15", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", - "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==" - }, - "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.22", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.22.tgz", - "integrity": "sha512-Wf963MzWtA2sjrNt+g18IAln9lKnlRp+K2eH4jjIoF1wYeq3aMREpG09xhlhdzS0EjwU7qmUJYangWa+151vZw==", - "dependencies": { - "@jridgewell/resolve-uri": "^3.1.0", - "@jridgewell/sourcemap-codec": "^1.4.14" - } - }, - "node_modules/@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dev": true, - "dependencies": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dev": true, - "dependencies": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@sindresorhus/is": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz", - "integrity": "sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sindresorhus/is?sponsor=1" - } - }, - "node_modules/@szmarczak/http-timer": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-4.0.6.tgz", - "integrity": "sha512-4BAffykYOgO+5nzBWYwE3W90sBgLJoUPRWWcL8wlyiM8IB8ipJz3UMJ9KXQd1RKQXpKp8Tutn80HZtWsu2u76w==", - "dev": true, - "dependencies": { - "defer-to-connect": "^2.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@tokenizer/token": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/@tokenizer/token/-/token-0.3.0.tgz", - "integrity": "sha512-OvjF+z51L3ov0OyAU0duzsYuvO01PH7x4t6DJx+guahgTnBHkhJdG7soQeTSFLWN3efnHyibZ4Z8l2EuWwJN3A==" - }, - "node_modules/@types/cacheable-request": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/@types/cacheable-request/-/cacheable-request-6.0.3.tgz", - "integrity": "sha512-IQ3EbTzGxIigb1I3qPZc1rWJnH0BmSKv5QYTalEwweFvyBDLSAe24zP0le/hyi7ecGfZVlIVAg4BZqb8WBwKqw==", - "dev": true, - "dependencies": { - "@types/http-cache-semantics": "*", - "@types/keyv": "^3.1.4", - "@types/node": "*", - "@types/responselike": "^1.0.0" - } - }, - "node_modules/@types/codemirror": { - "version": "5.60.8", - "resolved": "https://registry.npmjs.org/@types/codemirror/-/codemirror-5.60.8.tgz", - "integrity": "sha512-VjFgDF/eB+Aklcy15TtOTLQeMjTo07k7KAjql8OK5Dirr7a6sJY4T1uVBDuTVG9VEmn1uUsohOpYnVfgC6/jyw==", - "dev": true, - "dependencies": { - "@types/tern": "*" - } - }, - "node_modules/@types/estree": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", - "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", - "dev": true - }, - "node_modules/@types/http-cache-semantics": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.1.tgz", - "integrity": "sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ==", - "dev": true - }, - "node_modules/@types/json-schema": { - "version": "7.0.11", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", - "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", - "dev": true - }, - "node_modules/@types/keyv": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/@types/keyv/-/keyv-3.1.4.tgz", - "integrity": "sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==", - "dev": true, - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@types/node": { - "version": "16.18.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.3.tgz", - "integrity": "sha512-jh6m0QUhIRcZpNv7Z/rpN+ZWXOicUUQbSoWks7Htkbb9IjFQj4kzcX/xFCkjstCj5flMsN8FiSvt+q+Tcs4Llg==", - "dev": true - }, - "node_modules/@types/responselike": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@types/responselike/-/responselike-1.0.0.tgz", - "integrity": "sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA==", - "dev": true, - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@types/rss": { - "version": "0.0.32", - "resolved": "https://registry.npmjs.org/@types/rss/-/rss-0.0.32.tgz", - "integrity": "sha512-2oKNqKyUY4RSdvl5eZR1n2Q9yvw3XTe3mQHsFPn9alaNBxfPnbXBtGP8R0SV8pK1PrVnLul0zx7izbm5/gF5Qw==", - "dev": true - }, - "node_modules/@types/tern": { - "version": "0.23.9", - "resolved": "https://registry.npmjs.org/@types/tern/-/tern-0.23.9.tgz", - "integrity": "sha512-ypzHFE/wBzh+BlH6rrBgS5I/Z7RD21pGhZ2rltb/+ZrVM1awdZwjx7hE5XfuYgHWk9uvV5HLZN3SloevCAp3Bw==", - "dev": true, - "dependencies": { - "@types/estree": "*" - } - }, - "node_modules/@types/yauzl": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.10.0.tgz", - "integrity": "sha512-Cn6WYCm0tXv8p6k+A8PvbDG763EDpBoTzHdA+Q/MF6H3sapGjCm9NzoaJncJS9tUKSuCoDs9XHxYYsQDgxR6kw==", - "dev": true, - "optional": true, - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@typescript-eslint/eslint-plugin": { - "version": "5.29.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.29.0.tgz", - "integrity": "sha512-kgTsISt9pM53yRFQmLZ4npj99yGl3x3Pl7z4eA66OuTzAGC4bQB5H5fuLwPnqTKU3yyrrg4MIhjF17UYnL4c0w==", - "dev": true, - "dependencies": { - "@typescript-eslint/scope-manager": "5.29.0", - "@typescript-eslint/type-utils": "5.29.0", - "@typescript-eslint/utils": "5.29.0", - "debug": "^4.3.4", - "functional-red-black-tree": "^1.0.1", - "ignore": "^5.2.0", - "regexpp": "^3.2.0", - "semver": "^7.3.7", - "tsutils": "^3.21.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "@typescript-eslint/parser": "^5.0.0", - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/parser": { - "version": "5.29.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.29.0.tgz", - "integrity": "sha512-ruKWTv+x0OOxbzIw9nW5oWlUopvP/IQDjB5ZqmTglLIoDTctLlAJpAQFpNPJP/ZI7hTT9sARBosEfaKbcFuECw==", - "dev": true, - "dependencies": { - "@typescript-eslint/scope-manager": "5.29.0", - "@typescript-eslint/types": "5.29.0", - "@typescript-eslint/typescript-estree": "5.29.0", - "debug": "^4.3.4" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/scope-manager": { - "version": "5.29.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.29.0.tgz", - "integrity": "sha512-etbXUT0FygFi2ihcxDZjz21LtC+Eps9V2xVx09zFoN44RRHPrkMflidGMI+2dUs821zR1tDS6Oc9IXxIjOUZwA==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "5.29.0", - "@typescript-eslint/visitor-keys": "5.29.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/type-utils": { - "version": "5.29.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.29.0.tgz", - "integrity": "sha512-JK6bAaaiJozbox3K220VRfCzLa9n0ib/J+FHIwnaV3Enw/TO267qe0pM1b1QrrEuy6xun374XEAsRlA86JJnyg==", - "dev": true, - "dependencies": { - "@typescript-eslint/utils": "5.29.0", - "debug": "^4.3.4", - "tsutils": "^3.21.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "*" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/types": { - "version": "5.29.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.29.0.tgz", - "integrity": "sha512-X99VbqvAXOMdVyfFmksMy3u8p8yoRGITgU1joBJPzeYa0rhdf5ok9S56/itRoUSh99fiDoMtarSIJXo7H/SnOg==", - "dev": true, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/typescript-estree": { - "version": "5.29.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.29.0.tgz", - "integrity": "sha512-mQvSUJ/JjGBdvo+1LwC+GY2XmSYjK1nAaVw2emp/E61wEVYEyibRHCqm1I1vEKbXCpUKuW4G7u9ZCaZhJbLoNQ==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "5.29.0", - "@typescript-eslint/visitor-keys": "5.29.0", - "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "semver": "^7.3.7", - "tsutils": "^3.21.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/utils": { - "version": "5.29.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.29.0.tgz", - "integrity": "sha512-3Eos6uP1nyLOBayc/VUdKZikV90HahXE5Dx9L5YlSd/7ylQPXhLk1BYb29SDgnBnTp+jmSZUU0QxUiyHgW4p7A==", - "dev": true, - "dependencies": { - "@types/json-schema": "^7.0.9", - "@typescript-eslint/scope-manager": "5.29.0", - "@typescript-eslint/types": "5.29.0", - "@typescript-eslint/typescript-estree": "5.29.0", - "eslint-scope": "^5.1.1", - "eslint-utils": "^3.0.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" - } - }, - "node_modules/@typescript-eslint/visitor-keys": { - "version": "5.29.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.29.0.tgz", - "integrity": "sha512-Hpb/mCWsjILvikMQoZIE3voc9wtQcS0A9FUw3h8bhr9UxBdtI/tw1ZDZUOXHXLOVMedKCH5NxyzATwnU78bWCQ==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "5.29.0", - "eslint-visitor-keys": "^3.3.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/acorn": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", - "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/acorn-jsx": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", - "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", - "dev": true, - "peer": true, - "peerDependencies": { - "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" - } - }, - "node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, - "peer": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "peer": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true, - "peer": true - }, - "node_modules/array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true, - "peer": true - }, - "node_modules/boolean": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/boolean/-/boolean-3.2.0.tgz", - "integrity": "sha512-d0II/GO9uf9lfUHH2BQsjxzRJZBdsjgsBiW4BvhWk/3qoKwQFjIDVN19PfX8F2D/r9PCMTtLWjYVCFrpeYUzsw==", - "dev": true, - "optional": true - }, - "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "peer": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "dependencies": { - "fill-range": "^7.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/buffer-crc32": { - "version": "0.2.13", - "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", - "integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==", - "dev": true, - "engines": { - "node": "*" - } - }, - "node_modules/buffer-from": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==" - }, - "node_modules/builtin-modules": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.3.0.tgz", - "integrity": "sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==", - "dev": true, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/cacheable-lookup": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-5.0.4.tgz", - "integrity": "sha512-2/kNscPhpcxrOigMZzbiWF7dz8ilhb/nIHU3EyZiXWXpeq/au8qJ8VhdftMkty3n7Gj6HIGalQG8oiBNB3AJgA==", - "dev": true, - "engines": { - "node": ">=10.6.0" - } - }, - "node_modules/cacheable-request": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-7.0.4.tgz", - "integrity": "sha512-v+p6ongsrp0yTGbJXjgxPow2+DL93DASP4kXCDKb8/bwRtt9OEF3whggkkDkGNzgcWy2XaF4a8nZglC7uElscg==", - "dev": true, - "dependencies": { - "clone-response": "^1.0.2", - "get-stream": "^5.1.0", - "http-cache-semantics": "^4.0.0", - "keyv": "^4.0.0", - "lowercase-keys": "^2.0.0", - "normalize-url": "^6.0.1", - "responselike": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true, - "peer": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/camel-case": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/camel-case/-/camel-case-4.1.2.tgz", - "integrity": "sha512-gxGWBrTT1JuMx6R+o5PTXMmUnhnVzLQ9SNutD4YqKtI6ap897t3tKECYla6gCWEkplXnlNybEkZg9GEGxKFCgw==", - "dependencies": { - "pascal-case": "^3.1.2", - "tslib": "^2.0.3" - } - }, - "node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "peer": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/clean-css": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-5.3.2.tgz", - "integrity": "sha512-JVJbM+f3d3Q704rF4bqQ5UUyTtuJ0JRKNbTKVEeujCCBoMdkEi+V+e8oktO9qGQNSvHrFTM6JZRXrUvGR1czww==", - "dependencies": { - "source-map": "~0.6.0" - }, - "engines": { - "node": ">= 10.0" - } - }, - "node_modules/clone-response": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.3.tgz", - "integrity": "sha512-ROoL94jJH2dUVML2Y/5PEDNaSHgeOdSDicUyS7izcF63G6sTc/FTjLub4b8Il9S8S0beOfYt0TaA5qvFK+w0wA==", - "dev": true, - "dependencies": { - "mimic-response": "^1.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "peer": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true, - "peer": true - }, - "node_modules/commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" - }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true, - "peer": true - }, - "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, - "peer": true, - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/decompress-response": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", - "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", - "dev": true, - "dependencies": { - "mimic-response": "^3.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/decompress-response/node_modules/mimic-response": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", - "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/deep-is": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", - "dev": true, - "peer": true - }, - "node_modules/defer-to-connect": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-2.0.1.tgz", - "integrity": "sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg==", - "dev": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/define-properties": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.0.tgz", - "integrity": "sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA==", - "dev": true, - "optional": true, - "dependencies": { - "has-property-descriptors": "^1.0.0", - "object-keys": "^1.1.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/detect-node": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/detect-node/-/detect-node-2.1.0.tgz", - "integrity": "sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g==", - "dev": true, - "optional": true - }, - "node_modules/dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "dev": true, - "dependencies": { - "path-type": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "dev": true, - "peer": true, - "dependencies": { - "esutils": "^2.0.2" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/dot-case": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/dot-case/-/dot-case-3.0.4.tgz", - "integrity": "sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==", - "dependencies": { - "no-case": "^3.0.4", - "tslib": "^2.0.3" - } - }, - "node_modules/electron": { - "version": "26.6.8", - "resolved": "https://registry.npmjs.org/electron/-/electron-26.6.8.tgz", - "integrity": "sha512-nuzJ5nVButL1jErc97IVb+A6jbContMg5Uuz5fhmZ4NLcygLkSW8FZpnOT7A4k8Saa95xDJOvqGZyQdI/OPNFw==", - "dev": true, - "hasInstallScript": true, - "dependencies": { - "@electron/get": "^2.0.0", - "@types/node": "^18.11.18", - "extract-zip": "^2.0.1" - }, - "bin": { - "electron": "cli.js" - }, - "engines": { - "node": ">= 12.20.55" - } - }, - "node_modules/electron/node_modules/@types/node": { - "version": "18.17.14", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.17.14.tgz", - "integrity": "sha512-ZE/5aB73CyGqgQULkLG87N9GnyGe5TcQjv34pwS8tfBs1IkCh0ASM69mydb2znqd6v0eX+9Ytvk6oQRqu8T1Vw==", - "dev": true - }, - "node_modules/end-of-stream": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", - "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", - "dev": true, - "dependencies": { - "once": "^1.4.0" - } - }, - "node_modules/entities": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", - "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", - "engines": { - "node": ">=0.12" - }, - "funding": { - "url": "https://github.com/fb55/entities?sponsor=1" - } - }, - "node_modules/env-paths": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", - "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/es6-error": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", - "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", - "dev": true, - "optional": true - }, - "node_modules/esbuild": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.14.47.tgz", - "integrity": "sha512-wI4ZiIfFxpkuxB8ju4MHrGwGLyp1+awEHAHVpx6w7a+1pmYIq8T9FGEVVwFo0iFierDoMj++Xq69GXWYn2EiwA==", - "dev": true, - "hasInstallScript": true, - "bin": { - "esbuild": "bin/esbuild" - }, - "engines": { - "node": ">=12" - }, - "optionalDependencies": { - "esbuild-android-64": "0.14.47", - "esbuild-android-arm64": "0.14.47", - "esbuild-darwin-64": "0.14.47", - "esbuild-darwin-arm64": "0.14.47", - "esbuild-freebsd-64": "0.14.47", - "esbuild-freebsd-arm64": "0.14.47", - "esbuild-linux-32": "0.14.47", - "esbuild-linux-64": "0.14.47", - "esbuild-linux-arm": "0.14.47", - "esbuild-linux-arm64": "0.14.47", - "esbuild-linux-mips64le": "0.14.47", - "esbuild-linux-ppc64le": "0.14.47", - "esbuild-linux-riscv64": "0.14.47", - "esbuild-linux-s390x": "0.14.47", - "esbuild-netbsd-64": "0.14.47", - "esbuild-openbsd-64": "0.14.47", - "esbuild-sunos-64": "0.14.47", - "esbuild-windows-32": "0.14.47", - "esbuild-windows-64": "0.14.47", - "esbuild-windows-arm64": "0.14.47" - } - }, - "node_modules/esbuild-android-64": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-android-64/-/esbuild-android-64-0.14.47.tgz", - "integrity": "sha512-R13Bd9+tqLVFndncMHssZrPWe6/0Kpv2/dt4aA69soX4PRxlzsVpCvoJeFE8sOEoeVEiBkI0myjlkDodXlHa0g==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-android-arm64": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.14.47.tgz", - "integrity": "sha512-OkwOjj7ts4lBp/TL6hdd8HftIzOy/pdtbrNA4+0oVWgGG64HrdVzAF5gxtJufAPOsEjkyh1oIYvKAUinKKQRSQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-darwin-64": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.14.47.tgz", - "integrity": "sha512-R6oaW0y5/u6Eccti/TS6c/2c1xYTb1izwK3gajJwi4vIfNs1s8B1dQzI1UiC9T61YovOQVuePDcfqHLT3mUZJA==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-darwin-arm64": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.47.tgz", - "integrity": "sha512-seCmearlQyvdvM/noz1L9+qblC5vcBrhUaOoLEDDoLInF/VQ9IkobGiLlyTPYP5dW1YD4LXhtBgOyevoIHGGnw==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-freebsd-64": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.14.47.tgz", - "integrity": "sha512-ZH8K2Q8/Ux5kXXvQMDsJcxvkIwut69KVrYQhza/ptkW50DC089bCVrJZZ3sKzIoOx+YPTrmsZvqeZERjyYrlvQ==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-freebsd-arm64": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.14.47.tgz", - "integrity": "sha512-ZJMQAJQsIOhn3XTm7MPQfCzEu5b9STNC+s90zMWe2afy9EwnHV7Ov7ohEMv2lyWlc2pjqLW8QJnz2r0KZmeAEQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-linux-32": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.14.47.tgz", - "integrity": "sha512-FxZOCKoEDPRYvq300lsWCTv1kcHgiiZfNrPtEhFAiqD7QZaXrad8LxyJ8fXGcWzIFzRiYZVtB3ttvITBvAFhKw==", - "cpu": [ - "ia32" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-linux-64": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.14.47.tgz", - "integrity": "sha512-nFNOk9vWVfvWYF9YNYksZptgQAdstnDCMtR6m42l5Wfugbzu11VpMCY9XrD4yFxvPo9zmzcoUL/88y0lfJZJJw==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-linux-arm": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.14.47.tgz", - "integrity": "sha512-ZGE1Bqg/gPRXrBpgpvH81tQHpiaGxa8c9Rx/XOylkIl2ypLuOcawXEAo8ls+5DFCcRGt/o3sV+PzpAFZobOsmA==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-linux-arm64": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.14.47.tgz", - "integrity": "sha512-ywfme6HVrhWcevzmsufjd4iT3PxTfCX9HOdxA7Hd+/ZM23Y9nXeb+vG6AyA6jgq/JovkcqRHcL9XwRNpWG6XRw==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-linux-mips64le": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.14.47.tgz", - "integrity": "sha512-mg3D8YndZ1LvUiEdDYR3OsmeyAew4MA/dvaEJxvyygahWmpv1SlEEnhEZlhPokjsUMfRagzsEF/d/2XF+kTQGg==", - "cpu": [ - "mips64el" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-linux-ppc64le": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.14.47.tgz", - "integrity": "sha512-WER+f3+szmnZiWoK6AsrTKGoJoErG2LlauSmk73LEZFQ/iWC+KhhDsOkn1xBUpzXWsxN9THmQFltLoaFEH8F8w==", - "cpu": [ - "ppc64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-linux-riscv64": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.14.47.tgz", - "integrity": "sha512-1fI6bP3A3rvI9BsaaXbMoaOjLE3lVkJtLxsgLHqlBhLlBVY7UqffWBvkrX/9zfPhhVMd9ZRFiaqXnB1T7BsL2g==", - "cpu": [ - "riscv64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-linux-s390x": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-linux-s390x/-/esbuild-linux-s390x-0.14.47.tgz", - "integrity": "sha512-eZrWzy0xFAhki1CWRGnhsHVz7IlSKX6yT2tj2Eg8lhAwlRE5E96Hsb0M1mPSE1dHGpt1QVwwVivXIAacF/G6mw==", - "cpu": [ - "s390x" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-netbsd-64": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.14.47.tgz", - "integrity": "sha512-Qjdjr+KQQVH5Q2Q1r6HBYswFTToPpss3gqCiSw2Fpq/ua8+eXSQyAMG+UvULPqXceOwpnPo4smyZyHdlkcPppQ==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-openbsd-64": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.14.47.tgz", - "integrity": "sha512-QpgN8ofL7B9z8g5zZqJE+eFvD1LehRlxr25PBkjyyasakm4599iroUpaj96rdqRlO2ShuyqwJdr+oNqWwTUmQw==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-sunos-64": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.14.47.tgz", - "integrity": "sha512-uOeSgLUwukLioAJOiGYm3kNl+1wJjgJA8R671GYgcPgCx7QR73zfvYqXFFcIO93/nBdIbt5hd8RItqbbf3HtAQ==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "sunos" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-windows-32": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.14.47.tgz", - "integrity": "sha512-H0fWsLTp2WBfKLBgwYT4OTfFly4Im/8B5f3ojDv1Kx//kiubVY0IQunP2Koc/fr/0wI7hj3IiBDbSrmKlrNgLQ==", - "cpu": [ - "ia32" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-windows-64": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.14.47.tgz", - "integrity": "sha512-/Pk5jIEH34T68r8PweKRi77W49KwanZ8X6lr3vDAtOlH5EumPE4pBHqkCUdELanvsT14yMXLQ/C/8XPi1pAtkQ==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-windows-arm64": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.14.47.tgz", - "integrity": "sha512-HFSW2lnp62fl86/qPQlqw6asIwCnEsEoNIL1h2uVMgakddf+vUuMcCbtUY1i8sst7KkgHrVKCJQB33YhhOweCQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/eslint": { - "version": "8.26.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.26.0.tgz", - "integrity": "sha512-kzJkpaw1Bfwheq4VXUezFriD1GxszX6dUekM7Z3aC2o4hju+tsR/XyTC3RcoSD7jmy9VkPU3+N6YjVU2e96Oyg==", - "dev": true, - "peer": true, - "dependencies": { - "@eslint/eslintrc": "^1.3.3", - "@humanwhocodes/config-array": "^0.11.6", - "@humanwhocodes/module-importer": "^1.0.1", - "@nodelib/fs.walk": "^1.2.8", - "ajv": "^6.10.0", - "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", - "debug": "^4.3.2", - "doctrine": "^3.0.0", - "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.1.1", - "eslint-utils": "^3.0.0", - "eslint-visitor-keys": "^3.3.0", - "espree": "^9.4.0", - "esquery": "^1.4.0", - "esutils": "^2.0.2", - "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^6.0.1", - "find-up": "^5.0.0", - "glob-parent": "^6.0.2", - "globals": "^13.15.0", - "grapheme-splitter": "^1.0.4", - "ignore": "^5.2.0", - "import-fresh": "^3.0.0", - "imurmurhash": "^0.1.4", - "is-glob": "^4.0.0", - "is-path-inside": "^3.0.3", - "js-sdsl": "^4.1.4", - "js-yaml": "^4.1.0", - "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", - "lodash.merge": "^4.6.2", - "minimatch": "^3.1.2", - "natural-compare": "^1.4.0", - "optionator": "^0.9.1", - "regexpp": "^3.2.0", - "strip-ansi": "^6.0.1", - "strip-json-comments": "^3.1.0", - "text-table": "^0.2.0" - }, - "bin": { - "eslint": "bin/eslint.js" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", - "dev": true, - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/eslint-utils": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", - "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", - "dev": true, - "dependencies": { - "eslint-visitor-keys": "^2.0.0" - }, - "engines": { - "node": "^10.0.0 || ^12.0.0 || >= 14.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - }, - "peerDependencies": { - "eslint": ">=5" - } - }, - "node_modules/eslint-utils/node_modules/eslint-visitor-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", - "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", - "dev": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/eslint-visitor-keys": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", - "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", - "dev": true, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - } - }, - "node_modules/eslint/node_modules/eslint-scope": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz", - "integrity": "sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==", - "dev": true, - "peer": true, - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^5.2.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - } - }, - "node_modules/eslint/node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "peer": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/espree": { - "version": "9.4.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.4.0.tgz", - "integrity": "sha512-DQmnRpLj7f6TgN/NYb0MTzJXL+vJF9h3pHy4JhCIs3zwcgez8xmGg3sXHcEO97BrmO2OSvCwMdfdlyl+E9KjOw==", - "dev": true, - "peer": true, - "dependencies": { - "acorn": "^8.8.0", - "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^3.3.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/esquery": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", - "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", - "dev": true, - "peer": true, - "dependencies": { - "estraverse": "^5.1.0" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/esquery/node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "peer": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/esrecurse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", - "dev": true, - "dependencies": { - "estraverse": "^5.2.0" - }, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/esrecurse/node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true, - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/extract-zip": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz", - "integrity": "sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==", - "dev": true, - "dependencies": { - "debug": "^4.1.1", - "get-stream": "^5.1.0", - "yauzl": "^2.10.0" - }, - "bin": { - "extract-zip": "cli.js" - }, - "engines": { - "node": ">= 10.17.0" - }, - "optionalDependencies": { - "@types/yauzl": "^2.9.1" - } - }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true, - "peer": true - }, - "node_modules/fast-glob": { - "version": "3.2.12", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", - "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", - "dev": true, - "dependencies": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - }, - "engines": { - "node": ">=8.6.0" - } - }, - "node_modules/fast-glob/node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true, - "peer": true - }, - "node_modules/fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", - "dev": true, - "peer": true - }, - "node_modules/fastq": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", - "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", - "dev": true, - "dependencies": { - "reusify": "^1.0.4" - } - }, - "node_modules/fd-slicer": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", - "integrity": "sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==", - "dev": true, - "dependencies": { - "pend": "~1.2.0" - } - }, - "node_modules/file-entry-cache": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", - "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", - "dev": true, - "peer": true, - "dependencies": { - "flat-cache": "^3.0.4" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/file-type": { - "version": "19.0.0", - "resolved": "https://registry.npmjs.org/file-type/-/file-type-19.0.0.tgz", - "integrity": "sha512-s7cxa7/leUWLiXO78DVVfBVse+milos9FitauDLG1pI7lNaJ2+5lzPnr2N24ym+84HVwJL6hVuGfgVE+ALvU8Q==", - "dependencies": { - "readable-web-to-node-stream": "^3.0.2", - "strtok3": "^7.0.0", - "token-types": "^5.0.1" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sindresorhus/file-type?sponsor=1" - } - }, - "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", - "dev": true, - "peer": true, - "dependencies": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/flat-cache": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", - "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", - "dev": true, - "peer": true, - "dependencies": { - "flatted": "^3.1.0", - "rimraf": "^3.0.2" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/flatted": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", - "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", - "dev": true, - "peer": true - }, - "node_modules/fs-extra": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", - "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", - "dev": true, - "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - }, - "engines": { - "node": ">=6 <7 || >=8" - } - }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true, - "peer": true - }, - "node_modules/function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true, - "optional": true - }, - "node_modules/functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==", - "dev": true - }, - "node_modules/get-intrinsic": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", - "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", - "dev": true, - "optional": true, - "dependencies": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-proto": "^1.0.1", - "has-symbols": "^1.0.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/get-stream": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", - "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", - "dev": true, - "dependencies": { - "pump": "^3.0.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "dev": true, - "peer": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/glob-parent": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", - "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", - "dev": true, - "peer": true, - "dependencies": { - "is-glob": "^4.0.3" - }, - "engines": { - "node": ">=10.13.0" - } - }, - "node_modules/global-agent": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/global-agent/-/global-agent-3.0.0.tgz", - "integrity": "sha512-PT6XReJ+D07JvGoxQMkT6qji/jVNfX/h364XHZOWeRzy64sSFr+xJ5OX7LI3b4MPQzdL4H8Y8M0xzPpsVMwA8Q==", - "dev": true, - "optional": true, - "dependencies": { - "boolean": "^3.0.1", - "es6-error": "^4.1.1", - "matcher": "^3.0.0", - "roarr": "^2.15.3", - "semver": "^7.3.2", - "serialize-error": "^7.0.1" - }, - "engines": { - "node": ">=10.0" - } - }, - "node_modules/globals": { - "version": "13.17.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.17.0.tgz", - "integrity": "sha512-1C+6nQRb1GwGMKm2dH/E7enFAMxGTmGI7/dEdhy/DNelv85w9B72t3uc5frtMNXIbzrarJJ/lTCjcaZwbLJmyw==", - "dev": true, - "peer": true, - "dependencies": { - "type-fest": "^0.20.2" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/globalthis": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz", - "integrity": "sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==", - "dev": true, - "optional": true, - "dependencies": { - "define-properties": "^1.1.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/globby": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", - "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", - "dev": true, - "dependencies": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.9", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/got": { - "version": "11.8.6", - "resolved": "https://registry.npmjs.org/got/-/got-11.8.6.tgz", - "integrity": "sha512-6tfZ91bOr7bOXnK7PRDCGBLa1H4U080YHNaAQ2KsMGlLEzRbk44nsZF2E1IeRc3vtJHPVbKCYgdFbaGO2ljd8g==", - "dev": true, - "dependencies": { - "@sindresorhus/is": "^4.0.0", - "@szmarczak/http-timer": "^4.0.5", - "@types/cacheable-request": "^6.0.1", - "@types/responselike": "^1.0.0", - "cacheable-lookup": "^5.0.3", - "cacheable-request": "^7.0.2", - "decompress-response": "^6.0.0", - "http2-wrapper": "^1.0.0-beta.5.2", - "lowercase-keys": "^2.0.0", - "p-cancelable": "^2.0.0", - "responselike": "^2.0.0" - }, - "engines": { - "node": ">=10.19.0" - }, - "funding": { - "url": "https://github.com/sindresorhus/got?sponsor=1" - } - }, - "node_modules/graceful-fs": { - "version": "4.2.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", - "dev": true - }, - "node_modules/grapheme-splitter": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", - "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", - "dev": true, - "peer": true - }, - "node_modules/has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, - "optional": true, - "dependencies": { - "function-bind": "^1.1.1" - }, - "engines": { - "node": ">= 0.4.0" - } - }, - "node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/has-property-descriptors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", - "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", - "dev": true, - "optional": true, - "dependencies": { - "get-intrinsic": "^1.1.1" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-proto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", - "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", - "dev": true, - "optional": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", - "dev": true, - "optional": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/html-minifier-terser": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/html-minifier-terser/-/html-minifier-terser-7.2.0.tgz", - "integrity": "sha512-tXgn3QfqPIpGl9o+K5tpcj3/MN4SfLtsx2GWwBC3SSd0tXQGyF3gsSqad8loJgKZGM3ZxbYDd5yhiBIdWpmvLA==", - "dependencies": { - "camel-case": "^4.1.2", - "clean-css": "~5.3.2", - "commander": "^10.0.0", - "entities": "^4.4.0", - "param-case": "^3.0.4", - "relateurl": "^0.2.7", - "terser": "^5.15.1" - }, - "bin": { - "html-minifier-terser": "cli.js" - }, - "engines": { - "node": "^14.13.1 || >=16.0.0" - } - }, - "node_modules/html-minifier-terser/node_modules/commander": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", - "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", - "engines": { - "node": ">=14" - } - }, - "node_modules/http-cache-semantics": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", - "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==", - "dev": true - }, - "node_modules/http2-wrapper": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-1.0.3.tgz", - "integrity": "sha512-V+23sDMr12Wnz7iTcDeJr3O6AIxlnvT/bmaAAAP/Xda35C90p9599p0F1eHR/N1KILWSoWVAiOMFjBBXaXSMxg==", - "dev": true, - "dependencies": { - "quick-lru": "^5.1.1", - "resolve-alpn": "^1.0.0" - }, - "engines": { - "node": ">=10.19.0" - } - }, - "node_modules/ieee754": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/ignore": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", - "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", - "dev": true, - "engines": { - "node": ">= 4" - } - }, - "node_modules/import-fresh": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", - "dev": true, - "peer": true, - "dependencies": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", - "dev": true, - "peer": true, - "engines": { - "node": ">=0.8.19" - } - }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "dev": true, - "peer": true, - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, - "dependencies": { - "is-extglob": "^2.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, - "engines": { - "node": ">=0.12.0" - } - }, - "node_modules/is-path-inside": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", - "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", - "dev": true, - "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true, - "peer": true - }, - "node_modules/js-sdsl": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.1.5.tgz", - "integrity": "sha512-08bOAKweV2NUC1wqTtf3qZlnpOX/R2DU9ikpjOHs0H+ibQv3zpncVQg6um4uYtRtrwIX8M4Nh3ytK4HGlYAq7Q==", - "dev": true, - "peer": true - }, - "node_modules/js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "dev": true, - "peer": true, - "dependencies": { - "argparse": "^2.0.1" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, - "node_modules/json-buffer": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", - "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", - "dev": true - }, - "node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true, - "peer": true - }, - "node_modules/json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", - "dev": true, - "peer": true - }, - "node_modules/json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", - "dev": true, - "optional": true - }, - "node_modules/jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", - "dev": true, - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, - "node_modules/keyv": { - "version": "4.5.3", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.3.tgz", - "integrity": "sha512-QCiSav9WaX1PgETJ+SpNnx2PRRapJ/oRSXM4VO5OGYGSjrxbKPVFVhB3l2OCbLCk329N8qyAtsJjSjvVBWzEug==", - "dev": true, - "dependencies": { - "json-buffer": "3.0.1" - } - }, - "node_modules/levn": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", - "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", - "dev": true, - "peer": true, - "dependencies": { - "prelude-ls": "^1.2.1", - "type-check": "~0.4.0" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", - "dev": true, - "peer": true, - "dependencies": { - "p-locate": "^5.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/lodash.merge": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "dev": true, - "peer": true - }, - "node_modules/lower-case": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz", - "integrity": "sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==", - "dependencies": { - "tslib": "^2.0.3" - } - }, - "node_modules/lowercase-keys": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", - "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/matcher": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/matcher/-/matcher-3.0.0.tgz", - "integrity": "sha512-OkeDaAZ/bQCxeFAozM55PKcKU0yJMPGifLwV4Qgjitu+5MoAfSQN4lsLJeXZ1b8w0x+/Emda6MZgXS1jvsapng==", - "dev": true, - "optional": true, - "dependencies": { - "escape-string-regexp": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", - "dev": true, - "dependencies": { - "braces": "^3.0.2", - "picomatch": "^2.3.1" - }, - "engines": { - "node": ">=8.6" - } - }, - "node_modules/mime": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz", - "integrity": "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==", - "bin": { - "mime": "cli.js" - }, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/mime-db": { - "version": "1.25.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.25.0.tgz", - "integrity": "sha512-5k547tI4Cy+Lddr/hdjNbBEWBwSl8EBc5aSdKvedav8DReADgWJzcYiktaRIw3GtGC1jjwldXtTzvqJZmtvC7w==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime-types": { - "version": "2.1.13", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.13.tgz", - "integrity": "sha512-ryBDp1Z/6X90UvjUK3RksH0IBPM137T7cmg4OgD5wQBojlAiUwuok0QeELkim/72EtcYuNlmbkrcGuxj3Kl0YQ==", - "dependencies": { - "mime-db": "~1.25.0" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mimic-response": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", - "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "peer": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/minisearch": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/minisearch/-/minisearch-6.3.0.tgz", - "integrity": "sha512-ihFnidEeU8iXzcVHy74dhkxh/dn8Dc08ERl0xwoMMGqp4+LvRSCgicb+zGqWthVokQKvCSxITlh3P08OzdTYCQ==" - }, - "node_modules/moment": { - "version": "2.29.4", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz", - "integrity": "sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==", - "dev": true, - "engines": { - "node": "*" - } - }, - "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "node_modules/natural-compare": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", - "dev": true, - "peer": true - }, - "node_modules/no-case": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz", - "integrity": "sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==", - "dependencies": { - "lower-case": "^2.0.2", - "tslib": "^2.0.3" - } - }, - "node_modules/normalize-url": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-6.1.0.tgz", - "integrity": "sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", - "dev": true, - "optional": true, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/obsidian": { - "version": "1.4.11", - "resolved": "https://registry.npmjs.org/obsidian/-/obsidian-1.4.11.tgz", - "integrity": "sha512-BCVYTvaXxElJMl6MMbDdY/CGK+aq18SdtDY/7vH8v6BxCBQ6KF4kKxL0vG9UZ0o5qh139KpUoJHNm+6O5dllKA==", - "dev": true, - "dependencies": { - "@types/codemirror": "5.60.8", - "moment": "2.29.4" - }, - "peerDependencies": { - "@codemirror/state": "^6.0.0", - "@codemirror/view": "^6.0.0" - } - }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dev": true, - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/optionator": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", - "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", - "dev": true, - "peer": true, - "dependencies": { - "deep-is": "^0.1.3", - "fast-levenshtein": "^2.0.6", - "levn": "^0.4.1", - "prelude-ls": "^1.2.1", - "type-check": "^0.4.0", - "word-wrap": "^1.2.3" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/p-cancelable": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-2.1.1.tgz", - "integrity": "sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, - "peer": true, - "dependencies": { - "yocto-queue": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", - "dev": true, - "peer": true, - "dependencies": { - "p-limit": "^3.0.2" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/param-case": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/param-case/-/param-case-3.0.4.tgz", - "integrity": "sha512-RXlj7zCYokReqWpOPH9oYivUzLYZ5vAPIfEmCTNViosC78F8F0H9y7T7gG2M39ymgutxF5gcFEsyZQSph9Bp3A==", - "dependencies": { - "dot-case": "^3.0.4", - "tslib": "^2.0.3" - } - }, - "node_modules/parent-module": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "dev": true, - "peer": true, - "dependencies": { - "callsites": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/pascal-case": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/pascal-case/-/pascal-case-3.1.2.tgz", - "integrity": "sha512-uWlGT3YSnK9x3BQJaOdcZwrnV6hPpd8jFH1/ucpiLRPh/2zCVJKS19E4GvYHvaCcACn3foXZ0cLB9Wrx1KGe5g==", - "dependencies": { - "no-case": "^3.0.4", - "tslib": "^2.0.3" - } - }, - "node_modules/path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true, - "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "dev": true, - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, - "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/peek-readable": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/peek-readable/-/peek-readable-5.0.0.tgz", - "integrity": "sha512-YtCKvLUOvwtMGmrniQPdO7MwPjgkFBtFIrmfSbYmYuq3tKDV/mcfAhBth1+C3ru7uXIZasc/pHnb+YDYNkkj4A==", - "engines": { - "node": ">=14.16" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/Borewit" - } - }, - "node_modules/pend": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", - "integrity": "sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==", - "dev": true - }, - "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true, - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/prelude-ls": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", - "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", - "dev": true, - "peer": true, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/progress": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", - "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", - "dev": true, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "dev": true, - "dependencies": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, - "node_modules/punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "dev": true, - "peer": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/quick-lru": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz", - "integrity": "sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/readable-web-to-node-stream": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/readable-web-to-node-stream/-/readable-web-to-node-stream-3.0.2.tgz", - "integrity": "sha512-ePeK6cc1EcKLEhJFt/AebMCLL+GgSKhuygrZ/GLaKZYEecIgIECf4UaUuaByiGtzckwR4ain9VzUh95T1exYGw==", - "dependencies": { - "readable-stream": "^3.6.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/Borewit" - } - }, - "node_modules/regexpp": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", - "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - } - }, - "node_modules/relateurl": { - "version": "0.2.7", - "resolved": "https://registry.npmjs.org/relateurl/-/relateurl-0.2.7.tgz", - "integrity": "sha512-G08Dxvm4iDN3MLM0EsP62EDV9IuhXPR6blNz6Utcp7zyV3tr4HVNINt6MpaRWbxoOHT3Q7YN2P+jaHX8vUbgog==", - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/resolve-alpn": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/resolve-alpn/-/resolve-alpn-1.2.1.tgz", - "integrity": "sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g==", - "dev": true - }, - "node_modules/resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true, - "peer": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/responselike": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/responselike/-/responselike-2.0.1.tgz", - "integrity": "sha512-4gl03wn3hj1HP3yzgdI7d3lCkF95F21Pz4BPGvKHinyQzALR5CapwC8yIi0Rh58DEMQ/SguC03wFj2k0M/mHhw==", - "dev": true, - "dependencies": { - "lowercase-keys": "^2.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true, - "engines": { - "iojs": ">=1.0.0", - "node": ">=0.10.0" - } - }, - "node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "peer": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/roarr": { - "version": "2.15.4", - "resolved": "https://registry.npmjs.org/roarr/-/roarr-2.15.4.tgz", - "integrity": "sha512-CHhPh+UNHD2GTXNYhPWLnU8ONHdI+5DI+4EYIAOaiD63rHeYlZvyh8P+in5999TTSFgUYuKUAjzRI4mdh/p+2A==", - "dev": true, - "optional": true, - "dependencies": { - "boolean": "^3.0.1", - "detect-node": "^2.0.4", - "globalthis": "^1.0.1", - "json-stringify-safe": "^5.0.1", - "semver-compare": "^1.0.0", - "sprintf-js": "^1.1.2" - }, - "engines": { - "node": ">=8.0" - } - }, - "node_modules/rss": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/rss/-/rss-1.2.2.tgz", - "integrity": "sha512-xUhRTgslHeCBeHAqaWSbOYTydN2f0tAzNXvzh3stjz7QDhQMzdgHf3pfgNIngeytQflrFPfy6axHilTETr6gDg==", - "dependencies": { - "mime-types": "2.1.13", - "xml": "1.0.1" - } - }, - "node_modules/run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "queue-microtask": "^1.2.2" - } - }, - "node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/semver-compare": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz", - "integrity": "sha512-YM3/ITh2MJ5MtzaM429anh+x2jiLVjqILF4m4oyQB18W7Ggea7BfqdH/wGMK7dDiMghv/6WG7znWMwUDzJiXow==", - "dev": true, - "optional": true - }, - "node_modules/serialize-error": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/serialize-error/-/serialize-error-7.0.1.tgz", - "integrity": "sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw==", - "dev": true, - "optional": true, - "dependencies": { - "type-fest": "^0.13.1" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/serialize-error/node_modules/type-fest": { - "version": "0.13.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz", - "integrity": "sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==", - "dev": true, - "optional": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "peer": true, - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, - "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/source-map-support": { - "version": "0.5.21", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", - "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", - "dependencies": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - } - }, - "node_modules/sprintf-js": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.2.tgz", - "integrity": "sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug==", - "dev": true, - "optional": true - }, - "node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, - "node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "peer": true, - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true, - "peer": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/strtok3": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/strtok3/-/strtok3-7.0.0.tgz", - "integrity": "sha512-pQ+V+nYQdC5H3Q7qBZAz/MO6lwGhoC2gOAjuouGf/VO0m7vQRh8QNMl2Uf6SwAtzZ9bOw3UIeBukEGNJl5dtXQ==", - "dependencies": { - "@tokenizer/token": "^0.3.0", - "peek-readable": "^5.0.0" - }, - "engines": { - "node": ">=14.16" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/Borewit" - } - }, - "node_modules/style-mod": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/style-mod/-/style-mod-4.0.0.tgz", - "integrity": "sha512-OPhtyEjyyN9x3nhPsu76f52yUGXiZcgvsrFVtvTkyGRQJ0XK+GPc6ov1z+lRpbeabka+MYEQxOYRnt5nF30aMw==", - "dev": true, - "peer": true - }, - "node_modules/sumchecker": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/sumchecker/-/sumchecker-3.0.1.tgz", - "integrity": "sha512-MvjXzkz/BOfyVDkG0oFOtBxHX2u3gKbMHIF/dXblZsgD3BWOFLmHovIpZY7BykJdAjcqRCBi1WYBNdEC9yI7vg==", - "dev": true, - "dependencies": { - "debug": "^4.1.0" - }, - "engines": { - "node": ">= 8.0" - } - }, - "node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "peer": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/terser": { - "version": "5.27.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.27.0.tgz", - "integrity": "sha512-bi1HRwVRskAjheeYl291n3JC4GgO/Ty4z1nVs5AAsmonJulGxpSektecnNedrwK9C7vpvVtcX3cw00VSLt7U2A==", - "dependencies": { - "@jridgewell/source-map": "^0.3.3", - "acorn": "^8.8.2", - "commander": "^2.20.0", - "source-map-support": "~0.5.20" - }, - "bin": { - "terser": "bin/terser" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", - "dev": true, - "peer": true - }, - "node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" - } - }, - "node_modules/token-types": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/token-types/-/token-types-5.0.1.tgz", - "integrity": "sha512-Y2fmSnZjQdDb9W4w4r1tswlMHylzWIeOKpx0aZH9BgGtACHhrk3OkT52AzwcuqTRBZtvvnTjDBh8eynMulu8Vg==", - "dependencies": { - "@tokenizer/token": "^0.3.0", - "ieee754": "^1.2.1" - }, - "engines": { - "node": ">=14.16" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/Borewit" - } - }, - "node_modules/tslib": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", - "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==" - }, - "node_modules/tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", - "dev": true, - "dependencies": { - "tslib": "^1.8.1" - }, - "engines": { - "node": ">= 6" - }, - "peerDependencies": { - "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" - } - }, - "node_modules/tsutils/node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - }, - "node_modules/type-check": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", - "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", - "dev": true, - "peer": true, - "dependencies": { - "prelude-ls": "^1.2.1" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "dev": true, - "peer": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/typescript": { - "version": "4.7.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz", - "integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==", - "dev": true, - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=4.2.0" - } - }, - "node_modules/universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "dev": true, - "engines": { - "node": ">= 4.0.0" - } - }, - "node_modules/upath": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/upath/-/upath-2.0.1.tgz", - "integrity": "sha512-1uEe95xksV1O0CYKXo8vQvN1JEbtJp7lb7C5U9HMsIp6IVwntkH/oNUzyVNQSd4S1sYk2FpSSW44FqMc8qee5w==", - "engines": { - "node": ">=4", - "yarn": "*" - } - }, - "node_modules/uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dev": true, - "peer": true, - "dependencies": { - "punycode": "^2.1.0" - } - }, - "node_modules/util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" - }, - "node_modules/w3c-keyname": { - "version": "2.2.6", - "resolved": "https://registry.npmjs.org/w3c-keyname/-/w3c-keyname-2.2.6.tgz", - "integrity": "sha512-f+fciywl1SJEniZHD6H+kUO8gOnwIr7f4ijKA6+ZvJFjeGi1r4PDLl53Ayud9O/rk64RqgoQine0feoeOU0kXg==", - "dev": true, - "peer": true - }, - "node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "peer": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/word-wrap": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", - "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", - "dev": true, - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true - }, - "node_modules/xml": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/xml/-/xml-1.0.1.tgz", - "integrity": "sha512-huCv9IH9Tcf95zuYCsQraZtWnJvBtLVE0QHMOs8bWyZAFZNDcYjsPq1nEx8jKA9y+Beo9v+7OBPRisQTjinQMw==" - }, - "node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, - "node_modules/yauzl": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", - "integrity": "sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==", - "dev": true, - "dependencies": { - "buffer-crc32": "~0.2.3", - "fd-slicer": "~1.1.0" - } - }, - "node_modules/yocto-queue": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", - "dev": true, - "peer": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - } - }, - "dependencies": { - "@codemirror/state": { - "version": "6.1.2", - "resolved": "https://registry.npmjs.org/@codemirror/state/-/state-6.1.2.tgz", - "integrity": "sha512-Mxff85Hp5va+zuj+H748KbubXjrinX/k28lj43H14T2D0+4kuvEFIEIO7hCEcvBT8ubZyIelt9yGOjj2MWOEQA==", - "dev": true, - "peer": true - }, - "@codemirror/view": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.4.0.tgz", - "integrity": "sha512-Kv32b6Tn7QVwFbj/EDswTLSocjk5kgggF6zzBFAL4o4hZ/vmtFD155+EjH1pVlbfoDyVC2M6SedPsMrwYscgNg==", - "dev": true, - "peer": true, - "requires": { - "@codemirror/state": "^6.0.0", - "style-mod": "^4.0.0", - "w3c-keyname": "^2.2.4" - } - }, - "@electron/get": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@electron/get/-/get-2.0.3.tgz", - "integrity": "sha512-Qkzpg2s9GnVV2I2BjRksUi43U5e6+zaQMcjoJy0C+C5oxaKl+fmckGDQFtRpZpZV0NQekuZZ+tGz7EA9TVnQtQ==", - "dev": true, - "requires": { - "debug": "^4.1.1", - "env-paths": "^2.2.0", - "fs-extra": "^8.1.0", - "global-agent": "^3.0.0", - "got": "^11.8.5", - "progress": "^2.0.3", - "semver": "^6.2.0", - "sumchecker": "^3.0.1" - }, - "dependencies": { - "semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true - } - } - }, - "@eslint/eslintrc": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.3.tgz", - "integrity": "sha512-uj3pT6Mg+3t39fvLrj8iuCIJ38zKO9FpGtJ4BBJebJhEwjoT+KLVNCcHT5QC9NGRIEi7fZ0ZR8YRb884auB4Lg==", - "dev": true, - "peer": true, - "requires": { - "ajv": "^6.12.4", - "debug": "^4.3.2", - "espree": "^9.4.0", - "globals": "^13.15.0", - "ignore": "^5.2.0", - "import-fresh": "^3.2.1", - "js-yaml": "^4.1.0", - "minimatch": "^3.1.2", - "strip-json-comments": "^3.1.1" - } - }, - "@humanwhocodes/config-array": { - "version": "0.11.7", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.7.tgz", - "integrity": "sha512-kBbPWzN8oVMLb0hOUYXhmxggL/1cJE6ydvjDIGi9EnAGUyA7cLVKQg+d/Dsm+KZwx2czGHrCmMVLiyg8s5JPKw==", - "dev": true, - "peer": true, - "requires": { - "@humanwhocodes/object-schema": "^1.2.1", - "debug": "^4.1.1", - "minimatch": "^3.0.5" - } - }, - "@humanwhocodes/module-importer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", - "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", - "dev": true, - "peer": true - }, - "@humanwhocodes/object-schema": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", - "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", - "dev": true, - "peer": true - }, - "@jridgewell/gen-mapping": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", - "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", - "requires": { - "@jridgewell/set-array": "^1.0.1", - "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.9" - } - }, - "@jridgewell/resolve-uri": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", - "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==" - }, - "@jridgewell/set-array": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", - "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==" - }, - "@jridgewell/source-map": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.5.tgz", - "integrity": "sha512-UTYAUj/wviwdsMfzoSJspJxbkH5o1snzwX0//0ENX1u/55kkZZkcTZP6u9bwKGkv+dkk9at4m1Cpt0uY80kcpQ==", - "requires": { - "@jridgewell/gen-mapping": "^0.3.0", - "@jridgewell/trace-mapping": "^0.3.9" - } - }, - "@jridgewell/sourcemap-codec": { - "version": "1.4.15", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", - "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==" - }, - "@jridgewell/trace-mapping": { - "version": "0.3.22", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.22.tgz", - "integrity": "sha512-Wf963MzWtA2sjrNt+g18IAln9lKnlRp+K2eH4jjIoF1wYeq3aMREpG09xhlhdzS0EjwU7qmUJYangWa+151vZw==", - "requires": { - "@jridgewell/resolve-uri": "^3.1.0", - "@jridgewell/sourcemap-codec": "^1.4.14" - } - }, - "@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dev": true, - "requires": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - } - }, - "@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "dev": true - }, - "@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dev": true, - "requires": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - } - }, - "@sindresorhus/is": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz", - "integrity": "sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==", - "dev": true - }, - "@szmarczak/http-timer": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-4.0.6.tgz", - "integrity": "sha512-4BAffykYOgO+5nzBWYwE3W90sBgLJoUPRWWcL8wlyiM8IB8ipJz3UMJ9KXQd1RKQXpKp8Tutn80HZtWsu2u76w==", - "dev": true, - "requires": { - "defer-to-connect": "^2.0.0" - } - }, - "@tokenizer/token": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/@tokenizer/token/-/token-0.3.0.tgz", - "integrity": "sha512-OvjF+z51L3ov0OyAU0duzsYuvO01PH7x4t6DJx+guahgTnBHkhJdG7soQeTSFLWN3efnHyibZ4Z8l2EuWwJN3A==" - }, - "@types/cacheable-request": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/@types/cacheable-request/-/cacheable-request-6.0.3.tgz", - "integrity": "sha512-IQ3EbTzGxIigb1I3qPZc1rWJnH0BmSKv5QYTalEwweFvyBDLSAe24zP0le/hyi7ecGfZVlIVAg4BZqb8WBwKqw==", - "dev": true, - "requires": { - "@types/http-cache-semantics": "*", - "@types/keyv": "^3.1.4", - "@types/node": "*", - "@types/responselike": "^1.0.0" - } - }, - "@types/codemirror": { - "version": "5.60.8", - "resolved": "https://registry.npmjs.org/@types/codemirror/-/codemirror-5.60.8.tgz", - "integrity": "sha512-VjFgDF/eB+Aklcy15TtOTLQeMjTo07k7KAjql8OK5Dirr7a6sJY4T1uVBDuTVG9VEmn1uUsohOpYnVfgC6/jyw==", - "dev": true, - "requires": { - "@types/tern": "*" - } - }, - "@types/estree": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", - "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", - "dev": true - }, - "@types/http-cache-semantics": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.1.tgz", - "integrity": "sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ==", - "dev": true - }, - "@types/json-schema": { - "version": "7.0.11", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", - "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", - "dev": true - }, - "@types/keyv": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/@types/keyv/-/keyv-3.1.4.tgz", - "integrity": "sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==", - "dev": true, - "requires": { - "@types/node": "*" - } - }, - "@types/node": { - "version": "16.18.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.3.tgz", - "integrity": "sha512-jh6m0QUhIRcZpNv7Z/rpN+ZWXOicUUQbSoWks7Htkbb9IjFQj4kzcX/xFCkjstCj5flMsN8FiSvt+q+Tcs4Llg==", - "dev": true - }, - "@types/responselike": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@types/responselike/-/responselike-1.0.0.tgz", - "integrity": "sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA==", - "dev": true, - "requires": { - "@types/node": "*" - } - }, - "@types/rss": { - "version": "0.0.32", - "resolved": "https://registry.npmjs.org/@types/rss/-/rss-0.0.32.tgz", - "integrity": "sha512-2oKNqKyUY4RSdvl5eZR1n2Q9yvw3XTe3mQHsFPn9alaNBxfPnbXBtGP8R0SV8pK1PrVnLul0zx7izbm5/gF5Qw==", - "dev": true - }, - "@types/tern": { - "version": "0.23.9", - "resolved": "https://registry.npmjs.org/@types/tern/-/tern-0.23.9.tgz", - "integrity": "sha512-ypzHFE/wBzh+BlH6rrBgS5I/Z7RD21pGhZ2rltb/+ZrVM1awdZwjx7hE5XfuYgHWk9uvV5HLZN3SloevCAp3Bw==", - "dev": true, - "requires": { - "@types/estree": "*" - } - }, - "@types/yauzl": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.10.0.tgz", - "integrity": "sha512-Cn6WYCm0tXv8p6k+A8PvbDG763EDpBoTzHdA+Q/MF6H3sapGjCm9NzoaJncJS9tUKSuCoDs9XHxYYsQDgxR6kw==", - "dev": true, - "optional": true, - "requires": { - "@types/node": "*" - } - }, - "@typescript-eslint/eslint-plugin": { - "version": "5.29.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.29.0.tgz", - "integrity": "sha512-kgTsISt9pM53yRFQmLZ4npj99yGl3x3Pl7z4eA66OuTzAGC4bQB5H5fuLwPnqTKU3yyrrg4MIhjF17UYnL4c0w==", - "dev": true, - "requires": { - "@typescript-eslint/scope-manager": "5.29.0", - "@typescript-eslint/type-utils": "5.29.0", - "@typescript-eslint/utils": "5.29.0", - "debug": "^4.3.4", - "functional-red-black-tree": "^1.0.1", - "ignore": "^5.2.0", - "regexpp": "^3.2.0", - "semver": "^7.3.7", - "tsutils": "^3.21.0" - } - }, - "@typescript-eslint/parser": { - "version": "5.29.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.29.0.tgz", - "integrity": "sha512-ruKWTv+x0OOxbzIw9nW5oWlUopvP/IQDjB5ZqmTglLIoDTctLlAJpAQFpNPJP/ZI7hTT9sARBosEfaKbcFuECw==", - "dev": true, - "requires": { - "@typescript-eslint/scope-manager": "5.29.0", - "@typescript-eslint/types": "5.29.0", - "@typescript-eslint/typescript-estree": "5.29.0", - "debug": "^4.3.4" - } - }, - "@typescript-eslint/scope-manager": { - "version": "5.29.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.29.0.tgz", - "integrity": "sha512-etbXUT0FygFi2ihcxDZjz21LtC+Eps9V2xVx09zFoN44RRHPrkMflidGMI+2dUs821zR1tDS6Oc9IXxIjOUZwA==", - "dev": true, - "requires": { - "@typescript-eslint/types": "5.29.0", - "@typescript-eslint/visitor-keys": "5.29.0" - } - }, - "@typescript-eslint/type-utils": { - "version": "5.29.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.29.0.tgz", - "integrity": "sha512-JK6bAaaiJozbox3K220VRfCzLa9n0ib/J+FHIwnaV3Enw/TO267qe0pM1b1QrrEuy6xun374XEAsRlA86JJnyg==", - "dev": true, - "requires": { - "@typescript-eslint/utils": "5.29.0", - "debug": "^4.3.4", - "tsutils": "^3.21.0" - } - }, - "@typescript-eslint/types": { - "version": "5.29.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.29.0.tgz", - "integrity": "sha512-X99VbqvAXOMdVyfFmksMy3u8p8yoRGITgU1joBJPzeYa0rhdf5ok9S56/itRoUSh99fiDoMtarSIJXo7H/SnOg==", - "dev": true - }, - "@typescript-eslint/typescript-estree": { - "version": "5.29.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.29.0.tgz", - "integrity": "sha512-mQvSUJ/JjGBdvo+1LwC+GY2XmSYjK1nAaVw2emp/E61wEVYEyibRHCqm1I1vEKbXCpUKuW4G7u9ZCaZhJbLoNQ==", - "dev": true, - "requires": { - "@typescript-eslint/types": "5.29.0", - "@typescript-eslint/visitor-keys": "5.29.0", - "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "semver": "^7.3.7", - "tsutils": "^3.21.0" - } - }, - "@typescript-eslint/utils": { - "version": "5.29.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.29.0.tgz", - "integrity": "sha512-3Eos6uP1nyLOBayc/VUdKZikV90HahXE5Dx9L5YlSd/7ylQPXhLk1BYb29SDgnBnTp+jmSZUU0QxUiyHgW4p7A==", - "dev": true, - "requires": { - "@types/json-schema": "^7.0.9", - "@typescript-eslint/scope-manager": "5.29.0", - "@typescript-eslint/types": "5.29.0", - "@typescript-eslint/typescript-estree": "5.29.0", - "eslint-scope": "^5.1.1", - "eslint-utils": "^3.0.0" - } - }, - "@typescript-eslint/visitor-keys": { - "version": "5.29.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.29.0.tgz", - "integrity": "sha512-Hpb/mCWsjILvikMQoZIE3voc9wtQcS0A9FUw3h8bhr9UxBdtI/tw1ZDZUOXHXLOVMedKCH5NxyzATwnU78bWCQ==", - "dev": true, - "requires": { - "@typescript-eslint/types": "5.29.0", - "eslint-visitor-keys": "^3.3.0" - } - }, - "acorn": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", - "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==" - }, - "acorn-jsx": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", - "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", - "dev": true, - "peer": true, - "requires": {} - }, - "ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, - "peer": true, - "requires": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "peer": true - }, - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "peer": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true, - "peer": true - }, - "array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true - }, - "balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true, - "peer": true - }, - "boolean": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/boolean/-/boolean-3.2.0.tgz", - "integrity": "sha512-d0II/GO9uf9lfUHH2BQsjxzRJZBdsjgsBiW4BvhWk/3qoKwQFjIDVN19PfX8F2D/r9PCMTtLWjYVCFrpeYUzsw==", - "dev": true, - "optional": true - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "peer": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "requires": { - "fill-range": "^7.0.1" - } - }, - "buffer-crc32": { - "version": "0.2.13", - "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", - "integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==", - "dev": true - }, - "buffer-from": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==" - }, - "builtin-modules": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.3.0.tgz", - "integrity": "sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==", - "dev": true - }, - "cacheable-lookup": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-5.0.4.tgz", - "integrity": "sha512-2/kNscPhpcxrOigMZzbiWF7dz8ilhb/nIHU3EyZiXWXpeq/au8qJ8VhdftMkty3n7Gj6HIGalQG8oiBNB3AJgA==", - "dev": true - }, - "cacheable-request": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-7.0.4.tgz", - "integrity": "sha512-v+p6ongsrp0yTGbJXjgxPow2+DL93DASP4kXCDKb8/bwRtt9OEF3whggkkDkGNzgcWy2XaF4a8nZglC7uElscg==", - "dev": true, - "requires": { - "clone-response": "^1.0.2", - "get-stream": "^5.1.0", - "http-cache-semantics": "^4.0.0", - "keyv": "^4.0.0", - "lowercase-keys": "^2.0.0", - "normalize-url": "^6.0.1", - "responselike": "^2.0.0" - } - }, - "callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true, - "peer": true - }, - "camel-case": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/camel-case/-/camel-case-4.1.2.tgz", - "integrity": "sha512-gxGWBrTT1JuMx6R+o5PTXMmUnhnVzLQ9SNutD4YqKtI6ap897t3tKECYla6gCWEkplXnlNybEkZg9GEGxKFCgw==", - "requires": { - "pascal-case": "^3.1.2", - "tslib": "^2.0.3" - } - }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "peer": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "clean-css": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-5.3.2.tgz", - "integrity": "sha512-JVJbM+f3d3Q704rF4bqQ5UUyTtuJ0JRKNbTKVEeujCCBoMdkEi+V+e8oktO9qGQNSvHrFTM6JZRXrUvGR1czww==", - "requires": { - "source-map": "~0.6.0" - } - }, - "clone-response": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.3.tgz", - "integrity": "sha512-ROoL94jJH2dUVML2Y/5PEDNaSHgeOdSDicUyS7izcF63G6sTc/FTjLub4b8Il9S8S0beOfYt0TaA5qvFK+w0wA==", - "dev": true, - "requires": { - "mimic-response": "^1.0.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "peer": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true, - "peer": true - }, - "commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true, - "peer": true - }, - "cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, - "peer": true, - "requires": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - } - }, - "debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, - "requires": { - "ms": "2.1.2" - } - }, - "decompress-response": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", - "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", - "dev": true, - "requires": { - "mimic-response": "^3.1.0" - }, - "dependencies": { - "mimic-response": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", - "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", - "dev": true - } - } - }, - "deep-is": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", - "dev": true, - "peer": true - }, - "defer-to-connect": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-2.0.1.tgz", - "integrity": "sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg==", - "dev": true - }, - "define-properties": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.0.tgz", - "integrity": "sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA==", - "dev": true, - "optional": true, - "requires": { - "has-property-descriptors": "^1.0.0", - "object-keys": "^1.1.1" - } - }, - "detect-node": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/detect-node/-/detect-node-2.1.0.tgz", - "integrity": "sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g==", - "dev": true, - "optional": true - }, - "dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "dev": true, - "requires": { - "path-type": "^4.0.0" - } - }, - "doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "dev": true, - "peer": true, - "requires": { - "esutils": "^2.0.2" - } - }, - "dot-case": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/dot-case/-/dot-case-3.0.4.tgz", - "integrity": "sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==", - "requires": { - "no-case": "^3.0.4", - "tslib": "^2.0.3" - } - }, - "electron": { - "version": "26.6.8", - "resolved": "https://registry.npmjs.org/electron/-/electron-26.6.8.tgz", - "integrity": "sha512-nuzJ5nVButL1jErc97IVb+A6jbContMg5Uuz5fhmZ4NLcygLkSW8FZpnOT7A4k8Saa95xDJOvqGZyQdI/OPNFw==", - "dev": true, - "requires": { - "@electron/get": "^2.0.0", - "@types/node": "^18.11.18", - "extract-zip": "^2.0.1" - }, - "dependencies": { - "@types/node": { - "version": "18.17.14", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.17.14.tgz", - "integrity": "sha512-ZE/5aB73CyGqgQULkLG87N9GnyGe5TcQjv34pwS8tfBs1IkCh0ASM69mydb2znqd6v0eX+9Ytvk6oQRqu8T1Vw==", - "dev": true - } - } - }, - "end-of-stream": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", - "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", - "dev": true, - "requires": { - "once": "^1.4.0" - } - }, - "entities": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", - "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==" - }, - "env-paths": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", - "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", - "dev": true - }, - "es6-error": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", - "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", - "dev": true, - "optional": true - }, - "esbuild": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.14.47.tgz", - "integrity": "sha512-wI4ZiIfFxpkuxB8ju4MHrGwGLyp1+awEHAHVpx6w7a+1pmYIq8T9FGEVVwFo0iFierDoMj++Xq69GXWYn2EiwA==", - "dev": true, - "requires": { - "esbuild-android-64": "0.14.47", - "esbuild-android-arm64": "0.14.47", - "esbuild-darwin-64": "0.14.47", - "esbuild-darwin-arm64": "0.14.47", - "esbuild-freebsd-64": "0.14.47", - "esbuild-freebsd-arm64": "0.14.47", - "esbuild-linux-32": "0.14.47", - "esbuild-linux-64": "0.14.47", - "esbuild-linux-arm": "0.14.47", - "esbuild-linux-arm64": "0.14.47", - "esbuild-linux-mips64le": "0.14.47", - "esbuild-linux-ppc64le": "0.14.47", - "esbuild-linux-riscv64": "0.14.47", - "esbuild-linux-s390x": "0.14.47", - "esbuild-netbsd-64": "0.14.47", - "esbuild-openbsd-64": "0.14.47", - "esbuild-sunos-64": "0.14.47", - "esbuild-windows-32": "0.14.47", - "esbuild-windows-64": "0.14.47", - "esbuild-windows-arm64": "0.14.47" - } - }, - "esbuild-android-64": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-android-64/-/esbuild-android-64-0.14.47.tgz", - "integrity": "sha512-R13Bd9+tqLVFndncMHssZrPWe6/0Kpv2/dt4aA69soX4PRxlzsVpCvoJeFE8sOEoeVEiBkI0myjlkDodXlHa0g==", - "dev": true, - "optional": true - }, - "esbuild-android-arm64": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.14.47.tgz", - "integrity": "sha512-OkwOjj7ts4lBp/TL6hdd8HftIzOy/pdtbrNA4+0oVWgGG64HrdVzAF5gxtJufAPOsEjkyh1oIYvKAUinKKQRSQ==", - "dev": true, - "optional": true - }, - "esbuild-darwin-64": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.14.47.tgz", - "integrity": "sha512-R6oaW0y5/u6Eccti/TS6c/2c1xYTb1izwK3gajJwi4vIfNs1s8B1dQzI1UiC9T61YovOQVuePDcfqHLT3mUZJA==", - "dev": true, - "optional": true - }, - "esbuild-darwin-arm64": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.47.tgz", - "integrity": "sha512-seCmearlQyvdvM/noz1L9+qblC5vcBrhUaOoLEDDoLInF/VQ9IkobGiLlyTPYP5dW1YD4LXhtBgOyevoIHGGnw==", - "dev": true, - "optional": true - }, - "esbuild-freebsd-64": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.14.47.tgz", - "integrity": "sha512-ZH8K2Q8/Ux5kXXvQMDsJcxvkIwut69KVrYQhza/ptkW50DC089bCVrJZZ3sKzIoOx+YPTrmsZvqeZERjyYrlvQ==", - "dev": true, - "optional": true - }, - "esbuild-freebsd-arm64": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.14.47.tgz", - "integrity": "sha512-ZJMQAJQsIOhn3XTm7MPQfCzEu5b9STNC+s90zMWe2afy9EwnHV7Ov7ohEMv2lyWlc2pjqLW8QJnz2r0KZmeAEQ==", - "dev": true, - "optional": true - }, - "esbuild-linux-32": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.14.47.tgz", - "integrity": "sha512-FxZOCKoEDPRYvq300lsWCTv1kcHgiiZfNrPtEhFAiqD7QZaXrad8LxyJ8fXGcWzIFzRiYZVtB3ttvITBvAFhKw==", - "dev": true, - "optional": true - }, - "esbuild-linux-64": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.14.47.tgz", - "integrity": "sha512-nFNOk9vWVfvWYF9YNYksZptgQAdstnDCMtR6m42l5Wfugbzu11VpMCY9XrD4yFxvPo9zmzcoUL/88y0lfJZJJw==", - "dev": true, - "optional": true - }, - "esbuild-linux-arm": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.14.47.tgz", - "integrity": "sha512-ZGE1Bqg/gPRXrBpgpvH81tQHpiaGxa8c9Rx/XOylkIl2ypLuOcawXEAo8ls+5DFCcRGt/o3sV+PzpAFZobOsmA==", - "dev": true, - "optional": true - }, - "esbuild-linux-arm64": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.14.47.tgz", - "integrity": "sha512-ywfme6HVrhWcevzmsufjd4iT3PxTfCX9HOdxA7Hd+/ZM23Y9nXeb+vG6AyA6jgq/JovkcqRHcL9XwRNpWG6XRw==", - "dev": true, - "optional": true - }, - "esbuild-linux-mips64le": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.14.47.tgz", - "integrity": "sha512-mg3D8YndZ1LvUiEdDYR3OsmeyAew4MA/dvaEJxvyygahWmpv1SlEEnhEZlhPokjsUMfRagzsEF/d/2XF+kTQGg==", - "dev": true, - "optional": true - }, - "esbuild-linux-ppc64le": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.14.47.tgz", - "integrity": "sha512-WER+f3+szmnZiWoK6AsrTKGoJoErG2LlauSmk73LEZFQ/iWC+KhhDsOkn1xBUpzXWsxN9THmQFltLoaFEH8F8w==", - "dev": true, - "optional": true - }, - "esbuild-linux-riscv64": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.14.47.tgz", - "integrity": "sha512-1fI6bP3A3rvI9BsaaXbMoaOjLE3lVkJtLxsgLHqlBhLlBVY7UqffWBvkrX/9zfPhhVMd9ZRFiaqXnB1T7BsL2g==", - "dev": true, - "optional": true - }, - "esbuild-linux-s390x": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-linux-s390x/-/esbuild-linux-s390x-0.14.47.tgz", - "integrity": "sha512-eZrWzy0xFAhki1CWRGnhsHVz7IlSKX6yT2tj2Eg8lhAwlRE5E96Hsb0M1mPSE1dHGpt1QVwwVivXIAacF/G6mw==", - "dev": true, - "optional": true - }, - "esbuild-netbsd-64": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.14.47.tgz", - "integrity": "sha512-Qjdjr+KQQVH5Q2Q1r6HBYswFTToPpss3gqCiSw2Fpq/ua8+eXSQyAMG+UvULPqXceOwpnPo4smyZyHdlkcPppQ==", - "dev": true, - "optional": true - }, - "esbuild-openbsd-64": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.14.47.tgz", - "integrity": "sha512-QpgN8ofL7B9z8g5zZqJE+eFvD1LehRlxr25PBkjyyasakm4599iroUpaj96rdqRlO2ShuyqwJdr+oNqWwTUmQw==", - "dev": true, - "optional": true - }, - "esbuild-sunos-64": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.14.47.tgz", - "integrity": "sha512-uOeSgLUwukLioAJOiGYm3kNl+1wJjgJA8R671GYgcPgCx7QR73zfvYqXFFcIO93/nBdIbt5hd8RItqbbf3HtAQ==", - "dev": true, - "optional": true - }, - "esbuild-windows-32": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.14.47.tgz", - "integrity": "sha512-H0fWsLTp2WBfKLBgwYT4OTfFly4Im/8B5f3ojDv1Kx//kiubVY0IQunP2Koc/fr/0wI7hj3IiBDbSrmKlrNgLQ==", - "dev": true, - "optional": true - }, - "esbuild-windows-64": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.14.47.tgz", - "integrity": "sha512-/Pk5jIEH34T68r8PweKRi77W49KwanZ8X6lr3vDAtOlH5EumPE4pBHqkCUdELanvsT14yMXLQ/C/8XPi1pAtkQ==", - "dev": true, - "optional": true - }, - "esbuild-windows-arm64": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.14.47.tgz", - "integrity": "sha512-HFSW2lnp62fl86/qPQlqw6asIwCnEsEoNIL1h2uVMgakddf+vUuMcCbtUY1i8sst7KkgHrVKCJQB33YhhOweCQ==", - "dev": true, - "optional": true - }, - "escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true - }, - "eslint": { - "version": "8.26.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.26.0.tgz", - "integrity": "sha512-kzJkpaw1Bfwheq4VXUezFriD1GxszX6dUekM7Z3aC2o4hju+tsR/XyTC3RcoSD7jmy9VkPU3+N6YjVU2e96Oyg==", - "dev": true, - "peer": true, - "requires": { - "@eslint/eslintrc": "^1.3.3", - "@humanwhocodes/config-array": "^0.11.6", - "@humanwhocodes/module-importer": "^1.0.1", - "@nodelib/fs.walk": "^1.2.8", - "ajv": "^6.10.0", - "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", - "debug": "^4.3.2", - "doctrine": "^3.0.0", - "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.1.1", - "eslint-utils": "^3.0.0", - "eslint-visitor-keys": "^3.3.0", - "espree": "^9.4.0", - "esquery": "^1.4.0", - "esutils": "^2.0.2", - "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^6.0.1", - "find-up": "^5.0.0", - "glob-parent": "^6.0.2", - "globals": "^13.15.0", - "grapheme-splitter": "^1.0.4", - "ignore": "^5.2.0", - "import-fresh": "^3.0.0", - "imurmurhash": "^0.1.4", - "is-glob": "^4.0.0", - "is-path-inside": "^3.0.3", - "js-sdsl": "^4.1.4", - "js-yaml": "^4.1.0", - "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", - "lodash.merge": "^4.6.2", - "minimatch": "^3.1.2", - "natural-compare": "^1.4.0", - "optionator": "^0.9.1", - "regexpp": "^3.2.0", - "strip-ansi": "^6.0.1", - "strip-json-comments": "^3.1.0", - "text-table": "^0.2.0" - }, - "dependencies": { - "eslint-scope": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz", - "integrity": "sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==", - "dev": true, - "peer": true, - "requires": { - "esrecurse": "^4.3.0", - "estraverse": "^5.2.0" - } - }, - "estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "peer": true - } - } - }, - "eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", - "dev": true, - "requires": { - "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" - } - }, - "eslint-utils": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", - "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", - "dev": true, - "requires": { - "eslint-visitor-keys": "^2.0.0" - }, - "dependencies": { - "eslint-visitor-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", - "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", - "dev": true - } - } - }, - "eslint-visitor-keys": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", - "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", - "dev": true - }, - "espree": { - "version": "9.4.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.4.0.tgz", - "integrity": "sha512-DQmnRpLj7f6TgN/NYb0MTzJXL+vJF9h3pHy4JhCIs3zwcgez8xmGg3sXHcEO97BrmO2OSvCwMdfdlyl+E9KjOw==", - "dev": true, - "peer": true, - "requires": { - "acorn": "^8.8.0", - "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^3.3.0" - } - }, - "esquery": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", - "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", - "dev": true, - "peer": true, - "requires": { - "estraverse": "^5.1.0" - }, - "dependencies": { - "estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "peer": true - } - } - }, - "esrecurse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", - "dev": true, - "requires": { - "estraverse": "^5.2.0" - }, - "dependencies": { - "estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true - } - } - }, - "estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true - }, - "esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true, - "peer": true - }, - "extract-zip": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz", - "integrity": "sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==", - "dev": true, - "requires": { - "@types/yauzl": "^2.9.1", - "debug": "^4.1.1", - "get-stream": "^5.1.0", - "yauzl": "^2.10.0" - } - }, - "fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true, - "peer": true - }, - "fast-glob": { - "version": "3.2.12", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", - "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", - "dev": true, - "requires": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - }, - "dependencies": { - "glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "requires": { - "is-glob": "^4.0.1" - } - } - } - }, - "fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true, - "peer": true - }, - "fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", - "dev": true, - "peer": true - }, - "fastq": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", - "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", - "dev": true, - "requires": { - "reusify": "^1.0.4" - } - }, - "fd-slicer": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", - "integrity": "sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==", - "dev": true, - "requires": { - "pend": "~1.2.0" - } - }, - "file-entry-cache": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", - "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", - "dev": true, - "peer": true, - "requires": { - "flat-cache": "^3.0.4" - } - }, - "file-type": { - "version": "19.0.0", - "resolved": "https://registry.npmjs.org/file-type/-/file-type-19.0.0.tgz", - "integrity": "sha512-s7cxa7/leUWLiXO78DVVfBVse+milos9FitauDLG1pI7lNaJ2+5lzPnr2N24ym+84HVwJL6hVuGfgVE+ALvU8Q==", - "requires": { - "readable-web-to-node-stream": "^3.0.2", - "strtok3": "^7.0.0", - "token-types": "^5.0.1" - } - }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "requires": { - "to-regex-range": "^5.0.1" - } - }, - "find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", - "dev": true, - "peer": true, - "requires": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" - } - }, - "flat-cache": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", - "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", - "dev": true, - "peer": true, - "requires": { - "flatted": "^3.1.0", - "rimraf": "^3.0.2" - } - }, - "flatted": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", - "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", - "dev": true, - "peer": true - }, - "fs-extra": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", - "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", - "dev": true, - "requires": { - "graceful-fs": "^4.2.0", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - } - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true, - "peer": true - }, - "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true, - "optional": true - }, - "functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==", - "dev": true - }, - "get-intrinsic": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", - "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", - "dev": true, - "optional": true, - "requires": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-proto": "^1.0.1", - "has-symbols": "^1.0.3" - } - }, - "get-stream": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", - "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", - "dev": true, - "requires": { - "pump": "^3.0.0" - } - }, - "glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "dev": true, - "peer": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "glob-parent": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", - "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", - "dev": true, - "peer": true, - "requires": { - "is-glob": "^4.0.3" - } - }, - "global-agent": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/global-agent/-/global-agent-3.0.0.tgz", - "integrity": "sha512-PT6XReJ+D07JvGoxQMkT6qji/jVNfX/h364XHZOWeRzy64sSFr+xJ5OX7LI3b4MPQzdL4H8Y8M0xzPpsVMwA8Q==", - "dev": true, - "optional": true, - "requires": { - "boolean": "^3.0.1", - "es6-error": "^4.1.1", - "matcher": "^3.0.0", - "roarr": "^2.15.3", - "semver": "^7.3.2", - "serialize-error": "^7.0.1" - } - }, - "globals": { - "version": "13.17.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.17.0.tgz", - "integrity": "sha512-1C+6nQRb1GwGMKm2dH/E7enFAMxGTmGI7/dEdhy/DNelv85w9B72t3uc5frtMNXIbzrarJJ/lTCjcaZwbLJmyw==", - "dev": true, - "peer": true, - "requires": { - "type-fest": "^0.20.2" - } - }, - "globalthis": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz", - "integrity": "sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==", - "dev": true, - "optional": true, - "requires": { - "define-properties": "^1.1.3" - } - }, - "globby": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", - "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", - "dev": true, - "requires": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.9", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^3.0.0" - } - }, - "got": { - "version": "11.8.6", - "resolved": "https://registry.npmjs.org/got/-/got-11.8.6.tgz", - "integrity": "sha512-6tfZ91bOr7bOXnK7PRDCGBLa1H4U080YHNaAQ2KsMGlLEzRbk44nsZF2E1IeRc3vtJHPVbKCYgdFbaGO2ljd8g==", - "dev": true, - "requires": { - "@sindresorhus/is": "^4.0.0", - "@szmarczak/http-timer": "^4.0.5", - "@types/cacheable-request": "^6.0.1", - "@types/responselike": "^1.0.0", - "cacheable-lookup": "^5.0.3", - "cacheable-request": "^7.0.2", - "decompress-response": "^6.0.0", - "http2-wrapper": "^1.0.0-beta.5.2", - "lowercase-keys": "^2.0.0", - "p-cancelable": "^2.0.0", - "responselike": "^2.0.0" - } - }, - "graceful-fs": { - "version": "4.2.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", - "dev": true - }, - "grapheme-splitter": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", - "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", - "dev": true, - "peer": true - }, - "has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, - "optional": true, - "requires": { - "function-bind": "^1.1.1" - } - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "peer": true - }, - "has-property-descriptors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", - "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", - "dev": true, - "optional": true, - "requires": { - "get-intrinsic": "^1.1.1" - } - }, - "has-proto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", - "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", - "dev": true, - "optional": true - }, - "has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", - "dev": true, - "optional": true - }, - "html-minifier-terser": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/html-minifier-terser/-/html-minifier-terser-7.2.0.tgz", - "integrity": "sha512-tXgn3QfqPIpGl9o+K5tpcj3/MN4SfLtsx2GWwBC3SSd0tXQGyF3gsSqad8loJgKZGM3ZxbYDd5yhiBIdWpmvLA==", - "requires": { - "camel-case": "^4.1.2", - "clean-css": "~5.3.2", - "commander": "^10.0.0", - "entities": "^4.4.0", - "param-case": "^3.0.4", - "relateurl": "^0.2.7", - "terser": "^5.15.1" - }, - "dependencies": { - "commander": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", - "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==" - } - } - }, - "http-cache-semantics": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", - "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==", - "dev": true - }, - "http2-wrapper": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-1.0.3.tgz", - "integrity": "sha512-V+23sDMr12Wnz7iTcDeJr3O6AIxlnvT/bmaAAAP/Xda35C90p9599p0F1eHR/N1KILWSoWVAiOMFjBBXaXSMxg==", - "dev": true, - "requires": { - "quick-lru": "^5.1.1", - "resolve-alpn": "^1.0.0" - } - }, - "ieee754": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==" - }, - "ignore": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", - "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", - "dev": true - }, - "import-fresh": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", - "dev": true, - "peer": true, - "requires": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - } - }, - "imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", - "dev": true, - "peer": true - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "dev": true, - "peer": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "dev": true - }, - "is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, - "requires": { - "is-extglob": "^2.1.1" - } - }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true - }, - "is-path-inside": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", - "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", - "dev": true, - "peer": true - }, - "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true, - "peer": true - }, - "js-sdsl": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.1.5.tgz", - "integrity": "sha512-08bOAKweV2NUC1wqTtf3qZlnpOX/R2DU9ikpjOHs0H+ibQv3zpncVQg6um4uYtRtrwIX8M4Nh3ytK4HGlYAq7Q==", - "dev": true, - "peer": true - }, - "js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "dev": true, - "peer": true, - "requires": { - "argparse": "^2.0.1" - } - }, - "json-buffer": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", - "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", - "dev": true - }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true, - "peer": true - }, - "json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", - "dev": true, - "peer": true - }, - "json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", - "dev": true, - "optional": true - }, - "jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.6" - } - }, - "keyv": { - "version": "4.5.3", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.3.tgz", - "integrity": "sha512-QCiSav9WaX1PgETJ+SpNnx2PRRapJ/oRSXM4VO5OGYGSjrxbKPVFVhB3l2OCbLCk329N8qyAtsJjSjvVBWzEug==", - "dev": true, - "requires": { - "json-buffer": "3.0.1" - } - }, - "levn": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", - "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", - "dev": true, - "peer": true, - "requires": { - "prelude-ls": "^1.2.1", - "type-check": "~0.4.0" - } - }, - "locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", - "dev": true, - "peer": true, - "requires": { - "p-locate": "^5.0.0" - } - }, - "lodash.merge": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "dev": true, - "peer": true - }, - "lower-case": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz", - "integrity": "sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==", - "requires": { - "tslib": "^2.0.3" - } - }, - "lowercase-keys": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", - "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==", - "dev": true - }, - "lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "requires": { - "yallist": "^4.0.0" - } - }, - "matcher": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/matcher/-/matcher-3.0.0.tgz", - "integrity": "sha512-OkeDaAZ/bQCxeFAozM55PKcKU0yJMPGifLwV4Qgjitu+5MoAfSQN4lsLJeXZ1b8w0x+/Emda6MZgXS1jvsapng==", - "dev": true, - "optional": true, - "requires": { - "escape-string-regexp": "^4.0.0" - } - }, - "merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "dev": true - }, - "micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", - "dev": true, - "requires": { - "braces": "^3.0.2", - "picomatch": "^2.3.1" - } - }, - "mime": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz", - "integrity": "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==" - }, - "mime-db": { - "version": "1.25.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.25.0.tgz", - "integrity": "sha512-5k547tI4Cy+Lddr/hdjNbBEWBwSl8EBc5aSdKvedav8DReADgWJzcYiktaRIw3GtGC1jjwldXtTzvqJZmtvC7w==" - }, - "mime-types": { - "version": "2.1.13", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.13.tgz", - "integrity": "sha512-ryBDp1Z/6X90UvjUK3RksH0IBPM137T7cmg4OgD5wQBojlAiUwuok0QeELkim/72EtcYuNlmbkrcGuxj3Kl0YQ==", - "requires": { - "mime-db": "~1.25.0" - } - }, - "mimic-response": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", - "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==", - "dev": true - }, - "minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "peer": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minisearch": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/minisearch/-/minisearch-6.3.0.tgz", - "integrity": "sha512-ihFnidEeU8iXzcVHy74dhkxh/dn8Dc08ERl0xwoMMGqp4+LvRSCgicb+zGqWthVokQKvCSxITlh3P08OzdTYCQ==" - }, - "moment": { - "version": "2.29.4", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz", - "integrity": "sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==", - "dev": true - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "natural-compare": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", - "dev": true, - "peer": true - }, - "no-case": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz", - "integrity": "sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==", - "requires": { - "lower-case": "^2.0.2", - "tslib": "^2.0.3" - } - }, - "normalize-url": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-6.1.0.tgz", - "integrity": "sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A==", - "dev": true - }, - "object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", - "dev": true, - "optional": true - }, - "obsidian": { - "version": "1.4.11", - "resolved": "https://registry.npmjs.org/obsidian/-/obsidian-1.4.11.tgz", - "integrity": "sha512-BCVYTvaXxElJMl6MMbDdY/CGK+aq18SdtDY/7vH8v6BxCBQ6KF4kKxL0vG9UZ0o5qh139KpUoJHNm+6O5dllKA==", - "dev": true, - "requires": { - "@types/codemirror": "5.60.8", - "moment": "2.29.4" - } - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dev": true, - "requires": { - "wrappy": "1" - } - }, - "optionator": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", - "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", - "dev": true, - "peer": true, - "requires": { - "deep-is": "^0.1.3", - "fast-levenshtein": "^2.0.6", - "levn": "^0.4.1", - "prelude-ls": "^1.2.1", - "type-check": "^0.4.0", - "word-wrap": "^1.2.3" - } - }, - "p-cancelable": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-2.1.1.tgz", - "integrity": "sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg==", - "dev": true - }, - "p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, - "peer": true, - "requires": { - "yocto-queue": "^0.1.0" - } - }, - "p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", - "dev": true, - "peer": true, - "requires": { - "p-limit": "^3.0.2" - } - }, - "param-case": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/param-case/-/param-case-3.0.4.tgz", - "integrity": "sha512-RXlj7zCYokReqWpOPH9oYivUzLYZ5vAPIfEmCTNViosC78F8F0H9y7T7gG2M39ymgutxF5gcFEsyZQSph9Bp3A==", - "requires": { - "dot-case": "^3.0.4", - "tslib": "^2.0.3" - } - }, - "parent-module": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "dev": true, - "peer": true, - "requires": { - "callsites": "^3.0.0" - } - }, - "pascal-case": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/pascal-case/-/pascal-case-3.1.2.tgz", - "integrity": "sha512-uWlGT3YSnK9x3BQJaOdcZwrnV6hPpd8jFH1/ucpiLRPh/2zCVJKS19E4GvYHvaCcACn3foXZ0cLB9Wrx1KGe5g==", - "requires": { - "no-case": "^3.0.4", - "tslib": "^2.0.3" - } - }, - "path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true, - "peer": true - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "dev": true, - "peer": true - }, - "path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, - "peer": true - }, - "path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true - }, - "peek-readable": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/peek-readable/-/peek-readable-5.0.0.tgz", - "integrity": "sha512-YtCKvLUOvwtMGmrniQPdO7MwPjgkFBtFIrmfSbYmYuq3tKDV/mcfAhBth1+C3ru7uXIZasc/pHnb+YDYNkkj4A==" - }, - "pend": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", - "integrity": "sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==", - "dev": true - }, - "picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true - }, - "prelude-ls": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", - "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", - "dev": true, - "peer": true - }, - "progress": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", - "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", - "dev": true - }, - "pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "dev": true, - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "dev": true, - "peer": true - }, - "queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true - }, - "quick-lru": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz", - "integrity": "sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==", - "dev": true - }, - "readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - }, - "readable-web-to-node-stream": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/readable-web-to-node-stream/-/readable-web-to-node-stream-3.0.2.tgz", - "integrity": "sha512-ePeK6cc1EcKLEhJFt/AebMCLL+GgSKhuygrZ/GLaKZYEecIgIECf4UaUuaByiGtzckwR4ain9VzUh95T1exYGw==", - "requires": { - "readable-stream": "^3.6.0" - } - }, - "regexpp": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", - "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", - "dev": true - }, - "relateurl": { - "version": "0.2.7", - "resolved": "https://registry.npmjs.org/relateurl/-/relateurl-0.2.7.tgz", - "integrity": "sha512-G08Dxvm4iDN3MLM0EsP62EDV9IuhXPR6blNz6Utcp7zyV3tr4HVNINt6MpaRWbxoOHT3Q7YN2P+jaHX8vUbgog==" - }, - "resolve-alpn": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/resolve-alpn/-/resolve-alpn-1.2.1.tgz", - "integrity": "sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g==", - "dev": true - }, - "resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true, - "peer": true - }, - "responselike": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/responselike/-/responselike-2.0.1.tgz", - "integrity": "sha512-4gl03wn3hj1HP3yzgdI7d3lCkF95F21Pz4BPGvKHinyQzALR5CapwC8yIi0Rh58DEMQ/SguC03wFj2k0M/mHhw==", - "dev": true, - "requires": { - "lowercase-keys": "^2.0.0" - } - }, - "reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true - }, - "rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "peer": true, - "requires": { - "glob": "^7.1.3" - } - }, - "roarr": { - "version": "2.15.4", - "resolved": "https://registry.npmjs.org/roarr/-/roarr-2.15.4.tgz", - "integrity": "sha512-CHhPh+UNHD2GTXNYhPWLnU8ONHdI+5DI+4EYIAOaiD63rHeYlZvyh8P+in5999TTSFgUYuKUAjzRI4mdh/p+2A==", - "dev": true, - "optional": true, - "requires": { - "boolean": "^3.0.1", - "detect-node": "^2.0.4", - "globalthis": "^1.0.1", - "json-stringify-safe": "^5.0.1", - "semver-compare": "^1.0.0", - "sprintf-js": "^1.1.2" - } - }, - "rss": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/rss/-/rss-1.2.2.tgz", - "integrity": "sha512-xUhRTgslHeCBeHAqaWSbOYTydN2f0tAzNXvzh3stjz7QDhQMzdgHf3pfgNIngeytQflrFPfy6axHilTETr6gDg==", - "requires": { - "mime-types": "2.1.13", - "xml": "1.0.1" - } - }, - "run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, - "requires": { - "queue-microtask": "^1.2.2" - } - }, - "safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" - }, - "semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dev": true, - "requires": { - "lru-cache": "^6.0.0" - } - }, - "semver-compare": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz", - "integrity": "sha512-YM3/ITh2MJ5MtzaM429anh+x2jiLVjqILF4m4oyQB18W7Ggea7BfqdH/wGMK7dDiMghv/6WG7znWMwUDzJiXow==", - "dev": true, - "optional": true - }, - "serialize-error": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/serialize-error/-/serialize-error-7.0.1.tgz", - "integrity": "sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw==", - "dev": true, - "optional": true, - "requires": { - "type-fest": "^0.13.1" - }, - "dependencies": { - "type-fest": { - "version": "0.13.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz", - "integrity": "sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==", - "dev": true, - "optional": true - } - } - }, - "shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "peer": true, - "requires": { - "shebang-regex": "^3.0.0" - } - }, - "shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, - "peer": true - }, - "slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" - }, - "source-map-support": { - "version": "0.5.21", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", - "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", - "requires": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - } - }, - "sprintf-js": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.2.tgz", - "integrity": "sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug==", - "dev": true, - "optional": true - }, - "string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "requires": { - "safe-buffer": "~5.2.0" - } - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "peer": true, - "requires": { - "ansi-regex": "^5.0.1" - } - }, - "strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true, - "peer": true - }, - "strtok3": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/strtok3/-/strtok3-7.0.0.tgz", - "integrity": "sha512-pQ+V+nYQdC5H3Q7qBZAz/MO6lwGhoC2gOAjuouGf/VO0m7vQRh8QNMl2Uf6SwAtzZ9bOw3UIeBukEGNJl5dtXQ==", - "requires": { - "@tokenizer/token": "^0.3.0", - "peek-readable": "^5.0.0" - } - }, - "style-mod": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/style-mod/-/style-mod-4.0.0.tgz", - "integrity": "sha512-OPhtyEjyyN9x3nhPsu76f52yUGXiZcgvsrFVtvTkyGRQJ0XK+GPc6ov1z+lRpbeabka+MYEQxOYRnt5nF30aMw==", - "dev": true, - "peer": true - }, - "sumchecker": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/sumchecker/-/sumchecker-3.0.1.tgz", - "integrity": "sha512-MvjXzkz/BOfyVDkG0oFOtBxHX2u3gKbMHIF/dXblZsgD3BWOFLmHovIpZY7BykJdAjcqRCBi1WYBNdEC9yI7vg==", - "dev": true, - "requires": { - "debug": "^4.1.0" - } - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "peer": true, - "requires": { - "has-flag": "^4.0.0" - } - }, - "terser": { - "version": "5.27.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.27.0.tgz", - "integrity": "sha512-bi1HRwVRskAjheeYl291n3JC4GgO/Ty4z1nVs5AAsmonJulGxpSektecnNedrwK9C7vpvVtcX3cw00VSLt7U2A==", - "requires": { - "@jridgewell/source-map": "^0.3.3", - "acorn": "^8.8.2", - "commander": "^2.20.0", - "source-map-support": "~0.5.20" - } - }, - "text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", - "dev": true, - "peer": true - }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "requires": { - "is-number": "^7.0.0" - } - }, - "token-types": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/token-types/-/token-types-5.0.1.tgz", - "integrity": "sha512-Y2fmSnZjQdDb9W4w4r1tswlMHylzWIeOKpx0aZH9BgGtACHhrk3OkT52AzwcuqTRBZtvvnTjDBh8eynMulu8Vg==", - "requires": { - "@tokenizer/token": "^0.3.0", - "ieee754": "^1.2.1" - } - }, - "tslib": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", - "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==" - }, - "tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", - "dev": true, - "requires": { - "tslib": "^1.8.1" - }, - "dependencies": { - "tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - } - } - }, - "type-check": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", - "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", - "dev": true, - "peer": true, - "requires": { - "prelude-ls": "^1.2.1" - } - }, - "type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "dev": true, - "peer": true - }, - "typescript": { - "version": "4.7.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz", - "integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==", - "dev": true - }, - "universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "dev": true - }, - "upath": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/upath/-/upath-2.0.1.tgz", - "integrity": "sha512-1uEe95xksV1O0CYKXo8vQvN1JEbtJp7lb7C5U9HMsIp6IVwntkH/oNUzyVNQSd4S1sYk2FpSSW44FqMc8qee5w==" - }, - "uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dev": true, - "peer": true, - "requires": { - "punycode": "^2.1.0" - } - }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" - }, - "w3c-keyname": { - "version": "2.2.6", - "resolved": "https://registry.npmjs.org/w3c-keyname/-/w3c-keyname-2.2.6.tgz", - "integrity": "sha512-f+fciywl1SJEniZHD6H+kUO8gOnwIr7f4ijKA6+ZvJFjeGi1r4PDLl53Ayud9O/rk64RqgoQine0feoeOU0kXg==", - "dev": true, - "peer": true - }, - "which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "peer": true, - "requires": { - "isexe": "^2.0.0" - } - }, - "word-wrap": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", - "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", - "dev": true, - "peer": true - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true - }, - "xml": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/xml/-/xml-1.0.1.tgz", - "integrity": "sha512-huCv9IH9Tcf95zuYCsQraZtWnJvBtLVE0QHMOs8bWyZAFZNDcYjsPq1nEx8jKA9y+Beo9v+7OBPRisQTjinQMw==" - }, - "yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, - "yauzl": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", - "integrity": "sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==", - "dev": true, - "requires": { - "buffer-crc32": "~0.2.3", - "fd-slicer": "~1.1.0" - } - }, - "yocto-queue": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", - "dev": true, - "peer": true - } - } -} diff --git a/.obsidian/plugins/obsidian-webpage-export-master/package.json b/.obsidian/plugins/obsidian-webpage-export-master/package.json deleted file mode 100644 index 5bb86917..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "obsidian-webpage-export", - "version": "1.3.2", - "description": "Exports an obsidian document as an HTML document / webpage / website, correctly including all styling and formatting.", - "main": "main.js", - "scripts": { - "dev": "node esbuild.config.mjs", - "build": "tsc -noEmit -skipLibCheck && node esbuild.config.mjs production", - "version": "node version-bump.mjs && git add manifest.json versions.json" - }, - "keywords": [], - "author": "Nathan George", - "license": "GPL-3.0", - "devDependencies": { - "@types/node": "^16.11.6", - "@types/rss": "^0.0.32", - "@typescript-eslint/eslint-plugin": "^7.8.0", - "@typescript-eslint/parser": "^7.8.0", - "builtin-modules": "3.3.0", - "electron": "^26.1.0", - "esbuild": "0.14.47", - "eslint": "^8.56.0", - "obsidian": "^1.4.11", - "tslib": "^2.6.2", - "typescript": "^5.4.5" - }, - "dependencies": { - "file-type": "^19.0.0", - "html-minifier-terser": "^7.2.0", - "mime": "^4.0.3", - "minisearch": "^6.3.0", - "rss": "^1.2.2", - "upath": "^2.0.1" - } -} diff --git a/.obsidian/plugins/obsidian-webpage-export-master/page_layout.xml b/.obsidian/plugins/obsidian-webpage-export-master/page_layout.xml deleted file mode 100644 index 46dac6c4..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/page_layout.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.obsidian/plugins/obsidian-webpage-export-master/scripts/api-options.ts b/.obsidian/plugins/obsidian-webpage-export-master/scripts/api-options.ts deleted file mode 100644 index 31a5d4cc..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/scripts/api-options.ts +++ /dev/null @@ -1,211 +0,0 @@ -import { ExportPreset, Settings } from "./settings/settings"; - -/** - * General options for the MarkdownRendererAPI - */ -export class MarkdownRendererAPIOptions -{ - /** - * The container to render the HTML into. - */ - container?: HTMLElement = undefined; - - /** - * Keep the .markdown-preview-view or .view-content container elements. - */ - keepViewContainer?: boolean = true; - - /** - * Convert the headers into a tree structure with all children of a header being in their own container. - */ - makeHeadersTrees?: boolean = true; - - /** - * Run post processing on the html to clean up various obsidian specific elements. - */ - postProcess?: boolean = true; - - /** - * Display a window with a log and progress bar. - */ - displayProgress?: boolean = true; -} - -export class GraphViewOptions -{ - attractionForce = 1; - linkLength = 10; - repulsionForce = 150; - centralForce = 3; - edgePruning = 100; - minNodeRadius = 3; - maxNodeRadius = 7; -} - -/** - * Options for the MarkdownWebpageRendererAPI when export a webpage object. - */ -export class MarkdownWebpageRendererAPIOptions extends MarkdownRendererAPIOptions -{ - /** - * Add sidebars to either side of the page. - */ - addSidebars?: boolean = Settings.exportPreset != ExportPreset.RawDocuments; - - /** - * Add a theme toggle to the left sidebar. - */ - addThemeToggle?: boolean = Settings.addThemeToggle; - - /** - * Add a file navigation tree to the left sidebar. - */ - addFileNavigation?: boolean = Settings.addFileNav; - - /** - * Add a document outline to the right sidebar - */ - addOutline?: boolean = Settings.addOutline; - - /** - * Add a search bar to the left sidebar. - */ - addSearch?: boolean = Settings.addSearchBar; - - /** - * Add the global graph view to the right sidebar. - */ - addGraphView?: boolean = Settings.addGraphView; - - /** - * Transfer body classes from obsidian to the exported document. - */ - addBodyClasses?: boolean = true; - - /** - * Add mathjax styles to the document - */ - addMathjaxStyles?: boolean = true; - - /** - * Add a tag with metadata, scripts, and styles. - */ - addHeadTag?: boolean = true; - - /** - * Create an RSS feed for the site - */ - addRSS?: boolean = Settings.addRSSFeed; - - /** - * Add a title to the top of each page. (Makes sure there are no duplicate titles) - */ - addTitle?: boolean = Settings.addTitle; - - /** - * The options controlling the behavior of the gaph view. - */ - graphViewOptions?: GraphViewOptions = new GraphViewOptions(); - - /** - * Allows lists with sub-items to be folded / collpased. - */ - allowFoldingLists?: boolean = Settings.allowFoldingLists; - - /** - * Allows headings to be folded / collapsed. - */ - allowFoldingHeadings?: boolean = Settings.allowFoldingHeadings; - - /** - * Allows the sidebars to be resized. - */ - allowResizeSidebars?: boolean = Settings.allowResizingSidebars; - - /** - * The current file wil be opened in the file anvigation by default. - * This only works in HTML is inlined! - */ - openNavFileLocation?: boolean = true; - - /** - * All items in the document outline will be collpased by default. - */ - startOutlineCollapsed?: boolean = Settings.startOutlineCollapsed; - - /** - * Any outline item with a nesting level >= to this will be collapsible. - */ - minOutlineCollapsibleLevel?: number = Settings.minOutlineCollapse; - - /** - * Include javascript in the export (both inline or external) - */ - includeJS?: boolean = true; - - /** - * Include CSS in the export (both inline or external) - */ - includeCSS?: boolean = true; - - /** - * Inline / embed media items (images, video, audio) directly into the HTML. - */ - inlineMedia?: boolean = Settings.inlineAssets; - - /** - * Inline / embed the css styles directly into the HTML. - */ - inlineCSS?: boolean = Settings.inlineAssets; - - /** - * Inline / embed the javascript directly into the HTML. - */ - inlineJS?: boolean = Settings.inlineAssets; - - /** - * Inline / embed other HTML directly into the HTML. - */ - inlineHTML?: boolean = Settings.inlineAssets; - - /** - * Inline / embed fonts directly into the HTML. - */ - inlineFonts?: boolean = Settings.inlineAssets; - - /** - * Do not leave any online urls, download them and embed them into the HTML. - */ - offlineResources?: boolean = Settings.makeOfflineCompatible; - - /** - * Make all paths and file names web style (lowercase, no spaces). - * For example: "My File.md" -> "my-file.html" - */ - webStylePaths?: boolean = Settings.makeNamesWebStyle; - - /** - * Flatten all export paths so that all HTML files are exported to the same root directory without the normal folder structure. - */ - flattenExportPaths?: boolean = false; - - /** - * Fix all links to be relative and direct to other files or media included in the export. - */ - fixLinks?: boolean = true; - - /** - * The url that this site will be hosted at. This is used for the rss feed data. - */ - siteURL?: string = Settings.siteURL; - - /** - * The name of the vault displayed above the file navigation. - */ - siteName?: string = Settings.vaultTitle || app.vault.getName(); - - /** - * The name of the author of the site. - */ - authorName?: string = Settings.authorName; -} diff --git a/.obsidian/plugins/obsidian-webpage-export-master/scripts/exporter.ts b/.obsidian/plugins/obsidian-webpage-export-master/scripts/exporter.ts deleted file mode 100644 index b9c51487..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/scripts/exporter.ts +++ /dev/null @@ -1,109 +0,0 @@ -import { Notice, TFile, TFolder } from "obsidian"; -import { Path } from "./utils/path"; -import { Settings, SettingsPage } from "./settings/settings"; -import HTMLExportPlugin from "./main"; -import { Utils } from "./utils/utils"; -import { Website } from "./objects/website"; -import { MarkdownRendererAPI } from "./render-api"; - -export class HTMLExporter -{ - public static async export(usePreviousSettings: boolean = true, overrideFiles: TFile[] | undefined = undefined, overrideExportPath: Path | undefined = undefined) - { - let info = await SettingsPage.updateSettings(usePreviousSettings, overrideFiles, overrideExportPath); - if ((!info && !usePreviousSettings) || (info && info.canceled)) return; - - let files = info?.pickedFiles ?? overrideFiles ?? SettingsPage.getFilesToExport(); - let exportPath = overrideExportPath ?? info?.exportPath ?? new Path(Settings.exportPath); - - let website = await HTMLExporter.exportFiles(files, exportPath, true, Settings.deleteOldFiles); - - if (!website) return; - if (Settings.openAfterExport) Utils.openPath(exportPath); - new Notice("✅ Finished HTML Export:\n\n" + exportPath, 5000); - } - - public static async exportFiles(files: TFile[], destination: Path, saveFiles: boolean, deleteOld: boolean) : Promise - { - var website = await new Website().createWithFiles(files, destination); - - if (!website) - { - new Notice("❌ Export Cancelled", 5000); - return; - } - - await website.index.updateBodyClasses(); - if (deleteOld) await website.index.deleteOldFiles(); - if (saveFiles) - { - await Utils.downloadFiles(website.downloads, destination); - } - - MarkdownRendererAPI.endBatch(); - - return website; - } - - public static async exportFolder(folder: TFolder, rootExportPath: Path, saveFiles: boolean, clearDirectory: boolean) : Promise - { - let folderPath = new Path(folder.path); - let allFiles = HTMLExportPlugin.plugin.app.vault.getFiles(); - let files = allFiles.filter((file) => new Path(file.path).directory.asString.startsWith(folderPath.asString)); - - return await this.exportFiles(files, rootExportPath, saveFiles, clearDirectory); - } - - public static async exportVault(rootExportPath: Path, saveFiles: boolean, clearDirectory: boolean) : Promise - { - let files = HTMLExportPlugin.plugin.app.vault.getFiles(); - return await this.exportFiles(files, rootExportPath, saveFiles, clearDirectory); - } - - - // public static async deleteNonExports(webpages: Webpage[], rootPath: Path) - // { - // return; - - // // delete all files in root path that are not in exports - // let files = (await this.getAllFilesInFolderRecursive(rootPath)).filter((file) => !file.makeUnixStyle().asString.contains(Asset.mediaPath.makeUnixStyle().asString)); - - // RenderLog.log(files, "Deletion candidates"); - - // let toDelete = []; - // for (let i = 0; i < files.length; i++) - // { - // RenderLog.progress(i, files.length, "Finding Old Files", "Checking: " + files[i].asString, "var(--color-yellow)"); - - // let file = files[i]; - // if(!webpages.find((exportedFile) => exportedFile.exportPathAbsolute.makeUnixStyle().asString == file.makeUnixStyle().asString)) - // { - // for (let webpage of webpages) - // { - // if (webpage.downloads.find((download) => download.relativeDownloadDirectory.makeUnixStyle().asString == file.makeUnixStyle().asString)) - // { - // toDelete.push(file); - // break; - // } - // } - // } - // } - - // for (let i = 0; i < toDelete.length; i++) - // { - // let file = toDelete[i]; - // RenderLog.progress(i, toDelete.length, "Deleting Old Files", "Deleting: " + file.asString, "var(--color-red)"); - // await fs.unlink(file.asString); - // } - - // // delete all empty folders in root path - // let folders = (await this.getAllEmptyFoldersRecursive(rootPath)); - - // for (let i = 0; i < folders.length; i++) - // { - // let folder = folders[i]; - // RenderLog.progress(i, folders.length, "Deleting Empty Folders", "Deleting: " + folder.asString, "var(--color-purple)"); - // await fs.rmdir(folder.directory.asString); - // } - // } -} diff --git a/.obsidian/plugins/obsidian-webpage-export-master/scripts/graph-view-cpp/GraphView.cpp b/.obsidian/plugins/obsidian-webpage-export-master/scripts/graph-view-cpp/GraphView.cpp deleted file mode 100644 index 98bbfeb4..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/scripts/graph-view-cpp/GraphView.cpp +++ /dev/null @@ -1,408 +0,0 @@ -#include "Dense.h" -#include -#include -#include -#include -#include -#include -#include "SpatialHashTable.h" - -using namespace Eigen; - -Vector2f* positions; -Vector2f* connectedDeltas; -Vector2f* lastConnectedDeltas; -Vector2f* forces; -Vector2f massOffsetFromCenterAccumulator; -Vector2f massOffsetFromCenter; -float* radii; -int* linkSources; -int* linkTargets; -int* linkCounts; -float* maxRadiiLinks; - -int totalNodes = 0; -int totalLinks = 0; -float maxRadius = 0; -float minRadius = 0; - -float dt = 0.01f; - -float attractionForce = 0; -float linkLength = 0; -float repulsionForce = 0; -float centralForce = 0; - -float batchFractionSize = 1.0f; -int batchSize = 0; -int batchOffset = 0; -int nextBatchOffset = 0; -int batchesPerRound = 0; - -int hoveredNode = -1; - -SpatialHashingTable table = NULL; - -float rand01() -{ - return static_cast (rand()) / static_cast (RAND_MAX); -} - -void print(const char* fmt, ...) -{ - va_list arg; - va_start(arg, fmt); - - char buffer[1024]; - vsprintf(buffer, fmt, arg); - - EM_ASM_ARGS({ - console.log(UTF8ToString($0)); - }, buffer); - - va_end(arg); -} - -void swap(Vector2f** a, Vector2f** b) -{ - Vector2f *temp = *a; - *a = *b; - *b = temp; -} - -float gaussianPlatau(float x, float width, float baseline = 0.1) -{ - float x_wdith = x/width; - return (1-baseline) * 1/(1+x_wdith*x_wdith) + baseline; -} - - -extern "C" -{ - -EMSCRIPTEN_KEEPALIVE -void SetBatchFractionSize(float fraction) -{ - batchFractionSize = fraction; - batchSize = std::min(std::max((int)(totalNodes * batchFractionSize), 50), totalNodes); - batchesPerRound = std::ceil(std::max(totalNodes / batchSize, 1)); -} - -EMSCRIPTEN_KEEPALIVE -void SetAttractionForce(float _attractionForce) -{ - attractionForce = _attractionForce; -} - -EMSCRIPTEN_KEEPALIVE -void SetLinkLength(float _linkLength) -{ - linkLength = _linkLength; -} - -EMSCRIPTEN_KEEPALIVE -void SetRepulsionForce(float _repulsionForce) -{ - repulsionForce = _repulsionForce; -} - -EMSCRIPTEN_KEEPALIVE -void SetCentralForce(float _centralForce) -{ - centralForce = _centralForce; -} - -EMSCRIPTEN_KEEPALIVE -void SetDt(float _dt) -{ - dt = _dt; -} - -EMSCRIPTEN_KEEPALIVE -void Init(Vector2f* _positions, float* _radii, int* _linkSources, int* _linkTargets, int _totalNodes, int _totalLinks, float batchFraction, float _dt, float _attractionForce, float _linkLength, float _repulsionForce, float _centralForce) -{ - print("Init called"); - - totalNodes = _totalNodes; - totalLinks = _totalLinks; - batchFractionSize = batchFraction; - - dt = _dt; - attractionForce = _attractionForce; - linkLength = _linkLength; - repulsionForce = _repulsionForce; - centralForce = _centralForce; - - positions = _positions; - forces = new Vector2f[totalNodes]; - connectedDeltas = new Vector2f[totalNodes]; - lastConnectedDeltas = new Vector2f[totalNodes]; - radii = _radii; - linkSources = _linkSources; - linkTargets = _linkTargets; - linkCounts = new int[totalNodes]; - maxRadiiLinks = new float[totalNodes]; - - maxRadius = 0; - minRadius = 1000000; - for (int i = 0; i < totalNodes; i++) - { - maxRadius = std::max(maxRadius, radii[i]); - minRadius = std::min(minRadius, radii[i]); - maxRadiiLinks[i] = 0; - } - - for (int i = 0; i < totalLinks; i++) - { - linkCounts[linkSources[i]]++; - linkCounts[linkTargets[i]]++; - - maxRadiiLinks[linkSources[i]] = std::max(maxRadiiLinks[linkSources[i]], radii[linkTargets[i]]); - maxRadiiLinks[linkTargets[i]] = std::max(maxRadiiLinks[linkTargets[i]], radii[linkSources[i]]); - } - - SetBatchFractionSize(batchFractionSize); - - table = SpatialHashingTable(maxRadius); -} - -float settleness = 1.0f; - -EMSCRIPTEN_KEEPALIVE -int Update(float mouseX, float mouseY, int grabbedNode, float cameraScale) -{ - Vector2f mousePos = Vector2f(mouseX, mouseY); - - if(grabbedNode != -1) - { - settleness = 1.0f; - if(grabbedNode < totalNodes) - positions[grabbedNode] = mousePos; - else - { - print("Grabbed node is out of bounds"); - } - } - - swap(&connectedDeltas, &lastConnectedDeltas); - - for (int i = 0; i < totalNodes; i++) - { - connectedDeltas[i] = Vector2f(0, 0); - forces[i] = Vector2f(0, 0); - } - - float multiplier = multiplier = std::min(attractionForce, 1.0f); - float maxRadiusSqr = maxRadius * maxRadius; - - for (int i = 0; i < totalLinks; i++) - { - int target = linkTargets[i]; - int source = linkSources[i]; - if (target == source) continue; - - if(target >= totalNodes || source >= totalNodes) - { - print("Link target or source is out of bounds"); - continue; - } - - Vector2f targetPos = positions[target]; - Vector2f sourcePos = positions[source]; - Vector2f delta = targetPos - sourcePos; - - connectedDeltas[source] += delta; - connectedDeltas[target] += -delta; - - float sourceRadius = radii[source]; - float targetRadius = radii[target]; - - float distance = delta.norm(); - if (distance <= 1) - { - positions[source] += Vector2f((rand01() - 0.5) * (sourceRadius + targetRadius), (rand01() - 0.5) * (sourceRadius + targetRadius)); - continue; - } - - Vector2f normalizedDelta = delta / distance; - float distanceDelta = distance - sourceRadius - targetRadius - linkLength; - Vector2f sourceTargetPos = sourcePos + normalizedDelta * distanceDelta; - Vector2f targetSourcePos = targetPos - normalizedDelta * distanceDelta; - - - Vector2f sourceForce = (sourceTargetPos - sourcePos) * multiplier * (targetRadius / maxRadiiLinks[source]); - Vector2f targetForce = (targetSourcePos - targetPos) * multiplier * (sourceRadius / maxRadiiLinks[target]); - - forces[target] += targetForce / linkCounts[target]; - forces[source] += sourceForce / linkCounts[source]; - } - - std::srand(std::time(nullptr)); - - float settlnessAccumulator = 0.0f; - - int repelEnd = std::min(batchOffset + std::max((int)ceil(batchSize * (log(50.0f * settleness)/1.7f)), 1), totalNodes); - - bool foundHovered = false; - bool firstRun = true; - for (int i = batchOffset; i < repelEnd; i++) - { - nextBatchOffset = (i + 1) % totalNodes; - - Vector2f nodePosition = positions[i]; - float nodeR = radii[i]; - - Vector2f nodeForce = Vector2f::Zero(); - - for (int j = 0; j < totalNodes; j++) - { - if (firstRun) - { - // find hovered node - if (!foundHovered) - { - float dist = (positions[j] - mousePos).norm(); - if (dist < radii[j] / sqrt(cameraScale)) - { - hoveredNode = j; - foundHovered = true; - } - } - - // if (j < batchOffset || j > repelEnd) - // { - // positions[j] += forces[j] * dt * settleness; - // } - - massOffsetFromCenterAccumulator += positions[j]; - - // positions[j] -= massOffsetFromCenter.normalized() * dt; - } - - - if (i == j) continue; - - Vector2f otherPosition = positions[j]; - float otherR = radii[j]; - - Vector2f delta = nodePosition - otherPosition; - float distanceSqr = delta.squaredNorm(); - - if (distanceSqr <= 1) - { - positions[i] += Vector2f((rand01() - 0.5) * (nodeR + otherR), (rand01() - 0.5) * (nodeR + otherR)); - continue; - } - - float maxCube = maxRadius * maxRadius * maxRadius; - float otherCube = otherR * otherR * otherR; - float nodeCube = nodeR * nodeR * nodeR; - - float force = (gaussianPlatau(sqrt(distanceSqr), 2.0f * (nodeR + otherR), 0.01f) * (otherCube/maxCube) / (nodeCube/maxCube) + (nodeR/maxRadius)) / (distanceSqr) * repulsionForce; - // force += 0.001f/sqrt(distanceSqr); - - nodeForce += delta * force; - } - - firstRun = false; - - // center forces - float distance = nodePosition.norm(); - float force = distance * centralForce/1000 * (nodeR/maxRadius) * (nodeR/maxRadius); - nodeForce += -nodePosition * force; - - float batchFraction = batchFractionSize / 2; - - nodeForce = Vector2f - ( - (batchFraction) * nodeForce.x() + (1 - (batchFraction)) * forces[i].x(), - (batchFraction) * nodeForce.y() + (1 - (batchFraction)) * forces[i].y() - ) * settleness; - - if (nodeForce.norm() > maxRadiusSqr) - { - nodeForce = nodeForce / nodeForce.norm() * maxRadiusSqr; - } - - forces[i] = nodeForce * 0.9f; - - positions[i] += forces[i] * dt; - - if(grabbedNode == i) - { - positions[grabbedNode] = mousePos; - } - - - settlnessAccumulator += ((connectedDeltas[i] - lastConnectedDeltas[i]).norm() + (connectedDeltas[i].normalized() - lastConnectedDeltas[i].normalized()).norm()) / 2; - } - - batchOffset = nextBatchOffset; - - settleness = settleness * 0.95f + std::min(settlnessAccumulator/totalNodes, 5.0f) * 0.01f; - - - massOffsetFromCenter = massOffsetFromCenterAccumulator / totalNodes; - - if(grabbedNode != -1) - { - positions[grabbedNode] = mousePos; - return grabbedNode; - } - - return foundHovered ? hoveredNode : -1; -} - -EMSCRIPTEN_KEEPALIVE -void SetPosition(int index, float x, float y) -{ - positions[index] = Vector2f(x, y); -} - - - -void AbstractedUpdate() -{ - std::vector abstractedGrid = table.getAbstractedGrid(GridspacePositionCalculationMethod::WEIGHTED_AVERAGE, radii); - - for (int i = 0; i < totalNodes; i++) - { - Vector2f nodePosition = positions[i]; - float nodeRadius = radii[i]; - - for (int j = 0; j < abstractedGrid.size(); j++) - { - Vector2f gridSpacePosition = abstractedGrid[j].position; - float spaceStrength = abstractedGrid[j].weightsSum; - Vector2f delta = gridSpacePosition - nodePosition; - - float distSqr = delta.dot(delta); - if (distSqr <= 0.00001) - { - positions[i] += Vector2f(1, 0); - continue; - } - - float dist = sqrt(distSqr); - Vector2f normalizedDelta = delta / dist; - Vector2f force = normalizedDelta * repulsionForce * dt * spaceStrength; - - positions[i] -= force; - } - - Vector2f centralForceVector = -nodePosition.normalized() * centralForce; - positions[i] += centralForceVector * dt * settleness; - } -} - -EMSCRIPTEN_KEEPALIVE -void FreeMemory() -{ - delete[] forces; - delete[] linkCounts; - delete[] maxRadiiLinks; - delete[] connectedDeltas; - delete[] lastConnectedDeltas; -} - -} \ No newline at end of file diff --git a/.obsidian/plugins/obsidian-webpage-export-master/scripts/graph-view-cpp/SpatialHashTable.h b/.obsidian/plugins/obsidian-webpage-export-master/scripts/graph-view-cpp/SpatialHashTable.h deleted file mode 100644 index c9ee1479..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/scripts/graph-view-cpp/SpatialHashTable.h +++ /dev/null @@ -1,214 +0,0 @@ -#include -#include -#include -#include - -struct AbstractedGridspace { - Eigen::Vector2f position; - int numObjects; - int weightsSum; -}; - -enum class GridspacePositionCalculationMethod -{ - AVERAGE, - WEIGHTED_AVERAGE, - CENTER -}; - - -class SpatialHashingTable { -public: - SpatialHashingTable(float cellSize) : cellSize_(cellSize) {} - - std::vector getNearbyObjects(const Eigen::Vector2f& position, float radius) const - { - // Compute the set of cells that overlap with the circle defined by the radius and position - std::unordered_set cells = findCells(position, radius); - - // Collect all objects that belong to any of the overlapping cells - std::unordered_set nearbyObjects; - for (int cell : cells) { - std::unordered_set objectsInCell = objects_.find(cell)->second; - nearbyObjects.insert(objectsInCell.begin(), objectsInCell.end()); - } - - return std::vector(nearbyObjects.begin(), nearbyObjects.end()); - } - - std::vector getAbstractedGrid(GridspacePositionCalculationMethod calcMethod, float* weights = nullptr) - { - std::vector grid; - - for (const auto& [cell, objects] : objects_) - { - Eigen::Vector2f center = computeCellCenter(cell, calcMethod, weights); - int numObjects = static_cast(objects.size()); - int weightsSum = 0; - - for (int object : objects) { - weightsSum += weights[object]; - } - - grid.push_back({center, numObjects, weightsSum}); - } - - return grid; - } - - std::vector getFarAbstractedGrid(const Eigen::Vector2f& position, float radius, GridspacePositionCalculationMethod calcMethod) - { - std::vector farGrid; - - for (const auto& [cell, objects] : objects_) { - Eigen::Vector2f center = computeCellCenter(cell, calcMethod); - - // Check if the cell is outside the radius from the position - if ((center - position).norm() > radius) { - int numObjects = static_cast(objects.size()); - farGrid.push_back({center, numObjects}); - } - } - - return farGrid; - } - - std::vector getObjectsInCell(const Eigen::Vector2f& position) const - { - int cell = findCell(position); - - std::unordered_set nearbyObjects; - std::unordered_set objectsInCell = objects_.find(cell)->second; - nearbyObjects.insert(objectsInCell.begin(), objectsInCell.end()); - - return std::vector(nearbyObjects.begin(), nearbyObjects.end()); - } - - void update(Eigen::Vector2f* positions, int numPositions) - { - clear(); - - for (int i = 0; i < numPositions; ++i) - { - add(i, positions[i]); - } - - positions_ = positions; - } - - void clear() - { - objects_.clear(); - occupiedCells_.clear(); - } - - float getCellSize() const - { - return cellSize_; - } - - -private: - std::unordered_map> objects_; // maps cell IDs to sets of object indices - std::unordered_map> occupiedCells_; // maps object indices to sets of cell IDs - Eigen::Vector2f* positions_; - int numPositions_; - float cellSize_; - - std::unordered_set findCells(const Eigen::Vector2f& position, float radius = 0.0f) const - { - // Compute the range of cells that overlap with the circle defined by the radius and position - float cellRadius = radius + cellSize_ / 2; - int left = static_cast(std::floor((position.x() - cellRadius) / cellSize_)); - int right = static_cast(std::floor((position.x() + cellRadius) / cellSize_)); - int top = static_cast(std::floor((position.y() - cellRadius) / cellSize_)); - int bottom = static_cast(std::floor((position.y() + cellRadius) / cellSize_)); - - // Add all cells within the range to the set of occupied cells - std::unordered_set cells; - for (int x = left; x <= right; ++x) { - for (int y = top; y <= bottom; ++y) { - int cell = x + y * (1 << 16); // combine x and y into a single integer key - cells.insert(cell); - } - } - - return cells; - } - - int findCell(const Eigen::Vector2f& position) const - { - int x = static_cast(std::floor(position.x() / cellSize_)); - int y = static_cast(std::floor(position.y() / cellSize_)); - return x + y * (1 << 16); // combine x and y into a single integer key - } - - Eigen::Vector2f computeCellCenter(int cell, GridspacePositionCalculationMethod calcMethod, float* weights = nullptr) const - { - if(calcMethod == GridspacePositionCalculationMethod::AVERAGE) - { - // Compute the average position of all objects in the cell - - Eigen::Vector2f center(0.0f, 0.0f); - - std::unordered_set objects = objects_.find(cell)->second; - - for (int objectIndex : objects) - { - center += positions_[objectIndex]; - } - - return center / static_cast(objects.size()); - } - else if(calcMethod == GridspacePositionCalculationMethod::WEIGHTED_AVERAGE) - { - // Compute the weighted average position of all objects in the cell - - Eigen::Vector2f center(0.0f, 0.0f); - float weightsSum = 0.0f; - - for (int objectIndex : objects_.find(cell)->second) - { - center += positions_[objectIndex] * weights[objectIndex]; - weightsSum += weights[objectIndex]; - } - - return center / weightsSum; - } - else if(calcMethod == GridspacePositionCalculationMethod::CENTER) - { - // Compute the center position of the cell given its unique ID - - int x = cell & 0xFFFF; - int y = (cell >> 16) & 0xFFFF; - return Eigen::Vector2f((x + 0.5f) * cellSize_, (y + 0.5f) * cellSize_); - } - - return Eigen::Vector2f(0.0f, 0.0f); - } - - void add(int objectIndex, const Eigen::Vector2f& position) - { - // Compute the set of cells that the object occupies - std::unordered_set cells = findCells(position); - - // Add the object index to the set of objects for each occupied cell - for (int cell : cells) { - objects_[cell].insert(objectIndex); - } - - // Store the set of cells that the object occupies - occupiedCells_[objectIndex] = std::move(cells); - } - - void remove(int objectIndex) - { - // Remove the object index from the set of objects for each occupied cell - for (int cell : occupiedCells_[objectIndex]) { - objects_[cell].erase(objectIndex); - } - - // Remove the object's occupied cells from the map - occupiedCells_.erase(objectIndex); - } -}; diff --git a/.obsidian/plugins/obsidian-webpage-export-master/scripts/html-generation/asset-handler.ts b/.obsidian/plugins/obsidian-webpage-export-master/scripts/html-generation/asset-handler.ts deleted file mode 100644 index 8b71a563..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/scripts/html-generation/asset-handler.ts +++ /dev/null @@ -1,357 +0,0 @@ -import graphViewJS from "assets/graph-view.txt.js"; -import graphWASMJS from "assets/graph-wasm.txt.js"; -import renderWorkerJS from "assets/graph-render-worker.txt.js"; -import graphWASM from "assets/graph-wasm.wasm"; -import websiteJS from "assets/website.txt.js"; -import webpageStyles from "assets/plugin-styles.txt.css"; -import deferredJS from "assets/deferred.txt.js"; -import deferredCSS from "assets/deferred.txt.css"; -import themeLoadJS from "assets/theme-load.txt.js"; - -import tinyColorJS from "assets/tinycolor.txt.js"; -import pixiJS from "assets/pixi.txt.js"; -import minisearchJS from "assets/minisearch.txt.js"; - -import { Path } from "scripts/utils/path.js"; -import { Asset, AssetType, InlinePolicy, LoadMethod, Mutability } from "./assets/asset.js"; -import { ObsidianStyles } from "./assets/obsidian-styles.js"; -import { OtherPluginStyles } from "./assets/other-plugin-styles.js"; -import { ThemeStyles } from "./assets/theme-styles.js"; -import { SnippetStyles } from "./assets/snippet-styles.js"; -import { MathjaxStyles } from "./assets/mathjax-styles.js"; -import { CustomHeadContent } from "./assets/custom-head-content.js"; -import { Settings, SettingsPage } from "scripts/settings/settings.js"; -import { GlobalVariableStyles } from "./assets/global-variable-styles.js"; -import { Favicon } from "./assets/favicon.js"; -import { FetchBuffer } from "./assets/local-fetch-buffer.js"; -import { ExportLog } from "./render-log.js"; -import { SupportedPluginStyles } from "./assets/supported-plugin-styles.js"; -import { fileTypeFromBuffer } from "file-type"; -import { MarkdownWebpageRendererAPIOptions } from "scripts/api-options.js"; -const mime = require('mime'); - - -export class AssetHandler -{ - public static vaultPluginsPath: Path; - - public static staticAssets: Asset[] = []; - public static dynamicAssets: Asset[] = []; - public static allAssets: Asset[] = []; - public static temporaryAssets: Asset[] = []; - - // this path is used to generate the relative path to the images folder, likewise for the other paths - private static libraryFolder: Path; - private static mediaFolder: Path; - private static jsFolder: Path; - private static cssFolder: Path; - private static fontFolder: Path; - private static htmlFolder: Path; - - public static exportOptions: MarkdownWebpageRendererAPIOptions = new MarkdownWebpageRendererAPIOptions(); - - public static get libraryPath(): Path - { - if (!this.libraryFolder) this.initialize(); - return AssetHandler.libraryFolder.copy.makeWebStyle(this.exportOptions.webStylePaths); - } - public static get mediaPath(): Path - { - if (!this.mediaFolder) this.initialize(); - return AssetHandler.mediaFolder.copy.makeWebStyle(this.exportOptions.webStylePaths); - } - public static get jsPath(): Path - { - if (!this.jsFolder) this.initialize(); - return AssetHandler.jsFolder.copy.makeWebStyle(this.exportOptions.webStylePaths); - } - public static get cssPath(): Path - { - if (!this.cssFolder) this.initialize(); - return AssetHandler.cssFolder.copy.makeWebStyle(this.exportOptions.webStylePaths); - } - public static get fontPath(): Path - { - if (!this.fontFolder) this.initialize(); - return AssetHandler.fontFolder.copy.makeWebStyle(this.exportOptions.webStylePaths); - } - public static get htmlPath(): Path - { - if (!this.htmlFolder) this.initialize(); - return AssetHandler.htmlFolder.copy.makeWebStyle(this.exportOptions.webStylePaths); - } - - // styles - public static obsidianStyles: ObsidianStyles = new ObsidianStyles(); - public static otherPluginStyles: OtherPluginStyles = new OtherPluginStyles(); - public static themeStyles: ThemeStyles = new ThemeStyles(); - public static snippetStyles: SnippetStyles = new SnippetStyles(); - public static mathjaxStyles: MathjaxStyles = new MathjaxStyles(); - public static globalDataStyles: GlobalVariableStyles = new GlobalVariableStyles(); - public static supportedPluginStyles: SupportedPluginStyles = new SupportedPluginStyles(); - public static websiteStyles: Asset = new Asset("main-styles.css", webpageStyles, AssetType.Style, InlinePolicy.AutoHead, true, Mutability.Static, LoadMethod.Async, 4); - public static deferredCSS: Asset = new Asset("deferred.css", deferredCSS, AssetType.Style, InlinePolicy.InlineHead, true, Mutability.Static, LoadMethod.Defer); - - // scripts - public static websiteJS: Asset = new Asset("webpage.js", websiteJS, AssetType.Script, InlinePolicy.AutoHead, true, Mutability.Static, LoadMethod.Async); - public static graphViewJS: Asset = new Asset("graph-view.js", graphViewJS, AssetType.Script, InlinePolicy.AutoHead, true, Mutability.Static); - public static graphWASMJS: Asset = new Asset("graph-wasm.js", graphWASMJS, AssetType.Script, InlinePolicy.AutoHead, true, Mutability.Static); - public static graphWASM: Asset = new Asset("graph-wasm.wasm", Buffer.from(graphWASM), AssetType.Script, InlinePolicy.Download, false, Mutability.Static); - public static renderWorkerJS: Asset = new Asset("graph-render-worker.js", renderWorkerJS, AssetType.Script, InlinePolicy.AutoHead, true, Mutability.Static); - public static deferredJS: Asset = new Asset("deferred.js", deferredJS, AssetType.Script, InlinePolicy.InlineHead, true, Mutability.Static, LoadMethod.Defer); - public static themeLoadJS: Asset = new Asset("theme-load.js", themeLoadJS, AssetType.Script, InlinePolicy.Inline, true, Mutability.Static, LoadMethod.Defer); - - public static tinyColorJS: Asset = new Asset("tinycolor.js", tinyColorJS, AssetType.Script, InlinePolicy.AutoHead, true, Mutability.Static); - public static pixiJS: Asset = new Asset("pixi.js", pixiJS, AssetType.Script, InlinePolicy.AutoHead, true, Mutability.Static, LoadMethod.Async, 100, "https://cdnjs.cloudflare.com/ajax/libs/pixi.js/7.4.0/pixi.min.js"); - public static minisearchJS: Asset = new Asset("minisearch.js", minisearchJS, AssetType.Script, InlinePolicy.AutoHead, true, Mutability.Static, LoadMethod.Async, 100, "https://cdn.jsdelivr.net/npm/minisearch@6.3.0/dist/umd/index.min.js"); - - // other - public static favicon: Favicon = new Favicon(); - public static externalLinkIcon: Asset; - public static customHeadContent: CustomHeadContent = new CustomHeadContent(); - public static mainJsModTime: number = 0; - - public static async initialize() - { - this.libraryFolder = new Path("lib").makeUnixStyle(); - this.mediaFolder = this.libraryFolder.joinString("media").makeUnixStyle(); - this.jsFolder = this.libraryFolder.joinString("scripts").makeUnixStyle(); - this.cssFolder = this.libraryFolder.joinString("styles").makeUnixStyle(); - this.fontFolder = this.libraryFolder.joinString("fonts").makeUnixStyle(); - this.htmlFolder = this.libraryFolder.joinString("html").makeUnixStyle(); - this.vaultPluginsPath = Path.vaultPath.joinString(app.vault.configDir, "plugins/").makeAbsolute(); - - // by default all static assets have a modified time the same as main.js - this.mainJsModTime = this.vaultPluginsPath.joinString("webpage-html-export/main.js").stat?.mtimeMs ?? 0; - this.staticAssets.forEach(asset => asset.modifiedTime = this.mainJsModTime); - - this.allAssets.sort((a, b) => a.loadPriority - b.loadPriority); - - let loadPromises = [] - for (let asset of this.allAssets) - { - loadPromises.push(asset.load(this.exportOptions)); - } - await Promise.all(loadPromises); - - let graphViewJSPath = this.graphViewJS.getAssetPath(); - this.graphViewJS.getHTML = () => ``; - } - - public static async reloadAssets() - { - // remove all temporary assets from allAssets - this.allAssets = this.allAssets.filter(asset => asset.mutability != Mutability.Temporary); - this.temporaryAssets = []; - - let i = 0; - - let loadPromises = [] - for (let asset of this.dynamicAssets) - { - let loadPromise = asset.load(this.exportOptions); - loadPromise.then(() => - { - i++; - ExportLog.progress(i, this.dynamicAssets.length, "Initialize Export", "Loading asset: " + asset.filename, "var(--color-yellow)"); - }); - loadPromises.push(loadPromise); - } - await Promise.all(loadPromises); - } - - public static getAssetsOfType(type: AssetType): Asset[] - { - let assets = this.allAssets.filter(asset => asset.type == type); - assets = assets.concat(this.allAssets.map(asset => asset.childAssets).flat().filter(asset => asset.type == type)); - return assets; - } - - public static getAssetsOfInlinePolicy(inlinePolicy: InlinePolicy): Asset[] - { - let assets = this.allAssets.filter(asset => asset.inlinePolicy == inlinePolicy); - assets = assets.concat(this.allAssets.map(asset => asset.childAssets).flat().filter(asset => asset.inlinePolicy == inlinePolicy)); - return assets; - } - - private static filterDownloads(downloads: Asset[], options: MarkdownWebpageRendererAPIOptions): Asset[] - { - if (!options.addGraphView || !options.addSidebars) - { - downloads = downloads.filter(asset => ![this.graphViewJS, this.graphWASMJS, this.graphWASM, this.renderWorkerJS, this.tinyColorJS, this.pixiJS].includes(asset)); - } - - if (!options.addSearch || !options.addSidebars) - { - downloads = downloads.filter(asset => ![this.minisearchJS].includes(asset)); - } - - if (!options.includeCSS) - { - downloads = downloads.filter(asset => asset.type != AssetType.Style); - } - - if (!options.includeJS) - { - downloads = downloads.filter(asset => asset.type != AssetType.Script); - } - - // remove duplicates - downloads = downloads.filter((asset, index, self) => self.findIndex((t) => t.relativePath.asString == asset.relativePath.asString) === index); - - // remove assets with no content - downloads = downloads.filter(asset => asset.content && asset.content.length > 0); - - return downloads; - } - - public static getDownloads(options: MarkdownWebpageRendererAPIOptions): Asset[] - { - let downloads = this.getAssetsOfInlinePolicy(InlinePolicy.Download) - .concat(this.getAssetsOfInlinePolicy(InlinePolicy.DownloadHead)); - - if (!options.inlineMedia) - { - downloads = downloads.concat(this.getAssetsOfInlinePolicy(InlinePolicy.Auto)); - downloads = downloads.concat(this.getAssetsOfInlinePolicy(InlinePolicy.AutoHead)); - } - - downloads = this.filterDownloads(downloads, options); - downloads.sort((a, b) => b.loadPriority - a.loadPriority); - - return downloads; - } - - public static getHeadReferences(options: MarkdownWebpageRendererAPIOptions): string - { - let head = ""; - - let referenceAssets = this.getAssetsOfInlinePolicy(InlinePolicy.DownloadHead) - .concat(this.getAssetsOfInlinePolicy(InlinePolicy.AutoHead)) - .concat(this.getAssetsOfInlinePolicy(InlinePolicy.InlineHead)); - - referenceAssets = this.filterDownloads(referenceAssets, options); - referenceAssets.sort((a, b) => b.loadPriority - a.loadPriority); - - for (let asset of referenceAssets) - { - head += asset.getHTML(options); - } - - return head; - } - - /*Takes a style sheet string and creates assets from every font or image url embedded in it*/ - public static async getStyleChildAssets(asset: Asset, makeBase64External: boolean = false): Promise - { - if (typeof asset.content != "string") throw new Error("Asset content is not a string"); - - let content = asset.content.replaceAll("app://obsidian.md/", ""); - - let urls = Array.from(content.matchAll(/url\("([^"]+)"\)|url\('([^']+)'\)/g)); - - // remove duplicates - urls = urls.filter((url, index, self) => self.findIndex((t) => t[0] === url[0]) === index); - - // use this mutability for child assets - let promises = []; - for (let urlObj of urls) - { - let url = urlObj[1] || urlObj[2]; - url = url.trim(); - - // we don't need to download online assets if we are not making the page offline compatible - if (!this.exportOptions.offlineResources && url.startsWith("http")) continue; - - if (url == "") continue; - - if (url.startsWith("data:")) - { - if (!this.exportOptions.inlineMedia && makeBase64External) - { - // decode the base64 data and create an Asset from it - // then replace the url with the relative path to the asset - - function hash(str:string, seed = 0) // taken from https://stackoverflow.com/questions/7616461/generate-a-hash-from-string-in-javascript - { - let h1 = 0xdeadbeef ^ seed, h2 = 0x41c6ce57 ^ seed; - for(let i = 0, ch; i < str.length; i++) { - ch = str.charCodeAt(i); - h1 = Math.imul(h1 ^ ch, 2654435761); - h2 = Math.imul(h2 ^ ch, 1597334677); - } - h1 = Math.imul(h1 ^ (h1 >>> 16), 2246822507); - h1 ^= Math.imul(h2 ^ (h2 >>> 13), 3266489909); - h2 = Math.imul(h2 ^ (h2 >>> 16), 2246822507); - h2 ^= Math.imul(h1 ^ (h1 >>> 13), 3266489909); - - return 4294967296 * (2097151 & h2) + (h1 >>> 0); - } - - let splitData = url.split(",") - let data = splitData.slice(1).join(","); - let extension = Asset.mimeToExtention(splitData[0].split(":")[1].split(";")[0]); - let buffer = Buffer.from(data, "base64"); - let dataHash = hash(data); - let filename = `${dataHash}.${extension}`; - if (extension == '') - { - let type = await fileTypeFromBuffer(buffer); - if (type) extension = type.ext; - filename = `${dataHash}.${extension}`; - } - let type = Asset.extentionToType(extension); - - let childAsset = new Asset(filename, buffer, type, InlinePolicy.Download, false, Mutability.Child); - asset.childAssets.push(childAsset); - let loadPromise = childAsset.load(this.exportOptions); - promises.push(loadPromise); - loadPromise.then(() => - { - if (childAsset.content == undefined || childAsset.content == null || childAsset.content.length == 0) - { - return; - } - - let newPath = childAsset.getAssetPath(asset.getAssetPath()); - content = content.replaceAll(url, newPath.asString); - }); - } - continue; - } - - let path = new Path(url); - let type = Asset.extentionToType(path.extension); - let childAsset = new FetchBuffer(path.fullName, url, type, InlinePolicy.Download, false, Mutability.Child); - asset.childAssets.push(childAsset); - - let loadPromise = childAsset.load(this.exportOptions); - promises.push(loadPromise); - loadPromise.then(() => - { - if (childAsset.content == undefined || childAsset.content == null || childAsset.content.length == 0) - { - return; - } - - if (this.exportOptions.inlineMedia) - { - let base64 = childAsset.content.toString("base64"); - content = content.replaceAll(url, `data:${mime.getType(url)};base64,${base64}`); - } - else - { - childAsset.relativeDirectory.makeWebStyle(this.exportOptions.webStylePaths); - if (this.exportOptions.webStylePaths) childAsset.filename = Path.toWebStyle(childAsset.filename); - - let newPath = childAsset.getAssetPath(asset.getAssetPath()); - content = content.replaceAll(url, newPath.asString); - } - }); - } - - await Promise.all(promises); - - return content; - } -} diff --git a/.obsidian/plugins/obsidian-webpage-export-master/scripts/html-generation/assets/asset.ts b/.obsidian/plugins/obsidian-webpage-export-master/scripts/html-generation/assets/asset.ts deleted file mode 100644 index 8faf7207..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/scripts/html-generation/assets/asset.ts +++ /dev/null @@ -1,320 +0,0 @@ -import { Path } from "scripts/utils/path"; -import { Downloadable } from "scripts/utils/downloadable"; -import { ExportLog } from "../render-log"; -import { Settings, SettingsPage } from "scripts/settings/settings"; -import { AssetHandler } from "../asset-handler"; -import { MarkdownWebpageRendererAPIOptions } from "scripts/api-options"; -const { minify: runMinify } = require('html-minifier-terser'); -const mime = require('mime'); - -export enum AssetType -{ - Style = "style", // css - Script = "script", // js - Media = "media", // images, videos, audio, etc - HTML = "html", // reusable html - Font = "font", // fonts - Other = "other" // anything else -} - -export enum InlinePolicy -{ - AutoHead = "autohead", // Fine for js, css, html, and fonts. Include data itself or reference to downloaded data into head. - Auto = "auto", // Does not auto insert anywhere, but chooses format on whether assets are being inlined. (will download if not inlined) - Inline = "inline", // Does not auto insert anywhere, but is always inline format - Download = "download", // Just download, does not auto insert anywhere - DownloadHead = "downloadhead", // Download and include ref in head - InlineHead = "inlinehead", // Inline raw data into head - None = "none" // Do nothing with this asset -} - -export enum Mutability -{ - Static = "static", // this asset never changes - Dynamic = "dynamic", // this asset can change - Temporary = "temporary", // this asset is created only for the current export and is deleted afterwards - Child = "child", // this asset will only change when the parent changes -} - -export enum LoadMethod -{ - Default = "", - Async = "async", - Defer = "defer" -} - -export class Asset extends Downloadable -{ - public type: AssetType; // what type of asset is this - public inlinePolicy: InlinePolicy; // should this asset be inlined into the html file - public mutability: Mutability; // can this asset change - public minify: boolean; // should the asset be minified - public loadMethod: LoadMethod = LoadMethod.Default; // should this asset be loaded asynchronously if possible - public loadPriority: number = 100; // the priority of this asset when loading - public onlineURL: string | undefined = undefined; // the link to the asset online - public childAssets: Asset[] = []; // assets that depend on this asset - public exportOptions: MarkdownWebpageRendererAPIOptions; - - constructor(filename: string, content: string | Buffer, type: AssetType, inlinePolicy: InlinePolicy, minify: boolean, mutability: Mutability, loadMethod: LoadMethod = LoadMethod.Async, loadPriority: number = 100, cdnPath: string | undefined = undefined, options: MarkdownWebpageRendererAPIOptions = new MarkdownWebpageRendererAPIOptions()) - { - if(options.webStylePaths) filename = Path.toWebStyle(filename); - super(filename, content, Asset.typeToPath(type)); - this.exportOptions = options; - this.type = type; - this.inlinePolicy = inlinePolicy; - this.mutability = mutability; - this.minify = minify; - this.loadMethod = loadMethod; - this.loadPriority = loadPriority; - this.onlineURL = cdnPath; - this.modifiedTime = Date.now(); - - switch(mutability) - { - case Mutability.Static: - AssetHandler.staticAssets.push(this); - this.modifiedTime = AssetHandler.mainJsModTime; // by default all static assets have a modified time the same as main.js - break; - case Mutability.Dynamic: - AssetHandler.dynamicAssets.push(this); - break; - case Mutability.Temporary: - AssetHandler.temporaryAssets.push(this); - break; - } - - if (mutability != Mutability.Child) AssetHandler.allAssets.push(this); - } - - public async load(options: MarkdownWebpageRendererAPIOptions): Promise - { - this.exportOptions = options; - - if (this.type == AssetType.Style && typeof this.content == "string") - { - this.childAssets = []; - this.content = await AssetHandler.getStyleChildAssets(this, false); - } - - if (this.minify) - { - this.minifyAsset(); - } - } - - override async download(downloadDirectory: Path): Promise - { - if (this.isInlineFormat(this.exportOptions)) return; - await super.download(downloadDirectory); - } - - public static typeToPath(type: AssetType): Path - { - switch(type) - { - case AssetType.Style: - return AssetHandler.cssPath; - case AssetType.Script: - return AssetHandler.jsPath; - case AssetType.Media: - return AssetHandler.mediaPath; - case AssetType.HTML: - return AssetHandler.htmlPath; - case AssetType.Font: - return AssetHandler.fontPath; - case AssetType.Other: - return AssetHandler.libraryPath; - } - } - - public static extentionToType(extention: string): AssetType - { - const mediaTypes = ["png", "jpg", "jpeg", "gif", "svg", "webp", "ico", "mp4", "webm", "ogg", "mp3", "wav", "flac", "aac", "m4a", "opus"]; - const scriptTypes = ["js", "ts"]; - const styleTypes = ["css", "scss", "sass", "less"]; - const htmlTypes = ["html", "htm"]; - const fontTypes = ["ttf", "woff", "woff2", "eot", "otf"]; - - extention = extention.toLowerCase().replace(".", ""); - - if (mediaTypes.includes(extention)) return AssetType.Media; - if (scriptTypes.includes(extention)) return AssetType.Script; - if (styleTypes.includes(extention)) return AssetType.Style; - if (htmlTypes.includes(extention)) return AssetType.HTML; - if (fontTypes.includes(extention)) return AssetType.Font; - return AssetType.Other; - } - - /**Minify the contents of a JS or CSS string (No HTML)*/ - async minifyAsset() - { - if (this.type == AssetType.HTML || typeof this.content != "string") return; - let isJS = this.type == AssetType.Script; - let isCSS = this.type == AssetType.Style; - - let tempContent = this.content; - - try - { - // add script or style tags so that minifier can minify it as html - if (isJS) tempContent = ``; - if (isCSS) tempContent = ``; - - tempContent = await runMinify(tempContent, { minifyCSS: isCSS, minifyJS: isJS, removeComments: true, collapseWhitespace: true}); - - // remove the ", "").replace("", ""); - this.content = tempContent; - } - catch (e) - { - ExportLog.warning("Unable to minify " + (isJS ? "JS" : "CSS") + " file."); - - // remove whitespace manually - this.content = this.content.replace(/[\n\r]+/g, ""); - } - } - - public getAssetPath(relativeFrom: Path | undefined = undefined): Path - { - if (this.isInlineFormat(this.exportOptions)) return new Path(""); - - if (relativeFrom == undefined) relativeFrom = Path.rootPath; - let toRoot = Path.getRelativePath(relativeFrom, Path.rootPath); - let newPath = toRoot.join(this.relativePath).makeUnixStyle(); - newPath.makeWebStyle(this.exportOptions.webStylePaths); - - return newPath; - } - - protected isInlineFormat(options: MarkdownWebpageRendererAPIOptions): boolean - { - let isInlineFormat = this.inlinePolicy == InlinePolicy.Inline || - this.inlinePolicy == InlinePolicy.InlineHead || - ((this.inlinePolicy == InlinePolicy.Auto || this.inlinePolicy == InlinePolicy.AutoHead) && - ( - (options.inlineCSS! && this.type == AssetType.Style) || - (options.inlineJS! && this.type == AssetType.Script) || - (options.inlineMedia! && this.type == AssetType.Media) || - (options.inlineHTML! && this.type == AssetType.HTML) || - (options.inlineFonts! && this.type == AssetType.Font) - )); - - return isInlineFormat; - } - - protected isRefFormat(options: MarkdownWebpageRendererAPIOptions): boolean - { - let isRefFormat = this.inlinePolicy == InlinePolicy.Download || - this.inlinePolicy == InlinePolicy.DownloadHead || - ((this.inlinePolicy == InlinePolicy.Auto || this.inlinePolicy == InlinePolicy.AutoHead) && - !( - (options.inlineCSS! && this.type == AssetType.Style) || - (options.inlineJS! && this.type == AssetType.Script) || - (options.inlineMedia! && this.type == AssetType.Media) || - (options.inlineHTML! && this.type == AssetType.HTML) || - (options.inlineFonts! && this.type == AssetType.Font) - )); - return isRefFormat; - } - - public getHTML(options: MarkdownWebpageRendererAPIOptions): string - { - if(this.isInlineFormat(options)) - { - switch(this.type) - { - case AssetType.Style: - return ``; - case AssetType.Script: - return ``; - case AssetType.Media: - return `<${this.getHTMLTagName()} src="${this.getContentBase64()}"/>`; - case AssetType.HTML: - return this.content as string; - case AssetType.Font: - return ``; - default: - return ""; - } - } - - if (this.isRefFormat(options)) - { - let path = this.getAssetPath(undefined).asString; - if (options.offlineResources === false && this.onlineURL) path = this.onlineURL; - - let include = ""; - let attr = ""; - switch(this.type) - { - case AssetType.Style: - include = ``; - if (this.loadMethod == LoadMethod.Async) - { - include = `` - } - return include; - case AssetType.Script: - include = ``; - return include; - case AssetType.Media: - attr = this.loadMethod == LoadMethod.Defer ? "loading='eager'" : "loading='lazy'"; - if (this.loadMethod == LoadMethod.Default) attr = ""; - include = `<${this.getHTMLTagName()} src="${path}" ${attr} />`; - return include; - case AssetType.Font: - include = ``; - return include; - case AssetType.HTML: - return `` - default: - return ""; - } - } - - - return ""; - } - - public static mimeToExtention(mime: string): string - { - const FileMimeType: {[key: string]: string} = {'audio/x-mpeg': 'mpega', 'application/postscript': 'ps', 'audio/x-aiff': 'aiff', 'application/x-aim': 'aim', 'image/x-jg': 'art', 'video/x-ms-asf': 'asx', 'audio/basic': 'ulw', 'video/x-msvideo': 'avi', 'video/x-rad-screenplay': 'avx', 'application/x-bcpio': 'bcpio', 'application/octet-stream': 'exe', 'image/bmp': 'dib', 'text/html': 'html', 'application/x-cdf': 'cdf', 'application/pkix-cert': 'cer', 'application/java': 'class', 'application/x-cpio': 'cpio', 'application/x-csh': 'csh', 'text/css': 'css', 'application/msword': 'doc', 'application/xml-dtd': 'dtd', 'video/x-dv': 'dv', 'application/x-dvi': 'dvi', 'application/vnd.ms-fontobject': 'eot', 'text/x-setext': 'etx', 'image/gif': 'gif', 'application/x-gtar': 'gtar', 'application/x-gzip': 'gz', 'application/x-hdf': 'hdf', 'application/mac-binhex40': 'hqx', 'text/x-component': 'htc', 'image/ief': 'ief', 'text/vnd.sun.j2me.app-descriptor': 'jad', 'application/java-archive': 'jar', 'text/x-java-source': 'java', 'application/x-java-jnlp-file': 'jnlp', 'image/jpeg': 'jpg', 'application/javascript': 'js', 'text/plain': 'txt', 'application/json': 'json', 'audio/midi': 'midi', 'application/x-latex': 'latex', 'audio/x-mpegurl': 'm3u', 'image/x-macpaint': 'pnt', 'text/troff': 'tr', 'application/mathml+xml': 'mathml', 'application/x-mif': 'mif', 'video/quicktime': 'qt', 'video/x-sgi-movie': 'movie', 'audio/mpeg': 'mpa', 'video/mp4': 'mp4', 'video/mpeg': 'mpg', 'video/mpeg2': 'mpv2', 'application/x-wais-source': 'src', 'application/x-netcdf': 'nc', 'application/oda': 'oda', 'application/vnd.oasis.opendocument.database': 'odb', 'application/vnd.oasis.opendocument.chart': 'odc', 'application/vnd.oasis.opendocument.formula': 'odf', 'application/vnd.oasis.opendocument.graphics': 'odg', 'application/vnd.oasis.opendocument.image': 'odi', 'application/vnd.oasis.opendocument.text-master': 'odm', 'application/vnd.oasis.opendocument.presentation': 'odp', 'application/vnd.oasis.opendocument.spreadsheet': 'ods', 'application/vnd.oasis.opendocument.text': 'odt', 'application/vnd.oasis.opendocument.graphics-template': 'otg', 'application/vnd.oasis.opendocument.text-web': 'oth', 'application/vnd.oasis.opendocument.presentation-template': 'otp', 'application/vnd.oasis.opendocument.spreadsheet-template': 'ots', 'application/vnd.oasis.opendocument.text-template': 'ott', 'application/ogg': 'ogx', 'video/ogg': 'ogv', 'audio/ogg': 'spx', 'application/x-font-opentype': 'otf', 'audio/flac': 'flac', 'application/annodex': 'anx', 'audio/annodex': 'axa', 'video/annodex': 'axv', 'application/xspf+xml': 'xspf', 'image/x-portable-bitmap': 'pbm', 'image/pict': 'pict', 'application/pdf': 'pdf', 'image/x-portable-graymap': 'pgm', 'audio/x-scpls': 'pls', 'image/png': 'png', 'image/x-portable-anymap': 'pnm', 'image/x-portable-pixmap': 'ppm', 'application/vnd.ms-powerpoint': 'pps', 'image/vnd.adobe.photoshop': 'psd', 'image/x-quicktime': 'qtif', 'image/x-cmu-raster': 'ras', 'application/rdf+xml': 'rdf', 'image/x-rgb': 'rgb', 'application/vnd.rn-realmedia': 'rm', 'application/rtf': 'rtf', 'text/richtext': 'rtx', 'application/font-sfnt': 'sfnt', 'application/x-sh': 'sh', 'application/x-shar': 'shar', 'application/x-stuffit': 'sit', 'application/x-sv4cpio': 'sv4cpio', 'application/x-sv4crc': 'sv4crc', 'image/svg+xml': 'svg', 'application/x-shockwave-flash': 'swf', 'application/x-tar': 'tar', 'application/x-tcl': 'tcl', 'application/x-tex': 'tex', 'application/x-texinfo': 'texinfo', 'image/tiff': 'tiff', 'text/tab-separated-values': 'tsv', 'application/x-font-ttf': 'ttf', 'application/x-ustar': 'ustar', 'application/voicexml+xml': 'vxml', 'image/x-xbitmap': 'xbm', 'application/xhtml+xml': 'xhtml', 'application/vnd.ms-excel': 'xls', 'application/xml': 'xsl', 'image/x-xpixmap': 'xpm', 'application/xslt+xml': 'xslt', 'application/vnd.mozilla.xul+xml': 'xul', 'image/x-xwindowdump': 'xwd', 'application/vnd.visio': 'vsd', 'audio/x-wav': 'wav', 'image/vnd.wap.wbmp': 'wbmp', 'text/vnd.wap.wml': 'wml', 'application/vnd.wap.wmlc': 'wmlc', 'text/vnd.wap.wmlsc': 'wmls', 'application/vnd.wap.wmlscriptc': 'wmlscriptc', 'video/x-ms-wmv': 'wmv', 'application/font-woff': 'woff', 'application/font-woff2': 'woff2', 'model/vrml': 'wrl', 'application/wspolicy+xml': 'wspolicy', 'application/x-compress': 'z', 'application/zip': 'zip'}; - return FileMimeType[mime] || mime.split("/")[1] || "txt"; - } - - public static extentionToMime(extention: string): string - { - if (extention.startsWith(".")) extention = extention.slice(1); - const FileMimeType: {[key: string]: string} = {'mpega': 'audio/x-mpeg', 'ps': 'application/postscript', 'aiff': 'audio/x-aiff', 'aim': 'application/x-aim', 'art': 'image/x-jg', 'asx': 'video/x-ms-asf', 'ulw': 'audio/basic', 'avi': 'video/x-msvideo', 'avx': 'video/x-rad-screenplay', 'bcpio': 'application/x-bcpio', 'exe': 'application/octet-stream', 'dib': 'image/bmp', 'html': 'text/html', 'cdf': 'application/x-cdf', 'cer': 'application/pkix-cert', 'class': 'application/java', 'cpio': 'application/x-cpio', 'csh': 'application/x-csh', 'css': 'text/css', 'doc': 'application/msword', 'dtd': 'application/xml-dtd', 'dv': 'video/x-dv', 'dvi': 'application/x-dvi', 'eot': 'application/vnd.ms-fontobject', 'etx': 'text/x-setext', 'gif': 'image/gif', 'gtar': 'application/x-gtar', 'gz': 'application/x-gzip', 'hdf': 'application/x-hdf', 'hqx': 'application/mac-binhex40', 'htc': 'text/x-component', 'ief': 'image/ief', 'jad': 'text/vnd.sun.j2me.app-descriptor', 'jar': 'application/java-archive', 'java': 'text/x-java-source', 'jnlp': 'application/x-java-jnlp-file', 'jpg': 'image/jpeg', 'js': 'application/javascript', 'txt': 'text/plain', 'json': 'application/json', 'midi': 'audio/midi', 'latex': 'application/x-latex', 'm3u': 'audio/x-mpegurl', 'pnt': 'image/x-macpaint', 'tr': 'text/troff', 'mathml': 'application/mathml+xml', 'mif': 'application/x-mif', 'qt': 'video/quicktime', 'movie': 'video/x-sgi-movie', 'mpa': 'audio/mpeg', 'mp4': 'video/mp4', 'mpg': 'video/mpeg', 'mpv2': 'video/mpeg2', 'src': 'application/x-wais-source', 'nc': 'application/x-netcdf', 'oda': 'application/oda', 'odb': 'application/vnd.oasis.opendocument.database', 'odc': 'application/vnd.oasis.opendocument.chart', 'odf': 'application/vnd.oasis.opendocument.formula', 'odg': 'application/vnd.oasis.opendocument.graphics', 'odi': 'application/vnd.oasis.opendocument.image', 'odm': 'application/vnd.oasis.opendocument.text-master', 'odp': 'application/vnd.oasis.opendocument.presentation', 'ods': 'application/vnd.oasis.opendocument.spreadsheet', 'odt': 'application/vnd.oasis.opendocument.text', 'otg': 'application/vnd.oasis.opendocument.graphics-template', 'oth': 'application/vnd.oasis.opendocument.text-web', 'otp': 'application/vnd.oasis.opendocument.presentation-template', 'ots': 'application/vnd.oasis.opendocument.spreadsheet-template', 'ott': 'application/vnd.oasis.opendocument.text-template', 'ogx': 'application/ogg', 'ogv': 'video/ogg', 'spx': 'audio/ogg', 'otf': 'application/x-font-opentype', 'flac': 'audio/flac', 'anx': 'application/annodex', 'axa': 'audio/annodex', 'axv': 'video/annodex', 'xspf': 'application/xspf+xml', 'pbm': 'image/x-portable-bitmap', 'pict': 'image/pict', 'pdf': 'application/pdf', 'pgm': 'image/x-portable-graymap', 'pls': 'audio/x-scpls', 'png': 'image/png', 'pnm': 'image/x-portable-anymap', 'ppm': 'image/x-portable-pixmap', 'pps': 'application/vnd.ms-powerpoint', 'psd': 'image/vnd.adobe.photoshop', 'qtif': 'image/x-quicktime', 'ras': 'image/x-cmu-raster', 'rdf': 'application/rdf+xml', 'rgb': 'image/x-rgb', 'rm': 'application/vnd.rn-realmedia', 'rtf': 'application/rtf', 'rtx': 'text/richtext', 'sfnt': 'application/font-sfnt', 'sh': 'application/x-sh', 'shar': 'application/x-shar', 'sit': 'application/x-stuffit', 'sv4cpio': 'application/x-sv4cpio', 'sv4crc': 'application/x-sv4crc', 'svg': 'image/svg+xml', 'swf': 'application/x-shockwave-flash', 'tar': 'application/x-tar', 'tcl': 'application/x-tcl', 'tex': 'application/x-tex', 'texinfo': 'application/x-texinfo', 'tiff': 'image/tiff', 'tsv': 'text/tab-separated-values', 'ttf': 'application/x-font-ttf', 'ustar': 'application/x-ustar', 'vxml': 'application/voicexml+xml', 'xbm': 'image/x-xbitmap', 'xhtml': 'application/xhtml+xml', 'xls': 'application/vnd.ms-excel', 'xsl': 'application/xml', 'xpm': 'image/x-xpixmap', 'xslt': 'application/xslt+xml', 'xul': 'application/vnd.mozilla.xul+xml', 'xwd': 'image/x-xwindowdump', 'vsd': 'application/vnd.visio', 'wav': 'audio/x-wav', 'wbmp': 'image/vnd.wap.wbmp', 'wml': 'text/vnd.wap.wml', 'wmlc': 'application/vnd.wap.wmlc', 'wmls': 'text/vnd.wap.wmlsc', 'wmlscriptc': 'application/vnd.wap.wmlscriptc', 'wmv': 'video/x-ms-wmv', 'woff': 'application/font-woff', 'woff2': 'application/font-woff2', 'wrl': 'model/vrml', 'wspolicy': 'application/wspolicy+xml', 'z': 'application/x-compress', 'zip': 'application/zip'}; - return FileMimeType[extention] || "application/octet-stream"; - } - - public getContentBase64(): string - { - let extension = this.filename.split(".").pop() || "txt"; - let mimeType = mime(extension) || "text/plain"; - let base64 = this.content.toString("base64"); - return `data:${mimeType};base64,${base64}`; - } - - private getHTMLTagName(): string - { - switch(this.type) - { - case AssetType.Style: - return "link"; - case AssetType.Script: - return "script"; - case AssetType.Font: - return "style"; - case AssetType.HTML: - return "include"; - } - - // media - let extension = this.filename.split(".").pop() || "txt"; - const extToTag: {[key: string]: string} = {"png": "img", "jpg": "img", "jpeg": "img", "tiff": "img", "bmp": "img", "avif": "img", "apng": "img", "gif": "img", "svg": "img", "webp": "img", "ico": "img", "mp4": "video", "webm": "video", "ogg": "video", "3gp": "video", "mov": "video", "mpeg": "video", "mp3": "audio", "wav": "audio", "flac": "audio", "aac": "audio", "m4a": "audio", "opus": "audio"}; - return extToTag[extension] || "img"; - } -} diff --git a/.obsidian/plugins/obsidian-webpage-export-master/scripts/html-generation/assets/custom-head-content.ts b/.obsidian/plugins/obsidian-webpage-export-master/scripts/html-generation/assets/custom-head-content.ts deleted file mode 100644 index c058b622..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/scripts/html-generation/assets/custom-head-content.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { Asset, AssetType, InlinePolicy, Mutability } from "./asset"; -import { Path } from "scripts/utils/path"; -import { Settings, SettingsPage } from "scripts/settings/settings"; -import { ExportLog } from "../render-log"; -import { MarkdownWebpageRendererAPIOptions } from "scripts/api-options"; - -export class CustomHeadContent extends Asset -{ - public content: string = ""; - - constructor() - { - super("custom-head-content.html", "", AssetType.HTML, InlinePolicy.AutoHead, false, Mutability.Dynamic); - } - - override async load(options: MarkdownWebpageRendererAPIOptions) - { - if (!SettingsPage.loaded) return; - - let customHeadPath = new Path(Settings.customHeadContentPath); - if (customHeadPath.isEmpty) - { - this.content = ""; - return; - } - - let validation = customHeadPath.validate( - { - allowEmpty: false, - allowFiles: true, - allowAbsolute: true, - allowRelative: true, - requireExists: true - }); - - if (!validation.valid) - { - this.content = ""; - ExportLog.error(validation.error + customHeadPath.asString); - return; - } - - this.modifiedTime = customHeadPath.stat?.mtimeMs ?? this.modifiedTime; - this.content = await customHeadPath.readFileString() ?? ""; - await super.load(options); - } -} diff --git a/.obsidian/plugins/obsidian-webpage-export-master/scripts/html-generation/assets/favicon.ts b/.obsidian/plugins/obsidian-webpage-export-master/scripts/html-generation/assets/favicon.ts deleted file mode 100644 index be2687fe..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/scripts/html-generation/assets/favicon.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { Asset, AssetType, InlinePolicy, Mutability } from "./asset"; -import { Settings, SettingsPage } from "scripts/settings/settings"; -import { Path } from "scripts/utils/path"; -import defaultIcon from "assets/icon.png"; -import { MarkdownWebpageRendererAPIOptions } from "scripts/api-options"; - -export class Favicon extends Asset -{ - public content: Buffer; - - constructor() - { - super("favicon.png", "", AssetType.Media, InlinePolicy.AutoHead, false, Mutability.Dynamic); - } - - override async load(options: MarkdownWebpageRendererAPIOptions) - { - if (Settings.faviconPath == "") this.content = Buffer.from(defaultIcon); - - let iconPath = new Path(Settings.faviconPath); - let icon = await iconPath.readFileBuffer(); - if (icon) - { - this.content = icon; - this.filename = "favicon" + iconPath.extension; - this.modifiedTime = iconPath.stat?.mtimeMs ?? this.modifiedTime; - } - - await super.load(options); - } - - public override getHTML(): string - { - if (Settings.inlineAssets) - { - return ``; - } - else - { - return ``; - } - } -} diff --git a/.obsidian/plugins/obsidian-webpage-export-master/scripts/html-generation/assets/global-variable-styles.ts b/.obsidian/plugins/obsidian-webpage-export-master/scripts/html-generation/assets/global-variable-styles.ts deleted file mode 100644 index d8aa4069..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/scripts/html-generation/assets/global-variable-styles.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { MarkdownWebpageRendererAPIOptions } from "scripts/api-options"; -import { Asset, AssetType, InlinePolicy, LoadMethod, Mutability } from "./asset"; -import { Settings, SettingsPage } from "scripts/settings/settings"; - -export class GlobalVariableStyles extends Asset -{ - public content: string = ""; - - constructor() - { - super("global-variable-styles.css", "", AssetType.Style, InlinePolicy.AutoHead, true, Mutability.Dynamic, LoadMethod.Async, 6); - } - - override async load(options: MarkdownWebpageRendererAPIOptions) - { - let bodyStyle = (document.body.getAttribute("style") ?? "").replaceAll("\"", "'").replaceAll("; ", " !important;\n\t"); - let lineWidth = Settings.documentWidth || "40em"; - let sidebarWidth = Settings.sidebarWidth || "20em"; - if (!isNaN(Number(lineWidth))) lineWidth += "px"; - if (!isNaN(Number(sidebarWidth))) sidebarWidth += "px"; - - let lineWidthCss = `min(${lineWidth}, calc(100vw - 2em))`; - this.content = - ` - :root body - { - --line-width: ${lineWidthCss}; - --line-width-adaptive: ${lineWidthCss}; - --file-line-width: ${lineWidthCss}; - --sidebar-width: min(${sidebarWidth}, 80vw); - } - - body - { - ${bodyStyle} - } - ` - - this.modifiedTime = Date.now(); - - await super.load(options); - } -} diff --git a/.obsidian/plugins/obsidian-webpage-export-master/scripts/html-generation/assets/local-fetch-buffer.ts b/.obsidian/plugins/obsidian-webpage-export-master/scripts/html-generation/assets/local-fetch-buffer.ts deleted file mode 100644 index 2a115e56..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/scripts/html-generation/assets/local-fetch-buffer.ts +++ /dev/null @@ -1,106 +0,0 @@ -import { Asset, AssetType, InlinePolicy, LoadMethod, Mutability } from "./asset"; -import { Path } from "scripts/utils/path"; -import { ExportLog } from "../render-log"; -import { RequestUrlResponse, requestUrl } from "obsidian"; -import { Utils } from "scripts/utils/utils"; -import { fileTypeFromBuffer } from "file-type"; -import { MarkdownWebpageRendererAPIOptions } from "scripts/api-options"; - -export class FetchBuffer extends Asset -{ - public content: Buffer; - public url: Path | string; - - constructor(filename: string, url: Path | string, type: AssetType, inlinePolicy: InlinePolicy, minify: boolean, mutability: Mutability, loadPriority?: number) - { - - super(filename, "", type, inlinePolicy, minify, mutability, LoadMethod.Default, loadPriority); - this.url = url; - - let stringURL = this.url instanceof Path ? this.url.asString : this.url; - if (stringURL.startsWith("http")) this.onlineURL = stringURL; - } - - override async load(options: MarkdownWebpageRendererAPIOptions) - { - - if (this.url instanceof Path) - { - if (this.url.isRelative) - { - this.url.setWorkingDirectory("").makeAbsolute(); - } - - this.url = this.url.makeUnixStyle().asString; - } - - if (options.offlineResources === false && this.url.startsWith("http")) return; - - if (this.url.startsWith("http") && (this.url.split(".").length <= 2 || this.url.split("/").length <= 2)) - { - this.onlineURL = undefined; - return; - } - - let res: RequestUrlResponse | Response; - try - { - if (this.url.startsWith("http")) - { - // first ping with a fetch "no-cors" request to see if the server is available - let testResp = await Utils.urlAvailable(this.url); - - if (testResp.type == "opaque") - res = await requestUrl(this.url); - else - { - ExportLog.log(`Url ${this.url} is not available`); - return; - } - } - else - { - // local file - res = await fetch(this.url); - } - } - catch (e) - { - ExportLog.log(e, `Failed to fetch ${this.url}`); - return; - } - - if (res.status != 200) - { - ExportLog.log(`Failed to fetch ${this.url} with status ${res.status}`); - return; - } - - let data; - if (res instanceof Response) - { - data = await res.arrayBuffer(); - } - else - { - data = res.arrayBuffer; - } - - this.content = Buffer.from(data); - this.modifiedTime = Date.now(); - - if (this.relativePath.extension == '') - { - let type = await fileTypeFromBuffer(this.content); - if (type) - { - this.relativePath.setExtension(type.ext); - this.filename = this.relativePath.fullName; - this.type = Asset.extentionToType(type.ext); - this.relativeDirectory = Asset.typeToPath(this.type); - } - } - - await super.load(options); - } -} diff --git a/.obsidian/plugins/obsidian-webpage-export-master/scripts/html-generation/assets/mathjax-styles.ts b/.obsidian/plugins/obsidian-webpage-export-master/scripts/html-generation/assets/mathjax-styles.ts deleted file mode 100644 index 40f043a8..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/scripts/html-generation/assets/mathjax-styles.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { MarkdownWebpageRendererAPIOptions } from "scripts/api-options"; -import { Asset, AssetType, InlinePolicy, Mutability } from "./asset"; - -export class MathjaxStyles extends Asset -{ - private mathjaxStylesheet: CSSStyleSheet | undefined = undefined; - private lastMathjaxChanged: number = -1; - public content: string = ""; - - constructor() - { - super("mathjax.css", "", AssetType.Style, InlinePolicy.Inline, true, Mutability.Dynamic); - } - - override async load(options: MarkdownWebpageRendererAPIOptions) - { - // @ts-ignore - if (this.mathjaxStylesheet == undefined) this.mathjaxStylesheet = Array.from(document.styleSheets).find((sheet) => sheet.ownerNode.id == ("MJX-CHTML-styles")); - if (this.mathjaxStylesheet == undefined) - { - return; - } - - this.modifiedTime = Date.now(); - - // @ts-ignore - let changed = this.mathjaxStylesheet?.ownerNode.getAttribute("data-change"); - if (changed != this.lastMathjaxChanged) - { - this.content = ""; - for (let i = 0; i < this.mathjaxStylesheet.cssRules.length; i++) - { - this.content += this.mathjaxStylesheet.cssRules[i].cssText + "\n"; - } - } - else - { - return; - } - - this.lastMathjaxChanged = changed; - await super.load(options); - } -} diff --git a/.obsidian/plugins/obsidian-webpage-export-master/scripts/html-generation/assets/obsidian-styles.ts b/.obsidian/plugins/obsidian-webpage-export-master/scripts/html-generation/assets/obsidian-styles.ts deleted file mode 100644 index d03dd2a5..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/scripts/html-generation/assets/obsidian-styles.ts +++ /dev/null @@ -1,106 +0,0 @@ -import { Asset, AssetType, InlinePolicy, LoadMethod, Mutability } from "./asset"; -import { SettingsPage } from "scripts/settings/settings"; -import { ExportLog } from "../render-log"; -import obsidianStyleOverrides from "assets/obsidian-styles.txt.css"; -import { MarkdownWebpageRendererAPIOptions } from "scripts/api-options"; - -export class ObsidianStyles extends Asset -{ - public content: string = ""; - - constructor() - { - super("obsidian.css", "", AssetType.Style, InlinePolicy.AutoHead, true, Mutability.Dynamic, LoadMethod.Default, 10); - } - - public static stylesFilter = - ["workspace-", "cm-", "ghost", "leaf", "CodeMirror", - "@media", "pdf", "xfa", "annotation", "@keyframes", - "load", "@-webkit", "setting", "filter", "decorator", - "dictionary", "status", "windows", "titlebar", "source", - "menu", "message", "popover", "suggestion", "prompt", - "tab", "HyperMD", "workspace", "publish", - "backlink", "sync", "vault", "mobile", "tablet", "phone", - "textLayer", "header", "linux", "macos", "rename", "edit", - "progress", "native", "aria", "tooltip", - "drop", "sidebar", "mod-windows", "is-frameless", - "is-hidden-frameless", "obsidian-app", "show-view-header", - "is-maximized", "is-translucent", "community"]; - - public static stylesKeep = ["scrollbar", "input[type", "table", "markdown-rendered", "css-settings-manager", "inline-embed", "background", "token"]; - - removeSelectors(css: string, containing: string): string - { - let regex = new RegExp(`([\w :*+~\\-\\.\\>\\[\\]()"=]*${containing}[\\w\\s:*+~\\-\\.\\>\\[\\]()"=]+)(,|{)`, "gm"); - let toRemove = [...css.matchAll(regex)]; - for (let match of toRemove) - { - css = css.replace(match[1], ""); - } - css = css.trim(); - return css; - } - - - override async load(options: MarkdownWebpageRendererAPIOptions) - { - this.content = ""; - - let appSheet = document.styleSheets[1]; - let stylesheets = document.styleSheets; - for (let i = 0; i < stylesheets.length; i++) - { - if (stylesheets[i].href && stylesheets[i].href?.includes("app.css")) - { - appSheet = stylesheets[i]; - break; - } - } - - this.content += obsidianStyleOverrides; - - for (let i = 0; i < appSheet.cssRules.length; i++) - { - let rule = appSheet.cssRules[i]; - if (rule) - { - let skip = false; - let cssText = rule.cssText; - let selector = cssText.split("{")[0]; - - for (let keep of ObsidianStyles.stylesKeep) - { - if (!selector.includes(keep)) - { - // filter out certain unused styles to reduce file size - for (let filter of ObsidianStyles.stylesFilter) - { - if (selector.includes(filter)) - { - skip = true; - break; - } - } - } - else - { - skip = false; - break; - } - } - - if (skip) continue; - - cssText = this.removeSelectors(cssText, "\\.cm-"); - if(cssText.startsWith("{")) continue; // skip empty rules - - cssText += "\n"; - - this.content += cssText; - } - } - - this.modifiedTime = Date.now(); - await super.load(options); - } -} diff --git a/.obsidian/plugins/obsidian-webpage-export-master/scripts/html-generation/assets/other-plugin-styles.ts b/.obsidian/plugins/obsidian-webpage-export-master/scripts/html-generation/assets/other-plugin-styles.ts deleted file mode 100644 index 604114b5..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/scripts/html-generation/assets/other-plugin-styles.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { Settings, SettingsPage } from "scripts/settings/settings"; -import { Asset, AssetType, InlinePolicy, LoadMethod, Mutability } from "./asset"; -import { AssetHandler } from "../asset-handler"; -import { MarkdownWebpageRendererAPIOptions } from "scripts/api-options"; - -export class OtherPluginStyles extends Asset -{ - public content: string = ""; - private lastEnabledPluginStyles: string = ""; - - constructor() - { - super("other-plugins.css", "", AssetType.Style, InlinePolicy.AutoHead, true, Mutability.Dynamic, LoadMethod.Async, 9); - } - - override async load(options: MarkdownWebpageRendererAPIOptions) - { - if(this.lastEnabledPluginStyles == Settings.includePluginCSS) return; - - this.content = ""; - let thirdPartyPluginStyleNames = Settings.includePluginCSS.split("\n"); - for (let i = 0; i < thirdPartyPluginStyleNames.length; i++) - { - if (!thirdPartyPluginStyleNames[i] || (thirdPartyPluginStyleNames[i] && !(/\S/.test(thirdPartyPluginStyleNames[i])))) continue; - - let path = AssetHandler.vaultPluginsPath.joinString(thirdPartyPluginStyleNames[i].replace("\n", ""), "styles.css"); - if (!path.exists) continue; - - let style = await path.readFileString(); - if (style) - { - this.content += style; - console.log("Loaded plugin style: " + thirdPartyPluginStyleNames[i] + " size: " + style.length); - } - } - - this.modifiedTime = Date.now(); - this.lastEnabledPluginStyles = Settings.includePluginCSS; - await super.load(options); - } -} diff --git a/.obsidian/plugins/obsidian-webpage-export-master/scripts/html-generation/assets/snippet-styles.ts b/.obsidian/plugins/obsidian-webpage-export-master/scripts/html-generation/assets/snippet-styles.ts deleted file mode 100644 index 8a3ee0c0..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/scripts/html-generation/assets/snippet-styles.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { Asset, AssetType, InlinePolicy, LoadMethod, Mutability } from "./asset"; -import { Path } from "scripts/utils/path"; -import { ExportLog } from "../render-log"; -import { MarkdownWebpageRendererAPIOptions } from "scripts/api-options"; - -export class SnippetStyles extends Asset -{ - public content: string = ""; - - constructor() - { - super("snippets.css", "", AssetType.Style, InlinePolicy.AutoHead, true, Mutability.Dynamic, LoadMethod.Async, 2); - } - - private static getEnabledSnippets(): string[] - { - /*@ts-ignore*/ - return app.vault.config?.enabledCssSnippets ?? []; - } - - private static async getStyleSnippetsContent(): Promise - { - let snippetContents : string[] = []; - let enabledSnippets = this.getEnabledSnippets(); - for (let i = 0; i < enabledSnippets.length; i++) - { - let path = new Path(`.obsidian/snippets/${enabledSnippets[i]}.css`).absolute(); - if (path.exists) snippetContents.push(await path.readFileString() ?? "\n"); - } - return snippetContents; - } - - - override async load(options: MarkdownWebpageRendererAPIOptions) - { - let snippetsList = await SnippetStyles.getStyleSnippetsContent(); - let snippets = "\n"; - for (let i = 0; i < snippetsList.length; i++) - { - snippets += snippetsList[i] + "\n"; - } - - // replace "publish" styles with a high specificity prefix - snippets = snippets.replaceAll(/^publish /gm, "html body[class].publish "); - - this.content = snippets; - this.modifiedTime = Date.now(); - - await super.load(options); - } -} diff --git a/.obsidian/plugins/obsidian-webpage-export-master/scripts/html-generation/assets/supported-plugin-styles.ts b/.obsidian/plugins/obsidian-webpage-export-master/scripts/html-generation/assets/supported-plugin-styles.ts deleted file mode 100644 index 0883946b..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/scripts/html-generation/assets/supported-plugin-styles.ts +++ /dev/null @@ -1,85 +0,0 @@ -import { Settings, SettingsPage } from "scripts/settings/settings"; -import { Asset, AssetType, InlinePolicy, LoadMethod, Mutability } from "./asset"; -import { ExportLog } from "../render-log"; -import { MarkdownWebpageRendererAPIOptions } from "scripts/api-options"; - -export class SupportedPluginStyles extends Asset -{ - public content: string = ""; - - constructor() - { - super("supported-plugins.css", "", AssetType.Style, InlinePolicy.AutoHead, true, Mutability.Dynamic, LoadMethod.Async, 5); - } - - override async load(options: MarkdownWebpageRendererAPIOptions) - { - this.content = ""; - let stylesheets = document.styleSheets; - - for(let i = 1; i < stylesheets.length; i++) - { - // @ts-ignore - let styleID = stylesheets[i].ownerNode?.id; - - if - ( - styleID == "ADMONITIONS_CUSTOM_STYLE_SHEET" || - styleID == "css-settings-manager" || - (Settings.includeSvelteCSS && this.isSvelteStylesheet(stylesheets[i])) - ) - { - ExportLog.log("Including stylesheet: " + styleID); - let style = stylesheets[i].cssRules; - - for(let item in style) - { - if(style[item].cssText != undefined) - { - - this.content += "\n" + style[item].cssText; - } - } - } - - this.content += "\n\n /* ---- */\n\n"; - } - - this.modifiedTime = Date.now(); - await super.load(options); - } - - getStylesheetContent(stylesheet: CSSStyleSheet): string - { - let content = ""; - let style = stylesheet.cssRules; - - for(let item in style) - { - if(style[item].cssText != undefined) - { - content += "\n" + style[item].cssText; - } - } - - return content; - } - - isSvelteStylesheet(stylesheet: CSSStyleSheet): boolean - { - if(stylesheet.ownerNode == undefined) return false; - // @ts-ignore - let styleID = stylesheet.ownerNode.id; - - if (styleID.contains("svelte")) return true; - - let sheetContent = this.getStylesheetContent(stylesheet); - let first1000 = sheetContent.substring(0, 1000); - if (first1000.contains(".svelte-")) - { - return true; - } - - return false; - } -} diff --git a/.obsidian/plugins/obsidian-webpage-export-master/scripts/html-generation/assets/theme-styles.ts b/.obsidian/plugins/obsidian-webpage-export-master/scripts/html-generation/assets/theme-styles.ts deleted file mode 100644 index 15c6a49a..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/scripts/html-generation/assets/theme-styles.ts +++ /dev/null @@ -1,53 +0,0 @@ -import { Asset, AssetType, InlinePolicy, LoadMethod, Mutability } from "./asset"; -import { Path } from "scripts/utils/path"; -import { ExportLog } from "../render-log"; -import { AssetHandler } from "../asset-handler"; -import { MarkdownWebpageRendererAPIOptions } from "scripts/api-options"; - -export class ThemeStyles extends Asset -{ - public content: string = ""; - private lastThemeName: string = ""; - - constructor() - { - super("theme.css", "", AssetType.Style, InlinePolicy.AutoHead, true, Mutability.Dynamic, LoadMethod.Default, 8); - } - - private static async getThemeContent(themeName: string): Promise - { - if (themeName == "Default") return "/* Using default theme. */"; - - let themePath = AssetHandler.vaultPluginsPath.joinString(`../themes/${themeName}/theme.css`).absolute(); - if (!themePath.exists) - { - ExportLog.warning("Cannot find theme at path: \n\n" + themePath); - return ""; - } - let themeContent = await themePath.readFileString() ?? ""; - - return themeContent; - } - - private static getCurrentThemeName(): string - { - /*@ts-ignore*/ - let themeName = app.vault.config?.cssTheme; - return (themeName ?? "") == "" ? "Default" : themeName; - } - - override async load(options: MarkdownWebpageRendererAPIOptions) - { - let themeName = ThemeStyles.getCurrentThemeName(); - if (themeName == this.lastThemeName) - { - this.modifiedTime = 0; - return; - } - this.content = await ThemeStyles.getThemeContent(themeName); - this.modifiedTime = Date.now(); - this.lastThemeName = themeName; - - await super.load(options); - } -} diff --git a/.obsidian/plugins/obsidian-webpage-export-master/scripts/html-generation/html-generation-helpers.ts b/.obsidian/plugins/obsidian-webpage-export-master/scripts/html-generation/html-generation-helpers.ts deleted file mode 100644 index 0fa80099..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/scripts/html-generation/html-generation-helpers.ts +++ /dev/null @@ -1,166 +0,0 @@ -import { EmojiStyle, Settings, SettingsPage } from "scripts/settings/settings"; -import { AssetHandler } from "./asset-handler"; -import { AssetType } from "./assets/asset"; -import { ExportLog } from "./render-log"; -import { getIcon as getObsidianIcon, requestUrl } from "obsidian"; -import { Utils } from "scripts/utils/utils"; -import { ObsidianStyles } from "./assets/obsidian-styles"; - -export namespace HTMLGeneration -{ - export function createThemeToggle(container: HTMLElement) : HTMLElement - { - let label = container.createEl("label"); - let input = label.createEl("input"); - let div = label.createDiv(); - - label.classList.add("theme-toggle-container"); - label.setAttribute("for", "theme_toggle"); - - input.classList.add("theme-toggle-input"); - input.setAttribute("type", "checkbox"); - input.setAttribute("id", "theme_toggle"); - - div.classList.add("toggle-background"); - - return label; - } - - let _validBodyClasses: string | undefined = undefined; - export async function getValidBodyClasses(cleanCache: boolean): Promise - { - if (cleanCache) _validBodyClasses = undefined; - if (_validBodyClasses) return _validBodyClasses; - - let bodyClasses = Array.from(document.body.classList); - // filter classes - bodyClasses = bodyClasses.filter((value) => - ObsidianStyles.stylesKeep.some(keep => value.includes(keep)) || - !ObsidianStyles.stylesFilter.some(filter => value.includes(filter)) - ); - - let validClasses = ""; - validClasses += " publish "; - validClasses += " css-settings-manager "; - - // keep body classes that are referenced in the styles - let styles = AssetHandler.getAssetsOfType(AssetType.Style); - let i = 0; - let classes: string[] = []; - - for (var style of styles) - { - ExportLog.progress(i, styles.length, "Compiling css classes", "Scanning: " + style.filename, "var(--color-yellow)"); - if (typeof(style.content) != "string") continue; - - // this matches every class name with the dot - let matches = Array.from(style.content.matchAll(/\.([A-Za-z_-]+[\w-]+)/g)); - let styleClasses = matches.map(match => match[0].substring(1).trim()); - // remove duplicates - styleClasses = styleClasses.filter((value, index, self) => self.indexOf(value) === index); - classes = classes.concat(styleClasses); - i++; - await Utils.delay(0); - } - - // remove duplicates - ExportLog.progress(1, 1, "Filtering classes", "...", "var(--color-yellow)"); - classes = classes.filter((value, index, self) => self.indexOf(value) === index); - ExportLog.progress(1, 1, "Sorting classes", "...", "var(--color-yellow)"); - classes = classes.sort(); - - i = 0; - for (var bodyClass of bodyClasses) - { - ExportLog.progress(i, bodyClasses.length, "Collecting valid classes", "Scanning: " + bodyClass, "var(--color-yellow)"); - - if (classes.includes(bodyClass)) - { - validClasses += bodyClass + " "; - } - - i++; - } - - ExportLog.progress(1, 1, "Cleanup classes", "...", "var(--color-yellow)"); - _validBodyClasses = validClasses.replace(/\s\s+/g, ' '); - - // convert to array and remove duplicates - ExportLog.progress(1, 1, "Filter duplicate classes", _validBodyClasses.length + " classes", "var(--color-yellow)"); - _validBodyClasses = _validBodyClasses.split(" ").filter((value, index, self) => self.indexOf(value) === index).join(" ").trim(); - - ExportLog.progress(1, 1, "Classes done", "...", "var(--color-yellow)"); - - return _validBodyClasses; - } - - export function getLucideIcon(iconName: string): string | undefined - { - const iconEl = getObsidianIcon(iconName); - if (iconEl) - { - let svg = iconEl.outerHTML; - iconEl.remove(); - return svg; - } - else - { - return undefined; - } - } - - export function getEmojiIcon(iconCode: string): string | undefined - { - let iconCodeInt = parseInt(iconCode, 16); - if (!isNaN(iconCodeInt)) - { - return String.fromCodePoint(iconCodeInt); - } - else - { - return undefined; - } - } - - export async function getIcon(iconName: string): Promise - { - if (iconName.startsWith('emoji//')) - { - const iconCode = iconName.replace(/^emoji\/\//, ''); - iconName = getEmojiIcon(iconCode) ?? "�"; - } - else if (iconName.startsWith('lucide//')) - { - const lucideIconName = iconName.replace(/^lucide\/\//, ''); - iconName = getLucideIcon(lucideIconName) ?? "�"; - } - - // if it's an emoji convert it into a twemoji - if ((/^\p{Emoji}/gu).test(iconName)) - { - let codepoint = [...iconName].map(e => e.codePointAt(0)!.toString(16)).join(`-`); - - switch (Settings.emojiStyle) - { - case EmojiStyle.Twemoji: - return ``; - case EmojiStyle.OpenMoji: - console.log(codepoint); - return ``; - case EmojiStyle.OpenMojiOutline: - let req = await requestUrl(`https://openmoji.org/data/black/svg/${codepoint.toUpperCase()}.svg`); - if (req.status == 200) - return req.text.replaceAll(/#00+/g, "currentColor").replaceAll(`stroke-width="2"`, `stroke-width="5"`); - - return iconName; - case EmojiStyle.FluentUI: - return ``; - default: - return iconName; - } - } - - return getLucideIcon(iconName.toLowerCase()) ?? iconName; // try and parse a plain lucide icon name - } - -} diff --git a/.obsidian/plugins/obsidian-webpage-export-master/scripts/html-generation/render-log.ts b/.obsidian/plugins/obsidian-webpage-export-master/scripts/html-generation/render-log.ts deleted file mode 100644 index 44207d6b..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/scripts/html-generation/render-log.ts +++ /dev/null @@ -1,142 +0,0 @@ -import { Path } from "scripts/utils/path"; -import { _MarkdownRendererInternal } from "scripts/render-api"; -import { Settings, SettingsPage } from "scripts/settings/settings"; - -export namespace ExportLog -{ - export let fullLog: string = ""; - - function logToString(message: any, title: string) - { - let messageString = (typeof message === "string") ? message : JSON.stringify(message).replaceAll("\n", "\n\t\t"); - let titleString = title != "" ? title + "\t" : ""; - let log = `${titleString}${messageString}\n`; - return log; - } - - function humanReadableJSON(object: any) - { - let string = JSON.stringify(object, null, 2).replaceAll(/\"|\{|\}|,/g, "").split("\n").map((s) => s.trim()).join("\n\t"); - // make the properties into a table - let lines = string.split("\n"); - lines = lines.filter((line) => line.contains(":")); - let names = lines.map((line) => line.split(":")[0] + " "); - let values = lines.map((line) => line.split(":").slice(1).join(":")); - let maxLength = Math.max(...names.map((name) => name.length)) + 3; - let table = ""; - for (let i = 0; i < names.length; i++) - { - let padString = i % 2 == 0 ? "-" : " "; - table += `${names[i].padEnd(maxLength, padString)}${values[i]}\n`; - } - - return table; - } - - export function log(message: any, messageTitle: string = "") - { - pullPathLogs(); - - messageTitle = `[INFO] ${messageTitle}` - fullLog += logToString(message, messageTitle); - - if(SettingsPage.loaded && !(Settings.logLevel == "all")) return; - - if (messageTitle != "") console.log(messageTitle + " ", message); - else console.log(message); - _MarkdownRendererInternal._reportInfo(messageTitle, message); - } - - export function warning(message: any, messageTitle: string = "") - { - pullPathLogs(); - - messageTitle = `[WARNING] ${messageTitle}` - fullLog += logToString(message, messageTitle); - - if(SettingsPage.loaded && !["warning", "all"].contains(Settings.logLevel)) return; - - if (messageTitle != "") console.warn(messageTitle + " ", message); - else console.warn(message); - _MarkdownRendererInternal._reportWarning(messageTitle, message); - } - - export function error(message: any, messageTitle: string = "", fatal: boolean = false) - { - pullPathLogs(); - - messageTitle = (fatal ? "[FATAL ERROR] " : "[ERROR] ") + messageTitle; - fullLog += logToString(message, messageTitle); - - if (SettingsPage.loaded && !fatal && !["error", "warning", "all"].contains(Settings.logLevel)) return; - - if (fatal && messageTitle == "Error") messageTitle = "Fatal Error"; - - if (messageTitle != "") console.error(messageTitle + " ", message); - else console.error(message); - - _MarkdownRendererInternal._reportError(messageTitle, message, fatal); - } - - export function progress(complete: number, total:number, message: string, subMessage: string, progressColor: string = "var(--interactive-accent)") - { - pullPathLogs(); - if (total == 0) - { - complete = 1; - total = 1; - } - _MarkdownRendererInternal._reportProgress(complete, total, message, subMessage, progressColor); - } - - function pullPathLogs() - { - let logs = Path.dequeueLog(); - for (let thisLog of logs) - { - switch (thisLog.type) - { - case "info": - log(thisLog.message, thisLog.title); - break; - case "warn": - warning(thisLog.message, thisLog.title); - break; - case "error": - error(thisLog.message, thisLog.title, false); - break; - case "fatal": - error(thisLog.message, thisLog.title, true); - break; - } - } - } - - export function getDebugInfo() - { - let debugInfo = ""; - - debugInfo += `Log:\n${fullLog}\n\n`; - - let settingsCopy = Object.assign({}, Settings); - //@ts-ignore - settingsCopy.filesToExport = settingsCopy.filesToExport[0].length; - settingsCopy.includePluginCSS = settingsCopy.includePluginCSS.split("\n").length + " plugins included"; - - debugInfo += `Settings:\n${humanReadableJSON(settingsCopy)}\n\n`; - - // @ts-ignore - let loadedPlugins = Object.values(app.plugins.plugins).filter((plugin) => plugin._loaded == true).map((plugin) => plugin.manifest.name).join("\n\t"); - debugInfo += `Enabled Plugins:\n\t${loadedPlugins}`; - - return debugInfo; - } - - export function testThrowError(chance: number) - { - if (Math.random() < chance) - { - throw new Error("Test error"); - } - } -} diff --git a/.obsidian/plugins/obsidian-webpage-export-master/scripts/local-server/server.py b/.obsidian/plugins/obsidian-webpage-export-master/scripts/local-server/server.py deleted file mode 100644 index 75ff7cb2..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/scripts/local-server/server.py +++ /dev/null @@ -1,64 +0,0 @@ -from http.server import HTTPServer, BaseHTTPRequestHandler -import json -import webbrowser -import mimetypes -import base64 - -database_string = open('C:/Main Documents/Obsidian/Export/database.json','r', encoding='utf-8').read() -website = json.loads(database_string) # dictionary relating paths to file data - - -html_404 = """ - - - - - - - -

404 Not Found

- - -""" - -class Serve(BaseHTTPRequestHandler): - - def do_GET(self): - if self.path == '/': - self.path = 'index.html' - if not self.path in website: - # return first html file in website - self.path = next(p for p in list(website.keys()) if p.endswith(".html")) - print("index.html does not exist. Using", self.path, "instead.") - - if(self.path.startswith("/")): - self.path = self.path[1:] - - ext = "." + self.path.split(".")[-1] - - - - if self.path in website: - data = website[self.path] - - self.send_response(200) - self.send_header('Content-type', mimetypes.types_map[ext]) - self.end_headers() - - if ext == ".html" or ext == ".css" or ext == ".js": - response = bytes(data,'utf-8') - self.wfile.write(response) - else: - response = base64.decodebytes(bytes(data, 'utf-8')) - self.wfile.write(response) - else: - self.send_response(404) - self.end_headers() - self.wfile.write(bytes(html_404,'utf-8')) - -httpd = HTTPServer(('localhost',8080),Serve) - -# open http://localhost:8080/ in the browser -webbrowser.open('http://localhost:8080/') - -httpd.serve_forever() diff --git a/.obsidian/plugins/obsidian-webpage-export-master/scripts/local-server/server.spec b/.obsidian/plugins/obsidian-webpage-export-master/scripts/local-server/server.spec deleted file mode 100644 index 92c38e7b..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/scripts/local-server/server.spec +++ /dev/null @@ -1,43 +0,0 @@ -# -*- mode: python ; coding: utf-8 -*- - - -a = Analysis( - ['server.py'], - pathex=[], - binaries=[], - datas=[], - hiddenimports=[], - hookspath=[], - hooksconfig={}, - runtime_hooks=[], - excludes=[], - noarchive=False, -) -pyz = PYZ(a.pure) - -exe = EXE( - pyz, - a.scripts, - [], - exclude_binaries=True, - name='server', - debug=False, - bootloader_ignore_signals=False, - strip=False, - upx=True, - console=True, - disable_windowed_traceback=False, - argv_emulation=False, - target_arch=None, - codesign_identity=None, - entitlements_file=None, -) -coll = COLLECT( - exe, - a.binaries, - a.datas, - strip=False, - upx=True, - upx_exclude=[], - name='server', -) diff --git a/.obsidian/plugins/obsidian-webpage-export-master/scripts/main.ts b/.obsidian/plugins/obsidian-webpage-export-master/scripts/main.ts deleted file mode 100644 index 6667904d..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/scripts/main.ts +++ /dev/null @@ -1,149 +0,0 @@ -// imports from obsidian API -import { Notice, Plugin, TFile, TFolder, requestUrl} from 'obsidian'; - -// modules that are part of the plugin -import { AssetHandler } from './html-generation/asset-handler'; -import { Settings, SettingsPage } from './settings/settings'; -import { HTMLExporter } from './exporter'; -import { Path } from './utils/path'; -import { ExportLog } from './html-generation/render-log'; -import { ExportModal } from './settings/export-modal'; -import { MarkdownRendererAPI } from './render-api'; - -export default class HTMLExportPlugin extends Plugin -{ - static plugin: HTMLExportPlugin; - static updateInfo: {updateAvailable: boolean, latestVersion: string, currentVersion: string, updateNote: string} = {updateAvailable: false, latestVersion: "0", currentVersion: "0", updateNote: ""}; - static pluginVersion: string = "0.0.0"; - public api = MarkdownRendererAPI; - public settings = Settings; - public assetHandler = AssetHandler; - public Path = Path; - - public async exportDocker() { - await HTMLExporter.export(true, undefined, new Path("/output")); - } - - async onload() - { - console.log("Loading webpage-html-export plugin"); - HTMLExportPlugin.plugin = this; - this.checkForUpdates(); - HTMLExportPlugin.pluginVersion = this.manifest.version; - - // @ts-ignore - window.WebpageHTMLExport = this; - - this.addSettingTab(new SettingsPage(this)); - await SettingsPage.loadSettings(); - await AssetHandler.initialize(); - - this.addRibbonIcon("folder-up", "Export Vault to HTML", () => - { - HTMLExporter.export(false); - }); - - // register callback for file rename so we can update the saved files to export - this.registerEvent(this.app.vault.on("rename", SettingsPage.renameFile)); - - this.addCommand({ - id: 'export-html-vault', - name: 'Export using previous settings', - callback: () => - { - HTMLExporter.export(true); - } - }); - - this.addCommand({ - id: 'export-html-current', - name: 'Export only current file using previous settings', - callback: () => - { - let file = this.app.workspace.getActiveFile(); - - if (!file) - { - new Notice("No file is currently open!", 5000); - return; - } - - HTMLExporter.export(true, [file]); - } - }); - - this.addCommand({ - id: 'export-html-setting', - name: 'Set html export settings', - callback: () => - { - HTMLExporter.export(false); - } - }); - - this.registerEvent( - this.app.workspace.on("file-menu", (menu, file) => - { - menu.addItem((item) => - { - item - .setTitle("Export as HTML") - .setIcon("download") - .setSection("export") - .onClick(() => - { - ExportModal.title = `Export ${file.name} as HTML`; - if(file instanceof TFile) - { - HTMLExporter.export(false, [file]); - } - else if(file instanceof TFolder) - { - let filesInFolder = this.app.vault.getFiles().filter((f) => new Path(f.path).directory.asString.startsWith(file.path)); - HTMLExporter.export(false, filesInFolder); - } - else - { - ExportLog.error("File is not a TFile or TFolder! Invalid type: " + typeof file + ""); - new Notice("File is not a File or Folder! Invalid type: " + typeof file + "", 5000); - } - }); - }); - }) - ); - } - - async checkForUpdates(): Promise<{updateAvailable: boolean, latestVersion: string, currentVersion: string, updateNote: string}> - { - let currentVersion = this.manifest.version; - - try - { - let url = "https://raw.githubusercontent.com/KosmosisDire/obsidian-webpage-export/master/manifest.json?cache=" + Date.now() + ""; - if (this.manifest.version.endsWith("b")) url = "https://raw.githubusercontent.com/KosmosisDire/obsidian-webpage-export/master/manifest-beta.json?cache=" + Date.now() + ""; - let manifestResp = await requestUrl(url); - if (manifestResp.status != 200) throw new Error("Could not fetch manifest"); - let manifest = manifestResp.json; - let latestVersion = manifest.version ?? currentVersion; - let updateAvailable = currentVersion < latestVersion; - let updateNote = manifest.updateNote ?? ""; - - HTMLExportPlugin.updateInfo = {updateAvailable: updateAvailable, latestVersion: latestVersion, currentVersion: currentVersion, updateNote: updateNote}; - - if(updateAvailable) ExportLog.log("Update available: " + latestVersion + " (current: " + currentVersion + ")"); - - return HTMLExportPlugin.updateInfo; - } - catch - { - ExportLog.log("Could not check for update"); - HTMLExportPlugin.updateInfo = {updateAvailable: false, latestVersion: currentVersion, currentVersion: currentVersion, updateNote: ""}; - return HTMLExportPlugin.updateInfo; - } - } - - onunload() - { - ExportLog.log('unloading webpage-html-export plugin'); - } -} diff --git a/.obsidian/plugins/obsidian-webpage-export-master/scripts/objects/file-picker.ts b/.obsidian/plugins/obsidian-webpage-export-master/scripts/objects/file-picker.ts deleted file mode 100644 index ba3bd134..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/scripts/objects/file-picker.ts +++ /dev/null @@ -1,296 +0,0 @@ -import { TAbstractFile, TFile, TFolder } from "obsidian"; -import { FileTree, FileTreeItem } from "./file-tree"; -import { Path } from "scripts/utils/path"; -import { Website } from "./website"; -import { MarkdownRendererAPI } from "scripts/render-api"; - -export class FilePickerTree extends FileTree -{ - public children: FilePickerTreeItem[] = []; - public selectAllItem: FilePickerTreeItem | undefined; - - public constructor(files: TFile[], keepOriginalExtensions: boolean = false, sort = true) - { - super(files, keepOriginalExtensions, sort); - } - - protected override async populateTree(): Promise - { - - for (let file of this.files) - { - let pathSections: TAbstractFile[] = []; - - let parentFile: TAbstractFile = file; - while (parentFile != undefined) - { - pathSections.push(parentFile); - // @ts-ignore - parentFile = parentFile.parent; - } - - pathSections.reverse(); - - let parent: FilePickerTreeItem | FilePickerTree = this; - for (let i = 1; i < pathSections.length; i++) - { - let section = pathSections[i]; - let isFolder = section instanceof TFolder; - - // make sure this section hasn't already been added - let child = parent.children.find(sibling => sibling.title == section.name && sibling.isFolder == isFolder && sibling.depth == i) as FilePickerTreeItem | undefined; - - if (child == undefined) - { - child = new FilePickerTreeItem(this, parent, i); - child.title = section.name; - child.isFolder = isFolder; - - if(child.isFolder) - { - child.href = section.path; - child.itemClass = "mod-tree-folder" - } - else - { - child.file = file; - child.itemClass = "mod-tree-file" - } - - parent.children.push(child); - } - parent = child; - } - - if (parent instanceof FilePickerTreeItem) - { - let titleInfo = await Website.getTitleAndIcon(file, true); - let path = new Path(file.path).makeUnixStyle(); - - if (file instanceof TFolder) path.makeForceFolder(); - else - { - parent.originalExtension = path.extensionName; - if(!this.keepOriginalExtensions && MarkdownRendererAPI.isConvertable(path.extensionName)) path.setExtension("html"); - } - parent.href = path.asString; - parent.title = path.basename == "." ? "" : titleInfo.title; - } - } - - if (this.sort) - { - this.sortAlphabetically(); - this.sortByIsFolder(); - } - } - - public async generateTree(container: HTMLElement): Promise - { - await super.generateTree(container); - - // add a select all button at the top - let selectAllButton = new FilePickerTreeItem(this, this, 0); - selectAllButton.title = "Select All"; - selectAllButton.itemClass = "mod-tree-control"; - let itemEl = await selectAllButton.generateItemHTML(container); - - // remove all event listeners from the select all button - let oldItemEl = itemEl; - itemEl = itemEl.cloneNode(true) as HTMLDivElement; - selectAllButton.checkbox = itemEl.querySelector("input") as HTMLInputElement; - selectAllButton.itemEl = itemEl; - selectAllButton.childContainer = itemEl.querySelector(".tree-item-children") as HTMLDivElement; - - container.prepend(itemEl); - - oldItemEl.remove(); - - - let localThis = this; - function selectAll() - { - let checked = selectAllButton.checkbox.checked; - selectAllButton.check(!checked); - localThis.forAllChildren((child) => child.check(!checked)); - } - - selectAllButton.checkbox.addEventListener("click", (event) => - { - selectAllButton.checkbox.checked = !selectAllButton.checkbox.checked; - selectAll(); - event.stopPropagation(); - }); - - selectAllButton.itemEl.addEventListener("click", () => - { - selectAll(); - }); - - this.selectAllItem = selectAllButton; - } - - public getSelectedFiles(): TFile[] - { - let selectedFiles: TFile[] = []; - - this.forAllChildren((child) => - { - if(child.checked && !child.isFolder) selectedFiles.push(child.file); - }); - - return selectedFiles; - } - - public getSelectedFilesSavePaths(): string[] - { - let selectedFiles: string[] = []; - - if (this.selectAllItem?.checked) - { - selectedFiles = ["all"]; - return selectedFiles; - } - - this.forAllChildren((child) => - { - selectedFiles.push(...child.getSelectedFilesSavePaths()); - }, false); - - - return selectedFiles; - } - - public setSelectedFiles(files: string[]) - { - if (files.includes("all")) - { - this.selectAllItem?.check(true, false, true); - this.forAllChildren((child) => child.check(true)); - return; - } - - this.forAllChildren((child) => - { - if(files.includes(child.href ?? "")) - { - child.check(true); - } - }); - - this.evaluateFolderChecks(); - } - - public forAllChildren(func: (child: FilePickerTreeItem) => void, recursive?: boolean): void { - super.forAllChildren(func, recursive); - } - - public evaluateFolderChecks() - { - // if all a folder's children are checked, check the folder, otherwise uncheck it - this.forAllChildren((child) => - { - if(child.isFolder) - { - let uncheckedChildren = child?.itemEl?.querySelectorAll(".mod-tree-file .file-checkbox:not(.checked)"); - - if (!child.checked && uncheckedChildren?.length == 0) - { - child.check(true, false, true); - } - else if (uncheckedChildren?.length ?? 0 > 0) - { - child.check(false, false, true); - } - } - }); - - // if all folders are checked, check the select all button, otherwise uncheck it - if (this.children.reduce((acc, child) => acc && child.checked, true)) - { - this.selectAllItem?.check(true, false, true); - } - else - { - this.selectAllItem?.check(false, false, true); - } - } -} - -export class FilePickerTreeItem extends FileTreeItem -{ - public file: TFile; - public checkbox: HTMLInputElement; - public tree: FilePickerTree; - public checked: boolean = false; - - protected async createItemContents(container: HTMLElement): Promise - { - let linkEl = await super.createItemContents(container); - - this.checkbox = linkEl.createEl("input"); - linkEl.prepend(this.checkbox); - this.checkbox.classList.add("file-checkbox"); - this.checkbox.setAttribute("type", "checkbox"); - this.checkbox.addEventListener("click", (event) => - { - event.stopPropagation(); - - this.check(this.checkbox.checked, false); - this.tree.evaluateFolderChecks(); - }); - - let localThis = this; - linkEl?.addEventListener("click", function(event) - { - if(localThis.isFolder) localThis.toggleCollapse(); - else localThis.toggle(true); - }); - - return linkEl; - } - - public check(checked: boolean, evaluate: boolean = false, skipChildren: boolean = false) - { - this.checked = checked; - this.checkbox.checked = checked; - this.checkbox.classList.toggle("checked", checked); - if (!skipChildren) this.checkAllChildren(checked); - if(evaluate) this.tree.evaluateFolderChecks(); - } - - public toggle(evaluate = false) - { - this.check(!this.checked, evaluate); - } - - public checkAllChildren(checked: boolean) - { - this.forAllChildren((child) => child.check(checked)); - } - - public forAllChildren(func: (child: FilePickerTreeItem) => void, recursive?: boolean): void - { - super.forAllChildren(func, recursive); - } - - public getSelectedFilesSavePaths(): string[] - { - let selectedFiles: string[] = []; - - if (this.checked) - { - selectedFiles.push(this.href ?? ""); - } - else if (this.isFolder) - { - this.forAllChildren((child) => - { - selectedFiles.push(...child.getSelectedFilesSavePaths()); - }, false); - } - - return selectedFiles; - } - -} diff --git a/.obsidian/plugins/obsidian-webpage-export-master/scripts/objects/file-tree.ts b/.obsidian/plugins/obsidian-webpage-export-master/scripts/objects/file-tree.ts deleted file mode 100644 index 33b2cd9f..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/scripts/objects/file-tree.ts +++ /dev/null @@ -1,167 +0,0 @@ -import { TAbstractFile, TFile, TFolder } from "obsidian"; -import { Tree, TreeItem } from "./tree"; -import { Path } from "scripts/utils/path"; -import { Website } from "./website"; -import { MarkdownRendererAPI } from "scripts/render-api"; - -export class FileTree extends Tree -{ - public children: FileTreeItem[] = []; - public showFileExtentionTags: boolean = true; - /** File extentions matching this will not show extention tags */ - public hideFileExtentionTags: string[] = []; - - public files: TFile[]; - public keepOriginalExtensions: boolean; - public sort: boolean; - - public constructor(files: TFile[], keepOriginalExtensions: boolean = false, sort = true) - { - super(); - this.files = files; - this.keepOriginalExtensions = keepOriginalExtensions; - this.sort = sort; - this.renderMarkdownTitles = true; - } - - protected async populateTree() - { - for (let file of this.files) - { - let pathSections: TAbstractFile[] = []; - - let parentFile: TAbstractFile = file; - while (parentFile != undefined) - { - pathSections.push(parentFile); - // @ts-ignore - parentFile = parentFile.parent; - } - - pathSections.reverse(); - - let parent: FileTreeItem | FileTree = this; - for (let i = 1; i < pathSections.length; i++) - { - let section = pathSections[i]; - let isFolder = section instanceof TFolder; - - // make sure this section hasn't already been added - let child = parent.children.find(sibling => sibling.title == section.name && sibling.isFolder == isFolder && sibling.depth == i) as FileTreeItem | undefined; - - if (child == undefined) - { - child = new FileTreeItem(this, parent, i); - child.title = section.name; - child.isFolder = isFolder; - - if(child.isFolder) - { - child.itemClass = "mod-tree-folder nav-folder"; - let titleInfo = await Website.getTitleAndIcon(section); - child.icon = titleInfo.icon; - } - else child.itemClass = "mod-tree-file nav-file" - - parent.children.push(child); - } - - parent = child; - } - - if (parent instanceof FileTreeItem) - { - let titleInfo = await Website.getTitleAndIcon(file); - let path = new Path(file.path).makeUnixStyle(); - - if (file instanceof TFolder) path.makeForceFolder(); - else - { - if (path.asString.endsWith(".excalidraw.md")) path.setExtension("drawing"); - parent.originalExtension = path.extensionName; - if(!this.keepOriginalExtensions && MarkdownRendererAPI.isConvertable(path.extensionName)) path.setExtension("html"); - } - - parent.href = path.asString; - parent.title = path.basename == "." ? "" : titleInfo.title; - parent.icon = titleInfo.icon || ""; - } - } - - if (this.sort) - { - this.sortAlphabetically(); - this.sortByIsFolder(); - } - } - - public override async generateTree(container: HTMLElement): Promise - { - await this.populateTree(); - await super.generateTree(container); - } - - public sortByIsFolder(reverse: boolean = false) - { - this.children.sort((a, b) => reverse ? (a.isFolder && !b.isFolder ? -1 : 1) : (a.isFolder && !b.isFolder ? -1 : 1)); - for (let child of this.children) - { - child.sortByIsFolder(reverse); - } - } - - public forAllChildren(func: (child: FileTreeItem) => void, recursive: boolean = true) - { - for (let child of this.children) - { - func(child); - if (recursive) child.forAllChildren(func); - } - } -} - -export class FileTreeItem extends TreeItem -{ - public tree: FileTree; - public children: FileTreeItem[] = []; - public parent: FileTreeItem | FileTree; - public isFolder = false; - public originalExtension: string = ""; - - public forAllChildren(func: (child: FileTreeItem) => void, recursive: boolean = true) - { - super.forAllChildren(func, recursive); - } - - public sortByIsFolder(reverse: boolean = false) - { - this.children.sort((a, b) => reverse ? (a.isFolder && !b.isFolder ? -1 : 1) : (a.isFolder && !b.isFolder ? -1 : 1)); - for (let child of this.children) - { - child.sortByIsFolder(reverse); - } - } - - protected override async createItemContents(container: HTMLElement): Promise - { - let containerEl = await super.createItemContents(container); - if (this.isFolder) containerEl.addClass("nav-folder-title"); - else containerEl.addClass("nav-file-title"); - - if (!this.isFolder && this.tree.showFileExtentionTags && !this.tree.hideFileExtentionTags.contains(this.originalExtension)) - { - let tag = containerEl.createDiv({ cls: "nav-file-tag" }); - tag.textContent = this.originalExtension.toUpperCase(); - } - - return containerEl; - } - - protected override async createItemTitle(container: HTMLElement): Promise - { - let titleEl = await super.createItemTitle(container); - if (this.isFolder) titleEl.addClass("nav-folder-title-content", "tree-item-inner"); - else titleEl.addClass("nav-file-title-content", "tree-item-inner"); - return titleEl; - } -} diff --git a/.obsidian/plugins/obsidian-webpage-export-master/scripts/objects/graph-view.ts b/.obsidian/plugins/obsidian-webpage-export-master/scripts/objects/graph-view.ts deleted file mode 100644 index 5be47f4c..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/scripts/objects/graph-view.ts +++ /dev/null @@ -1,129 +0,0 @@ -import { TFile } from "obsidian"; -import { Path } from "scripts/utils/path"; -import { Settings } from "scripts/settings/settings"; -import { Website } from "./website"; -import { GraphViewOptions, MarkdownWebpageRendererAPIOptions } from "scripts/api-options"; - -export class GraphView -{ - public nodeCount: number; - public linkCount: number; - public radii: number[]; - public labels: string[]; - public paths: string[]; - public linkSources: number[]; - public linkTargets: number[]; - - public graphOptions: GraphViewOptions = new GraphViewOptions(); - private isInitialized: boolean = false; - - - static InOutQuadBlend(start: number, end: number, t: number): number - { - t /= 2; - let t2 = 2.0 * t * (1.0 - t) + 0.5; - t2 -= 0.5; - t2 *= 2.0; - return start + (end - start) * t2; - } - - public async init(files: TFile[], options: MarkdownWebpageRendererAPIOptions) - { - if (this.isInitialized) return; - - Object.assign(this.graphOptions, options.graphViewOptions); - - this.paths = files.map(f => f.path); - this.nodeCount = this.paths.length; - this.linkSources = []; - this.linkTargets = []; - this.labels = []; - this.radii = []; - - let linkCounts: number[] = []; - - for (let i = 0; i < this.nodeCount; i++) - { - linkCounts.push(0); - } - - let resolvedLinks = Object.entries(app.metadataCache.resolvedLinks); - let values = Array.from(resolvedLinks.values()); - let sources = values.map(v => v[0]); - let targets = values.map(v => v[1]); - - for (let source of this.paths) - { - let sourceIndex = sources.indexOf(source); - let file = files.find(f => f.path == source); - - if (file) - { - let titleInfo = await Website.getTitleAndIcon(file, true); - this.labels.push(titleInfo.title); - } - - if (sourceIndex != -1) - { - let target = targets[sourceIndex]; - - for (let link of Object.entries(target)) - { - if (link[0] == source) continue; - if (this.paths.includes(link[0])) - { - let path1 = source; - let path2 = link[0]; - - let index1 = this.paths.indexOf(path1); - let index2 = this.paths.indexOf(path2); - - if (index1 == -1 || index2 == -1) continue; - - this.linkSources.push(index1); - this.linkTargets.push(index2); - - linkCounts[index1] = (linkCounts[index1] ?? 0) + 1; - linkCounts[index2] = (linkCounts[index2] ?? 0) + 1; - } - } - } - } - - let maxLinks = Math.max(...linkCounts); - - this.radii = linkCounts.map(l => GraphView.InOutQuadBlend(this.graphOptions.minNodeRadius, this.graphOptions.maxNodeRadius, Math.min(l / (maxLinks * 0.8), 1.0))); - this.paths = this.paths.map(p => new Path(p).setExtension(".html").makeUnixStyle().makeWebStyle(options.webStylePaths).asString); - - this.linkCount = this.linkSources.length; - - this.isInitialized = true; - } - - public static generateGraphEl(container: HTMLElement): HTMLElement - { - let graphWrapper = container.createDiv(); - graphWrapper.classList.add("graph-view-wrapper"); - - let graphHeader = graphWrapper.createDiv(); - graphHeader.addClass("sidebar-section-header"); - graphHeader.innerText = "Interactive Graph"; - - let graphEl = graphWrapper.createDiv(); - graphEl.className = "graph-view-placeholder"; - graphEl.innerHTML = - ` -
-
- -
- ` - return graphWrapper; - } - - public getExportData(): string - { - if (!this.isInitialized) throw new Error("Graph not initialized"); - return `let graphData=\n${JSON.stringify(this)};`; - } -} diff --git a/.obsidian/plugins/obsidian-webpage-export-master/scripts/objects/outline-tree.ts b/.obsidian/plugins/obsidian-webpage-export-master/scripts/objects/outline-tree.ts deleted file mode 100644 index 3e6fb45f..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/scripts/objects/outline-tree.ts +++ /dev/null @@ -1,99 +0,0 @@ -import { TFile } from "obsidian"; -import { Tree, TreeItem } from "./tree"; -import { Webpage } from "./webpage"; - - -export class OutlineTree extends Tree -{ - public file: TFile; - public webpage: Webpage; - public children: OutlineTreeItem[]; - public minDepth: number = 1; - public depth: number = 0; - - private createTreeItem(heading: {heading: string, level: number, headingEl: HTMLElement}, parent: OutlineTreeItem | OutlineTree): OutlineTreeItem - { - let item = new OutlineTreeItem(this, parent, heading); - item.title = heading.heading; - return item; - } - - public constructor(webpage: Webpage, minDepth = 1) - { - super(); - - this.webpage = webpage; - this.file = webpage.source; - this.minDepth = minDepth; - - let headings = webpage.headings; - this.depth = Math.min(...headings.map(h => h.level)) - 1; - - let parent: OutlineTreeItem | OutlineTree = this; - for (let heading of headings) - { - if (heading.level < minDepth) continue; - - if (heading.level > parent.depth) - { - let child = this.createTreeItem(heading, parent); - parent.children.push(child); - if(heading.level == parent.depth + 1) parent = child; - } - else if (heading.level == parent.depth) - { - if(parent instanceof OutlineTreeItem) - { - let child = this.createTreeItem(heading, parent.parent); - parent.parent.children.push(child); - parent = child; - } - } - else if (heading.level < parent.depth) - { - if (parent instanceof OutlineTreeItem) - { - let levelChange = parent.depth - heading.level; - let backParent: OutlineTreeItem | OutlineTree = (parent.parent as OutlineTreeItem | OutlineTree) ?? parent; - for (let i = 0; i < levelChange; i++) - { - if (backParent instanceof OutlineTreeItem) backParent = (backParent.parent as OutlineTreeItem | OutlineTree) ?? backParent; - } - - let child = this.createTreeItem(heading, backParent); - backParent.children.push(child); - parent = child; - } - } - } - } -} - - -export class OutlineTreeItem extends TreeItem -{ - public children: OutlineTreeItem[] = []; - public parent: OutlineTreeItem | OutlineTree; - public heading: string; - - public constructor(tree: OutlineTree, parent: OutlineTreeItem | OutlineTree, heading: {heading: string, level: number, headingEl: HTMLElement}) - { - super(tree, parent, heading.level); - this.heading = heading.heading; - this.href = tree.webpage.relativePath + "#" + heading.headingEl.id; - } - - public forAllChildren(func: (child: OutlineTreeItem) => void, recursive: boolean = true) - { - super.forAllChildren(func, recursive); - } - - protected override async createItemContents(container: HTMLElement): Promise - { - let linkEl = await super.createItemContents(container); - linkEl?.setAttribute("heading-name", this.heading); - linkEl.classList.add("heading-link"); - - return linkEl; - } -} diff --git a/.obsidian/plugins/obsidian-webpage-export-master/scripts/objects/tree.ts b/.obsidian/plugins/obsidian-webpage-export-master/scripts/objects/tree.ts deleted file mode 100644 index c84937b5..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/scripts/objects/tree.ts +++ /dev/null @@ -1,345 +0,0 @@ -import { MarkdownRendererAPI } from "scripts/render-api"; -import { Path } from "scripts/utils/path"; - -export class Tree -{ - public children: TreeItem[] = []; - public minCollapsableDepth: number = 1; - public title: string = "Tree"; - public class: string = "mod-tree-none"; - public showNestingIndicator = true; - public minDepth: number = 1; - public generateWithItemsClosed: boolean = false; - public makeLinksWebStyle: boolean = false; - public renderMarkdownTitles: boolean = true; - public container: HTMLElement | undefined = undefined; - - protected async buildTreeRecursive(tree: TreeItem, container: HTMLElement, minDepth:number = 1, closeAllItems: boolean = false): Promise - { - tree.minCollapsableDepth = this.minCollapsableDepth; - let treeItem = await tree.generateItemHTML(container, closeAllItems); - - if(!tree.childContainer) return; - - for (let item of tree.children) - { - if(item.depth < minDepth) continue; - await this.buildTreeRecursive(item, tree.childContainer, minDepth, closeAllItems); - } - } - - //**Generate the raw tree with no extra containers or buttons*/ - public async generateTree(container: HTMLElement) - { - for (let item of this.children) - { - await this.buildTreeRecursive(item, container, this.minDepth, this.generateWithItemsClosed); - } - - this.forAllChildren((child) => - { - if (child.isCollapsed) child.setCollapse(true, false); - }); - } - - //**Generate a tree with a title and full tree collapse button*/ - public async generateTreeWithContainer(container: HTMLElement) - { - /* - - div.tree-container.mod-root.nav-folder - - div.tree-header - - span.sidebar-section-header - - button.collapse-tree-button - - svg - - div.tree-scroll-area.tree-item-children - - div.tree-item // invisible first item - - div.tree-item - - div.tree-item-contents - - div.tree-item-icon - - svg - - a.internal-link - - span.tree-item-title - - div.tree-item-children - */ - - this.container = container; - - let treeContainerEl = container.createDiv(); - let treeHeaderEl = container.createDiv(); - let sectionHeaderEl = container.createEl('span'); - let collapseAllEl = container.createEl('button'); - let treeScrollAreaEl = container.createDiv(); - - treeContainerEl.classList.add('tree-container', "mod-root", "nav-folder", "tree-item", this.class); - treeHeaderEl.classList.add("tree-header"); - sectionHeaderEl.classList.add("sidebar-section-header"); - collapseAllEl.classList.add("clickable-icon", "collapse-tree-button"); - collapseAllEl.setAttribute("aria-label", "Collapse All"); - collapseAllEl.innerHTML = ""; - treeScrollAreaEl.classList.add("tree-scroll-area", "tree-item-children", "nav-folder-children"); - let invisFirst = treeScrollAreaEl.createDiv("tree-item mod-tree-folder nav-folder mod-collapsible is-collapsed"); // invisible first item - invisFirst.style.display = "none"; - - if (this.generateWithItemsClosed) collapseAllEl.classList.add("is-collapsed"); - if (this.showNestingIndicator) treeContainerEl.classList.add("mod-nav-indicator"); - - treeContainerEl.setAttribute("data-depth", "0"); - sectionHeaderEl.innerText = this.title; - - treeContainerEl.appendChild(treeHeaderEl); - treeContainerEl.appendChild(treeScrollAreaEl); - treeHeaderEl.appendChild(sectionHeaderEl); - treeHeaderEl.appendChild(collapseAllEl); - - await this.generateTree(treeScrollAreaEl); - } - - public sortAlphabetically(reverse: boolean = false) - { - this.children.sort((a, b) => reverse ? b.title.localeCompare(a.title, undefined, { numeric: true }) : a.title.localeCompare(b.title, undefined, { numeric: true })); - for (let child of this.children) - { - child.sortAlphabetically(); - } - } - - public forAllChildren(func: (child: TreeItem) => void, recursive: boolean = true) - { - for (let child of this.children) - { - func(child); - if (recursive) child.forAllChildren(func); - } - } -} - -export class TreeItem -{ - public tree: Tree; - public children: TreeItem[] = []; - public parent: TreeItem | Tree; - public depth: number = 0; - public itemClass: string = ""; - public title: string = ""; - public icon: string = ""; - public href: string | undefined = undefined; - public minCollapsableDepth: number = 1; - public isCollapsed: boolean = false; - public childContainer: HTMLDivElement | undefined = undefined; - - public itemEl: HTMLDivElement | undefined = undefined; - - public constructor(tree: Tree, parent: TreeItem | Tree, depth: number) - { - this.tree = tree; - this.parent = parent; - this.depth = depth; - } - - public async generateItemHTML(container: HTMLElement, startClosed: boolean = true): Promise - { - - /* - - div.tree-item-wrapper - - div.a.tree-link - - .tree-item-contents - - div.tree-item-icon - - svg - - span.tree-item-title - - div.tree-item-children - */ - - if(startClosed) this.isCollapsed = true; - this.itemEl = this.createItemWrapper(container); - await this.createItemLink(this.itemEl); - this.createItemChildren(this.itemEl); - - return this.itemEl; - } - - public forAllChildren(func: (child: TreeItem) => void, recursive: boolean = true) - { - for (let child of this.children) - { - func(child); - if (recursive) child.forAllChildren(func); - } - } - - public async setCollapse(collapsed: boolean, animate = true) - { - if (!this.isCollapsible()) return; - if (!this.itemEl || !this.itemEl.classList.contains("mod-collapsible")) return; - - let children = this.itemEl.querySelector(".tree-item-children") as HTMLElement; - - if (children == null) return; - - if (collapsed) - { - this.itemEl.classList.add("is-collapsed"); - if(animate) this.slideUp(children, 100); - else children.style.display = "none"; - } - else - { - this.itemEl.classList.remove("is-collapsed"); - if(animate) this.slideDown(children, 100); - else children.style.removeProperty("display"); - } - - this.isCollapsed = collapsed; - } - - public toggleCollapse() - { - if (!this.itemEl) return; - this.setCollapse(!this.itemEl.classList.contains("is-collapsed")); - } - - public sortAlphabetically(reverse: boolean = false) - { - this.children.sort((a, b) => reverse ? b.title.localeCompare(a.title, undefined, { numeric: true }) : a.title.localeCompare(b.title, undefined, { numeric: true })); - for (let child of this.children) - { - child.sortAlphabetically(); - } - } - - protected isCollapsible(): boolean - { - return this.children.length != 0 && this.depth >= this.minCollapsableDepth; - } - - protected createItemWrapper(container: HTMLElement): HTMLDivElement - { - let itemEl = container.createDiv(); - itemEl.classList.add("tree-item"); - if (this.itemClass.trim() != "") itemEl.classList.add(...this.itemClass.split(" ")); - itemEl.setAttribute("data-depth", this.depth.toString()); - if (this.isCollapsible()) itemEl.classList.add("mod-collapsible"); - return itemEl; - } - - protected async createItemContents(container: HTMLElement): Promise - { - let itemContentsEl = container.createDiv("tree-item-contents"); - - if (this.isCollapsible()) - { - this.createItemCollapseIcon(itemContentsEl); - if (this.isCollapsed) - { - this.itemEl?.classList.add("is-collapsed"); - } - } - - this.createItemIcon(itemContentsEl); - await this.createItemTitle(itemContentsEl); - - return itemContentsEl; - } - - protected async createItemLink(container: HTMLElement): Promise<{ linkEl: HTMLElement, contentEl: HTMLSpanElement }> - { - if (this.tree.makeLinksWebStyle && this.href) this.href = Path.toWebStyle(this.href); - let itemLinkEl = container.createEl(this.href ? "a" : "div", { cls: "tree-link" }); - if (this.href) itemLinkEl.setAttribute("href", this.href); - - let itemContentEl = await this.createItemContents(itemLinkEl); - - return { linkEl: itemLinkEl, contentEl: itemContentEl }; - } - - protected createItemCollapseIcon(container: HTMLElement): HTMLElement | undefined - { - const arrowIcon = ``; - - let itemIconEl = container.createDiv("collapse-icon"); - itemIconEl.innerHTML = arrowIcon; - return itemIconEl; - } - - protected async createItemTitle(container: HTMLElement): Promise - { - let titleEl = container.createEl("span", { cls: "tree-item-title" }); - if (this.tree.renderMarkdownTitles) MarkdownRendererAPI.renderMarkdownSimpleEl(this.title, titleEl); - else titleEl.innerText = this.title; - return titleEl; - } - - protected createItemIcon(container: HTMLElement): HTMLDivElement | undefined - { - if (this.icon.trim() == "") return undefined; - - let itemIconEl = container.createDiv("tree-item-icon"); - - if (this.tree.renderMarkdownTitles) MarkdownRendererAPI.renderMarkdownSimpleEl(this.icon, itemIconEl); - else itemIconEl.innerText = this.icon; - - return itemIconEl; - } - - protected createItemChildren(container: HTMLElement): HTMLDivElement - { - this.childContainer = container.createDiv("tree-item-children nav-folder-children"); - return this.childContainer; - } - - - protected slideUp(target: HTMLElement, duration=500) - { - target.style.transitionProperty = 'height, margin, padding'; - target.style.transitionDuration = duration + 'ms'; - target.style.boxSizing = 'border-box'; - target.style.height = target.offsetHeight + 'px'; - target.offsetHeight; - target.style.overflow = 'hidden'; - target.style.height = "0"; - target.style.paddingTop = "0"; - target.style.paddingBottom = "0"; - target.style.marginTop = "0"; - target.style.marginBottom = "0"; - window.setTimeout(async () => { - target.style.display = 'none'; - target.style.removeProperty('height'); - target.style.removeProperty('padding-top'); - target.style.removeProperty('padding-bottom'); - target.style.removeProperty('margin-top'); - target.style.removeProperty('margin-bottom'); - target.style.removeProperty('overflow'); - target.style.removeProperty('transition-duration'); - target.style.removeProperty('transition-property'); - }, duration); - } - - protected slideDown(target: HTMLElement, duration=500) - { - target.style.removeProperty('display'); - let display = window.getComputedStyle(target).display; - if (display === 'none') display = 'block'; - target.style.display = display; - let height = target.offsetHeight; - target.style.overflow = 'hidden'; - target.style.height = "0"; - target.style.paddingTop = "0"; - target.style.paddingBottom = "0"; - target.style.marginTop = "0"; - target.style.marginBottom = "0"; - target.offsetHeight; - target.style.boxSizing = 'border-box'; - target.style.transitionProperty = "height, margin, padding"; - target.style.transitionDuration = duration + 'ms'; - target.style.height = height + 'px'; - target.style.removeProperty('padding-top'); - target.style.removeProperty('padding-bottom'); - target.style.removeProperty('margin-top'); - target.style.removeProperty('margin-bottom'); - window.setTimeout(async () => { - target.style.removeProperty('height'); - target.style.removeProperty('overflow'); - target.style.removeProperty('transition-duration'); - target.style.removeProperty('transition-property'); - }, duration); - } -} diff --git a/.obsidian/plugins/obsidian-webpage-export-master/scripts/objects/webpage.ts b/.obsidian/plugins/obsidian-webpage-export-master/scripts/objects/webpage.ts deleted file mode 100644 index 2bdcf4f8..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/scripts/objects/webpage.ts +++ /dev/null @@ -1,797 +0,0 @@ -import { FrontMatterCache, TFile } from "obsidian"; -import { Path } from "scripts/utils/path"; -import { Downloadable } from "scripts/utils/downloadable"; -import { OutlineTree } from "./outline-tree"; -import { GraphView } from "./graph-view"; -import { Website } from "./website"; -import { AssetHandler } from "scripts/html-generation/asset-handler"; -import { HTMLGeneration } from "scripts/html-generation/html-generation-helpers"; -import { Utils } from "scripts/utils/utils"; -import { ExportLog } from "scripts/html-generation/render-log"; -import { MarkdownRendererAPI } from "scripts/render-api"; -import { MarkdownWebpageRendererAPIOptions } from "scripts/api-options"; -const { minify } = require('html-minifier-terser'); - -export class Webpage extends Downloadable -{ - /** - * The original file this webpage was exported from - */ - public source: TFile; - public website: Website | undefined; - - /** - * The document containing this webpage's HTML - */ - public document?: Document; - - /** - * The absolute path to the ROOT FOLDER of the export - */ - public destinationFolder: Path; - - /** - * The external files that need to be downloaded for this file to work NOT including the file itself. - */ - public dependencies: Downloadable[] = []; - - public viewType: string = "markdown"; - - public isConvertable: boolean = false; - - public exportOptions: MarkdownWebpageRendererAPIOptions; - - public title: string = ""; - public icon: string = ""; - public titleInfo: {title: string, icon: string, isDefaultTitle: boolean, isDefaultIcon: boolean} = {title: "", icon: "", isDefaultTitle: true, isDefaultIcon: true}; - - /** - * @param file The original markdown file to export - * @param destination The absolute path to the FOLDER we are exporting to - * @param name The name of the file being exported without the extension - * @param website The website this file is part of - * @param options The options for exporting this file - */ - constructor(file: TFile, destination?: Path, name?: string, website?: Website, options?: MarkdownWebpageRendererAPIOptions) - { - if(destination && (!destination.isAbsolute || !destination.isDirectory)) throw new Error("destination must be an absolute directory path: " + destination?.asString); - - super(file.basename, "", Path.emptyPath); - - options = Object.assign(new MarkdownWebpageRendererAPIOptions(), options); - - let isConvertable = MarkdownRendererAPI.isConvertable(file.extension); - this.filename = name ?? file.basename; - this.filename += isConvertable ? ".html" : "." + file.extension; - this.isConvertable = isConvertable; - this.exportOptions = options; - this.source = file; - this.website = website ?? undefined; - this.destinationFolder = destination ?? Path.vaultPath.joinString("Export"); - - if (this.isConvertable) this.document = document.implementation.createHTMLDocument(this.source.basename); - - let sourcePath = new Path(file.path); - this.relativeDirectory = sourcePath.directory; - - if (this.exportOptions.flattenExportPaths) - this.relativeDirectory = Path.emptyPath; - - if (this.exportOptions.webStylePaths) - { - this.filename = Path.toWebStyle(this.filename); - this.relativeDirectory.makeWebStyle(); - } - } - - /** - * The HTML string for the file - */ - get html(): string - { - let htmlString = " " + this.document?.documentElement.outerHTML; - return htmlString; - } - - /** - * The element that contains the content of the document, aka the markdown-preview-view or view-content - */ - get viewElement(): HTMLElement - { - if (!this.document) throw new Error("Document is not defined"); - - - let viewContent = this.document.querySelector(".view-content") as HTMLElement; - let markdownPreview = this.document.querySelector(".markdown-preview-view") as HTMLElement; - - if (!viewContent && !markdownPreview) - { - throw new Error("No content element found"); - } - - if (this.viewType != "markdown") - return viewContent ?? markdownPreview; - - return markdownPreview ?? viewContent; - } - - /** - * The element that determines the size of the document, aka the markdown-preview-sizer - */ - get sizerElement(): HTMLDivElement - { - if (this.viewType != "markdown") return this.document?.querySelector(".view-content")?.firstChild as HTMLDivElement; - - return this.document?.querySelector(".markdown-preview-sizer") as HTMLDivElement; - } - - /** - * The absolute path that the file will be saved to - */ - get exportPath(): Path - { - return this.destinationFolder?.join(this.relativePath) ?? Path.vaultPath.join(this.relativePath); - } - - /** - * The relative path from exportPath to rootFolder - */ - get pathToRoot(): Path - { - return Path.getRelativePath(this.relativePath, new Path(this.relativePath.workingDirectory), true).makeUnixStyle(); - } - - get tags(): string[] - { - let tagCaches = app.metadataCache.getFileCache(this.source)?.tags?.values(); - if (tagCaches) - { - let tags = Array.from(tagCaches).map((tag) => tag.tag); - return tags; - } - - return []; - } - - get headings(): {heading: string, level: number, headingEl: HTMLElement}[] - { - let headers: {heading: string, level: number, headingEl: HTMLElement}[] = []; - if (this.document) - { - this.document.querySelectorAll(".heading").forEach((headerEl: HTMLElement) => - { - let level = parseInt(headerEl.tagName[1]); - if (headerEl.closest("[class^='block-language-']") || headerEl.closest(".markdown-embed.inline-embed")) level += 6; - let heading = headerEl.getAttribute("data-heading") ?? headerEl.innerText ?? ""; - headers.push({heading, level, headingEl: headerEl}); - }); - } - - return headers; - } - - get aliases(): string[] - { - let aliases = this.frontmatter?.aliases ?? []; - return aliases; - } - - get description(): string - { - return this.frontmatter["description"] || this.frontmatter["summary"] || ""; - } - - get author(): string - { - return this.frontmatter["author"] || this.exportOptions.authorName || ""; - } - - get fullURL(): string - { - let url = Path.joinStrings(this.exportOptions.siteURL ?? "", this.relativePath.asString).makeUnixStyle().asString; - return url; - } - - get metadataImageURL(): string | undefined - { - let mediaPathStr = this.viewElement.querySelector("img")?.getAttribute("src") ?? ""; - let hasMedia = mediaPathStr.length > 0; - if (!hasMedia) return undefined; - - if (!mediaPathStr.startsWith("http") && !mediaPathStr.startsWith("data:")) - { - let mediaPath = Path.joinStrings(this.exportOptions.siteURL ?? "", mediaPathStr); - mediaPathStr = mediaPath.asString; - } - - return mediaPathStr; - } - - get frontmatter(): FrontMatterCache - { - let frontmatter = app.metadataCache.getFileCache(this.source)?.frontmatter ?? {}; - return frontmatter; - } - - public getCompatibilityContent(): string - { - let oldContent = this.sizerElement.outerHTML; - let compatContent = this.sizerElement; - - compatContent.querySelectorAll("script, style, .collapse-indicator, .callout-icon, .icon, a.tag").forEach((script) => script.remove()); - - function moveChildrenOut(element: HTMLElement) - { - let children = Array.from(element.children); - element.parentElement?.append(...children); - element.remove(); - } - - let headingTreeElements = Array.from(compatContent.querySelectorAll(".heading-wrapper")); - headingTreeElements.forEach(moveChildrenOut); - headingTreeElements = Array.from(compatContent.querySelectorAll(".heading-children")); - headingTreeElements.forEach(moveChildrenOut); - let lowDivs = Array.from(compatContent.children).filter((el) => el.tagName == "DIV" && el.childElementCount == 1); - lowDivs.forEach(moveChildrenOut); - - let all = Array.from(compatContent.querySelectorAll("*")); - all.forEach((el: HTMLElement) => - { - // give default var values - let fillDefault = el.tagName == "text" ? "#181818" : "white"; - el.style.fill = el.style.fill.replace(/var\(([\w -]+)\)/g, `var($1, ${fillDefault})`); - el.style.stroke = el.style.stroke.replace(/var\(([\w -]+)\)/g, "var($1, #181818)"); - el.style.backgroundColor = el.style.backgroundColor.replace(/var\(([\w -]+)\)/g, "var($1, white)"); - el.style.color = el.style.color.replace(/var\(([\w -]+)\)/g, "var($1, #181818)"); - - el.removeAttribute("id"); - el.removeAttribute("class"); - el.removeAttribute("font-family"); - }); - - let result = compatContent.innerHTML; - compatContent.innerHTML = oldContent; - - result = result.replaceAll("<", " <"); - - return result; - } - - public async create(): Promise - { - this.titleInfo = await Website.getTitleAndIcon(this.source); - this.title = this.titleInfo.title; - this.icon = this.titleInfo.icon; - - - if (!this.isConvertable) - { - this.content = await new Path(this.source.path).readFileBuffer() ?? ""; - this.modifiedTime = this.source.stat.mtime; - return this; - } - - if (!this.document) return this; - - let webpageWithContent = await this.populateDocument(); - if(!webpageWithContent) - { - if (!MarkdownRendererAPI.checkCancelled()) ExportLog.error(this.source, "Failed to create webpage"); - return; - } - - if (this.exportOptions.addHeadTag) - await this.addHead(); - - if (this.exportOptions.addTitle) - await this.addTitle(); - - if (this.exportOptions.addSidebars) - { - let innerContent = this.document.body.innerHTML; - this.document.body.innerHTML = ""; - let layout = this.generateWebpageLayout(innerContent); - this.document.body.appendChild(layout.container); - let rightSidebar = layout.right; - let leftSidebar = layout.left; - - // inject graph view - if (this.exportOptions.addGraphView) - { - GraphView.generateGraphEl(rightSidebar); - } - - // inject outline - if (this.exportOptions.addOutline) - { - let headerTree = new OutlineTree(this, 1); - headerTree.class = "outline-tree"; - headerTree.title = "Table Of Contents"; - headerTree.showNestingIndicator = false; - headerTree.generateWithItemsClosed = this.exportOptions.startOutlineCollapsed === true; - headerTree.minCollapsableDepth = this.exportOptions.minOutlineCollapsibleLevel ?? 2; - await headerTree.generateTreeWithContainer(rightSidebar); - } - - // inject darkmode toggle - if (this.exportOptions.addThemeToggle) - { - HTMLGeneration.createThemeToggle(layout.leftBar); - } - - // inject search bar - // TODO: don't hardcode searchbar html - if (this.exportOptions.addSearch) - { - let searchbarHTML = `
`; - leftSidebar.createDiv().outerHTML = searchbarHTML; - } - - // inject file tree - if (this.website && this.exportOptions.addFileNavigation) - { - leftSidebar.createDiv().outerHTML = this.website.fileTreeAsset.getHTML(this.exportOptions); - - // if the file will be opened locally, un-collapse the tree containing this file - if (this.exportOptions.openNavFileLocation) - { - let sidebar = leftSidebar.querySelector(".file-tree"); - let unixPath = this.relativePath.copy.makeUnixStyle().asString; - let fileElement: HTMLElement = sidebar?.querySelector(`[href="${unixPath}"]`) as HTMLElement; - fileElement = fileElement?.closest(".tree-item") as HTMLElement; - while (fileElement) - { - fileElement?.classList.remove("is-collapsed"); - let children = fileElement?.querySelector(".tree-item-children") as HTMLElement; - if(children) children.style.display = "block"; - fileElement = fileElement?.parentElement?.closest(".tree-item") as HTMLElement; - } - } - } - } - - if (this.exportOptions.includeJS) - { - let bodyScript = this.document.body.createEl("script"); - bodyScript.setAttribute("defer", ""); - bodyScript.innerText = AssetHandler.themeLoadJS.content.toString(); - this.document.body.prepend(bodyScript); - } - - this.content = this.html; - - return this; - } - - private async populateDocument(): Promise - { - if (!this.isConvertable || !this.document) return this; - - let body = this.document.body; - if (this.exportOptions.addBodyClasses) - body.setAttribute("class", Website.validBodyClasses || await HTMLGeneration.getValidBodyClasses(false)); - - let options = {...this.exportOptions, container: body}; - let renderInfo = await MarkdownRendererAPI.renderFile(this.source, options); - let contentEl = renderInfo?.contentEl; - this.viewType = renderInfo?.viewType ?? "markdown"; - - if (!contentEl) return undefined; - if (MarkdownRendererAPI.checkCancelled()) return undefined; - - if (this.viewType == "markdown") - { - contentEl.classList.toggle("allow-fold-headings", this.exportOptions.allowFoldingHeadings); - contentEl.classList.toggle("allow-fold-lists", this.exportOptions.allowFoldingLists); - contentEl.classList.add("is-readable-line-width"); - } - - if(this.sizerElement) this.sizerElement.style.paddingBottom = ""; - - // modify links to work outside of obsidian (including relative links) - if (this.exportOptions.fixLinks) - this.convertLinks(); - - // add math styles to the document. They are here and not in because they are unique to each document - if (this.exportOptions.addMathjaxStyles) - { - let mathStyleEl = document.createElement("style"); - mathStyleEl.id = "MJX-CHTML-styles"; - await AssetHandler.mathjaxStyles.load(this.exportOptions); - mathStyleEl.innerHTML = AssetHandler.mathjaxStyles.content; - this.viewElement.prepend(mathStyleEl); - } - - // inline / outline images - let outlinedImages : Downloadable[] = []; - if (this.exportOptions.inlineMedia) - await this.inlineMedia(); - else - outlinedImages = await this.exportMedia(); - - this.dependencies.push(...outlinedImages); - - if(this.exportOptions.webStylePaths) - { - this.dependencies.forEach((file) => - { - file.filename = Path.toWebStyle(file.filename); - file.relativeDirectory = file.relativeDirectory?.makeWebStyle(); - }); - } - - return this; - } - - private generateWebpageLayout(middleContent: HTMLElement | Node | string): {container: HTMLElement, left: HTMLElement, leftBar: HTMLElement, right: HTMLElement, rightBar: HTMLElement, center: HTMLElement} - { - if (!this.document) throw new Error("Document is not defined"); - - /* - - div.webpage-container - - - div.sidebar.sidebar-left - - div.sidebar-content - - div.sidebar-topbar - - div.clickable-icon.sidebar-collapse-icon - - svg - - - div.document-container - - - div.sidebar.sidebar-right - - div.sidebar-content - - div.sidebar-topbar - - div.clickable-icon.sidebar-collapse-icon - - svg - - */ - - let collapseSidebarIcon = `` - - let pageContainer = this.document.createElement("div"); - let leftSidebar = this.document.createElement("div"); - let leftSidebarHandle = this.document.createElement("div"); - let leftContent = this.document.createElement("div"); - let leftTopbar = this.document.createElement("div"); - let leftTopbarContent = this.document.createElement("div"); - let leftCollapseIcon = this.document.createElement("div"); - let documentContainer = this.document.createElement("div"); - let rightSidebar = this.document.createElement("div"); - let rightSidebarHandle = this.document.createElement("div"); - let rightContent = this.document.createElement("div"); - let rightTopbar = this.document.createElement("div"); - let rightTopbarContent = this.document.createElement("div"); - let rightCollapseIcon = this.document.createElement("div"); - - pageContainer.setAttribute("class", "webpage-container workspace"); - - leftSidebar.setAttribute("class", "sidebar-left sidebar"); - leftSidebarHandle.setAttribute("class", "sidebar-handle"); - leftContent.setAttribute("class", "sidebar-content"); - leftTopbar.setAttribute("class", "sidebar-topbar"); - leftTopbarContent.setAttribute("class", "topbar-content"); - leftCollapseIcon.setAttribute("class", "clickable-icon sidebar-collapse-icon"); - - documentContainer.setAttribute("class", "document-container markdown-reading-view"); - if (this.exportOptions.includeJS) documentContainer.classList.add("hide"); // if js included, hide the content until the js is loaded - - rightSidebar.setAttribute("class", "sidebar-right sidebar"); - rightSidebarHandle.setAttribute("class", "sidebar-handle"); - rightContent.setAttribute("class", "sidebar-content"); - rightTopbar.setAttribute("class", "sidebar-topbar"); - rightTopbarContent.setAttribute("class", "topbar-content"); - rightCollapseIcon.setAttribute("class", "clickable-icon sidebar-collapse-icon"); - - pageContainer.appendChild(leftSidebar); - pageContainer.appendChild(documentContainer); - pageContainer.appendChild(rightSidebar); - - if (this.exportOptions.allowResizeSidebars && this.exportOptions.includeJS) leftSidebar.appendChild(leftSidebarHandle); - leftSidebar.appendChild(leftTopbar); - leftSidebar.appendChild(leftContent); - leftTopbar.appendChild(leftTopbarContent); - leftTopbar.appendChild(leftCollapseIcon); - leftCollapseIcon.innerHTML = collapseSidebarIcon; - - documentContainer.innerHTML += middleContent instanceof HTMLElement ? middleContent.outerHTML : middleContent.toString(); - - if (this.exportOptions.allowResizeSidebars && this.exportOptions.includeJS) rightSidebar.appendChild(rightSidebarHandle); - rightSidebar.appendChild(rightTopbar); - rightSidebar.appendChild(rightContent); - rightTopbar.appendChild(rightTopbarContent); - rightTopbar.appendChild(rightCollapseIcon); - rightCollapseIcon.innerHTML = collapseSidebarIcon; - - let leftSidebarScript = leftSidebar.createEl("script"); - let rightSidebarScript = rightSidebar.createEl("script"); - leftSidebarScript.setAttribute("defer", ""); - rightSidebarScript.setAttribute("defer", ""); - leftSidebarScript.innerHTML = `let ls = document.querySelector(".sidebar-left"); ls.classList.add("is-collapsed"); if (window.innerWidth > 768) ls.classList.remove("is-collapsed"); ls.style.setProperty("--sidebar-width", localStorage.getItem("sidebar-left-width"));`; - rightSidebarScript.innerHTML = `let rs = document.querySelector(".sidebar-right"); rs.classList.add("is-collapsed"); if (window.innerWidth > 768) rs.classList.remove("is-collapsed"); rs.style.setProperty("--sidebar-width", localStorage.getItem("sidebar-right-width"));`; - - return {container: pageContainer, left: leftContent, leftBar: leftTopbarContent, right: rightContent, rightBar: rightTopbarContent, center: documentContainer}; - } - - private async addTitle() - { - if (!this.document || !this.sizerElement || this.viewType != "markdown") return; - - // remove inline title - let inlineTitle = this.document.querySelector(".inline-title"); - inlineTitle?.remove(); - - // remove make.md title - let makeTitle = this.document.querySelector(".mk-inline-context"); - makeTitle?.remove(); - - // remove mod-header - let modHeader = this.document.querySelector(".mod-header"); - modHeader?.remove(); - - // if the first header element is basically the same as the title, use it's text and remove it - let firstHeader = this.document.querySelector(":is(h1, h2, h3, h4, h5, h6):not(.markdown-embed-content *)"); - if (firstHeader) - { - let firstHeaderText = (firstHeader.getAttribute("data-heading") ?? firstHeader.textContent)?.toLowerCase() ?? ""; - let lowerTitle = this.title.toLowerCase(); - let titleDiff = Utils.levenshteinDistance(firstHeaderText, lowerTitle) / lowerTitle.length; - let basenameDiff = Utils.levenshteinDistance(firstHeaderText, this.source.basename.toLowerCase()) / this.source.basename.length; - let difference = Math.min(titleDiff, basenameDiff); - - if ((firstHeader.tagName == "H1" && difference < 0.2) || (firstHeader.tagName == "H2" && difference < 0.1)) - { - if(this.titleInfo.isDefaultTitle) - { - firstHeader.querySelector(".heading-collapse-indicator")?.remove(); - this.title = firstHeader.innerHTML; - ExportLog.log(`Using "${firstHeaderText}" header because it was very similar to the file's title.`); - } - else - { - ExportLog.log(`Replacing "${firstHeaderText}" header because it was very similar to the file's title.`); - } - firstHeader.remove(); - } - else if (firstHeader.tagName == "H1") - { - // if the difference is too large but the first header is an h1 and it's the first element in the body, use it as the title - let headerEl = firstHeader.closest(".heading-wrapper") ?? firstHeader; - let headerParent = headerEl.parentElement; - if (headerParent && headerParent.classList.contains("markdown-preview-sizer")) - { - let childPosition = Array.from(headerParent.children).indexOf(headerEl); - if (childPosition <= 2) - { - if(this.titleInfo.isDefaultTitle) - { - firstHeader.querySelector(".heading-collapse-indicator")?.remove(); - this.title = firstHeader.innerHTML; - ExportLog.log(`Using "${firstHeaderText}" header as title because it was H1 at the top of the page`); - } - else - { - ExportLog.log(`Replacing "${firstHeaderText}" header because it was H1 at the top of the page`); - } - - firstHeader.remove(); - } - } - } - } - - // remove banner header - this.document.querySelector(".banner-header")?.remove(); - - // Create h1 inline title - let titleEl = this.document.createElement("h1"); - titleEl.classList.add("page-title", "heading"); - if (this.document?.body.classList.contains("show-inline-title")) titleEl.classList.add("inline-title"); - titleEl.id = this.title; - - let pageIcon = undefined; - // Create a div with icon - if ((this.icon != "" && !this.titleInfo.isDefaultIcon)) - { - pageIcon = this.document.createElement("div"); - pageIcon.id = "webpage-icon"; - } - - // Insert title into the title element - MarkdownRendererAPI.renderMarkdownSimpleEl(this.title, titleEl); - if (pageIcon) - { - MarkdownRendererAPI.renderMarkdownSimpleEl(this.icon, pageIcon); - titleEl.prepend(pageIcon); - } - - // Insert title into the document - this.sizerElement.prepend(titleEl); - } - - private async addHead() - { - if (!this.document) return; - - let rootPath = this.pathToRoot.copy.makeWebStyle(this.exportOptions.webStylePaths).asString; - let description = this.description || (this.exportOptions.siteName + " - " + this.titleInfo.title); - let head = - ` - ${this.titleInfo.title} - - - - - - - - - - - - `; - - if (this.author && this.author != "") - { - head += ``; - } - - if (this.exportOptions.addRSS) - { - let rssURL = Path.joinStrings(this.exportOptions.siteURL ?? "", this.website?.rssPath ?? "").makeUnixStyle().asString; - head += ``; - } - - head += AssetHandler.getHeadReferences(this.exportOptions); - - this.document.head.innerHTML = head; - } - - private convertLinks() - { - if (!this.document) return; - - this.document.querySelectorAll("a.internal-link").forEach((linkEl) => - { - linkEl.setAttribute("target", "_self"); - - let href = linkEl.getAttribute("href"); - if (!href) return; - - if (href.startsWith("#")) // link pointing to header of this document - { - linkEl.setAttribute("href", href.replaceAll(" ", "_")); - } - else // if it doesn't start with #, it's a link to another document - { - let targetHeader = href.split("#").length > 1 ? "#" + href.split("#")[1] : ""; - let target = href.split("#")[0]; - - let targetFile = app.metadataCache.getFirstLinkpathDest(target, this.source.path); - if (!targetFile) return; - - let targetPath = new Path(targetFile.path); - if (MarkdownRendererAPI.isConvertable(targetPath.extensionName)) targetPath.setExtension("html"); - targetPath.makeWebStyle(this.exportOptions.webStylePaths); - - let finalHref = targetPath.makeUnixStyle() + targetHeader.replaceAll(" ", "_"); - linkEl.setAttribute("href", finalHref); - } - }); - - this.document.querySelectorAll("a.footnote-link").forEach((linkEl) => - { - linkEl.setAttribute("target", "_self"); - }); - - this.document.querySelectorAll("h1, h2, h3, h4, h5, h6").forEach((headerEl) => - { - // convert the data-heading to the id - headerEl.setAttribute("id", (headerEl.getAttribute("data-heading") ?? headerEl.textContent)?.replaceAll(" ", "_") ?? ""); - }); - } - - private async inlineMedia() - { - if (!this.document) return; - - let elements = Array.from(this.document.querySelectorAll("[src]:not(head [src])")) - for (let mediaEl of elements) - { - let rawSrc = mediaEl.getAttribute("src") ?? ""; - let filePath = Webpage.getMediaPath(rawSrc, this.source.path); - if (filePath.isEmpty || filePath.isDirectory || filePath.isAbsolute) continue; - - let base64 = await filePath.readFileString("base64") ?? ""; - if (base64 === "") return; - - let ext = filePath.extensionName; - - //@ts-ignore - let type = app.viewRegistry.typeByExtension[ext] ?? "audio"; - - if(ext === "svg") ext += "+xml"; - - mediaEl.setAttribute("src", `data:${type}/${ext};base64,${base64}`); - }; - } - - private async exportMedia(): Promise - { - if (!this.document) return []; - - let downloads: Downloadable[] = []; - - let elements = Array.from(this.document.querySelectorAll("[src]:not(head [src]):not(span)")); - - for (let mediaEl of elements) - { - let rawSrc = mediaEl.getAttribute("src") ?? ""; - let filePath = Webpage.getMediaPath(rawSrc, this.source.path); - if (filePath.isEmpty || filePath.isDirectory || - filePath.isAbsolute || MarkdownRendererAPI.isConvertable(filePath.extension)) - continue; - - let exportLocation = filePath.copy; - - - // if the media is inside the exported folder then keep it in the same place - let sourceFolder = new Path(this.source.path).directory; - let mediaPathInExport = Path.getRelativePath(sourceFolder, filePath); - if (mediaPathInExport.asString.startsWith("..")) - { - // if path is outside of the vault, outline it into the media folder - exportLocation = AssetHandler.mediaPath.joinString(filePath.fullName); - } - - exportLocation = exportLocation.makeWebStyle(this.exportOptions.webStylePaths).makeUnixStyle(); - mediaEl.setAttribute("src", exportLocation.asString); - - let data = await filePath.readFileBuffer(); - if (data) - { - let imageDownload = new Downloadable(exportLocation.fullName, data, exportLocation.directory.makeForceFolder()); - let imageStat = filePath.stat; - if (imageStat) imageDownload.modifiedTime = imageStat.mtimeMs; - downloads.push(imageDownload); - } - }; - - return downloads; - } - - private static getMediaPath(src: string, exportingFilePath: string): Path - { - // @ts-ignore - let pathString = ""; - if (src.startsWith("app://")) - { - let fail = false; - try - { - // @ts-ignore - pathString = app.vault.resolveFileUrl(src)?.path ?? ""; - if (pathString == "") fail = true; - } - catch - { - fail = true; - } - - if(fail) - { - pathString = src.replaceAll("app://", "").replaceAll("\\", "/"); - pathString = pathString.replaceAll(pathString.split("/")[0] + "/", ""); - pathString = Path.getRelativePathFromVault(new Path(pathString), true).asString; - ExportLog.log(pathString, "Fallback path parsing:"); - } - } - else - { - pathString = app.metadataCache.getFirstLinkpathDest(src, exportingFilePath)?.path ?? ""; - } - - pathString = pathString ?? ""; - - return new Path(pathString); - } -} diff --git a/.obsidian/plugins/obsidian-webpage-export-master/scripts/objects/website-index.ts b/.obsidian/plugins/obsidian-webpage-export-master/scripts/objects/website-index.ts deleted file mode 100644 index 03b79177..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/scripts/objects/website-index.ts +++ /dev/null @@ -1,526 +0,0 @@ -import { Asset, AssetType, InlinePolicy, Mutability } from "scripts/html-generation/assets/asset"; -import { Website } from "./website"; -import Minisearch from 'minisearch'; -import { ExportLog } from "scripts/html-generation/render-log"; -import { Path } from "scripts/utils/path"; -import { ExportPreset, Settings, SettingsPage } from "scripts/settings/settings"; -import HTMLExportPlugin from "scripts/main"; -import { TFile } from "obsidian"; -import { AssetHandler } from "scripts/html-generation/asset-handler"; -import { MarkdownRendererAPI } from "scripts/render-api"; -import { MarkdownWebpageRendererAPIOptions } from "scripts/api-options"; - -export class WebsiteIndex -{ - private web: Website; - - public exportTime: number = Date.now(); - public previousMetadata: - { - vaultName: string, - lastExport: number, - pluginVersion: string, - validBodyClasses: string, - useCustomHeadContent: boolean, - useCustomFavicon: boolean, - mainDependencies: string[], - files: string[], - fileInfo: - { - [path: string]: - { - modifiedTime: number, - sourceSize: number, - exportedPath: string, - dependencies: string[] - } - } - } | undefined = undefined; - public index: Minisearch | undefined = undefined; - private stopWords = ["a", "about", "actually", "almost", "also", "although", "always", "am", "an", "and", "any", "are", "as", "at", "be", "became", "become", "but", "by", "can", "could", "did", "do", "does", "each", "either", "else", "for", "from", "had", "has", "have", "hence", "how", "i", "if", "in", "is", "it", "its", "just", "may", "maybe", "me", "might", "mine", "must", "my", "mine", "must", "my", "neither", "nor", "not", "of", "oh", "ok", "when", "where", "whereas", "wherever", "whenever", "whether", "which", "while", "who", "whom", "whoever", "whose", "why", "will", "with", "within", "without", "would", "yes", "yet", "you", "your"]; - private indexOptions = - { - idField: 'path', - fields: ['path', 'title', 'content', 'tags', 'headers'], - storeFields: ['path', 'title', 'tags', 'headers'], - processTerm: (term:any, _fieldName:any) => - this.stopWords.includes(term) ? null : term.toLowerCase() - } - // public exportOptions: MarkdownWebpageRendererAPIOptions = new MarkdownWebpageRendererAPIOptions(); - - private allFiles: string[] = []; // all files that are being exported - public removedFiles: string[] = []; // old files that are no longer being exported - public addedFiles: string[] = []; // new files that are being exported - private keptDependencies: string[] = []; // dependencies that are being kept - - constructor(website: Website) - { - this.web = website; - } - - public async init(): Promise - { - this.exportTime = Date.now(); - this.previousMetadata = await this.getExportMetadata(); - this.index = await this.getExportIndex(); - - // Notify the user if all files will be exported - this.shouldApplyIncrementalExport(true); - - if (!this.previousMetadata) return false; - return true; - } - - public shouldApplyIncrementalExport(printWarning: boolean = false): boolean - { - let result = true; - - if (!Settings.onlyExportModified) result = false; - if (Settings.exportPreset != ExportPreset.Website) result = false; - - if (this.isVersionChanged() && this.previousMetadata) - { - if (printWarning) ExportLog.warning("Plugin version changed. All files will be re-exported."); - result = false; - } - - if (this.previousMetadata == undefined) - { - if (printWarning) ExportLog.warning("No existing export metadata found. All files will be exported."); - result = false; - } - - if (this.index == undefined) - { - if (printWarning) ExportLog.warning("No existing search index found. All files will be exported."); - result = false; - } - - let rssAbsoultePath = this.web.destination.joinString(this.web.rssPath); - if (!rssAbsoultePath.exists && this.web.exportOptions.addRSS) - { - if (printWarning) ExportLog.warning("No existing RSS feed found. All files will be exported."); - result = false; - } - - let customHeadChanged = this.previousMetadata && (this.previousMetadata?.useCustomHeadContent != (Settings.customHeadContentPath != "")); - if (customHeadChanged) - { - if (printWarning) ExportLog.warning(`${Settings.customHeadContentPath != "" ? "Added" : "Removed"} custom head content. All files will be re-exported.`); - result = false; - } - - let customFaviconChanged = this.previousMetadata && (this.previousMetadata?.useCustomFavicon != (Settings.faviconPath != "")); - if (customFaviconChanged) - { - if (printWarning) ExportLog.warning(`${Settings.faviconPath != "" ? "Added" : "Removed"} custom favicon. All files will be re-exported.`); - result = false; - } - - return result; - } - - private async getExportMetadata(): Promise - { - try - { - let metadataPath = this.web.destination.join(AssetHandler.libraryPath).joinString("metadata.json"); - let metadata = await metadataPath.readFileString(); - if (metadata) return JSON.parse(metadata); - } - catch (e) - { - ExportLog.warning(e, "Failed to parse metadata.json. Recreating metadata."); - } - - return undefined; - } - - private async getExportIndex(): Promise | undefined> - { - let index: Minisearch | undefined = undefined; - - try - { - // load current index or create a new one if it doesn't exist - let indexPath = this.web.destination.join(AssetHandler.libraryPath).joinString("search-index.json"); - let indexJson = await indexPath.readFileString(); - if (indexJson) - { - index = Minisearch.loadJSON(indexJson, this.indexOptions); - } - } - catch (e) - { - ExportLog.warning(e, "Failed to load search-index.json. Creating new index."); - index = undefined; - } - - return index; - } - - public async createIndex(): Promise - { - if (!this.index) - { - this.index = new Minisearch(this.indexOptions); - } - - function preprocessContent(contentElement: HTMLElement): string - { - function getTextNodes(element: HTMLElement): Node[] - { - const textNodes = []; - const walker = document.createTreeWalker(element, NodeFilter.SHOW_TEXT, null); - - let node; - while (node = walker.nextNode()) { - textNodes.push(node); - } - - return textNodes; - } - - contentElement.querySelectorAll(".math, svg, img, .frontmatter, .metadata-container, .heading-after, style, script").forEach((el) => el.remove()); - - const textNodes = getTextNodes(contentElement); - - let content = ''; - for (const node of textNodes) - { - content += ' ' + node.textContent + ' '; - } - - content = content.trim().replace(/\s+/g, ' '); - - return content; - } - - const htmlWebpages = this.web.webpages.filter(webpage => webpage.document && webpage.viewElement); - - // progress counters - let progressCount = 0; - let totalCount = htmlWebpages.length + this.web.dependencies.length + this.removedFiles.length; - - - for (const webpage of htmlWebpages) - { - if(MarkdownRendererAPI.checkCancelled()) return undefined; - ExportLog.progress(progressCount, totalCount, "Indexing", "Adding: " + webpage.relativePath.asString, "var(--color-blue)"); - - const content = preprocessContent(webpage.viewElement); - - if (content) - { - const webpagePath = webpage.relativePath.copy.makeUnixStyle().asString; - if (this.index.has(webpagePath)) - { - this.index.discard(webpagePath); - } - - this.index.add({ - path: webpagePath, - title: webpage.title, - content: content, - tags: webpage.tags, - headers: webpage.headings.map((header) => header.heading), - }); - } - else - { - console.warn(`No indexable content found for ${webpage.source.basename}`); - } - progressCount++; - } - - // add other files to search - for (const file of this.web.dependencies) - { - if(MarkdownRendererAPI.checkCancelled()) return undefined; - - const filePath = file.relativePath.asString; - if (this.index.has(filePath)) - { - continue; - } - - ExportLog.progress(progressCount, totalCount, "Indexing", "Adding: " + file.filename, "var(--color-blue)"); - - this.index.add({ - path: filePath, - title: file.relativePath.basename, - content: "", - tags: [], - headers: [], - }); - - progressCount++; - } - - // remove old files - for (const oldFile of this.removedFiles) - { - if(MarkdownRendererAPI.checkCancelled()) return undefined; - ExportLog.progress(progressCount, totalCount, "Indexing", "Removing: " + oldFile, "var(--color-blue)"); - - if (this.index.has(oldFile)) - this.index.discard(oldFile); - - progressCount++; - } - - ExportLog.progress(totalCount, totalCount, "Indexing", "Cleanup index", "var(--color-blue)"); - this.index.vacuum(); - - return new Asset("search-index.json", JSON.stringify(this.index), AssetType.Other, InlinePolicy.Download, false, Mutability.Temporary); - } - - public async createMetadata(options: MarkdownWebpageRendererAPIOptions): Promise - { - // metadata stores a list of files in the export, their relative paths, and modification times. - // is also stores the vault name, the export time, and the plugin version - let metadata: any = this.previousMetadata ? JSON.parse(JSON.stringify(this.previousMetadata)) : {}; - metadata.vaultName = this.web.exportOptions.siteName; - metadata.lastExport = this.exportTime; - metadata.pluginVersion = HTMLExportPlugin.plugin.manifest.version; - metadata.validBodyClasses = Website.validBodyClasses; - metadata.useCustomHeadContent = Settings.customHeadContentPath != ""; - metadata.useCustomFavicon = Settings.faviconPath != ""; - metadata.files = this.allFiles; - metadata.mainDependencies = AssetHandler.getDownloads(options).map((asset) => asset.relativePath.copy.makeUnixStyle().asString); - if (!metadata.fileInfo) metadata.fileInfo = {}; - - // progress counters - let progressCount = 0; - let totalCount = this.web.webpages.length + this.web.dependencies.length + this.removedFiles.length; - - for (const page of this.web.webpages) - { - if(MarkdownRendererAPI.checkCancelled()) return undefined; - ExportLog.progress(progressCount, totalCount, "Creating Metadata", "Adding: " + page.relativePath.asString, "var(--color-cyan)"); - - let fileInfo: any = {}; - fileInfo.modifiedTime = this.exportTime; - fileInfo.sourceSize = page.source.stat.size; - fileInfo.exportedPath = page.relativePath.copy.makeUnixStyle().asString; - fileInfo.dependencies = page.dependencies.map((asset) => asset.relativePath.copy.makeUnixStyle().asString); - - let exportPath = new Path(page.source.path).makeUnixStyle().asString; - metadata.fileInfo[exportPath] = fileInfo; - progressCount++; - } - - for (const file of this.web.dependencies) - { - if(MarkdownRendererAPI.checkCancelled()) return undefined; - ExportLog.progress(progressCount, totalCount, "Creating Metadata", "Adding: " + file.relativePath.asString, "var(--color-cyan)"); - - let fileInfo: any = {}; - fileInfo.modifiedTime = this.exportTime; - fileInfo.sourceSize = file.content.length; - fileInfo.exportedPath = file.relativePath.copy.makeUnixStyle().asString; - fileInfo.dependencies = []; - - let exportPath = file.relativePath.copy.makeUnixStyle().asString; - metadata.fileInfo[exportPath] = fileInfo; - progressCount++; - } - - // remove old files - for (const oldFile of this.removedFiles) - { - if(MarkdownRendererAPI.checkCancelled()) return undefined; - ExportLog.progress(progressCount, totalCount, "Creating Metadata", "Removing: " + oldFile, "var(--color-cyan)"); - delete metadata.fileInfo[oldFile]; - progressCount++; - } - - return new Asset("metadata.json", JSON.stringify(metadata, null, 2), AssetType.Other, InlinePolicy.Download, false, Mutability.Temporary); - } - - public async deleteOldFiles(options?: MarkdownWebpageRendererAPIOptions) - { - options = Object.assign(new MarkdownWebpageRendererAPIOptions(), options); - if (!this.previousMetadata) return; - if (this.removedFiles.length == 0) - { - ExportLog.log("No old files to delete"); - return; - } - - for (let i = 0; i < this.removedFiles.length; i++) - { - if(MarkdownRendererAPI.checkCancelled()) return; - let removedPath = this.removedFiles[i]; - console.log("Removing old file: ", this.previousMetadata.fileInfo); - let exportedPath = new Path(this.previousMetadata.fileInfo[removedPath].exportedPath); - exportedPath.makeWebStyle(options.webStylePaths); - - let deletePath = this.web.destination.join(exportedPath); - console.log("Deleting old file: " + deletePath.asString); - await deletePath.delete(true); - ExportLog.progress(i, this.removedFiles.length, "Deleting Old Files", "Deleting: " + deletePath.asString, "var(--color-orange)"); - } - - let folders = (await Path.getAllEmptyFoldersRecursive(this.web.destination)); - if(MarkdownRendererAPI.checkCancelled()) return; - - // sort by depth so that the deepest folders are deleted first - folders.sort((a, b) => a.depth - b.depth); - for (let i = 0; i < folders.length; i++) - { - if(MarkdownRendererAPI.checkCancelled()) return; - let folder = folders[i]; - ExportLog.progress(i, folders.length, "Deleting Empty Folders", "Deleting: " + folder.asString, "var(--color-orange)"); - await folder.directory.delete(true); - } - } - - public async updateBodyClasses() - { - if (!this.previousMetadata) return; - if (this.previousMetadata.validBodyClasses == Website.validBodyClasses) return; - console.log("Updating body classes of previous export"); - - let convertableFiles = this.previousMetadata.files.filter((path) => MarkdownRendererAPI.isConvertable(path.split(".").pop() ?? "")); - let exportedPaths = convertableFiles.map((path) => new Path(this.previousMetadata?.fileInfo[path]?.exportedPath ?? "", this.web.destination.asString)); - exportedPaths = exportedPaths.filter((path) => !path.isEmpty); - - for (let i = 0; i < exportedPaths.length; i++) - { - if(MarkdownRendererAPI.checkCancelled()) return; - let exportedPath = exportedPaths[i]; - let content = await exportedPath.readFileString(); - if (!content) continue; - let dom = new DOMParser().parseFromString(content, "text/html"); - let body = dom.querySelector("body"); - if (!body) continue; - body.className = Website.validBodyClasses; - await exportedPath.writeFile(dom.documentElement.outerHTML); - ExportLog.progress(i, exportedPaths.length, "Updating Body Classes", "Updating: " + exportedPath.asString, "var(--color-yellow)"); - } - } - - public isFileChanged(file: TFile): boolean - { - let metadata = this.getMetadataForFile(file); - if (!metadata) - { - return true; - } - return metadata.modifiedTime < file.stat.mtime || metadata.sourceSize !== file.stat.size; - } - - public hasFile(file: TFile): boolean - { - return this.getMetadataForFile(file) !== undefined; - } - - public hasFileByPath(path: string): boolean - { - return this.getMetadataForPath(path) !== undefined; - } - - public getMetadataForFile(file: TFile): {modifiedTime: number,sourceSize: number,exportedPath: string,dependencies: string[]} | undefined - { - return this.previousMetadata?.fileInfo[file.path]; - } - - public getMetadataForPath(path: string): {modifiedTime: number,sourceSize: number,exportedPath: string,dependencies: string[]} | undefined - { - return this.previousMetadata?.fileInfo[path]; - } - - public isVersionChanged(): boolean - { - return this.previousMetadata?.pluginVersion !== HTMLExportPlugin.plugin.manifest.version; - } - - public getAllFiles(): string[] - { - this.allFiles = []; - - for (let file of this.web.batchFiles) - { - this.allFiles.push(file.path); - } - - for (let asset of this.web.dependencies) - { - if (this.allFiles.some((path) => Path.equal(path, asset.relativePath.asString))) continue; - - this.allFiles.push(asset.relativePath.copy.makeUnixStyle().asString); - } - - return this.allFiles; - } - - public getRemovedFiles(): string[] - { - if (!this.previousMetadata) return []; - - this.removedFiles = this.previousMetadata.files.filter((path) => - { - return !this.allFiles.includes(path) && - !this.previousMetadata?.mainDependencies.includes(path) && - !this.keptDependencies.includes(path); - }); - - console.log("Old files: ", this.removedFiles); - - return this.removedFiles; - } - - public getAddedFiles(): string[] - { - if (!this.previousMetadata) return []; - - this.addedFiles = this.allFiles.filter(path => !this.previousMetadata?.files.includes(path)); - console.log("New files: ", this.addedFiles); - - return this.addedFiles; - } - - public getKeptDependencies(): string[] - { - if (!this.previousMetadata) return []; - - this.keptDependencies = []; - - for (let file of this.allFiles) - { - let dep = this.previousMetadata.fileInfo[file]?.dependencies ?? []; - this.keptDependencies.push(...dep); - } - - // add kept dependencies to the list of all files and remove duplicates - this.allFiles.push(...this.keptDependencies); - this.allFiles = this.allFiles.filter((path, index) => this.allFiles.findIndex((f) => f == path) == index); - - return this.keptDependencies; - } - - public async build(options: MarkdownWebpageRendererAPIOptions): Promise - { - this.getAllFiles(); - this.getKeptDependencies(); - this.getRemovedFiles(); - this.getAddedFiles(); - - // create website metadata and index - let metadataAsset = await this.createMetadata(options); - if (!metadataAsset) return false; - this.web.dependencies.push(metadataAsset); - this.web.downloads.push(metadataAsset); - - if (options.addSearch) // only create index if search bar is enabled - { - let index = await this.createIndex(); - if (!index) return false; - this.web.dependencies.push(index); - this.web.downloads.push(index); - } - - return true; - } -} diff --git a/.obsidian/plugins/obsidian-webpage-export-master/scripts/objects/website.ts b/.obsidian/plugins/obsidian-webpage-export-master/scripts/objects/website.ts deleted file mode 100644 index 688b9543..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/scripts/objects/website.ts +++ /dev/null @@ -1,507 +0,0 @@ -import { Downloadable } from "scripts/utils/downloadable"; -import { Webpage } from "./webpage"; -import { FileTree } from "./file-tree"; -import { AssetHandler } from "scripts/html-generation/asset-handler"; -import { TAbstractFile, TFile, TFolder } from "obsidian"; -import { Settings } from "scripts/settings/settings"; -import { GraphView } from "./graph-view"; -import { Path } from "scripts/utils/path"; -import { ExportLog } from "scripts/html-generation/render-log"; -import { Asset, AssetType, InlinePolicy, Mutability } from "scripts/html-generation/assets/asset"; -import HTMLExportPlugin from "scripts/main"; -import { WebsiteIndex } from "./website-index"; -import { HTMLGeneration } from "scripts/html-generation/html-generation-helpers"; -import { MarkdownRendererAPI } from "scripts/render-api"; -import { MarkdownWebpageRendererAPIOptions } from "scripts/api-options"; -import RSS from 'rss'; - -export class Website -{ - public webpages: Webpage[] = []; - public dependencies: Downloadable[] = []; - public downloads: Downloadable[] = []; - public batchFiles: TFile[] = []; - public progress: number = 0; - public destination: Path; - public index: WebsiteIndex; - public rss: RSS; - public rssPath = AssetHandler.libraryPath.joinString("rss.xml").makeUnixStyle().asString; - - private globalGraph: GraphView; - private fileTree: FileTree; - private fileTreeHtml: string = ""; - - public graphDataAsset: Asset; - public fileTreeAsset: Asset; - - - public static validBodyClasses: string; - public exportOptions: MarkdownWebpageRendererAPIOptions; - - /** - * Create a new website with the given files and options. - * @param files The files to include in the website. - * @param destination The folder to export the website to. - * @param options The api options to use for the export. - * @returns The website object. - */ - public async createWithFiles(files: TFile[], destination: Path, options?: MarkdownWebpageRendererAPIOptions): Promise - { - this.exportOptions = Object.assign(new MarkdownWebpageRendererAPIOptions(), options); - this.batchFiles = files; - this.destination = destination; - await this.initExport(); - - console.log("Creating website with files: ", files); - - let useIncrementalExport = this.index.shouldApplyIncrementalExport(); - - for (let file of files) - { - if(MarkdownRendererAPI.checkCancelled()) return; - ExportLog.progress(this.progress, this.batchFiles.length, "Generating HTML", "Exporting: " + file.path, "var(--interactive-accent)"); - this.progress++; - - let filename = new Path(file.path).basename; - let webpage = new Webpage(file, destination, filename, this, this.exportOptions); - let shouldExportPage = (useIncrementalExport && this.index.isFileChanged(file)) || !useIncrementalExport; - if (!shouldExportPage) continue; - - let createdPage = await webpage.create(); - if(!createdPage) continue; - - this.webpages.push(webpage); - this.downloads.push(webpage); - this.downloads.push(...webpage.dependencies); - this.dependencies.push(...webpage.dependencies); - } - - - this.dependencies.push(...AssetHandler.getDownloads(this.exportOptions)); - this.downloads.push(...AssetHandler.getDownloads(this.exportOptions)); - - this.filterDownloads(true); - this.index.build(this.exportOptions); - this.filterDownloads(); - - if (this.exportOptions.addRSS) - { - this.createRSS(); - } - - console.log("Website created: ", this); - - return this; - } - - private giveWarnings() - { - // if iconize plugin is installed, warn if note icons are not enabled - // @ts-ignore - if (app.plugins.enabledPlugins.has("obsidian-icon-folder")) - { - // @ts-ignore - let fileToIconName = app.plugins.plugins['obsidian-icon-folder'].data; - let noteIconsEnabled = fileToIconName.settings.iconsInNotesEnabled ?? false; - if (!noteIconsEnabled) - { - ExportLog.warning("For Iconize plugin support, enable \"Toggle icons while editing notes\" in the Iconize plugin settings."); - } - } - - // if excalidraw installed and the embed mode is not set to Native SVG, warn - // @ts-ignore - if (app.plugins.enabledPlugins.has("obsidian-excalidraw-plugin")) - { - // @ts-ignore - let embedMode = app.plugins.plugins['obsidian-excalidraw-plugin']?.settings['previewImageType'] ?? ""; - if (embedMode != "SVG") - { - ExportLog.warning("For Excalidraw embed support, set the embed mode to \"Native SVG\" in the Excalidraw plugin settings."); - } - } - - // the plugin only supports the banner plugin above version 2.0.5 - // @ts-ignore - if (app.plugins.enabledPlugins.has("obsidian-banners")) - { - // @ts-ignore - let bannerPlugin = app.plugins.plugins['obsidian-banners']; - let version = bannerPlugin?.manifest?.version ?? "0.0.0"; - version = version.substring(0, 5); - if (version < "2.0.5") - { - ExportLog.warning("The Banner plugin version 2.0.5 or higher is required for full support. You have version " + version + "."); - } - } - - // warn the user if they are trying to create an rss feed without a site url - if (this.exportOptions.addRSS && (this.exportOptions.siteURL == "" || this.exportOptions.siteURL == undefined)) - { - ExportLog.warning("Creating an RSS feed requires a site url to be set in the export settings."); - } - - } - - private async initExport() - { - this.progress = 0; - this.index = new WebsiteIndex(this); - - await MarkdownRendererAPI.beginBatch(); - - this.giveWarnings(); - - if (this.exportOptions.addGraphView) - { - ExportLog.progress(0, 1, "Initialize Export", "Generating graph view", "var(--color-yellow)"); - let convertableFiles = this.batchFiles.filter((file) => MarkdownRendererAPI.isConvertable(file.extension)); - this.globalGraph = new GraphView(); - await this.globalGraph.init(convertableFiles, this.exportOptions); - } - - if (this.exportOptions.addFileNavigation) - { - ExportLog.progress(0, 1, "Initialize Export", "Generating file tree", "var(--color-yellow)"); - this.fileTree = new FileTree(this.batchFiles, false, true); - this.fileTree.makeLinksWebStyle = this.exportOptions.webStylePaths ?? true; - this.fileTree.showNestingIndicator = true; - this.fileTree.generateWithItemsClosed = true; - this.fileTree.showFileExtentionTags = true; - this.fileTree.hideFileExtentionTags = ["md"] - this.fileTree.title = this.exportOptions.siteName ?? app.vault.getName(); - this.fileTree.class = "file-tree"; - - let tempTreeContainer = document.body.createDiv(); - await this.fileTree.generateTreeWithContainer(tempTreeContainer); - this.fileTreeHtml = tempTreeContainer.innerHTML; - tempTreeContainer.remove(); - } - - // wipe all temporary assets and reload dynamic assets - ExportLog.progress(0, 1, "Initialize Export", "loading assets", "var(--color-yellow)"); - await AssetHandler.reloadAssets(); - - Website.validBodyClasses = await HTMLGeneration.getValidBodyClasses(true); - - if (this.exportOptions.addGraphView) - { - ExportLog.progress(1, 1, "Loading graph asset", "...", "var(--color-yellow)"); - this.graphDataAsset = new Asset("graph-data.js", this.globalGraph.getExportData(), AssetType.Script, InlinePolicy.AutoHead, true, Mutability.Temporary); - this.graphDataAsset.load(this.exportOptions); - } - - if (this.exportOptions.addFileNavigation) - { - ExportLog.progress(1, 1, "Loading file tree asset", "...", "var(--color-yellow)"); - this.fileTreeAsset = new Asset("file-tree.html", this.fileTreeHtml, AssetType.HTML, InlinePolicy.Auto, true, Mutability.Temporary); - this.fileTreeAsset.load(this.exportOptions); - } - - ExportLog.progress(1, 1, "Initializing index", "...", "var(--color-yellow)"); - await this.index.init(); - } - - private async createRSS() - { - let author = this.exportOptions.authorName || undefined; - - this.rss = new RSS( - { - title: this.exportOptions.siteName ?? app.vault.getName(), - description: "Obsidian digital garden", - generator: "Webpage HTML Export plugin for Obsidian", - feed_url: Path.joinStrings(this.exportOptions.siteURL ?? "", this.rssPath).asString, - site_url: this.exportOptions.siteURL ?? "", - image_url: Path.joinStrings(this.exportOptions.siteURL ?? "", AssetHandler.favicon.relativePath.asString).asString, - pubDate: new Date(this.index.exportTime), - copyright: author, - ttl: 60, - custom_elements: - [ - { "dc:creator": author }, - - ] - }); - - for (let page of this.webpages) - { - // only include convertable pages with content - if (!page.isConvertable || page.sizerElement.innerText.length < 5) continue; - - let title = page.title; - let url = Path.joinStrings(this.exportOptions.siteURL ?? "", page.relativePath.asString).asString; - let guid = page.source.path; - let date = new Date(page.source.stat.mtime); - author = page.author ?? author; - let media = page.metadataImageURL ?? ""; - let hasMedia = media != ""; - - let description = page.description; - - if (!description) - { - let content = page.viewElement.cloneNode(true) as HTMLElement; - content.querySelectorAll(`h1, h2, h3, h4, h5, h6, .mermaid, table, mjx-container, style, script, -.mod-header, .mod-footer, .metadata-container, .frontmatter, img[src^="data:"]`).forEach((heading) => heading.remove()); - - // update image links - content.querySelectorAll("[src]").forEach((el: HTMLImageElement) => - { - let src = el.src; - if (!src) return; - if (src.startsWith("http") || src.startsWith("data:")) return; - src = src.replace("app://obsidian", ""); - src = src.replace(".md", ""); - let path = Path.joinStrings(this.exportOptions.siteURL ?? "", src); - el.src = path.asString; - }); - - // update normal links - content.querySelectorAll("[href]").forEach((el: HTMLAnchorElement) => - { - let href = el.href; - if (!href) return; - if (href.startsWith("http") || href.startsWith("data:")) return; - href = href.replace("app://obsidian", ""); - href = href.replace(".md", ""); - let path = Path.joinStrings(this.exportOptions.siteURL ?? "", href); - el.href = path.asString; - }); - - // console.log("Content: ", content.outerHTML); - - function keepTextLinksImages(element: HTMLElement) - { - let walker = document.createTreeWalker(element, NodeFilter.SHOW_TEXT | NodeFilter.SHOW_ELEMENT); - let node; - let nodes = []; - while (node = walker.nextNode()) - { - if (node.nodeType == Node.ELEMENT_NODE) - { - let element = node as HTMLElement; - if (element.tagName == "A" || element.tagName == "IMG" || element.tagName == "BR") - { - nodes.push(element); - } - - if (element.tagName == "DIV") - { - let classes = element.parentElement?.classList; - if (classes?.contains("heading-children") || classes?.contains("markdown-preview-sizer")) - { - nodes.push(document.createElement("br")); - } - } - - if (element.tagName == "LI") - { - nodes.push(document.createElement("br")); - } - } - else - { - if (node.parentElement?.tagName != "A" && node.parentElement?.tagName != "IMG") - nodes.push(node); - } - } - - element.innerHTML = ""; - element.append(...nodes); - } - - keepTextLinksImages(content); - description = content.innerHTML; - content.remove(); - } - - // add tags to top of description - let tags = page.tags.map((t) => t).map((tag) => `${tag}`).join(" "); - let tagContainer = document.body.createDiv(); - tagContainer.innerHTML = tags; - tagContainer.style.display = "flex"; - tagContainer.style.gap = "0.4em"; - - tagContainer.querySelectorAll("a.tag").forEach((tag: HTMLElement) => - { - tag.style.backgroundColor = "#046c74"; - tag.style.color = "white"; - tag.style.fontWeight = "700"; - tag.style.border = "none"; - tag.style.borderRadius = "1em"; - tag.style.padding = "0.2em 0.5em"; - }); - - description = tagContainer.innerHTML + " \n " + description; - tagContainer.remove(); - - this.rss.item( - { - title: title, - description: description, - url: url, - guid: guid, - date: date, - enclosure: hasMedia ? { url: media } : undefined, - author: author, - custom_elements: - [ - hasMedia ? { "content:encoded": `
` } : undefined, - ] - }); - } - - let result = this.rss.xml(); - - let rssAbsoultePath = this.destination.joinString(this.rssPath); - let rssFileOld = await rssAbsoultePath.readFileString(); - if (rssFileOld) - { - let rssDocOld = new DOMParser().parseFromString(rssFileOld, "text/xml"); - let rssDocNew = new DOMParser().parseFromString(result, "text/xml"); - - // insert old items into new rss and remove duplicates - let oldItems = Array.from(rssDocOld.querySelectorAll("item")) as HTMLElement[]; - let newItems = Array.from(rssDocNew.querySelectorAll("item")) as HTMLElement[]; - - oldItems = oldItems.filter((oldItem) => !newItems.find((newItem) => newItem.querySelector("guid")?.textContent == oldItem.querySelector("guid")?.textContent)); - oldItems = oldItems.filter((oldItem) => !this.index.removedFiles.contains(oldItem.querySelector("guid")?.textContent ?? "")); - newItems = newItems.concat(oldItems); - - // remove all items from new rss - newItems.forEach((item) => item.remove()); - - // add items back to new rss - let channel = rssDocNew.querySelector("channel"); - newItems.forEach((item) => channel?.appendChild(item)); - - result = rssDocNew.documentElement.outerHTML; - } - - let rss = new Asset("rss.xml", result, AssetType.Other, InlinePolicy.Download, false, Mutability.Temporary); - rss.download(this.destination); - } - - private filterDownloads(onlyDuplicates: boolean = false) - { - // remove duplicates from the dependencies and downloads - this.dependencies = this.dependencies.filter((file, index) => this.dependencies.findIndex((f) => f.relativePath.asString == file.relativePath.asString) == index); - this.downloads = this.downloads.filter((file, index) => this.downloads.findIndex((f) => f.relativePath.asString == file.relativePath.asString) == index); - - // remove files that have not been modified since last export - if (!this.index.shouldApplyIncrementalExport() || onlyDuplicates) return; - - let localThis = this; - function filterFunction(file: Downloadable) - { - // always include .html files - if (file.filename.endsWith(".html")) return true; - - // always exclude fonts if they exist - if - ( - localThis.index.hasFileByPath(file.relativePath.asString) && - file.filename.endsWith(".woff") || - file.filename.endsWith(".woff2") || - file.filename.endsWith(".otf") || - file.filename.endsWith(".ttf") - ) - { - return false; - } - - // always include files that have been modified since last export - let metadata = localThis.index.getMetadataForPath(file.relativePath.copy.makeUnixStyle().asString); - if (metadata && (file.modifiedTime > metadata.modifiedTime || metadata.sourceSize != file.content.length)) - return true; - - console.log("Excluding: " + file.relativePath.asString); - return false; - } - - this.dependencies = this.dependencies.filter(filterFunction); - this.downloads = this.downloads.filter(filterFunction); - } - - // TODO: Seperate the icon and title into seperate functions - public static async getTitleAndIcon(file: TAbstractFile, skipIcon:boolean = false): Promise<{ title: string; icon: string; isDefaultIcon: boolean; isDefaultTitle: boolean }> - { - const { app } = HTMLExportPlugin.plugin; - const { titleProperty } = Settings; - - let iconOutput = ""; - let iconProperty: string | undefined = ""; - let title = file.name; - let isDefaultTitle = true; - let useDefaultIcon = false; - if (file instanceof TFile) - { - const fileCache = app.metadataCache.getFileCache(file); - const frontmatter = fileCache?.frontmatter; - title = (frontmatter?.[titleProperty] ?? frontmatter?.banner_header)?.toString() ?? file.basename; - if (title != file.basename) isDefaultTitle = false; - if (title.endsWith(".excalidraw")) title = title.substring(0, title.length - 11); - - iconProperty = frontmatter?.icon ?? frontmatter?.sticker ?? frontmatter?.banner_icon; // banner plugin support - if (!iconProperty && Settings.showDefaultTreeIcons) - { - useDefaultIcon = true; - let isMedia = Asset.extentionToType(file.extension) == AssetType.Media; - iconProperty = isMedia ? Settings.defaultMediaIcon : Settings.defaultFileIcon; - if (file.extension == "canvas") iconProperty = "lucide//layout-dashboard"; - } - } - - if (skipIcon) return { title: title, icon: "", isDefaultIcon: true, isDefaultTitle: isDefaultTitle }; - - if (file instanceof TFolder && Settings.showDefaultTreeIcons) - { - iconProperty = Settings.defaultFolderIcon; - useDefaultIcon = true; - } - - iconOutput = await HTMLGeneration.getIcon(iconProperty ?? ""); - - // add iconize icon as frontmatter if iconize exists - let isUnchangedNotEmojiNotHTML = (iconProperty == iconOutput && iconOutput.length < 40) && !/\p{Emoji}/u.test(iconOutput) && !iconOutput.includes("<") && !iconOutput.includes(">"); - let parsedAsIconize = false; - - //@ts-ignore - if ((useDefaultIcon || !iconProperty || isUnchangedNotEmojiNotHTML) && app.plugins.enabledPlugins.has("obsidian-icon-folder")) - { - //@ts-ignore - let fileToIconName = app.plugins.plugins['obsidian-icon-folder'].data; - let noteIconsEnabled = fileToIconName.settings.iconsInNotesEnabled ?? false; - - // only add icon if rendering note icons is enabled - // because that is what we rely on to get the icon - if (noteIconsEnabled) - { - let iconIdentifier = fileToIconName.settings.iconIdentifier ?? ":"; - let iconProperty = fileToIconName[file.path]; - - if (iconProperty && typeof iconProperty != "string") - { - iconProperty = iconProperty.iconName ?? ""; - } - - if (iconProperty && typeof iconProperty == "string" && iconProperty.trim() != "") - { - if (file instanceof TFile) - app.fileManager.processFrontMatter(file, (frontmatter) => - { - frontmatter.icon = iconProperty; - }); - - iconOutput = iconIdentifier + iconProperty + iconIdentifier; - parsedAsIconize = true; - } - } - } - - if (!parsedAsIconize && isUnchangedNotEmojiNotHTML) iconOutput = ""; - - return { title: title, icon: iconOutput, isDefaultIcon: useDefaultIcon, isDefaultTitle: isDefaultTitle }; - } -} diff --git a/.obsidian/plugins/obsidian-webpage-export-master/scripts/render-api.ts b/.obsidian/plugins/obsidian-webpage-export-master/scripts/render-api.ts deleted file mode 100644 index 9b4e7ed5..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/scripts/render-api.ts +++ /dev/null @@ -1,1078 +0,0 @@ -import { MarkdownRendererAPIOptions, MarkdownWebpageRendererAPIOptions } from "./api-options"; -import { Component, Notice, WorkspaceLeaf, MarkdownRenderer as ObsidianRenderer, MarkdownPreviewView, loadMermaid, TFile, MarkdownView, View } from "obsidian"; -import { Utils } from "scripts/utils/utils"; -import { TabManager } from "scripts/utils/tab-manager"; -import { Webpage } from "scripts/objects/webpage"; -import * as electron from 'electron'; -import { ExportLog } from "./html-generation/render-log"; -import { AssetHandler } from "./html-generation/asset-handler"; - -export namespace MarkdownRendererAPI -{ - export let convertableExtensions = ["md", "canvas", "drawing", "excalidraw"]; // drawing is an alias for excalidraw - - function makeHeadingsTrees(html: HTMLElement) - { - - // make headers into format: - /* - - .heading-wrapper - - h1.heading - - .heading-collapse-indicator.collapse-indicator.collapse-icon - - "Text" - - .heading-children - */ - - function getHeaderEl(headingContainer: HTMLDivElement) - { - let first = headingContainer.firstElementChild; - if (first && /[Hh][1-6]/g.test(first.tagName)) return first; - else return; - } - - function makeHeaderTree(headerDiv: HTMLDivElement, childrenContainer: HTMLElement) - { - let headerEl = getHeaderEl(headerDiv); - - if (!headerEl) return; - - let possibleChild = headerDiv.nextElementSibling; - - while (possibleChild != null) - { - let possibleChildHeader = getHeaderEl(possibleChild as HTMLDivElement); - - if(possibleChildHeader) - { - // if header is a sibling of this header then break - if (possibleChildHeader.tagName <= headerEl.tagName) - { - break; - } - - // if we reached the footer then break - if (possibleChildHeader.querySelector(":has(section.footnotes)") || possibleChildHeader.classList.contains("mod-footer")) - { - break; - } - } - - let nextEl = possibleChild.nextElementSibling; - childrenContainer.appendChild(possibleChild); - possibleChild = nextEl; - } - } - - html.querySelectorAll("div:has(> :is(h1, h2, h3, h4, h5, h6):not([class^='block-language-'] *)):not(.markdown-preview-sizer)").forEach(function (header: HTMLDivElement) - { - header.classList.add("heading-wrapper"); - - let hEl = getHeaderEl(header) as HTMLHeadingElement; - - if (!hEl || hEl.classList.contains("heading")) return; - - hEl.classList.add("heading"); - - let collapseIcon = hEl.querySelector(".heading-collapse-indicator"); - if (!collapseIcon) - { - collapseIcon = hEl.createDiv({ cls: "heading-collapse-indicator collapse-indicator collapse-icon" }); - collapseIcon.innerHTML = _MarkdownRendererInternal.arrowHTML; - hEl.prepend(collapseIcon); - } - - let children = header.createDiv({ cls: "heading-children" }); - - makeHeaderTree(header, children); - }); - - // add "heading" class to all headers that don't have it - html.querySelectorAll(":is(h1, h2, h3, h4, h5, h6):not(.heading)").forEach((el) => el.classList.add("heading")); - - // remove collapsible arrows from h1 and inline titles - html.querySelectorAll("div h1, div .inline-title").forEach((element) => - { - element.querySelector(".heading-collapse-indicator")?.remove(); - }); - - // remove all new lines from header elements which cause spacing issues - html.querySelectorAll("h1, h2, h3, h4, h5, h6").forEach((el) => el.innerHTML = el.innerHTML.replaceAll("\n", "")); - } - - export async function renderMarkdownToString(markdown: string, options?: MarkdownRendererAPIOptions): Promise - { - options = Object.assign(new MarkdownRendererAPIOptions(), options); - let html = await _MarkdownRendererInternal.renderMarkdown(markdown, options); - if (!html) return; - if(options.postProcess) await _MarkdownRendererInternal.postProcessHTML(html, options); - if (options.makeHeadersTrees) makeHeadingsTrees(html); - let text = html.innerHTML; - if (!options.container) html.remove(); - return text; - } - - export async function renderMarkdownToElement(markdown: string, options?: MarkdownRendererAPIOptions): Promise - { - options = Object.assign(new MarkdownRendererAPIOptions(), options); - let html = await _MarkdownRendererInternal.renderMarkdown(markdown, options); - if (!html) return; - if(options.postProcess) await _MarkdownRendererInternal.postProcessHTML(html, options); - if (options.makeHeadersTrees) makeHeadingsTrees(html); - return html; - } - - // export async function renderMarkdownsToStrings(markdowns: string[], options?: MarkdownRendererAPIOptions): Promise<(string | undefined)[]> - // { - // options = Object.assign(new MarkdownRendererAPIOptions(), options); - // await _MarkdownRendererInternal.beginBatch(options); - // let results = await Promise.all(markdowns.map(markdown => this.renderMarkdownToString(markdown, options))); - // _MarkdownRendererInternal.endBatch(); - // return results; - // } - - // export async function renderMarkdownsToElements(markdowns: string[], options?: MarkdownRendererAPIOptions): Promise<(HTMLElement | undefined)[]> - // { - // options = Object.assign(new MarkdownRendererAPIOptions(), options); - // await _MarkdownRendererInternal.beginBatch(options); - // let results = await Promise.all(markdowns.map(markdown => this.renderMarkdownToElement(markdown, options))); - // _MarkdownRendererInternal.endBatch(); - // return results; - // } - - export async function renderFile(file: TFile, options?: MarkdownRendererAPIOptions): Promise<{contentEl: HTMLElement; viewType: string;} | undefined> - { - options = Object.assign(new MarkdownRendererAPIOptions(), options); - let result = await _MarkdownRendererInternal.renderFile(file, options); - if (!result) return; - - - if (options.postProcess) await _MarkdownRendererInternal.postProcessHTML(result.contentEl, options); - if (options.makeHeadersTrees) makeHeadingsTrees(result.contentEl); - - - return result; - } - - export async function renderFileToString(file: TFile, options?: MarkdownRendererAPIOptions): Promise - { - options = Object.assign(new MarkdownRendererAPIOptions(), options); - let result = await this.renderFile(file, options); - if (!result) return; - let text = result.contentEl.innerHTML; - if (!options.container) result.contentEl.remove(); - return text; - } - - export async function renderFileToWebpage(file: TFile, options?: MarkdownWebpageRendererAPIOptions): Promise - { - options = Object.assign(new MarkdownWebpageRendererAPIOptions(), options); - this.beginBatch(options); - let webpage : Webpage | undefined = new Webpage(file, undefined, file.basename, undefined, options); - webpage = await webpage.create(); - - if (!webpage) - { - ExportLog.error("Failed to create webpage for file " + file.path); - return; - } - - this.endBatch(); - - return webpage; - } - - export async function renderMarkdownSimple(markdown: string): Promise - { - let container = document.body.createDiv(); - await _MarkdownRendererInternal.renderSimpleMarkdown(markdown, container); - let text = container.innerHTML; - container.remove(); - return text; - } - - export async function renderMarkdownSimpleEl(markdown: string, container: HTMLElement) - { - await _MarkdownRendererInternal.renderSimpleMarkdown(markdown, container); - } - - export function isConvertable(extention: string) - { - if (extention.startsWith(".")) extention = extention.substring(1); - return this.convertableExtensions.contains(extention); - } - - export function checkCancelled(): boolean - { - return _MarkdownRendererInternal.checkCancelled(); - } - - export async function beginBatch(options?: MarkdownRendererAPIOptions) - { - options = Object.assign(new MarkdownRendererAPIOptions(), options); - await _MarkdownRendererInternal.beginBatch(options); - } - - export function endBatch() - { - _MarkdownRendererInternal.endBatch(); - } - -} - -export namespace _MarkdownRendererInternal -{ - export let renderLeaf: WorkspaceLeaf | undefined; - export let electronWindow: electron.BrowserWindow | undefined; - export let errorInBatch: boolean = false; - export let cancelled: boolean = false; - export let batchStarted: boolean = false; - let logContainer: HTMLElement | undefined; - let loadingContainer: HTMLElement | undefined; - - const infoColor = "var(--text-normal)"; - const warningColor = "var(--color-yellow)"; - const errorColor = "var(--color-red)"; - const infoBoxColor = "rgba(0,0,0,0.15)" - const warningBoxColor = "rgba(var(--color-yellow-rgb), 0.15)"; - const errorBoxColor = "rgba(var(--color-red-rgb), 0.15)"; - export const arrowHTML = ""; - - export function checkCancelled(): boolean - { - if (_MarkdownRendererInternal.cancelled || !_MarkdownRendererInternal.renderLeaf) - { - ExportLog.log("cancelled"); - _MarkdownRendererInternal.endBatch(); - return true; - } - - return false; - } - - function failRender(file: TFile | undefined, message: any): undefined - { - if (checkCancelled()) return undefined; - - ExportLog.error(message, `Rendering ${file?.path ?? " custom markdown "} failed: `); - return; - } - - export async function renderFile(file: TFile, options: MarkdownRendererAPIOptions): Promise<{contentEl: HTMLElement, viewType: string} | undefined> - { - let loneFile = !batchStarted; - if (loneFile) - { - ExportLog.log("Exporting single file, starting batch"); - await _MarkdownRendererInternal.beginBatch(options); - } - - let success = await Utils.waitUntil(() => renderLeaf != undefined || checkCancelled(), 2000, 1); - if (!success || !renderLeaf) return failRender(file, "Failed to get leaf for rendering!"); - - - try - { - await renderLeaf.openFile(file, { active: false}); - } - catch (e) - { - return failRender(file, e); - } - - - let html: HTMLElement | undefined; - let view = renderLeaf.view; - let viewType = view.getViewType(); - - switch(viewType) - { - case "markdown": - // @ts-ignore - let preview = view.previewMode; - html = await renderMarkdownView(preview, options); - break; - case "kanban": - html = await renderGeneric(view, options); - break; - case "excalidraw": - html = await renderExcalidraw(view, options); - break; - case "canvas": - html = await renderCanvas(view, options); - break; - default: - html = await renderGeneric(view, options); - break; - } - - if(checkCancelled()) return undefined; - if (!html) return failRender(file, "Failed to render file!"); - - if (loneFile) _MarkdownRendererInternal.endBatch(); - - return {contentEl: html, viewType: viewType}; - } - - export async function renderMarkdown(markdown: string, options: MarkdownRendererAPIOptions): Promise - { - let loneFile = !batchStarted; - if (loneFile) - { - ExportLog.log("Exporting single file, starting batch"); - await _MarkdownRendererInternal.beginBatch(options); - } - - let success = await Utils.waitUntil(() => renderLeaf != undefined || checkCancelled(), 2000, 1); - if (!success || !renderLeaf) return failRender(undefined, "Failed to get leaf for rendering!"); - - - let view = new MarkdownView(renderLeaf); - renderLeaf.view = view; - - try - { - view.setViewData(markdown, true); - } - catch (e) - { - return failRender(undefined, e); - } - - - let html: HTMLElement | undefined; - - // @ts-ignore - let preview = view.previewMode; - html = await renderMarkdownView(preview, options); - - if(checkCancelled()) return undefined; - if (!html) return failRender(undefined, "Failed to render file!"); - - if (loneFile) _MarkdownRendererInternal.endBatch(); - - return html; - } - - export async function renderMarkdownView(preview: MarkdownPreviewView, options: MarkdownRendererAPIOptions): Promise - { - preview.load(); - // @ts-ignore - let renderer = preview.renderer; - await renderer.unfoldAllHeadings(); - await renderer.unfoldAllLists(); - await renderer.parseSync(); - - // @ts-ignore - if (!window.mermaid) - { - await loadMermaid(); - } - - let sections = renderer.sections as {"rendered": boolean, "height": number, "computed": boolean, "lines": number, "lineStart": number, "lineEnd": number, "used": boolean, "highlightRanges": number, "level": number, "headingCollapsed": boolean, "shown": boolean, "usesFrontMatter": boolean, "html": string, "el": HTMLElement}[]; - - - let newMarkdownEl = document.body.createDiv({ cls: "markdown-preview-view markdown-rendered" }); - let newSizerEl = newMarkdownEl.createDiv({ cls: "markdown-preview-sizer markdown-preview-section" }); - - if (!newMarkdownEl || !newSizerEl) return failRender(preview.file, "Please specify a container element, or enable keepViewContainer!"); - - preview.containerEl = newSizerEl; - - // @ts-ignore - let promises: Promise[] = []; - let foldedCallouts: HTMLElement[] = []; - for (let i = 0; i < sections.length; i++) - { - let section = sections[i]; - - section.shown = true; - section.rendered = false; - // @ts-ignore - section.resetCompute(); - // @ts-ignore - section.setCollapsed(false); - section.el.empty(); - - newSizerEl.appendChild(section.el); - - // @ts-ignore - await section.render(); - - // @ts-ignore - let success = await Utils.waitUntil(() => (section.el && section.rendered) || checkCancelled(), 2000, 1); - if (!success) return failRender(preview.file, "Failed to render section!"); - - await renderer.measureSection(section); - success = await Utils.waitUntil(() => section.computed || checkCancelled(), 2000, 1); - if (!success) return failRender(preview.file, "Failed to compute section!"); - - // @ts-ignore - await preview.postProcess(section, promises, renderer.frontmatter); - - // unfold callouts - let folded = Array.from(section.el.querySelectorAll(".callout-content[style*='display: none']")) as HTMLElement[]; - for (let callout of folded) - { - callout.style.display = ""; - } - foldedCallouts.push(...folded); - - // dataview support - // @ts-ignore - let dataview = app.plugins.plugins["dataview"]; - if (dataview) - { - let jsKeyword = dataview.settings?.dataviewJsKeyword ?? "dataviewjs"; - let emptyDataviewSelector = `:is(.block-language-dataview, .block-language-${jsKeyword}):not(.node-insert-event), :is(.block-language-dataview, .block-language-${jsKeyword}):empty` - await Utils.waitUntil(() => !section.el.querySelector(emptyDataviewSelector) || checkCancelled(), 4000, 1); - if (checkCancelled()) return undefined; - - if (section.el.querySelector(emptyDataviewSelector)) - { - ExportLog.warning("Dataview plugin elements were not rendered correctly in file " + preview.file.name + "!"); - } - } - - // wait for transclusions - await Utils.waitUntil(() => !section.el.querySelector(".markdown-preview-sizer:empty") || checkCancelled(), 500, 1); - if (checkCancelled()) return undefined; - - if (section.el.querySelector(".markdown-preview-sizer:empty")) - { - ExportLog.warning("Transclusions were not rendered correctly in file " + preview.file.name + "!"); - } - - // wait for generic plugins - await Utils.waitUntil(() => !section.el.querySelector("[class^='block-language-']:empty") || checkCancelled(), 500, 1); - if (checkCancelled()) return undefined; - - // convert canvas elements into images here because otherwise they will lose their data when moved - let canvases = Array.from(section.el.querySelectorAll("canvas:not(.pdf-embed canvas)")) as HTMLCanvasElement[]; - for (let canvas of canvases) - { - let data = canvas.toDataURL(); - if (data.length < 100) - { - ExportLog.log(canvas.outerHTML, "Failed to render canvas based plugin element in file " + preview.file.name + ":"); - canvas.remove(); - continue; - } - - let image = document.createElement("img"); - image.src = data; - image.style.width = canvas.style.width || "100%"; - image.style.maxWidth = "100%"; - canvas.replaceWith(image); - }; - - console.debug(section.el.outerHTML); // for some reason adding this line here fixes an issue where some plugins wouldn't render - - let invalidPluginBlocks = Array.from(section.el.querySelectorAll("[class^='block-language-']:empty")); - for (let block of invalidPluginBlocks) - { - ExportLog.warning(`Plugin element ${block.className || block.parentElement?.className || "unknown"} from ${preview.file.name} not rendered correctly!`); - } - } - - // @ts-ignore - await Promise.all(promises); - - // refold callouts - for (let callout of foldedCallouts) - { - callout.style.display = "none"; - } - - newSizerEl.empty(); - // move all of them back in since rendering can cause some sections to move themselves out of their container - for (let i = 0; i < sections.length; i++) - { - let section = sections[i]; - newSizerEl.appendChild(section.el.cloneNode(true)); - } - - // get banner plugin banner and insert it before the sizer element - let banner = preview.containerEl.querySelector(".obsidian-banner-wrapper"); - if (banner) - { - newSizerEl.before(banner); - } - - // if we aren't kepping the view element then only keep the content of the sizer element - if (options.keepViewContainer === false) - { - newMarkdownEl.outerHTML = newSizerEl.innerHTML; - console.log("keeping only sizer content"); - } - - options.container?.appendChild(newMarkdownEl); - - return newMarkdownEl; - } - - export async function renderSimpleMarkdown(markdown: string, container: HTMLElement) - { - let renderComp = new Component(); - renderComp.load(); - await ObsidianRenderer.render(app, markdown, container, "/", renderComp); - renderComp.unload(); - - let renderedEl = container.children[container.children.length - 1]; - if (renderedEl && renderedEl.tagName == "P") - { - renderedEl.outerHTML = renderedEl.innerHTML; // remove the outer

tag - } - - // remove tags - container.querySelectorAll("a.tag").forEach((element: HTMLAnchorElement) => - { - element.remove(); - }); - - //remove rendered lists and replace them with plain text - container.querySelectorAll("ol").forEach((listEl: HTMLElement) => - { - if(listEl.parentElement) - { - let start = listEl.getAttribute("start") ?? "1"; - listEl.parentElement.createSpan().outerHTML = `${start}. ${listEl.innerText}`; - listEl.remove(); - } - }); - container.querySelectorAll("ul").forEach((listEl: HTMLElement) => - { - if(listEl.parentElement) - { - listEl.parentElement.createSpan().innerHTML = "- " + listEl.innerHTML; - listEl.remove(); - } - }); - container.querySelectorAll("li").forEach((listEl: HTMLElement) => - { - if(listEl.parentElement) - { - listEl.parentElement.createSpan().innerHTML = listEl.innerHTML; - listEl.remove(); - } - }); - } - - async function renderGeneric(view: View, options: MarkdownRendererAPIOptions): Promise - { - await Utils.delay(2000); - - if (checkCancelled()) return undefined; - - // @ts-ignore - let contentEl = view.containerEl; - options.container?.appendChild(contentEl); - - return contentEl; - } - - async function renderExcalidraw(view: any, options: MarkdownRendererAPIOptions): Promise - { - await Utils.delay(500); - - // @ts-ignore - let scene = view.excalidrawData.scene; - - // @ts-ignore - let svg = await view.svg(scene, "", false); - - // remove rect fill - let isLight = !svg.getAttribute("filter"); - if (!isLight) svg.removeAttribute("filter"); - svg.classList.add(isLight ? "light" : "dark"); - - let contentEl = document.createElement("div"); - contentEl.classList.add("view-content"); - let sizerEl = contentEl.createDiv(); - sizerEl.classList.add("excalidraw-plugin"); - - sizerEl.appendChild(svg); - - if (checkCancelled()) return undefined; - - if (options.keepViewContainer === false) - { - contentEl = svg; - } - - options.container?.appendChild(contentEl); - - return contentEl; - } - - export async function renderCanvas(view: any, options: MarkdownRendererAPIOptions): Promise - { - if (checkCancelled()) return undefined; - - let canvas = view.canvas; - - let nodes = canvas.nodes; - let edges = canvas.edges; - - for (const node of nodes) - { - await node[1].render(); - } - - for (const edge of edges) - { - await edge[1].render(); - } - - canvas.zoomToFit(); - await Utils.delay(500); - - let contentEl = view.contentEl; - let canvasEl = contentEl.querySelector(".canvas"); - canvasEl.innerHTML = ""; - - let edgeContainer = canvasEl.createEl("svg", { cls: "canvas-edges" }); - let edgeHeadContainer = canvasEl.createEl("svg", { cls: "canvas-edges" }); - - for (const node of nodes) - { - let nodeEl = node[1].nodeEl; - let childPreview = node[1]?.child?.previewMode; - let embedEl = nodeEl.querySelector(".markdown-embed-content.node-insert-event"); - - if (childPreview && embedEl) - { - node[1].render(); - embedEl.innerHTML = ""; - let optionsCopy = Object.assign({}, options); - optionsCopy.container = embedEl; - await renderMarkdownView(childPreview, optionsCopy); - } - - canvasEl.appendChild(nodeEl); - } - - for (const edge of edges) - { - let edgeEl = edge[1].lineGroupEl; - let headEl = edge[1].lineEndGroupEl; - - edgeContainer.appendChild(edgeEl); - edgeHeadContainer.appendChild(headEl); - - if(edge[1].label) - { - let labelEl = edge[1].labelElement.wrapperEl; - canvasEl.appendChild(labelEl); - } - } - - if (checkCancelled()) return undefined; - - if (options.keepViewContainer === false) - { - contentEl = canvasEl; - } - - options.container?.appendChild(contentEl); - - return contentEl; - } - - export async function postProcessHTML(html: HTMLElement, options: MarkdownRendererAPIOptions) - { - // remove the extra elements if they are not wanted - if (options.keepViewContainer === false) - { - html.querySelectorAll(".mod-header, .mod-footer").forEach((e: HTMLElement) => e.remove()); - } - - // transclusions put a div inside a p tag, which is invalid html. Fix it here - html.querySelectorAll("p:has(div)").forEach((element) => - { - // replace the p tag with a span - let span = document.body.createEl("span"); - span.innerHTML = element.innerHTML; - element.replaceWith(span); - span.style.display = "block"; - span.style.marginBlockStart = "var(--p-spacing)"; - span.style.marginBlockEnd = "var(--p-spacing)"; - }); - - // encode all text input values into attributes - html.querySelectorAll("input[type=text]").forEach((element: HTMLElement) => - { - // @ts-ignore - element.setAttribute("value", element.value); - // @ts-ignore - element.value = ""; - }); - - // encode all text area values into text content - html.querySelectorAll("textarea").forEach((element: HTMLElement) => - { - // @ts-ignore - element.textContent = element.value; - }); - - // convert tag href to search query - html.querySelectorAll("a.tag").forEach((element: HTMLAnchorElement) => - { - let split = element.href.split("#"); - let tag = split[1] ?? element.href.substring(1); // remove the # - element.setAttribute("href", `?query=tag:${tag}`); - }); - - // convert all hard coded image / media widths into max widths - html.querySelectorAll("img, video, .media-embed:has( > :is(img, video))").forEach((element: HTMLElement) => - { - let width = element.getAttribute("width"); - if (width) - { - element.removeAttribute("width"); - element.style.width = (width.trim() != "") ? (width + "px") : ""; - element.style.maxWidth = "100%"; - } - }); - - // replace obsidian's pdf embeds with normal embeds - // this has to happen before converting canvases because the pdf embeds use canvas elements - html.querySelectorAll("span.internal-embed.pdf-embed").forEach((pdf: HTMLElement) => - { - let embed = document.createElement("embed"); - embed.setAttribute("src", pdf.getAttribute("src") ?? ""); - embed.style.width = pdf.style.width || '100%'; - embed.style.maxWidth = "100%"; - embed.style.height = pdf.style.height || '800px'; - - let container = pdf.parentElement?.parentElement; - - container?.querySelectorAll("*").forEach((el) => el.remove()); - - if (container) container.appendChild(embed); - }); - - // remove all MAKE.md elements - html.querySelectorAll("div[class^='mk-']").forEach((element: HTMLElement) => - { - element.remove(); - }); - - // move frontmatter before markdown-preview-sizer - let frontmatter = html.querySelector(".frontmatter"); - if (frontmatter) - { - let frontmatterParent = frontmatter.parentElement; - let sizer = html.querySelector(".markdown-preview-sizer"); - if (sizer) - { - sizer.before(frontmatter); - } - frontmatterParent?.remove(); - } - - // add lazy loading to iframe elements - html.querySelectorAll("iframe").forEach((element: HTMLIFrameElement) => - { - element.setAttribute("loading", "lazy"); - }); - - // add collapse icons to lists if they don't already have them - var collapsableListItems = Array.from(html.querySelectorAll("li:has(ul), li:has(ol)")); - for (const item of collapsableListItems) - { - let collapseIcon = item.querySelector(".collapse-icon"); - if (!collapseIcon) - { - collapseIcon = item.createDiv({ cls: "list-collapse-indicator collapse-indicator collapse-icon" }); - collapseIcon.innerHTML = this.arrowHTML; - item.prepend(collapseIcon); - } - } - - // if the dynamic table of contents plugin is included on this page - // then parse each list item and render markdown for it - let tocEls = Array.from(html.querySelectorAll(".block-language-toc.dynamic-toc li > a")); - for (const element of tocEls) - { - let renderEl = document.body.createDiv(); - renderSimpleMarkdown(element.textContent ?? "", renderEl); - element.textContent = renderEl.textContent; - renderEl.remove(); - } - } - - export async function beginBatch(options: MarkdownRendererAPIOptions | MarkdownWebpageRendererAPIOptions) - { - if(batchStarted) return; - - errorInBatch = false; - cancelled = false; - batchStarted = true; - loadingContainer = undefined; - logContainer = undefined; - logShowing = false; - AssetHandler.exportOptions = options; - - renderLeaf = TabManager.openNewTab("window", "vertical"); - - // @ts-ignore - let parentFound = await Utils.waitUntil(() => (renderLeaf && renderLeaf.parent) || checkCancelled(), 2000, 1); - if (!parentFound) - { - try - { - renderLeaf.detach(); - } - catch (e) - { - ExportLog.error(e, "Failed to detach render leaf: "); - } - - if (!checkCancelled()) - { - new Notice("Error: Failed to create leaf for rendering!"); - throw new Error("Failed to create leaf for rendering!"); - } - - return; - } - - let obsidianWindow = renderLeaf.view.containerEl.win; - // @ts-ignore - electronWindow = obsidianWindow.electronWindow as electron.BrowserWindow; - - if (!electronWindow) - { - new Notice("Failed to get the render window, please try again."); - errorInBatch = false; - cancelled = false; - batchStarted = false; - renderLeaf = undefined; - electronWindow = undefined; - return; - } - - if (options.displayProgress === false) - { - let newPosition = {x: 0, y: window.screen.height}; - obsidianWindow.moveTo(newPosition.x, newPosition.y); - electronWindow.hide(); - } - else - { - // hide the leaf so we can render without intruding on the user - // @ts-ignore - renderLeaf.parent.containerEl.style.height = "0"; - // @ts-ignore - renderLeaf.parent.parent.containerEl.querySelector(".clickable-icon, .workspace-tab-header-container-inner").style.display = "none"; - // @ts-ignore - renderLeaf.parent.containerEl.style.maxHeight = "var(--header-height)"; - // @ts-ignore - renderLeaf.parent.parent.containerEl.classList.remove("mod-vertical"); - // @ts-ignore - renderLeaf.parent.parent.containerEl.classList.add("mod-horizontal"); - - let newSize = { width: 800, height: 400 }; - obsidianWindow.resizeTo(newSize.width, newSize.height); - let newPosition = {x: window.screen.width / 2 - 450, y: window.screen.height - 450 - 75}; - obsidianWindow.moveTo(newPosition.x, newPosition.y); - } - - electronWindow.setAlwaysOnTop(true, "floating", 1); - electronWindow.webContents.setBackgroundThrottling(false); - - function windowClosed() - { - if (cancelled) return; - endBatch(); - cancelled = true; - electronWindow?.off("close", windowClosed); - } - - electronWindow.on("close", windowClosed); - - - createLoadingContainer(); - } - - export function endBatch() - { - if (!batchStarted) return; - - if (renderLeaf) - { - if (!errorInBatch) - { - ExportLog.log("Closing render window"); - renderLeaf.detach(); - } - else - { - ExportLog.warning("Error in batch, leaving render window open"); - _reportProgress(1, 1, "Completed with errors", "Please see the log for more details.", errorColor); - } - } - - electronWindow = undefined; - renderLeaf = undefined; - - batchStarted = false; - } - - function generateLogEl(title: string, message: any, textColor: string, backgroundColor: string): HTMLElement - { - let logEl = document.createElement("div"); - logEl.className = "html-render-log-item"; - logEl.style.display = "flex"; - logEl.style.flexDirection = "column"; - logEl.style.marginBottom = "2px"; - logEl.style.fontSize = "12px"; - logEl.innerHTML = - ` -

-
- `; - logEl.querySelector(".html-render-log-title")!.textContent = title; - logEl.querySelector(".html-render-log-message")!.textContent = message.toString(); - - logEl.style.color = textColor; - logEl.style.backgroundColor = backgroundColor; - logEl.style.borderLeft = `5px solid ${textColor}`; - logEl.style.borderBottom = "1px solid var(--divider-color)"; - logEl.style.borderTop = "1px solid var(--divider-color)"; - - return logEl; - } - - function createLoadingContainer() - { - if (!loadingContainer) - { - loadingContainer = document.createElement("div"); - loadingContainer.className = `html-render-progress-container`; - loadingContainer.setAttribute("style", "height: 100%; min-width: 100%; display:flex; flex-direction:column; align-content: center; justify-content: center; align-items: center;"); - loadingContainer.innerHTML = - ` -
-
-
-

Generating HTML

- - -
- -
-
- ` - - // @ts-ignore - renderLeaf.parent.parent.containerEl.appendChild(loadingContainer); - } - } - - let logShowing = false; - function appendLogEl(logEl: HTMLElement) - { - logContainer = loadingContainer?.querySelector(".html-render-log") ?? undefined; - - if(!logContainer || !renderLeaf) - { - console.error("Failed to append log element, log container or render leaf is undefined!"); - return; - } - - if (!logShowing) - { - renderLeaf.view.containerEl.win.resizeTo(900, 500); - logContainer.style.display = "flex"; - logShowing = true; - } - - logContainer.appendChild(logEl); - // @ts-ignore - logEl.scrollIntoView({ behavior: "instant", block: "end", inline: "end" }); - } - - export async function _reportProgress(complete: number, total:number, message: string, subMessage: string, progressColor: string) - { - if (!batchStarted) return; - - // @ts-ignore - if (!renderLeaf || !renderLeaf.parent || !renderLeaf.parent.parent) return; - - // @ts-ignore - let loadingContainer = renderLeaf.parent.parent.containerEl.querySelector(`.html-render-progress-container`); - if (!loadingContainer) return; - - - let progress = complete / total; - - let progressBar = loadingContainer.querySelector("progress"); - if (progressBar) - { - progressBar.value = progress; - progressBar.style.backgroundColor = "transparent"; - progressBar.style.color = progressColor; - } - - - let messageElement = loadingContainer.querySelector("h1"); - if (messageElement) - { - messageElement.innerText = message; - } - - let subMessageElement = loadingContainer.querySelector("span.html-render-submessage") as HTMLElement; - if (subMessageElement) - { - subMessageElement.innerText = subMessage; - } - - electronWindow?.setProgressBar(progress); - } - - export async function _reportError(messageTitle: string, message: any, fatal: boolean) - { - if (!batchStarted) return; - - errorInBatch = true; - - // @ts-ignore - let found = await Utils.waitUntil(() => renderLeaf && renderLeaf.parent && renderLeaf.parent.parent, 100, 10); - if (!found) return; - - appendLogEl(generateLogEl(messageTitle, message, errorColor, errorBoxColor)); - - if (fatal) - { - renderLeaf = undefined; - loadingContainer = undefined; - logContainer = undefined; - } - } - - export async function _reportWarning(messageTitle: string, message: any) - { - if (!batchStarted) return; - - // @ts-ignore - let found = await Utils.waitUntil(() => renderLeaf && renderLeaf.parent && renderLeaf.parent.parent, 100, 10); - if (!found) return; - - appendLogEl(generateLogEl(messageTitle, message, warningColor, warningBoxColor)); - } - - export async function _reportInfo(messageTitle: string, message: any) - { - if (!batchStarted) return; - - // @ts-ignore - let found = await Utils.waitUntil(() => renderLeaf && renderLeaf.parent && renderLeaf.parent.parent, 100, 10); - if (!found) return; - - appendLogEl(generateLogEl(messageTitle, message, infoColor, infoBoxColor)); - } - -} diff --git a/.obsidian/plugins/obsidian-webpage-export-master/scripts/settings/export-modal.ts b/.obsidian/plugins/obsidian-webpage-export-master/scripts/settings/export-modal.ts deleted file mode 100644 index bb96e287..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/scripts/settings/export-modal.ts +++ /dev/null @@ -1,271 +0,0 @@ -import { ButtonComponent, Modal, Setting, TFile } from 'obsidian'; -import { Utils } from '../utils/utils'; -import HTMLExportPlugin from '../main'; -import { ExportPreset, Settings, SettingsPage } from './settings'; -import { FilePickerTree } from '../objects/file-picker'; -import { Path } from 'scripts/utils/path'; - -export interface ExportInfo -{ - canceled: boolean; - pickedFiles: TFile[]; - exportPath: Path; - validPath: boolean; -} - -export class ExportModal extends Modal -{ - private isClosed: boolean = true; - private canceled: boolean = true; - private filePickerModalEl: HTMLElement; - private filePicker: FilePickerTree; - private pickedFiles: TFile[] | undefined = undefined; - private validPath: boolean = true; - public static title: string = "Export to HTML"; - - public exportInfo: ExportInfo; - - constructor() { - super(app); - } - - overridePickedFiles(files: TFile[]) - { - this.pickedFiles = files; - } - - /** - * @brief Opens the modal and async blocks until the modal is closed. - * @returns True if the EXPORT button was pressed, false is the export was canceled. - * @override - */ - async open(): Promise - { - this.isClosed = false; - this.canceled = true; - - super.open(); - - if(!this.filePickerModalEl) - { - this.filePickerModalEl = this.containerEl.createDiv({ cls: 'modal' }); - this.containerEl.insertBefore(this.filePickerModalEl, this.modalEl); - this.filePickerModalEl.style.position = 'relative'; - this.filePickerModalEl.style.zIndex = "1"; - this.filePickerModalEl.style.width = "25em"; - this.filePickerModalEl.style.padding = "0"; - this.filePickerModalEl.style.margin = "10px"; - this.filePickerModalEl.style.maxHeight = "80%"; - this.filePickerModalEl.style.boxShadow = "0 0 7px 1px inset #00000060"; - - let container = this.filePickerModalEl.createDiv({ cls: 'modal-content tree-container mod-root file-picker-tree file-tree mod-nav-indicator' }); - container.style.height = "100%"; - container.style.width = "100%"; - container.style.padding = "0"; - container.style.margin = "0"; - container.style.display = "flex"; - container.style.flexDirection = "column"; - container.style.alignItems = "flex-end"; - - let scrollArea = container.createDiv({ cls: 'tree-scroll-area' }); - scrollArea.style.height = "100%"; - scrollArea.style.width = "100%"; - scrollArea.style.overflowY = "auto"; - scrollArea.style.overflowX = "hidden"; - scrollArea.style.padding = "1em"; - scrollArea.style.boxShadow = "0 0 7px 1px inset #00000060"; - - this.filePicker = new FilePickerTree(app.vault.getFiles(), true, true); - this.filePicker.generateWithItemsClosed = true; - this.filePicker.showFileExtentionTags = true; - this.filePicker.hideFileExtentionTags = ["md"]; - await this.filePicker.generateTree(scrollArea); - - if((this.pickedFiles?.length ?? 0 > 0) || Settings.filesToExport[0].length > 0) - { - let filesToPick = this.pickedFiles?.map(file => file.path) ?? Settings.filesToExport[0]; - this.filePicker.setSelectedFiles(filesToPick); - } - - let saveFiles = new Setting(container).addButton((button) => - { - button.setButtonText("Save").onClick(async () => - { - Settings.filesToExport[0] = this.filePicker.getSelectedFilesSavePaths(); - await SettingsPage.saveSettings(); - }); - }); - - saveFiles.settingEl.style.border = "none"; - saveFiles.settingEl.style.marginRight = "1em"; - } - - - const { contentEl } = this; - - contentEl.empty(); - - this.titleEl.setText(ExportModal.title); - - if (HTMLExportPlugin.updateInfo.updateAvailable) - { - // create red notice showing the update is available - let updateNotice = contentEl.createEl('strong', { text: `Update Available: ${HTMLExportPlugin.updateInfo.currentVersion} ⟶ ${HTMLExportPlugin.updateInfo.latestVersion}` }); - updateNotice.setAttribute("style", - `margin-block-start: calc(var(--h3-size)/2); - background-color: var(--interactive-normal); - padding: 4px; - padding-left: 1em; - padding-right: 1em; - color: var(--color-red); - border-radius: 5px; - display: block; - width: fit-content;`) - - // create normal block with update notes - let updateNotes = contentEl.createEl('div', { text: HTMLExportPlugin.updateInfo.updateNote }); - updateNotes.setAttribute("style", - `margin-block-start: calc(var(--h3-size)/2); - background-color: var(--background-secondary-alt); - padding: 4px; - padding-left: 1em; - padding-right: 1em; - color: var(--text-normal); - font-size: var(--font-ui-smaller); - border-radius: 5px; - display: block; - width: fit-content; - white-space: pre-wrap;`) - } - - let modeDescriptions = - { - "website": "This will export a file structure suitable for uploading to your own web server.", - "documents": "This will export self-contained, but slow loading and large, html documents.", - "raw-documents": "This will export raw, self-contained documents without the website layout. This is useful for sharing individual notes, or printing." - } - - let exportModeSetting = new Setting(contentEl) - .setName('Export Mode') - // @ts-ignore - .setDesc(modeDescriptions[Settings.exportPreset] + "\n\nSome options are only available in certain modes.") - .setHeading() - .addDropdown((dropdown) => dropdown - .addOption('website', 'Online Web Server') - .addOption('documents', 'HTML Documents') - .addOption('raw-documents', 'Raw HTML Documents') - .setValue(["website", "documents", "raw-documents"].contains(Settings.exportPreset) ? Settings.exportPreset : 'website') - .onChange(async (value) => - { - Settings.exportPreset = value as ExportPreset; - - switch (value) { - case 'website': - Settings.inlineAssets = false; - Settings.makeNamesWebStyle = true; - Settings.addGraphView = true; - Settings.addFileNav = true; - Settings.addSearchBar = true; - await SettingsPage.saveSettings(); - - break; - case 'documents': - Settings.inlineAssets = true; - Settings.makeNamesWebStyle = false; - Settings.addFileNav = true; - Settings.addGraphView = false; - Settings.addSearchBar = false; - await SettingsPage.saveSettings(); - - break; - case 'raw-documents': - Settings.inlineAssets = true; - Settings.makeNamesWebStyle = false; - Settings.addGraphView = false; - Settings.addFileNav = false; - Settings.addSearchBar = false; - await SettingsPage.saveSettings(); - - break; - } - - this.open(); - } - )); - exportModeSetting.descEl.style.whiteSpace = "pre-wrap"; - - SettingsPage.createToggle(contentEl, "Open after export", () => Settings.openAfterExport, (value) => Settings.openAfterExport = value); - - let exportButton : ButtonComponent | undefined = undefined; - - function setExportDisabled(disabled: boolean) - { - if(exportButton) - { - exportButton.setDisabled(disabled); - if (exportButton.disabled) exportButton.buttonEl.style.opacity = "0.5"; - else exportButton.buttonEl.style.opacity = "1"; - } - } - - let validatePath = (path: Path) => path.validate( - { - allowEmpty: false, - allowRelative: false, - allowAbsolute: true, - allowDirectories: true, - allowTildeHomeDirectory: true, - requireExists: true - }); - - let exportPathInput = SettingsPage.createFileInput(contentEl, () => Settings.exportPath, (value) => Settings.exportPath = value, - { - name: '', - description: '', - placeholder: 'Type or browse an export directory...', - defaultPath: Utils.idealDefaultPath(), - pickFolder: true, - validation: validatePath, - onChanged: (path) => (!validatePath(path).valid) ? setExportDisabled(true) : setExportDisabled(false) - }); - - let { fileInput } = exportPathInput; - - fileInput.addButton((button) => { - exportButton = button; - setExportDisabled(!this.validPath); - button.setButtonText('Export').onClick(async () => - { - this.canceled = false; - this.close(); - }); - }); - - new Setting(contentEl) - .setDesc("More options located on the plugin settings page.") - .addExtraButton((button) => button.setTooltip('Open plugin settings').onClick(() => { - //@ts-ignore - app.setting.open(); - //@ts-ignore - app.setting.openTabById('webpage-html-export'); - })); - - this.filePickerModalEl.style.height = this.modalEl.clientHeight * 2 + "px"; - - await Utils.waitUntil(() => this.isClosed, 60 * 60 * 1000, 10); - - this.pickedFiles = this.filePicker.getSelectedFiles(); - this.filePickerModalEl.remove(); - this.exportInfo = { canceled: this.canceled, pickedFiles: this.pickedFiles, exportPath: new Path(Settings.exportPath), validPath: this.validPath}; - - return this.exportInfo; - } - - onClose() - { - const { contentEl } = this; - contentEl.empty(); - this.isClosed = true; - ExportModal.title = "Export to HTML"; - } -} diff --git a/.obsidian/plugins/obsidian-webpage-export-master/scripts/settings/flow-list.ts b/.obsidian/plugins/obsidian-webpage-export-master/scripts/settings/flow-list.ts deleted file mode 100644 index b2b40198..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/scripts/settings/flow-list.ts +++ /dev/null @@ -1,50 +0,0 @@ - - -export class FlowList { - containerEl: HTMLElement; - flowListEl: HTMLElement; - checkedList: string[] = []; - - constructor(containerEl: HTMLElement) { - this.containerEl = containerEl; - this.flowListEl = this.containerEl.createDiv({ cls: 'flow-list' }); - - } - - addItem(name: string, key: string, value: boolean, onChange: (value: boolean) => void): HTMLElement { - let item = this.flowListEl.createDiv({ cls: 'flow-item' }); - let checkbox = item.createEl('input', { type: 'checkbox' }); - checkbox.checked = value; - if (checkbox.checked) this.checkedList.push(key) - - item.addEventListener('click', (evt) => - { - if (!checkbox.checked) - { - checkbox.checked = true; - if (!this.checkedList.includes(key)) - this.checkedList.push(key) - } - else - { - checkbox.checked = false; - if (this.checkedList.includes(key)) - this.checkedList.remove(key) - } - - onChange(checkbox.checked); - }); - - // override the default checkbox behavior - checkbox.onclick = (evt) => - { - checkbox.checked = !checkbox.checked; - } - - let label = item.createDiv({ cls: 'flow-label' }); - label.setText(name); - - return item; - } - -} diff --git a/.obsidian/plugins/obsidian-webpage-export-master/scripts/settings/settings-migration.ts b/.obsidian/plugins/obsidian-webpage-export-master/scripts/settings/settings-migration.ts deleted file mode 100644 index 4baa10ba..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/scripts/settings/settings-migration.ts +++ /dev/null @@ -1,50 +0,0 @@ -import HTMLExportPlugin from "scripts/main" -import { DEFAULT_SETTINGS, Settings, SettingsPage } from "./settings" -import { ExportLog } from "scripts/html-generation/render-log"; -import { Notice } from "obsidian"; - - -export async function migrateSettings() -{ - if (Settings.settingsVersion == HTMLExportPlugin.pluginVersion) return; - - new Notice("Webpage HTML Export settings have been updated to a new version. Please update your settings if any have been reset.", 10000); - - var settingsToSave = - [ - "filesToExport", - "exportPath", - "includePluginCSS", - "includeGraphView", - "graphMaxNodeSize", - "graphMinNodeSize", - "graphEdgePruning", - "graphCentralForce", - "graphRepulsionForce", - "graphLinkLength", - "graphAttractionForce", - ] - - try - { - var savedSettings = JSON.parse(JSON.stringify(Object.assign({}, Settings))); - Object.assign(Settings, DEFAULT_SETTINGS); - for (var i = 0; i < settingsToSave.length; i++) - { - var settingName = settingsToSave[i]; - // @ts-ignore - Settings[settingName] = savedSettings[settingName]; - } - - Settings.settingsVersion = HTMLExportPlugin.pluginVersion; - } - catch (e) - { - ExportLog.error(e, "Failed to migrate settings, resetting to default settings."); - Object.assign(Settings, DEFAULT_SETTINGS); - } - - await SettingsPage.saveSettings(); - - return; -} diff --git a/.obsidian/plugins/obsidian-webpage-export-master/scripts/settings/settings.ts b/.obsidian/plugins/obsidian-webpage-export-master/scripts/settings/settings.ts deleted file mode 100644 index e171b216..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/scripts/settings/settings.ts +++ /dev/null @@ -1,862 +0,0 @@ -import { Notice, Plugin, PluginSettingTab, Setting, TFile, TFolder, TextComponent, Vault, getIcon } from 'obsidian'; -import { Utils } from '../utils/utils'; -import { Path } from '../utils/path'; -import pluginStylesBlacklist from 'assets/third-party-styles-blacklist.txt'; -import { FlowList } from './flow-list'; -import { ExportInfo, ExportModal } from './export-modal'; -import { migrateSettings } from './settings-migration'; -import { ExportLog } from 'scripts/html-generation/render-log'; - -// #region Settings Definition - -export enum ExportPreset -{ - Website = "website", - Documents = "documents", - RawDocuments = "raw-documents", -} - -export enum EmojiStyle -{ - Native = "Native", - Twemoji = "Twemoji", - OpenMoji = "OpenMoji", - OpenMojiOutline = "OpenMojiOutline", - FluentUI = "FluentUI", -} - -export class Settings -{ - public static settingsVersion: string; - - // Asset Options - public static makeOfflineCompatible: boolean; - public static inlineAssets: boolean; - public static includePluginCSS: string; - public static includeSvelteCSS: boolean; - public static titleProperty: string; - public static customHeadContentPath: string; - public static faviconPath: string; - - // Layout Options - public static documentWidth: string; - public static sidebarWidth: string; - - // Behavior Options - public static minOutlineCollapse: number; - public static startOutlineCollapsed: boolean; - public static allowFoldingHeadings: boolean; - public static allowFoldingLists: boolean; - public static allowResizingSidebars: boolean; - - // Export Options - public static logLevel: "all" | "warning" | "error" | "fatal" | "none"; - public static minifyHTML: boolean; - public static makeNamesWebStyle: boolean; - public static onlyExportModified: boolean; - public static deleteOldFiles: boolean; - - // Page Features - public static addThemeToggle: boolean; - public static addOutline: boolean; - public static addFileNav: boolean; - public static addSearchBar: boolean; - public static addGraphView: boolean; - public static addTitle: boolean; - public static addRSSFeed: boolean; - - // Main Export Options - public static siteURL: string; - public static authorName: string; - public static vaultTitle: string; - public static exportPreset: ExportPreset; - public static openAfterExport: boolean; - - // Graph View Settings - public static graphAttractionForce: number; - public static graphLinkLength: number; - public static graphRepulsionForce: number; - public static graphCentralForce: number; - public static graphEdgePruning: number; - public static graphMinNodeSize: number; - public static graphMaxNodeSize: number; - - // icons - public static showDefaultTreeIcons: boolean; - public static emojiStyle: EmojiStyle; - public static defaultFileIcon: string; - public static defaultFolderIcon: string; - public static defaultMediaIcon: string; - - // Cache - public static exportPath: string; - public static filesToExport: string[][]; -} - -export const DEFAULT_SETTINGS: Settings = -{ - settingsVersion: "0.0.0", - - // Asset Options - makeOfflineCompatible: false, - inlineAssets: false, - includePluginCSS: '', - includeSvelteCSS: true, - titleProperty: 'title', - customHeadContentPath: '', - faviconPath: '', - - // Layout Options - documentWidth: "40em", - sidebarWidth: "20em", - - // Behavior Options - minOutlineCollapse: 2, - startOutlineCollapsed: false, - allowFoldingHeadings: true, - allowFoldingLists: true, - allowResizingSidebars: true, - - // Export Options - logLevel: "warning", - minifyHTML: true, - makeNamesWebStyle: true, - onlyExportModified: true, - deleteOldFiles: true, - - // Page Features - addThemeToggle: true, - addOutline: true, - addFileNav: true, - addSearchBar: true, - addGraphView: true, - addTitle: true, - addRSSFeed: true, - - // Main Export Options - siteURL: '', - authorName: '', - vaultTitle: app.vault.getName(), - exportPreset: ExportPreset.Website, - openAfterExport: false, - - // Graph View Settings - graphAttractionForce: 1, - graphLinkLength: 10, - graphRepulsionForce: 150, - graphCentralForce: 3, - graphEdgePruning: 100, - graphMinNodeSize: 3, - graphMaxNodeSize: 7, - - // icons - showDefaultTreeIcons: false, - emojiStyle: EmojiStyle.Native, - defaultFileIcon: "lucide//file", - defaultFolderIcon: "lucide//folder", - defaultMediaIcon: "lucide//file-image", - - // Cache - exportPath: '', - filesToExport: [[]], -} - -// #endregion - -export class SettingsPage extends PluginSettingTab -{ - display() - { - const { containerEl: contentEl } = this; - - // #region Settings Header - - contentEl.empty(); - - let header = contentEl.createEl('h2', { text: 'HTML Export Settings' }); - header.style.display = 'block'; - header.style.marginBottom = '15px'; - - let supportContainer = contentEl.createDiv(); - supportContainer.style.marginBottom = '15px'; - let supportLink = contentEl.createEl('a'); - let buttonColor = Utils.sampleCSSColorHex("--color-accent", document.body).hex; - let buttonTextColor = Utils.sampleCSSColorHex("--text-on-accent", document.body).hex; - // @ts-ignore - supportLink.href = `href="https://www.buymeacoffee.com/nathangeorge"`; - supportLink.style.height = "40px" - supportLink.innerHTML = ``; - let supportHeader = contentEl.createDiv({ text: 'Support the continued development of this plugin.', cls: "setting-item-description" }); - supportHeader.style.display = 'block'; - - supportContainer.style.display = 'grid'; - supportContainer.style.gridTemplateColumns = "0.5fr 0.5fr"; - supportContainer.style.gridTemplateRows = "40px 20px"; - supportContainer.appendChild(supportLink); - - // debug info button - let debugInfoButton = contentEl.createEl('button'); - let bugIcon = getIcon('bug'); - if (bugIcon) debugInfoButton.appendChild(bugIcon); - debugInfoButton.style.height = '100%'; - debugInfoButton.style.aspectRatio = '1/1'; - debugInfoButton.style.justifySelf = 'end'; - let debugHeader = contentEl.createDiv({ text: 'Copy debug info to clipboard', cls: "setting-item-description" }); - debugHeader.style.display = 'block'; - debugHeader.style.justifySelf = 'end'; - debugInfoButton.addEventListener('click', () => { - navigator.clipboard.writeText(ExportLog.getDebugInfo()); - new Notice("Debug info copied to clipboard!"); - }); - supportContainer.appendChild(debugInfoButton); - supportContainer.appendChild(supportHeader); - supportContainer.appendChild(debugHeader); - - - // #endregion - - //#region Page Features - - if (Settings.exportPreset != ExportPreset.RawDocuments) - { - SettingsPage.createDivider(contentEl); - let section = SettingsPage.createSection(contentEl, 'Page Features', 'Control the visibility of different page features'); - - SettingsPage.createToggle(section, 'Theme toggle', () => Settings.addThemeToggle, (value) => Settings.addThemeToggle = value); - SettingsPage.createToggle(section, 'Document outline / table of contents', () => Settings.addOutline, (value) => Settings.addOutline = value); - SettingsPage.createToggle(section, 'File navigation tree', () => Settings.addFileNav, (value) => Settings.addFileNav = value); - SettingsPage.createToggle(section, 'File & folder icons', () => Settings.showDefaultTreeIcons, (value) => Settings.showDefaultTreeIcons = value); - if (Settings.exportPreset == ExportPreset.Website) - { - SettingsPage.createToggle(section, 'Search bar', () => Settings.addSearchBar, (value) => Settings.addSearchBar = value); - SettingsPage.createToggle(section, 'Graph view', () => Settings.addGraphView, (value) => Settings.addGraphView = value); - let graphViewSection = SettingsPage.createSection(section, 'Graph View Settings', 'Control the behavior of the graph view simulation'); - - new Setting(graphViewSection) - .setName('Attraction Force') - .setDesc("How much should linked nodes attract each other? This will make the graph appear more clustered.") - .addSlider((slider) => slider - .setLimits(0, 100, 1) - .setValue(Settings.graphAttractionForce / (2 / 100)) - .setDynamicTooltip() - .onChange(async (value) => { - // remap to 0 - 2; - let remapMultiplier = 2 / 100; - Settings.graphAttractionForce = value * remapMultiplier; - await SettingsPage.saveSettings(); - }) - .showTooltip() - ); - - new Setting(graphViewSection) - .setName('Link Length') - .setDesc("How long should the links between nodes be? The shorter the links the closer connected nodes will cluster together.") - .addSlider((slider) => slider - .setLimits(0, 100, 1) - .setValue(Settings.graphLinkLength) - .setDynamicTooltip() - .onChange(async (value) => { - Settings.graphLinkLength = value; - await SettingsPage.saveSettings(); - }) - .showTooltip() - ); - - new Setting(graphViewSection) - .setName('Repulsion Force') - .setDesc("How much should nodes repel each other? This will make the graph appear more spread out.") - .addSlider((slider) => slider - .setLimits(0, 100, 1) - .setValue(Settings.graphRepulsionForce / 3) - .setDynamicTooltip() - .onChange(async (value) => { - Settings.graphRepulsionForce = value * 3; - await SettingsPage.saveSettings(); - }) - .showTooltip() - ); - - new Setting(graphViewSection) - .setName('Central Force') - .setDesc("How much should nodes be attracted to the center? This will make the graph appear more dense and circular.") - .addSlider((slider) => slider - .setLimits(0, 100, 1) - .setValue(Settings.graphCentralForce / (5 / 100)) - .setDynamicTooltip() - .onChange(async (value) => { - // remap to 0 - 5; - let remapMultiplier = 5 / 100; - Settings.graphCentralForce = value * remapMultiplier; - await SettingsPage.saveSettings(); - }) - .showTooltip() - ); - - new Setting(graphViewSection) - .setName('Max Node Radius') - .setDesc("How large should the largest nodes be? Nodes are sized by how many links they have. The larger a node is the more it will attract other nodes. This can be used to create a good grouping around the most important nodes.") - .addSlider((slider) => slider - .setLimits(3, 15, 1) - .setValue(Settings.graphMaxNodeSize) - .setDynamicTooltip() - .onChange(async (value) => { - Settings.graphMaxNodeSize = value; - await SettingsPage.saveSettings(); - }) - .showTooltip() - ); - - new Setting(graphViewSection) - .setName('Min Node Radius') - .setDesc("How small should the smallest nodes be? The smaller a node is the less it will attract other nodes.") - .addSlider((slider) => slider - .setLimits(3, 15, 1) - .setValue(Settings.graphMinNodeSize) - .setDynamicTooltip() - .onChange(async (value) => { - Settings.graphMinNodeSize = value; - await SettingsPage.saveSettings(); - }) - .showTooltip() - ); - - new Setting(graphViewSection) - .setName('Edge Pruning Factor') - .setDesc("Edges with a length above this threshold will not be rendered, however they will still contribute to the simulation. This can help large tangled graphs look more organised. Hovering over a node will still display these links.") - .addSlider((slider) => slider - .setLimits(0, 100, 1) - .setValue(100 - Settings.graphEdgePruning) - .setDynamicTooltip() - .onChange(async (value) => { - Settings.graphEdgePruning = 100 - value; - await SettingsPage.saveSettings(); - }) - .showTooltip() - ); - - } - - let iconTutorial = new Setting(section) - .setName('Custom icons') - .setDesc( -`Use the 'Iconize' plugin to add custom icons to your files and folders. -Or set the 'icon' property of your file to an emoji or lucide icon name. -This feature does not require "File & folder icons" to be enbaled.`); - iconTutorial.infoEl.style.whiteSpace = "pre-wrap"; - - new Setting(section) - .setName('Icon emoji style') - .addDropdown((dropdown) => - { - for (let style in EmojiStyle) dropdown.addOption(style, style); - dropdown.setValue(Settings.emojiStyle); - dropdown.onChange(async (value) => { - Settings.emojiStyle = value as EmojiStyle; - await SettingsPage.saveSettings(); - }); - }); - - SettingsPage.createText(section, 'Page title property', () => Settings.titleProperty, (value) => Settings.titleProperty = value, - "Override a specific file's title / name by defining this property in the frontmatter."); - - SettingsPage.createFileInput(section, () => Settings.customHeadContentPath, (value) => Settings.customHeadContentPath = value, - { - name: 'Custom head content', - description: 'Custom scripts, styles, or anything else (html file)', - placeholder: 'Path to html formatted file...', - defaultPath: Path.vaultPath, - validation: (path) => path.validate( - { - allowEmpty: true, - allowAbsolute: true, - allowRelative: true, - allowFiles: true, - requireExists: true, - requireExtentions: ["html, htm, txt"] - }), - }); - - SettingsPage.createFileInput(section, () => Settings.faviconPath, (value) => Settings.faviconPath = value, - { - name: 'Favicon path', - description: 'Add a custom favicon image to the website', - placeholder: 'Path to image file...', - defaultPath: Path.vaultPath, - validation: (path) => path.validate( - { - allowEmpty: true, - allowAbsolute: true, - allowRelative: true, - allowFiles: true, - requireExists: true, - requireExtentions: ["png", "ico", "jpg", "jpeg", "svg"] - }), - }); - - - } - - //#endregion - - //#region Page Behaviors - - let section; - - if (Settings.exportPreset != ExportPreset.RawDocuments) - { - - SettingsPage.createDivider(contentEl); - - section = SettingsPage.createSection(contentEl, 'Page Behaviors', 'Change the behavior of included page features'); - - new Setting(section) - .setName('Min Outline Collapse Depth') - .setDesc('Only allow outline items to be collapsed if they are at least this many levels deep in the tree.') - .addDropdown((dropdown) => dropdown.addOption('1', '1').addOption('2', '2').addOption('100', 'No Collapse') - .setValue(Settings.minOutlineCollapse.toString()) - .onChange(async (value) => { - Settings.minOutlineCollapse = parseInt(value); - await SettingsPage.saveSettings(); - })); - - SettingsPage.createToggle(section, 'Start Outline Collapsed', () => Settings.startOutlineCollapsed, (value) => Settings.startOutlineCollapsed = value, - 'All outline items will be collapsed by default.'); - - SettingsPage.createToggle(section, 'Allow folding headings', () => Settings.allowFoldingHeadings, (value) => Settings.allowFoldingHeadings = value, - 'Fold headings using an arrow icon, like in Obsidian.'); - - SettingsPage.createToggle(section, 'Allow folding lists', () => Settings.allowFoldingLists, (value) => Settings.allowFoldingLists = value, - 'Fold lists using an arrow icon, like in Obsidian.'); - - SettingsPage.createToggle(section, 'Allow resizing sidebars', () => Settings.allowResizingSidebars, (value) => Settings.allowResizingSidebars = value, - 'Allow the user to resize the sidebar width.'); - } - - //#endregion - - //#region Layout Options - - SettingsPage.createDivider(contentEl); - - - section = SettingsPage.createSection(contentEl, 'Layout Options', 'Set document and sidebar widths'); - - new Setting(section) - .setName('Document Width') - .setDesc('Sets the line width of the exported document in css units. (ex. 600px, 50em)') - .addText((text) => text - .setValue(Settings.documentWidth) - .setPlaceholder('40em') - .onChange(async (value) => { - Settings.documentWidth = value; - await SettingsPage.saveSettings(); - } - )) - .addExtraButton((button) => button.setIcon('reset').setTooltip('Reset to default').onClick(() => { - Settings.documentWidth = ""; - SettingsPage.saveSettings(); - this.display(); - })); - - new Setting(section) - .setName('Sidebar Width') - .setDesc('Sets the width of the sidebar in css units. (ex. 20em, 200px)') - .addText((text) => text - .setValue(Settings.sidebarWidth) - .setPlaceholder('20em') - .onChange(async (value) => { - Settings.sidebarWidth = value; - await SettingsPage.saveSettings(); - } - )) - .addExtraButton((button) => button.setIcon('reset').setTooltip('Reset to default').onClick(() => { - Settings.sidebarWidth = ""; - SettingsPage.saveSettings(); - this.display(); - })); - - //#endregion - - //#region Export Options - - SettingsPage.createDivider(contentEl); - - - section = SettingsPage.createSection(contentEl, 'Export Options', 'Change the behavior of the export process.'); - - SettingsPage.createToggle(section, 'Only export modfied files', () => Settings.onlyExportModified, (value) => Settings.onlyExportModified = value, - 'Only generate new html for files which have been modified since the last export.'); - SettingsPage.createToggle(section, 'Delete old files', () => Settings.deleteOldFiles, (value) => Settings.deleteOldFiles = value, - 'Delete files from a previous export that are no longer being exported.'); - SettingsPage.createToggle(section, 'Minify HTML', () => Settings.minifyHTML, (value) => Settings.minifyHTML = value, - 'Minify HTML to make it load faster.'); - - new Setting(section) - .setName('Log Level') - .setDesc('Set the level of logging to display in the export log.') - .addDropdown((dropdown) => dropdown - .addOption('all', 'All') - .addOption('warning', 'Warning') - .addOption('error', 'Error') - .addOption('fatal', 'Only Fatal Errors') - .setValue(Settings.logLevel) - .onChange(async (value: "all" | "warning" | "error" | "fatal" | "none") => - { - Settings.logLevel = value; - await SettingsPage.saveSettings(); - })); - - //#endregion - - //#region Asset Settings - - SettingsPage.createDivider(contentEl); - - section = SettingsPage.createSection(contentEl, 'Asset Options', 'Add plugin styles, or make the page offline compatible.'); - - SettingsPage.createToggle(section, 'Make Offline Compatible', () => Settings.makeOfflineCompatible, (value) => Settings.makeOfflineCompatible = value, - 'Download any online assets / images / scripts so the page can be viewed offline. Or so the website does not depend on a CDN.'); - SettingsPage.createToggle(section, 'Include Svelte CSS', () => Settings.includeSvelteCSS, (value) => Settings.includeSvelteCSS = value, - 'Include the CSS from any plugins that use the svelte framework. These can not be chosen individually because their styles are not associated with their respective plugins.'); - - new Setting(section) - .setName('Include CSS from Plugins') - .setDesc('Include the CSS from the following plugins in the exported HTML. If plugin features aren\'t rendering correctly, try adding the plugin to this list. Avoid adding plugins unless you specifically notice a problem, because more CSS will increase the loading time of your page.') - - let pluginsList = new FlowList(section); - Utils.getPluginIDs().forEach(async (plugin) => { - let pluginManifest = Utils.getPluginManifest(plugin); - if (!pluginManifest) return; - - if ((await this.getBlacklistedPluginIDs()).contains(pluginManifest.id)) { - return; - } - - let pluginDir = pluginManifest.dir; - if (!pluginDir) return; - let pluginPath = new Path(pluginDir); - - let hasCSS = pluginPath.joinString('styles.css').exists; - if (!hasCSS) return; - - let isChecked = Settings.includePluginCSS.match(new RegExp(`^${plugin}`, 'm')) != null; - - pluginsList.addItem(pluginManifest.name, plugin, isChecked, (value) => { - Settings.includePluginCSS = pluginsList.checkedList.join('\n'); - SettingsPage.saveSettings(); - }); - }); - - //#endregion - - //#region Advanced - - SettingsPage.createDivider(contentEl); - section = SettingsPage.createSection(contentEl, 'Metadata', 'Control general site data and RSS feed creation'); - - SettingsPage.createText(section, 'Public site URL', () => Settings.siteURL, (value) => Settings.siteURL = ((value.endsWith("/") || value == "") ? value : value + "/").trim(), - 'The url that this site will be hosted at. This is needed to reference links and images in metadata and RSS. (Because these links cannot be relative)', - (value) => (value.startsWith("http://") || value.startsWith("https://") || value.trim() == "") ? "" : "URL must start with 'http://' or 'https://'"); - - SettingsPage.createText(section, 'Author Name', () => Settings.authorName, (value) => Settings.authorName = value, - 'The default name of the author of the site'); - - SettingsPage.createText(section, 'Vault Title', () => Settings.vaultTitle, (value) => Settings.vaultTitle = value, - 'The title of the vault'); - - SettingsPage.createToggle(section, 'Create RSS feed', () => Settings.addRSSFeed, (value) => Settings.addRSSFeed = value, - `Create an RSS feed for the website located at ${Settings.siteURL}lib/rss.xml`); - - let summaryTutorial = new Setting(section) - .setName('Metadata Properties') - .setDesc( -`Use the 'description' or 'summary' property to set a custom summary of a page. -Use the 'author' property to set the author of a specific page.`); - summaryTutorial.infoEl.style.whiteSpace = "pre-wrap"; - - - //#endregion - - //#region Experimental - - - // if (Settings.exportPreset == ExportPreset.Website) - // { - // let experimentalContainer = contentEl.createDiv(); - // let experimentalHR1 = experimentalContainer.createEl('hr'); - // let experimentalHeader = experimentalContainer.createEl('span', { text: 'Experimental' }); - // let experimentalHR2 = experimentalContainer.createEl('hr'); - - // experimentalContainer.style.display = 'flex'; - // experimentalContainer.style.marginTop = '5em'; - // experimentalContainer.style.alignItems = 'center'; - - // experimentalHR1.style.borderColor = "var(--color-red)"; - // experimentalHR2.style.borderColor = "var(--color-red)"; - // experimentalHeader.style.color = "var(--color-red)"; - - // experimentalHR1.style.flexGrow = "1"; - // experimentalHR2.style.flexGrow = "1"; - // experimentalHeader.style.flexGrow = "0.1"; - // experimentalHeader.style.textAlign = "center"; - - // let experimentalHREnd = contentEl.createEl('hr'); - // experimentalHREnd.style.borderColor = "var(--color-red)"; - // } - - //#endregion - - } - - // #region Class Functions and Variables - - static settings: Settings = DEFAULT_SETTINGS; - static plugin: Plugin; - static loaded = false; - - - private blacklistedPluginIDs: string[] = []; - public async getBlacklistedPluginIDs(): Promise - { - if (this.blacklistedPluginIDs.length > 0) return this.blacklistedPluginIDs; - this.blacklistedPluginIDs = pluginStylesBlacklist.replaceAll("\r", "").split("\n"); - - return this.blacklistedPluginIDs; - } - - constructor(plugin: Plugin) { - super(app, plugin); - SettingsPage.plugin = plugin; - } - - static async loadSettings() - { - let loadedSettings = await SettingsPage.plugin.loadData(); - Object.assign(Settings, DEFAULT_SETTINGS, loadedSettings); - await migrateSettings(); - SettingsPage.loaded = true; - } - - static async saveSettings() { - await SettingsPage.plugin.saveData(Object.assign({}, Settings)); - } - - static renameFile(file: TFile, oldPath: string) - { - let oldPathParsed = new Path(oldPath).asString; - Settings.filesToExport.forEach((fileList) => - { - let index = fileList.indexOf(oldPathParsed); - if (index >= 0) - { - fileList[index] = file.path; - } - }); - - SettingsPage.saveSettings(); - } - - static async updateSettings(usePreviousSettings: boolean = false, overrideFiles: TFile[] | undefined = undefined, overrideExportPath: Path | undefined = undefined): Promise - { - if (!usePreviousSettings) - { - let modal = new ExportModal(); - if(overrideFiles) modal.overridePickedFiles(overrideFiles); - return await modal.open(); - } - - let files = Settings.filesToExport[0]; - let path = overrideExportPath ?? new Path(Settings.exportPath); - if ((files.length == 0 && overrideFiles == undefined) || !path.exists || !path.isAbsolute || !path.isDirectory) - { - new Notice("Please set the export path and files to export in the settings first.", 5000); - let modal = new ExportModal(); - if(overrideFiles) modal.overridePickedFiles(overrideFiles); - return await modal.open(); - } - - return undefined; - } - - static getFilesToExport(): TFile[] - { - let files: TFile[] = []; - - let allFiles = app.vault.getFiles(); - let exportPaths = Settings.filesToExport[0]; - if (!exportPaths) return []; - - for (let path of exportPaths) - { - let file = app.vault.getAbstractFileByPath(path); - if (file instanceof TFile) files.push(file); - else if (file instanceof TFolder) - { - let newFiles = allFiles.filter((f) => f.path.startsWith(file?.path ?? "*")); - files.push(...newFiles); - } - }; - - return files; - } - - public static createDivider(container: HTMLElement) - { - let hr = container.createEl("hr"); - hr.style.marginTop = "20px"; - hr.style.marginBottom = "20px"; - hr.style.borderColor = "var(--interactive-accent)"; - hr.style.opacity = "0.5"; - } - - public static createToggle(container: HTMLElement, name: string, get: () => boolean, set: (value: boolean) => void, desc: string = ""): Setting - { - let setting = new Setting(container); - setting.setName(name) - if (desc != "") setting.setDesc(desc); - setting.addToggle((toggle) => toggle - // @ts-ignore - .setValue(get()) - .onChange(async (value) => { - // @ts-ignore - set(value); - await SettingsPage.saveSettings(); - })); - return setting; - } - - public static createText(container: HTMLElement, name: string, get: () => string, set: (value: string) => void, desc: string = "", validation?: (value: string) => string): Setting - { - let setting = new Setting(container); - let errorText = this.createError(container); - - let value = get(); - if (value != "") errorText.setText(validation ? validation(value) : ""); - - setting.setName(name) - if (desc != "") setting.setDesc(desc); - setting.addText((text) => text - .setValue(value) - .onChange(async (value) => - { - let error = validation ? validation(value) : ""; - if (error == "") - { - set(value); - await SettingsPage.saveSettings(); - } - - errorText.setText(error); - })); - - return setting; - } - - public static createError(container: HTMLElement): HTMLElement - { - let error = container.createDiv({ cls: 'setting-item-description' }); - error.style.color = "var(--color-red)"; - error.style.marginBottom = "0.75rem"; - return error; - } - - public static createFileInput(container: HTMLElement, get: () => string, set: (value: string) => void, options?: {name?: string, description?: string, placeholder?: string, defaultPath?: Path, pickFolder?: boolean, validation?: (path: Path) => {valid: boolean, isEmpty: boolean, error: string}, browseButton?: boolean, onChanged?: (path: Path)=>void}): {fileInput: Setting, textInput: TextComponent, browseButton: HTMLElement | undefined} - { - let name = options?.name ?? ""; - let description = options?.description ?? ""; - let placeholder = options?.placeholder ?? "Path to file..."; - let defaultPath = options?.defaultPath ?? Path.vaultPath; - let pickFolder = options?.pickFolder ?? false; - let validation = options?.validation ?? ((path) => ({valid: true, isEmpty: false, error: ""})); - let browseButton = options?.browseButton ?? true; - let onChanged = options?.onChanged; - - let headContentErrorMessage = this.createError(container); - if (get().trim() != "") - { - let tempPath = new Path(get()); - headContentErrorMessage.setText(validation(tempPath).error); - } - - let headContentInput : TextComponent | undefined = undefined; - - let fileInput = new Setting(container); - if(name != "") fileInput.setName(name); - if (description != "") fileInput.setDesc(description); - if (name == "" && description == "") fileInput.infoEl.style.display = "none"; - - let textEl: TextComponent; - fileInput.addText((text) => - { - textEl = text; - headContentInput = text; - text.inputEl.style.width = '100%'; - text.setPlaceholder(placeholder) - .setValue(get()) - .onChange(async (value) => - { - let path = new Path(value); - let valid = validation(path); - headContentErrorMessage.setText(valid.error); - if (valid.valid) - { - headContentErrorMessage.setText(""); - set(value.replaceAll("\"", "")); - text.setValue(get()); - await SettingsPage.saveSettings(); - } - - if (onChanged) onChanged(path); - }); - }); - - let browseButtonEl = undefined; - if(browseButton) - { - fileInput.addButton((button) => - { - browseButtonEl = button.buttonEl; - button.setButtonText('Browse').onClick(async () => - { - let path = pickFolder ? await Utils.showSelectFolderDialog(defaultPath) : await Utils.showSelectFileDialog(defaultPath); - if (!path) return; - - set(path.asString); - let valid = validation(path); - headContentErrorMessage.setText(valid.error); - if (valid.valid) - { - await SettingsPage.saveSettings(); - } - - if (onChanged) onChanged(path); - - headContentInput?.setValue(get()); - }); - }); - } - - container.appendChild(headContentErrorMessage); - - return {fileInput: fileInput, textInput: textEl!, browseButton: browseButtonEl}; - } - - public static createSection(container: HTMLElement, name: string, desc: string): HTMLElement - { - let section = container.createEl('details'); - let summary = section.createEl('summary'); - summary.style.display = "block"; - summary.style.marginLeft = "-1em"; - section.style.paddingLeft = "2em"; - section.style.borderLeft = "1px solid var(--interactive-accent)"; - - new Setting(summary) - .setName(name) - .setDesc(desc) - .setHeading() - - return section; - } - - // #endregion -} diff --git a/.obsidian/plugins/obsidian-webpage-export-master/scripts/utils/downloadable.ts b/.obsidian/plugins/obsidian-webpage-export-master/scripts/utils/downloadable.ts deleted file mode 100644 index 2d865667..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/scripts/utils/downloadable.ts +++ /dev/null @@ -1,50 +0,0 @@ -import { Path } from "./path"; - -export class Downloadable -{ - /** - * The name of the file with the extention - */ - public filename: string; - - /** - * The raw data of the file - */ - public content: string | Buffer; - - public relativeDirectory: Path; - public encoding: BufferEncoding | undefined; - public modifiedTime: number = 0; // when was the source file last modified - - constructor(filename: string, content: string | Buffer, vaultRelativeDestination: Path, encoding: BufferEncoding | undefined = "utf8") - { - if(vaultRelativeDestination.isFile) throw new Error("vaultRelativeDestination must be a folder: " + vaultRelativeDestination.asString); - - this.filename = filename; - this.content = content; - this.relativeDirectory = vaultRelativeDestination; - this.encoding = encoding; - } - - public get relativePath(): Path - { - return this.relativeDirectory.joinString(this.filename); - } - - async download(downloadDirectory: Path) - { - let data = this.content instanceof Buffer ? this.content : Buffer.from(this.content.toString(), this.encoding); - let writePath = this.getAbsoluteDownloadDirectory(downloadDirectory).joinString(this.filename); - await writePath.writeFile(data, this.encoding); - } - - public getAbsoluteDownloadPath(downloadDirectory: Path): Path - { - return this.relativeDirectory.absolute(downloadDirectory).joinString(this.filename); - } - - public getAbsoluteDownloadDirectory(downloadDirectory: Path): Path - { - return this.relativeDirectory.absolute(downloadDirectory); - } -} diff --git a/.obsidian/plugins/obsidian-webpage-export-master/scripts/utils/path.ts b/.obsidian/plugins/obsidian-webpage-export-master/scripts/utils/path.ts deleted file mode 100644 index b1a4cbf9..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/scripts/utils/path.ts +++ /dev/null @@ -1,872 +0,0 @@ -const pathTools = require('upath'); -import { Stats, existsSync } from 'fs'; -import { FileSystemAdapter, Notice } from 'obsidian'; -import { Utils } from './utils'; -import { promises as fs } from 'fs'; -import { statSync } from 'fs'; -import internal from 'stream'; -import { ExportLog } from 'scripts/html-generation/render-log'; -import { join } from 'path'; -import { homedir } from 'os'; - -export class Path -{ - private static logQueue: { title: string, message: any, type: "info" | "warn" | "error" | "fatal" }[] = []; - private static log(title: string, message: any, type: "info" | "warn" | "error" | "fatal") - { - this.logQueue.push({ title: title, message: message, type: type }); - } - public static dequeueLog(): { title: string, message: any, type: "info" | "warn" | "error" | "fatal" }[] - { - let queue = this.logQueue; - this.logQueue = []; - return queue; - } - - private _root: string = ""; - private _dir: string = ""; - private _parent: string = ""; - private _base: string = ""; - private _ext: string = ""; - private _name: string = ""; - private _fullPath: string = ""; - private _isDirectory: boolean = false; - private _isFile: boolean = false; - private _exists: boolean | undefined = undefined; - private _workingDirectory: string; - private _rawString: string = ""; - - private _isWindows: boolean = process.platform === "win32"; - - constructor(path: string, workingDirectory: string = Path.vaultPath.asString) - { - this._workingDirectory = Path.parsePath(workingDirectory).fullPath; - - this.reparse(path); - - if (this.isAbsolute) this._workingDirectory = ""; - } - - reparse(path: string): Path - { - let parsed = Path.parsePath(path); - this._root = parsed.root; - this._dir = parsed.dir; - this._parent = parsed.parent; - this._base = parsed.base; - this._ext = parsed.ext; - this._name = parsed.name; - this._fullPath = parsed.fullPath; - this._isDirectory = this._ext == ""; - this._isFile = this._ext != ""; - this._exists = undefined; - this._rawString = path; - - if (this._isWindows) - { - if (this._root.startsWith("http:") || this._root.startsWith("https:")) - { - this._isWindows = false; - this.reparse(this._fullPath.replaceAll("\\", "/")); - } - else - { - this._root = this._root.replaceAll("/", "\\"); - this._dir = this._dir.replaceAll("/", "\\"); - this._parent = this._parent.replaceAll("/", "\\"); - this._fullPath = this._fullPath.replaceAll("/", "\\"); - this._workingDirectory = this._workingDirectory.replaceAll("/", "\\"); - } - } - - this._exists; // force a re-evaluation of the exists property which will also throw an error if the path does not exist - return this; - } - - joinString(...paths: string[]): Path - { - return this.copy.reparse(Path.joinStringPaths(this.asString, ...paths)); - } - - join(...paths: Path[]): Path - { - return new Path(Path.joinStringPaths(this.asString, ...paths.map(p => p.asString)), this._workingDirectory); - } - - makeAbsolute(workingDirectory: string | Path = this._workingDirectory): Path - { - if(workingDirectory instanceof Path && !workingDirectory.isAbsolute) throw new Error("workingDirectory must be an absolute path: " + workingDirectory.asString); - - if (!this.isAbsolute) - { - this._fullPath = Path.joinStringPaths(workingDirectory.toString(), this.asString); - this._workingDirectory = ""; - this.reparse(this.asString); - } - - return this; - } - - makeForceFolder(): Path - { - if (!this.isDirectory) - { - this.reparse(this.asString + "/"); - } - - return this; - } - - makeNormalized(): Path - { - let fullPath = pathTools.normalizeSafe(this.absolute().asString); - let newWorkingDir = ""; - let newFullPath = ""; - let reachedEndOfWorkingDir = false; - for (let i = 0; i < fullPath.length; i++) - { - let fullChar = fullPath.charAt(i); - let workingChar = this.workingDirectory.charAt(i); - if (fullChar == workingChar && !reachedEndOfWorkingDir) - { - newWorkingDir += fullChar; - continue; - } - - reachedEndOfWorkingDir = true; - newFullPath += fullChar; - } - - this.reparse(newFullPath); - this._workingDirectory = newWorkingDir; - - return this; - } - - normalized(): Path - { - return this.copy.makeNormalized(); - } - - makeRootAbsolute(): Path - { - if (!this.isAbsolute) - { - if (this._isWindows) - { - if(this._fullPath.contains(":")) - { - this._fullPath = this.asString.substring(this._fullPath.indexOf(":") - 1); - } - else - { - this._fullPath = "\\" + this.asString; - } - } - else - { - this._fullPath = "/" + this.asString; - } - - this.reparse(this.asString); - } - - return this; - } - - setWorkingDirectory(workingDirectory: string): Path - { - this._workingDirectory = workingDirectory; - return this; - } - - makeRootRelative(): Path - { - if (this.isAbsolute) - { - if (this._isWindows) - { - // replace the drive letter and colon with nothing - this._fullPath = this.asString.replace(/^.:\/\//i, "").replace(/^.:\//i, ""); - this._fullPath = Utils.trimStart(this._fullPath, "\\"); - } - else - { - this._fullPath = Utils.trimStart(this._fullPath, "/"); - } - - this.reparse(this.asString); - } - - return this; - } - - makeWebStyle(makeWebStyle: boolean = true): Path - { - if (!makeWebStyle) return this; - this._fullPath = Path.toWebStyle(this.asString); - this.reparse(this.asString); - return this; - } - - makeWindowsStyle(): Path - { - this._isWindows = true; - this._fullPath = this.asString.replaceAll("/", "\\"); - this.reparse(this.asString); - return this; - } - - makeUnixStyle(): Path - { - this._isWindows = false; - this._fullPath = this.asString.replaceAll("\\", "/").replace(/^.:\/\//i, "/"); - this.reparse(this.asString); - return this; - } - - setExtension(extension: string): Path - { - if (!extension.contains(".")) extension = "." + extension; - - this._ext = extension; - this._base = this._name + this._ext; - this._fullPath = Path.joinStringPaths(this._dir, this._base); - - this.reparse(this._fullPath); - return this; - } - - replaceExtension(searchExt: string, replaceExt: string): Path - { - if (!searchExt.contains(".")) searchExt = "." + searchExt; - if (!replaceExt.contains(".")) replaceExt = "." + replaceExt; - - this._ext = this._ext.replace(searchExt, replaceExt); - this._base = this._name + this._ext; - this._fullPath = Path.joinStringPaths(this._dir, this._base); - - this.reparse(this._fullPath); - return this; - } - - // overide the default toString() method - toString(): string - { - return this.asString; - } - - /** - * The root of the path - * @example - * "C:/" or "/". - */ - get root(): string - { - return this._root; - } - - /** - * The parent directory of the file, or if the path is a directory this will be the full path. - * @example - * "C:/Users/JohnDoe/Documents" or "/home/johndoe/Documents". - */ - get directory(): Path - { - return new Path(this._dir, this._workingDirectory); - } - - /** - * Same as dir, but if the path is a directory this will be the parent directory not the full path. - */ - get parent(): Path - { - return new Path(this._parent, this._workingDirectory); - } - - /** - * The name of the file or folder including the extension. - * @example - * "file.txt" or "Documents". - */ - get fullName(): string - { - return this._base; - } - - /** - * The extension of the file or folder. - * @example - * ".txt" or "". - */ - get extension(): string - { - return this._ext; - } - - get extensionName(): string - { - return this._ext.replace(".", ""); - } - - /** - * The name of the file or folder without the extension. - * @example - * "file" or "Documents". - */ - get basename(): string - { - return this._name; - } - - /** - * The depth of the path. - * @example - * "C:/Users/JohnDoe/Documents/file.txt" = 4 - * "/home/johndoe/Documents/file.txt" = 4 - * "JohnDoe/Documents/Documents" = 2 - */ - get depth(): number - { - return this.asString.replaceAll("\\", "/").replaceAll("//", "/").split("/").length - 1; - } - - /** - * The original unparsed uncleaned string that was used to create this path. - * @example - * Can be any string: "C:/Users//John Doe/../Documents\file.txt " or "" - */ - get rawString(): string - { - return this._rawString; - } - - /** - * The full path of the file or folder. - * @example - * "C:/Users/John Doe/Documents/file.txt" - * "/home/john doe/Documents/file.txt" - * "C:/Users/John Doe/Documents/Documents" - * "/home/john doe/Documents/Documents" - * "relative/path/to/example.txt" - * "relative/path/to/folder" - */ - get asString(): string - { - return this._fullPath; - } - - /** - * True if this is a directory. - */ - get isDirectory(): boolean - { - return this._isDirectory; - } - - /** - * True if this is an empty path: ".". - * AKA is the path just referencing its working directory. - */ - get isEmpty(): boolean - { - return this.asString == "."; - } - - /** - * True if this is a file, not a folder. - */ - get isFile(): boolean - { - return this._isFile; - } - - get workingDirectory(): string - { - return this._workingDirectory; - } - - /** - * True if the file or folder exists on the filesystem. - */ - get exists(): boolean - { - if(this._exists == undefined) - { - try - { - this._exists = Path.pathExists(this.absolute().asString); - } - catch (error) - { - this._exists = false; - Path.log("Error checking if path exists: " + this.asString, error, "error"); - } - } - - return this._exists; - } - - get stat(): Stats|undefined - { - if(!this.exists) return; - - try - { - - let stat = statSync(this.absolute().asString); - return stat; - } - catch (error) - { - Path.log("Error getting stat: " + this.asString, error, "error"); - return; - } - } - - assertExists(): boolean - { - if(!this.exists) - { - new Notice("Error: Path does not exist: \n\n" + this.asString, 5000); - ExportLog.error("Path does not exist: " + this.asString); - } - - return this.exists; - } - - get isAbsolute(): boolean - { - let asString = this.asString; - if (asString.startsWith("http:") || asString.startsWith("https:")) return true; - - if(this._isWindows) - { - if (asString.match(/^[A-Za-z]:[\\|\/|\\\\|\/\/]/)) return true; - if (asString.startsWith("\\") && !asString.contains(":")) return true; - else return false; - } - else - { - if (asString.startsWith("/")) return true; - else return false; - } - } - - get isRelative(): boolean - { - return !this.isAbsolute; - } - - get copy(): Path - { - return new Path(this.asString, this._workingDirectory); - } - - getDepth(): number - { - return this.asString.split("/").length - 1; - } - - absolute(workingDirectory: string | Path = this._workingDirectory): Path - { - return this.copy.makeAbsolute(workingDirectory); - } - - validate(options: {allowEmpty?: boolean, requireExists?: boolean, allowAbsolute?: boolean, allowRelative?: boolean, allowTildeHomeDirectory?: boolean, allowFiles?: boolean, allowDirectories?: boolean, requireExtentions?: string[]}): {valid: boolean, isEmpty: boolean, error: string} - { - let error = ""; - let valid = true; - let isEmpty = this.rawString.trim() == ""; - - // remove dots from requireExtention - options.requireExtentions = options.requireExtentions?.map(e => e.replace(".", "")) ?? []; - let dottedExtention = options.requireExtentions.map(e => "." + e); - - if (!options.allowEmpty && isEmpty) - { - error += "Path cannot be empty\n"; - valid = false; - } - else if (options.allowEmpty && isEmpty) - { - return { valid: true, isEmpty: isEmpty, error: "" }; - } - - if (options.requireExists && !this.exists) - { - error += "Path does not exist"; - valid = false; - } - else if (!options.allowTildeHomeDirectory && this.asString.startsWith("~")) - { - error += "Home directory with tilde (~) is not allowed"; - valid = false; - } - else if (!options.allowAbsolute && this.isAbsolute) - { - error += "Path cannot be absolute"; - valid = false; - } - else if (!options.allowRelative && this.isRelative) - { - error += "Path cannot be relative"; - valid = false; - } - else if (!options.allowFiles && this.isFile) - { - error += "Path cannot be a file"; - valid = false; - } - else if (!options.allowDirectories && this.isDirectory) - { - error += "Path cannot be a directory"; - valid = false; - } - else if (options.requireExtentions.length > 0 && !options.requireExtentions.includes(this.extensionName) && !isEmpty) - { - error += "Path must be: " + dottedExtention.join(", "); - valid = false; - } - - return { valid: valid, isEmpty: isEmpty, error: error }; - } - - async createDirectory(): Promise - { - if (!this.exists) - { - let path = this.absolute().directory.asString; - - try - { - await fs.mkdir(path, { recursive: true }); - } - catch (error) - { - Path.log("Error creating directory: " + path, error, "error"); - return false; - } - } - - return true; - } - - async readFileString(encoding: "ascii" | "utf8" | "utf-8" | "utf16le" | "ucs2" | "ucs-2" | "base64" | "base64url" | "latin1" | "binary" | "hex" = "utf-8"): Promise - { - if(!this.exists || this.isDirectory) return; - - try - { - let data = await fs.readFile(this.absolute().asString, { encoding: encoding }); - return data; - } - catch (error) - { - Path.log("Error reading file: " + this.asString, error, "error"); - return; - } - } - - async readFileBuffer(): Promise - { - if(!this.exists || this.isDirectory) return; - - try - { - let data = await fs.readFile(this.absolute().asString); - return data; - } - catch (error) - { - Path.log("Error reading file buffer: " + this.asString, error, "error"); - return; - } - } - - async writeFile(data: string | NodeJS.ArrayBufferView | Iterable | AsyncIterable | internal.Stream, encoding: "ascii" | "utf8" | "utf-8" | "utf16le" | "ucs2" | "ucs-2" | "base64" | "base64url" | "latin1" | "binary" | "hex" = "utf-8"): Promise - { - if (this.isDirectory) return false; - - try - { - await fs.writeFile(this.absolute().asString, data, { encoding: encoding }); - return true; - } - catch (error) - { - let dirExists = await this.createDirectory(); - if (!dirExists) return false; - - try - { - await fs.writeFile(this.absolute().asString, data, { encoding: encoding }); - return true; - } - catch (error) - { - Path.log("Error writing file: " + this.asString, error, "error"); - return false; - } - } - } - - async delete(recursive: boolean = false): Promise - { - if (!this.exists) return false; - - try - { - await fs.rm(this.absolute().asString, { recursive: recursive }); - return true; - } - catch (error) - { - Path.log("Error deleting file: " + this.asString, error, "error"); - return false; - } - } - - public static fromString(path: string): Path - { - return new Path(path); - } - - private static parsePath(path: string): { root: string, dir: string, parent: string, base: string, ext: string, name: string, fullPath: string } - { - let args = path.split("?")[1] ?? ""; - path = path.split("?")[0]; - - if (process.platform === "win32") - { - if (path.startsWith("~")) - { - path = path.replace("~", homedir()); - } - } - - try - { - path = decodeURI(path); - } - catch (trash) - { - try - { - path = decodeURI(path.replaceAll("%", "")); - } - catch (e) - { - this.log("Could not decode path:" + path, e, "info"); - } - } - - let parsed = pathTools.parse(path) as { root: string, dir: string, base: string, ext: string, name: string }; - - if (parsed.ext.contains(" ")) - { - parsed.ext = ""; - } - - if(parsed.name.endsWith(" ")) - { - parsed.name += parsed.ext; - parsed.ext = ""; - } - - let parent = parsed.dir; - let fullPath = ""; - - if(path.endsWith("/") || path.endsWith("\\") || parsed.ext == "") - { - if (path.endsWith("/") || path.endsWith("\\")) path = path.substring(0, path.length - 1); - - parsed.dir = pathTools.normalizeSafe(path); - let items = parsed.dir.split("/"); - parsed.name = items[items.length - 1]; - parsed.base = parsed.name; - parsed.ext = ""; - fullPath = parsed.dir; - } - else - { - fullPath = pathTools.join(parent, parsed.base); - } - - - if (args && args.trim() != "") fullPath += "?" + args; - - if(fullPath.startsWith("http:")) parsed.root = "http://"; - else if(fullPath.startsWith("https:")) parsed.root = "https://"; - - // make sure that protocols and windows drives use two slashes - parsed.dir = parsed.dir.replace(/[:][\\/](?![\\/])/g, "://"); - parent = parsed.dir; - fullPath = fullPath.replace(/[:][\\/](?![\\/])/g, "://"); - - return { root: parsed.root, dir: parsed.dir, parent: parent, base: parsed.base, ext: parsed.ext, name: parsed.name, fullPath: fullPath }; - } - - private static pathExists(path: string): boolean - { - return existsSync(path); - } - - private static joinStringPaths(...paths: string[]): string - { - let joined = pathTools.join(...paths); - - if (joined.startsWith("http")) - { - joined = joined.replaceAll(":/", "://"); - } - - try - { - return decodeURI(joined); - } - catch (e) - { - this.log("Could not decode joined paths: " + joined, e, "info"); - return joined; - } - } - - public static joinPath(...paths: Path[]): Path - { - return new Path(Path.joinStringPaths(...paths.map(p => p.asString)), paths[0]._workingDirectory); - } - - public static joinStrings(...paths: string[]): Path - { - return new Path(Path.joinStringPaths(...paths)); - } - - /** - * @param from The source path / working directory - * @param to The destination path - * @returns The relative path to the destination from the source - */ - public static getRelativePath(from: Path, to: Path, useAbsolute: boolean = false): Path - { - let fromUse = useAbsolute ? from.absolute() : from; - let toUse = useAbsolute ? to.absolute() : to; - let relative = pathTools.relative(fromUse.directory.asString, toUse.asString); - let workingDir = from.absolute().directory.asString; - return new Path(relative, workingDir); - } - - public static getRelativePathFromVault(path: Path, useAbsolute: boolean = false): Path - { - return Path.getRelativePath(Path.vaultPath, path, useAbsolute); - } - - private static vaultPathCache: Path | undefined = undefined; - static get vaultPath(): Path - { - if (this.vaultPathCache != undefined) return this.vaultPathCache; - - let adapter = app.vault.adapter; - if (adapter instanceof FileSystemAdapter) - { - let basePath = adapter.getBasePath() ?? ""; - this.vaultPathCache = new Path(basePath, ""); - return this.vaultPathCache; - } - - throw new Error("Vault path could not be determined"); - } - - private static vaultConfigDirCache: Path | undefined = undefined; - static get vaultConfigDir(): Path - { - if (this.vaultConfigDirCache == undefined) - { - this.vaultConfigDirCache = new Path(app.vault.configDir, ""); - } - - return this.vaultConfigDirCache; - } - - static get emptyPath(): Path - { - return new Path("", ""); - } - - static get rootPath(): Path - { - return new Path("/", ""); - } - - static toWebStyle(path: string): string - { - return path.replaceAll(" ", "-").replaceAll(/-{2,}/g, "-").toLowerCase(); - } - - static equal(path1: string, path2: string): boolean - { - let path1Parsed = new Path(path1).makeUnixStyle().makeWebStyle().asString; - let path2Parsed = new Path(path2).makeUnixStyle().makeWebStyle().asString; - return path1Parsed == path2Parsed; - } - - public static async getAllEmptyFoldersRecursive(folder: Path): Promise - { - if (!folder.isDirectory) throw new Error("folder must be a directory: " + folder.asString); - - let folders: Path[] = []; - - let folderFiles = await fs.readdir(folder.asString); - for (let i = 0; i < folderFiles.length; i++) - { - let file = folderFiles[i]; - let path = folder.joinString(file); - - if ((await fs.stat(path.asString)).isDirectory()) - { - let subFolders = await this.getAllEmptyFoldersRecursive(path); - if (subFolders.length == 0) - { - let subFiles = await fs.readdir(path.asString); - if (subFiles.length == 0) folders.push(path); - } - else - { - folders.push(...subFolders); - } - } - } - - return folders; - } - - public static async getAllFilesInFolderRecursive(folder: Path): Promise - { - if (!folder.isDirectory) throw new Error("folder must be a directory: " + folder.asString); - - let files: Path[] = []; - - let folderFiles = await fs.readdir(folder.asString); - for (let i = 0; i < folderFiles.length; i++) - { - let file = folderFiles[i]; - let path = folder.joinString(file); - - ExportLog.progress(i, folderFiles.length, "Finding Old Files", "Searching: " + folder.asString, "var(--color-yellow)"); - - if ((await fs.stat(path.asString)).isDirectory()) - { - files.push(...await this.getAllFilesInFolderRecursive(path)); - } - else - { - files.push(path); - } - } - - return files; - } - -} - - diff --git a/.obsidian/plugins/obsidian-webpage-export-master/scripts/utils/tab-manager.ts b/.obsidian/plugins/obsidian-webpage-export-master/scripts/utils/tab-manager.ts deleted file mode 100644 index e8920f06..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/scripts/utils/tab-manager.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { PaneType, SplitDirection, TFile, View, WorkspaceLeaf } from "obsidian"; -import { ExportLog } from "scripts/html-generation/render-log"; - - -export namespace TabManager -{ - function getLeaf(navType: PaneType | boolean, splitDirection: SplitDirection = 'vertical'): WorkspaceLeaf - { - let leaf = navType === 'split' ? app.workspace.getLeaf(navType, splitDirection) : app.workspace.getLeaf(navType); - return leaf; - } - - export async function openFileInNewTab(file: TFile, navType: PaneType | boolean, splitDirection: SplitDirection = 'vertical'): Promise - { - let leaf = getLeaf(navType, splitDirection); - - try - { - await leaf.openFile(file, undefined).catch((reason) => - { - ExportLog.error(reason); - }); - } - catch (error) - { - ExportLog.error(error); - } - - return leaf; - } - - export function openNewTab(navType: PaneType | boolean, splitDirection: SplitDirection = 'vertical'): WorkspaceLeaf - { - return getLeaf(navType, splitDirection); - } -} - diff --git a/.obsidian/plugins/obsidian-webpage-export-master/scripts/utils/utils.ts b/.obsidian/plugins/obsidian-webpage-export-master/scripts/utils/utils.ts deleted file mode 100644 index c027b63b..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/scripts/utils/utils.ts +++ /dev/null @@ -1,292 +0,0 @@ -import { MarkdownView, PluginManifest, TextFileView } from 'obsidian'; -import { Path } from './path'; -import { ExportLog } from '../html-generation/render-log'; -import { Downloadable } from './downloadable'; -import { Settings, SettingsPage } from 'scripts/settings/settings'; - -/* @ts-ignore */ -const dialog: Electron.Dialog = require('electron').remote.dialog; - -export class Utils -{ - static async delay (ms: number) - { - return new Promise( resolve => setTimeout(resolve, ms) ); - } - - static padStringBeggining(str: string, length: number, char: string) - { - return char.repeat(length - str.length) + str; - } - - static includesAny(str: string, substrings: string[]): boolean - { - for (let substring of substrings) - { - if (str.includes(substring)) return true; - } - - return false; - } - - static async urlAvailable(url: RequestInfo | URL) - { - const controller = new AbortController(); - const id = setTimeout(() => controller.abort(), 4000); - - const response = await fetch(url, {signal: controller.signal, mode: "no-cors"}); - clearTimeout(id); - - return response; - } - - static sampleCSSColorHex(variable: string, testParentEl: HTMLElement): { a: number, hex: string } - { - let testEl = document.createElement('div'); - testEl.style.setProperty('display', 'none'); - testEl.style.setProperty('color', 'var(' + variable + ')'); - testParentEl.appendChild(testEl); - - let col = getComputedStyle(testEl).color; - let opacity = getComputedStyle(testEl).opacity; - - testEl.remove(); - - function toColorObject(str: string) - { - var match = str.match(/rgb?\((\d+),\s*(\d+),\s*(\d+)\)/); - return match ? { - red: parseInt(match[1]), - green: parseInt(match[2]), - blue: parseInt(match[3]), - alpha: 1 - } : null - } - - var color = toColorObject(col), alpha = parseFloat(opacity); - return isNaN(alpha) && (alpha = 1), - color ? { - a: alpha * color.alpha, - hex: Utils.padStringBeggining(color.red.toString(16), 2, "0") + Utils.padStringBeggining(color.green.toString(16), 2, "0") + Utils.padStringBeggining(color.blue.toString(16), 2, "0") - } : { - a: alpha, - hex: "ffffff" - } - }; - - static async changeViewMode(view: MarkdownView, modeName: "preview" | "source") - { - /*@ts-ignore*/ - const mode = view.modes[modeName]; - /*@ts-ignore*/ - mode && await view.setMode(mode); - }; - - static async showSaveDialog(defaultPath: Path, defaultFileName: string, showAllFilesOption: boolean = true): Promise - { - // get paths - let absoluteDefaultPath = defaultPath.directory.absolute().joinString(defaultFileName); - - // add filters - let filters = [{ - name: Utils.trimStart(absoluteDefaultPath.extension, ".").toUpperCase() + " Files", - extensions: [Utils.trimStart(absoluteDefaultPath.extension, ".")] - }]; - - if (showAllFilesOption) - { - filters.push({ - name: "All Files", - extensions: ["*"] - }); - } - - // show picker - let picker = await dialog.showSaveDialog({ - defaultPath: absoluteDefaultPath.asString, - filters: filters, - properties: ["showOverwriteConfirmation"] - }) - - if (picker.canceled || !picker.filePath) return; - - let pickedPath = new Path(picker.filePath); - Settings.exportPath = pickedPath.asString; - SettingsPage.saveSettings(); - - return pickedPath; - } - - static async showSelectFolderDialog(defaultPath: Path): Promise - { - if(!defaultPath.exists) defaultPath = Path.vaultPath; - - // show picker - let picker = await dialog.showOpenDialog({ - defaultPath: defaultPath.directory.asString, - properties: ["openDirectory"] - }); - - if (picker.canceled) return; - - let path = new Path(picker.filePaths[0]); - Settings.exportPath = path.directory.asString; - SettingsPage.saveSettings(); - - return path; - } - - static async showSelectFileDialog(defaultPath: Path): Promise - { - if(!defaultPath.exists) defaultPath = Path.vaultPath; - - // show picker - let picker = await dialog.showOpenDialog({ - defaultPath: defaultPath.directory.asString, - properties: ["openFile"] - }); - - if (picker.canceled) return; - - let path = new Path(picker.filePaths[0]); - return path; - } - - static idealDefaultPath() : Path - { - let lastPath = new Path(Settings.exportPath); - - if (lastPath.asString != "" && lastPath.exists) - { - return lastPath.directory; - } - - return Path.vaultPath; - } - - static async downloadFiles(files: Downloadable[], rootPath: Path) - { - if (!rootPath.isAbsolute) throw new Error("folderPath must be absolute: " + rootPath.asString); - - ExportLog.progress(0, files.length, "Saving HTML files to disk", "...", "var(--color-green)"); - - for (let i = 0; i < files.length; i++) - { - let file = files[i]; - - try - { - await file.download(rootPath.directory); - ExportLog.progress(i+1, files.length, "Saving HTML files to disk", "Saving: " + file.filename, "var(--color-green)"); - } - catch (e) - { - ExportLog.error(e.stack, "Could not save file: " + file.filename); - continue; - } - } - } - - //async function that awaits until a condition is met - static async waitUntil(condition: () => boolean, timeout: number = 1000, interval: number = 100): Promise - { - if (condition()) return true; - - return new Promise((resolve, reject) => { - let timer = 0; - let intervalId = setInterval(() => { - if (condition()) { - clearInterval(intervalId); - resolve(true); - } else { - timer += interval; - if (timer >= timeout) { - clearInterval(intervalId); - resolve(false); - } - } - }, interval); - }); - } - - static getPluginIDs(): string[] - { - /*@ts-ignore*/ - let pluginsArray: string[] = Array.from(app.plugins.enabledPlugins.values()) as string[]; - for (let i = 0; i < pluginsArray.length; i++) - { - /*@ts-ignore*/ - if (app.plugins.manifests[pluginsArray[i]] == undefined) - { - pluginsArray.splice(i, 1); - i--; - } - } - - return pluginsArray; - } - - static getPluginManifest(pluginID: string): PluginManifest | null - { - // @ts-ignore - return app.plugins.manifests[pluginID] ?? null; - } - - static getActiveTextView(): TextFileView | null - { - let view = app.workspace.getActiveViewOfType(TextFileView); - if (!view) - { - return null; - } - - return view; - } - - static trimEnd(inputString: string, trimString: string): string - { - if (inputString.endsWith(trimString)) - { - return inputString.substring(0, inputString.length - trimString.length); - } - - return inputString; - } - - static trimStart(inputString: string, trimString: string): string - { - if (inputString.startsWith(trimString)) - { - return inputString.substring(trimString.length); - } - - return inputString; - } - - static async openPath(path: Path) - { - // @ts-ignore - await window.electron.remote.shell.openPath(path.asString); - } - - static levenshteinDistance(string1: string, string2: string): number - { - if (!string1.length) return string2.length; - if (!string2.length) return string1.length; - const arr = []; - for (let i = 0; i <= string2.length; i++) { - arr[i] = [i]; - for (let j = 1; j <= string1.length; j++) { - arr[i][j] = - i === 0 - ? j - : Math.min( - arr[i - 1][j] + 1, - arr[i][j - 1] + 1, - arr[i - 1][j - 1] + (string1[j - 1] === string2[i - 1] ? 0 : 1) - ); - } - } - return arr[string2.length][string1.length]; - }; -} diff --git a/.obsidian/plugins/obsidian-webpage-export-master/styles.css b/.obsidian/plugins/obsidian-webpage-export-master/styles.css deleted file mode 100644 index 6c0c2dae..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/styles.css +++ /dev/null @@ -1,432 +0,0 @@ -/* THIS FILE IS NOT EXPORTED WITH THE HTML FILE! */ - -/* Flow list used on the settings page */ -.flow-list { - contain: inline-size; - gap: 0.2em; - display: flex; - flex-direction: row; - flex-wrap: wrap; - justify-content: flex-start; - width: -webkit-fill-available; - background-color: var(--background-secondary); - border: 1px solid var(--divider-color); - border-radius: 5px; - padding: 6px; -} - -.flow-item { - display: flex; - flex-direction: row; - border-radius: 100px; - border: 1px solid var(--divider-color); - font-size: 0.9em; - height: min-content; - width: max-content; - padding: 3px 8px 3px 8px; - margin: 0.1em 0em 0.1em 0.0em; - background-color: var(--background-primary); - align-items: center; -} - -.flow-item:has(input:checked) { - background-color: hsla(var(--color-accent-hsl), 0.3); -} - -.flow-item input[type="checkbox"] { - padding: 0; - margin: 0.1em; - margin-right: 0.5em; -} - -/* Progressbar used in the render progress */ - -.html-render-progressbar::-webkit-progress-bar { - background-color: var(--background-secondary); - border-radius: 500px; -} - -.html-render-progressbar::-webkit-progress-value { - background-color: currentColor; - border-radius: 500px; -} - - -/*#region Tree */ - -.tree-container -{ - --checkbox-size: 1.2em; - --collapse-arrow-size: 0.5em; - --tree-horizontal-spacing: calc(var(--collapse-arrow-size) * 2); - --tree-vertical-spacing: 0.5em; - --sidebar-margin: 12px; - - font-size: 14px; - font-family: var(--font-family); -} - -input[type=checkbox].file-checkbox -{ - position: absolute; - margin-left: calc(0px - var(--collapse-arrow-size) * 2 - 0.5em - var(--checkbox-size) - 0.5em); - z-index: 20; -} - -.theme-dark .tree-item:has(.file-checkbox.checked).mod-tree-folder -{ - transition: border-radius 0.2s, background-color 0.2s; - background-color: rgba(var(--color-blue-rgb), 0.05); - border-radius: 3px var(--radius-l) var(--radius-l) 3px; -} - -.tree-item:has(.tree-item-contents) -{ - cursor: pointer; -} - -.tree-item:has(.file-checkbox).mod-tree-folder -{ - margin-top: 2px; - margin-bottom: 2px; -} - -.tree-item.mod-tree-control -{ - background-color: var(--color-base-00); - border-radius: var(--radius-s); - box-shadow: 0px 0px 10px 0px rgba(0,0,0,0.2); - width: fit-content; - margin-bottom: 1em; -} - -.tree-item:has(.file-checkbox.checked).mod-tree-folder.is-collapsed -{ - border-radius: 3px; -} - -.tree-item-title * -{ - padding: 0; - margin: 0; - overflow: visible; - display: inline-block; -} - - -.tree-container .tree-item-icon * -{ - color: var(--text-muted); - font-family: emoji; -} - -.tree-container .tree-item-icon :is(svg,img) -{ - -webkit-mask-image-repeat: no-repeat; - -webkit-mask-image-position: center; - max-width: 1.3em; - height: 100%; -} - -/* Skip outer wrappers around icons */ -.tree-container .tree-item-icon *:has(svg) -{ - display: contents !important; -} - -.tree-container .tree-item-icon -{ - min-width: 1.6em; - max-width: 1.6em; - display: flex; - align-items: center; - justify-content: flex-start; -} - -.theme-dark .tree-item:has(> .tree-link > .tree-item-contents > .file-checkbox:not(.checked)):has(.file-checkbox.checked).mod-tree-folder -{ - background-color: rgba(var(--color-pink-rgb), 0.1); -} - -.theme-light .tree-item:has(.file-checkbox.checked).mod-tree-folder -{ - transition: border-radius 0.2s, background-color 0.2s; - background-color: rgba(var(--color-blue-rgb), 0.15); - border-radius: 3px var(--radius-l) var(--radius-l) 3px; -} - -.theme-light .tree-item:has(> .tree-link > .tree-item-contents > .file-checkbox:not(.checked)):has(.file-checkbox.checked).mod-tree-folder -{ - background-color: rgba(var(--color-pink-rgb), 0.15); -} - - -/* Base tree */ -.tree-container -{ - /* padding-bottom: 12px; */ - /* margin: 12px; */ - /* height: 100%; */ - /* position: relative; */ - /* display: contents; */ - position: relative; - height: 100%; - width: auto; - margin: var(--sidebar-margin); - margin-top: 3em; - margin-bottom: 0; -} - -.tree-container .tree-header -{ - display: flex; - flex-direction: row; - align-items: center; - position: absolute; - top: -3em; -} - -.tree-container .tree-header .sidebar-section-header -{ - margin: 1em; - margin-left: 0; -} - -.tree-container:has(.tree-scroll-area:empty) -{ - display: none; -} - -.tree-container .tree-scroll-area -{ - width: 100%; - height: 100%; - max-height: 100%; - overflow-y: auto; - padding: 1em; - padding-right: calc(1em + var(--sidebar-margin)); - padding-bottom: 3em; - border-radius: var(--radius-m); -} - -.tree-container .tree-item -{ - transition: background-color 0.2s; - display: flex; - flex-direction: column; - align-items: flex-start; - padding: 0; - border: none !important; -} - -.tree-container .tree-item-children -{ - padding: 0; - margin-bottom: 0; - margin-left: 0; - - border-left: none; - width: -webkit-fill-available; -} - -.tree-container .tree-item.mod-active > .tree-link > .tree-item-contents -{ - color: var(--interactive-accent); -} - -.tree-container .tree-link { - position: relative; - display: flex; - flex-direction: row; - align-items: center; - text-decoration: none; - color: var(--nav-item-color); - width: -webkit-fill-available; - margin-left: var(--tree-horizontal-spacing); -} - -.tree-container .tree-link:active -{ - color: var(--nav-item-color-active); -} - -.tree-container .tree-item-contents -{ - width: 100%; - height: 100%; - margin: 0 !important; - padding: 0 !important; - background-color: transparent !important; - border-radius: var(--radius-s); - padding-left: calc(var(--tree-horizontal-spacing) + var(--checkbox-size) * 2 + 1px) !important; - padding-bottom: calc(var(--tree-vertical-spacing) / 2) !important; - padding-top: calc(var(--tree-vertical-spacing) / 2) !important; - color: var(--text-normal); - display: flex !important; - flex-direction: row !important; - justify-content: flex-start; - align-items: center; -} - -.tree-container .tree-item-contents:has(.tree-item-icon.collapse-icon) -{ - cursor: pointer !important; -} - -.tree-container .tree-item-title -{ - overflow: hidden; - text-overflow: ellipsis; - text-wrap: nowrap; - white-space: nowrap; - - width: 100%; - width: -webkit-fill-available; - width: -moz-available; - width: fill-available; - - position: relative; -} - -.tree-container .collapse-icon { - margin-left: calc(0px - var(--collapse-arrow-size) * 2 - 0.5em); - position: absolute; -} - -.tree-container .tree-item.mod-tree-folder > .tree-link > .collapse-icon -{ - width: 100%; -} - -.tree-container .collapse-icon > svg { - color: unset !important; -} - -.tree-container .collapse-icon:hover -{ - color: var(--nav-item-color-hover); -} - -.tree-container .tree-item.is-collapsed > .tree-link > .tree-item-contents > .collapse-icon > svg -{ - transition: transform 0.1s ease-in-out; - transform: rotate(-90deg); -} - -.tree-container .tree-item-contents:hover -{ - cursor: default; - text-decoration: none; -} - -.tree-container .tree-link:hover -{ - background-color: var(--nav-item-background-hover); - border-radius: var(--radius-s); -} - -.tree-container .tree-item-title -{ - background-color: transparent !important; - color: var(--nav-item-color) !important; -} - - -/* Indentation guide */ - -.tree-container > .tree-scroll-area > * .tree-item -{ - margin-left: calc(var(--tree-horizontal-spacing) + var(--collapse-arrow-size) / 2 + 1px); - border-left: var(--nav-indentation-guide-width) solid var(--nav-indentation-guide-color); -} - -.tree-container .tree-scroll-area > * > * > .tree-item -{ - margin-left: calc(var(--collapse-arrow-size) / 2 + 1px); -} - -.tree-container .tree-item.mod-active -{ - border-left: var(--nav-indentation-guide-width) solid var(--interactive-accent); -} - - -.tree-container .tree-item:hover:not(.mod-active):not(.mod-collapsible):not(:has(.tree-item:hover)) /* Hover */ -{ - border-left: var(--nav-indentation-guide-width) solid var(--nav-item-color-hover); -} - -.tree-container .tree-item:not(.mod-collapsible) > .tree-item-children > .tree-item, -.tree-container > .tree-scroll-area > .tree-item, -.tree-container:not(.mod-nav-indicator) .tree-item -{ - border-left: none !important; -} - -.tree-container .tree-item:not(.mod-collapsible) > .tree-item-children > .tree-item > .tree-link, -.tree-container:not(.mod-nav-indicator) .tree-item .tree-link, -.tree-container > .tree-scroll-area > .tree-item > .tree-link -{ - margin-left: 0 !important; -} - -/* Special */ - - -/* AnuPpuccin rainbow indent support */ -.anp-simple-rainbow-color-toggle.anp-simple-rainbow-indentation-toggle .tree-container .tree-item -{ - border-color: rgba(var(--rainbow-folder-color), 0.5); -} - -.tree-container.outline-tree .tree-item[data-depth='1'] > .tree-link > .tree-item-contents -{ - font-weight: 900; - font-size: 1.1em; - margin-left: 0; - padding-left: 1em; -} - -.tree-container .nav-folder.mod-root .nav-folder>.nav-folder-children -{ - padding: 0 !important; - margin: 0 !important; - border: none !important; -} - -.tree-container .nav-file -{ - border-radius: 0 !important; -} - -.tree-container .nav-folder.mod-root .nav-folder > .nav-folder-children -{ - border-radius: var(--radius-s) !important;; -} - -.tree-container .nav-file-tag -{ - margin-right: 1em; -} - -.tree-container .nav-file-title-content, .tree-container .nav-folder-title-content -{ - margin-top: unset !important; - margin-bottom: unset !important; - margin-left: unset !important; - margin-right: unset !important; - display: unset !important; - border-radius: unset !important; - cursor: unset !important; - font-size: unset !important; - font-weight: unset !important; - line-height: unset !important; - padding: unset !important; - border: unset !important; -} - -.tree-item-contents:has(.tree-item-icon) .tree-item-title::before -{ - display: none !important; -} -/*#endregion */ diff --git a/.obsidian/plugins/obsidian-webpage-export-master/tsconfig.json b/.obsidian/plugins/obsidian-webpage-export-master/tsconfig.json deleted file mode 100644 index aa02f89d..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/tsconfig.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "compilerOptions": { - "baseUrl": ".", - "inlineSourceMap": true, - "inlineSources": true, - "module": "ESNext", - "target": "ES6", - "noImplicitAny": true, - "moduleResolution": "node", - "importHelpers": true, - "isolatedModules": true, - "esModuleInterop":true, - "strictNullChecks": true, - "lib": [ - "DOM", - "ES5", - "ES6", - "ES7", - "ES2021.String" - ] - }, - "include": [ - "**/*.ts" - ] -} diff --git a/.obsidian/plugins/obsidian-webpage-export-master/version-bump.mjs b/.obsidian/plugins/obsidian-webpage-export-master/version-bump.mjs deleted file mode 100644 index d409fa0e..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/version-bump.mjs +++ /dev/null @@ -1,14 +0,0 @@ -import { readFileSync, writeFileSync } from "fs"; - -const targetVersion = process.env.npm_package_version; - -// read minAppVersion from manifest.json and bump version to target version -let manifest = JSON.parse(readFileSync("manifest.json", "utf8")); -const { minAppVersion } = manifest; -manifest.version = targetVersion; -writeFileSync("manifest.json", JSON.stringify(manifest, null, "\t")); - -// update versions.json with target version and minAppVersion from manifest.json -let versions = JSON.parse(readFileSync("versions.json", "utf8")); -versions[targetVersion] = minAppVersion; -writeFileSync("versions.json", JSON.stringify(versions, null, "\t")); diff --git a/.obsidian/plugins/obsidian-webpage-export-master/versions.json b/.obsidian/plugins/obsidian-webpage-export-master/versions.json deleted file mode 100644 index e7a9d43a..00000000 --- a/.obsidian/plugins/obsidian-webpage-export-master/versions.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "1.5.2": "0.15.0", - "1.6.0": "1.1.9" -}