diff --git a/.deployignore b/.deployignore deleted file mode 100644 index 56180bf5..00000000 --- a/.deployignore +++ /dev/null @@ -1,22 +0,0 @@ -.DS_Store -Thumbs.db -wp-cli.local.yml -node_modules/ -*.sql -*.tar.gz -*.zip -.phpunit.result.cache -Dockerfile -output.log -.github -tests -bin -composer.lock -.phpcs.xml -phpunit.xml -configure.php -DOCKER_ENV -phpunit.xml -tests -.phpcs -Makefile diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 115b12e2..00000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,25 +0,0 @@ -# Please see the documentation for all configuration options: -# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates - -version: 2 -updates: - - - package-ecosystem: "github-actions" - directory: "/" - schedule: - interval: "weekly" - - - package-ecosystem: "composer" - directory: "/" - schedule: - interval: "weekly" - - - package-ecosystem: "npm" - directory: "/" - schedule: - interval: "weekly" - day: "saturday" - time: "09:00" - timezone: "America/New_York" - ignore: - - dependency-name: "@wordpress/*" diff --git a/.github/workflows/build-branch.yml b/.github/workflows/build-branch.yml deleted file mode 100644 index 52fee124..00000000 --- a/.github/workflows/build-branch.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: Create a -built branch - -on: - push: - branches: - - main - - develop - -jobs: - built-branch: - uses: alleyinteractive/.github/.github/workflows/built-branch.yml@main - with: - node: 18 - php: 8.1 diff --git a/.github/workflows/built-release.yml b/.github/workflows/built-release.yml deleted file mode 100644 index cf60ecfc..00000000 --- a/.github/workflows/built-release.yml +++ /dev/null @@ -1,10 +0,0 @@ -name: Built Release - -on: - push: - branches: - - develop - -jobs: - built-release: - uses: alleyinteractive/.github/.github/workflows/built-release.yml@main diff --git a/.github/workflows/built-tag.yml b/.github/workflows/built-tag.yml deleted file mode 100644 index 94e59e2d..00000000 --- a/.github/workflows/built-tag.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: Create a -built tag - -on: - push: - tags: - - 'v*.*.*' - - '!*-built' - -jobs: - built-tag: - uses: alleyinteractive/.github/.github/workflows/built-tag.yml@main - with: - node: 18 diff --git a/.github/workflows/coding-quality.yml b/.github/workflows/coding-quality.yml deleted file mode 100644 index 5b7f32ec..00000000 --- a/.github/workflows/coding-quality.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: Code Quality - -on: - push: - branches: - - main - pull_request: - # Uncomment and edit the following to run on a schedule. - # schedule: - # - cron: '45 5 * * 0' # Run once per week at 5:45am UTC on Sundays. - -jobs: - code-quality: - uses: alleyinteractive/.github/.github/workflows/php-code-quality.yml@main - with: - php: 8.1 - command: | - phpstan \ No newline at end of file diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml deleted file mode 100644 index 43af87b3..00000000 --- a/.github/workflows/coding-standards.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: Coding Standards - -on: - push: - branches: - - develop - pull_request: - # Uncomment and edit the following to run on a schedule. - # schedule: - # - cron: '0 5 * * 0' # Run once per week at 5am UTC on Sundays. - -jobs: - coding-standards: - uses: alleyinteractive/.github/.github/workflows/php-coding-standards.yml@main - with: - php: 8.1 - command: | - phpstan \ No newline at end of file diff --git a/.github/workflows/dependabot-auto-approve.yml b/.github/workflows/dependabot-auto-approve.yml deleted file mode 100644 index e2119dec..00000000 --- a/.github/workflows/dependabot-auto-approve.yml +++ /dev/null @@ -1,11 +0,0 @@ -name: dependabot-auto-approve -on: - pull_request: - -permissions: - pull-requests: write - contents: write - -jobs: - dependabot: - uses: alleyinteractive/.github/.github/workflows/dependabot-auto-approve.yml@main diff --git a/.github/workflows/dependabot-auto-merge.yml b/.github/workflows/dependabot-auto-merge.yml deleted file mode 100644 index aaed13d4..00000000 --- a/.github/workflows/dependabot-auto-merge.yml +++ /dev/null @@ -1,10 +0,0 @@ -name: dependabot-auto-merge -on: pull_request_target - -permissions: - pull-requests: write - contents: write - -jobs: - dependabot: - uses: alleyinteractive/.github/.github/workflows/dependabot-auto-merge.yml@main diff --git a/.github/workflows/node-tests.yml b/.github/workflows/node-tests.yml deleted file mode 100644 index 04eb799f..00000000 --- a/.github/workflows/node-tests.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: Node Tests - -on: - push: - branches: - - develop - pull_request: - # Uncomment and edit the following to run on a schedule. - # schedule: - # - cron: '15 5 * * 0' # Run once per week at 5:15am UTC on Sundays. - -jobs: - node-tests: - uses: alleyinteractive/.github/.github/workflows/node-tests.yml@main - with: - run-audit: true - node: 18 diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml deleted file mode 100644 index 36ed0cf9..00000000 --- a/.github/workflows/unit-test.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Testing Suite - -on: - push: - branches: - - develop - pull_request: - # Uncomment and edit the following to run on a schedule. - # schedule: - # - cron: '30 5 * * 0' # Run once per week at 5:30am UTC on Sundays. - -jobs: - php-tests: - strategy: - matrix: - php: [8.1] - wordpress: ["latest"] - uses: alleyinteractive/.github/.github/workflows/php-tests.yml@main - with: - php: ${{ matrix.php }} - wordpress: ${{ matrix.wordpress }} diff --git a/.github/workflows/update-changelog.yml b/.github/workflows/update-changelog.yml deleted file mode 100644 index 94df2c33..00000000 --- a/.github/workflows/update-changelog.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: "Update Changelog" - -on: - release: - types: [released] - -jobs: - update: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - ref: main - - - name: Update Changelog - uses: stefanzweifel/changelog-updater-action@v1 - with: - latest-version: ${{ github.event.release.name }} - release-notes: ${{ github.event.release.body }} - - - name: Commit updated CHANGELOG - uses: stefanzweifel/git-auto-commit-action@v4 - with: - branch: main - commit_message: Update CHANGELOG - file_pattern: CHANGELOG.md diff --git a/.github/workflows/upgrade-wordpress-plugin.yml b/.github/workflows/upgrade-wordpress-plugin.yml deleted file mode 100644 index 36f38e0d..00000000 --- a/.github/workflows/upgrade-wordpress-plugin.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: Update WordPress Plugin - -on: - schedule: - - cron: '0 6 1 * *' # Run on the first day of every month at 6am UTC. - -permissions: - contents: write - pull-requests: write - -jobs: - update-plugin: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: alleyinteractive/action-update-wordpress-plugin@v1.2.1 - with: - plugin-file: 'wp-curate.php' - upgrade-npm-dependencies: "true" diff --git a/.gitignore b/.gitignore index a8545793..56180bf5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,26 +1,22 @@ -# Build files -build -vendor -composer.lock -node_modules - -# Log files -*.log - -# Cache files -.phpcs/*.json -.phpunit.result.cache - -# Ignore temporary OS files .DS_Store -.DS_Store? -.Spotlight-V100 -.Trashes -ehthumbs.db Thumbs.db -.thumbsdb - -# IDE files -*.code-workspace -.idea -.vscode +wp-cli.local.yml +node_modules/ +*.sql +*.tar.gz +*.zip +.phpunit.result.cache +Dockerfile +output.log +.github +tests +bin +composer.lock +.phpcs.xml +phpunit.xml +configure.php +DOCKER_ENV +phpunit.xml +tests +.phpcs +Makefile diff --git a/.phpcs.xml b/.phpcs.xml deleted file mode 100644 index f79d046f..00000000 --- a/.phpcs.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - PHP_CodeSniffer standard for wp-curate. - - - - - - - - - - - - - - - - - - - - - build/ - vendor/ - - - - - - - - - - - - - - - - - - src/assets.php - blocks - build - entries - - - - src/assets.php - - diff --git a/build/example-entry/index.asset.php b/build/example-entry/index.asset.php new file mode 100644 index 00000000..eeb6d0c8 --- /dev/null +++ b/build/example-entry/index.asset.php @@ -0,0 +1 @@ + array(), 'version' => 'fbb750fd312778403036'); diff --git a/build/example-entry/index.css b/build/example-entry/index.css new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/build/example-entry/index.css @@ -0,0 +1 @@ + diff --git a/.phpcs/.gitkeep b/build/example-entry/index.js similarity index 100% rename from .phpcs/.gitkeep rename to build/example-entry/index.js diff --git a/build/post/block.json b/build/post/block.json new file mode 100644 index 00000000..1cb16357 --- /dev/null +++ b/build/post/block.json @@ -0,0 +1,24 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 2, + "name": "wp-curate/post", + "version": "0.1.0", + "title": "Post", + "category": "theme", + "icon": "admin-post", + "description": "Container block to allow setting a post inline", + "textdomain": "wp-curate", + "editorScript": "file:index.js", + "editorStyle": "file:index.css", + "style": [ + "file:style-index.css" + ], + "usesContext": [ + "postId", + "query" + ], + "render": "file:render.php", + "supports": { + "inserter": false + } +} \ No newline at end of file diff --git a/build/post/index.asset.php b/build/post/index.asset.php new file mode 100644 index 00000000..537aca3e --- /dev/null +++ b/build/post/index.asset.php @@ -0,0 +1 @@ + array('wp-block-editor', 'wp-blocks', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => '4c70dccf518b29efedd2'); diff --git a/build/post/index.css b/build/post/index.css new file mode 100644 index 00000000..b47ad643 --- /dev/null +++ b/build/post/index.css @@ -0,0 +1 @@ +.wp-curate-post-block{padding:2px}.wp-curate-post-block--selected{outline:1px dashed #ccc;outline-offset:.5rem}.wp-curate-post-block--backfill .block-editor-inner-blocks{opacity:.5}.wp-curate-post-block__post-picker{margin-bottom:.5rem;text-align:right} diff --git a/build/post/index.js b/build/post/index.js new file mode 100644 index 00000000..05928b88 --- /dev/null +++ b/build/post/index.js @@ -0,0 +1,42 @@ +!function(){var e={373:function(e){var t;self,t=()=>(()=>{var e={779:(e,t)=>{var n;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e=[],t=0;t{"use strict";n.d(t,{Z:()=>a});var r=n(272),o=n.n(r),s=n(609),i=n.n(s)()(o());i.push([e.id,".alley-scripts-post-picker__post-list{display:flex;flex-wrap:wrap;float:left;height:calc(70vh - 200px);justify-content:flex-start;overflow-y:auto;padding:8px;width:100%}.alley-scripts-post-picker__post{border:1px solid #eee;height:auto;justify-content:center;margin:0 8px 8px 0;transition:background-color .2s ease-in-out;width:calc((100% - 40px)/3)}@media(min-width: 780px){.alley-scripts-post-picker__post{width:calc((100% - 40px)/5)}}.alley-scripts-post-picker__post:hover{background-color:#f5f5f5}.alley-scripts-post-picker__post.is-selected{background-color:#f5f5f5}.alley-scripts-post-picker__load-more{clear:both;float:left;text-align:center;width:100%}","",{version:3,sources:["webpack://./src/components/post-picker/post-list.scss"],names:[],mappings:"AAAA,sCACE,YAAA,CACA,cAAA,CACA,UAAA,CACA,yBAAA,CACA,0BAAA,CACA,eAAA,CACA,WAAA,CACA,UAAA,CAGF,iCACE,qBAAA,CACA,WAAA,CACA,sBAAA,CACA,kBAAA,CACA,2CAAA,CACA,2BAAA,CAGA,yBATF,iCAUI,2BAAA,CAAA,CAGF,uCACE,wBAAA,CAGF,6CACE,wBAAA,CAIJ,sCACE,UAAA,CACA,UAAA,CACA,iBAAA,CACA,UAAA",sourcesContent:[".alley-scripts-post-picker__post-list {\n display: flex;\n flex-wrap: wrap;\n float: left;\n height: calc(70vh - 200px);\n justify-content: flex-start;\n overflow-y: auto;\n padding: 8px;\n width: 100%;\n}\n\n.alley-scripts-post-picker__post {\n border: 1px solid #eee;\n height: auto;\n justify-content: center;\n margin: 0 8px 8px 0;\n transition: background-color 0.2s ease-in-out;\n width: calc((100% - 40px) / 3);\n\n\n @media (min-width: 780px) {\n width: calc((100% - 40px) / 5);\n }\n\n &:hover {\n background-color: #f5f5f5;\n }\n\n &.is-selected {\n background-color: #f5f5f5;\n }\n}\n\n.alley-scripts-post-picker__load-more {\n clear: both;\n float: left;\n text-align: center;\n width: 100%;\n}\n"],sourceRoot:""}]);const a=i},992:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(272),o=n.n(r),s=n(609),i=n.n(s)()(o());i.push([e.id,".components-modal__content{width:90vw}.alley-scripts-post-picker__buttons{clear:both;display:block;text-align:right;width:100%}.alley-scripts-post-picker__buttons button{margin:5px}","",{version:3,sources:["webpack://./src/components/post-picker/search-modal.scss"],names:[],mappings:"AAAA,2BACE,UAAA,CAGF,oCACE,UAAA,CACA,aAAA,CACA,gBAAA,CACA,UAAA,CAEA,2CACE,UAAA",sourcesContent:[".components-modal__content {\n width: 90vw;\n}\n\n.alley-scripts-post-picker__buttons {\n clear: both;\n display: block;\n text-align: right;\n width: 100%;\n\n button {\n margin: 5px;\n }\n}\n"],sourceRoot:""}]);const a=i},458:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(272),o=n.n(r),s=n(609),i=n.n(s)()(o());i.push([e.id,'.edit-post-sidebar .autocomplete__component,.editor-styles-wrapper .autocomplete__component{margin-bottom:20px}.edit-post-sidebar .autocomplete-base-control,.editor-styles-wrapper .autocomplete-base-control{position:relative}.edit-post-sidebar .autocomplete-text-control__input,.editor-styles-wrapper .autocomplete-text-control__input{margin:0}.edit-post-sidebar .autocomplete__selection-list,.editor-styles-wrapper .autocomplete__selection-list{list-style-type:none;margin:0 0 6px;padding:0}.edit-post-sidebar .autocomplete__selection-list--item,.editor-styles-wrapper .autocomplete__selection-list--item{display:inline-block;list-style:none}.edit-post-sidebar .autocomplete__selection-list--item--button,.editor-styles-wrapper .autocomplete__selection-list--item--button{margin-bottom:4px;margin-right:3px}.edit-post-sidebar .autocomplete__selection-list--item--button::after,.editor-styles-wrapper .autocomplete__selection-list--item--button::after{content:"×";font-size:16px;line-height:20px;margin-left:5px}.edit-post-sidebar .autocomplete__dropdown,.editor-styles-wrapper .autocomplete__dropdown{background-color:#fff;border-color:rgba(0,0,0,0) #e2e4e7 #e2e4e7;border-radius:0 0 4px 4px;border-style:solid;border-width:0 1px 1px;left:0;max-height:0;overflow-y:hidden;position:absolute;top:calc(100% + 1px);visibility:hidden;width:100%;z-index:10}.edit-post-sidebar .autocomplete__dropdown--is-open,.editor-styles-wrapper .autocomplete__dropdown--is-open{box-shadow:0 3px 30px rgba(25,30,35,.1);max-height:225px;overflow-y:scroll;visibility:visible}.edit-post-sidebar .autocomplete__dropdown--notice,.editor-styles-wrapper .autocomplete__dropdown--notice{padding:15px}.edit-post-sidebar .autocomplete__dropdown--results,.editor-styles-wrapper .autocomplete__dropdown--results{list-style:none;margin:0;padding:0}.edit-post-sidebar .autocomplete__list--item,.editor-styles-wrapper .autocomplete__list--item{list-style:none}.edit-post-sidebar .autocomplete__list--item>button,.editor-styles-wrapper .autocomplete__list--item>button{background:rgba(0,0,0,0);border-color:#e2e4e7;border-style:solid;border-width:0 0 1px;height:100%;line-height:1.25;text-align:left;white-space:inherit;width:100%}.edit-post-sidebar .autocomplete__list--item:last-child>button,.editor-styles-wrapper .autocomplete__list--item:last-child>button{border-bottom:0}',"",{version:3,sources:["webpack://./src/components/selector/styles.scss"],names:[],mappings:"AAAA,4FAgBI,kBACE,CAAA,gGAMF,iBACE,CAAA,8GAMF,QACE,CAAA,sGAMF,oBACE,CAAA,cACA,CAAA,SACA,CAAA,kHAEA,oBACE,CAAA,eACA,CAAA,kIAEA,iBACE,CAAA,gBACA,CAAA,gJAEA,WACE,CAAA,cACA,CAAA,gBACA,CAAA,eACA,CAAA,0FASR,qBACE,CAAA,0CACA,CAAA,yBACA,CAAA,kBACA,CAAA,sBACA,CAAA,MACA,CAAA,YACA,CAAA,iBACA,CAAA,iBACA,CAAA,oBACA,CAAA,iBACA,CAAA,UACA,CAAA,UACA,CAAA,4GAGA,uCACE,CAAA,gBACA,CAAA,iBACA,CAAA,kBACA,CAAA,0GAIF,YACE,CAAA,4GAIF,eACE,CAAA,QACA,CAAA,SACA,CAAA,8FAOJ,eACE,CAAA,4GAEA,wBACE,CAAA,oBACA,CAAA,kBACA,CAAA,oBACA,CAAA,WACA,CAAA,gBACA,CAAA,eACA,CAAA,mBACA,CAAA,UACA,CAAA,kIAGF,eACE",sourcesContent:["//--------------------------------------------------------------\n// AutoComplete Styles\n//--------------------------------------------------------------\n\n/* stylelint-disable max-nesting-depth */\n\n//-----------------------------------------\n// Accommodate editor well, or the sidebar.\n//-----------------------------------------\n.edit-post-sidebar,\n.editor-styles-wrapper {\n .autocomplete {\n\n //-----------------------------------------\n // Parent form wrapper.\n //-----------------------------------------\n &__component {\n margin-bottom: 20px;\n }\n\n //-----------------------------------------\n // Wrapper\n //-----------------------------------------\n &-base-control {\n position: relative;\n }\n\n //-----------------------------------------\n // Input\n //-----------------------------------------\n &-text-control__input {\n margin: 0;\n }\n\n //-----------------------------------------\n // Selected buttons.\n //-----------------------------------------\n &__selection-list {\n list-style-type: none;\n margin: 0 0 6px;\n padding: 0;\n\n &--item {\n display: inline-block;\n list-style: none;\n\n &--button {\n margin-bottom: 4px;\n margin-right: 3px;\n\n &::after {\n content: '×';\n font-size: 16px;\n line-height: 20px;\n margin-left: 5px;\n }\n }\n }\n }\n\n //-----------------------------------------\n // Results\n //-----------------------------------------\n &__dropdown {\n background-color: #fff;\n border-color: transparent #e2e4e7 #e2e4e7;\n border-radius: 0 0 4px 4px;\n border-style: solid;\n border-width: 0 1px 1px;\n left: 0;\n max-height: 0;\n overflow-y: hidden;\n position: absolute;\n top: calc(100% + 1px); // Offset focus border.\n visibility: hidden;\n width: 100%;\n z-index: 10;\n\n // Container is open.\n &--is-open {\n box-shadow: 0 3px 30px rgba(25, 30, 35, 0.1);\n max-height: 225px;\n overflow-y: scroll;\n visibility: visible;\n }\n\n // Notice handler.\n &--notice {\n padding: 15px;\n }\n\n // Results container.\n &--results {\n list-style: none;\n margin: 0;\n padding: 0;\n }\n }\n\n //-----------------------------------------\n // List/Results\n //-----------------------------------------\n &__list--item {\n list-style: none;\n\n > button {\n background: transparent;\n border-color: #e2e4e7;\n border-style: solid;\n border-width: 0 0 1px;\n height: 100%;\n line-height: 1.25;\n text-align: left;\n white-space: inherit;\n width: 100%;\n }\n\n &:last-child > button {\n border-bottom: 0;\n }\n }\n }\n}\n"],sourceRoot:""}]);const a=i},609:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,r,o,s){"string"==typeof e&&(e=[[null,e,void 0]]);var i={};if(r)for(var a=0;a0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=s),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),o&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=o):u[4]="".concat(o)),t.push(u))}},t}},272:e=>{"use strict";e.exports=function(e){var t=e[1],n=e[3];if(!n)return t;if("function"==typeof btoa){var r=btoa(unescape(encodeURIComponent(JSON.stringify(n)))),o="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(r),s="/*# ".concat(o," */");return[t].concat([s]).join("\n")}return[t].join("\n")}},368:function(e){e.exports=function(){"use strict";const{entries:e,setPrototypeOf:t,isFrozen:n,getPrototypeOf:r,getOwnPropertyDescriptor:o}=Object;let{freeze:s,seal:i,create:a}=Object,{apply:l,construct:c}="undefined"!=typeof Reflect&&Reflect;l||(l=function(e,t,n){return e.apply(t,n)}),s||(s=function(e){return e}),i||(i=function(e){return e}),c||(c=function(e,t){return new e(...t)});const u=w(Array.prototype.forEach),p=w(Array.prototype.pop),d=w(Array.prototype.push),f=w(String.prototype.toLowerCase),h=w(String.prototype.toString),m=w(String.prototype.match),g=w(String.prototype.replace),y=w(String.prototype.indexOf),v=w(String.prototype.trim),b=w(RegExp.prototype.test),A=(_=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n1?n-1:0),o=1;o/gm),B=i(/\${[\w\W]*}/gm),F=i(/^data-[\-\w.\u00B7-\uFFFF]/),z=i(/^aria-[\-\w]+$/),q=i(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),$=i(/^(?:\w+script|data):/i),H=i(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),W=i(/^html$/i);var G=Object.freeze({__proto__:null,MUSTACHE_EXPR:U,ERB_EXPR:M,TMPLIT_EXPR:B,DATA_ATTR:F,ARIA_ATTR:z,IS_ALLOWED_URI:q,IS_SCRIPT_OR_DATA:$,ATTR_WHITESPACE:H,DOCTYPE_NAME:W});return function t(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"undefined"==typeof window?null:window;const r=e=>t(e);if(r.version="3.0.5",r.removed=[],!n||!n.document||9!==n.document.nodeType)return r.isSupported=!1,r;const o=n.document,i=o.currentScript;let{document:a}=n;const{DocumentFragment:l,HTMLTemplateElement:c,Node:_,Element:w,NodeFilter:U,NamedNodeMap:M=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:B,DOMParser:F,trustedTypes:z}=n,$=w.prototype,H=S($,"cloneNode"),Y=S($,"nextSibling"),V=S($,"childNodes"),Z=S($,"parentNode");if("function"==typeof c){const e=a.createElement("template");e.content&&e.content.ownerDocument&&(a=e.content.ownerDocument)}let K,Q="";const{implementation:J,createNodeIterator:X,createDocumentFragment:ee,getElementsByTagName:te}=a,{importNode:ne}=o;let re={};r.isSupported="function"==typeof e&&"function"==typeof Z&&J&&void 0!==J.createHTMLDocument;const{MUSTACHE_EXPR:oe,ERB_EXPR:se,TMPLIT_EXPR:ie,DATA_ATTR:ae,ARIA_ATTR:le,IS_SCRIPT_OR_DATA:ce,ATTR_WHITESPACE:ue}=G;let{IS_ALLOWED_URI:pe}=G,de=null;const fe=x({},[...k,...E,...R,...I,...O]);let he=null;const me=x({},[...P,...L,...j,...D]);let ge=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ye=null,ve=null,be=!0,Ae=!0,_e=!1,we=!0,xe=!1,Ce=!1,Se=!1,ke=!1,Ee=!1,Re=!1,Te=!1,Ie=!0,Ne=!1,Oe=!0,Pe=!1,Le={},je=null;const De=x({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ue=null;const Me=x({},["audio","video","img","source","image","track"]);let Be=null;const Fe=x({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ze="http://www.w3.org/1998/Math/MathML",qe="http://www.w3.org/2000/svg",$e="http://www.w3.org/1999/xhtml";let He=$e,We=!1,Ge=null;const Ye=x({},[ze,qe,$e],h);let Ve;const Ze=["application/xhtml+xml","text/html"];let Ke,Qe=null;const Je=a.createElement("form"),Xe=function(e){return e instanceof RegExp||e instanceof Function},et=function(e){if(!Qe||Qe!==e){if(e&&"object"==typeof e||(e={}),e=C(e),Ve=Ve=-1===Ze.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,Ke="application/xhtml+xml"===Ve?h:f,de="ALLOWED_TAGS"in e?x({},e.ALLOWED_TAGS,Ke):fe,he="ALLOWED_ATTR"in e?x({},e.ALLOWED_ATTR,Ke):me,Ge="ALLOWED_NAMESPACES"in e?x({},e.ALLOWED_NAMESPACES,h):Ye,Be="ADD_URI_SAFE_ATTR"in e?x(C(Fe),e.ADD_URI_SAFE_ATTR,Ke):Fe,Ue="ADD_DATA_URI_TAGS"in e?x(C(Me),e.ADD_DATA_URI_TAGS,Ke):Me,je="FORBID_CONTENTS"in e?x({},e.FORBID_CONTENTS,Ke):De,ye="FORBID_TAGS"in e?x({},e.FORBID_TAGS,Ke):{},ve="FORBID_ATTR"in e?x({},e.FORBID_ATTR,Ke):{},Le="USE_PROFILES"in e&&e.USE_PROFILES,be=!1!==e.ALLOW_ARIA_ATTR,Ae=!1!==e.ALLOW_DATA_ATTR,_e=e.ALLOW_UNKNOWN_PROTOCOLS||!1,we=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,xe=e.SAFE_FOR_TEMPLATES||!1,Ce=e.WHOLE_DOCUMENT||!1,Ee=e.RETURN_DOM||!1,Re=e.RETURN_DOM_FRAGMENT||!1,Te=e.RETURN_TRUSTED_TYPE||!1,ke=e.FORCE_BODY||!1,Ie=!1!==e.SANITIZE_DOM,Ne=e.SANITIZE_NAMED_PROPS||!1,Oe=!1!==e.KEEP_CONTENT,Pe=e.IN_PLACE||!1,pe=e.ALLOWED_URI_REGEXP||q,He=e.NAMESPACE||$e,ge=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&Xe(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ge.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&Xe(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ge.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(ge.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),xe&&(Ae=!1),Re&&(Ee=!0),Le&&(de=x({},[...O]),he=[],!0===Le.html&&(x(de,k),x(he,P)),!0===Le.svg&&(x(de,E),x(he,L),x(he,D)),!0===Le.svgFilters&&(x(de,R),x(he,L),x(he,D)),!0===Le.mathMl&&(x(de,I),x(he,j),x(he,D))),e.ADD_TAGS&&(de===fe&&(de=C(de)),x(de,e.ADD_TAGS,Ke)),e.ADD_ATTR&&(he===me&&(he=C(he)),x(he,e.ADD_ATTR,Ke)),e.ADD_URI_SAFE_ATTR&&x(Be,e.ADD_URI_SAFE_ATTR,Ke),e.FORBID_CONTENTS&&(je===De&&(je=C(je)),x(je,e.FORBID_CONTENTS,Ke)),Oe&&(de["#text"]=!0),Ce&&x(de,["html","head","body"]),de.table&&(x(de,["tbody"]),delete ye.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw A('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw A('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');K=e.TRUSTED_TYPES_POLICY,Q=K.createHTML("")}else void 0===K&&(K=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+o+" could not be created."),null}}(z,i)),null!==K&&"string"==typeof Q&&(Q=K.createHTML(""));s&&s(e),Qe=e}},tt=x({},["mi","mo","mn","ms","mtext"]),nt=x({},["foreignobject","desc","title","annotation-xml"]),rt=x({},["title","style","font","a","script"]),ot=x({},E);x(ot,R),x(ot,T);const st=x({},I);x(st,N);const it=function(e){d(r.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){e.remove()}},at=function(e,t){try{d(r.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){d(r.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!he[e])if(Ee||Re)try{it(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},lt=function(e){let t,n;if(ke)e=""+e;else{const t=m(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===Ve&&He===$e&&(e=''+e+"");const r=K?K.createHTML(e):e;if(He===$e)try{t=(new F).parseFromString(r,Ve)}catch(e){}if(!t||!t.documentElement){t=J.createDocument(He,"template",null);try{t.documentElement.innerHTML=We?Q:r}catch(e){}}const o=t.body||t.documentElement;return e&&n&&o.insertBefore(a.createTextNode(n),o.childNodes[0]||null),He===$e?te.call(t,Ce?"html":"body")[0]:Ce?t.documentElement:o},ct=function(e){return X.call(e.ownerDocument||e,e,U.SHOW_ELEMENT|U.SHOW_COMMENT|U.SHOW_TEXT,null,!1)},ut=function(e){return"object"==typeof _?e instanceof _:e&&"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},pt=function(e,t,n){re[e]&&u(re[e],(e=>{e.call(r,t,n,Qe)}))},dt=function(e){let t;if(pt("beforeSanitizeElements",e,null),(n=e)instanceof B&&("string"!=typeof n.nodeName||"string"!=typeof n.textContent||"function"!=typeof n.removeChild||!(n.attributes instanceof M)||"function"!=typeof n.removeAttribute||"function"!=typeof n.setAttribute||"string"!=typeof n.namespaceURI||"function"!=typeof n.insertBefore||"function"!=typeof n.hasChildNodes))return it(e),!0;var n;const o=Ke(e.nodeName);if(pt("uponSanitizeElement",e,{tagName:o,allowedTags:de}),e.hasChildNodes()&&!ut(e.firstElementChild)&&(!ut(e.content)||!ut(e.content.firstElementChild))&&b(/<[/\w]/g,e.innerHTML)&&b(/<[/\w]/g,e.textContent))return it(e),!0;if(!de[o]||ye[o]){if(!ye[o]&&ht(o)){if(ge.tagNameCheck instanceof RegExp&&b(ge.tagNameCheck,o))return!1;if(ge.tagNameCheck instanceof Function&&ge.tagNameCheck(o))return!1}if(Oe&&!je[o]){const t=Z(e)||e.parentNode,n=V(e)||e.childNodes;if(n&&t)for(let r=n.length-1;r>=0;--r)t.insertBefore(H(n[r],!0),Y(e))}return it(e),!0}return e instanceof w&&!function(e){let t=Z(e);t&&t.tagName||(t={namespaceURI:He,tagName:"template"});const n=f(e.tagName),r=f(t.tagName);return!!Ge[e.namespaceURI]&&(e.namespaceURI===qe?t.namespaceURI===$e?"svg"===n:t.namespaceURI===ze?"svg"===n&&("annotation-xml"===r||tt[r]):Boolean(ot[n]):e.namespaceURI===ze?t.namespaceURI===$e?"math"===n:t.namespaceURI===qe?"math"===n&&nt[r]:Boolean(st[n]):e.namespaceURI===$e?!(t.namespaceURI===qe&&!nt[r])&&!(t.namespaceURI===ze&&!tt[r])&&!st[n]&&(rt[n]||!ot[n]):!("application/xhtml+xml"!==Ve||!Ge[e.namespaceURI]))}(e)?(it(e),!0):"noscript"!==o&&"noembed"!==o&&"noframes"!==o||!b(/<\/no(script|embed|frames)/i,e.innerHTML)?(xe&&3===e.nodeType&&(t=e.textContent,t=g(t,oe," "),t=g(t,se," "),t=g(t,ie," "),e.textContent!==t&&(d(r.removed,{element:e.cloneNode()}),e.textContent=t)),pt("afterSanitizeElements",e,null),!1):(it(e),!0)},ft=function(e,t,n){if(Ie&&("id"===t||"name"===t)&&(n in a||n in Je))return!1;if(Ae&&!ve[t]&&b(ae,t));else if(be&&b(le,t));else if(!he[t]||ve[t]){if(!(ht(e)&&(ge.tagNameCheck instanceof RegExp&&b(ge.tagNameCheck,e)||ge.tagNameCheck instanceof Function&&ge.tagNameCheck(e))&&(ge.attributeNameCheck instanceof RegExp&&b(ge.attributeNameCheck,t)||ge.attributeNameCheck instanceof Function&&ge.attributeNameCheck(t))||"is"===t&&ge.allowCustomizedBuiltInElements&&(ge.tagNameCheck instanceof RegExp&&b(ge.tagNameCheck,n)||ge.tagNameCheck instanceof Function&&ge.tagNameCheck(n))))return!1}else if(Be[t]);else if(b(pe,g(n,ue,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==y(n,"data:")||!Ue[e])if(_e&&!b(ce,g(n,ue,"")));else if(n)return!1;return!0},ht=function(e){return e.indexOf("-")>0},mt=function(e){let t,n,o,s;pt("beforeSanitizeAttributes",e,null);const{attributes:i}=e;if(!i)return;const a={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:he};for(s=i.length;s--;){t=i[s];const{name:l,namespaceURI:c}=t;if(n="value"===l?t.value:v(t.value),o=Ke(l),a.attrName=o,a.attrValue=n,a.keepAttr=!0,a.forceKeepAttr=void 0,pt("uponSanitizeAttribute",e,a),n=a.attrValue,a.forceKeepAttr)continue;if(at(l,e),!a.keepAttr)continue;if(!we&&b(/\/>/i,n)){at(l,e);continue}xe&&(n=g(n,oe," "),n=g(n,se," "),n=g(n,ie," "));const u=Ke(e.nodeName);if(ft(u,o,n)){if(!Ne||"id"!==o&&"name"!==o||(at(l,e),n="user-content-"+n),K&&"object"==typeof z&&"function"==typeof z.getAttributeType)if(c);else switch(z.getAttributeType(u,o)){case"TrustedHTML":n=K.createHTML(n);break;case"TrustedScriptURL":n=K.createScriptURL(n)}try{c?e.setAttributeNS(c,l,n):e.setAttribute(l,n),p(r.removed)}catch(e){}}}pt("afterSanitizeAttributes",e,null)},gt=function e(t){let n;const r=ct(t);for(pt("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)pt("uponSanitizeShadowNode",n,null),dt(n)||(n.content instanceof l&&e(n.content),mt(n));pt("afterSanitizeShadowDOM",t,null)};return r.sanitize=function(e){let t,n,s,i,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(We=!e,We&&(e="\x3c!--\x3e"),"string"!=typeof e&&!ut(e)){if("function"!=typeof e.toString)throw A("toString is not a function");if("string"!=typeof(e=e.toString()))throw A("dirty is not a string, aborting")}if(!r.isSupported)return e;if(Se||et(a),r.removed=[],"string"==typeof e&&(Pe=!1),Pe){if(e.nodeName){const t=Ke(e.nodeName);if(!de[t]||ye[t])throw A("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof _)t=lt("\x3c!----\x3e"),n=t.ownerDocument.importNode(e,!0),1===n.nodeType&&"BODY"===n.nodeName||"HTML"===n.nodeName?t=n:t.appendChild(n);else{if(!Ee&&!xe&&!Ce&&-1===e.indexOf("<"))return K&&Te?K.createHTML(e):e;if(t=lt(e),!t)return Ee?null:Te?Q:""}t&&ke&&it(t.firstChild);const c=ct(Pe?e:t);for(;s=c.nextNode();)dt(s)||(s.content instanceof l&>(s.content),mt(s));if(Pe)return e;if(Ee){if(Re)for(i=ee.call(t.ownerDocument);t.firstChild;)i.appendChild(t.firstChild);else i=t;return(he.shadowroot||he.shadowrootmode)&&(i=ne.call(o,i,!0)),i}let u=Ce?t.outerHTML:t.innerHTML;return Ce&&de["!doctype"]&&t.ownerDocument&&t.ownerDocument.doctype&&t.ownerDocument.doctype.name&&b(W,t.ownerDocument.doctype.name)&&(u="\n"+u),xe&&(u=g(u,oe," "),u=g(u,se," "),u=g(u,ie," ")),K&&Te?K.createHTML(u):u},r.setConfig=function(e){et(e),Se=!0},r.clearConfig=function(){Qe=null,Se=!1},r.isValidAttribute=function(e,t,n){Qe||et({});const r=Ke(e),o=Ke(t);return ft(r,o,n)},r.addHook=function(e,t){"function"==typeof t&&(re[e]=re[e]||[],d(re[e],t))},r.removeHook=function(e){if(re[e])return p(re[e])},r.removeHooks=function(e){re[e]&&(re[e]=[])},r.removeAllHooks=function(){re={}},r}()}()},286:function(e,t){var n,r;n=function e(){"use strict";var t="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==t?t:{},n=!t.document&&!!t.postMessage,r=t.IS_PAPA_WORKER||!1,o={},s=0,i={parse:function(n,r){var a=(r=r||{}).dynamicTyping||!1;if(_(a)&&(r.dynamicTypingFunction=a,a={}),r.dynamicTyping=a,r.transform=!!_(r.transform)&&r.transform,r.worker&&i.WORKERS_SUPPORTED){var l=function(){if(!i.WORKERS_SUPPORTED)return!1;var n,r,a=(n=t.URL||t.webkitURL||null,r=e.toString(),i.BLOB_URL||(i.BLOB_URL=n.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",r,")();"],{type:"text/javascript"})))),l=new t.Worker(a);return l.onmessage=g,l.id=s++,o[l.id]=l}();return l.userStep=r.step,l.userChunk=r.chunk,l.userComplete=r.complete,l.userError=r.error,r.step=_(r.step),r.chunk=_(r.chunk),r.complete=_(r.complete),r.error=_(r.error),delete r.worker,void l.postMessage({input:n,config:r,workerId:l.id})}var f=null;return i.NODE_STREAM_INPUT,"string"==typeof n?(n=function(e){return 65279===e.charCodeAt(0)?e.slice(1):e}(n),f=r.download?new c(r):new p(r)):!0===n.readable&&_(n.read)&&_(n.on)?f=new d(r):(t.File&&n instanceof File||n instanceof Object)&&(f=new u(r)),f.stream(n)},unparse:function(e,t){var n=!1,r=!0,o=",",s="\r\n",a='"',l=a+a,c=!1,u=null,p=!1;!function(){if("object"==typeof t){if("string"!=typeof t.delimiter||i.BAD_DELIMITERS.filter((function(e){return-1!==t.delimiter.indexOf(e)})).length||(o=t.delimiter),("boolean"==typeof t.quotes||"function"==typeof t.quotes||Array.isArray(t.quotes))&&(n=t.quotes),"boolean"!=typeof t.skipEmptyLines&&"string"!=typeof t.skipEmptyLines||(c=t.skipEmptyLines),"string"==typeof t.newline&&(s=t.newline),"string"==typeof t.quoteChar&&(a=t.quoteChar),"boolean"==typeof t.header&&(r=t.header),Array.isArray(t.columns)){if(0===t.columns.length)throw new Error("Option columns is empty");u=t.columns}void 0!==t.escapeChar&&(l=t.escapeChar+a),("boolean"==typeof t.escapeFormulae||t.escapeFormulae instanceof RegExp)&&(p=t.escapeFormulae instanceof RegExp?t.escapeFormulae:/^[=+\-@\t\r].*$/)}}();var d=new RegExp(h(a),"g");if("string"==typeof e&&(e=JSON.parse(e)),Array.isArray(e)){if(!e.length||Array.isArray(e[0]))return f(null,e,c);if("object"==typeof e[0])return f(u||Object.keys(e[0]),e,c)}else if("object"==typeof e)return"string"==typeof e.data&&(e.data=JSON.parse(e.data)),Array.isArray(e.data)&&(e.fields||(e.fields=e.meta&&e.meta.fields||u),e.fields||(e.fields=Array.isArray(e.data[0])?e.fields:"object"==typeof e.data[0]?Object.keys(e.data[0]):[]),Array.isArray(e.data[0])||"object"==typeof e.data[0]||(e.data=[e.data])),f(e.fields||[],e.data||[],c);throw new Error("Unable to serialize unrecognized input");function f(e,t,n){var i="";"string"==typeof e&&(e=JSON.parse(e)),"string"==typeof t&&(t=JSON.parse(t));var a=Array.isArray(e)&&0=this._config.preview;if(r)t.postMessage({results:a,workerId:i.WORKER_ID,finished:c});else if(_(this._config.chunk)&&!n){if(this._config.chunk(a,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);a=void 0,this._completeResults=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(a.data),this._completeResults.errors=this._completeResults.errors.concat(a.errors),this._completeResults.meta=a.meta),this._completed||!c||!_(this._config.complete)||a&&a.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),c||a&&a.meta.paused||this._nextChunk(),a}this._halted=!0},this._sendError=function(e){_(this._config.error)?this._config.error(e):r&&this._config.error&&t.postMessage({workerId:i.WORKER_ID,error:e,finished:!1})}}function c(e){var t;(e=e||{}).chunkSize||(e.chunkSize=i.RemoteChunkSize),l.call(this,e),this._nextChunk=n?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(e){this._input=e,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(t=new XMLHttpRequest,this._config.withCredentials&&(t.withCredentials=this._config.withCredentials),n||(t.onload=A(this._chunkLoaded,this),t.onerror=A(this._chunkError,this)),t.open(this._config.downloadRequestBody?"POST":"GET",this._input,!n),this._config.downloadRequestHeaders){var e=this._config.downloadRequestHeaders;for(var r in e)t.setRequestHeader(r,e[r])}if(this._config.chunkSize){var o=this._start+this._config.chunkSize-1;t.setRequestHeader("Range","bytes="+this._start+"-"+o)}try{t.send(this._config.downloadRequestBody)}catch(e){this._chunkError(e.message)}n&&0===t.status&&this._chunkError()}},this._chunkLoaded=function(){4===t.readyState&&(t.status<200||400<=t.status?this._chunkError():(this._start+=this._config.chunkSize?this._config.chunkSize:t.responseText.length,this._finished=!this._config.chunkSize||this._start>=function(e){var t=e.getResponseHeader("Content-Range");return null===t?-1:parseInt(t.substring(t.lastIndexOf("/")+1))}(t),this.parseChunk(t.responseText)))},this._chunkError=function(e){var n=t.statusText||e;this._sendError(new Error(n))}}function u(e){var t,n;(e=e||{}).chunkSize||(e.chunkSize=i.LocalChunkSize),l.call(this,e);var r="undefined"!=typeof FileReader;this.stream=function(e){this._input=e,n=e.slice||e.webkitSlice||e.mozSlice,r?((t=new FileReader).onload=A(this._chunkLoaded,this),t.onerror=A(this._chunkError,this)):t=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount=this._input.size,this.parseChunk(e.target.result)},this._chunkError=function(){this._sendError(t.error)}}function p(e){var t;l.call(this,e=e||{}),this.stream=function(e){return t=e,this._nextChunk()},this._nextChunk=function(){if(!this._finished){var e,n=this._config.chunkSize;return n?(e=t.substring(0,n),t=t.substring(n)):(e=t,t=""),this._finished=!t,this.parseChunk(e)}}}function d(e){l.call(this,e=e||{});var t=[],n=!0,r=!1;this.pause=function(){l.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){l.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(e){this._input=e,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){r&&1===t.length&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),t.length?this.parseChunk(t.shift()):n=!0},this._streamData=A((function(e){try{t.push("string"==typeof e?e:e.toString(this._config.encoding)),n&&(n=!1,this._checkIsFinished(),this.parseChunk(t.shift()))}catch(e){this._streamError(e)}}),this),this._streamError=A((function(e){this._streamCleanUp(),this._sendError(e)}),this),this._streamEnd=A((function(){this._streamCleanUp(),r=!0,this._streamData("")}),this),this._streamCleanUp=A((function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)}),this)}function f(e){var t,n,r,o=Math.pow(2,53),s=-o,a=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,l=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,c=this,u=0,p=0,d=!1,f=!1,g=[],y={data:[],errors:[],meta:{}};if(_(e.step)){var v=e.step;e.step=function(t){if(y=t,x())w();else{if(w(),0===y.data.length)return;u+=t.data.length,e.preview&&u>e.preview?n.abort():(y.data=y.data[0],v(y,c))}}}function A(t){return"greedy"===e.skipEmptyLines?""===t.join("").trim():1===t.length&&0===t[0].length}function w(){return y&&r&&(S("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+i.DefaultDelimiter+"'"),r=!1),e.skipEmptyLines&&(y.data=y.data.filter((function(e){return!A(e)}))),x()&&function(){if(y)if(Array.isArray(y.data[0])){for(var t=0;x()&&t=g.length?"__parsed_extra":g[r]),e.transform&&(i=e.transform(i,s)),i=C(s,i),"__parsed_extra"===s?(o[s]=o[s]||[],o[s].push(i)):o[s]=i}return e.header&&(r>g.length?S("FieldMismatch","TooManyFields","Too many fields: expected "+g.length+" fields but parsed "+r,p+n):r=r.length/2?"\r\n":"\r"}(o,l)),r=!1,e.delimiter)_(e.delimiter)&&(e.delimiter=e.delimiter(o),y.meta.delimiter=e.delimiter);else{var c=function(t,n,r,o,s){var a,l,c,u;s=s||[",","\t","|",";",i.RECORD_SEP,i.UNIT_SEP];for(var p=0;p=a)return G(!0)}else for(B=u,u++;;){if(-1===(B=i.indexOf(t,B+1)))return f||w.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:A.length,index:u}),H();if(B===m-1)return H(i.substring(u,B).replace(M,t));if(t!==c||i[B+1]!==c){if(t===c||0===B||i[B-1]!==c){-1!==D&&D=a)return G(!0);break}w.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:A.length,index:u}),B++}}else B++}return H();function q(e){A.push(e),C=u}function $(e){var t=0;if(-1!==e){var n=i.substring(B+1,e);n&&""===n.trim()&&(t=n.length)}return t}function H(e){return f||(void 0===e&&(e=i.substring(u)),x.push(e),u=m,q(x),b&&Y()),G()}function W(e){u=e,q(x),x=[],U=i.indexOf(r,u)}function G(e){return{data:A,errors:w,meta:{delimiter:n,linebreak:r,aborted:p,truncated:!!e,cursor:C+(d||0)}}}function Y(){s(G()),A=[],w=[]}},this.abort=function(){p=!0},this.getCharIndex=function(){return u}}function g(e){var t=e.data,n=o[t.workerId],r=!1;if(t.error)n.userError(t.error,t.file);else if(t.results&&t.results.data){var s={abort:function(){r=!0,y(t.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:v,resume:v};if(_(n.userStep)){for(var i=0;i{"use strict";var r=n(586);function o(){}function s(){}s.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,s,i){if(i!==r){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:s,resetWarningCache:o};return n.PropTypes=n,n}},980:(e,t,n)=>{e.exports=n(262)()},586:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},837:(e,t,n)=>{"use strict";var r=n(196),o=Symbol.for("react.element"),s=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,a=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,n){var r,s={},c=null,u=null;for(r in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)i.call(t,r)&&!l.hasOwnProperty(r)&&(s[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===s[r]&&(s[r]=t[r]);return{$$typeof:o,type:e,key:c,ref:u,props:s,_owner:a.current}}t.Fragment=s,t.jsx=c,t.jsxs=c},322:(e,t,n)=>{"use strict";e.exports=n(837)},665:e=>{e.exports=function(e,t,n,r){var o=n?n.call(r,e,t):void 0;if(void 0!==o)return!!o;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var s=Object.keys(e),i=Object.keys(t);if(s.length!==i.length)return!1;for(var a=Object.prototype.hasOwnProperty.bind(t),l=0;l{"use strict";var t=[];function n(e){for(var n=-1,r=0;r{"use strict";var t={};e.exports=function(e,n){var r=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(n)}},173:e=>{"use strict";e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},892:(e,t,n)=>{"use strict";e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},36:e=>{"use strict";e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var r="";n.supports&&(r+="@supports (".concat(n.supports,") {")),n.media&&(r+="@media ".concat(n.media," {"));var o=void 0!==n.layer;o&&(r+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),r+=n.css,o&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}");var s=n.sourceMap;s&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(s))))," */")),t.styleTagTransform(r,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},464:e=>{"use strict";e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},196:e=>{"use strict";e.exports=window.React}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var s=t[r]={id:r,exports:{}};return e[r].call(s.exports,s,s.exports,n),s.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nc=void 0;var r={};return(()=>{"use strict";n.r(r),n.d(r,{AudioPicker:()=>$t,CSVUploader:()=>Jt,Checkboxes:()=>Gt,ImagePicker:()=>nn,MediaPicker:()=>cn,PostPicker:()=>sr,PostSelector:()=>ar,SafeHtml:()=>fn,Selector:()=>br,TermSelector:()=>_r,VideoPicker:()=>Sr,getMediaUrl:()=>Qt,parseCSVFile:()=>Kt,useDebounce:()=>gn,useHasInnerBlocks:()=>yn,useInnerBlocks:()=>bn,useInnerBlocksAttributes:()=>_n,useInnerBlocksCount:()=>An,useInnerBlocksIndex:()=>vn,useMedia:()=>wn,useParentBlock:()=>xn,useParentBlockAttributes:()=>Cn,usePost:()=>Sn,usePostById:()=>Rn,usePostMeta:()=>Nn,usePostMetaValue:()=>On,usePosts:()=>Pn,useTerms:()=>Ln});var e=n(322),t=n(980),o=n.n(t),s=function(){return s=Object.assign||function(e){for(var t,n=1,r=arguments.length;n2||G(U)>3?"":" "}function Z(e,t){for(;--t&&q()&&!(U<48||U>102||U>57&&U<65||U>70&&U<97););return W(e,H()+(t<6&&32==$()&&32==q()))}function K(e){for(;q();)switch(U){case e:return D;case 34:case 39:34!==e&&39!==e&&K(U);break;case 40:41===e&&K(e);break;case 92:q()}return D}function Q(e,t){for(;q()&&e+U!==57&&(e+U!==84||47!==$()););return"/*"+W(t,D-1)+"*"+_(47===e?e:q())}function J(e){for(;!G($());)q();return W(e,D)}function X(e,t){for(var n="",r=0;r6)switch(E(e,t+1)){case 109:if(45!==E(e,t+4))break;case 102:return S(e,/(.+:)(.+)-([^]+)/,"$1"+f+"$2-$3$1"+d+(108==E(e,t+3)?"$3":"$2-$3"))+e;case 115:return~k(e,"stretch")?te(S(e,"stretch","fill-available"),t,n)+e:e}break;case 5152:case 5920:return S(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,(function(t,n,r,o,s,i,a){return p+n+":"+r+a+(o?p+n+"-span:"+(s?i:+i-+r)+a:"")+e}));case 4949:if(121===E(e,t+6))return S(e,":",":"+f)+e;break;case 6444:switch(E(e,45===E(e,14)?18:11)){case 120:return S(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+f+(45===E(e,14)?"inline-":"")+"box$3$1"+f+"$2$3$1"+p+"$2box$3")+e;case 100:return S(e,":",":"+p)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return S(e,"scroll-","scroll-snap-")+e}return e}function ne(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case g:return void(e.return=te(e.value,e.length,n));case v:return X([F(e,{value:S(e.value,"@","@"+f)})],r);case m:if(e.length)return function(e,t){return e.map(t).join("")}(n=e.props,(function(t){switch(C(t,r=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":z(F(e,{props:[S(t,/:(read-\w+)/,":"+d+"$1")]})),z(F(e,{props:[t]})),w(e,{props:O(n,r)});break;case"::placeholder":z(F(e,{props:[S(t,/:(plac\w+)/,":"+f+"input-$1")]})),z(F(e,{props:[S(t,/:(plac\w+)/,":"+d+"$1")]})),z(F(e,{props:[S(t,/:(plac\w+)/,p+"input-$1")]})),z(F(e,{props:[t]})),w(e,{props:O(n,r)})}return""}))}}function re(e){return function(e){return M="",e}(oe("",null,null,null,[""],e=function(e){return P=L=1,j=T(M=e),D=0,[]}(e),0,[0],e))}function oe(e,t,n,r,o,s,i,a,l){for(var c=0,u=0,p=i,d=0,f=0,h=0,m=1,g=1,y=1,v=0,b="",A=o,w=s,x=r,C=b;g;)switch(h=v,v=q()){case 40:if(108!=h&&58==E(C,p-1)){-1!=k(C+=S(Y(v),"&","&\f"),"&\f")&&(y=-1);break}case 34:case 39:case 91:C+=Y(v);break;case 9:case 10:case 13:case 32:C+=V(h);break;case 92:C+=Z(H()-1,7);continue;case 47:switch($()){case 42:case 47:N(ie(Q(q(),H()),t,n,l),l);break;default:C+="/"}break;case 123*m:a[c++]=T(C)*y;case 125*m:case 59:case 0:switch(v){case 0:case 125:g=0;case 59+u:-1==y&&(C=S(C,/\f/g,"")),f>0&&T(C)-p&&N(f>32?ae(C+";",r,n,p-1,l):ae(S(C," ","")+";",r,n,p-2,l),l);break;case 59:C+=";";default:if(N(x=se(C,t,n,c,u,o,a,b,A=[],w=[],p,s),s),123===v)if(0===u)oe(C,t,x,x,A,s,p,a,w);else switch(99===d&&110===E(C,3)?100:d){case 100:case 108:case 109:case 115:oe(e,x,x,r&&N(se(e,x,x,0,0,o,a,b,o,A=[],p,w),w),o,w,p,a,r?A:w);break;default:oe(C,x,x,x,[""],w,0,a,w)}}c=u=f=0,m=y=1,b=C="",p=i;break;case 58:p=1+T(C),f=h;default:if(m<1)if(123==v)--m;else if(125==v&&0==m++&&125==(U=D>0?E(M,--D):0,L--,10===U&&(L=1,P--),U))continue;switch(C+=_(v),v*m){case 38:y=u>0?1:(C+="\f",-1);break;case 44:a[c++]=(T(C)-1)*y,y=1;break;case 64:45===$()&&(C+=Y(q())),d=$(),u=p=T(b=C+=J(H())),v++;break;case 45:45===h&&2==T(C)&&(m=0)}}return s}function se(e,t,n,r,o,s,i,a,l,c,u,p){for(var d=o-1,f=0===o?s:[""],h=I(f),g=0,y=0,v=0;g0?f[b]+" "+_:S(_,/&\f/g,f[b])))&&(l[v++]=w);return B(e,t,n,0===o?m:a,l,c,u,p)}function ie(e,t,n,r){return B(e,t,n,h,_(U),R(e,2,-2),0,r)}function ae(e,t,n,r,o){return B(e,t,n,g,R(e,0,r),R(e,r+1,-1),r,o)}const le={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};var ce="undefined"!=typeof process&&void 0!==process.env&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",ue="undefined"!=typeof window&&"HTMLElement"in window,pe=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env&&void 0!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&""!==process.env.REACT_APP_SC_DISABLE_SPEEDY?"false"!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&process.env.REACT_APP_SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env&&void 0!==process.env.SC_DISABLE_SPEEDY&&""!==process.env.SC_DISABLE_SPEEDY&&"false"!==process.env.SC_DISABLE_SPEEDY&&process.env.SC_DISABLE_SPEEDY),de=(new Set,Object.freeze([])),fe=Object.freeze({}),he=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),me=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,ge=/(^-|-$)/g;function ye(e){return e.replace(me,"-").replace(ge,"")}var ve=/(a)(d)/gi,be=function(e){return String.fromCharCode(e+(e>25?39:97))};function Ae(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=be(t%52)+n;return(be(t%52)+n).replace(ve,"$1-$2")}var _e,we=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},xe=function(e){return we(5381,e)};function Ce(e){return"string"==typeof e&&!0}var Se="function"==typeof Symbol&&Symbol.for,ke=Se?Symbol.for("react.memo"):60115,Ee=Se?Symbol.for("react.forward_ref"):60112,Re={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},Te={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Ie={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Ne=((_e={})[Ee]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},_e[ke]=Ie,_e);function Oe(e){return("type"in(t=e)&&t.type.$$typeof)===ke?Ie:"$$typeof"in e?Ne[e.$$typeof]:Re;var t}var Pe=Object.defineProperty,Le=Object.getOwnPropertyNames,je=Object.getOwnPropertySymbols,De=Object.getOwnPropertyDescriptor,Ue=Object.getPrototypeOf,Me=Object.prototype;function Be(e,t,n){if("string"!=typeof t){if(Me){var r=Ue(t);r&&r!==Me&&Be(e,r,n)}var o=Le(t);je&&(o=o.concat(je(t)));for(var s=Oe(e),i=Oe(t),a=0;a0?" Args: ".concat(t.join(", ")):""))}var Ve=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}return e.prototype.indexOfGroup=function(e){for(var t=0,n=0;n=this.groupSizes.length){for(var n=this.groupSizes,r=n.length,o=r;e>=o;)if((o<<=1)<0)throw Ye(16,"".concat(e));this.groupSizes=new Uint32Array(o),this.groupSizes.set(n),this.length=o;for(var s=r;s=this.length||0===this.groupSizes[e])return t;for(var n=this.groupSizes[e],r=this.indexOfGroup(e),o=r+n,s=r;s=0){var n=document.createTextNode(t);return this.element.insertBefore(n,this.nodes[e]||null),this.length++,!0}return!1},e.prototype.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},e.prototype.getRule=function(e){return e0&&(l+="".concat(e,","))})),r+="".concat(i).concat(a,'{content:"').concat(l,'"}').concat("/*!sc*/\n")},s=0;s0?".".concat(t):e},u=l.slice();u.push((function(e){e.type===m&&e.value.includes("&")&&(e.props[0]=e.props[0].replace(dt,n).replace(r,c))})),i.prefix&&u.push(ne),u.push(ee);var p=function(e,o,s,a){void 0===o&&(o=""),void 0===s&&(s=""),void 0===a&&(a="&"),t=a,n=o,r=new RegExp("\\".concat(n,"\\b"),"g");var l=e.replace(ft,""),c=re(s||o?"".concat(s," ").concat(o," { ").concat(l," }"):l);i.namespace&&(c=ht(c,i.namespace));var p,d,f,h=[];return X(c,(p=u.concat((f=function(e){return h.push(e)},function(e){e.root||(e=e.return)&&f(e)})),d=I(p),function(e,t,n,r){for(var o="",s=0;s="A"&&e<="Z"};function Ct(e){for(var t="",n=0;n>>0);if(!t.hasNameForId(this.componentId,s)){var i=n(o,".".concat(s),void 0,this.componentId);t.insertRules(this.componentId,s,i)}r=qe(r,s),this.staticRulesId=s}else{for(var a=we(this.baseHash,n.hash),l="",c=0;c>>0);t.hasNameForId(this.componentId,d)||t.insertRules(this.componentId,d,n(l,".".concat(d),void 0,this.componentId)),r=qe(r,d)}}return r},e}(),Nt=l().createContext(void 0);Nt.Consumer;var Ot={};function Pt(e,t,n){var r=ze(e),o=e,i=!Ce(e),c=t.attrs,u=void 0===c?de:c,p=t.componentId,d=void 0===p?function(e,t){var n="string"!=typeof e?"sc":ye(e);Ot[n]=(Ot[n]||0)+1;var r="".concat(n,"-").concat(function(e){return Ae(xe(e)>>>0)}("6.0.5"+n+Ot[n]));return t?"".concat(t,"-").concat(r):r}(t.displayName,t.parentComponentId):p,f=(void 0===t.displayName&&function(e){Ce(e)?"styled.".concat(e):"Styled(".concat(function(e){return e.displayName||e.name||"Component"}(e),")")}(e),t.displayName&&t.componentId?"".concat(ye(t.displayName),"-").concat(t.componentId):t.componentId||d),h=r&&o.attrs?o.attrs.concat(u).filter(Boolean):u,m=t.shouldForwardProp;if(r&&o.shouldForwardProp){var g=o.shouldForwardProp;if(t.shouldForwardProp){var y=t.shouldForwardProp;m=function(e,t){return g(e,t)&&y(e,t)}}else m=g}var v=new It(n,f,r?o.componentStyle:void 0),b=l().forwardRef((function(e,t){return function(e,t,n){var r=e.attrs,o=e.componentStyle,i=e.defaultProps,c=e.foldedComponentIds,u=e.styledComponentId,p=e.target,d=l().useContext(Nt),f=At(),h=e.shouldForwardProp||f.shouldForwardProp,m=function(e,t,n){for(var r,o=s(s({},t),{className:void 0,theme:n}),i=0;i2&&pt.registerId(this.componentId+e),this.removeStyles(e,n),this.createStyles(e,t,n,r)}}(),function(){function e(){var e=this;this._emitSheetCSS=function(){var t=e.instance.toString(),n=ot(),r=$e([n&&'nonce="'.concat(n,'"'),"".concat(ce,'="true"'),"".concat("data-styled-version",'="').concat("6.0.5",'"')].filter(Boolean)," ");return"")},this.getStyleTags=function(){if(e.sealed)throw Ye(2);return e._emitSheetCSS()},this.getStyleElement=function(){var t;if(e.sealed)throw Ye(2);var n=((t={})[ce]="",t["data-styled-version"]="6.0.5",t.dangerouslySetInnerHTML={__html:e.instance.toString()},t),r=ot();return r&&(n.nonce=r),[l().createElement("style",s({},n,{key:"sc-0-0"}))]},this.seal=function(){e.sealed=!0},this.instance=new pt({isServer:!0}),this.sealed=!1}e.prototype.collectStyles=function(e){if(this.sealed)throw Ye(2);return l().createElement(_t,{sheet:this.instance},e)},e.prototype.interleaveWithNodeStream=function(e){throw Ye(3)}}(),"__sc-".concat(ce,"__");const Ft=Bt.div` + height: auto; + width: 100%; +`,zt=({src:t})=>(0,e.jsx)(Ft,{children:(0,e.jsx)("audio",{className:"edit-audio-preview",controls:!0,src:t})});zt.propTypes={src:o().string.isRequired};const qt=({className:t,onReset:n,onUpdate:r,onUpdateURL:o,value:s,valueURL:i})=>(0,e.jsx)(cn,{allowedTypes:["audio"],className:t,icon:"format-audio",onReset:n,onUpdate:r,onUpdateURL:o,preview:zt,value:s,valueURL:i});qt.defaultProps={className:"",onUpdateURL:null,valueURL:""},qt.propTypes={className:o().string,onReset:o().func.isRequired,onUpdate:o().func.isRequired,onUpdateURL:o().func,value:o().number.isRequired,valueURL:o().string};const $t=qt,Ht=window.wp.components,Wt=({label:t,value:n,options:r,onChange:o})=>(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Ht.BaseControl,{label:t}),r.map((t=>(0,e.jsx)(Ht.CheckboxControl,{label:t.label,checked:n.includes(t.value),onChange:e=>{o(e?[...n,t.value]:[...n.filter((e=>e!==t.value))])}})))]});Wt.propTypes={label:o().string.isRequired,value:o().arrayOf(o().string).isRequired,options:o().arrayOf(o().shape({label:o().string.isRequired,value:o().string.isRequired})).isRequired,onChange:o().func.isRequired};const Gt=Wt,Yt=window.wp.i18n;var Vt=n(286),Zt=n.n(Vt);const Kt=e=>new Promise(((t,n)=>{Zt().parse(e,{complete:e=>t(e.data),dynamicTyping:!0,error:e=>n(e),header:!0,skipEmptyLines:!0})})),Qt=(e,t="full")=>{const{media_details:{sizes:{[t]:{source_url:n=""}={},full:{source_url:r=""}={}}={}}={},sizes:{[t]:{url:o=""}={},full:{url:s=""}={}}={},source_url:i="",url:a=""}=e;return o||n||s||r||a||i||""};class Jt extends l().PureComponent{static handleSubmit(e){e.preventDefault()}constructor(e){super(e),this.handleChange=this.handleChange.bind(this),this.state={error:"",success:""}}handleChange(e){const{attributeName:t,callback:n,setAttributes:r}=this.props;e.target.files&&e.target.files[0]&&Kt(e.target.files[0]).then((e=>n?n(e):e)).then((e=>{Array.isArray(e)&&e.length>0?(this.setState({error:"",success:(0,Yt.__)("Successfully read CSV data.","alley-scripts")}),r({[t]:JSON.stringify(e)})):this.setState({error:(0,Yt.__)("Could not map CSV data. Please check the source file to ensure that it has the correct structure.","alley-scripts"),success:""})})).catch((e=>{this.setState({error:e,success:""})}))}render(){const{error:t="",success:n=""}=this.state;return(0,e.jsxs)("div",{className:"alley-scripts-block-csv-uploader",children:[(0,e.jsx)("h2",{children:(0,Yt.__)("Upload CSV","alley-scripts")}),(0,e.jsxs)("form",{onSubmit:this.handleSubmit,children:[""!==t?(0,e.jsxs)("div",{style:{color:"#c00"},children:[(0,e.jsx)("strong",{children:(0,Yt.__)("Error:","alley-scripts")})," ",t]}):null,""!==n?(0,e.jsxs)("div",{style:{color:"#0c0"},children:[(0,e.jsx)("strong",{children:(0,Yt.__)("Success:","alley-scripts")})," ",n]}):null,(0,e.jsx)("div",{children:(0,e.jsxs)("label",{htmlFor:"alley-scripts-block-csv-uploader-file",children:[(0,e.jsx)("p",{children:(0,Yt.__)("Select a file to load data.","alley-scripts")}),(0,e.jsx)("input",{id:"alley-scripts-block-csv-uploader-file",onChange:this.handleChange,type:"file"})]})})]})]})}}Jt.defaultProps={callback:null},Jt.propTypes={attributeName:o().string.isRequired,callback:o().func,setAttributes:o().func.isRequired};const Xt=Bt.div` + box-sizing: border-box; + flex-shrink: 0; + height: auto; + max-height: 1450px; + max-width: 1450px; + min-height: 20px; + min-width: 20px; + position: relative; + width: auto; +`,en=({src:t})=>(0,e.jsx)(Xt,{children:(0,e.jsx)("img",{alt:(0,Yt.__)("Edit image","alley-scripts"),className:"edit-image-preview",src:t,title:(0,Yt.__)("Edit image","alley-scripts")})});en.propTypes={src:o().string.isRequired};const tn=({className:t,imageSize:n,displayControlsInToolbar:r,onReset:o,onUpdate:s,onUpdateURL:i,value:a,valueURL:l})=>(0,e.jsx)(cn,{allowedTypes:["image"],className:t,icon:"format-image",imageSize:n,displayControlsInToolbar:r,onReset:o,onUpdate:s,onUpdateURL:i,preview:en,value:a,valueURL:l});tn.defaultProps={className:"",imageSize:"thumbnail",displayControlsInToolbar:!1,onUpdateURL:null,valueURL:""},tn.propTypes={className:o().string,imageSize:o().string,displayControlsInToolbar:o().bool,onReset:o().func.isRequired,onUpdate:o().func.isRequired,onUpdateURL:o().func,value:o().number.isRequired,valueURL:o().string};const nn=tn,rn=window.wp.blockEditor,on=window.wp.data,sn=Bt.div` + display: block; + position: relative; +`,an=Bt.div` + background: white; + border: 1px solid black; + padding: 1em; +`,ln=({allowedTypes:t,className:n,icon:r,imageSize:o,displayControlsInToolbar:s,onReset:i,onUpdate:a,onUpdateURL:l,preview:c,value:u,valueURL:p})=>{const{media:d}=(0,on.useSelect)((e=>({media:u?e("core").getMedia(u):void 0})),[u]);if(0!==u&&null===d)return(0,e.jsx)(Ht.Spinner,{});const f=d?Qt(d,o):p;return f?(0,e.jsxs)(sn,{className:n,children:[c?(0,e.jsx)(c,{src:f}):(0,e.jsxs)(an,{className:"alley-scripts-media-picker__preview",children:[(0,e.jsx)("p",{children:(0,Yt.__)("Selected file:","alley-scripts")}),(0,e.jsx)("p",{children:(0,e.jsx)("a",{href:f,children:f})})]}),s?(0,e.jsx)(rn.BlockControls,{group:"other",children:(0,e.jsx)(rn.MediaReplaceFlow,{name:(0,Yt.__)("Edit Media","alley-scripts"),mediaId:u,mediaURL:f,allowedTypes:t,onSelect:a,onSelectURL:l,children:(0,e.jsx)(Ht.ToolbarButton,{isDestructive:!0,text:(0,Yt.__)("Remove","alley-scripts"),onClick:i})})}):(0,e.jsx)(Ht.Button,{variant:"primary",onClick:i,children:(0,Yt.__)("Reset","alley-scripts")})]}):(0,e.jsx)(sn,{className:n,children:(0,e.jsx)(rn.MediaPlaceholder,{allowedTypes:t,disableMediaButtons:!!p,icon:(0,e.jsx)(rn.BlockIcon,{icon:r}),onSelect:a,onSelectURL:l,value:{id:u,src:f}})})};ln.defaultProps={allowedTypes:[],className:"",icon:"format-aside",imageSize:"thumbnail",displayControlsInToolbar:!1,onUpdateURL:null,preview:null,valueURL:""},ln.propTypes={allowedTypes:o().arrayOf(o().string),className:o().string,icon:o().string,imageSize:o().string,displayControlsInToolbar:o().bool,onReset:o().func.isRequired,onUpdate:o().func.isRequired,onUpdateURL:o().func,preview:o().element,value:o().number.isRequired,valueURL:o().string};const cn=ln;var un=n(368),pn=n.n(un);const dn=({className:t,html:n,tag:r})=>(0,e.jsx)(r,{className:t,dangerouslySetInnerHTML:{__html:pn().sanitize(n)}});dn.defaultProps={className:""},dn.propTypes={className:o().string,html:o().string.isRequired,tag:o().string.isRequired};const fn=dn,hn=window.wp.element,mn=window.wp.url,gn=(e,t)=>{const[n,r]=(0,hn.useState)(e);return(0,hn.useEffect)((()=>{const n=setTimeout((()=>{r(e)}),t);return()=>{clearTimeout(n)}}),[e,t]),n},yn=e=>An(e)>0,vn=e=>{const t=xn(e),n=bn(t);return n?n.findIndex((t=>t.clientId===e)):-1},bn=e=>(0,on.useSelect)((t=>t(rn.store).getBlocks(e)),[e]),_n=e=>bn(e).map((e=>e.attributes)),An=e=>bn(e).length,wn=e=>(0,on.useSelect)((t=>t("core").getMedia(e)),[e]),xn=e=>(0,on.useSelect)((t=>{const{getBlock:n,getBlockRootClientId:r}=t(rn.store),o=r(e);return o?n(o):null}),[e]),Cn=e=>(0,on.useSelect)((t=>{const{getBlockAttributes:n,getBlockRootClientId:r}=t(rn.store),o=r(e);return o?n(o):null}),[e]),Sn=(e,t="post")=>(0,on.useSelect)((n=>n("core").getEntityRecord("postType",t,e)),[e,t]),kn=window.wp.apiFetch;var En=n.n(kn);const Rn=(e,t=null)=>{const[n,r]=(0,hn.useState)({});return(0,hn.useEffect)((()=>{e&&!n[e]&&(async()=>{if(t){const n=await t(e);n?r((t=>({...t,[e]:n}))):console.error(`Custom function to get post with ID ${e} failed.`)}else{const t=(0,mn.addQueryArgs)("/wp/v2/search",{include:e}),n=await En()({path:t});r((t=>({...t,[e]:n[0].subtype})))}})()}),[e]),Sn(e,n[e]??"")},Tn=window.wp.coreData,In=window.lodash,Nn=(e=null,t=null)=>{const n=(0,on.useSelect)((t=>e||t("core/editor").getCurrentPostType()),[]),[r,o]=(0,Tn.useEntityProp)("postType",n,"meta",t),s="function"==typeof o?o:()=>console.error(`Error attempting to set post meta for post type ${n}. Does it have support for custom-fields?`);return["object"==typeof r?r:{},e=>s((0,In.cloneDeep)(e))]},On=(e,t=null,n=null)=>{const[r,o]=Nn(t,n);return[r[e],t=>o({...r,[e]:t})]},Pn=(e,t="post")=>(0,on.useSelect)((n=>{const{getEntityRecords:r}=n("core");return r("postType",t,{include:e})}),[e,t]),Ln=(e=null,t=null,n="categories")=>{const r=(0,on.useSelect)((t=>e||t("core/editor").getCurrentPostType()),[]),[o,s]=(0,Tn.useEntityProp)("postType",r,n,t);return[o,e=>s(e)]};var jn=n(62),Dn=n.n(jn),Un=n(36),Mn=n.n(Un),Bn=n(793),Fn=n.n(Bn),zn=n(892),qn=n.n(zn),$n=n(173),Hn=n.n($n),Wn=n(464),Gn=n.n(Wn),Yn=n(992),Vn={};Vn.styleTagTransform=Gn(),Vn.setAttributes=qn(),Vn.insert=Fn().bind(null,"head"),Vn.domAPI=Mn(),Vn.insertStyleElement=Hn(),Dn()(Yn.Z,Vn),Yn.Z&&Yn.Z.locals&&Yn.Z.locals;var Zn=n(779),Kn=n.n(Zn),Qn=n(905),Jn={};Jn.styleTagTransform=Gn(),Jn.setAttributes=qn(),Jn.insert=Fn().bind(null,"head"),Jn.domAPI=Mn(),Jn.insertStyleElement=Hn(),Dn()(Qn.Z,Jn),Qn.Z&&Qn.Z.locals&&Qn.Z.locals;const Xn=Bt.div` + align-items: center; + gap: 4px; + overflow-wrap: anywhere; + display: flex; + flex-direction: column; + justify-content: center; + padding: 0.5rem 0.75rem; +`,er=({title:t,postType:n,attachmentID:r})=>{const o=wn(r),s=o?.media_details?.sizes?.thumbnail?.source_url,i=o?.alt_text??"";return(0,e.jsxs)(Xn,{children:[s?(0,e.jsx)("img",{style:{maxWidth:"100%",height:"auto"},loading:"lazy",src:s,alt:i}):null,(0,e.jsx)(fn,{html:t,className:"post-picker-result-title",tag:"strong"}),(0,Yt.sprintf)(" (%s)",n)]})},tr=({baseUrl:t,searchRender:n,selected:r,setSelected:o,suppressPostIds:s=[]})=>{const[i,a]=(0,hn.useState)(!1),[l,c]=(0,hn.useState)([]),[u,p]=(0,hn.useState)(!1),[d,f]=(0,hn.useState)(0),[h,m]=(0,hn.useState)({searchValue:"",page:1}),g=(0,hn.useCallback)((async(e,n=!1)=>{if(e.searchValue&&e.searchValue.length<=2)return;const r=function(){let n=(0,mn.addQueryArgs)(t,{page:e.page,_embed:1,exclude:s.join(",")});return e.searchValue&&e.searchValue.length>2&&(n=(0,mn.addQueryArgs)(n,{search:e.searchValue})),n}();a(!0);const o=await En()({path:r,parse:!1});f(parseInt(o.headers.get("X-WP-TotalPages"),10));const i=await o.json();let u=i;e.page>1&&(u=[...l,...i]),n||(c(u),a(!1))}),[l,t,s]);return(0,hn.useEffect)((()=>{let e=!1;return u||(p(!0),g(h,e)),()=>{e=!0}}),[g,u,h]),(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Ht.TextControl,{value:h.searchValue,placeholder:(0,Yt.__)("Search...","alley-scripts"),label:(0,Yt.__)("Search","alley-scripts"),onChange:e=>{const t={...h,searchValue:e,page:1};m(t),g(t)}}),(0,e.jsxs)("div",{className:"alley-scripts-post-picker__post-list",children:[l?l.map((t=>(0,e.jsx)(Ht.Button,{className:Kn()({"alley-scripts-post-picker__post":!0,"is-selected":t.id===r}),onClick:()=>o(t.id),children:n?n(t):(0,e.jsx)(er,{title:t.title,postType:t.subtype,attachmentID:t?._embedded?.self[0]?.featured_media})},t.id))):null,i?(0,e.jsx)(Ht.Spinner,{}):null,d>0&&h.page{const e={...h,page:h.page+1};m(e),g(e)},children:(0,Yt.__)("Load More","alley-scripts")})}):null]})]})},nr=({baseUrl:t,closeModal:n,modalTitle:r,onUpdate:o,searchRender:s,suppressPostIds:i=[]})=>{const[a,l]=(0,hn.useState)();return(0,e.jsxs)(Ht.Modal,{isDismissible:!0,title:r,onRequestClose:n,closeButtonLabel:"Close",children:[(0,e.jsx)(tr,{baseUrl:t,selected:a??0,setSelected:l,searchRender:s,suppressPostIds:i}),(0,e.jsxs)("div",{className:"alley-scripts-post-picker__buttons",children:[(0,e.jsx)(Ht.Button,{variant:"secondary",onClick:n,children:(0,Yt.__)("Cancel","alley-scripts")}),(0,e.jsx)(Ht.Button,{variant:"primary",onClick:()=>{a&&(o(a),n())},disabled:!a,children:(0,Yt.__)("Select","alley-scripts")})]})]})},rr=Bt.div` + display: block; + position: relative; +`,or=Bt.div` + border: 1px solid #eee; + display: flex; + flex-direction: column; + margin: 5px 0; + padding: 0.5rem 0.75rem; + text-align: center; +`,sr=({allowedTypes:t,className:n,getPostType:r,modalTitle:o=(0,Yt.__)("Select Post","alley-scripts"),onReset:s,onUpdate:i,params:a={},previewRender:l,replaceText:c=(0,Yt.__)("Replace","alley-scripts"),resetText:u=(0,Yt.__)("Reset","alley-scripts"),searchEndpoint:p="/wp/v2/search",searchRender:d,selectText:f=(0,Yt.__)("Select","alley-scripts"),suppressPostIds:h=[],title:m="",value:g=0})=>{const[y,v]=(0,hn.useState)(!1),b=(0,mn.addQueryArgs)(p,{type:"post",subtype:t??"any",...a}),A=Rn(g,r),{featured_media:_,title:{rendered:w=""}={},type:x=""}=A||{},C=()=>{v(!0)};return 0!==g&&null===A?(0,e.jsx)(Ht.Spinner,{}):(0,e.jsxs)(rr,{className:n,children:[m?(0,e.jsx)("h4",{children:m}):null,0!==g&&null!==A?(0,e.jsxs)(e.Fragment,{children:[void 0!==l?l(A):(0,e.jsx)(or,{children:(0,e.jsx)(er,{title:w,postType:x,attachmentID:_})}),(0,e.jsxs)(Ht.ButtonGroup,{children:[(0,e.jsx)(Ht.Button,{variant:"secondary",onClick:s,style:{margin:"0 4px"},children:u}),(0,e.jsx)(Ht.Button,{variant:"secondary",onClick:C,style:{margin:"0 4px"},children:c})]})]}):(0,e.jsx)(Ht.Button,{onClick:C,variant:"secondary",children:f}),y?(0,e.jsx)(nr,{closeModal:()=>{v(!1)},baseUrl:b,modalTitle:o,onUpdate:i,searchRender:d,suppressPostIds:h}):null]})},ir=({className:t,emptyLabel:n,label:r,maxPages:o,multiple:s,onSelect:i,placeholder:a,subTypes:l,selected:c,threshold:u})=>(0,e.jsx)(br,{type:"post",className:t,emptyLabel:n,label:r,maxPages:o,multiple:s,onSelect:i,placeholder:a,subTypes:l,selected:c,threshold:u});ir.defaultProps={className:"",emptyLabel:(0,Yt.__)("No posts found","alley-scripts"),label:(0,Yt.__)("Search for posts","alley-scripts"),maxPages:5,multiple:!1,placeholder:(0,Yt.__)("Search for posts","alley-scripts"),subTypes:[],selected:[],threshold:3},ir.propTypes={className:o().string,emptyLabel:o().string,label:o().string,maxPages:o().number,multiple:o().bool,onSelect:o().func.isRequired,placeholder:o().string,subTypes:o().arrayOf(o().string),selected:o().arrayOf([o().shape({id:o().number,title:o().string})]),threshold:o().number};const ar=ir,lr={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let cr;const ur=new Uint8Array(16);function pr(){if(!cr&&(cr="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!cr))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return cr(ur)}const dr=[];for(let e=0;e<256;++e)dr.push((e+256).toString(16).slice(1));const fr=function(e,t,n){if(lr.randomUUID&&!t&&!e)return lr.randomUUID();const r=(e=e||{}).random||(e.rng||pr)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=r[e];return t}return function(e,t=0){return(dr[e[t+0]]+dr[e[t+1]]+dr[e[t+2]]+dr[e[t+3]]+"-"+dr[e[t+4]]+dr[e[t+5]]+"-"+dr[e[t+6]]+dr[e[t+7]]+"-"+dr[e[t+8]]+dr[e[t+9]]+"-"+dr[e[t+10]]+dr[e[t+11]]+dr[e[t+12]]+dr[e[t+13]]+dr[e[t+14]]+dr[e[t+15]]).toLowerCase()}(r)},hr=({emptyLabel:t,error:n,id:r,isOpen:o,labelledbyId:s,loading:i,onSelect:a,options:l,selectedItems:c,threshold:u,value:p})=>{if(!i&&(""===p||u>p.length))return null;let d="",f="";return i?(d="loading",f=(0,Yt.__)("Loading...","alley-scripts")):n?(d="error",f=n):i||0!==l.length||(d="no-posts",f=t),i||!i&&(p&&0===l.length||n)?(0,e.jsx)("div",{"aria-busy":!0,className:Kn()("autocomplete__dropdown",{"autocomplete__dropdown--is-open":o}),children:(0,e.jsx)("div",{className:Kn()("autocomplete__dropdown--notice",`autocomplete__${d}`),children:f})}):(0,e.jsx)("div",{className:Kn()("autocomplete__dropdown",{"autocomplete__dropdown--is-open":o}),children:(0,e.jsx)("ul",{role:"listbox","aria-labelledby":s,id:r,className:Kn()("autocomplete__dropdown--results","autocomplete__list"),children:l.map((t=>(0,e.jsx)("li",{className:"autocomplete__list--item",children:(0,e.jsx)(Ht.Button,{onClick:()=>a(t),type:"button",disabled:c.some((e=>e.id===t.id)),isTertiary:!0,children:t.title})},t.id)))})})};hr.propTypes={emptyLabel:o().string.isRequired,error:o().string.isRequired,id:o().string.isRequired,isOpen:o().bool.isRequired,labelledbyId:o().string.isRequired,loading:o().bool.isRequired,options:o().arrayOf(o().shape({label:o().string,value:o().string})).isRequired,onSelect:o().func.isRequired,selectedItems:o().shape([]).isRequired,threshold:o().number.isRequired,value:o().string.isRequired};const mr=hr;var gr=n(458),yr={};yr.styleTagTransform=Gn(),yr.setAttributes=qn(),yr.insert=Fn().bind(null,"head"),yr.domAPI=Mn(),yr.insertStyleElement=Hn(),Dn()(gr.Z,yr),gr.Z&&gr.Z.locals&&gr.Z.locals;const vr=({type:t,className:n,emptyLabel:r,label:o,maxPages:s,multiple:i,onSelect:a,placeholder:l,subTypes:c,selected:u,threshold:p})=>{const d=fr(),[f,h]=(0,hn.useState)(""),[m,g]=(0,hn.useState)([]),[y,v]=(0,hn.useState)(!1),[b,A]=(0,hn.useState)(!1),[_,w]=(0,hn.useState)(""),[x,C]=(0,hn.useState)([]),S=(0,hn.useRef)(),k=gn(_,750),E=(0,hn.useCallback)((async(e=1)=>{if(k.length0?c.join(","):"any",type:t});await En()({path:r,parse:!1}).then((e=>{const t=parseInt(e.headers.get("X-WP-TotalPages"),10);return n=t>s?s:t,e.json()})).then((t=>{g((e=>[...e,...t])),A(!1),(n&&n>e||e>=1&&i&&x.length>0)&&E(e+1)})).catch((e=>h(e.message)))}),[k,t,s,i,c,x.length,p]);(0,hn.useEffect)((()=>{C(u)}),[u]),(0,hn.useEffect)((()=>{k&&p<=k.length?E():g([])}),[k,E,p]);const R=e=>{v(S.current.contains(e.target))},T=e=>{"Escape"===e.key&&v(!1)};(0,hn.useEffect)((()=>(document.addEventListener("keydown",T),()=>document.removeEventListener("keydown",T)))),(0,hn.useEffect)((()=>(S&&document.addEventListener("mousedown",R),()=>document.removeEventListener("mousedown",R))));const I=e=>{let t=[];if(x.some((t=>t.id===e.id))){const n=x.findIndex((t=>t.id===e.id));t=[...x.slice(0,n),...x.slice(n+1,x.length)]}else i?t=[...x,e]:(t=[e],v(!1));C(t),a(t)};return(0,e.jsx)("form",{className:"autocomplete__component",onSubmit:e=>e.preventDefault(),children:(0,e.jsxs)("div",{className:Kn()("components-base-control","autocomplete-base-control",n),ref:S,children:[(0,e.jsxs)("div",{"aria-expanded":y,"aria-haspopup":"listbox","aria-owns":`listbox-${d}`,className:Kn()("components-base-control__field","autocomplete-base-control__field"),role:"combobox",children:[(0,e.jsx)("label",{className:Kn()("components-base-control__label","autocomplete-base-control__label"),htmlFor:`autocomplete-${d}`,children:(0,e.jsx)("div",{children:o})}),x.length>0?(0,e.jsx)("ul",{role:"listbox","aria-labelledby":`autocomplete-${d}`,id:`selected-items-${d}`,className:Kn()("autocomplete__selection--results","autocomplete__selection-list"),children:x.map((t=>(0,e.jsx)("li",{className:"autocomplete__selection-list--item",children:(0,e.jsx)(Ht.Button,{className:"autocomplete__selection-list--item--button",isSecondary:!0,isSmall:!0,onClick:()=>I(t),type:"button",children:t.title})},t.title)))}):null,(0,e.jsx)("input",{"aria-autocomplete":"list",autoComplete:"off",className:Kn()("components-text-control__input","autocomplete-text-control__input",{"autocomplete-text-control__input--working":y}),id:`autocomplete-${d}`,onChange:e=>w(e.target.value),onFocus:()=>v(!0),placeholder:l,type:"text",value:_})]}),(0,e.jsx)(mr,{emptyLabel:r,error:f,labelledById:`autocomplete-${d}`,id:`listbox-${d}`,isOpen:y,loading:b&&k,onSelect:I,options:m,selectedItems:x,threshold:p,value:k})]})})};vr.defaultProps={type:"post",className:"",emptyLabel:(0,Yt.__)("No items found","alley-scripts"),label:(0,Yt.__)("Search for items","alley-scripts"),maxPages:5,multiple:!1,placeholder:(0,Yt.__)("Search for items","alley-scripts"),subTypes:[],selected:[],threshold:3},vr.propTypes={type:o().string,className:o().string,emptyLabel:o().string,label:o().string,maxPages:o().number,multiple:o().bool,onSelect:o().func.isRequired,placeholder:o().string,subTypes:o().arrayOf(o().string),selected:o().arrayOf([o().shape({id:o().number,title:o().string})]),threshold:o().number};const br=vr,Ar=({className:t,emptyLabel:n,label:r,maxPages:o,multiple:s,onSelect:i,placeholder:a,subTypes:l,selected:c,threshold:u})=>(0,e.jsx)(br,{type:"term",className:t,emptyLabel:n,label:r,maxPages:o,multiple:s,onSelect:i,placeholder:a,subTypes:l,selected:c,threshold:u});Ar.defaultProps={className:"",emptyLabel:(0,Yt.__)("No terms found","alley-scripts"),label:(0,Yt.__)("Search for terms","alley-scripts"),maxPages:5,multiple:!1,placeholder:(0,Yt.__)("Search for terms","alley-scripts"),subTypes:[],selected:[],threshold:3},Ar.propTypes={className:o().string,emptyLabel:o().string,label:o().string,maxPages:o().number,multiple:o().bool,onSelect:o().func.isRequired,placeholder:o().string,subTypes:o().arrayOf(o().string),selected:o().arrayOf([o().shape({id:o().number,title:o().string})]),threshold:o().number};const _r=Ar,wr=Bt.div` + height: auto; + width: 100%; +`,xr=({src:t})=>(0,e.jsx)(wr,{children:(0,e.jsx)("video",{className:"edit-video-preview",controls:!0,src:t})});xr.propTypes={src:o().string.isRequired};const Cr=({className:t,onReset:n,onUpdate:r,onUpdateURL:o,value:s,valueURL:i})=>(0,e.jsx)(cn,{allowedTypes:["video"],className:t,icon:"format-video",onReset:n,onUpdate:r,onUpdateURL:o,preview:xr,value:s,valueURL:i});Cr.defaultProps={className:"",onUpdateURL:null,valueURL:""},Cr.propTypes={className:o().string,onReset:o().func.isRequired,onUpdate:o().func.isRequired,onUpdateURL:o().func,value:o().number.isRequired,valueURL:o().string};const Sr=Cr})(),r})(),e.exports=t()},184:function(e,t){var n;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e=[],t=0;tparseInt(e,10))).findIndex((e=>e===u)),v=m[y],b=e=>{const t=[...m];t[y]=e,(0,a.dispatch)("core/block-editor").updateBlockAttributes(f,{posts:t})},A=(0,a.useSelect)((e=>e("core/block-editor").hasSelectedInnerBlock(o,!0)),[o]);return(0,e.createElement)("div",{...(0,r.useBlockProps)({className:s()("wp-curate-post-block",{"wp-curate-post-block--selected":A},{"wp-curate-post-block--backfill":!v})})},A||d?(0,e.createElement)(i.PostPicker,{allowedTypes:g,onUpdate:b,onReset:()=>{b(null)},value:null!=v?v:0,previewRender:c,className:"wp-curate-post-block__post-picker",selectText:(0,l.__)("Pin a post","wp-curate"),resetText:(0,l.__)("Backfill post","wp-curate"),replaceText:(0,l.__)("Pin a different post","wp-curate")}):null,(0,e.createElement)(r.InnerBlocks,null))},save:()=>{const t=r.useBlockProps.save();return(0,e.createElement)("div",{...t},(0,e.createElement)(r.InnerBlocks.Content,null))}})}()}(); \ No newline at end of file diff --git a/build/post/index.php b/build/post/index.php new file mode 100644 index 00000000..c4f7d0af --- /dev/null +++ b/build/post/index.php @@ -0,0 +1,17 @@ +. + * @var WP_Block $block The instance of the WP_Block class that represents the block being rendered. + * + * @package wp-curate + */ + +echo $content; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Rendered by Gutenberg. diff --git a/build/query/block.json b/build/query/block.json new file mode 100644 index 00000000..4c361622 --- /dev/null +++ b/build/query/block.json @@ -0,0 +1,79 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 2, + "name": "wp-curate/query", + "version": "0.1.0", + "title": "Query", + "category": "theme", + "icon": "filter", + "description": "Custom queries for WP Curate", + "textdomain": "wp-curate", + "editorScript": "file:index.js", + "editorStyle": "file:index.css", + "style": [ + "file:style-index.css" + ], + "providesContext": { + "query": "query", + "displayLayout": "displayLayout", + "heading": "heading", + "curation": "curation" + }, + "attributes": { + "deduplication": { + "default": "inherit", + "enum": [ + "inherit", + "never" + ], + "type": "string" + }, + "maxNumberOfPosts": { + "default": 10, + "type": "number" + }, + "minNumberOfPosts": { + "default": 1, + "type": "number" + }, + "numberOfPosts": { + "default": 5, + "type": "number" + }, + "offset": { + "default": 0, + "type": "number" + }, + "postTypes": { + "default": [ + "post" + ], + "items": { + "type": "string" + }, + "type": "array" + }, + "posts": { + "default": [], + "items": { + "type": "number" + }, + "type": "array" + }, + "searchTerm": { + "default": "", + "type": "string" + }, + "terms": { + "default": {}, + "items": { + "default": [], + "items": { + "type": "object" + }, + "type": "array" + }, + "type": "object" + } + } +} \ No newline at end of file diff --git a/build/query/index.asset.php b/build/query/index.asset.php new file mode 100644 index 00000000..b4095e16 --- /dev/null +++ b/build/query/index.asset.php @@ -0,0 +1 @@ + array('react', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-url'), 'version' => '7a27ad3de45d0c9576d4'); diff --git a/build/query/index.css b/build/query/index.css new file mode 100644 index 00000000..5b314f14 --- /dev/null +++ b/build/query/index.css @@ -0,0 +1 @@ +.autocomplete__component .components-base-control__label{display:inline-block;font-size:11px;font-weight:500;line-height:1.4;margin-bottom:8px;text-transform:uppercase}.manual-posts__container{gap:1rem}.manual-posts__picker{border:1px dashed #e0e0e0;flex:1;padding:8px}.manual-posts__picker>.components-button{justify-content:center;width:100%}.manual-posts__container--selected .manual-posts__picker{border:0;padding:0 0 16px}.manual-posts__container--selected .manual-posts__picker>*{width:100%}.manual-posts__counter{font-weight:500}.manual-posts:has(.manual-posts__container:nth-last-child(10)) .manual-posts__counter{min-width:18px} diff --git a/build/query/index.js b/build/query/index.js new file mode 100644 index 00000000..ac0508d7 --- /dev/null +++ b/build/query/index.js @@ -0,0 +1,42 @@ +!function(){var e,t={373:function(e){var t;self,t=()=>(()=>{var e={779:(e,t)=>{var n;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e=[],t=0;t{"use strict";n.d(t,{Z:()=>a});var r=n(272),o=n.n(r),s=n(609),i=n.n(s)()(o());i.push([e.id,".alley-scripts-post-picker__post-list{display:flex;flex-wrap:wrap;float:left;height:calc(70vh - 200px);justify-content:flex-start;overflow-y:auto;padding:8px;width:100%}.alley-scripts-post-picker__post{border:1px solid #eee;height:auto;justify-content:center;margin:0 8px 8px 0;transition:background-color .2s ease-in-out;width:calc((100% - 40px)/3)}@media(min-width: 780px){.alley-scripts-post-picker__post{width:calc((100% - 40px)/5)}}.alley-scripts-post-picker__post:hover{background-color:#f5f5f5}.alley-scripts-post-picker__post.is-selected{background-color:#f5f5f5}.alley-scripts-post-picker__load-more{clear:both;float:left;text-align:center;width:100%}","",{version:3,sources:["webpack://./src/components/post-picker/post-list.scss"],names:[],mappings:"AAAA,sCACE,YAAA,CACA,cAAA,CACA,UAAA,CACA,yBAAA,CACA,0BAAA,CACA,eAAA,CACA,WAAA,CACA,UAAA,CAGF,iCACE,qBAAA,CACA,WAAA,CACA,sBAAA,CACA,kBAAA,CACA,2CAAA,CACA,2BAAA,CAGA,yBATF,iCAUI,2BAAA,CAAA,CAGF,uCACE,wBAAA,CAGF,6CACE,wBAAA,CAIJ,sCACE,UAAA,CACA,UAAA,CACA,iBAAA,CACA,UAAA",sourcesContent:[".alley-scripts-post-picker__post-list {\n display: flex;\n flex-wrap: wrap;\n float: left;\n height: calc(70vh - 200px);\n justify-content: flex-start;\n overflow-y: auto;\n padding: 8px;\n width: 100%;\n}\n\n.alley-scripts-post-picker__post {\n border: 1px solid #eee;\n height: auto;\n justify-content: center;\n margin: 0 8px 8px 0;\n transition: background-color 0.2s ease-in-out;\n width: calc((100% - 40px) / 3);\n\n\n @media (min-width: 780px) {\n width: calc((100% - 40px) / 5);\n }\n\n &:hover {\n background-color: #f5f5f5;\n }\n\n &.is-selected {\n background-color: #f5f5f5;\n }\n}\n\n.alley-scripts-post-picker__load-more {\n clear: both;\n float: left;\n text-align: center;\n width: 100%;\n}\n"],sourceRoot:""}]);const a=i},992:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(272),o=n.n(r),s=n(609),i=n.n(s)()(o());i.push([e.id,".components-modal__content{width:90vw}.alley-scripts-post-picker__buttons{clear:both;display:block;text-align:right;width:100%}.alley-scripts-post-picker__buttons button{margin:5px}","",{version:3,sources:["webpack://./src/components/post-picker/search-modal.scss"],names:[],mappings:"AAAA,2BACE,UAAA,CAGF,oCACE,UAAA,CACA,aAAA,CACA,gBAAA,CACA,UAAA,CAEA,2CACE,UAAA",sourcesContent:[".components-modal__content {\n width: 90vw;\n}\n\n.alley-scripts-post-picker__buttons {\n clear: both;\n display: block;\n text-align: right;\n width: 100%;\n\n button {\n margin: 5px;\n }\n}\n"],sourceRoot:""}]);const a=i},458:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(272),o=n.n(r),s=n(609),i=n.n(s)()(o());i.push([e.id,'.edit-post-sidebar .autocomplete__component,.editor-styles-wrapper .autocomplete__component{margin-bottom:20px}.edit-post-sidebar .autocomplete-base-control,.editor-styles-wrapper .autocomplete-base-control{position:relative}.edit-post-sidebar .autocomplete-text-control__input,.editor-styles-wrapper .autocomplete-text-control__input{margin:0}.edit-post-sidebar .autocomplete__selection-list,.editor-styles-wrapper .autocomplete__selection-list{list-style-type:none;margin:0 0 6px;padding:0}.edit-post-sidebar .autocomplete__selection-list--item,.editor-styles-wrapper .autocomplete__selection-list--item{display:inline-block;list-style:none}.edit-post-sidebar .autocomplete__selection-list--item--button,.editor-styles-wrapper .autocomplete__selection-list--item--button{margin-bottom:4px;margin-right:3px}.edit-post-sidebar .autocomplete__selection-list--item--button::after,.editor-styles-wrapper .autocomplete__selection-list--item--button::after{content:"×";font-size:16px;line-height:20px;margin-left:5px}.edit-post-sidebar .autocomplete__dropdown,.editor-styles-wrapper .autocomplete__dropdown{background-color:#fff;border-color:rgba(0,0,0,0) #e2e4e7 #e2e4e7;border-radius:0 0 4px 4px;border-style:solid;border-width:0 1px 1px;left:0;max-height:0;overflow-y:hidden;position:absolute;top:calc(100% + 1px);visibility:hidden;width:100%;z-index:10}.edit-post-sidebar .autocomplete__dropdown--is-open,.editor-styles-wrapper .autocomplete__dropdown--is-open{box-shadow:0 3px 30px rgba(25,30,35,.1);max-height:225px;overflow-y:scroll;visibility:visible}.edit-post-sidebar .autocomplete__dropdown--notice,.editor-styles-wrapper .autocomplete__dropdown--notice{padding:15px}.edit-post-sidebar .autocomplete__dropdown--results,.editor-styles-wrapper .autocomplete__dropdown--results{list-style:none;margin:0;padding:0}.edit-post-sidebar .autocomplete__list--item,.editor-styles-wrapper .autocomplete__list--item{list-style:none}.edit-post-sidebar .autocomplete__list--item>button,.editor-styles-wrapper .autocomplete__list--item>button{background:rgba(0,0,0,0);border-color:#e2e4e7;border-style:solid;border-width:0 0 1px;height:100%;line-height:1.25;text-align:left;white-space:inherit;width:100%}.edit-post-sidebar .autocomplete__list--item:last-child>button,.editor-styles-wrapper .autocomplete__list--item:last-child>button{border-bottom:0}',"",{version:3,sources:["webpack://./src/components/selector/styles.scss"],names:[],mappings:"AAAA,4FAgBI,kBACE,CAAA,gGAMF,iBACE,CAAA,8GAMF,QACE,CAAA,sGAMF,oBACE,CAAA,cACA,CAAA,SACA,CAAA,kHAEA,oBACE,CAAA,eACA,CAAA,kIAEA,iBACE,CAAA,gBACA,CAAA,gJAEA,WACE,CAAA,cACA,CAAA,gBACA,CAAA,eACA,CAAA,0FASR,qBACE,CAAA,0CACA,CAAA,yBACA,CAAA,kBACA,CAAA,sBACA,CAAA,MACA,CAAA,YACA,CAAA,iBACA,CAAA,iBACA,CAAA,oBACA,CAAA,iBACA,CAAA,UACA,CAAA,UACA,CAAA,4GAGA,uCACE,CAAA,gBACA,CAAA,iBACA,CAAA,kBACA,CAAA,0GAIF,YACE,CAAA,4GAIF,eACE,CAAA,QACA,CAAA,SACA,CAAA,8FAOJ,eACE,CAAA,4GAEA,wBACE,CAAA,oBACA,CAAA,kBACA,CAAA,oBACA,CAAA,WACA,CAAA,gBACA,CAAA,eACA,CAAA,mBACA,CAAA,UACA,CAAA,kIAGF,eACE",sourcesContent:["//--------------------------------------------------------------\n// AutoComplete Styles\n//--------------------------------------------------------------\n\n/* stylelint-disable max-nesting-depth */\n\n//-----------------------------------------\n// Accommodate editor well, or the sidebar.\n//-----------------------------------------\n.edit-post-sidebar,\n.editor-styles-wrapper {\n .autocomplete {\n\n //-----------------------------------------\n // Parent form wrapper.\n //-----------------------------------------\n &__component {\n margin-bottom: 20px;\n }\n\n //-----------------------------------------\n // Wrapper\n //-----------------------------------------\n &-base-control {\n position: relative;\n }\n\n //-----------------------------------------\n // Input\n //-----------------------------------------\n &-text-control__input {\n margin: 0;\n }\n\n //-----------------------------------------\n // Selected buttons.\n //-----------------------------------------\n &__selection-list {\n list-style-type: none;\n margin: 0 0 6px;\n padding: 0;\n\n &--item {\n display: inline-block;\n list-style: none;\n\n &--button {\n margin-bottom: 4px;\n margin-right: 3px;\n\n &::after {\n content: '×';\n font-size: 16px;\n line-height: 20px;\n margin-left: 5px;\n }\n }\n }\n }\n\n //-----------------------------------------\n // Results\n //-----------------------------------------\n &__dropdown {\n background-color: #fff;\n border-color: transparent #e2e4e7 #e2e4e7;\n border-radius: 0 0 4px 4px;\n border-style: solid;\n border-width: 0 1px 1px;\n left: 0;\n max-height: 0;\n overflow-y: hidden;\n position: absolute;\n top: calc(100% + 1px); // Offset focus border.\n visibility: hidden;\n width: 100%;\n z-index: 10;\n\n // Container is open.\n &--is-open {\n box-shadow: 0 3px 30px rgba(25, 30, 35, 0.1);\n max-height: 225px;\n overflow-y: scroll;\n visibility: visible;\n }\n\n // Notice handler.\n &--notice {\n padding: 15px;\n }\n\n // Results container.\n &--results {\n list-style: none;\n margin: 0;\n padding: 0;\n }\n }\n\n //-----------------------------------------\n // List/Results\n //-----------------------------------------\n &__list--item {\n list-style: none;\n\n > button {\n background: transparent;\n border-color: #e2e4e7;\n border-style: solid;\n border-width: 0 0 1px;\n height: 100%;\n line-height: 1.25;\n text-align: left;\n white-space: inherit;\n width: 100%;\n }\n\n &:last-child > button {\n border-bottom: 0;\n }\n }\n }\n}\n"],sourceRoot:""}]);const a=i},609:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,r,o,s){"string"==typeof e&&(e=[[null,e,void 0]]);var i={};if(r)for(var a=0;a0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=s),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),o&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=o):u[4]="".concat(o)),t.push(u))}},t}},272:e=>{"use strict";e.exports=function(e){var t=e[1],n=e[3];if(!n)return t;if("function"==typeof btoa){var r=btoa(unescape(encodeURIComponent(JSON.stringify(n)))),o="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(r),s="/*# ".concat(o," */");return[t].concat([s]).join("\n")}return[t].join("\n")}},368:function(e){e.exports=function(){"use strict";const{entries:e,setPrototypeOf:t,isFrozen:n,getPrototypeOf:r,getOwnPropertyDescriptor:o}=Object;let{freeze:s,seal:i,create:a}=Object,{apply:l,construct:c}="undefined"!=typeof Reflect&&Reflect;l||(l=function(e,t,n){return e.apply(t,n)}),s||(s=function(e){return e}),i||(i=function(e){return e}),c||(c=function(e,t){return new e(...t)});const u=w(Array.prototype.forEach),p=w(Array.prototype.pop),d=w(Array.prototype.push),f=w(String.prototype.toLowerCase),h=w(String.prototype.toString),m=w(String.prototype.match),g=w(String.prototype.replace),y=w(String.prototype.indexOf),v=w(String.prototype.trim),b=w(RegExp.prototype.test),_=(A=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n1?n-1:0),o=1;o/gm),B=i(/\${[\w\W]*}/gm),F=i(/^data-[\-\w.\u00B7-\uFFFF]/),z=i(/^aria-[\-\w]+$/),q=i(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),$=i(/^(?:\w+script|data):/i),H=i(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),W=i(/^html$/i);var G=Object.freeze({__proto__:null,MUSTACHE_EXPR:U,ERB_EXPR:M,TMPLIT_EXPR:B,DATA_ATTR:F,ARIA_ATTR:z,IS_ALLOWED_URI:q,IS_SCRIPT_OR_DATA:$,ATTR_WHITESPACE:H,DOCTYPE_NAME:W});return function t(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"undefined"==typeof window?null:window;const r=e=>t(e);if(r.version="3.0.5",r.removed=[],!n||!n.document||9!==n.document.nodeType)return r.isSupported=!1,r;const o=n.document,i=o.currentScript;let{document:a}=n;const{DocumentFragment:l,HTMLTemplateElement:c,Node:A,Element:w,NodeFilter:U,NamedNodeMap:M=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:B,DOMParser:F,trustedTypes:z}=n,$=w.prototype,H=S($,"cloneNode"),Y=S($,"nextSibling"),V=S($,"childNodes"),Z=S($,"parentNode");if("function"==typeof c){const e=a.createElement("template");e.content&&e.content.ownerDocument&&(a=e.content.ownerDocument)}let Q,K="";const{implementation:J,createNodeIterator:X,createDocumentFragment:ee,getElementsByTagName:te}=a,{importNode:ne}=o;let re={};r.isSupported="function"==typeof e&&"function"==typeof Z&&J&&void 0!==J.createHTMLDocument;const{MUSTACHE_EXPR:oe,ERB_EXPR:se,TMPLIT_EXPR:ie,DATA_ATTR:ae,ARIA_ATTR:le,IS_SCRIPT_OR_DATA:ce,ATTR_WHITESPACE:ue}=G;let{IS_ALLOWED_URI:pe}=G,de=null;const fe=C({},[...E,...k,...R,...I,...O]);let he=null;const me=C({},[...P,...L,...j,...D]);let ge=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ye=null,ve=null,be=!0,_e=!0,Ae=!1,we=!0,Ce=!1,xe=!1,Se=!1,Ee=!1,ke=!1,Re=!1,Te=!1,Ie=!0,Ne=!1,Oe=!0,Pe=!1,Le={},je=null;const De=C({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ue=null;const Me=C({},["audio","video","img","source","image","track"]);let Be=null;const Fe=C({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ze="http://www.w3.org/1998/Math/MathML",qe="http://www.w3.org/2000/svg",$e="http://www.w3.org/1999/xhtml";let He=$e,We=!1,Ge=null;const Ye=C({},[ze,qe,$e],h);let Ve;const Ze=["application/xhtml+xml","text/html"];let Qe,Ke=null;const Je=a.createElement("form"),Xe=function(e){return e instanceof RegExp||e instanceof Function},et=function(e){if(!Ke||Ke!==e){if(e&&"object"==typeof e||(e={}),e=x(e),Ve=Ve=-1===Ze.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,Qe="application/xhtml+xml"===Ve?h:f,de="ALLOWED_TAGS"in e?C({},e.ALLOWED_TAGS,Qe):fe,he="ALLOWED_ATTR"in e?C({},e.ALLOWED_ATTR,Qe):me,Ge="ALLOWED_NAMESPACES"in e?C({},e.ALLOWED_NAMESPACES,h):Ye,Be="ADD_URI_SAFE_ATTR"in e?C(x(Fe),e.ADD_URI_SAFE_ATTR,Qe):Fe,Ue="ADD_DATA_URI_TAGS"in e?C(x(Me),e.ADD_DATA_URI_TAGS,Qe):Me,je="FORBID_CONTENTS"in e?C({},e.FORBID_CONTENTS,Qe):De,ye="FORBID_TAGS"in e?C({},e.FORBID_TAGS,Qe):{},ve="FORBID_ATTR"in e?C({},e.FORBID_ATTR,Qe):{},Le="USE_PROFILES"in e&&e.USE_PROFILES,be=!1!==e.ALLOW_ARIA_ATTR,_e=!1!==e.ALLOW_DATA_ATTR,Ae=e.ALLOW_UNKNOWN_PROTOCOLS||!1,we=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Ce=e.SAFE_FOR_TEMPLATES||!1,xe=e.WHOLE_DOCUMENT||!1,ke=e.RETURN_DOM||!1,Re=e.RETURN_DOM_FRAGMENT||!1,Te=e.RETURN_TRUSTED_TYPE||!1,Ee=e.FORCE_BODY||!1,Ie=!1!==e.SANITIZE_DOM,Ne=e.SANITIZE_NAMED_PROPS||!1,Oe=!1!==e.KEEP_CONTENT,Pe=e.IN_PLACE||!1,pe=e.ALLOWED_URI_REGEXP||q,He=e.NAMESPACE||$e,ge=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&Xe(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ge.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&Xe(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ge.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(ge.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ce&&(_e=!1),Re&&(ke=!0),Le&&(de=C({},[...O]),he=[],!0===Le.html&&(C(de,E),C(he,P)),!0===Le.svg&&(C(de,k),C(he,L),C(he,D)),!0===Le.svgFilters&&(C(de,R),C(he,L),C(he,D)),!0===Le.mathMl&&(C(de,I),C(he,j),C(he,D))),e.ADD_TAGS&&(de===fe&&(de=x(de)),C(de,e.ADD_TAGS,Qe)),e.ADD_ATTR&&(he===me&&(he=x(he)),C(he,e.ADD_ATTR,Qe)),e.ADD_URI_SAFE_ATTR&&C(Be,e.ADD_URI_SAFE_ATTR,Qe),e.FORBID_CONTENTS&&(je===De&&(je=x(je)),C(je,e.FORBID_CONTENTS,Qe)),Oe&&(de["#text"]=!0),xe&&C(de,["html","head","body"]),de.table&&(C(de,["tbody"]),delete ye.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw _('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw _('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');Q=e.TRUSTED_TYPES_POLICY,K=Q.createHTML("")}else void 0===Q&&(Q=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+o+" could not be created."),null}}(z,i)),null!==Q&&"string"==typeof K&&(K=Q.createHTML(""));s&&s(e),Ke=e}},tt=C({},["mi","mo","mn","ms","mtext"]),nt=C({},["foreignobject","desc","title","annotation-xml"]),rt=C({},["title","style","font","a","script"]),ot=C({},k);C(ot,R),C(ot,T);const st=C({},I);C(st,N);const it=function(e){d(r.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){e.remove()}},at=function(e,t){try{d(r.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){d(r.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!he[e])if(ke||Re)try{it(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},lt=function(e){let t,n;if(Ee)e=""+e;else{const t=m(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===Ve&&He===$e&&(e=''+e+"");const r=Q?Q.createHTML(e):e;if(He===$e)try{t=(new F).parseFromString(r,Ve)}catch(e){}if(!t||!t.documentElement){t=J.createDocument(He,"template",null);try{t.documentElement.innerHTML=We?K:r}catch(e){}}const o=t.body||t.documentElement;return e&&n&&o.insertBefore(a.createTextNode(n),o.childNodes[0]||null),He===$e?te.call(t,xe?"html":"body")[0]:xe?t.documentElement:o},ct=function(e){return X.call(e.ownerDocument||e,e,U.SHOW_ELEMENT|U.SHOW_COMMENT|U.SHOW_TEXT,null,!1)},ut=function(e){return"object"==typeof A?e instanceof A:e&&"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},pt=function(e,t,n){re[e]&&u(re[e],(e=>{e.call(r,t,n,Ke)}))},dt=function(e){let t;if(pt("beforeSanitizeElements",e,null),(n=e)instanceof B&&("string"!=typeof n.nodeName||"string"!=typeof n.textContent||"function"!=typeof n.removeChild||!(n.attributes instanceof M)||"function"!=typeof n.removeAttribute||"function"!=typeof n.setAttribute||"string"!=typeof n.namespaceURI||"function"!=typeof n.insertBefore||"function"!=typeof n.hasChildNodes))return it(e),!0;var n;const o=Qe(e.nodeName);if(pt("uponSanitizeElement",e,{tagName:o,allowedTags:de}),e.hasChildNodes()&&!ut(e.firstElementChild)&&(!ut(e.content)||!ut(e.content.firstElementChild))&&b(/<[/\w]/g,e.innerHTML)&&b(/<[/\w]/g,e.textContent))return it(e),!0;if(!de[o]||ye[o]){if(!ye[o]&&ht(o)){if(ge.tagNameCheck instanceof RegExp&&b(ge.tagNameCheck,o))return!1;if(ge.tagNameCheck instanceof Function&&ge.tagNameCheck(o))return!1}if(Oe&&!je[o]){const t=Z(e)||e.parentNode,n=V(e)||e.childNodes;if(n&&t)for(let r=n.length-1;r>=0;--r)t.insertBefore(H(n[r],!0),Y(e))}return it(e),!0}return e instanceof w&&!function(e){let t=Z(e);t&&t.tagName||(t={namespaceURI:He,tagName:"template"});const n=f(e.tagName),r=f(t.tagName);return!!Ge[e.namespaceURI]&&(e.namespaceURI===qe?t.namespaceURI===$e?"svg"===n:t.namespaceURI===ze?"svg"===n&&("annotation-xml"===r||tt[r]):Boolean(ot[n]):e.namespaceURI===ze?t.namespaceURI===$e?"math"===n:t.namespaceURI===qe?"math"===n&&nt[r]:Boolean(st[n]):e.namespaceURI===$e?!(t.namespaceURI===qe&&!nt[r])&&!(t.namespaceURI===ze&&!tt[r])&&!st[n]&&(rt[n]||!ot[n]):!("application/xhtml+xml"!==Ve||!Ge[e.namespaceURI]))}(e)?(it(e),!0):"noscript"!==o&&"noembed"!==o&&"noframes"!==o||!b(/<\/no(script|embed|frames)/i,e.innerHTML)?(Ce&&3===e.nodeType&&(t=e.textContent,t=g(t,oe," "),t=g(t,se," "),t=g(t,ie," "),e.textContent!==t&&(d(r.removed,{element:e.cloneNode()}),e.textContent=t)),pt("afterSanitizeElements",e,null),!1):(it(e),!0)},ft=function(e,t,n){if(Ie&&("id"===t||"name"===t)&&(n in a||n in Je))return!1;if(_e&&!ve[t]&&b(ae,t));else if(be&&b(le,t));else if(!he[t]||ve[t]){if(!(ht(e)&&(ge.tagNameCheck instanceof RegExp&&b(ge.tagNameCheck,e)||ge.tagNameCheck instanceof Function&&ge.tagNameCheck(e))&&(ge.attributeNameCheck instanceof RegExp&&b(ge.attributeNameCheck,t)||ge.attributeNameCheck instanceof Function&&ge.attributeNameCheck(t))||"is"===t&&ge.allowCustomizedBuiltInElements&&(ge.tagNameCheck instanceof RegExp&&b(ge.tagNameCheck,n)||ge.tagNameCheck instanceof Function&&ge.tagNameCheck(n))))return!1}else if(Be[t]);else if(b(pe,g(n,ue,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==y(n,"data:")||!Ue[e])if(Ae&&!b(ce,g(n,ue,"")));else if(n)return!1;return!0},ht=function(e){return e.indexOf("-")>0},mt=function(e){let t,n,o,s;pt("beforeSanitizeAttributes",e,null);const{attributes:i}=e;if(!i)return;const a={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:he};for(s=i.length;s--;){t=i[s];const{name:l,namespaceURI:c}=t;if(n="value"===l?t.value:v(t.value),o=Qe(l),a.attrName=o,a.attrValue=n,a.keepAttr=!0,a.forceKeepAttr=void 0,pt("uponSanitizeAttribute",e,a),n=a.attrValue,a.forceKeepAttr)continue;if(at(l,e),!a.keepAttr)continue;if(!we&&b(/\/>/i,n)){at(l,e);continue}Ce&&(n=g(n,oe," "),n=g(n,se," "),n=g(n,ie," "));const u=Qe(e.nodeName);if(ft(u,o,n)){if(!Ne||"id"!==o&&"name"!==o||(at(l,e),n="user-content-"+n),Q&&"object"==typeof z&&"function"==typeof z.getAttributeType)if(c);else switch(z.getAttributeType(u,o)){case"TrustedHTML":n=Q.createHTML(n);break;case"TrustedScriptURL":n=Q.createScriptURL(n)}try{c?e.setAttributeNS(c,l,n):e.setAttribute(l,n),p(r.removed)}catch(e){}}}pt("afterSanitizeAttributes",e,null)},gt=function e(t){let n;const r=ct(t);for(pt("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)pt("uponSanitizeShadowNode",n,null),dt(n)||(n.content instanceof l&&e(n.content),mt(n));pt("afterSanitizeShadowDOM",t,null)};return r.sanitize=function(e){let t,n,s,i,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(We=!e,We&&(e="\x3c!--\x3e"),"string"!=typeof e&&!ut(e)){if("function"!=typeof e.toString)throw _("toString is not a function");if("string"!=typeof(e=e.toString()))throw _("dirty is not a string, aborting")}if(!r.isSupported)return e;if(Se||et(a),r.removed=[],"string"==typeof e&&(Pe=!1),Pe){if(e.nodeName){const t=Qe(e.nodeName);if(!de[t]||ye[t])throw _("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof A)t=lt("\x3c!----\x3e"),n=t.ownerDocument.importNode(e,!0),1===n.nodeType&&"BODY"===n.nodeName||"HTML"===n.nodeName?t=n:t.appendChild(n);else{if(!ke&&!Ce&&!xe&&-1===e.indexOf("<"))return Q&&Te?Q.createHTML(e):e;if(t=lt(e),!t)return ke?null:Te?K:""}t&&Ee&&it(t.firstChild);const c=ct(Pe?e:t);for(;s=c.nextNode();)dt(s)||(s.content instanceof l&>(s.content),mt(s));if(Pe)return e;if(ke){if(Re)for(i=ee.call(t.ownerDocument);t.firstChild;)i.appendChild(t.firstChild);else i=t;return(he.shadowroot||he.shadowrootmode)&&(i=ne.call(o,i,!0)),i}let u=xe?t.outerHTML:t.innerHTML;return xe&&de["!doctype"]&&t.ownerDocument&&t.ownerDocument.doctype&&t.ownerDocument.doctype.name&&b(W,t.ownerDocument.doctype.name)&&(u="\n"+u),Ce&&(u=g(u,oe," "),u=g(u,se," "),u=g(u,ie," ")),Q&&Te?Q.createHTML(u):u},r.setConfig=function(e){et(e),Se=!0},r.clearConfig=function(){Ke=null,Se=!1},r.isValidAttribute=function(e,t,n){Ke||et({});const r=Qe(e),o=Qe(t);return ft(r,o,n)},r.addHook=function(e,t){"function"==typeof t&&(re[e]=re[e]||[],d(re[e],t))},r.removeHook=function(e){if(re[e])return p(re[e])},r.removeHooks=function(e){re[e]&&(re[e]=[])},r.removeAllHooks=function(){re={}},r}()}()},286:function(e,t){var n,r;n=function e(){"use strict";var t="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==t?t:{},n=!t.document&&!!t.postMessage,r=t.IS_PAPA_WORKER||!1,o={},s=0,i={parse:function(n,r){var a=(r=r||{}).dynamicTyping||!1;if(A(a)&&(r.dynamicTypingFunction=a,a={}),r.dynamicTyping=a,r.transform=!!A(r.transform)&&r.transform,r.worker&&i.WORKERS_SUPPORTED){var l=function(){if(!i.WORKERS_SUPPORTED)return!1;var n,r,a=(n=t.URL||t.webkitURL||null,r=e.toString(),i.BLOB_URL||(i.BLOB_URL=n.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",r,")();"],{type:"text/javascript"})))),l=new t.Worker(a);return l.onmessage=g,l.id=s++,o[l.id]=l}();return l.userStep=r.step,l.userChunk=r.chunk,l.userComplete=r.complete,l.userError=r.error,r.step=A(r.step),r.chunk=A(r.chunk),r.complete=A(r.complete),r.error=A(r.error),delete r.worker,void l.postMessage({input:n,config:r,workerId:l.id})}var f=null;return i.NODE_STREAM_INPUT,"string"==typeof n?(n=function(e){return 65279===e.charCodeAt(0)?e.slice(1):e}(n),f=r.download?new c(r):new p(r)):!0===n.readable&&A(n.read)&&A(n.on)?f=new d(r):(t.File&&n instanceof File||n instanceof Object)&&(f=new u(r)),f.stream(n)},unparse:function(e,t){var n=!1,r=!0,o=",",s="\r\n",a='"',l=a+a,c=!1,u=null,p=!1;!function(){if("object"==typeof t){if("string"!=typeof t.delimiter||i.BAD_DELIMITERS.filter((function(e){return-1!==t.delimiter.indexOf(e)})).length||(o=t.delimiter),("boolean"==typeof t.quotes||"function"==typeof t.quotes||Array.isArray(t.quotes))&&(n=t.quotes),"boolean"!=typeof t.skipEmptyLines&&"string"!=typeof t.skipEmptyLines||(c=t.skipEmptyLines),"string"==typeof t.newline&&(s=t.newline),"string"==typeof t.quoteChar&&(a=t.quoteChar),"boolean"==typeof t.header&&(r=t.header),Array.isArray(t.columns)){if(0===t.columns.length)throw new Error("Option columns is empty");u=t.columns}void 0!==t.escapeChar&&(l=t.escapeChar+a),("boolean"==typeof t.escapeFormulae||t.escapeFormulae instanceof RegExp)&&(p=t.escapeFormulae instanceof RegExp?t.escapeFormulae:/^[=+\-@\t\r].*$/)}}();var d=new RegExp(h(a),"g");if("string"==typeof e&&(e=JSON.parse(e)),Array.isArray(e)){if(!e.length||Array.isArray(e[0]))return f(null,e,c);if("object"==typeof e[0])return f(u||Object.keys(e[0]),e,c)}else if("object"==typeof e)return"string"==typeof e.data&&(e.data=JSON.parse(e.data)),Array.isArray(e.data)&&(e.fields||(e.fields=e.meta&&e.meta.fields||u),e.fields||(e.fields=Array.isArray(e.data[0])?e.fields:"object"==typeof e.data[0]?Object.keys(e.data[0]):[]),Array.isArray(e.data[0])||"object"==typeof e.data[0]||(e.data=[e.data])),f(e.fields||[],e.data||[],c);throw new Error("Unable to serialize unrecognized input");function f(e,t,n){var i="";"string"==typeof e&&(e=JSON.parse(e)),"string"==typeof t&&(t=JSON.parse(t));var a=Array.isArray(e)&&0=this._config.preview;if(r)t.postMessage({results:a,workerId:i.WORKER_ID,finished:c});else if(A(this._config.chunk)&&!n){if(this._config.chunk(a,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);a=void 0,this._completeResults=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(a.data),this._completeResults.errors=this._completeResults.errors.concat(a.errors),this._completeResults.meta=a.meta),this._completed||!c||!A(this._config.complete)||a&&a.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),c||a&&a.meta.paused||this._nextChunk(),a}this._halted=!0},this._sendError=function(e){A(this._config.error)?this._config.error(e):r&&this._config.error&&t.postMessage({workerId:i.WORKER_ID,error:e,finished:!1})}}function c(e){var t;(e=e||{}).chunkSize||(e.chunkSize=i.RemoteChunkSize),l.call(this,e),this._nextChunk=n?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(e){this._input=e,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(t=new XMLHttpRequest,this._config.withCredentials&&(t.withCredentials=this._config.withCredentials),n||(t.onload=_(this._chunkLoaded,this),t.onerror=_(this._chunkError,this)),t.open(this._config.downloadRequestBody?"POST":"GET",this._input,!n),this._config.downloadRequestHeaders){var e=this._config.downloadRequestHeaders;for(var r in e)t.setRequestHeader(r,e[r])}if(this._config.chunkSize){var o=this._start+this._config.chunkSize-1;t.setRequestHeader("Range","bytes="+this._start+"-"+o)}try{t.send(this._config.downloadRequestBody)}catch(e){this._chunkError(e.message)}n&&0===t.status&&this._chunkError()}},this._chunkLoaded=function(){4===t.readyState&&(t.status<200||400<=t.status?this._chunkError():(this._start+=this._config.chunkSize?this._config.chunkSize:t.responseText.length,this._finished=!this._config.chunkSize||this._start>=function(e){var t=e.getResponseHeader("Content-Range");return null===t?-1:parseInt(t.substring(t.lastIndexOf("/")+1))}(t),this.parseChunk(t.responseText)))},this._chunkError=function(e){var n=t.statusText||e;this._sendError(new Error(n))}}function u(e){var t,n;(e=e||{}).chunkSize||(e.chunkSize=i.LocalChunkSize),l.call(this,e);var r="undefined"!=typeof FileReader;this.stream=function(e){this._input=e,n=e.slice||e.webkitSlice||e.mozSlice,r?((t=new FileReader).onload=_(this._chunkLoaded,this),t.onerror=_(this._chunkError,this)):t=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount=this._input.size,this.parseChunk(e.target.result)},this._chunkError=function(){this._sendError(t.error)}}function p(e){var t;l.call(this,e=e||{}),this.stream=function(e){return t=e,this._nextChunk()},this._nextChunk=function(){if(!this._finished){var e,n=this._config.chunkSize;return n?(e=t.substring(0,n),t=t.substring(n)):(e=t,t=""),this._finished=!t,this.parseChunk(e)}}}function d(e){l.call(this,e=e||{});var t=[],n=!0,r=!1;this.pause=function(){l.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){l.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(e){this._input=e,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){r&&1===t.length&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),t.length?this.parseChunk(t.shift()):n=!0},this._streamData=_((function(e){try{t.push("string"==typeof e?e:e.toString(this._config.encoding)),n&&(n=!1,this._checkIsFinished(),this.parseChunk(t.shift()))}catch(e){this._streamError(e)}}),this),this._streamError=_((function(e){this._streamCleanUp(),this._sendError(e)}),this),this._streamEnd=_((function(){this._streamCleanUp(),r=!0,this._streamData("")}),this),this._streamCleanUp=_((function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)}),this)}function f(e){var t,n,r,o=Math.pow(2,53),s=-o,a=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,l=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,c=this,u=0,p=0,d=!1,f=!1,g=[],y={data:[],errors:[],meta:{}};if(A(e.step)){var v=e.step;e.step=function(t){if(y=t,C())w();else{if(w(),0===y.data.length)return;u+=t.data.length,e.preview&&u>e.preview?n.abort():(y.data=y.data[0],v(y,c))}}}function _(t){return"greedy"===e.skipEmptyLines?""===t.join("").trim():1===t.length&&0===t[0].length}function w(){return y&&r&&(S("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+i.DefaultDelimiter+"'"),r=!1),e.skipEmptyLines&&(y.data=y.data.filter((function(e){return!_(e)}))),C()&&function(){if(y)if(Array.isArray(y.data[0])){for(var t=0;C()&&t=g.length?"__parsed_extra":g[r]),e.transform&&(i=e.transform(i,s)),i=x(s,i),"__parsed_extra"===s?(o[s]=o[s]||[],o[s].push(i)):o[s]=i}return e.header&&(r>g.length?S("FieldMismatch","TooManyFields","Too many fields: expected "+g.length+" fields but parsed "+r,p+n):r=r.length/2?"\r\n":"\r"}(o,l)),r=!1,e.delimiter)A(e.delimiter)&&(e.delimiter=e.delimiter(o),y.meta.delimiter=e.delimiter);else{var c=function(t,n,r,o,s){var a,l,c,u;s=s||[",","\t","|",";",i.RECORD_SEP,i.UNIT_SEP];for(var p=0;p=a)return G(!0)}else for(B=u,u++;;){if(-1===(B=i.indexOf(t,B+1)))return f||w.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:_.length,index:u}),H();if(B===m-1)return H(i.substring(u,B).replace(M,t));if(t!==c||i[B+1]!==c){if(t===c||0===B||i[B-1]!==c){-1!==D&&D=a)return G(!0);break}w.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:_.length,index:u}),B++}}else B++}return H();function q(e){_.push(e),x=u}function $(e){var t=0;if(-1!==e){var n=i.substring(B+1,e);n&&""===n.trim()&&(t=n.length)}return t}function H(e){return f||(void 0===e&&(e=i.substring(u)),C.push(e),u=m,q(C),b&&Y()),G()}function W(e){u=e,q(C),C=[],U=i.indexOf(r,u)}function G(e){return{data:_,errors:w,meta:{delimiter:n,linebreak:r,aborted:p,truncated:!!e,cursor:x+(d||0)}}}function Y(){s(G()),_=[],w=[]}},this.abort=function(){p=!0},this.getCharIndex=function(){return u}}function g(e){var t=e.data,n=o[t.workerId],r=!1;if(t.error)n.userError(t.error,t.file);else if(t.results&&t.results.data){var s={abort:function(){r=!0,y(t.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:v,resume:v};if(A(n.userStep)){for(var i=0;i{"use strict";var r=n(586);function o(){}function s(){}s.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,s,i){if(i!==r){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:s,resetWarningCache:o};return n.PropTypes=n,n}},980:(e,t,n)=>{e.exports=n(262)()},586:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},837:(e,t,n)=>{"use strict";var r=n(196),o=Symbol.for("react.element"),s=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,a=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,n){var r,s={},c=null,u=null;for(r in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)i.call(t,r)&&!l.hasOwnProperty(r)&&(s[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===s[r]&&(s[r]=t[r]);return{$$typeof:o,type:e,key:c,ref:u,props:s,_owner:a.current}}t.Fragment=s,t.jsx=c,t.jsxs=c},322:(e,t,n)=>{"use strict";e.exports=n(837)},665:e=>{e.exports=function(e,t,n,r){var o=n?n.call(r,e,t):void 0;if(void 0!==o)return!!o;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var s=Object.keys(e),i=Object.keys(t);if(s.length!==i.length)return!1;for(var a=Object.prototype.hasOwnProperty.bind(t),l=0;l{"use strict";var t=[];function n(e){for(var n=-1,r=0;r{"use strict";var t={};e.exports=function(e,n){var r=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(n)}},173:e=>{"use strict";e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},892:(e,t,n)=>{"use strict";e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},36:e=>{"use strict";e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var r="";n.supports&&(r+="@supports (".concat(n.supports,") {")),n.media&&(r+="@media ".concat(n.media," {"));var o=void 0!==n.layer;o&&(r+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),r+=n.css,o&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}");var s=n.sourceMap;s&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(s))))," */")),t.styleTagTransform(r,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},464:e=>{"use strict";e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},196:e=>{"use strict";e.exports=window.React}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var s=t[r]={id:r,exports:{}};return e[r].call(s.exports,s,s.exports,n),s.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nc=void 0;var r={};return(()=>{"use strict";n.r(r),n.d(r,{AudioPicker:()=>$t,CSVUploader:()=>Jt,Checkboxes:()=>Gt,ImagePicker:()=>nn,MediaPicker:()=>cn,PostPicker:()=>sr,PostSelector:()=>ar,SafeHtml:()=>fn,Selector:()=>br,TermSelector:()=>Ar,VideoPicker:()=>Sr,getMediaUrl:()=>Kt,parseCSVFile:()=>Qt,useDebounce:()=>gn,useHasInnerBlocks:()=>yn,useInnerBlocks:()=>bn,useInnerBlocksAttributes:()=>_n,useInnerBlocksCount:()=>An,useInnerBlocksIndex:()=>vn,useMedia:()=>wn,useParentBlock:()=>Cn,useParentBlockAttributes:()=>xn,usePost:()=>Sn,usePostById:()=>Rn,usePostMeta:()=>Nn,usePostMetaValue:()=>On,usePosts:()=>Pn,useTerms:()=>Ln});var e=n(322),t=n(980),o=n.n(t),s=function(){return s=Object.assign||function(e){for(var t,n=1,r=arguments.length;n2||G(U)>3?"":" "}function Z(e,t){for(;--t&&q()&&!(U<48||U>102||U>57&&U<65||U>70&&U<97););return W(e,H()+(t<6&&32==$()&&32==q()))}function Q(e){for(;q();)switch(U){case e:return D;case 34:case 39:34!==e&&39!==e&&Q(U);break;case 40:41===e&&Q(e);break;case 92:q()}return D}function K(e,t){for(;q()&&e+U!==57&&(e+U!==84||47!==$()););return"/*"+W(t,D-1)+"*"+A(47===e?e:q())}function J(e){for(;!G($());)q();return W(e,D)}function X(e,t){for(var n="",r=0;r6)switch(k(e,t+1)){case 109:if(45!==k(e,t+4))break;case 102:return S(e,/(.+:)(.+)-([^]+)/,"$1"+f+"$2-$3$1"+d+(108==k(e,t+3)?"$3":"$2-$3"))+e;case 115:return~E(e,"stretch")?te(S(e,"stretch","fill-available"),t,n)+e:e}break;case 5152:case 5920:return S(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,(function(t,n,r,o,s,i,a){return p+n+":"+r+a+(o?p+n+"-span:"+(s?i:+i-+r)+a:"")+e}));case 4949:if(121===k(e,t+6))return S(e,":",":"+f)+e;break;case 6444:switch(k(e,45===k(e,14)?18:11)){case 120:return S(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+f+(45===k(e,14)?"inline-":"")+"box$3$1"+f+"$2$3$1"+p+"$2box$3")+e;case 100:return S(e,":",":"+p)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return S(e,"scroll-","scroll-snap-")+e}return e}function ne(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case g:return void(e.return=te(e.value,e.length,n));case v:return X([F(e,{value:S(e.value,"@","@"+f)})],r);case m:if(e.length)return function(e,t){return e.map(t).join("")}(n=e.props,(function(t){switch(x(t,r=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":z(F(e,{props:[S(t,/:(read-\w+)/,":"+d+"$1")]})),z(F(e,{props:[t]})),w(e,{props:O(n,r)});break;case"::placeholder":z(F(e,{props:[S(t,/:(plac\w+)/,":"+f+"input-$1")]})),z(F(e,{props:[S(t,/:(plac\w+)/,":"+d+"$1")]})),z(F(e,{props:[S(t,/:(plac\w+)/,p+"input-$1")]})),z(F(e,{props:[t]})),w(e,{props:O(n,r)})}return""}))}}function re(e){return function(e){return M="",e}(oe("",null,null,null,[""],e=function(e){return P=L=1,j=T(M=e),D=0,[]}(e),0,[0],e))}function oe(e,t,n,r,o,s,i,a,l){for(var c=0,u=0,p=i,d=0,f=0,h=0,m=1,g=1,y=1,v=0,b="",_=o,w=s,C=r,x=b;g;)switch(h=v,v=q()){case 40:if(108!=h&&58==k(x,p-1)){-1!=E(x+=S(Y(v),"&","&\f"),"&\f")&&(y=-1);break}case 34:case 39:case 91:x+=Y(v);break;case 9:case 10:case 13:case 32:x+=V(h);break;case 92:x+=Z(H()-1,7);continue;case 47:switch($()){case 42:case 47:N(ie(K(q(),H()),t,n,l),l);break;default:x+="/"}break;case 123*m:a[c++]=T(x)*y;case 125*m:case 59:case 0:switch(v){case 0:case 125:g=0;case 59+u:-1==y&&(x=S(x,/\f/g,"")),f>0&&T(x)-p&&N(f>32?ae(x+";",r,n,p-1,l):ae(S(x," ","")+";",r,n,p-2,l),l);break;case 59:x+=";";default:if(N(C=se(x,t,n,c,u,o,a,b,_=[],w=[],p,s),s),123===v)if(0===u)oe(x,t,C,C,_,s,p,a,w);else switch(99===d&&110===k(x,3)?100:d){case 100:case 108:case 109:case 115:oe(e,C,C,r&&N(se(e,C,C,0,0,o,a,b,o,_=[],p,w),w),o,w,p,a,r?_:w);break;default:oe(x,C,C,C,[""],w,0,a,w)}}c=u=f=0,m=y=1,b=x="",p=i;break;case 58:p=1+T(x),f=h;default:if(m<1)if(123==v)--m;else if(125==v&&0==m++&&125==(U=D>0?k(M,--D):0,L--,10===U&&(L=1,P--),U))continue;switch(x+=A(v),v*m){case 38:y=u>0?1:(x+="\f",-1);break;case 44:a[c++]=(T(x)-1)*y,y=1;break;case 64:45===$()&&(x+=Y(q())),d=$(),u=p=T(b=x+=J(H())),v++;break;case 45:45===h&&2==T(x)&&(m=0)}}return s}function se(e,t,n,r,o,s,i,a,l,c,u,p){for(var d=o-1,f=0===o?s:[""],h=I(f),g=0,y=0,v=0;g0?f[b]+" "+A:S(A,/&\f/g,f[b])))&&(l[v++]=w);return B(e,t,n,0===o?m:a,l,c,u,p)}function ie(e,t,n,r){return B(e,t,n,h,A(U),R(e,2,-2),0,r)}function ae(e,t,n,r,o){return B(e,t,n,g,R(e,0,r),R(e,r+1,-1),r,o)}const le={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};var ce="undefined"!=typeof process&&void 0!==process.env&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",ue="undefined"!=typeof window&&"HTMLElement"in window,pe=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env&&void 0!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&""!==process.env.REACT_APP_SC_DISABLE_SPEEDY?"false"!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&process.env.REACT_APP_SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env&&void 0!==process.env.SC_DISABLE_SPEEDY&&""!==process.env.SC_DISABLE_SPEEDY&&"false"!==process.env.SC_DISABLE_SPEEDY&&process.env.SC_DISABLE_SPEEDY),de=(new Set,Object.freeze([])),fe=Object.freeze({}),he=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),me=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,ge=/(^-|-$)/g;function ye(e){return e.replace(me,"-").replace(ge,"")}var ve=/(a)(d)/gi,be=function(e){return String.fromCharCode(e+(e>25?39:97))};function _e(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=be(t%52)+n;return(be(t%52)+n).replace(ve,"$1-$2")}var Ae,we=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},Ce=function(e){return we(5381,e)};function xe(e){return"string"==typeof e&&!0}var Se="function"==typeof Symbol&&Symbol.for,Ee=Se?Symbol.for("react.memo"):60115,ke=Se?Symbol.for("react.forward_ref"):60112,Re={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},Te={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Ie={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Ne=((Ae={})[ke]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Ae[Ee]=Ie,Ae);function Oe(e){return("type"in(t=e)&&t.type.$$typeof)===Ee?Ie:"$$typeof"in e?Ne[e.$$typeof]:Re;var t}var Pe=Object.defineProperty,Le=Object.getOwnPropertyNames,je=Object.getOwnPropertySymbols,De=Object.getOwnPropertyDescriptor,Ue=Object.getPrototypeOf,Me=Object.prototype;function Be(e,t,n){if("string"!=typeof t){if(Me){var r=Ue(t);r&&r!==Me&&Be(e,r,n)}var o=Le(t);je&&(o=o.concat(je(t)));for(var s=Oe(e),i=Oe(t),a=0;a0?" Args: ".concat(t.join(", ")):""))}var Ve=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}return e.prototype.indexOfGroup=function(e){for(var t=0,n=0;n=this.groupSizes.length){for(var n=this.groupSizes,r=n.length,o=r;e>=o;)if((o<<=1)<0)throw Ye(16,"".concat(e));this.groupSizes=new Uint32Array(o),this.groupSizes.set(n),this.length=o;for(var s=r;s=this.length||0===this.groupSizes[e])return t;for(var n=this.groupSizes[e],r=this.indexOfGroup(e),o=r+n,s=r;s=0){var n=document.createTextNode(t);return this.element.insertBefore(n,this.nodes[e]||null),this.length++,!0}return!1},e.prototype.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},e.prototype.getRule=function(e){return e0&&(l+="".concat(e,","))})),r+="".concat(i).concat(a,'{content:"').concat(l,'"}').concat("/*!sc*/\n")},s=0;s0?".".concat(t):e},u=l.slice();u.push((function(e){e.type===m&&e.value.includes("&")&&(e.props[0]=e.props[0].replace(dt,n).replace(r,c))})),i.prefix&&u.push(ne),u.push(ee);var p=function(e,o,s,a){void 0===o&&(o=""),void 0===s&&(s=""),void 0===a&&(a="&"),t=a,n=o,r=new RegExp("\\".concat(n,"\\b"),"g");var l=e.replace(ft,""),c=re(s||o?"".concat(s," ").concat(o," { ").concat(l," }"):l);i.namespace&&(c=ht(c,i.namespace));var p,d,f,h=[];return X(c,(p=u.concat((f=function(e){return h.push(e)},function(e){e.root||(e=e.return)&&f(e)})),d=I(p),function(e,t,n,r){for(var o="",s=0;s="A"&&e<="Z"};function xt(e){for(var t="",n=0;n>>0);if(!t.hasNameForId(this.componentId,s)){var i=n(o,".".concat(s),void 0,this.componentId);t.insertRules(this.componentId,s,i)}r=qe(r,s),this.staticRulesId=s}else{for(var a=we(this.baseHash,n.hash),l="",c=0;c>>0);t.hasNameForId(this.componentId,d)||t.insertRules(this.componentId,d,n(l,".".concat(d),void 0,this.componentId)),r=qe(r,d)}}return r},e}(),Nt=l().createContext(void 0);Nt.Consumer;var Ot={};function Pt(e,t,n){var r=ze(e),o=e,i=!xe(e),c=t.attrs,u=void 0===c?de:c,p=t.componentId,d=void 0===p?function(e,t){var n="string"!=typeof e?"sc":ye(e);Ot[n]=(Ot[n]||0)+1;var r="".concat(n,"-").concat(function(e){return _e(Ce(e)>>>0)}("6.0.5"+n+Ot[n]));return t?"".concat(t,"-").concat(r):r}(t.displayName,t.parentComponentId):p,f=(void 0===t.displayName&&function(e){xe(e)?"styled.".concat(e):"Styled(".concat(function(e){return e.displayName||e.name||"Component"}(e),")")}(e),t.displayName&&t.componentId?"".concat(ye(t.displayName),"-").concat(t.componentId):t.componentId||d),h=r&&o.attrs?o.attrs.concat(u).filter(Boolean):u,m=t.shouldForwardProp;if(r&&o.shouldForwardProp){var g=o.shouldForwardProp;if(t.shouldForwardProp){var y=t.shouldForwardProp;m=function(e,t){return g(e,t)&&y(e,t)}}else m=g}var v=new It(n,f,r?o.componentStyle:void 0),b=l().forwardRef((function(e,t){return function(e,t,n){var r=e.attrs,o=e.componentStyle,i=e.defaultProps,c=e.foldedComponentIds,u=e.styledComponentId,p=e.target,d=l().useContext(Nt),f=_t(),h=e.shouldForwardProp||f.shouldForwardProp,m=function(e,t,n){for(var r,o=s(s({},t),{className:void 0,theme:n}),i=0;i2&&pt.registerId(this.componentId+e),this.removeStyles(e,n),this.createStyles(e,t,n,r)}}(),function(){function e(){var e=this;this._emitSheetCSS=function(){var t=e.instance.toString(),n=ot(),r=$e([n&&'nonce="'.concat(n,'"'),"".concat(ce,'="true"'),"".concat("data-styled-version",'="').concat("6.0.5",'"')].filter(Boolean)," ");return"")},this.getStyleTags=function(){if(e.sealed)throw Ye(2);return e._emitSheetCSS()},this.getStyleElement=function(){var t;if(e.sealed)throw Ye(2);var n=((t={})[ce]="",t["data-styled-version"]="6.0.5",t.dangerouslySetInnerHTML={__html:e.instance.toString()},t),r=ot();return r&&(n.nonce=r),[l().createElement("style",s({},n,{key:"sc-0-0"}))]},this.seal=function(){e.sealed=!0},this.instance=new pt({isServer:!0}),this.sealed=!1}e.prototype.collectStyles=function(e){if(this.sealed)throw Ye(2);return l().createElement(At,{sheet:this.instance},e)},e.prototype.interleaveWithNodeStream=function(e){throw Ye(3)}}(),"__sc-".concat(ce,"__");const Ft=Bt.div` + height: auto; + width: 100%; +`,zt=({src:t})=>(0,e.jsx)(Ft,{children:(0,e.jsx)("audio",{className:"edit-audio-preview",controls:!0,src:t})});zt.propTypes={src:o().string.isRequired};const qt=({className:t,onReset:n,onUpdate:r,onUpdateURL:o,value:s,valueURL:i})=>(0,e.jsx)(cn,{allowedTypes:["audio"],className:t,icon:"format-audio",onReset:n,onUpdate:r,onUpdateURL:o,preview:zt,value:s,valueURL:i});qt.defaultProps={className:"",onUpdateURL:null,valueURL:""},qt.propTypes={className:o().string,onReset:o().func.isRequired,onUpdate:o().func.isRequired,onUpdateURL:o().func,value:o().number.isRequired,valueURL:o().string};const $t=qt,Ht=window.wp.components,Wt=({label:t,value:n,options:r,onChange:o})=>(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Ht.BaseControl,{label:t}),r.map((t=>(0,e.jsx)(Ht.CheckboxControl,{label:t.label,checked:n.includes(t.value),onChange:e=>{o(e?[...n,t.value]:[...n.filter((e=>e!==t.value))])}})))]});Wt.propTypes={label:o().string.isRequired,value:o().arrayOf(o().string).isRequired,options:o().arrayOf(o().shape({label:o().string.isRequired,value:o().string.isRequired})).isRequired,onChange:o().func.isRequired};const Gt=Wt,Yt=window.wp.i18n;var Vt=n(286),Zt=n.n(Vt);const Qt=e=>new Promise(((t,n)=>{Zt().parse(e,{complete:e=>t(e.data),dynamicTyping:!0,error:e=>n(e),header:!0,skipEmptyLines:!0})})),Kt=(e,t="full")=>{const{media_details:{sizes:{[t]:{source_url:n=""}={},full:{source_url:r=""}={}}={}}={},sizes:{[t]:{url:o=""}={},full:{url:s=""}={}}={},source_url:i="",url:a=""}=e;return o||n||s||r||a||i||""};class Jt extends l().PureComponent{static handleSubmit(e){e.preventDefault()}constructor(e){super(e),this.handleChange=this.handleChange.bind(this),this.state={error:"",success:""}}handleChange(e){const{attributeName:t,callback:n,setAttributes:r}=this.props;e.target.files&&e.target.files[0]&&Qt(e.target.files[0]).then((e=>n?n(e):e)).then((e=>{Array.isArray(e)&&e.length>0?(this.setState({error:"",success:(0,Yt.__)("Successfully read CSV data.","alley-scripts")}),r({[t]:JSON.stringify(e)})):this.setState({error:(0,Yt.__)("Could not map CSV data. Please check the source file to ensure that it has the correct structure.","alley-scripts"),success:""})})).catch((e=>{this.setState({error:e,success:""})}))}render(){const{error:t="",success:n=""}=this.state;return(0,e.jsxs)("div",{className:"alley-scripts-block-csv-uploader",children:[(0,e.jsx)("h2",{children:(0,Yt.__)("Upload CSV","alley-scripts")}),(0,e.jsxs)("form",{onSubmit:this.handleSubmit,children:[""!==t?(0,e.jsxs)("div",{style:{color:"#c00"},children:[(0,e.jsx)("strong",{children:(0,Yt.__)("Error:","alley-scripts")})," ",t]}):null,""!==n?(0,e.jsxs)("div",{style:{color:"#0c0"},children:[(0,e.jsx)("strong",{children:(0,Yt.__)("Success:","alley-scripts")})," ",n]}):null,(0,e.jsx)("div",{children:(0,e.jsxs)("label",{htmlFor:"alley-scripts-block-csv-uploader-file",children:[(0,e.jsx)("p",{children:(0,Yt.__)("Select a file to load data.","alley-scripts")}),(0,e.jsx)("input",{id:"alley-scripts-block-csv-uploader-file",onChange:this.handleChange,type:"file"})]})})]})]})}}Jt.defaultProps={callback:null},Jt.propTypes={attributeName:o().string.isRequired,callback:o().func,setAttributes:o().func.isRequired};const Xt=Bt.div` + box-sizing: border-box; + flex-shrink: 0; + height: auto; + max-height: 1450px; + max-width: 1450px; + min-height: 20px; + min-width: 20px; + position: relative; + width: auto; +`,en=({src:t})=>(0,e.jsx)(Xt,{children:(0,e.jsx)("img",{alt:(0,Yt.__)("Edit image","alley-scripts"),className:"edit-image-preview",src:t,title:(0,Yt.__)("Edit image","alley-scripts")})});en.propTypes={src:o().string.isRequired};const tn=({className:t,imageSize:n,displayControlsInToolbar:r,onReset:o,onUpdate:s,onUpdateURL:i,value:a,valueURL:l})=>(0,e.jsx)(cn,{allowedTypes:["image"],className:t,icon:"format-image",imageSize:n,displayControlsInToolbar:r,onReset:o,onUpdate:s,onUpdateURL:i,preview:en,value:a,valueURL:l});tn.defaultProps={className:"",imageSize:"thumbnail",displayControlsInToolbar:!1,onUpdateURL:null,valueURL:""},tn.propTypes={className:o().string,imageSize:o().string,displayControlsInToolbar:o().bool,onReset:o().func.isRequired,onUpdate:o().func.isRequired,onUpdateURL:o().func,value:o().number.isRequired,valueURL:o().string};const nn=tn,rn=window.wp.blockEditor,on=window.wp.data,sn=Bt.div` + display: block; + position: relative; +`,an=Bt.div` + background: white; + border: 1px solid black; + padding: 1em; +`,ln=({allowedTypes:t,className:n,icon:r,imageSize:o,displayControlsInToolbar:s,onReset:i,onUpdate:a,onUpdateURL:l,preview:c,value:u,valueURL:p})=>{const{media:d}=(0,on.useSelect)((e=>({media:u?e("core").getMedia(u):void 0})),[u]);if(0!==u&&null===d)return(0,e.jsx)(Ht.Spinner,{});const f=d?Kt(d,o):p;return f?(0,e.jsxs)(sn,{className:n,children:[c?(0,e.jsx)(c,{src:f}):(0,e.jsxs)(an,{className:"alley-scripts-media-picker__preview",children:[(0,e.jsx)("p",{children:(0,Yt.__)("Selected file:","alley-scripts")}),(0,e.jsx)("p",{children:(0,e.jsx)("a",{href:f,children:f})})]}),s?(0,e.jsx)(rn.BlockControls,{group:"other",children:(0,e.jsx)(rn.MediaReplaceFlow,{name:(0,Yt.__)("Edit Media","alley-scripts"),mediaId:u,mediaURL:f,allowedTypes:t,onSelect:a,onSelectURL:l,children:(0,e.jsx)(Ht.ToolbarButton,{isDestructive:!0,text:(0,Yt.__)("Remove","alley-scripts"),onClick:i})})}):(0,e.jsx)(Ht.Button,{variant:"primary",onClick:i,children:(0,Yt.__)("Reset","alley-scripts")})]}):(0,e.jsx)(sn,{className:n,children:(0,e.jsx)(rn.MediaPlaceholder,{allowedTypes:t,disableMediaButtons:!!p,icon:(0,e.jsx)(rn.BlockIcon,{icon:r}),onSelect:a,onSelectURL:l,value:{id:u,src:f}})})};ln.defaultProps={allowedTypes:[],className:"",icon:"format-aside",imageSize:"thumbnail",displayControlsInToolbar:!1,onUpdateURL:null,preview:null,valueURL:""},ln.propTypes={allowedTypes:o().arrayOf(o().string),className:o().string,icon:o().string,imageSize:o().string,displayControlsInToolbar:o().bool,onReset:o().func.isRequired,onUpdate:o().func.isRequired,onUpdateURL:o().func,preview:o().element,value:o().number.isRequired,valueURL:o().string};const cn=ln;var un=n(368),pn=n.n(un);const dn=({className:t,html:n,tag:r})=>(0,e.jsx)(r,{className:t,dangerouslySetInnerHTML:{__html:pn().sanitize(n)}});dn.defaultProps={className:""},dn.propTypes={className:o().string,html:o().string.isRequired,tag:o().string.isRequired};const fn=dn,hn=window.wp.element,mn=window.wp.url,gn=(e,t)=>{const[n,r]=(0,hn.useState)(e);return(0,hn.useEffect)((()=>{const n=setTimeout((()=>{r(e)}),t);return()=>{clearTimeout(n)}}),[e,t]),n},yn=e=>An(e)>0,vn=e=>{const t=Cn(e),n=bn(t);return n?n.findIndex((t=>t.clientId===e)):-1},bn=e=>(0,on.useSelect)((t=>t(rn.store).getBlocks(e)),[e]),_n=e=>bn(e).map((e=>e.attributes)),An=e=>bn(e).length,wn=e=>(0,on.useSelect)((t=>t("core").getMedia(e)),[e]),Cn=e=>(0,on.useSelect)((t=>{const{getBlock:n,getBlockRootClientId:r}=t(rn.store),o=r(e);return o?n(o):null}),[e]),xn=e=>(0,on.useSelect)((t=>{const{getBlockAttributes:n,getBlockRootClientId:r}=t(rn.store),o=r(e);return o?n(o):null}),[e]),Sn=(e,t="post")=>(0,on.useSelect)((n=>n("core").getEntityRecord("postType",t,e)),[e,t]),En=window.wp.apiFetch;var kn=n.n(En);const Rn=(e,t=null)=>{const[n,r]=(0,hn.useState)({});return(0,hn.useEffect)((()=>{e&&!n[e]&&(async()=>{if(t){const n=await t(e);n?r((t=>({...t,[e]:n}))):console.error(`Custom function to get post with ID ${e} failed.`)}else{const t=(0,mn.addQueryArgs)("/wp/v2/search",{include:e}),n=await kn()({path:t});r((t=>({...t,[e]:n[0].subtype})))}})()}),[e]),Sn(e,n[e]??"")},Tn=window.wp.coreData,In=window.lodash,Nn=(e=null,t=null)=>{const n=(0,on.useSelect)((t=>e||t("core/editor").getCurrentPostType()),[]),[r,o]=(0,Tn.useEntityProp)("postType",n,"meta",t),s="function"==typeof o?o:()=>console.error(`Error attempting to set post meta for post type ${n}. Does it have support for custom-fields?`);return["object"==typeof r?r:{},e=>s((0,In.cloneDeep)(e))]},On=(e,t=null,n=null)=>{const[r,o]=Nn(t,n);return[r[e],t=>o({...r,[e]:t})]},Pn=(e,t="post")=>(0,on.useSelect)((n=>{const{getEntityRecords:r}=n("core");return r("postType",t,{include:e})}),[e,t]),Ln=(e=null,t=null,n="categories")=>{const r=(0,on.useSelect)((t=>e||t("core/editor").getCurrentPostType()),[]),[o,s]=(0,Tn.useEntityProp)("postType",r,n,t);return[o,e=>s(e)]};var jn=n(62),Dn=n.n(jn),Un=n(36),Mn=n.n(Un),Bn=n(793),Fn=n.n(Bn),zn=n(892),qn=n.n(zn),$n=n(173),Hn=n.n($n),Wn=n(464),Gn=n.n(Wn),Yn=n(992),Vn={};Vn.styleTagTransform=Gn(),Vn.setAttributes=qn(),Vn.insert=Fn().bind(null,"head"),Vn.domAPI=Mn(),Vn.insertStyleElement=Hn(),Dn()(Yn.Z,Vn),Yn.Z&&Yn.Z.locals&&Yn.Z.locals;var Zn=n(779),Qn=n.n(Zn),Kn=n(905),Jn={};Jn.styleTagTransform=Gn(),Jn.setAttributes=qn(),Jn.insert=Fn().bind(null,"head"),Jn.domAPI=Mn(),Jn.insertStyleElement=Hn(),Dn()(Kn.Z,Jn),Kn.Z&&Kn.Z.locals&&Kn.Z.locals;const Xn=Bt.div` + align-items: center; + gap: 4px; + overflow-wrap: anywhere; + display: flex; + flex-direction: column; + justify-content: center; + padding: 0.5rem 0.75rem; +`,er=({title:t,postType:n,attachmentID:r})=>{const o=wn(r),s=o?.media_details?.sizes?.thumbnail?.source_url,i=o?.alt_text??"";return(0,e.jsxs)(Xn,{children:[s?(0,e.jsx)("img",{style:{maxWidth:"100%",height:"auto"},loading:"lazy",src:s,alt:i}):null,(0,e.jsx)(fn,{html:t,className:"post-picker-result-title",tag:"strong"}),(0,Yt.sprintf)(" (%s)",n)]})},tr=({baseUrl:t,searchRender:n,selected:r,setSelected:o,suppressPostIds:s=[]})=>{const[i,a]=(0,hn.useState)(!1),[l,c]=(0,hn.useState)([]),[u,p]=(0,hn.useState)(!1),[d,f]=(0,hn.useState)(0),[h,m]=(0,hn.useState)({searchValue:"",page:1}),g=(0,hn.useCallback)((async(e,n=!1)=>{if(e.searchValue&&e.searchValue.length<=2)return;const r=function(){let n=(0,mn.addQueryArgs)(t,{page:e.page,_embed:1,exclude:s.join(",")});return e.searchValue&&e.searchValue.length>2&&(n=(0,mn.addQueryArgs)(n,{search:e.searchValue})),n}();a(!0);const o=await kn()({path:r,parse:!1});f(parseInt(o.headers.get("X-WP-TotalPages"),10));const i=await o.json();let u=i;e.page>1&&(u=[...l,...i]),n||(c(u),a(!1))}),[l,t,s]);return(0,hn.useEffect)((()=>{let e=!1;return u||(p(!0),g(h,e)),()=>{e=!0}}),[g,u,h]),(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Ht.TextControl,{value:h.searchValue,placeholder:(0,Yt.__)("Search...","alley-scripts"),label:(0,Yt.__)("Search","alley-scripts"),onChange:e=>{const t={...h,searchValue:e,page:1};m(t),g(t)}}),(0,e.jsxs)("div",{className:"alley-scripts-post-picker__post-list",children:[l?l.map((t=>(0,e.jsx)(Ht.Button,{className:Qn()({"alley-scripts-post-picker__post":!0,"is-selected":t.id===r}),onClick:()=>o(t.id),children:n?n(t):(0,e.jsx)(er,{title:t.title,postType:t.subtype,attachmentID:t?._embedded?.self[0]?.featured_media})},t.id))):null,i?(0,e.jsx)(Ht.Spinner,{}):null,d>0&&h.page{const e={...h,page:h.page+1};m(e),g(e)},children:(0,Yt.__)("Load More","alley-scripts")})}):null]})]})},nr=({baseUrl:t,closeModal:n,modalTitle:r,onUpdate:o,searchRender:s,suppressPostIds:i=[]})=>{const[a,l]=(0,hn.useState)();return(0,e.jsxs)(Ht.Modal,{isDismissible:!0,title:r,onRequestClose:n,closeButtonLabel:"Close",children:[(0,e.jsx)(tr,{baseUrl:t,selected:a??0,setSelected:l,searchRender:s,suppressPostIds:i}),(0,e.jsxs)("div",{className:"alley-scripts-post-picker__buttons",children:[(0,e.jsx)(Ht.Button,{variant:"secondary",onClick:n,children:(0,Yt.__)("Cancel","alley-scripts")}),(0,e.jsx)(Ht.Button,{variant:"primary",onClick:()=>{a&&(o(a),n())},disabled:!a,children:(0,Yt.__)("Select","alley-scripts")})]})]})},rr=Bt.div` + display: block; + position: relative; +`,or=Bt.div` + border: 1px solid #eee; + display: flex; + flex-direction: column; + margin: 5px 0; + padding: 0.5rem 0.75rem; + text-align: center; +`,sr=({allowedTypes:t,className:n,getPostType:r,modalTitle:o=(0,Yt.__)("Select Post","alley-scripts"),onReset:s,onUpdate:i,params:a={},previewRender:l,replaceText:c=(0,Yt.__)("Replace","alley-scripts"),resetText:u=(0,Yt.__)("Reset","alley-scripts"),searchEndpoint:p="/wp/v2/search",searchRender:d,selectText:f=(0,Yt.__)("Select","alley-scripts"),suppressPostIds:h=[],title:m="",value:g=0})=>{const[y,v]=(0,hn.useState)(!1),b=(0,mn.addQueryArgs)(p,{type:"post",subtype:t??"any",...a}),_=Rn(g,r),{featured_media:A,title:{rendered:w=""}={},type:C=""}=_||{},x=()=>{v(!0)};return 0!==g&&null===_?(0,e.jsx)(Ht.Spinner,{}):(0,e.jsxs)(rr,{className:n,children:[m?(0,e.jsx)("h4",{children:m}):null,0!==g&&null!==_?(0,e.jsxs)(e.Fragment,{children:[void 0!==l?l(_):(0,e.jsx)(or,{children:(0,e.jsx)(er,{title:w,postType:C,attachmentID:A})}),(0,e.jsxs)(Ht.ButtonGroup,{children:[(0,e.jsx)(Ht.Button,{variant:"secondary",onClick:s,style:{margin:"0 4px"},children:u}),(0,e.jsx)(Ht.Button,{variant:"secondary",onClick:x,style:{margin:"0 4px"},children:c})]})]}):(0,e.jsx)(Ht.Button,{onClick:x,variant:"secondary",children:f}),y?(0,e.jsx)(nr,{closeModal:()=>{v(!1)},baseUrl:b,modalTitle:o,onUpdate:i,searchRender:d,suppressPostIds:h}):null]})},ir=({className:t,emptyLabel:n,label:r,maxPages:o,multiple:s,onSelect:i,placeholder:a,subTypes:l,selected:c,threshold:u})=>(0,e.jsx)(br,{type:"post",className:t,emptyLabel:n,label:r,maxPages:o,multiple:s,onSelect:i,placeholder:a,subTypes:l,selected:c,threshold:u});ir.defaultProps={className:"",emptyLabel:(0,Yt.__)("No posts found","alley-scripts"),label:(0,Yt.__)("Search for posts","alley-scripts"),maxPages:5,multiple:!1,placeholder:(0,Yt.__)("Search for posts","alley-scripts"),subTypes:[],selected:[],threshold:3},ir.propTypes={className:o().string,emptyLabel:o().string,label:o().string,maxPages:o().number,multiple:o().bool,onSelect:o().func.isRequired,placeholder:o().string,subTypes:o().arrayOf(o().string),selected:o().arrayOf([o().shape({id:o().number,title:o().string})]),threshold:o().number};const ar=ir,lr={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let cr;const ur=new Uint8Array(16);function pr(){if(!cr&&(cr="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!cr))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return cr(ur)}const dr=[];for(let e=0;e<256;++e)dr.push((e+256).toString(16).slice(1));const fr=function(e,t,n){if(lr.randomUUID&&!t&&!e)return lr.randomUUID();const r=(e=e||{}).random||(e.rng||pr)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=r[e];return t}return function(e,t=0){return(dr[e[t+0]]+dr[e[t+1]]+dr[e[t+2]]+dr[e[t+3]]+"-"+dr[e[t+4]]+dr[e[t+5]]+"-"+dr[e[t+6]]+dr[e[t+7]]+"-"+dr[e[t+8]]+dr[e[t+9]]+"-"+dr[e[t+10]]+dr[e[t+11]]+dr[e[t+12]]+dr[e[t+13]]+dr[e[t+14]]+dr[e[t+15]]).toLowerCase()}(r)},hr=({emptyLabel:t,error:n,id:r,isOpen:o,labelledbyId:s,loading:i,onSelect:a,options:l,selectedItems:c,threshold:u,value:p})=>{if(!i&&(""===p||u>p.length))return null;let d="",f="";return i?(d="loading",f=(0,Yt.__)("Loading...","alley-scripts")):n?(d="error",f=n):i||0!==l.length||(d="no-posts",f=t),i||!i&&(p&&0===l.length||n)?(0,e.jsx)("div",{"aria-busy":!0,className:Qn()("autocomplete__dropdown",{"autocomplete__dropdown--is-open":o}),children:(0,e.jsx)("div",{className:Qn()("autocomplete__dropdown--notice",`autocomplete__${d}`),children:f})}):(0,e.jsx)("div",{className:Qn()("autocomplete__dropdown",{"autocomplete__dropdown--is-open":o}),children:(0,e.jsx)("ul",{role:"listbox","aria-labelledby":s,id:r,className:Qn()("autocomplete__dropdown--results","autocomplete__list"),children:l.map((t=>(0,e.jsx)("li",{className:"autocomplete__list--item",children:(0,e.jsx)(Ht.Button,{onClick:()=>a(t),type:"button",disabled:c.some((e=>e.id===t.id)),isTertiary:!0,children:t.title})},t.id)))})})};hr.propTypes={emptyLabel:o().string.isRequired,error:o().string.isRequired,id:o().string.isRequired,isOpen:o().bool.isRequired,labelledbyId:o().string.isRequired,loading:o().bool.isRequired,options:o().arrayOf(o().shape({label:o().string,value:o().string})).isRequired,onSelect:o().func.isRequired,selectedItems:o().shape([]).isRequired,threshold:o().number.isRequired,value:o().string.isRequired};const mr=hr;var gr=n(458),yr={};yr.styleTagTransform=Gn(),yr.setAttributes=qn(),yr.insert=Fn().bind(null,"head"),yr.domAPI=Mn(),yr.insertStyleElement=Hn(),Dn()(gr.Z,yr),gr.Z&&gr.Z.locals&&gr.Z.locals;const vr=({type:t,className:n,emptyLabel:r,label:o,maxPages:s,multiple:i,onSelect:a,placeholder:l,subTypes:c,selected:u,threshold:p})=>{const d=fr(),[f,h]=(0,hn.useState)(""),[m,g]=(0,hn.useState)([]),[y,v]=(0,hn.useState)(!1),[b,_]=(0,hn.useState)(!1),[A,w]=(0,hn.useState)(""),[C,x]=(0,hn.useState)([]),S=(0,hn.useRef)(),E=gn(A,750),k=(0,hn.useCallback)((async(e=1)=>{if(E.length0?c.join(","):"any",type:t});await kn()({path:r,parse:!1}).then((e=>{const t=parseInt(e.headers.get("X-WP-TotalPages"),10);return n=t>s?s:t,e.json()})).then((t=>{g((e=>[...e,...t])),_(!1),(n&&n>e||e>=1&&i&&C.length>0)&&k(e+1)})).catch((e=>h(e.message)))}),[E,t,s,i,c,C.length,p]);(0,hn.useEffect)((()=>{x(u)}),[u]),(0,hn.useEffect)((()=>{E&&p<=E.length?k():g([])}),[E,k,p]);const R=e=>{v(S.current.contains(e.target))},T=e=>{"Escape"===e.key&&v(!1)};(0,hn.useEffect)((()=>(document.addEventListener("keydown",T),()=>document.removeEventListener("keydown",T)))),(0,hn.useEffect)((()=>(S&&document.addEventListener("mousedown",R),()=>document.removeEventListener("mousedown",R))));const I=e=>{let t=[];if(C.some((t=>t.id===e.id))){const n=C.findIndex((t=>t.id===e.id));t=[...C.slice(0,n),...C.slice(n+1,C.length)]}else i?t=[...C,e]:(t=[e],v(!1));x(t),a(t)};return(0,e.jsx)("form",{className:"autocomplete__component",onSubmit:e=>e.preventDefault(),children:(0,e.jsxs)("div",{className:Qn()("components-base-control","autocomplete-base-control",n),ref:S,children:[(0,e.jsxs)("div",{"aria-expanded":y,"aria-haspopup":"listbox","aria-owns":`listbox-${d}`,className:Qn()("components-base-control__field","autocomplete-base-control__field"),role:"combobox",children:[(0,e.jsx)("label",{className:Qn()("components-base-control__label","autocomplete-base-control__label"),htmlFor:`autocomplete-${d}`,children:(0,e.jsx)("div",{children:o})}),C.length>0?(0,e.jsx)("ul",{role:"listbox","aria-labelledby":`autocomplete-${d}`,id:`selected-items-${d}`,className:Qn()("autocomplete__selection--results","autocomplete__selection-list"),children:C.map((t=>(0,e.jsx)("li",{className:"autocomplete__selection-list--item",children:(0,e.jsx)(Ht.Button,{className:"autocomplete__selection-list--item--button",isSecondary:!0,isSmall:!0,onClick:()=>I(t),type:"button",children:t.title})},t.title)))}):null,(0,e.jsx)("input",{"aria-autocomplete":"list",autoComplete:"off",className:Qn()("components-text-control__input","autocomplete-text-control__input",{"autocomplete-text-control__input--working":y}),id:`autocomplete-${d}`,onChange:e=>w(e.target.value),onFocus:()=>v(!0),placeholder:l,type:"text",value:A})]}),(0,e.jsx)(mr,{emptyLabel:r,error:f,labelledById:`autocomplete-${d}`,id:`listbox-${d}`,isOpen:y,loading:b&&E,onSelect:I,options:m,selectedItems:C,threshold:p,value:E})]})})};vr.defaultProps={type:"post",className:"",emptyLabel:(0,Yt.__)("No items found","alley-scripts"),label:(0,Yt.__)("Search for items","alley-scripts"),maxPages:5,multiple:!1,placeholder:(0,Yt.__)("Search for items","alley-scripts"),subTypes:[],selected:[],threshold:3},vr.propTypes={type:o().string,className:o().string,emptyLabel:o().string,label:o().string,maxPages:o().number,multiple:o().bool,onSelect:o().func.isRequired,placeholder:o().string,subTypes:o().arrayOf(o().string),selected:o().arrayOf([o().shape({id:o().number,title:o().string})]),threshold:o().number};const br=vr,_r=({className:t,emptyLabel:n,label:r,maxPages:o,multiple:s,onSelect:i,placeholder:a,subTypes:l,selected:c,threshold:u})=>(0,e.jsx)(br,{type:"term",className:t,emptyLabel:n,label:r,maxPages:o,multiple:s,onSelect:i,placeholder:a,subTypes:l,selected:c,threshold:u});_r.defaultProps={className:"",emptyLabel:(0,Yt.__)("No terms found","alley-scripts"),label:(0,Yt.__)("Search for terms","alley-scripts"),maxPages:5,multiple:!1,placeholder:(0,Yt.__)("Search for terms","alley-scripts"),subTypes:[],selected:[],threshold:3},_r.propTypes={className:o().string,emptyLabel:o().string,label:o().string,maxPages:o().number,multiple:o().bool,onSelect:o().func.isRequired,placeholder:o().string,subTypes:o().arrayOf(o().string),selected:o().arrayOf([o().shape({id:o().number,title:o().string})]),threshold:o().number};const Ar=_r,wr=Bt.div` + height: auto; + width: 100%; +`,Cr=({src:t})=>(0,e.jsx)(wr,{children:(0,e.jsx)("video",{className:"edit-video-preview",controls:!0,src:t})});Cr.propTypes={src:o().string.isRequired};const xr=({className:t,onReset:n,onUpdate:r,onUpdateURL:o,value:s,valueURL:i})=>(0,e.jsx)(cn,{allowedTypes:["video"],className:t,icon:"format-video",onReset:n,onUpdate:r,onUpdateURL:o,preview:Cr,value:s,valueURL:i});xr.defaultProps={className:"",onUpdateURL:null,valueURL:""},xr.propTypes={className:o().string,onReset:o().func.isRequired,onUpdate:o().func.isRequired,onUpdateURL:o().func,value:o().number.isRequired,valueURL:o().string};const Sr=xr})(),r})(),e.exports=t()},188:function(e,t,n){"use strict";var r=window.wp.element,o=window.wp.blocks,s=window.wp.blockEditor,i=n(373),a=n(184),l=n.n(a),c=window.React,u=window.wp.apiFetch,p=n.n(u),d=window.wp.components,f=window.wp.data,h=window.wp.i18n,m=window.wp.url;const g=new Map,y=new Map;let v=!1,b=!1;function _(e){if(!e)return!0;const t="string"==typeof e?parseInt(e,10):e;return!g.has(t)&&(g.set(t,!0),!0)}function A(e){if(!e)return;const t="string"==typeof e?parseInt(e,10):e;g.set(t,!0)}const w=(e,t)=>{e.forEach((e=>{if("wp-curate/query"===e.name)t.push(e);else{const{innerBlocks:n}=e;if(!n)return;w(n,t)}}))};function C(){if(v)return void(b=!0);v=!0,b=!1,g.clear(),y.clear();const e=(0,f.select)("core/block-editor").getBlocks(),{wp_curate_deduplication:t=!0}=(0,f.select)("core/editor").getEditedPostAttribute("meta")||{},n=[];w(e,n),n.forEach((e=>{const{attributes:n}=e,{backfillPosts:r=[],deduplication:o="inherit",posts:s=[],numberOfPosts:i=5,postTypes:a=["post"]}=n;if(!r.length)return;const l=a.join(",");let c=0;const u=[],p=s,d=r.filter((e=>!p.includes(e)));for(let e=0;e{var r;let s,i,a=!1;if(null!==p[n])s=p[n],A(s);else do{d[c]&&(i=d[c],t&&"inherit"===o?a=_(i):(a=!0,A(i))),c+=1}while(!1===a&&c<=d.length);u.push(null!==(r=s)&&void 0!==r?r:i)}));const h={perPage:i,postType:"post",type:l,include:u.join(","),orderby:"include"};(0,f.dispatch)("core/block-editor").updateBlockAttributes(e.clientId,{query:h,queryId:0})})),v=!1,b&&C()}var x=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"wp-curate/query","version":"0.1.0","title":"Query","category":"theme","icon":"filter","description":"Custom queries for WP Curate","textdomain":"wp-curate","editorScript":"file:index.ts","editorStyle":"file:index.css","style":["file:style-index.css"],"providesContext":{"query":"query","displayLayout":"displayLayout","heading":"heading","curation":"curation"},"attributes":{"deduplication":{"default":"inherit","enum":["inherit","never"],"type":"string"},"maxNumberOfPosts":{"default":10,"type":"number"},"minNumberOfPosts":{"default":1,"type":"number"},"numberOfPosts":{"default":5,"type":"number"},"offset":{"default":0,"type":"number"},"postTypes":{"default":["post"],"items":{"type":"string"},"type":"array"},"posts":{"default":[],"items":{"type":"number"},"type":"array"},"searchTerm":{"default":"","type":"string"},"terms":{"default":{},"items":{"default":[],"items":{"type":"object"},"type":"array"},"type":"object"}}}');(0,o.registerBlockType)(x,{edit:function(e){let{attributes:{backfillPosts:t=[],deduplication:n="inherit",maxNumberOfPosts:o=10,minNumberOfPosts:a=1,numberOfPosts:u=5,offset:g=0,posts:y=[],postTypes:v=["post"],searchTerm:b,terms:_={}},setAttributes:A}=e;const{wpCurateQueryBlock:{allowedPostTypes:w=[],allowedTaxonomies:x=[]}={}}=window,[S,E]=(0,f.useSelect)((e=>{const t=e("core/editor"),n=t.getEditedPostAttribute("type"),r=t.getEditedPostAttribute("meta");return[Boolean(r?.wp_curate_deduplication),n?e("core").getPostType(n):null]})),k=function(e,t){const[n,r]=c.useState(e);return c.useEffect((()=>{const t=setTimeout((()=>{r(e)}),500);return()=>{clearTimeout(t)}}),[e,500]),n}(null!=b?b:""),[R,T]=(0,r.useState)({}),[I,N]=(0,r.useState)({});let O="";Object.keys(R).length>0&&x.forEach((e=>{if(_[e]?.length>0){const t=R[e].rest_base;t&&(O+=`&${t}=${_[e].map((e=>e.id)).join(",")}`)}}));const P=y.map((e=>null!=e?e:null)).join(","),L=v.join(",");(0,r.useEffect)((()=>{(async()=>{p()({path:"/wp/v2/taxonomies"}).then((e=>{T(e)}))})()}),[]),(0,r.useEffect)((()=>{(async()=>{p()({path:"/wp/v2/types"}).then((e=>{N(e)}))})()}),[]),(0,r.useEffect)((()=>{Object.keys(R).length<=0||(async()=>{let e=(0,m.addQueryArgs)("/wp/v2/posts",{search:k,offset:g,type:L,per_page:20});e+=O,p()({path:e}).then((e=>{const t=e.map((e=>e.id));A({backfillPosts:t})}))})()}),[k,O,g,L,R,A]),(0,r.useEffect)((()=>{C()}),[P,t,u,A,L,S,n]);const j=(e,t)=>{const n=[...y];n.splice(t,1,e),A({posts:n})};for(let e=0;e{w.includes(e)&&D.push({label:I[e].name,value:e})})),(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{...(0,s.useBlockProps)()},(0,r.createElement)(s.InnerBlocks,{template:[["core/post-template",{},[["wp-curate/post",{},[["core/post-title",{isLink:!0}],["core/post-excerpt",{}]]]]]]})),(0,r.createElement)(s.InspectorControls,null,(0,r.createElement)(d.PanelBody,{title:(0,h.__)("Setup","wp-curate"),initialOpen:!0},void 0!==a&&a!==o?(0,r.createElement)(r.Fragment,null,(0,r.createElement)(d.RangeControl,{label:(0,h.__)("Number of Posts","wp-curate"),help:(0,h.__)("The maximum number of posts to show.","wp-curate"),value:u,onChange:e=>{A({numberOfPosts:e,posts:y.slice(0,e)})},min:a,max:o})):null,(0,r.createElement)(d.RangeControl,{label:(0,h.__)("Offset","wp-curate"),help:(0,h.__)("The number of posts to pass over.","wp-curate"),onChange:e=>A({offset:e}),value:g,min:0,max:20})),(0,r.createElement)(d.PanelBody,{title:(0,h.__)("Select Posts","wp-curate"),initialOpen:!1,className:"manual-posts"},y.map(((e,t)=>{var n;return(0,r.createElement)(d.PanelRow,{className:l()("manual-posts__container",{"manual-posts__container--selected":y[t]})},(0,r.createElement)("span",{className:"manual-posts__counter"},t+1),(0,r.createElement)(i.PostPicker,{allowedTypes:w,onReset:()=>j(0,t),onUpdate:e=>{j(e,t)},value:null!==(n=y[t])&&void 0!==n?n:0,className:"manual-posts__picker"}))}))),(0,r.createElement)(d.PanelBody,{title:(0,h.__)("Query Parameters","wp-curate"),initialOpen:!1},(0,r.createElement)(i.Checkboxes,{label:(0,h.__)("Post Types","wp-curate"),value:v,onChange:e=>A({postTypes:e}),options:D}),Object.keys(R).length>0?x.map((e=>{var t;return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(i.TermSelector,{label:R[e].name,subTypes:[e],selected:null!==(t=_[e])&&void 0!==t?t:[],onSelect:t=>((e,t)=>{const n=t.map((e=>({id:e.id,title:e.title,url:e.url,type:e.type}))),r={..._,[e]:n};A({terms:r})})(e,t),multiple:!0}))})):null,(0,r.createElement)(d.TextControl,{label:(0,h.__)("Search Term","wp-curate"),onChange:e=>A({searchTerm:e}),value:b}))),(0,r.createElement)(s.InspectorControls,{group:"advanced"},(0,r.createElement)(d.RadioControl,{label:(0,h.__)("Deduplication","wp-curate"),help:(0,h.__)("Customize whether posts that have already appeared in previous query blocks can appear again in this block.","wp-curate"),options:[{label:(0,r.createInterpolateElement)((0,h.sprintf)((0,h.__)("Inherit deduplication setting from this %1$s (currently %2$s)","wp-curate"),E?E.labels.singular_name:"post",`${S?(0,h.__)("enabled","wp-curate"):(0,h.__)("disabled","wp-curate")}`),{strong:(0,r.createElement)("strong",null)}),value:"inherit"},{label:(0,h.__)("Never exclude posts appearing in previous query blocks","wp-curate"),value:"never"}],onChange:e=>A({deduplication:e}),selected:n})))},save:()=>{const e=s.useBlockProps.save();return(0,r.createElement)("div",{...e},(0,r.createElement)(s.InnerBlocks.Content,null))}})},184:function(e,t){var n;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e=[],t=0;t=s)&&Object.keys(r.O).every((function(e){return r.O[e](n[l])}))?n.splice(l--,1):(a=!1,s0&&e[u-1][2]>s;u--)e[u]=e[u-1];e[u]=[n,o,s]},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var e={477:0,566:0};r.O.j=function(t){return 0===e[t]};var t=function(t,n){var o,s,i=n[0],a=n[1],l=n[2],c=0;if(i.some((function(t){return 0!==e[t]}))){for(o in a)r.o(a,o)&&(r.m[o]=a[o]);if(l)var u=l(r)}for(t&&t(n);c 'wp_curate_render_query_block', + ], + ); + + /** + * Filter the post types that can be used in the Query block. + */ + $allowed_post_types = apply_filters( 'wp_curate_allowed_post_types', [ 'post' ] ); + + /** + * Filter the taxonomies that can be used in the Query block. + */ + $allowed_taxonomies = apply_filters( 'wp_curate_allowed_taxonomies', [ 'category', 'post_tag' ] ); + + wp_localize_script( + 'wp-curate-query-editor-script', + 'wpCurateQueryBlock', + [ + 'allowedPostTypes' => $allowed_post_types, + 'allowedTaxonomies' => $allowed_taxonomies, + ] + ); +} +add_action( 'init', 'wp_curate_query_block_init' ); + +/** + * Renders the `wp-curate/query` block on the server. + * + * @param array $attributes Block attributes. + * @param string $content Block default content. + * @return string Block output. + */ +function wp_curate_render_query_block( $attributes, $content ): string { + $proc = new WP_HTML_Tag_Processor( $content ); + + /* + * If a query returns no posts -- denoted by the absence of a list in the content -- don't + * show any of the inner content. + * + * This approach is not great because the inner blocks will have been rendered already and their + * scripts and styles will have been enqueued, but it's not clear what other options are + * available because the post template inner block needs to render for us to know whether there + * are any posts to begin with. + */ + return $proc->next_tag( [ 'tag_name' => 'ul' ] ) === true || $proc->next_tag( [ 'tag_name' => 'ol' ] ) === true ? $content : ''; +} diff --git a/build/query/style-index.css b/build/query/style-index.css new file mode 100644 index 00000000..de232b2b --- /dev/null +++ b/build/query/style-index.css @@ -0,0 +1 @@ +.wp-block-wp-curate-query{min-height:50px;padding:2px} diff --git a/build/slotfills/index.asset.php b/build/slotfills/index.asset.php new file mode 100644 index 00000000..0d71ae12 --- /dev/null +++ b/build/slotfills/index.asset.php @@ -0,0 +1 @@ + array('wp-components', 'wp-edit-post', 'wp-element', 'wp-i18n', 'wp-plugins'), 'version' => 'da752c337856cac02227'); diff --git a/build/slotfills/index.js b/build/slotfills/index.js new file mode 100644 index 00000000..52d7e20d --- /dev/null +++ b/build/slotfills/index.js @@ -0,0 +1,42 @@ +!function(){var e={373:function(e){var t;self,t=()=>(()=>{var e={779:(e,t)=>{var n;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e=[],t=0;t{"use strict";n.d(t,{Z:()=>a});var r=n(272),o=n.n(r),s=n(609),i=n.n(s)()(o());i.push([e.id,".alley-scripts-post-picker__post-list{display:flex;flex-wrap:wrap;float:left;height:calc(70vh - 200px);justify-content:flex-start;overflow-y:auto;padding:8px;width:100%}.alley-scripts-post-picker__post{border:1px solid #eee;height:auto;justify-content:center;margin:0 8px 8px 0;transition:background-color .2s ease-in-out;width:calc((100% - 40px)/3)}@media(min-width: 780px){.alley-scripts-post-picker__post{width:calc((100% - 40px)/5)}}.alley-scripts-post-picker__post:hover{background-color:#f5f5f5}.alley-scripts-post-picker__post.is-selected{background-color:#f5f5f5}.alley-scripts-post-picker__load-more{clear:both;float:left;text-align:center;width:100%}","",{version:3,sources:["webpack://./src/components/post-picker/post-list.scss"],names:[],mappings:"AAAA,sCACE,YAAA,CACA,cAAA,CACA,UAAA,CACA,yBAAA,CACA,0BAAA,CACA,eAAA,CACA,WAAA,CACA,UAAA,CAGF,iCACE,qBAAA,CACA,WAAA,CACA,sBAAA,CACA,kBAAA,CACA,2CAAA,CACA,2BAAA,CAGA,yBATF,iCAUI,2BAAA,CAAA,CAGF,uCACE,wBAAA,CAGF,6CACE,wBAAA,CAIJ,sCACE,UAAA,CACA,UAAA,CACA,iBAAA,CACA,UAAA",sourcesContent:[".alley-scripts-post-picker__post-list {\n display: flex;\n flex-wrap: wrap;\n float: left;\n height: calc(70vh - 200px);\n justify-content: flex-start;\n overflow-y: auto;\n padding: 8px;\n width: 100%;\n}\n\n.alley-scripts-post-picker__post {\n border: 1px solid #eee;\n height: auto;\n justify-content: center;\n margin: 0 8px 8px 0;\n transition: background-color 0.2s ease-in-out;\n width: calc((100% - 40px) / 3);\n\n\n @media (min-width: 780px) {\n width: calc((100% - 40px) / 5);\n }\n\n &:hover {\n background-color: #f5f5f5;\n }\n\n &.is-selected {\n background-color: #f5f5f5;\n }\n}\n\n.alley-scripts-post-picker__load-more {\n clear: both;\n float: left;\n text-align: center;\n width: 100%;\n}\n"],sourceRoot:""}]);const a=i},992:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(272),o=n.n(r),s=n(609),i=n.n(s)()(o());i.push([e.id,".components-modal__content{width:90vw}.alley-scripts-post-picker__buttons{clear:both;display:block;text-align:right;width:100%}.alley-scripts-post-picker__buttons button{margin:5px}","",{version:3,sources:["webpack://./src/components/post-picker/search-modal.scss"],names:[],mappings:"AAAA,2BACE,UAAA,CAGF,oCACE,UAAA,CACA,aAAA,CACA,gBAAA,CACA,UAAA,CAEA,2CACE,UAAA",sourcesContent:[".components-modal__content {\n width: 90vw;\n}\n\n.alley-scripts-post-picker__buttons {\n clear: both;\n display: block;\n text-align: right;\n width: 100%;\n\n button {\n margin: 5px;\n }\n}\n"],sourceRoot:""}]);const a=i},458:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(272),o=n.n(r),s=n(609),i=n.n(s)()(o());i.push([e.id,'.edit-post-sidebar .autocomplete__component,.editor-styles-wrapper .autocomplete__component{margin-bottom:20px}.edit-post-sidebar .autocomplete-base-control,.editor-styles-wrapper .autocomplete-base-control{position:relative}.edit-post-sidebar .autocomplete-text-control__input,.editor-styles-wrapper .autocomplete-text-control__input{margin:0}.edit-post-sidebar .autocomplete__selection-list,.editor-styles-wrapper .autocomplete__selection-list{list-style-type:none;margin:0 0 6px;padding:0}.edit-post-sidebar .autocomplete__selection-list--item,.editor-styles-wrapper .autocomplete__selection-list--item{display:inline-block;list-style:none}.edit-post-sidebar .autocomplete__selection-list--item--button,.editor-styles-wrapper .autocomplete__selection-list--item--button{margin-bottom:4px;margin-right:3px}.edit-post-sidebar .autocomplete__selection-list--item--button::after,.editor-styles-wrapper .autocomplete__selection-list--item--button::after{content:"×";font-size:16px;line-height:20px;margin-left:5px}.edit-post-sidebar .autocomplete__dropdown,.editor-styles-wrapper .autocomplete__dropdown{background-color:#fff;border-color:rgba(0,0,0,0) #e2e4e7 #e2e4e7;border-radius:0 0 4px 4px;border-style:solid;border-width:0 1px 1px;left:0;max-height:0;overflow-y:hidden;position:absolute;top:calc(100% + 1px);visibility:hidden;width:100%;z-index:10}.edit-post-sidebar .autocomplete__dropdown--is-open,.editor-styles-wrapper .autocomplete__dropdown--is-open{box-shadow:0 3px 30px rgba(25,30,35,.1);max-height:225px;overflow-y:scroll;visibility:visible}.edit-post-sidebar .autocomplete__dropdown--notice,.editor-styles-wrapper .autocomplete__dropdown--notice{padding:15px}.edit-post-sidebar .autocomplete__dropdown--results,.editor-styles-wrapper .autocomplete__dropdown--results{list-style:none;margin:0;padding:0}.edit-post-sidebar .autocomplete__list--item,.editor-styles-wrapper .autocomplete__list--item{list-style:none}.edit-post-sidebar .autocomplete__list--item>button,.editor-styles-wrapper .autocomplete__list--item>button{background:rgba(0,0,0,0);border-color:#e2e4e7;border-style:solid;border-width:0 0 1px;height:100%;line-height:1.25;text-align:left;white-space:inherit;width:100%}.edit-post-sidebar .autocomplete__list--item:last-child>button,.editor-styles-wrapper .autocomplete__list--item:last-child>button{border-bottom:0}',"",{version:3,sources:["webpack://./src/components/selector/styles.scss"],names:[],mappings:"AAAA,4FAgBI,kBACE,CAAA,gGAMF,iBACE,CAAA,8GAMF,QACE,CAAA,sGAMF,oBACE,CAAA,cACA,CAAA,SACA,CAAA,kHAEA,oBACE,CAAA,eACA,CAAA,kIAEA,iBACE,CAAA,gBACA,CAAA,gJAEA,WACE,CAAA,cACA,CAAA,gBACA,CAAA,eACA,CAAA,0FASR,qBACE,CAAA,0CACA,CAAA,yBACA,CAAA,kBACA,CAAA,sBACA,CAAA,MACA,CAAA,YACA,CAAA,iBACA,CAAA,iBACA,CAAA,oBACA,CAAA,iBACA,CAAA,UACA,CAAA,UACA,CAAA,4GAGA,uCACE,CAAA,gBACA,CAAA,iBACA,CAAA,kBACA,CAAA,0GAIF,YACE,CAAA,4GAIF,eACE,CAAA,QACA,CAAA,SACA,CAAA,8FAOJ,eACE,CAAA,4GAEA,wBACE,CAAA,oBACA,CAAA,kBACA,CAAA,oBACA,CAAA,WACA,CAAA,gBACA,CAAA,eACA,CAAA,mBACA,CAAA,UACA,CAAA,kIAGF,eACE",sourcesContent:["//--------------------------------------------------------------\n// AutoComplete Styles\n//--------------------------------------------------------------\n\n/* stylelint-disable max-nesting-depth */\n\n//-----------------------------------------\n// Accommodate editor well, or the sidebar.\n//-----------------------------------------\n.edit-post-sidebar,\n.editor-styles-wrapper {\n .autocomplete {\n\n //-----------------------------------------\n // Parent form wrapper.\n //-----------------------------------------\n &__component {\n margin-bottom: 20px;\n }\n\n //-----------------------------------------\n // Wrapper\n //-----------------------------------------\n &-base-control {\n position: relative;\n }\n\n //-----------------------------------------\n // Input\n //-----------------------------------------\n &-text-control__input {\n margin: 0;\n }\n\n //-----------------------------------------\n // Selected buttons.\n //-----------------------------------------\n &__selection-list {\n list-style-type: none;\n margin: 0 0 6px;\n padding: 0;\n\n &--item {\n display: inline-block;\n list-style: none;\n\n &--button {\n margin-bottom: 4px;\n margin-right: 3px;\n\n &::after {\n content: '×';\n font-size: 16px;\n line-height: 20px;\n margin-left: 5px;\n }\n }\n }\n }\n\n //-----------------------------------------\n // Results\n //-----------------------------------------\n &__dropdown {\n background-color: #fff;\n border-color: transparent #e2e4e7 #e2e4e7;\n border-radius: 0 0 4px 4px;\n border-style: solid;\n border-width: 0 1px 1px;\n left: 0;\n max-height: 0;\n overflow-y: hidden;\n position: absolute;\n top: calc(100% + 1px); // Offset focus border.\n visibility: hidden;\n width: 100%;\n z-index: 10;\n\n // Container is open.\n &--is-open {\n box-shadow: 0 3px 30px rgba(25, 30, 35, 0.1);\n max-height: 225px;\n overflow-y: scroll;\n visibility: visible;\n }\n\n // Notice handler.\n &--notice {\n padding: 15px;\n }\n\n // Results container.\n &--results {\n list-style: none;\n margin: 0;\n padding: 0;\n }\n }\n\n //-----------------------------------------\n // List/Results\n //-----------------------------------------\n &__list--item {\n list-style: none;\n\n > button {\n background: transparent;\n border-color: #e2e4e7;\n border-style: solid;\n border-width: 0 0 1px;\n height: 100%;\n line-height: 1.25;\n text-align: left;\n white-space: inherit;\n width: 100%;\n }\n\n &:last-child > button {\n border-bottom: 0;\n }\n }\n }\n}\n"],sourceRoot:""}]);const a=i},609:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,r,o,s){"string"==typeof e&&(e=[[null,e,void 0]]);var i={};if(r)for(var a=0;a0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=s),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),o&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=o):u[4]="".concat(o)),t.push(u))}},t}},272:e=>{"use strict";e.exports=function(e){var t=e[1],n=e[3];if(!n)return t;if("function"==typeof btoa){var r=btoa(unescape(encodeURIComponent(JSON.stringify(n)))),o="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(r),s="/*# ".concat(o," */");return[t].concat([s]).join("\n")}return[t].join("\n")}},368:function(e){e.exports=function(){"use strict";const{entries:e,setPrototypeOf:t,isFrozen:n,getPrototypeOf:r,getOwnPropertyDescriptor:o}=Object;let{freeze:s,seal:i,create:a}=Object,{apply:l,construct:c}="undefined"!=typeof Reflect&&Reflect;l||(l=function(e,t,n){return e.apply(t,n)}),s||(s=function(e){return e}),i||(i=function(e){return e}),c||(c=function(e,t){return new e(...t)});const u=w(Array.prototype.forEach),p=w(Array.prototype.pop),d=w(Array.prototype.push),f=w(String.prototype.toLowerCase),h=w(String.prototype.toString),m=w(String.prototype.match),g=w(String.prototype.replace),y=w(String.prototype.indexOf),v=w(String.prototype.trim),A=w(RegExp.prototype.test),b=(_=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n1?n-1:0),o=1;o/gm),B=i(/\${[\w\W]*}/gm),F=i(/^data-[\-\w.\u00B7-\uFFFF]/),z=i(/^aria-[\-\w]+$/),q=i(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),$=i(/^(?:\w+script|data):/i),H=i(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),W=i(/^html$/i);var G=Object.freeze({__proto__:null,MUSTACHE_EXPR:U,ERB_EXPR:M,TMPLIT_EXPR:B,DATA_ATTR:F,ARIA_ATTR:z,IS_ALLOWED_URI:q,IS_SCRIPT_OR_DATA:$,ATTR_WHITESPACE:H,DOCTYPE_NAME:W});return function t(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"undefined"==typeof window?null:window;const r=e=>t(e);if(r.version="3.0.5",r.removed=[],!n||!n.document||9!==n.document.nodeType)return r.isSupported=!1,r;const o=n.document,i=o.currentScript;let{document:a}=n;const{DocumentFragment:l,HTMLTemplateElement:c,Node:_,Element:w,NodeFilter:U,NamedNodeMap:M=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:B,DOMParser:F,trustedTypes:z}=n,$=w.prototype,H=S($,"cloneNode"),Y=S($,"nextSibling"),V=S($,"childNodes"),Z=S($,"parentNode");if("function"==typeof c){const e=a.createElement("template");e.content&&e.content.ownerDocument&&(a=e.content.ownerDocument)}let K,Q="";const{implementation:J,createNodeIterator:X,createDocumentFragment:ee,getElementsByTagName:te}=a,{importNode:ne}=o;let re={};r.isSupported="function"==typeof e&&"function"==typeof Z&&J&&void 0!==J.createHTMLDocument;const{MUSTACHE_EXPR:oe,ERB_EXPR:se,TMPLIT_EXPR:ie,DATA_ATTR:ae,ARIA_ATTR:le,IS_SCRIPT_OR_DATA:ce,ATTR_WHITESPACE:ue}=G;let{IS_ALLOWED_URI:pe}=G,de=null;const fe=C({},[...E,...R,...k,...I,...O]);let he=null;const me=C({},[...L,...P,...j,...D]);let ge=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ye=null,ve=null,Ae=!0,be=!0,_e=!1,we=!0,Ce=!1,xe=!1,Se=!1,Ee=!1,Re=!1,ke=!1,Te=!1,Ie=!0,Ne=!1,Oe=!0,Le=!1,Pe={},je=null;const De=C({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ue=null;const Me=C({},["audio","video","img","source","image","track"]);let Be=null;const Fe=C({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ze="http://www.w3.org/1998/Math/MathML",qe="http://www.w3.org/2000/svg",$e="http://www.w3.org/1999/xhtml";let He=$e,We=!1,Ge=null;const Ye=C({},[ze,qe,$e],h);let Ve;const Ze=["application/xhtml+xml","text/html"];let Ke,Qe=null;const Je=a.createElement("form"),Xe=function(e){return e instanceof RegExp||e instanceof Function},et=function(e){if(!Qe||Qe!==e){if(e&&"object"==typeof e||(e={}),e=x(e),Ve=Ve=-1===Ze.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,Ke="application/xhtml+xml"===Ve?h:f,de="ALLOWED_TAGS"in e?C({},e.ALLOWED_TAGS,Ke):fe,he="ALLOWED_ATTR"in e?C({},e.ALLOWED_ATTR,Ke):me,Ge="ALLOWED_NAMESPACES"in e?C({},e.ALLOWED_NAMESPACES,h):Ye,Be="ADD_URI_SAFE_ATTR"in e?C(x(Fe),e.ADD_URI_SAFE_ATTR,Ke):Fe,Ue="ADD_DATA_URI_TAGS"in e?C(x(Me),e.ADD_DATA_URI_TAGS,Ke):Me,je="FORBID_CONTENTS"in e?C({},e.FORBID_CONTENTS,Ke):De,ye="FORBID_TAGS"in e?C({},e.FORBID_TAGS,Ke):{},ve="FORBID_ATTR"in e?C({},e.FORBID_ATTR,Ke):{},Pe="USE_PROFILES"in e&&e.USE_PROFILES,Ae=!1!==e.ALLOW_ARIA_ATTR,be=!1!==e.ALLOW_DATA_ATTR,_e=e.ALLOW_UNKNOWN_PROTOCOLS||!1,we=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Ce=e.SAFE_FOR_TEMPLATES||!1,xe=e.WHOLE_DOCUMENT||!1,Re=e.RETURN_DOM||!1,ke=e.RETURN_DOM_FRAGMENT||!1,Te=e.RETURN_TRUSTED_TYPE||!1,Ee=e.FORCE_BODY||!1,Ie=!1!==e.SANITIZE_DOM,Ne=e.SANITIZE_NAMED_PROPS||!1,Oe=!1!==e.KEEP_CONTENT,Le=e.IN_PLACE||!1,pe=e.ALLOWED_URI_REGEXP||q,He=e.NAMESPACE||$e,ge=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&Xe(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ge.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&Xe(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ge.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(ge.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ce&&(be=!1),ke&&(Re=!0),Pe&&(de=C({},[...O]),he=[],!0===Pe.html&&(C(de,E),C(he,L)),!0===Pe.svg&&(C(de,R),C(he,P),C(he,D)),!0===Pe.svgFilters&&(C(de,k),C(he,P),C(he,D)),!0===Pe.mathMl&&(C(de,I),C(he,j),C(he,D))),e.ADD_TAGS&&(de===fe&&(de=x(de)),C(de,e.ADD_TAGS,Ke)),e.ADD_ATTR&&(he===me&&(he=x(he)),C(he,e.ADD_ATTR,Ke)),e.ADD_URI_SAFE_ATTR&&C(Be,e.ADD_URI_SAFE_ATTR,Ke),e.FORBID_CONTENTS&&(je===De&&(je=x(je)),C(je,e.FORBID_CONTENTS,Ke)),Oe&&(de["#text"]=!0),xe&&C(de,["html","head","body"]),de.table&&(C(de,["tbody"]),delete ye.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw b('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw b('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');K=e.TRUSTED_TYPES_POLICY,Q=K.createHTML("")}else void 0===K&&(K=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+o+" could not be created."),null}}(z,i)),null!==K&&"string"==typeof Q&&(Q=K.createHTML(""));s&&s(e),Qe=e}},tt=C({},["mi","mo","mn","ms","mtext"]),nt=C({},["foreignobject","desc","title","annotation-xml"]),rt=C({},["title","style","font","a","script"]),ot=C({},R);C(ot,k),C(ot,T);const st=C({},I);C(st,N);const it=function(e){d(r.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){e.remove()}},at=function(e,t){try{d(r.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){d(r.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!he[e])if(Re||ke)try{it(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},lt=function(e){let t,n;if(Ee)e=""+e;else{const t=m(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===Ve&&He===$e&&(e=''+e+"");const r=K?K.createHTML(e):e;if(He===$e)try{t=(new F).parseFromString(r,Ve)}catch(e){}if(!t||!t.documentElement){t=J.createDocument(He,"template",null);try{t.documentElement.innerHTML=We?Q:r}catch(e){}}const o=t.body||t.documentElement;return e&&n&&o.insertBefore(a.createTextNode(n),o.childNodes[0]||null),He===$e?te.call(t,xe?"html":"body")[0]:xe?t.documentElement:o},ct=function(e){return X.call(e.ownerDocument||e,e,U.SHOW_ELEMENT|U.SHOW_COMMENT|U.SHOW_TEXT,null,!1)},ut=function(e){return"object"==typeof _?e instanceof _:e&&"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},pt=function(e,t,n){re[e]&&u(re[e],(e=>{e.call(r,t,n,Qe)}))},dt=function(e){let t;if(pt("beforeSanitizeElements",e,null),(n=e)instanceof B&&("string"!=typeof n.nodeName||"string"!=typeof n.textContent||"function"!=typeof n.removeChild||!(n.attributes instanceof M)||"function"!=typeof n.removeAttribute||"function"!=typeof n.setAttribute||"string"!=typeof n.namespaceURI||"function"!=typeof n.insertBefore||"function"!=typeof n.hasChildNodes))return it(e),!0;var n;const o=Ke(e.nodeName);if(pt("uponSanitizeElement",e,{tagName:o,allowedTags:de}),e.hasChildNodes()&&!ut(e.firstElementChild)&&(!ut(e.content)||!ut(e.content.firstElementChild))&&A(/<[/\w]/g,e.innerHTML)&&A(/<[/\w]/g,e.textContent))return it(e),!0;if(!de[o]||ye[o]){if(!ye[o]&&ht(o)){if(ge.tagNameCheck instanceof RegExp&&A(ge.tagNameCheck,o))return!1;if(ge.tagNameCheck instanceof Function&&ge.tagNameCheck(o))return!1}if(Oe&&!je[o]){const t=Z(e)||e.parentNode,n=V(e)||e.childNodes;if(n&&t)for(let r=n.length-1;r>=0;--r)t.insertBefore(H(n[r],!0),Y(e))}return it(e),!0}return e instanceof w&&!function(e){let t=Z(e);t&&t.tagName||(t={namespaceURI:He,tagName:"template"});const n=f(e.tagName),r=f(t.tagName);return!!Ge[e.namespaceURI]&&(e.namespaceURI===qe?t.namespaceURI===$e?"svg"===n:t.namespaceURI===ze?"svg"===n&&("annotation-xml"===r||tt[r]):Boolean(ot[n]):e.namespaceURI===ze?t.namespaceURI===$e?"math"===n:t.namespaceURI===qe?"math"===n&&nt[r]:Boolean(st[n]):e.namespaceURI===$e?!(t.namespaceURI===qe&&!nt[r])&&!(t.namespaceURI===ze&&!tt[r])&&!st[n]&&(rt[n]||!ot[n]):!("application/xhtml+xml"!==Ve||!Ge[e.namespaceURI]))}(e)?(it(e),!0):"noscript"!==o&&"noembed"!==o&&"noframes"!==o||!A(/<\/no(script|embed|frames)/i,e.innerHTML)?(Ce&&3===e.nodeType&&(t=e.textContent,t=g(t,oe," "),t=g(t,se," "),t=g(t,ie," "),e.textContent!==t&&(d(r.removed,{element:e.cloneNode()}),e.textContent=t)),pt("afterSanitizeElements",e,null),!1):(it(e),!0)},ft=function(e,t,n){if(Ie&&("id"===t||"name"===t)&&(n in a||n in Je))return!1;if(be&&!ve[t]&&A(ae,t));else if(Ae&&A(le,t));else if(!he[t]||ve[t]){if(!(ht(e)&&(ge.tagNameCheck instanceof RegExp&&A(ge.tagNameCheck,e)||ge.tagNameCheck instanceof Function&&ge.tagNameCheck(e))&&(ge.attributeNameCheck instanceof RegExp&&A(ge.attributeNameCheck,t)||ge.attributeNameCheck instanceof Function&&ge.attributeNameCheck(t))||"is"===t&&ge.allowCustomizedBuiltInElements&&(ge.tagNameCheck instanceof RegExp&&A(ge.tagNameCheck,n)||ge.tagNameCheck instanceof Function&&ge.tagNameCheck(n))))return!1}else if(Be[t]);else if(A(pe,g(n,ue,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==y(n,"data:")||!Ue[e])if(_e&&!A(ce,g(n,ue,"")));else if(n)return!1;return!0},ht=function(e){return e.indexOf("-")>0},mt=function(e){let t,n,o,s;pt("beforeSanitizeAttributes",e,null);const{attributes:i}=e;if(!i)return;const a={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:he};for(s=i.length;s--;){t=i[s];const{name:l,namespaceURI:c}=t;if(n="value"===l?t.value:v(t.value),o=Ke(l),a.attrName=o,a.attrValue=n,a.keepAttr=!0,a.forceKeepAttr=void 0,pt("uponSanitizeAttribute",e,a),n=a.attrValue,a.forceKeepAttr)continue;if(at(l,e),!a.keepAttr)continue;if(!we&&A(/\/>/i,n)){at(l,e);continue}Ce&&(n=g(n,oe," "),n=g(n,se," "),n=g(n,ie," "));const u=Ke(e.nodeName);if(ft(u,o,n)){if(!Ne||"id"!==o&&"name"!==o||(at(l,e),n="user-content-"+n),K&&"object"==typeof z&&"function"==typeof z.getAttributeType)if(c);else switch(z.getAttributeType(u,o)){case"TrustedHTML":n=K.createHTML(n);break;case"TrustedScriptURL":n=K.createScriptURL(n)}try{c?e.setAttributeNS(c,l,n):e.setAttribute(l,n),p(r.removed)}catch(e){}}}pt("afterSanitizeAttributes",e,null)},gt=function e(t){let n;const r=ct(t);for(pt("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)pt("uponSanitizeShadowNode",n,null),dt(n)||(n.content instanceof l&&e(n.content),mt(n));pt("afterSanitizeShadowDOM",t,null)};return r.sanitize=function(e){let t,n,s,i,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(We=!e,We&&(e="\x3c!--\x3e"),"string"!=typeof e&&!ut(e)){if("function"!=typeof e.toString)throw b("toString is not a function");if("string"!=typeof(e=e.toString()))throw b("dirty is not a string, aborting")}if(!r.isSupported)return e;if(Se||et(a),r.removed=[],"string"==typeof e&&(Le=!1),Le){if(e.nodeName){const t=Ke(e.nodeName);if(!de[t]||ye[t])throw b("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof _)t=lt("\x3c!----\x3e"),n=t.ownerDocument.importNode(e,!0),1===n.nodeType&&"BODY"===n.nodeName||"HTML"===n.nodeName?t=n:t.appendChild(n);else{if(!Re&&!Ce&&!xe&&-1===e.indexOf("<"))return K&&Te?K.createHTML(e):e;if(t=lt(e),!t)return Re?null:Te?Q:""}t&&Ee&&it(t.firstChild);const c=ct(Le?e:t);for(;s=c.nextNode();)dt(s)||(s.content instanceof l&>(s.content),mt(s));if(Le)return e;if(Re){if(ke)for(i=ee.call(t.ownerDocument);t.firstChild;)i.appendChild(t.firstChild);else i=t;return(he.shadowroot||he.shadowrootmode)&&(i=ne.call(o,i,!0)),i}let u=xe?t.outerHTML:t.innerHTML;return xe&&de["!doctype"]&&t.ownerDocument&&t.ownerDocument.doctype&&t.ownerDocument.doctype.name&&A(W,t.ownerDocument.doctype.name)&&(u="\n"+u),Ce&&(u=g(u,oe," "),u=g(u,se," "),u=g(u,ie," ")),K&&Te?K.createHTML(u):u},r.setConfig=function(e){et(e),Se=!0},r.clearConfig=function(){Qe=null,Se=!1},r.isValidAttribute=function(e,t,n){Qe||et({});const r=Ke(e),o=Ke(t);return ft(r,o,n)},r.addHook=function(e,t){"function"==typeof t&&(re[e]=re[e]||[],d(re[e],t))},r.removeHook=function(e){if(re[e])return p(re[e])},r.removeHooks=function(e){re[e]&&(re[e]=[])},r.removeAllHooks=function(){re={}},r}()}()},286:function(e,t){var n,r;n=function e(){"use strict";var t="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==t?t:{},n=!t.document&&!!t.postMessage,r=t.IS_PAPA_WORKER||!1,o={},s=0,i={parse:function(n,r){var a=(r=r||{}).dynamicTyping||!1;if(_(a)&&(r.dynamicTypingFunction=a,a={}),r.dynamicTyping=a,r.transform=!!_(r.transform)&&r.transform,r.worker&&i.WORKERS_SUPPORTED){var l=function(){if(!i.WORKERS_SUPPORTED)return!1;var n,r,a=(n=t.URL||t.webkitURL||null,r=e.toString(),i.BLOB_URL||(i.BLOB_URL=n.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",r,")();"],{type:"text/javascript"})))),l=new t.Worker(a);return l.onmessage=g,l.id=s++,o[l.id]=l}();return l.userStep=r.step,l.userChunk=r.chunk,l.userComplete=r.complete,l.userError=r.error,r.step=_(r.step),r.chunk=_(r.chunk),r.complete=_(r.complete),r.error=_(r.error),delete r.worker,void l.postMessage({input:n,config:r,workerId:l.id})}var f=null;return i.NODE_STREAM_INPUT,"string"==typeof n?(n=function(e){return 65279===e.charCodeAt(0)?e.slice(1):e}(n),f=r.download?new c(r):new p(r)):!0===n.readable&&_(n.read)&&_(n.on)?f=new d(r):(t.File&&n instanceof File||n instanceof Object)&&(f=new u(r)),f.stream(n)},unparse:function(e,t){var n=!1,r=!0,o=",",s="\r\n",a='"',l=a+a,c=!1,u=null,p=!1;!function(){if("object"==typeof t){if("string"!=typeof t.delimiter||i.BAD_DELIMITERS.filter((function(e){return-1!==t.delimiter.indexOf(e)})).length||(o=t.delimiter),("boolean"==typeof t.quotes||"function"==typeof t.quotes||Array.isArray(t.quotes))&&(n=t.quotes),"boolean"!=typeof t.skipEmptyLines&&"string"!=typeof t.skipEmptyLines||(c=t.skipEmptyLines),"string"==typeof t.newline&&(s=t.newline),"string"==typeof t.quoteChar&&(a=t.quoteChar),"boolean"==typeof t.header&&(r=t.header),Array.isArray(t.columns)){if(0===t.columns.length)throw new Error("Option columns is empty");u=t.columns}void 0!==t.escapeChar&&(l=t.escapeChar+a),("boolean"==typeof t.escapeFormulae||t.escapeFormulae instanceof RegExp)&&(p=t.escapeFormulae instanceof RegExp?t.escapeFormulae:/^[=+\-@\t\r].*$/)}}();var d=new RegExp(h(a),"g");if("string"==typeof e&&(e=JSON.parse(e)),Array.isArray(e)){if(!e.length||Array.isArray(e[0]))return f(null,e,c);if("object"==typeof e[0])return f(u||Object.keys(e[0]),e,c)}else if("object"==typeof e)return"string"==typeof e.data&&(e.data=JSON.parse(e.data)),Array.isArray(e.data)&&(e.fields||(e.fields=e.meta&&e.meta.fields||u),e.fields||(e.fields=Array.isArray(e.data[0])?e.fields:"object"==typeof e.data[0]?Object.keys(e.data[0]):[]),Array.isArray(e.data[0])||"object"==typeof e.data[0]||(e.data=[e.data])),f(e.fields||[],e.data||[],c);throw new Error("Unable to serialize unrecognized input");function f(e,t,n){var i="";"string"==typeof e&&(e=JSON.parse(e)),"string"==typeof t&&(t=JSON.parse(t));var a=Array.isArray(e)&&0=this._config.preview;if(r)t.postMessage({results:a,workerId:i.WORKER_ID,finished:c});else if(_(this._config.chunk)&&!n){if(this._config.chunk(a,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);a=void 0,this._completeResults=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(a.data),this._completeResults.errors=this._completeResults.errors.concat(a.errors),this._completeResults.meta=a.meta),this._completed||!c||!_(this._config.complete)||a&&a.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),c||a&&a.meta.paused||this._nextChunk(),a}this._halted=!0},this._sendError=function(e){_(this._config.error)?this._config.error(e):r&&this._config.error&&t.postMessage({workerId:i.WORKER_ID,error:e,finished:!1})}}function c(e){var t;(e=e||{}).chunkSize||(e.chunkSize=i.RemoteChunkSize),l.call(this,e),this._nextChunk=n?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(e){this._input=e,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(t=new XMLHttpRequest,this._config.withCredentials&&(t.withCredentials=this._config.withCredentials),n||(t.onload=b(this._chunkLoaded,this),t.onerror=b(this._chunkError,this)),t.open(this._config.downloadRequestBody?"POST":"GET",this._input,!n),this._config.downloadRequestHeaders){var e=this._config.downloadRequestHeaders;for(var r in e)t.setRequestHeader(r,e[r])}if(this._config.chunkSize){var o=this._start+this._config.chunkSize-1;t.setRequestHeader("Range","bytes="+this._start+"-"+o)}try{t.send(this._config.downloadRequestBody)}catch(e){this._chunkError(e.message)}n&&0===t.status&&this._chunkError()}},this._chunkLoaded=function(){4===t.readyState&&(t.status<200||400<=t.status?this._chunkError():(this._start+=this._config.chunkSize?this._config.chunkSize:t.responseText.length,this._finished=!this._config.chunkSize||this._start>=function(e){var t=e.getResponseHeader("Content-Range");return null===t?-1:parseInt(t.substring(t.lastIndexOf("/")+1))}(t),this.parseChunk(t.responseText)))},this._chunkError=function(e){var n=t.statusText||e;this._sendError(new Error(n))}}function u(e){var t,n;(e=e||{}).chunkSize||(e.chunkSize=i.LocalChunkSize),l.call(this,e);var r="undefined"!=typeof FileReader;this.stream=function(e){this._input=e,n=e.slice||e.webkitSlice||e.mozSlice,r?((t=new FileReader).onload=b(this._chunkLoaded,this),t.onerror=b(this._chunkError,this)):t=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount=this._input.size,this.parseChunk(e.target.result)},this._chunkError=function(){this._sendError(t.error)}}function p(e){var t;l.call(this,e=e||{}),this.stream=function(e){return t=e,this._nextChunk()},this._nextChunk=function(){if(!this._finished){var e,n=this._config.chunkSize;return n?(e=t.substring(0,n),t=t.substring(n)):(e=t,t=""),this._finished=!t,this.parseChunk(e)}}}function d(e){l.call(this,e=e||{});var t=[],n=!0,r=!1;this.pause=function(){l.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){l.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(e){this._input=e,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){r&&1===t.length&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),t.length?this.parseChunk(t.shift()):n=!0},this._streamData=b((function(e){try{t.push("string"==typeof e?e:e.toString(this._config.encoding)),n&&(n=!1,this._checkIsFinished(),this.parseChunk(t.shift()))}catch(e){this._streamError(e)}}),this),this._streamError=b((function(e){this._streamCleanUp(),this._sendError(e)}),this),this._streamEnd=b((function(){this._streamCleanUp(),r=!0,this._streamData("")}),this),this._streamCleanUp=b((function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)}),this)}function f(e){var t,n,r,o=Math.pow(2,53),s=-o,a=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,l=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,c=this,u=0,p=0,d=!1,f=!1,g=[],y={data:[],errors:[],meta:{}};if(_(e.step)){var v=e.step;e.step=function(t){if(y=t,C())w();else{if(w(),0===y.data.length)return;u+=t.data.length,e.preview&&u>e.preview?n.abort():(y.data=y.data[0],v(y,c))}}}function b(t){return"greedy"===e.skipEmptyLines?""===t.join("").trim():1===t.length&&0===t[0].length}function w(){return y&&r&&(S("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+i.DefaultDelimiter+"'"),r=!1),e.skipEmptyLines&&(y.data=y.data.filter((function(e){return!b(e)}))),C()&&function(){if(y)if(Array.isArray(y.data[0])){for(var t=0;C()&&t=g.length?"__parsed_extra":g[r]),e.transform&&(i=e.transform(i,s)),i=x(s,i),"__parsed_extra"===s?(o[s]=o[s]||[],o[s].push(i)):o[s]=i}return e.header&&(r>g.length?S("FieldMismatch","TooManyFields","Too many fields: expected "+g.length+" fields but parsed "+r,p+n):r=r.length/2?"\r\n":"\r"}(o,l)),r=!1,e.delimiter)_(e.delimiter)&&(e.delimiter=e.delimiter(o),y.meta.delimiter=e.delimiter);else{var c=function(t,n,r,o,s){var a,l,c,u;s=s||[",","\t","|",";",i.RECORD_SEP,i.UNIT_SEP];for(var p=0;p=a)return G(!0)}else for(B=u,u++;;){if(-1===(B=i.indexOf(t,B+1)))return f||w.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:b.length,index:u}),H();if(B===m-1)return H(i.substring(u,B).replace(M,t));if(t!==c||i[B+1]!==c){if(t===c||0===B||i[B-1]!==c){-1!==D&&D=a)return G(!0);break}w.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:b.length,index:u}),B++}}else B++}return H();function q(e){b.push(e),x=u}function $(e){var t=0;if(-1!==e){var n=i.substring(B+1,e);n&&""===n.trim()&&(t=n.length)}return t}function H(e){return f||(void 0===e&&(e=i.substring(u)),C.push(e),u=m,q(C),A&&Y()),G()}function W(e){u=e,q(C),C=[],U=i.indexOf(r,u)}function G(e){return{data:b,errors:w,meta:{delimiter:n,linebreak:r,aborted:p,truncated:!!e,cursor:x+(d||0)}}}function Y(){s(G()),b=[],w=[]}},this.abort=function(){p=!0},this.getCharIndex=function(){return u}}function g(e){var t=e.data,n=o[t.workerId],r=!1;if(t.error)n.userError(t.error,t.file);else if(t.results&&t.results.data){var s={abort:function(){r=!0,y(t.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:v,resume:v};if(_(n.userStep)){for(var i=0;i{"use strict";var r=n(586);function o(){}function s(){}s.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,s,i){if(i!==r){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:s,resetWarningCache:o};return n.PropTypes=n,n}},980:(e,t,n)=>{e.exports=n(262)()},586:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},837:(e,t,n)=>{"use strict";var r=n(196),o=Symbol.for("react.element"),s=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,a=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,n){var r,s={},c=null,u=null;for(r in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)i.call(t,r)&&!l.hasOwnProperty(r)&&(s[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===s[r]&&(s[r]=t[r]);return{$$typeof:o,type:e,key:c,ref:u,props:s,_owner:a.current}}t.Fragment=s,t.jsx=c,t.jsxs=c},322:(e,t,n)=>{"use strict";e.exports=n(837)},665:e=>{e.exports=function(e,t,n,r){var o=n?n.call(r,e,t):void 0;if(void 0!==o)return!!o;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var s=Object.keys(e),i=Object.keys(t);if(s.length!==i.length)return!1;for(var a=Object.prototype.hasOwnProperty.bind(t),l=0;l{"use strict";var t=[];function n(e){for(var n=-1,r=0;r{"use strict";var t={};e.exports=function(e,n){var r=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(n)}},173:e=>{"use strict";e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},892:(e,t,n)=>{"use strict";e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},36:e=>{"use strict";e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var r="";n.supports&&(r+="@supports (".concat(n.supports,") {")),n.media&&(r+="@media ".concat(n.media," {"));var o=void 0!==n.layer;o&&(r+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),r+=n.css,o&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}");var s=n.sourceMap;s&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(s))))," */")),t.styleTagTransform(r,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},464:e=>{"use strict";e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},196:e=>{"use strict";e.exports=window.React}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var s=t[r]={id:r,exports:{}};return e[r].call(s.exports,s,s.exports,n),s.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nc=void 0;var r={};return(()=>{"use strict";n.r(r),n.d(r,{AudioPicker:()=>$t,CSVUploader:()=>Jt,Checkboxes:()=>Gt,ImagePicker:()=>nn,MediaPicker:()=>cn,PostPicker:()=>sr,PostSelector:()=>ar,SafeHtml:()=>fn,Selector:()=>Ar,TermSelector:()=>_r,VideoPicker:()=>Sr,getMediaUrl:()=>Qt,parseCSVFile:()=>Kt,useDebounce:()=>gn,useHasInnerBlocks:()=>yn,useInnerBlocks:()=>An,useInnerBlocksAttributes:()=>_n,useInnerBlocksCount:()=>bn,useInnerBlocksIndex:()=>vn,useMedia:()=>wn,useParentBlock:()=>Cn,useParentBlockAttributes:()=>xn,usePost:()=>Sn,usePostById:()=>kn,usePostMeta:()=>Nn,usePostMetaValue:()=>On,usePosts:()=>Ln,useTerms:()=>Pn});var e=n(322),t=n(980),o=n.n(t),s=function(){return s=Object.assign||function(e){for(var t,n=1,r=arguments.length;n2||G(U)>3?"":" "}function Z(e,t){for(;--t&&q()&&!(U<48||U>102||U>57&&U<65||U>70&&U<97););return W(e,H()+(t<6&&32==$()&&32==q()))}function K(e){for(;q();)switch(U){case e:return D;case 34:case 39:34!==e&&39!==e&&K(U);break;case 40:41===e&&K(e);break;case 92:q()}return D}function Q(e,t){for(;q()&&e+U!==57&&(e+U!==84||47!==$()););return"/*"+W(t,D-1)+"*"+_(47===e?e:q())}function J(e){for(;!G($());)q();return W(e,D)}function X(e,t){for(var n="",r=0;r6)switch(R(e,t+1)){case 109:if(45!==R(e,t+4))break;case 102:return S(e,/(.+:)(.+)-([^]+)/,"$1"+f+"$2-$3$1"+d+(108==R(e,t+3)?"$3":"$2-$3"))+e;case 115:return~E(e,"stretch")?te(S(e,"stretch","fill-available"),t,n)+e:e}break;case 5152:case 5920:return S(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,(function(t,n,r,o,s,i,a){return p+n+":"+r+a+(o?p+n+"-span:"+(s?i:+i-+r)+a:"")+e}));case 4949:if(121===R(e,t+6))return S(e,":",":"+f)+e;break;case 6444:switch(R(e,45===R(e,14)?18:11)){case 120:return S(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+f+(45===R(e,14)?"inline-":"")+"box$3$1"+f+"$2$3$1"+p+"$2box$3")+e;case 100:return S(e,":",":"+p)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return S(e,"scroll-","scroll-snap-")+e}return e}function ne(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case g:return void(e.return=te(e.value,e.length,n));case v:return X([F(e,{value:S(e.value,"@","@"+f)})],r);case m:if(e.length)return function(e,t){return e.map(t).join("")}(n=e.props,(function(t){switch(x(t,r=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":z(F(e,{props:[S(t,/:(read-\w+)/,":"+d+"$1")]})),z(F(e,{props:[t]})),w(e,{props:O(n,r)});break;case"::placeholder":z(F(e,{props:[S(t,/:(plac\w+)/,":"+f+"input-$1")]})),z(F(e,{props:[S(t,/:(plac\w+)/,":"+d+"$1")]})),z(F(e,{props:[S(t,/:(plac\w+)/,p+"input-$1")]})),z(F(e,{props:[t]})),w(e,{props:O(n,r)})}return""}))}}function re(e){return function(e){return M="",e}(oe("",null,null,null,[""],e=function(e){return L=P=1,j=T(M=e),D=0,[]}(e),0,[0],e))}function oe(e,t,n,r,o,s,i,a,l){for(var c=0,u=0,p=i,d=0,f=0,h=0,m=1,g=1,y=1,v=0,A="",b=o,w=s,C=r,x=A;g;)switch(h=v,v=q()){case 40:if(108!=h&&58==R(x,p-1)){-1!=E(x+=S(Y(v),"&","&\f"),"&\f")&&(y=-1);break}case 34:case 39:case 91:x+=Y(v);break;case 9:case 10:case 13:case 32:x+=V(h);break;case 92:x+=Z(H()-1,7);continue;case 47:switch($()){case 42:case 47:N(ie(Q(q(),H()),t,n,l),l);break;default:x+="/"}break;case 123*m:a[c++]=T(x)*y;case 125*m:case 59:case 0:switch(v){case 0:case 125:g=0;case 59+u:-1==y&&(x=S(x,/\f/g,"")),f>0&&T(x)-p&&N(f>32?ae(x+";",r,n,p-1,l):ae(S(x," ","")+";",r,n,p-2,l),l);break;case 59:x+=";";default:if(N(C=se(x,t,n,c,u,o,a,A,b=[],w=[],p,s),s),123===v)if(0===u)oe(x,t,C,C,b,s,p,a,w);else switch(99===d&&110===R(x,3)?100:d){case 100:case 108:case 109:case 115:oe(e,C,C,r&&N(se(e,C,C,0,0,o,a,A,o,b=[],p,w),w),o,w,p,a,r?b:w);break;default:oe(x,C,C,C,[""],w,0,a,w)}}c=u=f=0,m=y=1,A=x="",p=i;break;case 58:p=1+T(x),f=h;default:if(m<1)if(123==v)--m;else if(125==v&&0==m++&&125==(U=D>0?R(M,--D):0,P--,10===U&&(P=1,L--),U))continue;switch(x+=_(v),v*m){case 38:y=u>0?1:(x+="\f",-1);break;case 44:a[c++]=(T(x)-1)*y,y=1;break;case 64:45===$()&&(x+=Y(q())),d=$(),u=p=T(A=x+=J(H())),v++;break;case 45:45===h&&2==T(x)&&(m=0)}}return s}function se(e,t,n,r,o,s,i,a,l,c,u,p){for(var d=o-1,f=0===o?s:[""],h=I(f),g=0,y=0,v=0;g0?f[A]+" "+_:S(_,/&\f/g,f[A])))&&(l[v++]=w);return B(e,t,n,0===o?m:a,l,c,u,p)}function ie(e,t,n,r){return B(e,t,n,h,_(U),k(e,2,-2),0,r)}function ae(e,t,n,r,o){return B(e,t,n,g,k(e,0,r),k(e,r+1,-1),r,o)}const le={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};var ce="undefined"!=typeof process&&void 0!==process.env&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",ue="undefined"!=typeof window&&"HTMLElement"in window,pe=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env&&void 0!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&""!==process.env.REACT_APP_SC_DISABLE_SPEEDY?"false"!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&process.env.REACT_APP_SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env&&void 0!==process.env.SC_DISABLE_SPEEDY&&""!==process.env.SC_DISABLE_SPEEDY&&"false"!==process.env.SC_DISABLE_SPEEDY&&process.env.SC_DISABLE_SPEEDY),de=(new Set,Object.freeze([])),fe=Object.freeze({}),he=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),me=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,ge=/(^-|-$)/g;function ye(e){return e.replace(me,"-").replace(ge,"")}var ve=/(a)(d)/gi,Ae=function(e){return String.fromCharCode(e+(e>25?39:97))};function be(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=Ae(t%52)+n;return(Ae(t%52)+n).replace(ve,"$1-$2")}var _e,we=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},Ce=function(e){return we(5381,e)};function xe(e){return"string"==typeof e&&!0}var Se="function"==typeof Symbol&&Symbol.for,Ee=Se?Symbol.for("react.memo"):60115,Re=Se?Symbol.for("react.forward_ref"):60112,ke={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},Te={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Ie={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Ne=((_e={})[Re]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},_e[Ee]=Ie,_e);function Oe(e){return("type"in(t=e)&&t.type.$$typeof)===Ee?Ie:"$$typeof"in e?Ne[e.$$typeof]:ke;var t}var Le=Object.defineProperty,Pe=Object.getOwnPropertyNames,je=Object.getOwnPropertySymbols,De=Object.getOwnPropertyDescriptor,Ue=Object.getPrototypeOf,Me=Object.prototype;function Be(e,t,n){if("string"!=typeof t){if(Me){var r=Ue(t);r&&r!==Me&&Be(e,r,n)}var o=Pe(t);je&&(o=o.concat(je(t)));for(var s=Oe(e),i=Oe(t),a=0;a0?" Args: ".concat(t.join(", ")):""))}var Ve=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}return e.prototype.indexOfGroup=function(e){for(var t=0,n=0;n=this.groupSizes.length){for(var n=this.groupSizes,r=n.length,o=r;e>=o;)if((o<<=1)<0)throw Ye(16,"".concat(e));this.groupSizes=new Uint32Array(o),this.groupSizes.set(n),this.length=o;for(var s=r;s=this.length||0===this.groupSizes[e])return t;for(var n=this.groupSizes[e],r=this.indexOfGroup(e),o=r+n,s=r;s=0){var n=document.createTextNode(t);return this.element.insertBefore(n,this.nodes[e]||null),this.length++,!0}return!1},e.prototype.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},e.prototype.getRule=function(e){return e0&&(l+="".concat(e,","))})),r+="".concat(i).concat(a,'{content:"').concat(l,'"}').concat("/*!sc*/\n")},s=0;s0?".".concat(t):e},u=l.slice();u.push((function(e){e.type===m&&e.value.includes("&")&&(e.props[0]=e.props[0].replace(dt,n).replace(r,c))})),i.prefix&&u.push(ne),u.push(ee);var p=function(e,o,s,a){void 0===o&&(o=""),void 0===s&&(s=""),void 0===a&&(a="&"),t=a,n=o,r=new RegExp("\\".concat(n,"\\b"),"g");var l=e.replace(ft,""),c=re(s||o?"".concat(s," ").concat(o," { ").concat(l," }"):l);i.namespace&&(c=ht(c,i.namespace));var p,d,f,h=[];return X(c,(p=u.concat((f=function(e){return h.push(e)},function(e){e.root||(e=e.return)&&f(e)})),d=I(p),function(e,t,n,r){for(var o="",s=0;s="A"&&e<="Z"};function xt(e){for(var t="",n=0;n>>0);if(!t.hasNameForId(this.componentId,s)){var i=n(o,".".concat(s),void 0,this.componentId);t.insertRules(this.componentId,s,i)}r=qe(r,s),this.staticRulesId=s}else{for(var a=we(this.baseHash,n.hash),l="",c=0;c>>0);t.hasNameForId(this.componentId,d)||t.insertRules(this.componentId,d,n(l,".".concat(d),void 0,this.componentId)),r=qe(r,d)}}return r},e}(),Nt=l().createContext(void 0);Nt.Consumer;var Ot={};function Lt(e,t,n){var r=ze(e),o=e,i=!xe(e),c=t.attrs,u=void 0===c?de:c,p=t.componentId,d=void 0===p?function(e,t){var n="string"!=typeof e?"sc":ye(e);Ot[n]=(Ot[n]||0)+1;var r="".concat(n,"-").concat(function(e){return be(Ce(e)>>>0)}("6.0.5"+n+Ot[n]));return t?"".concat(t,"-").concat(r):r}(t.displayName,t.parentComponentId):p,f=(void 0===t.displayName&&function(e){xe(e)?"styled.".concat(e):"Styled(".concat(function(e){return e.displayName||e.name||"Component"}(e),")")}(e),t.displayName&&t.componentId?"".concat(ye(t.displayName),"-").concat(t.componentId):t.componentId||d),h=r&&o.attrs?o.attrs.concat(u).filter(Boolean):u,m=t.shouldForwardProp;if(r&&o.shouldForwardProp){var g=o.shouldForwardProp;if(t.shouldForwardProp){var y=t.shouldForwardProp;m=function(e,t){return g(e,t)&&y(e,t)}}else m=g}var v=new It(n,f,r?o.componentStyle:void 0),A=l().forwardRef((function(e,t){return function(e,t,n){var r=e.attrs,o=e.componentStyle,i=e.defaultProps,c=e.foldedComponentIds,u=e.styledComponentId,p=e.target,d=l().useContext(Nt),f=bt(),h=e.shouldForwardProp||f.shouldForwardProp,m=function(e,t,n){for(var r,o=s(s({},t),{className:void 0,theme:n}),i=0;i2&&pt.registerId(this.componentId+e),this.removeStyles(e,n),this.createStyles(e,t,n,r)}}(),function(){function e(){var e=this;this._emitSheetCSS=function(){var t=e.instance.toString(),n=ot(),r=$e([n&&'nonce="'.concat(n,'"'),"".concat(ce,'="true"'),"".concat("data-styled-version",'="').concat("6.0.5",'"')].filter(Boolean)," ");return"")},this.getStyleTags=function(){if(e.sealed)throw Ye(2);return e._emitSheetCSS()},this.getStyleElement=function(){var t;if(e.sealed)throw Ye(2);var n=((t={})[ce]="",t["data-styled-version"]="6.0.5",t.dangerouslySetInnerHTML={__html:e.instance.toString()},t),r=ot();return r&&(n.nonce=r),[l().createElement("style",s({},n,{key:"sc-0-0"}))]},this.seal=function(){e.sealed=!0},this.instance=new pt({isServer:!0}),this.sealed=!1}e.prototype.collectStyles=function(e){if(this.sealed)throw Ye(2);return l().createElement(_t,{sheet:this.instance},e)},e.prototype.interleaveWithNodeStream=function(e){throw Ye(3)}}(),"__sc-".concat(ce,"__");const Ft=Bt.div` + height: auto; + width: 100%; +`,zt=({src:t})=>(0,e.jsx)(Ft,{children:(0,e.jsx)("audio",{className:"edit-audio-preview",controls:!0,src:t})});zt.propTypes={src:o().string.isRequired};const qt=({className:t,onReset:n,onUpdate:r,onUpdateURL:o,value:s,valueURL:i})=>(0,e.jsx)(cn,{allowedTypes:["audio"],className:t,icon:"format-audio",onReset:n,onUpdate:r,onUpdateURL:o,preview:zt,value:s,valueURL:i});qt.defaultProps={className:"",onUpdateURL:null,valueURL:""},qt.propTypes={className:o().string,onReset:o().func.isRequired,onUpdate:o().func.isRequired,onUpdateURL:o().func,value:o().number.isRequired,valueURL:o().string};const $t=qt,Ht=window.wp.components,Wt=({label:t,value:n,options:r,onChange:o})=>(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Ht.BaseControl,{label:t}),r.map((t=>(0,e.jsx)(Ht.CheckboxControl,{label:t.label,checked:n.includes(t.value),onChange:e=>{o(e?[...n,t.value]:[...n.filter((e=>e!==t.value))])}})))]});Wt.propTypes={label:o().string.isRequired,value:o().arrayOf(o().string).isRequired,options:o().arrayOf(o().shape({label:o().string.isRequired,value:o().string.isRequired})).isRequired,onChange:o().func.isRequired};const Gt=Wt,Yt=window.wp.i18n;var Vt=n(286),Zt=n.n(Vt);const Kt=e=>new Promise(((t,n)=>{Zt().parse(e,{complete:e=>t(e.data),dynamicTyping:!0,error:e=>n(e),header:!0,skipEmptyLines:!0})})),Qt=(e,t="full")=>{const{media_details:{sizes:{[t]:{source_url:n=""}={},full:{source_url:r=""}={}}={}}={},sizes:{[t]:{url:o=""}={},full:{url:s=""}={}}={},source_url:i="",url:a=""}=e;return o||n||s||r||a||i||""};class Jt extends l().PureComponent{static handleSubmit(e){e.preventDefault()}constructor(e){super(e),this.handleChange=this.handleChange.bind(this),this.state={error:"",success:""}}handleChange(e){const{attributeName:t,callback:n,setAttributes:r}=this.props;e.target.files&&e.target.files[0]&&Kt(e.target.files[0]).then((e=>n?n(e):e)).then((e=>{Array.isArray(e)&&e.length>0?(this.setState({error:"",success:(0,Yt.__)("Successfully read CSV data.","alley-scripts")}),r({[t]:JSON.stringify(e)})):this.setState({error:(0,Yt.__)("Could not map CSV data. Please check the source file to ensure that it has the correct structure.","alley-scripts"),success:""})})).catch((e=>{this.setState({error:e,success:""})}))}render(){const{error:t="",success:n=""}=this.state;return(0,e.jsxs)("div",{className:"alley-scripts-block-csv-uploader",children:[(0,e.jsx)("h2",{children:(0,Yt.__)("Upload CSV","alley-scripts")}),(0,e.jsxs)("form",{onSubmit:this.handleSubmit,children:[""!==t?(0,e.jsxs)("div",{style:{color:"#c00"},children:[(0,e.jsx)("strong",{children:(0,Yt.__)("Error:","alley-scripts")})," ",t]}):null,""!==n?(0,e.jsxs)("div",{style:{color:"#0c0"},children:[(0,e.jsx)("strong",{children:(0,Yt.__)("Success:","alley-scripts")})," ",n]}):null,(0,e.jsx)("div",{children:(0,e.jsxs)("label",{htmlFor:"alley-scripts-block-csv-uploader-file",children:[(0,e.jsx)("p",{children:(0,Yt.__)("Select a file to load data.","alley-scripts")}),(0,e.jsx)("input",{id:"alley-scripts-block-csv-uploader-file",onChange:this.handleChange,type:"file"})]})})]})]})}}Jt.defaultProps={callback:null},Jt.propTypes={attributeName:o().string.isRequired,callback:o().func,setAttributes:o().func.isRequired};const Xt=Bt.div` + box-sizing: border-box; + flex-shrink: 0; + height: auto; + max-height: 1450px; + max-width: 1450px; + min-height: 20px; + min-width: 20px; + position: relative; + width: auto; +`,en=({src:t})=>(0,e.jsx)(Xt,{children:(0,e.jsx)("img",{alt:(0,Yt.__)("Edit image","alley-scripts"),className:"edit-image-preview",src:t,title:(0,Yt.__)("Edit image","alley-scripts")})});en.propTypes={src:o().string.isRequired};const tn=({className:t,imageSize:n,displayControlsInToolbar:r,onReset:o,onUpdate:s,onUpdateURL:i,value:a,valueURL:l})=>(0,e.jsx)(cn,{allowedTypes:["image"],className:t,icon:"format-image",imageSize:n,displayControlsInToolbar:r,onReset:o,onUpdate:s,onUpdateURL:i,preview:en,value:a,valueURL:l});tn.defaultProps={className:"",imageSize:"thumbnail",displayControlsInToolbar:!1,onUpdateURL:null,valueURL:""},tn.propTypes={className:o().string,imageSize:o().string,displayControlsInToolbar:o().bool,onReset:o().func.isRequired,onUpdate:o().func.isRequired,onUpdateURL:o().func,value:o().number.isRequired,valueURL:o().string};const nn=tn,rn=window.wp.blockEditor,on=window.wp.data,sn=Bt.div` + display: block; + position: relative; +`,an=Bt.div` + background: white; + border: 1px solid black; + padding: 1em; +`,ln=({allowedTypes:t,className:n,icon:r,imageSize:o,displayControlsInToolbar:s,onReset:i,onUpdate:a,onUpdateURL:l,preview:c,value:u,valueURL:p})=>{const{media:d}=(0,on.useSelect)((e=>({media:u?e("core").getMedia(u):void 0})),[u]);if(0!==u&&null===d)return(0,e.jsx)(Ht.Spinner,{});const f=d?Qt(d,o):p;return f?(0,e.jsxs)(sn,{className:n,children:[c?(0,e.jsx)(c,{src:f}):(0,e.jsxs)(an,{className:"alley-scripts-media-picker__preview",children:[(0,e.jsx)("p",{children:(0,Yt.__)("Selected file:","alley-scripts")}),(0,e.jsx)("p",{children:(0,e.jsx)("a",{href:f,children:f})})]}),s?(0,e.jsx)(rn.BlockControls,{group:"other",children:(0,e.jsx)(rn.MediaReplaceFlow,{name:(0,Yt.__)("Edit Media","alley-scripts"),mediaId:u,mediaURL:f,allowedTypes:t,onSelect:a,onSelectURL:l,children:(0,e.jsx)(Ht.ToolbarButton,{isDestructive:!0,text:(0,Yt.__)("Remove","alley-scripts"),onClick:i})})}):(0,e.jsx)(Ht.Button,{variant:"primary",onClick:i,children:(0,Yt.__)("Reset","alley-scripts")})]}):(0,e.jsx)(sn,{className:n,children:(0,e.jsx)(rn.MediaPlaceholder,{allowedTypes:t,disableMediaButtons:!!p,icon:(0,e.jsx)(rn.BlockIcon,{icon:r}),onSelect:a,onSelectURL:l,value:{id:u,src:f}})})};ln.defaultProps={allowedTypes:[],className:"",icon:"format-aside",imageSize:"thumbnail",displayControlsInToolbar:!1,onUpdateURL:null,preview:null,valueURL:""},ln.propTypes={allowedTypes:o().arrayOf(o().string),className:o().string,icon:o().string,imageSize:o().string,displayControlsInToolbar:o().bool,onReset:o().func.isRequired,onUpdate:o().func.isRequired,onUpdateURL:o().func,preview:o().element,value:o().number.isRequired,valueURL:o().string};const cn=ln;var un=n(368),pn=n.n(un);const dn=({className:t,html:n,tag:r})=>(0,e.jsx)(r,{className:t,dangerouslySetInnerHTML:{__html:pn().sanitize(n)}});dn.defaultProps={className:""},dn.propTypes={className:o().string,html:o().string.isRequired,tag:o().string.isRequired};const fn=dn,hn=window.wp.element,mn=window.wp.url,gn=(e,t)=>{const[n,r]=(0,hn.useState)(e);return(0,hn.useEffect)((()=>{const n=setTimeout((()=>{r(e)}),t);return()=>{clearTimeout(n)}}),[e,t]),n},yn=e=>bn(e)>0,vn=e=>{const t=Cn(e),n=An(t);return n?n.findIndex((t=>t.clientId===e)):-1},An=e=>(0,on.useSelect)((t=>t(rn.store).getBlocks(e)),[e]),_n=e=>An(e).map((e=>e.attributes)),bn=e=>An(e).length,wn=e=>(0,on.useSelect)((t=>t("core").getMedia(e)),[e]),Cn=e=>(0,on.useSelect)((t=>{const{getBlock:n,getBlockRootClientId:r}=t(rn.store),o=r(e);return o?n(o):null}),[e]),xn=e=>(0,on.useSelect)((t=>{const{getBlockAttributes:n,getBlockRootClientId:r}=t(rn.store),o=r(e);return o?n(o):null}),[e]),Sn=(e,t="post")=>(0,on.useSelect)((n=>n("core").getEntityRecord("postType",t,e)),[e,t]),En=window.wp.apiFetch;var Rn=n.n(En);const kn=(e,t=null)=>{const[n,r]=(0,hn.useState)({});return(0,hn.useEffect)((()=>{e&&!n[e]&&(async()=>{if(t){const n=await t(e);n?r((t=>({...t,[e]:n}))):console.error(`Custom function to get post with ID ${e} failed.`)}else{const t=(0,mn.addQueryArgs)("/wp/v2/search",{include:e}),n=await Rn()({path:t});r((t=>({...t,[e]:n[0].subtype})))}})()}),[e]),Sn(e,n[e]??"")},Tn=window.wp.coreData,In=window.lodash,Nn=(e=null,t=null)=>{const n=(0,on.useSelect)((t=>e||t("core/editor").getCurrentPostType()),[]),[r,o]=(0,Tn.useEntityProp)("postType",n,"meta",t),s="function"==typeof o?o:()=>console.error(`Error attempting to set post meta for post type ${n}. Does it have support for custom-fields?`);return["object"==typeof r?r:{},e=>s((0,In.cloneDeep)(e))]},On=(e,t=null,n=null)=>{const[r,o]=Nn(t,n);return[r[e],t=>o({...r,[e]:t})]},Ln=(e,t="post")=>(0,on.useSelect)((n=>{const{getEntityRecords:r}=n("core");return r("postType",t,{include:e})}),[e,t]),Pn=(e=null,t=null,n="categories")=>{const r=(0,on.useSelect)((t=>e||t("core/editor").getCurrentPostType()),[]),[o,s]=(0,Tn.useEntityProp)("postType",r,n,t);return[o,e=>s(e)]};var jn=n(62),Dn=n.n(jn),Un=n(36),Mn=n.n(Un),Bn=n(793),Fn=n.n(Bn),zn=n(892),qn=n.n(zn),$n=n(173),Hn=n.n($n),Wn=n(464),Gn=n.n(Wn),Yn=n(992),Vn={};Vn.styleTagTransform=Gn(),Vn.setAttributes=qn(),Vn.insert=Fn().bind(null,"head"),Vn.domAPI=Mn(),Vn.insertStyleElement=Hn(),Dn()(Yn.Z,Vn),Yn.Z&&Yn.Z.locals&&Yn.Z.locals;var Zn=n(779),Kn=n.n(Zn),Qn=n(905),Jn={};Jn.styleTagTransform=Gn(),Jn.setAttributes=qn(),Jn.insert=Fn().bind(null,"head"),Jn.domAPI=Mn(),Jn.insertStyleElement=Hn(),Dn()(Qn.Z,Jn),Qn.Z&&Qn.Z.locals&&Qn.Z.locals;const Xn=Bt.div` + align-items: center; + gap: 4px; + overflow-wrap: anywhere; + display: flex; + flex-direction: column; + justify-content: center; + padding: 0.5rem 0.75rem; +`,er=({title:t,postType:n,attachmentID:r})=>{const o=wn(r),s=o?.media_details?.sizes?.thumbnail?.source_url,i=o?.alt_text??"";return(0,e.jsxs)(Xn,{children:[s?(0,e.jsx)("img",{style:{maxWidth:"100%",height:"auto"},loading:"lazy",src:s,alt:i}):null,(0,e.jsx)(fn,{html:t,className:"post-picker-result-title",tag:"strong"}),(0,Yt.sprintf)(" (%s)",n)]})},tr=({baseUrl:t,searchRender:n,selected:r,setSelected:o,suppressPostIds:s=[]})=>{const[i,a]=(0,hn.useState)(!1),[l,c]=(0,hn.useState)([]),[u,p]=(0,hn.useState)(!1),[d,f]=(0,hn.useState)(0),[h,m]=(0,hn.useState)({searchValue:"",page:1}),g=(0,hn.useCallback)((async(e,n=!1)=>{if(e.searchValue&&e.searchValue.length<=2)return;const r=function(){let n=(0,mn.addQueryArgs)(t,{page:e.page,_embed:1,exclude:s.join(",")});return e.searchValue&&e.searchValue.length>2&&(n=(0,mn.addQueryArgs)(n,{search:e.searchValue})),n}();a(!0);const o=await Rn()({path:r,parse:!1});f(parseInt(o.headers.get("X-WP-TotalPages"),10));const i=await o.json();let u=i;e.page>1&&(u=[...l,...i]),n||(c(u),a(!1))}),[l,t,s]);return(0,hn.useEffect)((()=>{let e=!1;return u||(p(!0),g(h,e)),()=>{e=!0}}),[g,u,h]),(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Ht.TextControl,{value:h.searchValue,placeholder:(0,Yt.__)("Search...","alley-scripts"),label:(0,Yt.__)("Search","alley-scripts"),onChange:e=>{const t={...h,searchValue:e,page:1};m(t),g(t)}}),(0,e.jsxs)("div",{className:"alley-scripts-post-picker__post-list",children:[l?l.map((t=>(0,e.jsx)(Ht.Button,{className:Kn()({"alley-scripts-post-picker__post":!0,"is-selected":t.id===r}),onClick:()=>o(t.id),children:n?n(t):(0,e.jsx)(er,{title:t.title,postType:t.subtype,attachmentID:t?._embedded?.self[0]?.featured_media})},t.id))):null,i?(0,e.jsx)(Ht.Spinner,{}):null,d>0&&h.page{const e={...h,page:h.page+1};m(e),g(e)},children:(0,Yt.__)("Load More","alley-scripts")})}):null]})]})},nr=({baseUrl:t,closeModal:n,modalTitle:r,onUpdate:o,searchRender:s,suppressPostIds:i=[]})=>{const[a,l]=(0,hn.useState)();return(0,e.jsxs)(Ht.Modal,{isDismissible:!0,title:r,onRequestClose:n,closeButtonLabel:"Close",children:[(0,e.jsx)(tr,{baseUrl:t,selected:a??0,setSelected:l,searchRender:s,suppressPostIds:i}),(0,e.jsxs)("div",{className:"alley-scripts-post-picker__buttons",children:[(0,e.jsx)(Ht.Button,{variant:"secondary",onClick:n,children:(0,Yt.__)("Cancel","alley-scripts")}),(0,e.jsx)(Ht.Button,{variant:"primary",onClick:()=>{a&&(o(a),n())},disabled:!a,children:(0,Yt.__)("Select","alley-scripts")})]})]})},rr=Bt.div` + display: block; + position: relative; +`,or=Bt.div` + border: 1px solid #eee; + display: flex; + flex-direction: column; + margin: 5px 0; + padding: 0.5rem 0.75rem; + text-align: center; +`,sr=({allowedTypes:t,className:n,getPostType:r,modalTitle:o=(0,Yt.__)("Select Post","alley-scripts"),onReset:s,onUpdate:i,params:a={},previewRender:l,replaceText:c=(0,Yt.__)("Replace","alley-scripts"),resetText:u=(0,Yt.__)("Reset","alley-scripts"),searchEndpoint:p="/wp/v2/search",searchRender:d,selectText:f=(0,Yt.__)("Select","alley-scripts"),suppressPostIds:h=[],title:m="",value:g=0})=>{const[y,v]=(0,hn.useState)(!1),A=(0,mn.addQueryArgs)(p,{type:"post",subtype:t??"any",...a}),b=kn(g,r),{featured_media:_,title:{rendered:w=""}={},type:C=""}=b||{},x=()=>{v(!0)};return 0!==g&&null===b?(0,e.jsx)(Ht.Spinner,{}):(0,e.jsxs)(rr,{className:n,children:[m?(0,e.jsx)("h4",{children:m}):null,0!==g&&null!==b?(0,e.jsxs)(e.Fragment,{children:[void 0!==l?l(b):(0,e.jsx)(or,{children:(0,e.jsx)(er,{title:w,postType:C,attachmentID:_})}),(0,e.jsxs)(Ht.ButtonGroup,{children:[(0,e.jsx)(Ht.Button,{variant:"secondary",onClick:s,style:{margin:"0 4px"},children:u}),(0,e.jsx)(Ht.Button,{variant:"secondary",onClick:x,style:{margin:"0 4px"},children:c})]})]}):(0,e.jsx)(Ht.Button,{onClick:x,variant:"secondary",children:f}),y?(0,e.jsx)(nr,{closeModal:()=>{v(!1)},baseUrl:A,modalTitle:o,onUpdate:i,searchRender:d,suppressPostIds:h}):null]})},ir=({className:t,emptyLabel:n,label:r,maxPages:o,multiple:s,onSelect:i,placeholder:a,subTypes:l,selected:c,threshold:u})=>(0,e.jsx)(Ar,{type:"post",className:t,emptyLabel:n,label:r,maxPages:o,multiple:s,onSelect:i,placeholder:a,subTypes:l,selected:c,threshold:u});ir.defaultProps={className:"",emptyLabel:(0,Yt.__)("No posts found","alley-scripts"),label:(0,Yt.__)("Search for posts","alley-scripts"),maxPages:5,multiple:!1,placeholder:(0,Yt.__)("Search for posts","alley-scripts"),subTypes:[],selected:[],threshold:3},ir.propTypes={className:o().string,emptyLabel:o().string,label:o().string,maxPages:o().number,multiple:o().bool,onSelect:o().func.isRequired,placeholder:o().string,subTypes:o().arrayOf(o().string),selected:o().arrayOf([o().shape({id:o().number,title:o().string})]),threshold:o().number};const ar=ir,lr={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let cr;const ur=new Uint8Array(16);function pr(){if(!cr&&(cr="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!cr))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return cr(ur)}const dr=[];for(let e=0;e<256;++e)dr.push((e+256).toString(16).slice(1));const fr=function(e,t,n){if(lr.randomUUID&&!t&&!e)return lr.randomUUID();const r=(e=e||{}).random||(e.rng||pr)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=r[e];return t}return function(e,t=0){return(dr[e[t+0]]+dr[e[t+1]]+dr[e[t+2]]+dr[e[t+3]]+"-"+dr[e[t+4]]+dr[e[t+5]]+"-"+dr[e[t+6]]+dr[e[t+7]]+"-"+dr[e[t+8]]+dr[e[t+9]]+"-"+dr[e[t+10]]+dr[e[t+11]]+dr[e[t+12]]+dr[e[t+13]]+dr[e[t+14]]+dr[e[t+15]]).toLowerCase()}(r)},hr=({emptyLabel:t,error:n,id:r,isOpen:o,labelledbyId:s,loading:i,onSelect:a,options:l,selectedItems:c,threshold:u,value:p})=>{if(!i&&(""===p||u>p.length))return null;let d="",f="";return i?(d="loading",f=(0,Yt.__)("Loading...","alley-scripts")):n?(d="error",f=n):i||0!==l.length||(d="no-posts",f=t),i||!i&&(p&&0===l.length||n)?(0,e.jsx)("div",{"aria-busy":!0,className:Kn()("autocomplete__dropdown",{"autocomplete__dropdown--is-open":o}),children:(0,e.jsx)("div",{className:Kn()("autocomplete__dropdown--notice",`autocomplete__${d}`),children:f})}):(0,e.jsx)("div",{className:Kn()("autocomplete__dropdown",{"autocomplete__dropdown--is-open":o}),children:(0,e.jsx)("ul",{role:"listbox","aria-labelledby":s,id:r,className:Kn()("autocomplete__dropdown--results","autocomplete__list"),children:l.map((t=>(0,e.jsx)("li",{className:"autocomplete__list--item",children:(0,e.jsx)(Ht.Button,{onClick:()=>a(t),type:"button",disabled:c.some((e=>e.id===t.id)),isTertiary:!0,children:t.title})},t.id)))})})};hr.propTypes={emptyLabel:o().string.isRequired,error:o().string.isRequired,id:o().string.isRequired,isOpen:o().bool.isRequired,labelledbyId:o().string.isRequired,loading:o().bool.isRequired,options:o().arrayOf(o().shape({label:o().string,value:o().string})).isRequired,onSelect:o().func.isRequired,selectedItems:o().shape([]).isRequired,threshold:o().number.isRequired,value:o().string.isRequired};const mr=hr;var gr=n(458),yr={};yr.styleTagTransform=Gn(),yr.setAttributes=qn(),yr.insert=Fn().bind(null,"head"),yr.domAPI=Mn(),yr.insertStyleElement=Hn(),Dn()(gr.Z,yr),gr.Z&&gr.Z.locals&&gr.Z.locals;const vr=({type:t,className:n,emptyLabel:r,label:o,maxPages:s,multiple:i,onSelect:a,placeholder:l,subTypes:c,selected:u,threshold:p})=>{const d=fr(),[f,h]=(0,hn.useState)(""),[m,g]=(0,hn.useState)([]),[y,v]=(0,hn.useState)(!1),[A,b]=(0,hn.useState)(!1),[_,w]=(0,hn.useState)(""),[C,x]=(0,hn.useState)([]),S=(0,hn.useRef)(),E=gn(_,750),R=(0,hn.useCallback)((async(e=1)=>{if(E.length0?c.join(","):"any",type:t});await Rn()({path:r,parse:!1}).then((e=>{const t=parseInt(e.headers.get("X-WP-TotalPages"),10);return n=t>s?s:t,e.json()})).then((t=>{g((e=>[...e,...t])),b(!1),(n&&n>e||e>=1&&i&&C.length>0)&&R(e+1)})).catch((e=>h(e.message)))}),[E,t,s,i,c,C.length,p]);(0,hn.useEffect)((()=>{x(u)}),[u]),(0,hn.useEffect)((()=>{E&&p<=E.length?R():g([])}),[E,R,p]);const k=e=>{v(S.current.contains(e.target))},T=e=>{"Escape"===e.key&&v(!1)};(0,hn.useEffect)((()=>(document.addEventListener("keydown",T),()=>document.removeEventListener("keydown",T)))),(0,hn.useEffect)((()=>(S&&document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k))));const I=e=>{let t=[];if(C.some((t=>t.id===e.id))){const n=C.findIndex((t=>t.id===e.id));t=[...C.slice(0,n),...C.slice(n+1,C.length)]}else i?t=[...C,e]:(t=[e],v(!1));x(t),a(t)};return(0,e.jsx)("form",{className:"autocomplete__component",onSubmit:e=>e.preventDefault(),children:(0,e.jsxs)("div",{className:Kn()("components-base-control","autocomplete-base-control",n),ref:S,children:[(0,e.jsxs)("div",{"aria-expanded":y,"aria-haspopup":"listbox","aria-owns":`listbox-${d}`,className:Kn()("components-base-control__field","autocomplete-base-control__field"),role:"combobox",children:[(0,e.jsx)("label",{className:Kn()("components-base-control__label","autocomplete-base-control__label"),htmlFor:`autocomplete-${d}`,children:(0,e.jsx)("div",{children:o})}),C.length>0?(0,e.jsx)("ul",{role:"listbox","aria-labelledby":`autocomplete-${d}`,id:`selected-items-${d}`,className:Kn()("autocomplete__selection--results","autocomplete__selection-list"),children:C.map((t=>(0,e.jsx)("li",{className:"autocomplete__selection-list--item",children:(0,e.jsx)(Ht.Button,{className:"autocomplete__selection-list--item--button",isSecondary:!0,isSmall:!0,onClick:()=>I(t),type:"button",children:t.title})},t.title)))}):null,(0,e.jsx)("input",{"aria-autocomplete":"list",autoComplete:"off",className:Kn()("components-text-control__input","autocomplete-text-control__input",{"autocomplete-text-control__input--working":y}),id:`autocomplete-${d}`,onChange:e=>w(e.target.value),onFocus:()=>v(!0),placeholder:l,type:"text",value:_})]}),(0,e.jsx)(mr,{emptyLabel:r,error:f,labelledById:`autocomplete-${d}`,id:`listbox-${d}`,isOpen:y,loading:A&&E,onSelect:I,options:m,selectedItems:C,threshold:p,value:E})]})})};vr.defaultProps={type:"post",className:"",emptyLabel:(0,Yt.__)("No items found","alley-scripts"),label:(0,Yt.__)("Search for items","alley-scripts"),maxPages:5,multiple:!1,placeholder:(0,Yt.__)("Search for items","alley-scripts"),subTypes:[],selected:[],threshold:3},vr.propTypes={type:o().string,className:o().string,emptyLabel:o().string,label:o().string,maxPages:o().number,multiple:o().bool,onSelect:o().func.isRequired,placeholder:o().string,subTypes:o().arrayOf(o().string),selected:o().arrayOf([o().shape({id:o().number,title:o().string})]),threshold:o().number};const Ar=vr,br=({className:t,emptyLabel:n,label:r,maxPages:o,multiple:s,onSelect:i,placeholder:a,subTypes:l,selected:c,threshold:u})=>(0,e.jsx)(Ar,{type:"term",className:t,emptyLabel:n,label:r,maxPages:o,multiple:s,onSelect:i,placeholder:a,subTypes:l,selected:c,threshold:u});br.defaultProps={className:"",emptyLabel:(0,Yt.__)("No terms found","alley-scripts"),label:(0,Yt.__)("Search for terms","alley-scripts"),maxPages:5,multiple:!1,placeholder:(0,Yt.__)("Search for terms","alley-scripts"),subTypes:[],selected:[],threshold:3},br.propTypes={className:o().string,emptyLabel:o().string,label:o().string,maxPages:o().number,multiple:o().bool,onSelect:o().func.isRequired,placeholder:o().string,subTypes:o().arrayOf(o().string),selected:o().arrayOf([o().shape({id:o().number,title:o().string})]),threshold:o().number};const _r=br,wr=Bt.div` + height: auto; + width: 100%; +`,Cr=({src:t})=>(0,e.jsx)(wr,{children:(0,e.jsx)("video",{className:"edit-video-preview",controls:!0,src:t})});Cr.propTypes={src:o().string.isRequired};const xr=({className:t,onReset:n,onUpdate:r,onUpdateURL:o,value:s,valueURL:i})=>(0,e.jsx)(cn,{allowedTypes:["video"],className:t,icon:"format-video",onReset:n,onUpdate:r,onUpdateURL:o,preview:Cr,value:s,valueURL:i});xr.defaultProps={className:"",onUpdateURL:null,valueURL:""},xr.propTypes={className:o().string,onReset:o().func.isRequired,onUpdate:o().func.isRequired,onUpdateURL:o().func,value:o().number.isRequired,valueURL:o().string};const Sr=xr})(),r})(),e.exports=t()}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var s=t[r]={exports:{}};return e[r](s,s.exports,n),s.exports}!function(){"use strict";var e=window.wp.plugins,t=window.wp.element,r=window.wp.components,o=window.wp.editPost,s=window.wp.i18n,i=n(373);(0,e.registerPlugin)("wp-curate-deduplication",{icon:"",render:function(){const[e,n]=(0,i.usePostMetaValue)("wp_curate_deduplication");return(0,t.createElement)(o.PluginDocumentSettingPanel,{icon:"",name:"deduplication",title:(0,s.__)("Deduplication","wp-curate")},(0,t.createElement)(r.ToggleControl,{label:(0,s.__)("Enable deduplication","wp-curate"),checked:e,onChange:e=>n(e)}))}})}()}(); \ No newline at end of file diff --git a/build/slotfills/index.php b/build/slotfills/index.php new file mode 100644 index 00000000..f10707d5 --- /dev/null +++ b/build/slotfills/index.php @@ -0,0 +1,78 @@ + - - - tests/feature - - - tests/unit - - - diff --git a/tests/bootstrap.php b/tests/bootstrap.php deleted file mode 100644 index e22936b9..00000000 --- a/tests/bootstrap.php +++ /dev/null @@ -1,16 +0,0 @@ -maybe_rsync_plugin() - ->with_sqlite() - // Load the main file of the plugin. - ->loaded( fn () => require_once __DIR__ . '/../wp-curate.php' ) - ->install(); diff --git a/tests/class-test-case.php b/tests/class-test-case.php deleted file mode 100644 index c10d64d2..00000000 --- a/tests/class-test-case.php +++ /dev/null @@ -1,17 +0,0 @@ -assertTrue( true ); - $this->assertNotEmpty( home_url() ); - } -} diff --git a/tests/unit/class-example-unit-test.php b/tests/unit/class-example-unit-test.php deleted file mode 100644 index 9ffefc99..00000000 --- a/tests/unit/class-example-unit-test.php +++ /dev/null @@ -1,24 +0,0 @@ -assertTrue( true ); - } -}