@caspeco/casper-ui-library 10.4.0 → 10.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/_rolldown/runtime.js +11 -0
- package/dist/_virtual/builtin_esm-external-require-react.js +9 -0
- package/dist/components/accordion/accordion-context.js +5 -6
- package/dist/components/accordion/accordion-item.js +28 -40
- package/dist/components/accordion/accordion-panel.js +17 -14
- package/dist/components/accordion/accordion-recipe.js +85 -120
- package/dist/components/accordion/accordion.js +23 -20
- package/dist/components/alert/alert.js +80 -59
- package/dist/components/alert/helper.js +30 -42
- package/dist/components/alert/types.d.ts.map +1 -1
- package/dist/components/badge/badge-recipe.js +57 -49
- package/dist/components/badge/badge.js +66 -71
- package/dist/components/badge/helper.js +8 -9
- package/dist/components/box/box.js +14 -11
- package/dist/components/breadcrumbs/breadcrumb-item.js +21 -17
- package/dist/components/breadcrumbs/breadcrumb-link.js +21 -20
- package/dist/components/breadcrumbs/breadcrumbs.js +123 -90
- package/dist/components/button/button-recipe.js +280 -315
- package/dist/components/button/button.js +39 -40
- package/dist/components/checkbox/checkbox-icon.js +38 -46
- package/dist/components/checkbox/checkbox-recipe.js +176 -204
- package/dist/components/checkbox/checkbox.js +43 -36
- package/dist/components/checkbox/icons/check.js +5 -5
- package/dist/components/checkbox/icons/minus.js +5 -5
- package/dist/components/checkbox/icons/plus.js +5 -5
- package/dist/components/checkbox-group/checkbox-group.js +17 -16
- package/dist/components/collapsible/collapsible.js +117 -101
- package/dist/components/collapsible/translations.js +29 -29
- package/dist/components/combobox/combobox-button.js +173 -143
- package/dist/components/combobox/combobox-item.js +45 -23
- package/dist/components/combobox/combobox-menu.js +240 -190
- package/dist/components/combobox/combobox-recipe.js +69 -103
- package/dist/components/combobox/combobox.js +243 -273
- package/dist/components/combobox/translations.js +49 -50
- package/dist/components/date-picker/base-date-picker.js +238 -248
- package/dist/components/date-picker/date-cell-recipe.js +149 -179
- package/dist/components/date-picker/date-multi-picker.js +35 -29
- package/dist/components/date-picker/date-picker-date-cell.js +109 -114
- package/dist/components/date-picker/date-picker-header.js +152 -170
- package/dist/components/date-picker/date-picker-week-cell.js +41 -43
- package/dist/components/date-picker/date-picker.js +32 -29
- package/dist/components/date-picker/date-range-picker.js +29 -24
- package/dist/components/date-picker/date-week-picker.js +29 -22
- package/dist/components/date-picker/datepicker-week-recipe.js +75 -91
- package/dist/components/date-picker/helper.js +11 -16
- package/dist/components/divider/divider-recipe.js +9 -11
- package/dist/components/divider/divider.js +19 -18
- package/dist/components/drawer/drawer-recipe.js +21 -50
- package/dist/components/drawer/drawer.js +45 -41
- package/dist/components/drawer/inline-drawer.js +69 -66
- package/dist/components/drawer/use-drawer-key-down.js +20 -20
- package/dist/components/fieldset/fieldset-error-text.js +15 -15
- package/dist/components/fieldset/fieldset-helper-text.js +15 -15
- package/dist/components/fieldset/fieldset-legend.js +15 -15
- package/dist/components/fieldset/fieldset-recipe.js +14 -24
- package/dist/components/fieldset/fieldset.js +17 -17
- package/dist/components/flex/flex.js +15 -15
- package/dist/components/form-control/form-control-recipe.js +42 -46
- package/dist/components/form-control/form-control.js +19 -19
- package/dist/components/form-control/form-error-message.js +15 -15
- package/dist/components/form-control/form-helper-text.js +15 -15
- package/dist/components/form-control/form-label.js +24 -26
- package/dist/components/grid/grid-item.js +15 -15
- package/dist/components/grid/grid.js +15 -15
- package/dist/components/heading/heading.js +24 -23
- package/dist/components/highlight/highlight.js +22 -21
- package/dist/components/icon/create-icon.js +27 -26
- package/dist/components/icon/icons/absence-icon.js +5 -5
- package/dist/components/icon/icons/accessibility-icon.js +5 -5
- package/dist/components/icon/icons/add-absence-icon.js +5 -5
- package/dist/components/icon/icons/add-emoji-icon.js +5 -5
- package/dist/components/icon/icons/add-icon.js +5 -5
- package/dist/components/icon/icons/apple-icon.js +5 -5
- package/dist/components/icon/icons/apps-icon.js +5 -5
- package/dist/components/icon/icons/archive-icon.js +6 -6
- package/dist/components/icon/icons/area-icon.js +5 -5
- package/dist/components/icon/icons/at-icon.js +5 -5
- package/dist/components/icon/icons/attachment-icon.js +5 -5
- package/dist/components/icon/icons/baby-icon.js +5 -5
- package/dist/components/icon/icons/back-icon.js +5 -5
- package/dist/components/icon/icons/backspace-icon.js +5 -5
- package/dist/components/icon/icons/bank-icon.js +5 -5
- package/dist/components/icon/icons/bank-id-icon.js +5 -5
- package/dist/components/icon/icons/barcode-icon.js +5 -5
- package/dist/components/icon/icons/bell-icon.js +5 -5
- package/dist/components/icon/icons/bolt-icon.js +7 -7
- package/dist/components/icon/icons/calendar-icon.js +5 -5
- package/dist/components/icon/icons/camera-icon.js +5 -5
- package/dist/components/icon/icons/cancel-icon.js +5 -5
- package/dist/components/icon/icons/card-icon.js +5 -5
- package/dist/components/icon/icons/cart-icon.js +5 -5
- package/dist/components/icon/icons/caspeco-icon.js +7 -7
- package/dist/components/icon/icons/channels-icon.js +5 -5
- package/dist/components/icon/icons/chart-icon.js +5 -5
- package/dist/components/icon/icons/chart-line-icon.js +5 -5
- package/dist/components/icon/icons/chart-mixed-icon.js +5 -5
- package/dist/components/icon/icons/chart-pie-icon.js +5 -5
- package/dist/components/icon/icons/chart-scatter-icon.js +5 -5
- package/dist/components/icon/icons/check-icon.js +5 -5
- package/dist/components/icon/icons/checkbox-icon.js +5 -5
- package/dist/components/icon/icons/chevron-left-icon.js +5 -5
- package/dist/components/icon/icons/chevron-right-icon.js +5 -5
- package/dist/components/icon/icons/child-icon.js +5 -5
- package/dist/components/icon/icons/circle-info-icon.js +5 -5
- package/dist/components/icon/icons/circle-parking-icon.js +5 -5
- package/dist/components/icon/icons/circle-question-icon.js +5 -5
- package/dist/components/icon/icons/circle-select-icon.js +5 -5
- package/dist/components/icon/icons/circle-success-icon.js +5 -5
- package/dist/components/icon/icons/circle-user-icon.js +5 -5
- package/dist/components/icon/icons/clear-icon.js +5 -5
- package/dist/components/icon/icons/close-icon.js +5 -5
- package/dist/components/icon/icons/closed-icon.js +5 -5
- package/dist/components/icon/icons/collapse-icon.js +5 -5
- package/dist/components/icon/icons/color-icon.js +5 -5
- package/dist/components/icon/icons/columns-icon.js +5 -5
- package/dist/components/icon/icons/comment-add-icon.js +5 -5
- package/dist/components/icon/icons/comment-icon.js +5 -5
- package/dist/components/icon/icons/cookies-icon.js +5 -5
- package/dist/components/icon/icons/copy-icon.js +5 -5
- package/dist/components/icon/icons/date-icon.js +5 -5
- package/dist/components/icon/icons/decrease-icon.js +4 -4
- package/dist/components/icon/icons/delete-icon.js +5 -5
- package/dist/components/icon/icons/deliverect-icon.js +5 -5
- package/dist/components/icon/icons/delivery-icon.js +5 -5
- package/dist/components/icon/icons/description-icon.js +5 -5
- package/dist/components/icon/icons/discount-icon.js +5 -5
- package/dist/components/icon/icons/distribute-evenly-icon.js +5 -5
- package/dist/components/icon/icons/door-closed-icon.js +5 -5
- package/dist/components/icon/icons/door-open-icon.js +5 -5
- package/dist/components/icon/icons/down-icon.js +5 -5
- package/dist/components/icon/icons/eat-in-icon.js +5 -5
- package/dist/components/icon/icons/edit-icon.js +5 -5
- package/dist/components/icon/icons/email-icon.js +5 -5
- package/dist/components/icon/icons/error-icon.js +5 -5
- package/dist/components/icon/icons/expand-icon.js +5 -5
- package/dist/components/icon/icons/export-icon.js +5 -5
- package/dist/components/icon/icons/extract-icon.js +5 -5
- package/dist/components/icon/icons/facebook-icon.js +5 -5
- package/dist/components/icon/icons/failed-print-icon.js +5 -5
- package/dist/components/icon/icons/file-icon.js +5 -5
- package/dist/components/icon/icons/filter-icon.js +5 -5
- package/dist/components/icon/icons/folder-icon.js +5 -5
- package/dist/components/icon/icons/foodora-icon.js +5 -5
- package/dist/components/icon/icons/forward-icon.js +5 -5
- package/dist/components/icon/icons/glovo-icon.js +7 -7
- package/dist/components/icon/icons/goal-icon.js +5 -5
- package/dist/components/icon/icons/google-icon.js +5 -5
- package/dist/components/icon/icons/grip-more-icon.js +5 -5
- package/dist/components/icon/icons/hash-icon.js +5 -5
- package/dist/components/icon/icons/hexagon-error-icon.js +5 -5
- package/dist/components/icon/icons/hide-icon.js +5 -5
- package/dist/components/icon/icons/history-icon.js +5 -5
- package/dist/components/icon/icons/icon-picker-anchor-icon.js +5 -5
- package/dist/components/icon/icons/icon-picker-asterisk-icon.js +5 -5
- package/dist/components/icon/icons/icon-picker-beer-icon.js +5 -5
- package/dist/components/icon/icons/icon-picker-bicycle-icon.js +5 -5
- package/dist/components/icon/icons/icon-picker-binoculars-icon.js +5 -5
- package/dist/components/icon/icons/icon-picker-bomb-icon.js +5 -5
- package/dist/components/icon/icons/icon-picker-car-icon.js +5 -5
- package/dist/components/icon/icons/icon-picker-cocktail-icon.js +5 -5
- package/dist/components/icon/icons/icon-picker-gem-icon.js +5 -5
- package/dist/components/icon/icons/icon-picker-heart-full-icon.js +5 -5
- package/dist/components/icon/icons/icon-picker-heart-icon.js +5 -5
- package/dist/components/icon/icons/icon-picker-magnet-icon.js +5 -5
- package/dist/components/icon/icons/icon-picker-money-icon.js +5 -5
- package/dist/components/icon/icons/icon-picker-moon-icon.js +5 -5
- package/dist/components/icon/icons/icon-picker-music-icon.js +5 -5
- package/dist/components/icon/icons/icon-picker-star-full-icon.js +5 -5
- package/dist/components/icon/icons/icon-picker-star-half-icon.js +5 -5
- package/dist/components/icon/icons/icon-picker-star-icon.js +5 -5
- package/dist/components/icon/icons/icon-picker-tint-icon.js +5 -5
- package/dist/components/icon/icons/icon-picker-tree-icon.js +5 -5
- package/dist/components/icon/icons/icon-picker-utensils-icon.js +5 -5
- package/dist/components/icon/icons/icon-picker-wheelchair-icon.js +5 -5
- package/dist/components/icon/icons/image-icon.js +5 -5
- package/dist/components/icon/icons/import-icon.js +5 -5
- package/dist/components/icon/icons/inbox-icon.js +5 -5
- package/dist/components/icon/icons/increase-icon.js +5 -5
- package/dist/components/icon/icons/indeterminate-icon.js +4 -4
- package/dist/components/icon/icons/info-icon.js +5 -5
- package/dist/components/icon/icons/inheritance-icon.js +5 -5
- package/dist/components/icon/icons/just-eat-icon.js +5 -5
- package/dist/components/icon/icons/karma-icon.js +5 -5
- package/dist/components/icon/icons/key-command-icon.js +5 -5
- package/dist/components/icon/icons/key-enter-icon.js +5 -5
- package/dist/components/icon/icons/key-icon.js +5 -5
- package/dist/components/icon/icons/key-option-icon.js +5 -5
- package/dist/components/icon/icons/language-icon.js +5 -5
- package/dist/components/icon/icons/link-broken-icon.js +5 -5
- package/dist/components/icon/icons/link-external-icon.js +5 -5
- package/dist/components/icon/icons/link-icon.js +5 -5
- package/dist/components/icon/icons/list-ol-icon.js +5 -5
- package/dist/components/icon/icons/list-ul-icon.js +5 -5
- package/dist/components/icon/icons/loading-icon.js +5 -5
- package/dist/components/icon/icons/location-icon.js +5 -5
- package/dist/components/icon/icons/lock-icon.js +5 -5
- package/dist/components/icon/icons/log-in-icon.js +5 -5
- package/dist/components/icon/icons/log-out-icon.js +5 -5
- package/dist/components/icon/icons/map-icon.js +5 -5
- package/dist/components/icon/icons/maximize-icon.js +5 -5
- package/dist/components/icon/icons/members-icon.js +5 -5
- package/dist/components/icon/icons/menu-hide-icon.js +5 -5
- package/dist/components/icon/icons/menu-icon.js +5 -5
- package/dist/components/icon/icons/menu-show-icon.js +5 -5
- package/dist/components/icon/icons/message-add-icon.js +5 -5
- package/dist/components/icon/icons/message-icon.js +5 -5
- package/dist/components/icon/icons/message-lines-icon.js +5 -5
- package/dist/components/icon/icons/minimize-icon.js +5 -5
- package/dist/components/icon/icons/minimize-window-icon.js +5 -5
- package/dist/components/icon/icons/mobile-rotate-icon.js +5 -5
- package/dist/components/icon/icons/module-accounting-icon.js +5 -5
- package/dist/components/icon/icons/module-ai-forecast-icon.js +5 -5
- package/dist/components/icon/icons/module-app-icon.js +5 -5
- package/dist/components/icon/icons/module-articles-icon.js +5 -5
- package/dist/components/icon/icons/module-benchmark-icon.js +5 -5
- package/dist/components/icon/icons/module-booking-icon.js +5 -5
- package/dist/components/icon/icons/module-cai-icon.js +5 -5
- package/dist/components/icon/icons/module-campaigns-icon.js +5 -5
- package/dist/components/icon/icons/module-cashier-icon.js +5 -5
- package/dist/components/icon/icons/module-communication-icon.js +5 -5
- package/dist/components/icon/icons/module-copilot-icon.js +5 -5
- package/dist/components/icon/icons/module-dashboard-icon.js +5 -5
- package/dist/components/icon/icons/module-document-icon.js +5 -5
- package/dist/components/icon/icons/module-employees-icon.js +5 -5
- package/dist/components/icon/icons/module-feed-icon.js +5 -5
- package/dist/components/icon/icons/module-history-icon.js +5 -5
- package/dist/components/icon/icons/module-home-icon.js +5 -5
- package/dist/components/icon/icons/module-insights-icon.js +5 -5
- package/dist/components/icon/icons/module-kds-icon.js +5 -5
- package/dist/components/icon/icons/module-members-icon.js +5 -5
- package/dist/components/icon/icons/module-menus-icon.js +5 -5
- package/dist/components/icon/icons/module-my-city-icon.js +5 -5
- package/dist/components/icon/icons/module-notification-center-icon.js +5 -5
- package/dist/components/icon/icons/module-online-order-icon.js +5 -5
- package/dist/components/icon/icons/module-organisation-icon.js +5 -5
- package/dist/components/icon/icons/module-pos-icon.js +5 -5
- package/dist/components/icon/icons/module-pulse-icon.js +5 -5
- package/dist/components/icon/icons/module-result-icon.js +5 -5
- package/dist/components/icon/icons/module-salary-icon.js +5 -5
- package/dist/components/icon/icons/module-schedule-icon.js +5 -5
- package/dist/components/icon/icons/module-settings-alt-icon.js +5 -5
- package/dist/components/icon/icons/module-settings-icon.js +5 -5
- package/dist/components/icon/icons/module-support-icon.js +5 -5
- package/dist/components/icon/icons/module-survey-icon.js +5 -5
- package/dist/components/icon/icons/module-table-map-icon.js +6 -6
- package/dist/components/icon/icons/module-tablet-icon.js +5 -5
- package/dist/components/icon/icons/module-time-icon.js +5 -5
- package/dist/components/icon/icons/module-timeline-icon.js +5 -5
- package/dist/components/icon/icons/module-tip-icon.js +5 -5
- package/dist/components/icon/icons/module-to-do-icon.js +5 -5
- package/dist/components/icon/icons/module-tools-icon.js +5 -5
- package/dist/components/icon/icons/module-top-list-icon.js +5 -5
- package/dist/components/icon/icons/module-web-charts-icon.js +5 -5
- package/dist/components/icon/icons/module-web-icon.js +5 -5
- package/dist/components/icon/icons/more-horizontal-icon.js +5 -5
- package/dist/components/icon/icons/more-vertical-icon.js +5 -5
- package/dist/components/icon/icons/nfc-icon.js +5 -5
- package/dist/components/icon/icons/no-cart-icon.js +5 -5
- package/dist/components/icon/icons/note-icon.js +5 -5
- package/dist/components/icon/icons/number-icon.js +6 -6
- package/dist/components/icon/icons/open-modal-icon.js +5 -5
- package/dist/components/icon/icons/parking-icon.js +5 -5
- package/dist/components/icon/icons/party-horn-icon.js +5 -5
- package/dist/components/icon/icons/paste-icon.js +5 -5
- package/dist/components/icon/icons/pause-icon.js +5 -5
- package/dist/components/icon/icons/payment-card-icon.js +5 -5
- package/dist/components/icon/icons/payment-cash-icon.js +5 -5
- package/dist/components/icon/icons/payment-generic-icon.js +5 -5
- package/dist/components/icon/icons/payment-giftcard-icon.js +5 -5
- package/dist/components/icon/icons/payment-hotel-icon.js +5 -5
- package/dist/components/icon/icons/payment-invoice-icon.js +5 -5
- package/dist/components/icon/icons/percentage-icon.js +5 -5
- package/dist/components/icon/icons/phone-icon.js +5 -5
- package/dist/components/icon/icons/pin-icon.js +5 -5
- package/dist/components/icon/icons/pin-map-icon.js +5 -5
- package/dist/components/icon/icons/play-icon.js +5 -5
- package/dist/components/icon/icons/preview-icon.js +5 -5
- package/dist/components/icon/icons/print-icon.js +5 -5
- package/dist/components/icon/icons/privacy-icon.js +5 -5
- package/dist/components/icon/icons/product-admin-icon.js +5 -5
- package/dist/components/icon/icons/product-analytics-icon.js +5 -5
- package/dist/components/icon/icons/product-booking-icon.js +5 -5
- package/dist/components/icon/icons/product-checkout-icon.js +5 -5
- package/dist/components/icon/icons/product-my-pages-icon.js +5 -5
- package/dist/components/icon/icons/product-staff-icon.js +5 -5
- package/dist/components/icon/icons/puck-icon.js +5 -5
- package/dist/components/icon/icons/qr-code-icon.js +5 -5
- package/dist/components/icon/icons/question-icon.js +5 -5
- package/dist/components/icon/icons/radio-icon.js +5 -5
- package/dist/components/icon/icons/receipt-icon.js +5 -5
- package/dist/components/icon/icons/redo-icon.js +5 -5
- package/dist/components/icon/icons/refund-icon.js +5 -5
- package/dist/components/icon/icons/remove-icon.js +5 -5
- package/dist/components/icon/icons/replace-icon.js +5 -5
- package/dist/components/icon/icons/schedule-icon.js +5 -5
- package/dist/components/icon/icons/search-icon.js +5 -5
- package/dist/components/icon/icons/select-icon.js +4 -4
- package/dist/components/icon/icons/send-icon.js +5 -5
- package/dist/components/icon/icons/share-icon.js +5 -5
- package/dist/components/icon/icons/show-icon.js +5 -5
- package/dist/components/icon/icons/shuffle-icon.js +5 -5
- package/dist/components/icon/icons/sidebar-hide-icon.js +4 -4
- package/dist/components/icon/icons/sidebar-left-icon.js +4 -4
- package/dist/components/icon/icons/sidebar-right-icon.js +5 -5
- package/dist/components/icon/icons/sidebar-show-icon.js +5 -5
- package/dist/components/icon/icons/sliders-icon.js +5 -5
- package/dist/components/icon/icons/slightly-sad-icon.js +5 -5
- package/dist/components/icon/icons/smile-icon.js +5 -5
- package/dist/components/icon/icons/sort-asc-icon.js +5 -5
- package/dist/components/icon/icons/sort-desc-icon.js +5 -5
- package/dist/components/icon/icons/split-icon.js +5 -5
- package/dist/components/icon/icons/status-icon.js +5 -5
- package/dist/components/icon/icons/stop-icon.js +5 -5
- package/dist/components/icon/icons/submenu-icon.js +5 -5
- package/dist/components/icon/icons/success-icon.js +5 -5
- package/dist/components/icon/icons/swap-icon.js +5 -5
- package/dist/components/icon/icons/swatch-icon.js +5 -5
- package/dist/components/icon/icons/sweat-icon.js +5 -5
- package/dist/components/icon/icons/table-icon.js +5 -5
- package/dist/components/icon/icons/table-map-icon.js +5 -5
- package/dist/components/icon/icons/take-away-dot-com-icon.js +5 -5
- package/dist/components/icon/icons/take-away-icon.js +5 -5
- package/dist/components/icon/icons/talk-icon.js +5 -5
- package/dist/components/icon/icons/thumbtack-icon.js +5 -5
- package/dist/components/icon/icons/time-icon.js +5 -5
- package/dist/components/icon/icons/timeline-icon.js +5 -5
- package/dist/components/icon/icons/tip-icon.js +5 -5
- package/dist/components/icon/icons/title-icon.js +5 -5
- package/dist/components/icon/icons/translate-icon.js +5 -5
- package/dist/components/icon/icons/tree-view-collapse-icon.js +4 -4
- package/dist/components/icon/icons/tree-view-expand-icon.js +4 -4
- package/dist/components/icon/icons/tree-view-last-icon.js +4 -4
- package/dist/components/icon/icons/trend-down-icon.js +5 -5
- package/dist/components/icon/icons/trend-up-icon.js +5 -5
- package/dist/components/icon/icons/triangle-warning-icon.js +5 -5
- package/dist/components/icon/icons/trivec-icon.js +6 -6
- package/dist/components/icon/icons/uber-eats-icon.js +5 -5
- package/dist/components/icon/icons/undo-icon.js +5 -5
- package/dist/components/icon/icons/unlock-icon.js +5 -5
- package/dist/components/icon/icons/unwrap-content-icon.js +5 -5
- package/dist/components/icon/icons/up-icon.js +5 -5
- package/dist/components/icon/icons/user-group-icon.js +5 -5
- package/dist/components/icon/icons/user-icon.js +5 -5
- package/dist/components/icon/icons/user-permissions-icon.js +5 -5
- package/dist/components/icon/icons/user-wait-icon.js +5 -5
- package/dist/components/icon/icons/users-icon.js +5 -5
- package/dist/components/icon/icons/version-control-icon.js +5 -5
- package/dist/components/icon/icons/volume-high-icon.js +5 -5
- package/dist/components/icon/icons/volume-icon.js +5 -5
- package/dist/components/icon/icons/volume-low-icon.js +5 -5
- package/dist/components/icon/icons/volume-off-icon.js +5 -5
- package/dist/components/icon/icons/warning-icon.js +5 -5
- package/dist/components/icon/icons/waste-icon.js +5 -5
- package/dist/components/icon/icons/wifi-icon.js +5 -5
- package/dist/components/icon/icons/wifi-off-icon.js +5 -5
- package/dist/components/icon/icons/wolt-icon.js +5 -5
- package/dist/components/icon/icons/wrap-content-icon.js +5 -5
- package/dist/components/icon-button/icon-button.js +37 -39
- package/dist/components/image/image.js +12 -14
- package/dist/components/image-upload/image-cropper.helper.js +74 -82
- package/dist/components/image-upload/image-cropper.js +156 -183
- package/dist/components/image-upload/image-upload-dropzone.js +134 -112
- package/dist/components/image-upload/image-upload-helper.js +15 -19
- package/dist/components/image-upload/image-upload-icons.js +52 -20
- package/dist/components/image-upload/image-upload-modal.js +131 -106
- package/dist/components/image-upload/image-upload.js +96 -86
- package/dist/components/image-upload/translations.js +65 -65
- package/dist/components/image-upload/types.js +6 -4
- package/dist/components/input/helper.js +18 -29
- package/dist/components/input/input-addon-recipe.js +37 -43
- package/dist/components/input/input-recipe.js +124 -133
- package/dist/components/input/input.js +78 -83
- package/dist/components/link/link-recipe.js +18 -22
- package/dist/components/link/link.js +14 -14
- package/dist/components/list/list-item.js +15 -15
- package/dist/components/list/list.js +19 -20
- package/dist/components/menu/helper.js +12 -16
- package/dist/components/menu/menu-box-button.js +22 -18
- package/dist/components/menu/menu-button.js +18 -16
- package/dist/components/menu/menu-divider.js +31 -28
- package/dist/components/menu/menu-group.js +138 -142
- package/dist/components/menu/menu-icon-button.js +13 -11
- package/dist/components/menu/menu-item.js +44 -45
- package/dist/components/menu/menu-list.js +14 -15
- package/dist/components/menu/menu-recipe.js +67 -81
- package/dist/components/menu/menu.js +34 -41
- package/dist/components/message/message.js +52 -38
- package/dist/components/modal/modal-body-context.js +6 -7
- package/dist/components/modal/modal-body.js +17 -17
- package/dist/components/modal/modal-close-button.js +23 -18
- package/dist/components/modal/modal-footer.js +29 -32
- package/dist/components/modal/modal-header.js +17 -17
- package/dist/components/modal/modal-recipe.js +110 -141
- package/dist/components/modal/modal.js +54 -58
- package/dist/components/navigation-list/navigation-list-item.js +76 -88
- package/dist/components/navigation-list/navigation-list.js +23 -17
- package/dist/components/paginator/paginator-recipe.js +34 -40
- package/dist/components/paginator/paginator.js +65 -70
- package/dist/components/paginator/translations.js +35 -35
- package/dist/components/phone-input/country-data.js +31 -36
- package/dist/components/phone-input/country-list.js +45 -25
- package/dist/components/phone-input/country-selector.js +167 -115
- package/dist/components/phone-input/phone-input-helpers.js +91 -119
- package/dist/components/phone-input/phone-input.js +47 -42
- package/dist/components/phone-input/translations.js +53 -53
- package/dist/components/phone-input/use-phone-input.js +110 -137
- package/dist/components/quantity-button/minus-button.js +18 -16
- package/dist/components/quantity-button/plus-button.js +18 -16
- package/dist/components/quantity-button/quantity-button.js +72 -40
- package/dist/components/radio/check-icon.js +5 -5
- package/dist/components/radio/hover-styles.js +21 -36
- package/dist/components/radio/radio-group-context.js +5 -6
- package/dist/components/radio/radio-group-recipe.js +124 -142
- package/dist/components/radio/radio-group.js +30 -28
- package/dist/components/radio/radio.js +72 -55
- package/dist/components/radio-card/hover-styles.js +21 -36
- package/dist/components/radio-card/radio-card-group.js +24 -25
- package/dist/components/radio-card/radio-card.js +87 -67
- package/dist/components/rich-text-editor/boolean-control.js +51 -54
- package/dist/components/rich-text-editor/extensions.js +39 -34
- package/dist/components/rich-text-editor/index.js +26 -22
- package/dist/components/rich-text-editor/rich-text-editor-context.js +9 -11
- package/dist/components/rich-text-editor/rich-text-editor-control.js +290 -284
- package/dist/components/rich-text-editor/rich-text-editor-recipe.js +71 -83
- package/dist/components/rich-text-editor/rich-text-editor.js +72 -69
- package/dist/components/rich-text-editor/rich-text-renderer.js +32 -32
- package/dist/components/rich-text-editor/translations.js +119 -119
- package/dist/components/rich-text-editor/use-rich-text-editor.js +22 -29
- package/dist/components/segmented-control/segmented-control-item.js +24 -25
- package/dist/components/segmented-control/segmented-control.js +49 -40
- package/dist/components/select/select-recipe.js +91 -106
- package/dist/components/select/select.js +27 -29
- package/dist/components/skeleton/skeleton-text.js +18 -19
- package/dist/components/skeleton/skeleton.js +19 -20
- package/dist/components/spinner/spinner.js +44 -28
- package/dist/components/stack/stack.js +18 -18
- package/dist/components/stepper/check-icon.js +5 -5
- package/dist/components/stepper/step-context.js +5 -5
- package/dist/components/stepper/step.js +111 -106
- package/dist/components/stepper/stepper.js +42 -43
- package/dist/components/stepper/times-icon.js +5 -5
- package/dist/components/switch/hover-styles.js +30 -44
- package/dist/components/switch/switch-recipe.js +76 -84
- package/dist/components/switch/switch.d.ts +3 -3
- package/dist/components/switch/switch.d.ts.map +1 -1
- package/dist/components/switch/switch.js +30 -31
- package/dist/components/switch/types.d.ts +4 -2
- package/dist/components/switch/types.d.ts.map +1 -1
- package/dist/components/table/helper.d.ts +6 -0
- package/dist/components/table/helper.d.ts.map +1 -1
- package/dist/components/table/helper.js +29 -9
- package/dist/components/table/index.d.ts +1 -1
- package/dist/components/table/index.d.ts.map +1 -1
- package/dist/components/table/table-cell.d.ts.map +1 -1
- package/dist/components/table/table-cell.js +136 -122
- package/dist/components/table/table-column-resize-handle.d.ts +12 -0
- package/dist/components/table/table-column-resize-handle.d.ts.map +1 -0
- package/dist/components/table/table-column-resize-handle.js +69 -0
- package/dist/components/table/table-content.d.ts.map +1 -1
- package/dist/components/table/table-content.js +174 -98
- package/dist/components/table/table-context-provider.d.ts +7 -2
- package/dist/components/table/table-context-provider.d.ts.map +1 -1
- package/dist/components/table/table-context-provider.js +203 -151
- package/dist/components/table/table-context.d.ts +24 -0
- package/dist/components/table/table-context.d.ts.map +1 -1
- package/dist/components/table/table-context.js +18 -11
- package/dist/components/table/table-filter.js +170 -118
- package/dist/components/table/table-header-dropdown.js +131 -89
- package/dist/components/table/table-header-row.d.ts.map +1 -1
- package/dist/components/table/table-header-row.js +202 -140
- package/dist/components/table/table-recipe.d.ts.map +1 -1
- package/dist/components/table/table-recipe.js +75 -96
- package/dist/components/table/table-row-expand-toggle-button.js +28 -35
- package/dist/components/table/table-row.d.ts.map +1 -1
- package/dist/components/table/table-row.js +51 -41
- package/dist/components/table/table-toolbar-actions.js +19 -19
- package/dist/components/table/table-toolbar-add-button.js +18 -13
- package/dist/components/table/table-toolbar-search.js +17 -12
- package/dist/components/table/table-toolbar-settings.js +180 -133
- package/dist/components/table/table-toolbar.js +72 -51
- package/dist/components/table/table.composition.d.ts +1 -0
- package/dist/components/table/table.composition.d.ts.map +1 -1
- package/dist/components/table/table.constants.d.ts +4 -0
- package/dist/components/table/table.constants.d.ts.map +1 -1
- package/dist/components/table/table.constants.js +9 -4
- package/dist/components/table/table.d.ts +1 -1
- package/dist/components/table/table.d.ts.map +1 -1
- package/dist/components/table/table.js +41 -37
- package/dist/components/table/translations.d.ts +7 -0
- package/dist/components/table/translations.d.ts.map +1 -1
- package/dist/components/table/translations.js +199 -194
- package/dist/components/table/types.d.ts +33 -2
- package/dist/components/table/types.d.ts.map +1 -1
- package/dist/components/tabs/tab-list.js +16 -17
- package/dist/components/tabs/tab-panel.js +14 -14
- package/dist/components/tabs/tab-panels.js +15 -15
- package/dist/components/tabs/tab-with-image.js +60 -53
- package/dist/components/tabs/tab.js +26 -22
- package/dist/components/tabs/tabs-recipe.js +96 -116
- package/dist/components/tabs/tabs.js +25 -24
- package/dist/components/tag/tag-recipe.js +225 -252
- package/dist/components/tag/tag.js +121 -62
- package/dist/components/text/text-recipe.js +3 -8
- package/dist/components/text/text.js +26 -27
- package/dist/components/textarea/textarea-recipe.js +90 -96
- package/dist/components/textarea/textarea.js +19 -19
- package/dist/components/toaster/toast-store.d.ts +2 -2
- package/dist/components/toaster/toast-store.d.ts.map +1 -1
- package/dist/components/toaster/toast-store.js +25 -32
- package/dist/components/toaster/toaster.js +39 -34
- package/dist/components/toggle-button/toggle-button.js +23 -25
- package/dist/components/toggle-button/use-button-children.js +36 -35
- package/dist/components/tooltip/tooltip.js +43 -47
- package/dist/hooks/use-color-mode.js +17 -22
- package/dist/hooks/use-disclosure.js +10 -13
- package/dist/hooks/use-measured-width.js +21 -21
- package/dist/hooks/use-remove-attributes.js +25 -24
- package/dist/index.js +396 -802
- package/dist/node_modules/@dnd-kit/abstract/index.js +658 -1185
- package/dist/node_modules/@dnd-kit/collision/dist/index.js +51 -90
- package/dist/node_modules/@dnd-kit/dom/index.js +1256 -1518
- package/dist/node_modules/@dnd-kit/dom/sortable.js +529 -654
- package/dist/node_modules/@dnd-kit/dom/utilities.js +772 -940
- package/dist/node_modules/@dnd-kit/geometry/dist/index.js +228 -196
- package/dist/node_modules/@dnd-kit/react/hooks.js +51 -63
- package/dist/node_modules/@dnd-kit/react/index.js +175 -235
- package/dist/node_modules/@dnd-kit/react/sortable.js +67 -142
- package/dist/node_modules/@dnd-kit/react/utilities.js +7 -9
- package/dist/node_modules/@dnd-kit/state/dist/index.js +157 -172
- package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +154 -243
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +294 -369
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +95 -133
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +96 -122
- package/dist/node_modules/@preact/signals-core/dist/signals-core.module.js +249 -264
- package/dist/node_modules/@tanstack/react-table/build/lib/index.js +34 -88
- package/dist/node_modules/@tanstack/react-virtual/dist/esm/index.js +74 -88
- package/dist/node_modules/@tanstack/table-core/build/lib/index.js +1463 -1822
- package/dist/node_modules/@tanstack/virtual-core/dist/esm/index.js +633 -768
- package/dist/node_modules/@tanstack/virtual-core/dist/esm/lazy-measurements.js +30 -32
- package/dist/node_modules/@tanstack/virtual-core/dist/esm/utils.js +35 -48
- package/dist/node_modules/@tiptap/core/dist/index.js +3433 -3946
- package/dist/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.js +19 -19
- package/dist/node_modules/@tiptap/extension-blockquote/dist/index.js +73 -1498
- package/dist/node_modules/@tiptap/extension-bold/dist/index.js +71 -84
- package/dist/node_modules/@tiptap/extension-code/dist/index.js +65 -70
- package/dist/node_modules/@tiptap/extension-code-block/dist/index.js +155 -216
- package/dist/node_modules/@tiptap/extension-document/dist/index.js +9 -11
- package/dist/node_modules/@tiptap/extension-hard-break/dist/index.js +48 -60
- package/dist/node_modules/@tiptap/extension-heading/dist/index.js +65 -66
- package/dist/node_modules/@tiptap/extension-horizontal-rule/dist/index.js +47 -55
- package/dist/node_modules/@tiptap/extension-italic/dist/index.js +68 -82
- package/dist/node_modules/@tiptap/extension-link/dist/index.js +365 -334
- package/dist/node_modules/@tiptap/extension-list/dist/index.js +936 -1105
- package/dist/node_modules/@tiptap/extension-paragraph/dist/index.js +43 -48
- package/dist/node_modules/@tiptap/extension-strike/dist/index.js +53 -65
- package/dist/node_modules/@tiptap/extension-text/dist/index.js +12 -12
- package/dist/node_modules/@tiptap/extension-underline/dist/index.js +60 -64
- package/dist/node_modules/@tiptap/extensions/dist/index.js +439 -462
- package/dist/node_modules/@tiptap/react/dist/index.js +314 -0
- package/dist/node_modules/@tiptap/starter-kit/dist/index.js +23 -24
- package/dist/node_modules/country-flag-icons/modules/countries.json.js +4 -4
- package/dist/node_modules/country-flag-icons/modules/hasFlag.js +6 -6
- package/dist/node_modules/country-flag-icons/modules/react/3x2/index.js +5469 -6298
- package/dist/node_modules/country-flag-icons/react/3x2/index.js +273 -269
- package/dist/node_modules/date-fns/_lib/addLeadingZeros.js +5 -6
- package/dist/node_modules/date-fns/_lib/defaultOptions.js +6 -6
- package/dist/node_modules/date-fns/_lib/format/formatters.js +385 -544
- package/dist/node_modules/date-fns/_lib/format/lightFormatters.js +42 -57
- package/dist/node_modules/date-fns/_lib/format/longFormatters.js +37 -48
- package/dist/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js +7 -17
- package/dist/node_modules/date-fns/_lib/normalizeDates.js +6 -9
- package/dist/node_modules/date-fns/_lib/protectedTokens.js +19 -16
- package/dist/node_modules/date-fns/addDays.js +8 -8
- package/dist/node_modules/date-fns/addMonths.js +11 -18
- package/dist/node_modules/date-fns/addWeeks.js +6 -6
- package/dist/node_modules/date-fns/constants.js +10 -6
- package/dist/node_modules/date-fns/constructFrom.js +6 -6
- package/dist/node_modules/date-fns/constructNow.js +6 -6
- package/dist/node_modules/date-fns/differenceInCalendarDays.js +10 -14
- package/dist/node_modules/date-fns/endOfDay.js +7 -7
- package/dist/node_modules/date-fns/endOfMonth.js +7 -7
- package/dist/node_modules/date-fns/format.js +57 -55
- package/dist/node_modules/date-fns/getDayOfYear.js +9 -9
- package/dist/node_modules/date-fns/getISOWeek.js +10 -10
- package/dist/node_modules/date-fns/getISOWeekYear.js +13 -13
- package/dist/node_modules/date-fns/getWeek.js +10 -10
- package/dist/node_modules/date-fns/getWeekYear.js +14 -14
- package/dist/node_modules/date-fns/isBefore.js +6 -6
- package/dist/node_modules/date-fns/isDate.js +5 -5
- package/dist/node_modules/date-fns/isPast.js +6 -6
- package/dist/node_modules/date-fns/isSameDay.js +8 -12
- package/dist/node_modules/date-fns/isSameMonth.js +7 -11
- package/dist/node_modules/date-fns/isSameWeek.js +8 -12
- package/dist/node_modules/date-fns/isSameYear.js +7 -11
- package/dist/node_modules/date-fns/isToday.js +7 -10
- package/dist/node_modules/date-fns/isValid.js +7 -7
- package/dist/node_modules/date-fns/locale/_lib/buildFormatLongFn.js +8 -8
- package/dist/node_modules/date-fns/locale/_lib/buildLocalizeFn.js +16 -17
- package/dist/node_modules/date-fns/locale/_lib/buildMatchFn.js +19 -28
- package/dist/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js +17 -14
- package/dist/node_modules/date-fns/locale/da/_lib/formatDistance.js +68 -69
- package/dist/node_modules/date-fns/locale/da/_lib/formatLong.js +31 -32
- package/dist/node_modules/date-fns/locale/da/_lib/formatRelative.js +11 -11
- package/dist/node_modules/date-fns/locale/da/_lib/localize.js +193 -142
- package/dist/node_modules/date-fns/locale/da/_lib/match.js +123 -109
- package/dist/node_modules/date-fns/locale/da.js +17 -17
- package/dist/node_modules/date-fns/locale/en-GB/_lib/formatLong.js +31 -32
- package/dist/node_modules/date-fns/locale/en-GB.js +18 -18
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatDistance.js +68 -69
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatLong.js +31 -32
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatRelative.js +11 -11
- package/dist/node_modules/date-fns/locale/en-US/_lib/localize.js +200 -153
- package/dist/node_modules/date-fns/locale/en-US/_lib/match.js +123 -109
- package/dist/node_modules/date-fns/locale/en-US.js +18 -18
- package/dist/node_modules/date-fns/locale/es/_lib/formatDistance.js +68 -69
- package/dist/node_modules/date-fns/locale/es/_lib/formatLong.js +31 -32
- package/dist/node_modules/date-fns/locale/es/_lib/formatRelative.js +18 -18
- package/dist/node_modules/date-fns/locale/es/_lib/localize.js +192 -141
- package/dist/node_modules/date-fns/locale/es/_lib/match.js +127 -114
- package/dist/node_modules/date-fns/locale/es.js +18 -18
- package/dist/node_modules/date-fns/locale/et/_lib/formatDistance.js +161 -162
- package/dist/node_modules/date-fns/locale/et/_lib/formatLong.js +31 -32
- package/dist/node_modules/date-fns/locale/et/_lib/formatRelative.js +11 -11
- package/dist/node_modules/date-fns/locale/et/_lib/localize.js +196 -152
- package/dist/node_modules/date-fns/locale/et/_lib/match.js +109 -107
- package/dist/node_modules/date-fns/locale/et.js +19 -19
- package/dist/node_modules/date-fns/locale/fi/_lib/formatDistance.js +101 -101
- package/dist/node_modules/date-fns/locale/fi/_lib/formatLong.js +31 -32
- package/dist/node_modules/date-fns/locale/fi/_lib/formatRelative.js +11 -11
- package/dist/node_modules/date-fns/locale/fi/_lib/localize.js +192 -140
- package/dist/node_modules/date-fns/locale/fi/_lib/match.js +122 -108
- package/dist/node_modules/date-fns/locale/fi.js +18 -18
- package/dist/node_modules/date-fns/locale/fr/_lib/formatDistance.js +68 -69
- package/dist/node_modules/date-fns/locale/fr/_lib/formatLong.js +31 -32
- package/dist/node_modules/date-fns/locale/fr/_lib/formatRelative.js +11 -11
- package/dist/node_modules/date-fns/locale/fr/_lib/localize.js +176 -120
- package/dist/node_modules/date-fns/locale/fr/_lib/match.js +122 -108
- package/dist/node_modules/date-fns/locale/fr.js +18 -18
- package/dist/node_modules/date-fns/locale/lt/_lib/formatDistance.js +93 -109
- package/dist/node_modules/date-fns/locale/lt/_lib/formatLong.js +31 -32
- package/dist/node_modules/date-fns/locale/lt/_lib/formatRelative.js +11 -11
- package/dist/node_modules/date-fns/locale/lt/_lib/localize.js +298 -195
- package/dist/node_modules/date-fns/locale/lt/_lib/match.js +154 -121
- package/dist/node_modules/date-fns/locale/lt.js +19 -19
- package/dist/node_modules/date-fns/locale/lv/_lib/formatDistance.js +226 -120
- package/dist/node_modules/date-fns/locale/lv/_lib/formatLong.js +31 -32
- package/dist/node_modules/date-fns/locale/lv/_lib/formatRelative.js +22 -22
- package/dist/node_modules/date-fns/locale/lv/_lib/localize.js +298 -221
- package/dist/node_modules/date-fns/locale/lv/_lib/match.js +138 -112
- package/dist/node_modules/date-fns/locale/lv.js +18 -18
- package/dist/node_modules/date-fns/locale/nb/_lib/formatDistance.js +68 -69
- package/dist/node_modules/date-fns/locale/nb/_lib/formatLong.js +31 -32
- package/dist/node_modules/date-fns/locale/nb/_lib/formatRelative.js +11 -11
- package/dist/node_modules/date-fns/locale/nb/_lib/localize.js +159 -108
- package/dist/node_modules/date-fns/locale/nb/_lib/match.js +112 -108
- package/dist/node_modules/date-fns/locale/nb.js +18 -18
- package/dist/node_modules/date-fns/locale/nl/_lib/formatDistance.js +68 -69
- package/dist/node_modules/date-fns/locale/nl/_lib/formatLong.js +31 -32
- package/dist/node_modules/date-fns/locale/nl/_lib/formatRelative.js +11 -11
- package/dist/node_modules/date-fns/locale/nl/_lib/localize.js +160 -109
- package/dist/node_modules/date-fns/locale/nl/_lib/match.js +120 -108
- package/dist/node_modules/date-fns/locale/nl-BE/_lib/formatDistance.js +68 -69
- package/dist/node_modules/date-fns/locale/nl-BE/_lib/formatLong.js +31 -32
- package/dist/node_modules/date-fns/locale/nl-BE/_lib/formatRelative.js +11 -11
- package/dist/node_modules/date-fns/locale/nl-BE/_lib/localize.js +160 -109
- package/dist/node_modules/date-fns/locale/nl-BE/_lib/match.js +120 -108
- package/dist/node_modules/date-fns/locale/nl-BE.js +18 -18
- package/dist/node_modules/date-fns/locale/nl.js +18 -18
- package/dist/node_modules/date-fns/locale/sv/_lib/formatDistance.js +82 -86
- package/dist/node_modules/date-fns/locale/sv/_lib/formatLong.js +31 -32
- package/dist/node_modules/date-fns/locale/sv/_lib/formatRelative.js +11 -11
- package/dist/node_modules/date-fns/locale/sv/_lib/localize.js +199 -142
- package/dist/node_modules/date-fns/locale/sv/_lib/match.js +109 -107
- package/dist/node_modules/date-fns/locale/sv.js +18 -18
- package/dist/node_modules/date-fns/startOfDay.js +7 -7
- package/dist/node_modules/date-fns/startOfISOWeek.js +9 -6
- package/dist/node_modules/date-fns/startOfISOWeekYear.js +9 -9
- package/dist/node_modules/date-fns/startOfMonth.js +7 -7
- package/dist/node_modules/date-fns/startOfWeek.js +8 -8
- package/dist/node_modules/date-fns/startOfWeekYear.js +10 -10
- package/dist/node_modules/date-fns/startOfYear.js +7 -7
- package/dist/node_modules/date-fns/subDays.js +6 -6
- package/dist/node_modules/date-fns/subMonths.js +6 -6
- package/dist/node_modules/date-fns/subWeeks.js +6 -6
- package/dist/node_modules/date-fns/toDate.js +6 -6
- package/dist/node_modules/fast-equals/dist/es/index.js +239 -298
- package/dist/node_modules/libphonenumber-js/es6/ParseError.js +116 -89
- package/dist/node_modules/libphonenumber-js/es6/PhoneNumber.js +155 -183
- package/dist/node_modules/libphonenumber-js/es6/constants.js +4 -10
- package/dist/node_modules/libphonenumber-js/es6/format.js +70 -91
- package/dist/node_modules/libphonenumber-js/es6/getCountries.js +5 -5
- package/dist/node_modules/libphonenumber-js/es6/helpers/RFC3966.js +8 -10
- package/dist/node_modules/libphonenumber-js/es6/helpers/applyInternationalSeparatorStyle.js +5 -5
- package/dist/node_modules/libphonenumber-js/es6/helpers/checkNumberLength.js +19 -14
- package/dist/node_modules/libphonenumber-js/es6/helpers/extension/createExtensionPattern.js +9 -9
- package/dist/node_modules/libphonenumber-js/es6/helpers/extension/extractExtension.js +15 -17
- package/dist/node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCode.js +35 -45
- package/dist/node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js +20 -26
- package/dist/node_modules/libphonenumber-js/es6/helpers/extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.js +17 -22
- package/dist/node_modules/libphonenumber-js/es6/helpers/extractNationalNumber.js +24 -36
- package/dist/node_modules/libphonenumber-js/es6/helpers/extractNationalNumberFromPossiblyIncompleteNumber.js +26 -30
- package/dist/node_modules/libphonenumber-js/es6/helpers/extractPhoneContext.js +13 -21
- package/dist/node_modules/libphonenumber-js/es6/helpers/formatNationalNumberUsingFormat.js +10 -24
- package/dist/node_modules/libphonenumber-js/es6/helpers/getCountryAndCallingCodeFromOneOfThem.js +10 -11
- package/dist/node_modules/libphonenumber-js/es6/helpers/getCountryByCallingCode.js +6 -8
- package/dist/node_modules/libphonenumber-js/es6/helpers/getCountryByNationalNumber.js +39 -39
- package/dist/node_modules/libphonenumber-js/es6/helpers/getIddPrefix.js +9 -11
- package/dist/node_modules/libphonenumber-js/es6/helpers/getNumberType.js +56 -47
- package/dist/node_modules/libphonenumber-js/es6/helpers/getPossibleCountriesForNumber.js +12 -12
- package/dist/node_modules/libphonenumber-js/es6/helpers/isCallingCode.js +5 -5
- package/dist/node_modules/libphonenumber-js/es6/helpers/isCountryCode.js +5 -5
- package/dist/node_modules/libphonenumber-js/es6/helpers/isObject.js +6 -6
- package/dist/node_modules/libphonenumber-js/es6/helpers/isViablePhoneNumber.js +9 -17
- package/dist/node_modules/libphonenumber-js/es6/helpers/matchesEntirely.js +5 -5
- package/dist/node_modules/libphonenumber-js/es6/helpers/mergeArrays.js +39 -0
- package/dist/node_modules/libphonenumber-js/es6/helpers/parseDigits.js +46 -77
- package/dist/node_modules/libphonenumber-js/es6/helpers/stripIddPrefix.js +17 -18
- package/dist/node_modules/libphonenumber-js/es6/isPossible.js +29 -32
- package/dist/node_modules/libphonenumber-js/es6/isValid.js +12 -13
- package/dist/node_modules/libphonenumber-js/es6/isValidPhoneNumber.js +55 -52
- package/dist/node_modules/libphonenumber-js/es6/metadata.js +462 -482
- package/dist/node_modules/libphonenumber-js/es6/normalizeArguments.js +97 -95
- package/dist/node_modules/libphonenumber-js/es6/parse.js +98 -133
- package/dist/node_modules/libphonenumber-js/es6/parseIncompletePhoneNumber.js +43 -35
- package/dist/node_modules/libphonenumber-js/es6/parsePhoneNumber.js +8 -8
- package/dist/node_modules/libphonenumber-js/es6/parsePhoneNumberWithError_.js +51 -48
- package/dist/node_modules/libphonenumber-js/es6/parsePhoneNumber_.js +59 -55
- package/dist/node_modules/libphonenumber-js/es6/tools/semver-compare.js +13 -13
- package/dist/node_modules/libphonenumber-js/metadata.min.json.js +7437 -3
- package/dist/node_modules/libphonenumber-js/min/exports/getCountries.js +6 -6
- package/dist/node_modules/libphonenumber-js/min/exports/getCountryCallingCode.js +6 -6
- package/dist/node_modules/libphonenumber-js/min/exports/isSupportedCountry.js +7 -7
- package/dist/node_modules/libphonenumber-js/min/exports/isValidPhoneNumber.js +6 -6
- package/dist/node_modules/libphonenumber-js/min/exports/parsePhoneNumber.js +7 -7
- package/dist/node_modules/libphonenumber-js/min/exports/withMetadataArgument.js +6 -6
- package/dist/node_modules/linkifyjs/dist/linkify.js +486 -679
- package/dist/node_modules/next-themes/dist/index.js +120 -85
- package/dist/node_modules/orderedmap/dist/index.js +64 -100
- package/dist/node_modules/prosemirror-commands/dist/index.js +313 -368
- package/dist/node_modules/prosemirror-dropcursor/dist/index.js +109 -84
- package/dist/node_modules/prosemirror-gapcursor/dist/index.js +162 -195
- package/dist/node_modules/prosemirror-history/dist/index.js +203 -239
- package/dist/node_modules/prosemirror-keymap/dist/index.js +45 -57
- package/dist/node_modules/prosemirror-model/dist/index.js +1783 -2735
- package/dist/node_modules/prosemirror-schema-list/dist/index.js +66 -81
- package/dist/node_modules/prosemirror-state/dist/index.js +517 -814
- package/dist/node_modules/prosemirror-transform/dist/index.js +1104 -1505
- package/dist/node_modules/prosemirror-view/dist/index.js +3274 -3782
- package/dist/node_modules/react/cjs/react-compiler-runtime.development.js +15 -21
- package/dist/node_modules/react/cjs/react-compiler-runtime.production.js +12 -14
- package/dist/node_modules/react/compiler-runtime.js +10 -10
- package/dist/node_modules/rope-sequence/dist/index.js +82 -99
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js +55 -58
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js +53 -57
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +53 -58
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +45 -46
- package/dist/node_modules/use-sync-external-store/shim/index.js +10 -10
- package/dist/node_modules/use-sync-external-store/shim/with-selector.js +10 -10
- package/dist/node_modules/w3c-keyname/index.js +87 -92
- package/dist/theme/component-recipes.js +52 -53
- package/dist/theme/theme-casper-ui.js +179 -420
- package/dist/theme/theme-helper.js +4 -4
- package/dist/theme/theme-provider.js +33 -34
- package/dist/theme/theme-style-props.d.ts.map +1 -1
- package/dist/theme/theme-tokens.js +22 -12
- package/dist/theme/theme-types.js +22 -12
- package/dist/theme/theme.js +213 -268
- package/package.json +30 -29
- package/dist/_virtual/compiler-runtime.js +0 -5
- package/dist/_virtual/compiler-runtime2.js +0 -4
- package/dist/_virtual/index.js +0 -5
- package/dist/_virtual/index2.js +0 -4
- package/dist/_virtual/react-compiler-runtime.development.js +0 -4
- package/dist/_virtual/react-compiler-runtime.production.js +0 -4
- package/dist/_virtual/use-sync-external-store-shim.development.js +0 -4
- package/dist/_virtual/use-sync-external-store-shim.production.js +0 -4
- package/dist/_virtual/with-selector.development.js +0 -4
- package/dist/_virtual/with-selector.js +0 -5
- package/dist/_virtual/with-selector.production.js +0 -4
- package/dist/_virtual/with-selector2.js +0 -4
- package/dist/packages/casper-ui-library/node_modules/@tiptap/react/dist/index.js +0 -506
|
@@ -1,2736 +1,1784 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
}
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
}
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
}
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
}
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
}
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
}
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
}
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
}
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
}
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
}
|
|
1716
|
-
/**
|
|
1717
|
-
True for node types that allow no content.
|
|
1718
|
-
*/
|
|
1719
|
-
get isLeaf() {
|
|
1720
|
-
return this.contentMatch == w.empty;
|
|
1721
|
-
}
|
|
1722
|
-
/**
|
|
1723
|
-
True when this node is an atom, i.e. when it does not have
|
|
1724
|
-
directly editable content.
|
|
1725
|
-
*/
|
|
1726
|
-
get isAtom() {
|
|
1727
|
-
return this.isLeaf || !!this.spec.atom;
|
|
1728
|
-
}
|
|
1729
|
-
/**
|
|
1730
|
-
Return true when this node type is part of the given
|
|
1731
|
-
[group](https://prosemirror.net/docs/ref/#model.NodeSpec.group).
|
|
1732
|
-
*/
|
|
1733
|
-
isInGroup(t) {
|
|
1734
|
-
return this.groups.indexOf(t) > -1;
|
|
1735
|
-
}
|
|
1736
|
-
/**
|
|
1737
|
-
The node type's [whitespace](https://prosemirror.net/docs/ref/#model.NodeSpec.whitespace) option.
|
|
1738
|
-
*/
|
|
1739
|
-
get whitespace() {
|
|
1740
|
-
return this.spec.whitespace || (this.spec.code ? "pre" : "normal");
|
|
1741
|
-
}
|
|
1742
|
-
/**
|
|
1743
|
-
Tells you whether this node type has any required attributes.
|
|
1744
|
-
*/
|
|
1745
|
-
hasRequiredAttrs() {
|
|
1746
|
-
for (let t in this.attrs)
|
|
1747
|
-
if (this.attrs[t].isRequired)
|
|
1748
|
-
return !0;
|
|
1749
|
-
return !1;
|
|
1750
|
-
}
|
|
1751
|
-
/**
|
|
1752
|
-
Indicates whether this node allows some of the same content as
|
|
1753
|
-
the given node type.
|
|
1754
|
-
*/
|
|
1755
|
-
compatibleContent(t) {
|
|
1756
|
-
return this == t || this.contentMatch.compatible(t.contentMatch);
|
|
1757
|
-
}
|
|
1758
|
-
/**
|
|
1759
|
-
@internal
|
|
1760
|
-
*/
|
|
1761
|
-
computeAttrs(t) {
|
|
1762
|
-
return !t && this.defaultAttrs ? this.defaultAttrs : ot(this.attrs, t);
|
|
1763
|
-
}
|
|
1764
|
-
/**
|
|
1765
|
-
Create a `Node` of this type. The given attributes are
|
|
1766
|
-
checked and defaulted (you can pass `null` to use the type's
|
|
1767
|
-
defaults entirely, if no required attributes exist). `content`
|
|
1768
|
-
may be a `Fragment`, a node, an array of nodes, or
|
|
1769
|
-
`null`. Similarly `marks` may be `null` to default to the empty
|
|
1770
|
-
set of marks.
|
|
1771
|
-
*/
|
|
1772
|
-
create(t = null, e, n) {
|
|
1773
|
-
if (this.isText)
|
|
1774
|
-
throw new Error("NodeType.create can't construct text nodes");
|
|
1775
|
-
return new g(this, this.computeAttrs(t), c.from(e), u.setFrom(n));
|
|
1776
|
-
}
|
|
1777
|
-
/**
|
|
1778
|
-
Like [`create`](https://prosemirror.net/docs/ref/#model.NodeType.create), but check the given content
|
|
1779
|
-
against the node type's content restrictions, and throw an error
|
|
1780
|
-
if it doesn't match.
|
|
1781
|
-
*/
|
|
1782
|
-
createChecked(t = null, e, n) {
|
|
1783
|
-
return e = c.from(e), this.checkContent(e), new g(this, this.computeAttrs(t), e, u.setFrom(n));
|
|
1784
|
-
}
|
|
1785
|
-
/**
|
|
1786
|
-
Like [`create`](https://prosemirror.net/docs/ref/#model.NodeType.create), but see if it is
|
|
1787
|
-
necessary to add nodes to the start or end of the given fragment
|
|
1788
|
-
to make it fit the node. If no fitting wrapping can be found,
|
|
1789
|
-
return null. Note that, due to the fact that required nodes can
|
|
1790
|
-
always be created, this will always succeed if you pass null or
|
|
1791
|
-
`Fragment.empty` as content.
|
|
1792
|
-
*/
|
|
1793
|
-
createAndFill(t = null, e, n) {
|
|
1794
|
-
if (t = this.computeAttrs(t), e = c.from(e), e.size) {
|
|
1795
|
-
let s = this.contentMatch.fillBefore(e);
|
|
1796
|
-
if (!s)
|
|
1797
|
-
return null;
|
|
1798
|
-
e = s.append(e);
|
|
1799
|
-
}
|
|
1800
|
-
let i = this.contentMatch.matchFragment(e), r = i && i.fillBefore(c.empty, !0);
|
|
1801
|
-
return r ? new g(this, t, e.append(r), u.setFrom(n)) : null;
|
|
1802
|
-
}
|
|
1803
|
-
/**
|
|
1804
|
-
Returns true if the given fragment is valid content for this node
|
|
1805
|
-
type.
|
|
1806
|
-
*/
|
|
1807
|
-
validContent(t) {
|
|
1808
|
-
let e = this.contentMatch.matchFragment(t);
|
|
1809
|
-
if (!e || !e.validEnd)
|
|
1810
|
-
return !1;
|
|
1811
|
-
for (let n = 0; n < t.childCount; n++)
|
|
1812
|
-
if (!this.allowsMarks(t.child(n).marks))
|
|
1813
|
-
return !1;
|
|
1814
|
-
return !0;
|
|
1815
|
-
}
|
|
1816
|
-
/**
|
|
1817
|
-
Throws a RangeError if the given fragment is not valid content for this
|
|
1818
|
-
node type.
|
|
1819
|
-
@internal
|
|
1820
|
-
*/
|
|
1821
|
-
checkContent(t) {
|
|
1822
|
-
if (!this.validContent(t))
|
|
1823
|
-
throw new RangeError(`Invalid content for node ${this.name}: ${t.toString().slice(0, 50)}`);
|
|
1824
|
-
}
|
|
1825
|
-
/**
|
|
1826
|
-
@internal
|
|
1827
|
-
*/
|
|
1828
|
-
checkAttrs(t) {
|
|
1829
|
-
ht(this.attrs, t, "node", this.name);
|
|
1830
|
-
}
|
|
1831
|
-
/**
|
|
1832
|
-
Check whether the given mark type is allowed in this node.
|
|
1833
|
-
*/
|
|
1834
|
-
allowsMarkType(t) {
|
|
1835
|
-
return this.markSet == null || this.markSet.indexOf(t) > -1;
|
|
1836
|
-
}
|
|
1837
|
-
/**
|
|
1838
|
-
Test whether the given set of marks are allowed in this node.
|
|
1839
|
-
*/
|
|
1840
|
-
allowsMarks(t) {
|
|
1841
|
-
if (this.markSet == null)
|
|
1842
|
-
return !0;
|
|
1843
|
-
for (let e = 0; e < t.length; e++)
|
|
1844
|
-
if (!this.allowsMarkType(t[e].type))
|
|
1845
|
-
return !1;
|
|
1846
|
-
return !0;
|
|
1847
|
-
}
|
|
1848
|
-
/**
|
|
1849
|
-
Removes the marks that are not allowed in this node from the given set.
|
|
1850
|
-
*/
|
|
1851
|
-
allowedMarks(t) {
|
|
1852
|
-
if (this.markSet == null)
|
|
1853
|
-
return t;
|
|
1854
|
-
let e;
|
|
1855
|
-
for (let n = 0; n < t.length; n++)
|
|
1856
|
-
this.allowsMarkType(t[n].type) ? e && e.push(t[n]) : e || (e = t.slice(0, n));
|
|
1857
|
-
return e ? e.length ? e : u.none : t;
|
|
1858
|
-
}
|
|
1859
|
-
/**
|
|
1860
|
-
@internal
|
|
1861
|
-
*/
|
|
1862
|
-
static compile(t, e) {
|
|
1863
|
-
let n = /* @__PURE__ */ Object.create(null);
|
|
1864
|
-
t.forEach((r, s) => n[r] = new v(r, e, s));
|
|
1865
|
-
let i = e.spec.topNode || "doc";
|
|
1866
|
-
if (!n[i])
|
|
1867
|
-
throw new RangeError("Schema is missing its top node type ('" + i + "')");
|
|
1868
|
-
if (!n.text)
|
|
1869
|
-
throw new RangeError("Every schema needs a 'text' type");
|
|
1870
|
-
for (let r in n.text.attrs)
|
|
1871
|
-
throw new RangeError("The text node type should not have attributes");
|
|
1872
|
-
return n;
|
|
1873
|
-
}
|
|
1874
|
-
}
|
|
1875
|
-
function Nt(l, t, e) {
|
|
1876
|
-
let n = e.split("|");
|
|
1877
|
-
return (i) => {
|
|
1878
|
-
let r = i === null ? "null" : typeof i;
|
|
1879
|
-
if (n.indexOf(r) < 0)
|
|
1880
|
-
throw new RangeError(`Expected value of type ${n} for attribute ${t} on type ${l}, got ${r}`);
|
|
1881
|
-
};
|
|
1882
|
-
}
|
|
1883
|
-
class zt {
|
|
1884
|
-
constructor(t, e, n) {
|
|
1885
|
-
this.hasDefault = Object.prototype.hasOwnProperty.call(n, "default"), this.default = n.default, this.validate = typeof n.validate == "string" ? Nt(t, e, n.validate) : n.validate;
|
|
1886
|
-
}
|
|
1887
|
-
get isRequired() {
|
|
1888
|
-
return !this.hasDefault;
|
|
1889
|
-
}
|
|
1890
|
-
}
|
|
1891
|
-
class F {
|
|
1892
|
-
/**
|
|
1893
|
-
@internal
|
|
1894
|
-
*/
|
|
1895
|
-
constructor(t, e, n, i) {
|
|
1896
|
-
this.name = t, this.rank = e, this.schema = n, this.spec = i, this.attrs = at(t, i.attrs), this.excluded = null;
|
|
1897
|
-
let r = lt(this.attrs);
|
|
1898
|
-
this.instance = r ? new u(this, r) : null;
|
|
1899
|
-
}
|
|
1900
|
-
/**
|
|
1901
|
-
Create a mark of this type. `attrs` may be `null` or an object
|
|
1902
|
-
containing only some of the mark's attributes. The others, if
|
|
1903
|
-
they have defaults, will be added.
|
|
1904
|
-
*/
|
|
1905
|
-
create(t = null) {
|
|
1906
|
-
return !t && this.instance ? this.instance : new u(this, ot(this.attrs, t));
|
|
1907
|
-
}
|
|
1908
|
-
/**
|
|
1909
|
-
@internal
|
|
1910
|
-
*/
|
|
1911
|
-
static compile(t, e) {
|
|
1912
|
-
let n = /* @__PURE__ */ Object.create(null), i = 0;
|
|
1913
|
-
return t.forEach((r, s) => n[r] = new F(r, i++, e, s)), n;
|
|
1914
|
-
}
|
|
1915
|
-
/**
|
|
1916
|
-
When there is a mark of this type in the given set, a new set
|
|
1917
|
-
without it is returned. Otherwise, the input set is returned.
|
|
1918
|
-
*/
|
|
1919
|
-
removeFromSet(t) {
|
|
1920
|
-
for (var e = 0; e < t.length; e++)
|
|
1921
|
-
t[e].type == this && (t = t.slice(0, e).concat(t.slice(e + 1)), e--);
|
|
1922
|
-
return t;
|
|
1923
|
-
}
|
|
1924
|
-
/**
|
|
1925
|
-
Tests whether there is a mark of this type in the given set.
|
|
1926
|
-
*/
|
|
1927
|
-
isInSet(t) {
|
|
1928
|
-
for (let e = 0; e < t.length; e++)
|
|
1929
|
-
if (t[e].type == this)
|
|
1930
|
-
return t[e];
|
|
1931
|
-
}
|
|
1932
|
-
/**
|
|
1933
|
-
@internal
|
|
1934
|
-
*/
|
|
1935
|
-
checkAttrs(t) {
|
|
1936
|
-
ht(this.attrs, t, "mark", this.name);
|
|
1937
|
-
}
|
|
1938
|
-
/**
|
|
1939
|
-
Queries whether a given mark type is
|
|
1940
|
-
[excluded](https://prosemirror.net/docs/ref/#model.MarkSpec.excludes) by this one.
|
|
1941
|
-
*/
|
|
1942
|
-
excludes(t) {
|
|
1943
|
-
return this.excluded.indexOf(t) > -1;
|
|
1944
|
-
}
|
|
1945
|
-
}
|
|
1946
|
-
class qt {
|
|
1947
|
-
/**
|
|
1948
|
-
Construct a schema from a schema [specification](https://prosemirror.net/docs/ref/#model.SchemaSpec).
|
|
1949
|
-
*/
|
|
1950
|
-
constructor(t) {
|
|
1951
|
-
this.linebreakReplacement = null, this.cached = /* @__PURE__ */ Object.create(null);
|
|
1952
|
-
let e = this.spec = {};
|
|
1953
|
-
for (let i in t)
|
|
1954
|
-
e[i] = t[i];
|
|
1955
|
-
e.nodes = q.from(t.nodes), e.marks = q.from(t.marks || {}), this.nodes = v.compile(this.spec.nodes, this), this.marks = F.compile(this.spec.marks, this);
|
|
1956
|
-
let n = /* @__PURE__ */ Object.create(null);
|
|
1957
|
-
for (let i in this.nodes) {
|
|
1958
|
-
if (i in this.marks)
|
|
1959
|
-
throw new RangeError(i + " can not be both a node and a mark");
|
|
1960
|
-
let r = this.nodes[i], s = r.spec.content || "", o = r.spec.marks;
|
|
1961
|
-
if (r.contentMatch = n[s] || (n[s] = w.parse(s, this.nodes)), r.inlineContent = r.contentMatch.inlineContent, r.spec.linebreakReplacement) {
|
|
1962
|
-
if (this.linebreakReplacement)
|
|
1963
|
-
throw new RangeError("Multiple linebreak nodes defined");
|
|
1964
|
-
if (!r.isInline || !r.isLeaf)
|
|
1965
|
-
throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");
|
|
1966
|
-
this.linebreakReplacement = r;
|
|
1967
|
-
}
|
|
1968
|
-
r.markSet = o == "_" ? null : o ? U(this, o.split(" ")) : o == "" || !r.inlineContent ? [] : null;
|
|
1969
|
-
}
|
|
1970
|
-
for (let i in this.marks) {
|
|
1971
|
-
let r = this.marks[i], s = r.spec.excludes;
|
|
1972
|
-
r.excluded = s == null ? [r] : s == "" ? [] : U(this, s.split(" "));
|
|
1973
|
-
}
|
|
1974
|
-
this.nodeFromJSON = (i) => g.fromJSON(this, i), this.markFromJSON = (i) => u.fromJSON(this, i), this.topNodeType = this.nodes[this.spec.topNode || "doc"], this.cached.wrappings = /* @__PURE__ */ Object.create(null);
|
|
1975
|
-
}
|
|
1976
|
-
/**
|
|
1977
|
-
Create a node in this schema. The `type` may be a string or a
|
|
1978
|
-
`NodeType` instance. Attributes will be extended with defaults,
|
|
1979
|
-
`content` may be a `Fragment`, `null`, a `Node`, or an array of
|
|
1980
|
-
nodes.
|
|
1981
|
-
*/
|
|
1982
|
-
node(t, e = null, n, i) {
|
|
1983
|
-
if (typeof t == "string")
|
|
1984
|
-
t = this.nodeType(t);
|
|
1985
|
-
else if (t instanceof v) {
|
|
1986
|
-
if (t.schema != this)
|
|
1987
|
-
throw new RangeError("Node type from different schema used (" + t.name + ")");
|
|
1988
|
-
} else throw new RangeError("Invalid node type: " + t);
|
|
1989
|
-
return t.createChecked(e, n, i);
|
|
1990
|
-
}
|
|
1991
|
-
/**
|
|
1992
|
-
Create a text node in the schema. Empty text nodes are not
|
|
1993
|
-
allowed.
|
|
1994
|
-
*/
|
|
1995
|
-
text(t, e) {
|
|
1996
|
-
let n = this.nodes.text;
|
|
1997
|
-
return new z(n, n.defaultAttrs, t, u.setFrom(e));
|
|
1998
|
-
}
|
|
1999
|
-
/**
|
|
2000
|
-
Create a mark with the given type and attributes.
|
|
2001
|
-
*/
|
|
2002
|
-
mark(t, e) {
|
|
2003
|
-
return typeof t == "string" && (t = this.marks[t]), t.create(e);
|
|
2004
|
-
}
|
|
2005
|
-
/**
|
|
2006
|
-
@internal
|
|
2007
|
-
*/
|
|
2008
|
-
nodeType(t) {
|
|
2009
|
-
let e = this.nodes[t];
|
|
2010
|
-
if (!e)
|
|
2011
|
-
throw new RangeError("Unknown node type: " + t);
|
|
2012
|
-
return e;
|
|
2013
|
-
}
|
|
2014
|
-
}
|
|
2015
|
-
function U(l, t) {
|
|
2016
|
-
let e = [];
|
|
2017
|
-
for (let n = 0; n < t.length; n++) {
|
|
2018
|
-
let i = t[n], r = l.marks[i], s = r;
|
|
2019
|
-
if (r)
|
|
2020
|
-
e.push(r);
|
|
2021
|
-
else
|
|
2022
|
-
for (let o in l.marks) {
|
|
2023
|
-
let h = l.marks[o];
|
|
2024
|
-
(i == "_" || h.spec.group && h.spec.group.split(" ").indexOf(i) > -1) && e.push(s = h);
|
|
2025
|
-
}
|
|
2026
|
-
if (!s)
|
|
2027
|
-
throw new SyntaxError("Unknown mark type: '" + t[n] + "'");
|
|
2028
|
-
}
|
|
2029
|
-
return e;
|
|
2030
|
-
}
|
|
2031
|
-
function vt(l) {
|
|
2032
|
-
return l.tag != null;
|
|
2033
|
-
}
|
|
2034
|
-
function Rt(l) {
|
|
2035
|
-
return l.style != null;
|
|
2036
|
-
}
|
|
2037
|
-
class P {
|
|
2038
|
-
/**
|
|
2039
|
-
Create a parser that targets the given schema, using the given
|
|
2040
|
-
parsing rules.
|
|
2041
|
-
*/
|
|
2042
|
-
constructor(t, e) {
|
|
2043
|
-
this.schema = t, this.rules = e, this.tags = [], this.styles = [];
|
|
2044
|
-
let n = this.matchedStyles = [];
|
|
2045
|
-
e.forEach((i) => {
|
|
2046
|
-
if (vt(i))
|
|
2047
|
-
this.tags.push(i);
|
|
2048
|
-
else if (Rt(i)) {
|
|
2049
|
-
let r = /[^=]*/.exec(i.style)[0];
|
|
2050
|
-
n.indexOf(r) < 0 && n.push(r), this.styles.push(i);
|
|
2051
|
-
}
|
|
2052
|
-
}), this.normalizeLists = !this.tags.some((i) => {
|
|
2053
|
-
if (!/^(ul|ol)\b/.test(i.tag) || !i.node)
|
|
2054
|
-
return !1;
|
|
2055
|
-
let r = t.nodes[i.node];
|
|
2056
|
-
return r.contentMatch.matchType(r);
|
|
2057
|
-
});
|
|
2058
|
-
}
|
|
2059
|
-
/**
|
|
2060
|
-
Parse a document from the content of a DOM node.
|
|
2061
|
-
*/
|
|
2062
|
-
parse(t, e = {}) {
|
|
2063
|
-
let n = new G(this, e, !1);
|
|
2064
|
-
return n.addAll(t, u.none, e.from, e.to), n.finish();
|
|
2065
|
-
}
|
|
2066
|
-
/**
|
|
2067
|
-
Parses the content of the given DOM node, like
|
|
2068
|
-
[`parse`](https://prosemirror.net/docs/ref/#model.DOMParser.parse), and takes the same set of
|
|
2069
|
-
options. But unlike that method, which produces a whole node,
|
|
2070
|
-
this one returns a slice that is open at the sides, meaning that
|
|
2071
|
-
the schema constraints aren't applied to the start of nodes to
|
|
2072
|
-
the left of the input and the end of nodes at the end.
|
|
2073
|
-
*/
|
|
2074
|
-
parseSlice(t, e = {}) {
|
|
2075
|
-
let n = new G(this, e, !0);
|
|
2076
|
-
return n.addAll(t, u.none, e.from, e.to), y.maxOpen(n.finish());
|
|
2077
|
-
}
|
|
2078
|
-
/**
|
|
2079
|
-
@internal
|
|
2080
|
-
*/
|
|
2081
|
-
matchTag(t, e, n) {
|
|
2082
|
-
for (let i = n ? this.tags.indexOf(n) + 1 : 0; i < this.tags.length; i++) {
|
|
2083
|
-
let r = this.tags[i];
|
|
2084
|
-
if (Pt(t, r.tag) && (r.namespace === void 0 || t.namespaceURI == r.namespace) && (!r.context || e.matchesContext(r.context))) {
|
|
2085
|
-
if (r.getAttrs) {
|
|
2086
|
-
let s = r.getAttrs(t);
|
|
2087
|
-
if (s === !1)
|
|
2088
|
-
continue;
|
|
2089
|
-
r.attrs = s || void 0;
|
|
2090
|
-
}
|
|
2091
|
-
return r;
|
|
2092
|
-
}
|
|
2093
|
-
}
|
|
2094
|
-
}
|
|
2095
|
-
/**
|
|
2096
|
-
@internal
|
|
2097
|
-
*/
|
|
2098
|
-
matchStyle(t, e, n, i) {
|
|
2099
|
-
for (let r = i ? this.styles.indexOf(i) + 1 : 0; r < this.styles.length; r++) {
|
|
2100
|
-
let s = this.styles[r], o = s.style;
|
|
2101
|
-
if (!(o.indexOf(t) != 0 || s.context && !n.matchesContext(s.context) || // Test that the style string either precisely matches the prop,
|
|
2102
|
-
// or has an '=' sign after the prop, followed by the given
|
|
2103
|
-
// value.
|
|
2104
|
-
o.length > t.length && (o.charCodeAt(t.length) != 61 || o.slice(t.length + 1) != e))) {
|
|
2105
|
-
if (s.getAttrs) {
|
|
2106
|
-
let h = s.getAttrs(e);
|
|
2107
|
-
if (h === !1)
|
|
2108
|
-
continue;
|
|
2109
|
-
s.attrs = h || void 0;
|
|
2110
|
-
}
|
|
2111
|
-
return s;
|
|
2112
|
-
}
|
|
2113
|
-
}
|
|
2114
|
-
}
|
|
2115
|
-
/**
|
|
2116
|
-
@internal
|
|
2117
|
-
*/
|
|
2118
|
-
static schemaRules(t) {
|
|
2119
|
-
let e = [];
|
|
2120
|
-
function n(i) {
|
|
2121
|
-
let r = i.priority == null ? 50 : i.priority, s = 0;
|
|
2122
|
-
for (; s < e.length; s++) {
|
|
2123
|
-
let o = e[s];
|
|
2124
|
-
if ((o.priority == null ? 50 : o.priority) < r)
|
|
2125
|
-
break;
|
|
2126
|
-
}
|
|
2127
|
-
e.splice(s, 0, i);
|
|
2128
|
-
}
|
|
2129
|
-
for (let i in t.marks) {
|
|
2130
|
-
let r = t.marks[i].spec.parseDOM;
|
|
2131
|
-
r && r.forEach((s) => {
|
|
2132
|
-
n(s = H(s)), s.mark || s.ignore || s.clearMark || (s.mark = i);
|
|
2133
|
-
});
|
|
2134
|
-
}
|
|
2135
|
-
for (let i in t.nodes) {
|
|
2136
|
-
let r = t.nodes[i].spec.parseDOM;
|
|
2137
|
-
r && r.forEach((s) => {
|
|
2138
|
-
n(s = H(s)), s.node || s.ignore || s.mark || (s.node = i);
|
|
2139
|
-
});
|
|
2140
|
-
}
|
|
2141
|
-
return e;
|
|
2142
|
-
}
|
|
2143
|
-
/**
|
|
2144
|
-
Construct a DOM parser using the parsing rules listed in a
|
|
2145
|
-
schema's [node specs](https://prosemirror.net/docs/ref/#model.NodeSpec.parseDOM), reordered by
|
|
2146
|
-
[priority](https://prosemirror.net/docs/ref/#model.GenericParseRule.priority).
|
|
2147
|
-
*/
|
|
2148
|
-
static fromSchema(t) {
|
|
2149
|
-
return t.cached.domParser || (t.cached.domParser = new P(t, P.schemaRules(t)));
|
|
2150
|
-
}
|
|
2151
|
-
}
|
|
2152
|
-
const ft = {
|
|
2153
|
-
address: !0,
|
|
2154
|
-
article: !0,
|
|
2155
|
-
aside: !0,
|
|
2156
|
-
blockquote: !0,
|
|
2157
|
-
canvas: !0,
|
|
2158
|
-
dd: !0,
|
|
2159
|
-
div: !0,
|
|
2160
|
-
dl: !0,
|
|
2161
|
-
fieldset: !0,
|
|
2162
|
-
figcaption: !0,
|
|
2163
|
-
figure: !0,
|
|
2164
|
-
footer: !0,
|
|
2165
|
-
form: !0,
|
|
2166
|
-
h1: !0,
|
|
2167
|
-
h2: !0,
|
|
2168
|
-
h3: !0,
|
|
2169
|
-
h4: !0,
|
|
2170
|
-
h5: !0,
|
|
2171
|
-
h6: !0,
|
|
2172
|
-
header: !0,
|
|
2173
|
-
hgroup: !0,
|
|
2174
|
-
hr: !0,
|
|
2175
|
-
li: !0,
|
|
2176
|
-
noscript: !0,
|
|
2177
|
-
ol: !0,
|
|
2178
|
-
output: !0,
|
|
2179
|
-
p: !0,
|
|
2180
|
-
pre: !0,
|
|
2181
|
-
section: !0,
|
|
2182
|
-
table: !0,
|
|
2183
|
-
tfoot: !0,
|
|
2184
|
-
ul: !0
|
|
2185
|
-
}, It = {
|
|
2186
|
-
head: !0,
|
|
2187
|
-
noscript: !0,
|
|
2188
|
-
object: !0,
|
|
2189
|
-
script: !0,
|
|
2190
|
-
style: !0,
|
|
2191
|
-
title: !0
|
|
2192
|
-
}, ct = { ol: !0, ul: !0 }, C = 1, B = 2, S = 4;
|
|
2193
|
-
function V(l, t, e) {
|
|
2194
|
-
return t != null ? (t ? C : 0) | (t === "full" ? B : 0) : l && l.whitespace == "pre" ? C | B : e & ~S;
|
|
2195
|
-
}
|
|
2196
|
-
class T {
|
|
2197
|
-
constructor(t, e, n, i, r, s) {
|
|
2198
|
-
this.type = t, this.attrs = e, this.marks = n, this.solid = i, this.options = s, this.content = [], this.activeMarks = u.none, this.match = r || (s & S ? null : t.contentMatch);
|
|
2199
|
-
}
|
|
2200
|
-
findWrapping(t) {
|
|
2201
|
-
if (!this.match) {
|
|
2202
|
-
if (!this.type)
|
|
2203
|
-
return [];
|
|
2204
|
-
let e = this.type.contentMatch.fillBefore(c.from(t));
|
|
2205
|
-
if (e)
|
|
2206
|
-
this.match = this.type.contentMatch.matchFragment(e);
|
|
2207
|
-
else {
|
|
2208
|
-
let n = this.type.contentMatch, i;
|
|
2209
|
-
return (i = n.findWrapping(t.type)) ? (this.match = n, i) : null;
|
|
2210
|
-
}
|
|
2211
|
-
}
|
|
2212
|
-
return this.match.findWrapping(t.type);
|
|
2213
|
-
}
|
|
2214
|
-
finish(t) {
|
|
2215
|
-
if (!(this.options & C)) {
|
|
2216
|
-
let n = this.content[this.content.length - 1], i;
|
|
2217
|
-
if (n && n.isText && (i = /[ \t\r\n\u000c]+$/.exec(n.text))) {
|
|
2218
|
-
let r = n;
|
|
2219
|
-
n.text.length == i[0].length ? this.content.pop() : this.content[this.content.length - 1] = r.withText(r.text.slice(0, r.text.length - i[0].length));
|
|
2220
|
-
}
|
|
2221
|
-
}
|
|
2222
|
-
let e = c.from(this.content);
|
|
2223
|
-
return !t && this.match && (e = e.append(this.match.fillBefore(c.empty, !0))), this.type ? this.type.create(this.attrs, e, this.marks) : e;
|
|
2224
|
-
}
|
|
2225
|
-
inlineContext(t) {
|
|
2226
|
-
return this.type ? this.type.inlineContent : this.content.length ? this.content[0].isInline : t.parentNode && !ft.hasOwnProperty(t.parentNode.nodeName.toLowerCase());
|
|
2227
|
-
}
|
|
2228
|
-
}
|
|
2229
|
-
class G {
|
|
2230
|
-
constructor(t, e, n) {
|
|
2231
|
-
this.parser = t, this.options = e, this.isOpen = n, this.open = 0, this.localPreserveWS = !1;
|
|
2232
|
-
let i = e.topNode, r, s = V(null, e.preserveWhitespace, 0) | (n ? S : 0);
|
|
2233
|
-
i ? r = new T(i.type, i.attrs, u.none, !0, e.topMatch || i.type.contentMatch, s) : n ? r = new T(null, null, u.none, !0, null, s) : r = new T(t.schema.topNodeType, null, u.none, !0, null, s), this.nodes = [r], this.find = e.findPositions, this.needsBlock = !1;
|
|
2234
|
-
}
|
|
2235
|
-
get top() {
|
|
2236
|
-
return this.nodes[this.open];
|
|
2237
|
-
}
|
|
2238
|
-
// Add a DOM node to the content. Text is inserted as text node,
|
|
2239
|
-
// otherwise, the node is passed to `addElement` or, if it has a
|
|
2240
|
-
// `style` attribute, `addElementWithStyles`.
|
|
2241
|
-
addDOM(t, e) {
|
|
2242
|
-
t.nodeType == 3 ? this.addTextNode(t, e) : t.nodeType == 1 && this.addElement(t, e);
|
|
2243
|
-
}
|
|
2244
|
-
addTextNode(t, e) {
|
|
2245
|
-
let n = t.nodeValue, i = this.top, r = i.options & B ? "full" : this.localPreserveWS || (i.options & C) > 0, { schema: s } = this.parser;
|
|
2246
|
-
if (r === "full" || i.inlineContext(t) || /[^ \t\r\n\u000c]/.test(n)) {
|
|
2247
|
-
if (r)
|
|
2248
|
-
if (r === "full")
|
|
2249
|
-
n = n.replace(/\r\n?/g, `
|
|
2250
|
-
`);
|
|
2251
|
-
else if (s.linebreakReplacement && /[\r\n]/.test(n) && this.top.findWrapping(s.linebreakReplacement.create())) {
|
|
2252
|
-
let o = n.split(/\r?\n|\r/);
|
|
2253
|
-
for (let h = 0; h < o.length; h++)
|
|
2254
|
-
h && this.insertNode(s.linebreakReplacement.create(), e, !0), o[h] && this.insertNode(s.text(o[h]), e, !/\S/.test(o[h]));
|
|
2255
|
-
n = "";
|
|
2256
|
-
} else
|
|
2257
|
-
n = n.replace(/\r?\n|\r/g, " ");
|
|
2258
|
-
else if (n = n.replace(/[ \t\r\n\u000c]+/g, " "), /^[ \t\r\n\u000c]/.test(n) && this.open == this.nodes.length - 1) {
|
|
2259
|
-
let o = i.content[i.content.length - 1], h = t.previousSibling;
|
|
2260
|
-
(!o || h && h.nodeName == "BR" || o.isText && /[ \t\r\n\u000c]$/.test(o.text)) && (n = n.slice(1));
|
|
2261
|
-
}
|
|
2262
|
-
n && this.insertNode(s.text(n), e, !/\S/.test(n)), this.findInText(t);
|
|
2263
|
-
} else
|
|
2264
|
-
this.findInside(t);
|
|
2265
|
-
}
|
|
2266
|
-
// Try to find a handler for the given tag and use that to parse. If
|
|
2267
|
-
// none is found, the element's content nodes are added directly.
|
|
2268
|
-
addElement(t, e, n) {
|
|
2269
|
-
let i = this.localPreserveWS, r = this.top;
|
|
2270
|
-
(t.tagName == "PRE" || /pre/.test(t.style && t.style.whiteSpace)) && (this.localPreserveWS = !0);
|
|
2271
|
-
let s = t.nodeName.toLowerCase(), o;
|
|
2272
|
-
ct.hasOwnProperty(s) && this.parser.normalizeLists && Dt(t);
|
|
2273
|
-
let h = this.options.ruleFromNode && this.options.ruleFromNode(t) || (o = this.parser.matchTag(t, this, n));
|
|
2274
|
-
t: if (h ? h.ignore : It.hasOwnProperty(s))
|
|
2275
|
-
this.findInside(t), this.ignoreFallback(t, e);
|
|
2276
|
-
else if (!h || h.skip || h.closeParent) {
|
|
2277
|
-
h && h.closeParent ? this.open = Math.max(0, this.open - 1) : h && h.skip.nodeType && (t = h.skip);
|
|
2278
|
-
let a, f = this.needsBlock;
|
|
2279
|
-
if (ft.hasOwnProperty(s))
|
|
2280
|
-
r.content.length && r.content[0].isInline && this.open && (this.open--, r = this.top), a = !0, r.type || (this.needsBlock = !0);
|
|
2281
|
-
else if (!t.firstChild) {
|
|
2282
|
-
this.leafFallback(t, e);
|
|
2283
|
-
break t;
|
|
2284
|
-
}
|
|
2285
|
-
let p = h && h.skip ? e : this.readStyles(t, e);
|
|
2286
|
-
p && this.addAll(t, p), a && this.sync(r), this.needsBlock = f;
|
|
2287
|
-
} else {
|
|
2288
|
-
let a = this.readStyles(t, e);
|
|
2289
|
-
a && this.addElementByRule(t, h, a, h.consuming === !1 ? o : void 0);
|
|
2290
|
-
}
|
|
2291
|
-
this.localPreserveWS = i;
|
|
2292
|
-
}
|
|
2293
|
-
// Called for leaf DOM nodes that would otherwise be ignored
|
|
2294
|
-
leafFallback(t, e) {
|
|
2295
|
-
t.nodeName == "BR" && this.top.type && this.top.type.inlineContent && this.addTextNode(t.ownerDocument.createTextNode(`
|
|
2296
|
-
`), e);
|
|
2297
|
-
}
|
|
2298
|
-
// Called for ignored nodes
|
|
2299
|
-
ignoreFallback(t, e) {
|
|
2300
|
-
t.nodeName == "BR" && (!this.top.type || !this.top.type.inlineContent) && this.findPlace(this.parser.schema.text("-"), e, !0);
|
|
2301
|
-
}
|
|
2302
|
-
// Run any style parser associated with the node's styles. Either
|
|
2303
|
-
// return an updated array of marks, or null to indicate some of the
|
|
2304
|
-
// styles had a rule with `ignore` set.
|
|
2305
|
-
readStyles(t, e) {
|
|
2306
|
-
let n = t.style;
|
|
2307
|
-
if (n && n.length)
|
|
2308
|
-
for (let i = 0; i < this.parser.matchedStyles.length; i++) {
|
|
2309
|
-
let r = this.parser.matchedStyles[i], s = n.getPropertyValue(r);
|
|
2310
|
-
if (s)
|
|
2311
|
-
for (let o = void 0; ; ) {
|
|
2312
|
-
let h = this.parser.matchStyle(r, s, this, o);
|
|
2313
|
-
if (!h)
|
|
2314
|
-
break;
|
|
2315
|
-
if (h.ignore)
|
|
2316
|
-
return null;
|
|
2317
|
-
if (h.clearMark ? e = e.filter((a) => !h.clearMark(a)) : e = e.concat(this.parser.schema.marks[h.mark].create(h.attrs)), h.consuming === !1)
|
|
2318
|
-
o = h;
|
|
2319
|
-
else
|
|
2320
|
-
break;
|
|
2321
|
-
}
|
|
2322
|
-
}
|
|
2323
|
-
return e;
|
|
2324
|
-
}
|
|
2325
|
-
// Look up a handler for the given node. If none are found, return
|
|
2326
|
-
// false. Otherwise, apply it, use its return value to drive the way
|
|
2327
|
-
// the node's content is wrapped, and return true.
|
|
2328
|
-
addElementByRule(t, e, n, i) {
|
|
2329
|
-
let r, s;
|
|
2330
|
-
if (e.node)
|
|
2331
|
-
if (s = this.parser.schema.nodes[e.node], s.isLeaf)
|
|
2332
|
-
this.insertNode(s.create(e.attrs), n, t.nodeName == "BR") || this.leafFallback(t, n);
|
|
2333
|
-
else {
|
|
2334
|
-
let h = this.enter(s, e.attrs || null, n, e.preserveWhitespace);
|
|
2335
|
-
h && (r = !0, n = h);
|
|
2336
|
-
}
|
|
2337
|
-
else {
|
|
2338
|
-
let h = this.parser.schema.marks[e.mark];
|
|
2339
|
-
n = n.concat(h.create(e.attrs));
|
|
2340
|
-
}
|
|
2341
|
-
let o = this.top;
|
|
2342
|
-
if (s && s.isLeaf)
|
|
2343
|
-
this.findInside(t);
|
|
2344
|
-
else if (i)
|
|
2345
|
-
this.addElement(t, n, i);
|
|
2346
|
-
else if (e.getContent)
|
|
2347
|
-
this.findInside(t), e.getContent(t, this.parser.schema).forEach((h) => this.insertNode(h, n, !1));
|
|
2348
|
-
else {
|
|
2349
|
-
let h = t;
|
|
2350
|
-
typeof e.contentElement == "string" ? h = t.querySelector(e.contentElement) : typeof e.contentElement == "function" ? h = e.contentElement(t) : e.contentElement && (h = e.contentElement), this.findAround(t, h, !0), this.addAll(h, n), this.findAround(t, h, !1);
|
|
2351
|
-
}
|
|
2352
|
-
r && this.sync(o) && this.open--;
|
|
2353
|
-
}
|
|
2354
|
-
// Add all child nodes between `startIndex` and `endIndex` (or the
|
|
2355
|
-
// whole node, if not given). If `sync` is passed, use it to
|
|
2356
|
-
// synchronize after every block element.
|
|
2357
|
-
addAll(t, e, n, i) {
|
|
2358
|
-
let r = n || 0;
|
|
2359
|
-
for (let s = n ? t.childNodes[n] : t.firstChild, o = i == null ? null : t.childNodes[i]; s != o; s = s.nextSibling, ++r)
|
|
2360
|
-
this.findAtPoint(t, r), this.addDOM(s, e);
|
|
2361
|
-
this.findAtPoint(t, r);
|
|
2362
|
-
}
|
|
2363
|
-
// Try to find a way to fit the given node type into the current
|
|
2364
|
-
// context. May add intermediate wrappers and/or leave non-solid
|
|
2365
|
-
// nodes that we're in.
|
|
2366
|
-
findPlace(t, e, n) {
|
|
2367
|
-
let i, r;
|
|
2368
|
-
for (let s = this.open, o = 0; s >= 0; s--) {
|
|
2369
|
-
let h = this.nodes[s], a = h.findWrapping(t);
|
|
2370
|
-
if (a && (!i || i.length > a.length + o) && (i = a, r = h, !a.length))
|
|
2371
|
-
break;
|
|
2372
|
-
if (h.solid) {
|
|
2373
|
-
if (n)
|
|
2374
|
-
break;
|
|
2375
|
-
o += 2;
|
|
2376
|
-
}
|
|
2377
|
-
}
|
|
2378
|
-
if (!i)
|
|
2379
|
-
return null;
|
|
2380
|
-
this.sync(r);
|
|
2381
|
-
for (let s = 0; s < i.length; s++)
|
|
2382
|
-
e = this.enterInner(i[s], null, e, !1);
|
|
2383
|
-
return e;
|
|
2384
|
-
}
|
|
2385
|
-
// Try to insert the given node, adjusting the context when needed.
|
|
2386
|
-
insertNode(t, e, n) {
|
|
2387
|
-
if (t.isInline && this.needsBlock && !this.top.type) {
|
|
2388
|
-
let r = this.textblockFromContext();
|
|
2389
|
-
r && (e = this.enterInner(r, null, e));
|
|
2390
|
-
}
|
|
2391
|
-
let i = this.findPlace(t, e, n);
|
|
2392
|
-
if (i) {
|
|
2393
|
-
this.closeExtra();
|
|
2394
|
-
let r = this.top;
|
|
2395
|
-
r.match && (r.match = r.match.matchType(t.type));
|
|
2396
|
-
let s = u.none;
|
|
2397
|
-
for (let o of i.concat(t.marks))
|
|
2398
|
-
(r.type ? r.type.allowsMarkType(o.type) : K(o.type, t.type)) && (s = o.addToSet(s));
|
|
2399
|
-
return r.content.push(t.mark(s)), !0;
|
|
2400
|
-
}
|
|
2401
|
-
return !1;
|
|
2402
|
-
}
|
|
2403
|
-
// Try to start a node of the given type, adjusting the context when
|
|
2404
|
-
// necessary.
|
|
2405
|
-
enter(t, e, n, i) {
|
|
2406
|
-
let r = this.findPlace(t.create(e), n, !1);
|
|
2407
|
-
return r && (r = this.enterInner(t, e, n, !0, i)), r;
|
|
2408
|
-
}
|
|
2409
|
-
// Open a node of the given type
|
|
2410
|
-
enterInner(t, e, n, i = !1, r) {
|
|
2411
|
-
this.closeExtra();
|
|
2412
|
-
let s = this.top;
|
|
2413
|
-
s.match = s.match && s.match.matchType(t);
|
|
2414
|
-
let o = V(t, r, s.options);
|
|
2415
|
-
s.options & S && s.content.length == 0 && (o |= S);
|
|
2416
|
-
let h = u.none;
|
|
2417
|
-
return n = n.filter((a) => (s.type ? s.type.allowsMarkType(a.type) : K(a.type, t)) ? (h = a.addToSet(h), !1) : !0), this.nodes.push(new T(t, e, h, i, null, o)), this.open++, n;
|
|
2418
|
-
}
|
|
2419
|
-
// Make sure all nodes above this.open are finished and added to
|
|
2420
|
-
// their parents
|
|
2421
|
-
closeExtra(t = !1) {
|
|
2422
|
-
let e = this.nodes.length - 1;
|
|
2423
|
-
if (e > this.open) {
|
|
2424
|
-
for (; e > this.open; e--)
|
|
2425
|
-
this.nodes[e - 1].content.push(this.nodes[e].finish(t));
|
|
2426
|
-
this.nodes.length = this.open + 1;
|
|
2427
|
-
}
|
|
2428
|
-
}
|
|
2429
|
-
finish() {
|
|
2430
|
-
return this.open = 0, this.closeExtra(this.isOpen), this.nodes[0].finish(!!(this.isOpen || this.options.topOpen));
|
|
2431
|
-
}
|
|
2432
|
-
sync(t) {
|
|
2433
|
-
for (let e = this.open; e >= 0; e--) {
|
|
2434
|
-
if (this.nodes[e] == t)
|
|
2435
|
-
return this.open = e, !0;
|
|
2436
|
-
this.localPreserveWS && (this.nodes[e].options |= C);
|
|
2437
|
-
}
|
|
2438
|
-
return !1;
|
|
2439
|
-
}
|
|
2440
|
-
get currentPos() {
|
|
2441
|
-
this.closeExtra();
|
|
2442
|
-
let t = 0;
|
|
2443
|
-
for (let e = this.open; e >= 0; e--) {
|
|
2444
|
-
let n = this.nodes[e].content;
|
|
2445
|
-
for (let i = n.length - 1; i >= 0; i--)
|
|
2446
|
-
t += n[i].nodeSize;
|
|
2447
|
-
e && t++;
|
|
2448
|
-
}
|
|
2449
|
-
return t;
|
|
2450
|
-
}
|
|
2451
|
-
findAtPoint(t, e) {
|
|
2452
|
-
if (this.find)
|
|
2453
|
-
for (let n = 0; n < this.find.length; n++)
|
|
2454
|
-
this.find[n].node == t && this.find[n].offset == e && (this.find[n].pos = this.currentPos);
|
|
2455
|
-
}
|
|
2456
|
-
findInside(t) {
|
|
2457
|
-
if (this.find)
|
|
2458
|
-
for (let e = 0; e < this.find.length; e++)
|
|
2459
|
-
this.find[e].pos == null && t.nodeType == 1 && t.contains(this.find[e].node) && (this.find[e].pos = this.currentPos);
|
|
2460
|
-
}
|
|
2461
|
-
findAround(t, e, n) {
|
|
2462
|
-
if (t != e && this.find)
|
|
2463
|
-
for (let i = 0; i < this.find.length; i++)
|
|
2464
|
-
this.find[i].pos == null && t.nodeType == 1 && t.contains(this.find[i].node) && e.compareDocumentPosition(this.find[i].node) & (n ? 2 : 4) && (this.find[i].pos = this.currentPos);
|
|
2465
|
-
}
|
|
2466
|
-
findInText(t) {
|
|
2467
|
-
if (this.find)
|
|
2468
|
-
for (let e = 0; e < this.find.length; e++)
|
|
2469
|
-
this.find[e].node == t && (this.find[e].pos = this.currentPos - (t.nodeValue.length - this.find[e].offset));
|
|
2470
|
-
}
|
|
2471
|
-
// Determines whether the given context string matches this context.
|
|
2472
|
-
matchesContext(t) {
|
|
2473
|
-
if (t.indexOf("|") > -1)
|
|
2474
|
-
return t.split(/\s*\|\s*/).some(this.matchesContext, this);
|
|
2475
|
-
let e = t.split("/"), n = this.options.context, i = !this.isOpen && (!n || n.parent.type == this.nodes[0].type), r = -(n ? n.depth + 1 : 0) + (i ? 0 : 1), s = (o, h) => {
|
|
2476
|
-
for (; o >= 0; o--) {
|
|
2477
|
-
let a = e[o];
|
|
2478
|
-
if (a == "") {
|
|
2479
|
-
if (o == e.length - 1 || o == 0)
|
|
2480
|
-
continue;
|
|
2481
|
-
for (; h >= r; h--)
|
|
2482
|
-
if (s(o - 1, h))
|
|
2483
|
-
return !0;
|
|
2484
|
-
return !1;
|
|
2485
|
-
} else {
|
|
2486
|
-
let f = h > 0 || h == 0 && i ? this.nodes[h].type : n && h >= r ? n.node(h - r).type : null;
|
|
2487
|
-
if (!f || f.name != a && !f.isInGroup(a))
|
|
2488
|
-
return !1;
|
|
2489
|
-
h--;
|
|
2490
|
-
}
|
|
2491
|
-
}
|
|
2492
|
-
return !0;
|
|
2493
|
-
};
|
|
2494
|
-
return s(e.length - 1, this.open);
|
|
2495
|
-
}
|
|
2496
|
-
textblockFromContext() {
|
|
2497
|
-
let t = this.options.context;
|
|
2498
|
-
if (t)
|
|
2499
|
-
for (let e = t.depth; e >= 0; e--) {
|
|
2500
|
-
let n = t.node(e).contentMatchAt(t.indexAfter(e)).defaultType;
|
|
2501
|
-
if (n && n.isTextblock && n.defaultAttrs)
|
|
2502
|
-
return n;
|
|
2503
|
-
}
|
|
2504
|
-
for (let e in this.parser.schema.nodes) {
|
|
2505
|
-
let n = this.parser.schema.nodes[e];
|
|
2506
|
-
if (n.isTextblock && n.defaultAttrs)
|
|
2507
|
-
return n;
|
|
2508
|
-
}
|
|
2509
|
-
}
|
|
2510
|
-
}
|
|
2511
|
-
function Dt(l) {
|
|
2512
|
-
for (let t = l.firstChild, e = null; t; t = t.nextSibling) {
|
|
2513
|
-
let n = t.nodeType == 1 ? t.nodeName.toLowerCase() : null;
|
|
2514
|
-
n && ct.hasOwnProperty(n) && e ? (e.appendChild(t), t = e) : n == "li" ? e = t : n && (e = null);
|
|
2515
|
-
}
|
|
2516
|
-
}
|
|
2517
|
-
function Pt(l, t) {
|
|
2518
|
-
return (l.matches || l.msMatchesSelector || l.webkitMatchesSelector || l.mozMatchesSelector).call(l, t);
|
|
2519
|
-
}
|
|
2520
|
-
function H(l) {
|
|
2521
|
-
let t = {};
|
|
2522
|
-
for (let e in l)
|
|
2523
|
-
t[e] = l[e];
|
|
2524
|
-
return t;
|
|
2525
|
-
}
|
|
2526
|
-
function K(l, t) {
|
|
2527
|
-
let e = t.schema.nodes;
|
|
2528
|
-
for (let n in e) {
|
|
2529
|
-
let i = e[n];
|
|
2530
|
-
if (!i.allowsMarkType(l))
|
|
2531
|
-
continue;
|
|
2532
|
-
let r = [], s = (o) => {
|
|
2533
|
-
r.push(o);
|
|
2534
|
-
for (let h = 0; h < o.edgeCount; h++) {
|
|
2535
|
-
let { type: a, next: f } = o.edge(h);
|
|
2536
|
-
if (a == t || r.indexOf(f) < 0 && s(f))
|
|
2537
|
-
return !0;
|
|
2538
|
-
}
|
|
2539
|
-
};
|
|
2540
|
-
if (s(i.contentMatch))
|
|
2541
|
-
return !0;
|
|
2542
|
-
}
|
|
2543
|
-
}
|
|
2544
|
-
class ut {
|
|
2545
|
-
/**
|
|
2546
|
-
Create a serializer. `nodes` should map node names to functions
|
|
2547
|
-
that take a node and return a description of the corresponding
|
|
2548
|
-
DOM. `marks` does the same for mark names, but also gets an
|
|
2549
|
-
argument that tells it whether the mark's content is block or
|
|
2550
|
-
inline content (for typical use, it'll always be inline). A mark
|
|
2551
|
-
serializer may be `null` to indicate that marks of that type
|
|
2552
|
-
should not be serialized.
|
|
2553
|
-
*/
|
|
2554
|
-
constructor(t, e) {
|
|
2555
|
-
this.nodes = t, this.marks = e;
|
|
2556
|
-
}
|
|
2557
|
-
/**
|
|
2558
|
-
Serialize the content of this fragment to a DOM fragment. When
|
|
2559
|
-
not in the browser, the `document` option, containing a DOM
|
|
2560
|
-
document, should be passed so that the serializer can create
|
|
2561
|
-
nodes.
|
|
2562
|
-
*/
|
|
2563
|
-
serializeFragment(t, e = {}, n) {
|
|
2564
|
-
n || (n = b(e).createDocumentFragment());
|
|
2565
|
-
let i = n, r = [];
|
|
2566
|
-
return t.forEach((s) => {
|
|
2567
|
-
if (r.length || s.marks.length) {
|
|
2568
|
-
let o = 0, h = 0;
|
|
2569
|
-
for (; o < r.length && h < s.marks.length; ) {
|
|
2570
|
-
let a = s.marks[h];
|
|
2571
|
-
if (!this.marks[a.type.name]) {
|
|
2572
|
-
h++;
|
|
2573
|
-
continue;
|
|
2574
|
-
}
|
|
2575
|
-
if (!a.eq(r[o][0]) || a.type.spec.spanning === !1)
|
|
2576
|
-
break;
|
|
2577
|
-
o++, h++;
|
|
2578
|
-
}
|
|
2579
|
-
for (; o < r.length; )
|
|
2580
|
-
i = r.pop()[1];
|
|
2581
|
-
for (; h < s.marks.length; ) {
|
|
2582
|
-
let a = s.marks[h++], f = this.serializeMark(a, s.isInline, e);
|
|
2583
|
-
f && (r.push([a, i]), i.appendChild(f.dom), i = f.contentDOM || f.dom);
|
|
2584
|
-
}
|
|
2585
|
-
}
|
|
2586
|
-
i.appendChild(this.serializeNodeInner(s, e));
|
|
2587
|
-
}), n;
|
|
2588
|
-
}
|
|
2589
|
-
/**
|
|
2590
|
-
@internal
|
|
2591
|
-
*/
|
|
2592
|
-
serializeNodeInner(t, e) {
|
|
2593
|
-
if (t.isText)
|
|
2594
|
-
return b(e).createTextNode(t.text);
|
|
2595
|
-
let { dom: n, contentDOM: i } = M(b(e), this.nodes[t.type.name](t), null, t.attrs);
|
|
2596
|
-
if (i) {
|
|
2597
|
-
if (t.isLeaf)
|
|
2598
|
-
throw new RangeError("Content hole not allowed in a leaf node spec");
|
|
2599
|
-
this.serializeFragment(t.content, e, i);
|
|
2600
|
-
}
|
|
2601
|
-
return n;
|
|
2602
|
-
}
|
|
2603
|
-
/**
|
|
2604
|
-
Serialize this node to a DOM node. This can be useful when you
|
|
2605
|
-
need to serialize a part of a document, as opposed to the whole
|
|
2606
|
-
document. To serialize a whole document, use
|
|
2607
|
-
[`serializeFragment`](https://prosemirror.net/docs/ref/#model.DOMSerializer.serializeFragment) on
|
|
2608
|
-
its [content](https://prosemirror.net/docs/ref/#model.Node.content).
|
|
2609
|
-
*/
|
|
2610
|
-
serializeNode(t, e = {}) {
|
|
2611
|
-
let n = this.serializeNodeInner(t, e);
|
|
2612
|
-
for (let i = t.marks.length - 1; i >= 0; i--) {
|
|
2613
|
-
let r = this.serializeMark(t.marks[i], t.isInline, e);
|
|
2614
|
-
r && ((r.contentDOM || r.dom).appendChild(n), n = r.dom);
|
|
2615
|
-
}
|
|
2616
|
-
return n;
|
|
2617
|
-
}
|
|
2618
|
-
/**
|
|
2619
|
-
@internal
|
|
2620
|
-
*/
|
|
2621
|
-
serializeMark(t, e, n = {}) {
|
|
2622
|
-
let i = this.marks[t.type.name];
|
|
2623
|
-
return i && M(b(n), i(t, e), null, t.attrs);
|
|
2624
|
-
}
|
|
2625
|
-
static renderSpec(t, e, n = null, i) {
|
|
2626
|
-
return typeof e == "string" ? { dom: t.createTextNode(e) } : M(t, e, n, i);
|
|
2627
|
-
}
|
|
2628
|
-
/**
|
|
2629
|
-
Build a serializer using the [`toDOM`](https://prosemirror.net/docs/ref/#model.NodeSpec.toDOM)
|
|
2630
|
-
properties in a schema's node and mark specs.
|
|
2631
|
-
*/
|
|
2632
|
-
static fromSchema(t) {
|
|
2633
|
-
return t.cached.domSerializer || (t.cached.domSerializer = new ut(this.nodesFromSchema(t), this.marksFromSchema(t)));
|
|
2634
|
-
}
|
|
2635
|
-
/**
|
|
2636
|
-
Gather the serializers in a schema's node specs into an object.
|
|
2637
|
-
This can be useful as a base to build a custom serializer from.
|
|
2638
|
-
*/
|
|
2639
|
-
static nodesFromSchema(t) {
|
|
2640
|
-
let e = Q(t.nodes);
|
|
2641
|
-
return e.text || (e.text = (n) => n.text), e;
|
|
2642
|
-
}
|
|
2643
|
-
/**
|
|
2644
|
-
Gather the serializers in a schema's mark specs into an object.
|
|
2645
|
-
*/
|
|
2646
|
-
static marksFromSchema(t) {
|
|
2647
|
-
return Q(t.marks);
|
|
2648
|
-
}
|
|
2649
|
-
}
|
|
2650
|
-
function Q(l) {
|
|
2651
|
-
let t = {};
|
|
2652
|
-
for (let e in l) {
|
|
2653
|
-
let n = l[e].spec.toDOM;
|
|
2654
|
-
n && (t[e] = n);
|
|
2655
|
-
}
|
|
2656
|
-
return t;
|
|
2657
|
-
}
|
|
2658
|
-
function b(l) {
|
|
2659
|
-
return l.document || window.document;
|
|
2660
|
-
}
|
|
2661
|
-
const X = /* @__PURE__ */ new WeakMap();
|
|
2662
|
-
function Bt(l) {
|
|
2663
|
-
let t = X.get(l);
|
|
2664
|
-
return t === void 0 && X.set(l, t = Ft(l)), t;
|
|
2665
|
-
}
|
|
2666
|
-
function Ft(l) {
|
|
2667
|
-
let t = null;
|
|
2668
|
-
function e(n) {
|
|
2669
|
-
if (n && typeof n == "object")
|
|
2670
|
-
if (Array.isArray(n))
|
|
2671
|
-
if (typeof n[0] == "string")
|
|
2672
|
-
t || (t = []), t.push(n);
|
|
2673
|
-
else
|
|
2674
|
-
for (let i = 0; i < n.length; i++)
|
|
2675
|
-
e(n[i]);
|
|
2676
|
-
else
|
|
2677
|
-
for (let i in n)
|
|
2678
|
-
e(n[i]);
|
|
2679
|
-
}
|
|
2680
|
-
return e(l), t;
|
|
2681
|
-
}
|
|
2682
|
-
function M(l, t, e, n) {
|
|
2683
|
-
if (t.nodeType == 1)
|
|
2684
|
-
return { dom: t };
|
|
2685
|
-
if (t.dom && t.dom.nodeType == 1)
|
|
2686
|
-
return t;
|
|
2687
|
-
let i = t[0], r;
|
|
2688
|
-
if (typeof i != "string")
|
|
2689
|
-
throw new RangeError("Invalid array passed to renderSpec");
|
|
2690
|
-
if (n && (r = Bt(n)) && r.indexOf(t) > -1)
|
|
2691
|
-
throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");
|
|
2692
|
-
let s = i.indexOf(" ");
|
|
2693
|
-
s > 0 && (e = i.slice(0, s), i = i.slice(s + 1));
|
|
2694
|
-
let o, h = e ? l.createElementNS(e, i) : l.createElement(i), a = t[1], f = 1;
|
|
2695
|
-
if (a && typeof a == "object" && a.nodeType == null && !Array.isArray(a)) {
|
|
2696
|
-
f = 2;
|
|
2697
|
-
for (let p in a)
|
|
2698
|
-
if (a[p] != null) {
|
|
2699
|
-
let d = p.indexOf(" ");
|
|
2700
|
-
d > 0 ? h.setAttributeNS(p.slice(0, d), p.slice(d + 1), a[p]) : p == "style" && h.style ? h.style.cssText = a[p] : h.setAttribute(p, a[p]);
|
|
2701
|
-
}
|
|
2702
|
-
}
|
|
2703
|
-
for (let p = f; p < t.length; p++) {
|
|
2704
|
-
let d = t[p];
|
|
2705
|
-
if (d === 0) {
|
|
2706
|
-
if (p < t.length - 1 || p > f)
|
|
2707
|
-
throw new RangeError("Content hole must be the only child of its parent node");
|
|
2708
|
-
return { dom: h, contentDOM: h };
|
|
2709
|
-
} else if (typeof d == "string")
|
|
2710
|
-
h.appendChild(l.createTextNode(d));
|
|
2711
|
-
else {
|
|
2712
|
-
let { dom: pt, contentDOM: J } = M(l, d, e, n);
|
|
2713
|
-
if (h.appendChild(pt), J) {
|
|
2714
|
-
if (o)
|
|
2715
|
-
throw new RangeError("Multiple content holes");
|
|
2716
|
-
o = J;
|
|
2717
|
-
}
|
|
2718
|
-
}
|
|
2719
|
-
}
|
|
2720
|
-
return { dom: h, contentDOM: o };
|
|
2721
|
-
}
|
|
2722
|
-
export {
|
|
2723
|
-
w as ContentMatch,
|
|
2724
|
-
P as DOMParser,
|
|
2725
|
-
ut as DOMSerializer,
|
|
2726
|
-
c as Fragment,
|
|
2727
|
-
u as Mark,
|
|
2728
|
-
F as MarkType,
|
|
2729
|
-
g as Node,
|
|
2730
|
-
mt as NodeRange,
|
|
2731
|
-
v as NodeType,
|
|
2732
|
-
I as ReplaceError,
|
|
2733
|
-
E as ResolvedPos,
|
|
2734
|
-
qt as Schema,
|
|
2735
|
-
y as Slice
|
|
1
|
+
import e from "../../orderedmap/dist/index.js";
|
|
2
|
+
//#region ../../node_modules/prosemirror-model/dist/index.js
|
|
3
|
+
function t(e, n, a) {
|
|
4
|
+
for (let o = 0;; o++) {
|
|
5
|
+
if (o == e.childCount || o == n.childCount) return e.childCount == n.childCount ? null : a;
|
|
6
|
+
let s = e.child(o), c = n.child(o);
|
|
7
|
+
if (s == c) {
|
|
8
|
+
a += s.nodeSize;
|
|
9
|
+
continue;
|
|
10
|
+
}
|
|
11
|
+
if (!s.sameMarkup(c)) return a;
|
|
12
|
+
if (s.isText && s.text != c.text) {
|
|
13
|
+
let e = s.text, t = c.text, n = 0;
|
|
14
|
+
for (; e[n] == t[n]; n++) a++;
|
|
15
|
+
return n && n < e.length && n < t.length && i(e.charCodeAt(n - 1)) && r(e.charCodeAt(n)) && a--, a;
|
|
16
|
+
}
|
|
17
|
+
if (s.content.size || c.content.size) {
|
|
18
|
+
let e = t(s.content, c.content, a + 1);
|
|
19
|
+
if (e != null) return e;
|
|
20
|
+
}
|
|
21
|
+
a += s.nodeSize;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
function n(e, t, a, o) {
|
|
25
|
+
for (let s = e.childCount, c = t.childCount;;) {
|
|
26
|
+
if (s == 0 || c == 0) return s == c ? null : {
|
|
27
|
+
a,
|
|
28
|
+
b: o
|
|
29
|
+
};
|
|
30
|
+
let l = e.child(--s), u = t.child(--c), d = l.nodeSize;
|
|
31
|
+
if (l == u) {
|
|
32
|
+
a -= d, o -= d;
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
if (!l.sameMarkup(u)) return {
|
|
36
|
+
a,
|
|
37
|
+
b: o
|
|
38
|
+
};
|
|
39
|
+
if (l.isText && l.text != u.text) {
|
|
40
|
+
let e = l.text, t = u.text, n = e.length, s = t.length;
|
|
41
|
+
for (; n > 0 && s > 0 && e[n - 1] == t[s - 1];) n--, s--, a--, o--;
|
|
42
|
+
return n && s && n < e.length && i(e.charCodeAt(n - 1)) && r(e.charCodeAt(n)) && (a++, o++), {
|
|
43
|
+
a,
|
|
44
|
+
b: o
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
if (l.content.size || u.content.size) {
|
|
48
|
+
let e = n(l.content, u.content, a - 1, o - 1);
|
|
49
|
+
if (e) return e;
|
|
50
|
+
}
|
|
51
|
+
a -= d, o -= d;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
function r(e) {
|
|
55
|
+
return e >= 56320 && e < 57344;
|
|
56
|
+
}
|
|
57
|
+
function i(e) {
|
|
58
|
+
return e >= 55296 && e < 56320;
|
|
59
|
+
}
|
|
60
|
+
var a = class e {
|
|
61
|
+
constructor(e, t) {
|
|
62
|
+
if (this.content = e, this.size = t || 0, t == null) for (let t = 0; t < e.length; t++) this.size += e[t].nodeSize;
|
|
63
|
+
}
|
|
64
|
+
nodesBetween(e, t, n, r = 0, i) {
|
|
65
|
+
for (let a = 0, o = 0; o < t; a++) {
|
|
66
|
+
let s = this.content[a], c = o + s.nodeSize;
|
|
67
|
+
if (c > e && n(s, r + o, i || null, a) !== !1 && s.content.size) {
|
|
68
|
+
let i = o + 1;
|
|
69
|
+
s.nodesBetween(Math.max(0, e - i), Math.min(s.content.size, t - i), n, r + i);
|
|
70
|
+
}
|
|
71
|
+
o = c;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
descendants(e) {
|
|
75
|
+
this.nodesBetween(0, this.size, e);
|
|
76
|
+
}
|
|
77
|
+
textBetween(e, t, n, r) {
|
|
78
|
+
let i = "", a = !0;
|
|
79
|
+
return this.nodesBetween(e, t, (o, s) => {
|
|
80
|
+
let c = o.isText ? o.text.slice(Math.max(e, s) - s, t - s) : o.isLeaf ? r ? typeof r == "function" ? r(o) : r : o.type.spec.leafText ? o.type.spec.leafText(o) : "" : "";
|
|
81
|
+
o.isBlock && (o.isLeaf && c || o.isTextblock) && n && (a ? a = !1 : i += n), i += c;
|
|
82
|
+
}, 0), i;
|
|
83
|
+
}
|
|
84
|
+
append(t) {
|
|
85
|
+
if (!t.size) return this;
|
|
86
|
+
if (!this.size) return t;
|
|
87
|
+
let n = this.lastChild, r = t.firstChild, i = this.content.slice(), a = 0;
|
|
88
|
+
for (n.isText && n.sameMarkup(r) && (i[i.length - 1] = n.withText(n.text + r.text), a = 1); a < t.content.length; a++) i.push(t.content[a]);
|
|
89
|
+
return new e(i, this.size + t.size);
|
|
90
|
+
}
|
|
91
|
+
cut(t, n = this.size) {
|
|
92
|
+
if (t == 0 && n == this.size) return this;
|
|
93
|
+
let r = [], i = 0;
|
|
94
|
+
if (n > t) for (let e = 0, a = 0; a < n; e++) {
|
|
95
|
+
let o = this.content[e], s = a + o.nodeSize;
|
|
96
|
+
s > t && ((a < t || s > n) && (o = o.isText ? o.cut(Math.max(0, t - a), Math.min(o.text.length, n - a)) : o.cut(Math.max(0, t - a - 1), Math.min(o.content.size, n - a - 1))), r.push(o), i += o.nodeSize), a = s;
|
|
97
|
+
}
|
|
98
|
+
return new e(r, i);
|
|
99
|
+
}
|
|
100
|
+
cutByIndex(t, n) {
|
|
101
|
+
return t == n ? e.empty : t == 0 && n == this.content.length ? this : new e(this.content.slice(t, n));
|
|
102
|
+
}
|
|
103
|
+
replaceChild(t, n) {
|
|
104
|
+
let r = this.content[t];
|
|
105
|
+
if (r == n) return this;
|
|
106
|
+
let i = this.content.slice(), a = this.size + n.nodeSize - r.nodeSize;
|
|
107
|
+
return i[t] = n, new e(i, a);
|
|
108
|
+
}
|
|
109
|
+
addToStart(t) {
|
|
110
|
+
return new e([t].concat(this.content), this.size + t.nodeSize);
|
|
111
|
+
}
|
|
112
|
+
addToEnd(t) {
|
|
113
|
+
return new e(this.content.concat(t), this.size + t.nodeSize);
|
|
114
|
+
}
|
|
115
|
+
eq(e) {
|
|
116
|
+
if (this.content.length != e.content.length) return !1;
|
|
117
|
+
for (let t = 0; t < this.content.length; t++) if (!this.content[t].eq(e.content[t])) return !1;
|
|
118
|
+
return !0;
|
|
119
|
+
}
|
|
120
|
+
get firstChild() {
|
|
121
|
+
return this.content.length ? this.content[0] : null;
|
|
122
|
+
}
|
|
123
|
+
get lastChild() {
|
|
124
|
+
return this.content.length ? this.content[this.content.length - 1] : null;
|
|
125
|
+
}
|
|
126
|
+
get childCount() {
|
|
127
|
+
return this.content.length;
|
|
128
|
+
}
|
|
129
|
+
child(e) {
|
|
130
|
+
let t = this.content[e];
|
|
131
|
+
if (!t) throw RangeError("Index " + e + " out of range for " + this);
|
|
132
|
+
return t;
|
|
133
|
+
}
|
|
134
|
+
maybeChild(e) {
|
|
135
|
+
return this.content[e] || null;
|
|
136
|
+
}
|
|
137
|
+
forEach(e) {
|
|
138
|
+
for (let t = 0, n = 0; t < this.content.length; t++) {
|
|
139
|
+
let r = this.content[t];
|
|
140
|
+
e(r, n, t), n += r.nodeSize;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
findDiffStart(e, n = 0) {
|
|
144
|
+
return t(this, e, n);
|
|
145
|
+
}
|
|
146
|
+
findDiffEnd(e, t = this.size, r = e.size) {
|
|
147
|
+
return n(this, e, t, r);
|
|
148
|
+
}
|
|
149
|
+
findIndex(e) {
|
|
150
|
+
if (e == 0) return s(0, e);
|
|
151
|
+
if (e == this.size) return s(this.content.length, e);
|
|
152
|
+
if (e > this.size || e < 0) throw RangeError(`Position ${e} outside of fragment (${this})`);
|
|
153
|
+
for (let t = 0, n = 0;; t++) {
|
|
154
|
+
let r = this.child(t), i = n + r.nodeSize;
|
|
155
|
+
if (i >= e) return i == e ? s(t + 1, i) : s(t, n);
|
|
156
|
+
n = i;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
toString() {
|
|
160
|
+
return "<" + this.toStringInner() + ">";
|
|
161
|
+
}
|
|
162
|
+
toStringInner() {
|
|
163
|
+
return this.content.join(", ");
|
|
164
|
+
}
|
|
165
|
+
toJSON() {
|
|
166
|
+
return this.content.length ? this.content.map((e) => e.toJSON()) : null;
|
|
167
|
+
}
|
|
168
|
+
static fromJSON(t, n) {
|
|
169
|
+
if (!n) return e.empty;
|
|
170
|
+
if (!Array.isArray(n)) throw RangeError("Invalid input for Fragment.fromJSON");
|
|
171
|
+
return e.fromArray(n.map(t.nodeFromJSON));
|
|
172
|
+
}
|
|
173
|
+
static fromArray(t) {
|
|
174
|
+
if (!t.length) return e.empty;
|
|
175
|
+
let n, r = 0;
|
|
176
|
+
for (let e = 0; e < t.length; e++) {
|
|
177
|
+
let i = t[e];
|
|
178
|
+
r += i.nodeSize, e && i.isText && t[e - 1].sameMarkup(i) ? (n ||= t.slice(0, e), n[n.length - 1] = i.withText(n[n.length - 1].text + i.text)) : n && n.push(i);
|
|
179
|
+
}
|
|
180
|
+
return new e(n || t, r);
|
|
181
|
+
}
|
|
182
|
+
static from(t) {
|
|
183
|
+
if (!t) return e.empty;
|
|
184
|
+
if (t instanceof e) return t;
|
|
185
|
+
if (Array.isArray(t)) return this.fromArray(t);
|
|
186
|
+
if (t.attrs) return new e([t], t.nodeSize);
|
|
187
|
+
throw RangeError("Can not convert " + t + " to a Fragment" + (t.nodesBetween ? " (looks like multiple versions of prosemirror-model were loaded)" : ""));
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
a.empty = new a([], 0);
|
|
191
|
+
var o = {
|
|
192
|
+
index: 0,
|
|
193
|
+
offset: 0
|
|
194
|
+
};
|
|
195
|
+
function s(e, t) {
|
|
196
|
+
return o.index = e, o.offset = t, o;
|
|
197
|
+
}
|
|
198
|
+
function c(e, t) {
|
|
199
|
+
if (e === t) return !0;
|
|
200
|
+
if (!(e && typeof e == "object") || !(t && typeof t == "object")) return !1;
|
|
201
|
+
let n = Array.isArray(e);
|
|
202
|
+
if (Array.isArray(t) != n) return !1;
|
|
203
|
+
if (n) {
|
|
204
|
+
if (e.length != t.length) return !1;
|
|
205
|
+
for (let n = 0; n < e.length; n++) if (!c(e[n], t[n])) return !1;
|
|
206
|
+
} else {
|
|
207
|
+
for (let n in e) if (!(n in t) || !c(e[n], t[n])) return !1;
|
|
208
|
+
for (let n in t) if (!(n in e)) return !1;
|
|
209
|
+
}
|
|
210
|
+
return !0;
|
|
211
|
+
}
|
|
212
|
+
var l = class e {
|
|
213
|
+
constructor(e, t) {
|
|
214
|
+
this.type = e, this.attrs = t;
|
|
215
|
+
}
|
|
216
|
+
addToSet(e) {
|
|
217
|
+
let t, n = !1;
|
|
218
|
+
for (let r = 0; r < e.length; r++) {
|
|
219
|
+
let i = e[r];
|
|
220
|
+
if (this.eq(i)) return e;
|
|
221
|
+
if (this.type.excludes(i.type)) t ||= e.slice(0, r);
|
|
222
|
+
else if (i.type.excludes(this.type)) return e;
|
|
223
|
+
else !n && i.type.rank > this.type.rank && (t ||= e.slice(0, r), t.push(this), n = !0), t && t.push(i);
|
|
224
|
+
}
|
|
225
|
+
return t ||= e.slice(), n || t.push(this), t;
|
|
226
|
+
}
|
|
227
|
+
removeFromSet(e) {
|
|
228
|
+
for (let t = 0; t < e.length; t++) if (this.eq(e[t])) return e.slice(0, t).concat(e.slice(t + 1));
|
|
229
|
+
return e;
|
|
230
|
+
}
|
|
231
|
+
isInSet(e) {
|
|
232
|
+
for (let t = 0; t < e.length; t++) if (this.eq(e[t])) return !0;
|
|
233
|
+
return !1;
|
|
234
|
+
}
|
|
235
|
+
eq(e) {
|
|
236
|
+
return this == e || this.type == e.type && c(this.attrs, e.attrs);
|
|
237
|
+
}
|
|
238
|
+
toJSON() {
|
|
239
|
+
let e = { type: this.type.name };
|
|
240
|
+
for (let t in this.attrs) {
|
|
241
|
+
e.attrs = this.attrs;
|
|
242
|
+
break;
|
|
243
|
+
}
|
|
244
|
+
return e;
|
|
245
|
+
}
|
|
246
|
+
static fromJSON(e, t) {
|
|
247
|
+
if (!t) throw RangeError("Invalid input for Mark.fromJSON");
|
|
248
|
+
let n = e.marks[t.type];
|
|
249
|
+
if (!n) throw RangeError(`There is no mark type ${t.type} in this schema`);
|
|
250
|
+
let r = n.create(t.attrs);
|
|
251
|
+
return n.checkAttrs(r.attrs), r;
|
|
252
|
+
}
|
|
253
|
+
static sameSet(e, t) {
|
|
254
|
+
if (e == t) return !0;
|
|
255
|
+
if (e.length != t.length) return !1;
|
|
256
|
+
for (let n = 0; n < e.length; n++) if (!e[n].eq(t[n])) return !1;
|
|
257
|
+
return !0;
|
|
258
|
+
}
|
|
259
|
+
static setFrom(t) {
|
|
260
|
+
if (!t || Array.isArray(t) && t.length == 0) return e.none;
|
|
261
|
+
if (t instanceof e) return [t];
|
|
262
|
+
let n = t.slice();
|
|
263
|
+
return n.sort((e, t) => e.type.rank - t.type.rank), n;
|
|
264
|
+
}
|
|
265
|
+
};
|
|
266
|
+
l.none = [];
|
|
267
|
+
var u = class extends Error {}, d = class e {
|
|
268
|
+
constructor(e, t, n) {
|
|
269
|
+
this.content = e, this.openStart = t, this.openEnd = n;
|
|
270
|
+
}
|
|
271
|
+
get size() {
|
|
272
|
+
return this.content.size - this.openStart - this.openEnd;
|
|
273
|
+
}
|
|
274
|
+
insertAt(t, n) {
|
|
275
|
+
let r = p(this.content, t + this.openStart, n, this.openStart + 1, this.openEnd + 1);
|
|
276
|
+
return r && new e(r, this.openStart, this.openEnd);
|
|
277
|
+
}
|
|
278
|
+
removeBetween(t, n) {
|
|
279
|
+
return new e(f(this.content, t + this.openStart, n + this.openStart), this.openStart, this.openEnd);
|
|
280
|
+
}
|
|
281
|
+
eq(e) {
|
|
282
|
+
return this.content.eq(e.content) && this.openStart == e.openStart && this.openEnd == e.openEnd;
|
|
283
|
+
}
|
|
284
|
+
toString() {
|
|
285
|
+
return this.content + "(" + this.openStart + "," + this.openEnd + ")";
|
|
286
|
+
}
|
|
287
|
+
toJSON() {
|
|
288
|
+
if (!this.content.size) return null;
|
|
289
|
+
let e = { content: this.content.toJSON() };
|
|
290
|
+
return this.openStart > 0 && (e.openStart = this.openStart), this.openEnd > 0 && (e.openEnd = this.openEnd), e;
|
|
291
|
+
}
|
|
292
|
+
static fromJSON(t, n) {
|
|
293
|
+
if (!n) return e.empty;
|
|
294
|
+
let r = n.openStart || 0, i = n.openEnd || 0;
|
|
295
|
+
if (typeof r != "number" || typeof i != "number") throw RangeError("Invalid input for Slice.fromJSON");
|
|
296
|
+
return new e(a.fromJSON(t, n.content), r, i);
|
|
297
|
+
}
|
|
298
|
+
static maxOpen(t, n = !0) {
|
|
299
|
+
let r = 0, i = 0;
|
|
300
|
+
for (let e = t.firstChild; e && !e.isLeaf && (n || !e.type.spec.isolating); e = e.firstChild) r++;
|
|
301
|
+
for (let e = t.lastChild; e && !e.isLeaf && (n || !e.type.spec.isolating); e = e.lastChild) i++;
|
|
302
|
+
return new e(t, r, i);
|
|
303
|
+
}
|
|
304
|
+
};
|
|
305
|
+
d.empty = new d(a.empty, 0, 0);
|
|
306
|
+
function f(e, t, n) {
|
|
307
|
+
let { index: r, offset: i } = e.findIndex(t), a = e.maybeChild(r), { index: o, offset: s } = e.findIndex(n);
|
|
308
|
+
if (i == t || a.isText) {
|
|
309
|
+
if (s != n && !e.child(o).isText) throw RangeError("Removing non-flat range");
|
|
310
|
+
return e.cut(0, t).append(e.cut(n));
|
|
311
|
+
}
|
|
312
|
+
if (r != o) throw RangeError("Removing non-flat range");
|
|
313
|
+
return e.replaceChild(r, a.copy(f(a.content, t - i - 1, n - i - 1)));
|
|
314
|
+
}
|
|
315
|
+
function p(e, t, n, r, i, a) {
|
|
316
|
+
let { index: o, offset: s } = e.findIndex(t), c = e.maybeChild(o);
|
|
317
|
+
if (s == t || c.isText) return a && r <= 0 && i <= 0 && !a.canReplace(o, o, n) ? null : e.cut(0, t).append(n).append(e.cut(t));
|
|
318
|
+
let l = p(c.content, t - s - 1, n, o == 0 ? r - 1 : 0, o == e.childCount - 1 ? i - 1 : 0, c);
|
|
319
|
+
return l && e.replaceChild(o, c.copy(l));
|
|
320
|
+
}
|
|
321
|
+
function ee(e, t, n) {
|
|
322
|
+
if (n.openStart > e.depth) throw new u("Inserted content deeper than insertion position");
|
|
323
|
+
if (e.depth - n.openStart != t.depth - n.openEnd) throw new u("Inconsistent open depths");
|
|
324
|
+
return m(e, t, n, 0);
|
|
325
|
+
}
|
|
326
|
+
function m(e, t, n, r) {
|
|
327
|
+
let i = e.index(r), a = e.node(r);
|
|
328
|
+
if (i == t.index(r) && r < e.depth - n.openStart) {
|
|
329
|
+
let o = m(e, t, n, r + 1);
|
|
330
|
+
return a.copy(a.content.replaceChild(i, o));
|
|
331
|
+
}
|
|
332
|
+
if (!n.content.size) return y(a, x(e, t, r));
|
|
333
|
+
if (!n.openStart && !n.openEnd && e.depth == r && t.depth == r) {
|
|
334
|
+
let r = e.parent, i = r.content;
|
|
335
|
+
return y(r, i.cut(0, e.parentOffset).append(n.content).append(i.cut(t.parentOffset)));
|
|
336
|
+
}
|
|
337
|
+
{
|
|
338
|
+
let { start: i, end: o } = te(n, e);
|
|
339
|
+
return y(a, b(e, i, o, t, r));
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
function h(e, t) {
|
|
343
|
+
if (!t.type.compatibleContent(e.type)) throw new u("Cannot join " + t.type.name + " onto " + e.type.name);
|
|
344
|
+
}
|
|
345
|
+
function g(e, t, n) {
|
|
346
|
+
let r = e.node(n);
|
|
347
|
+
return h(r, t.node(n)), r;
|
|
348
|
+
}
|
|
349
|
+
function _(e, t) {
|
|
350
|
+
let n = t.length - 1;
|
|
351
|
+
n >= 0 && e.isText && e.sameMarkup(t[n]) ? t[n] = e.withText(t[n].text + e.text) : t.push(e);
|
|
352
|
+
}
|
|
353
|
+
function v(e, t, n, r) {
|
|
354
|
+
let i = (t || e).node(n), a = 0, o = t ? t.index(n) : i.childCount;
|
|
355
|
+
e && (a = e.index(n), e.depth > n ? a++ : e.textOffset && (_(e.nodeAfter, r), a++));
|
|
356
|
+
for (let e = a; e < o; e++) _(i.child(e), r);
|
|
357
|
+
t && t.depth == n && t.textOffset && _(t.nodeBefore, r);
|
|
358
|
+
}
|
|
359
|
+
function y(e, t) {
|
|
360
|
+
if (!e.type.validContent(t)) throw new u("Invalid content for node " + e.type.name);
|
|
361
|
+
return e.copy(t);
|
|
362
|
+
}
|
|
363
|
+
function b(e, t, n, r, i) {
|
|
364
|
+
let o = e.depth > i && g(e, t, i + 1), s = r.depth > i && g(n, r, i + 1), c = [];
|
|
365
|
+
return v(null, e, i, c), o && s && t.index(i) == n.index(i) ? (h(o, s), _(y(o, b(e, t, n, r, i + 1)), c)) : (o && _(y(o, x(e, t, i + 1)), c), v(t, n, i, c), s && _(y(s, x(n, r, i + 1)), c)), v(r, null, i, c), new a(c);
|
|
366
|
+
}
|
|
367
|
+
function x(e, t, n) {
|
|
368
|
+
let r = [];
|
|
369
|
+
return v(null, e, n, r), e.depth > n && _(y(g(e, t, n + 1), x(e, t, n + 1)), r), v(t, null, n, r), new a(r);
|
|
370
|
+
}
|
|
371
|
+
function te(e, t) {
|
|
372
|
+
let n = t.depth - e.openStart, r = t.node(n).copy(e.content);
|
|
373
|
+
for (let e = n - 1; e >= 0; e--) r = t.node(e).copy(a.from(r));
|
|
374
|
+
return {
|
|
375
|
+
start: r.resolveNoCache(e.openStart + n),
|
|
376
|
+
end: r.resolveNoCache(r.content.size - e.openEnd - n)
|
|
377
|
+
};
|
|
378
|
+
}
|
|
379
|
+
var S = class e {
|
|
380
|
+
constructor(e, t, n) {
|
|
381
|
+
this.pos = e, this.path = t, this.parentOffset = n, this.depth = t.length / 3 - 1;
|
|
382
|
+
}
|
|
383
|
+
resolveDepth(e) {
|
|
384
|
+
return e == null ? this.depth : e < 0 ? this.depth + e : e;
|
|
385
|
+
}
|
|
386
|
+
get parent() {
|
|
387
|
+
return this.node(this.depth);
|
|
388
|
+
}
|
|
389
|
+
get doc() {
|
|
390
|
+
return this.node(0);
|
|
391
|
+
}
|
|
392
|
+
node(e) {
|
|
393
|
+
return this.path[this.resolveDepth(e) * 3];
|
|
394
|
+
}
|
|
395
|
+
index(e) {
|
|
396
|
+
return this.path[this.resolveDepth(e) * 3 + 1];
|
|
397
|
+
}
|
|
398
|
+
indexAfter(e) {
|
|
399
|
+
return e = this.resolveDepth(e), this.index(e) + (e == this.depth && !this.textOffset ? 0 : 1);
|
|
400
|
+
}
|
|
401
|
+
start(e) {
|
|
402
|
+
return e = this.resolveDepth(e), e == 0 ? 0 : this.path[e * 3 - 1] + 1;
|
|
403
|
+
}
|
|
404
|
+
end(e) {
|
|
405
|
+
return e = this.resolveDepth(e), this.start(e) + this.node(e).content.size;
|
|
406
|
+
}
|
|
407
|
+
before(e) {
|
|
408
|
+
if (e = this.resolveDepth(e), !e) throw RangeError("There is no position before the top-level node");
|
|
409
|
+
return e == this.depth + 1 ? this.pos : this.path[e * 3 - 1];
|
|
410
|
+
}
|
|
411
|
+
after(e) {
|
|
412
|
+
if (e = this.resolveDepth(e), !e) throw RangeError("There is no position after the top-level node");
|
|
413
|
+
return e == this.depth + 1 ? this.pos : this.path[e * 3 - 1] + this.path[e * 3].nodeSize;
|
|
414
|
+
}
|
|
415
|
+
get textOffset() {
|
|
416
|
+
return this.pos - this.path[this.path.length - 1];
|
|
417
|
+
}
|
|
418
|
+
get nodeAfter() {
|
|
419
|
+
let e = this.parent, t = this.index(this.depth);
|
|
420
|
+
if (t == e.childCount) return null;
|
|
421
|
+
let n = this.pos - this.path[this.path.length - 1], r = e.child(t);
|
|
422
|
+
return n ? e.child(t).cut(n) : r;
|
|
423
|
+
}
|
|
424
|
+
get nodeBefore() {
|
|
425
|
+
let e = this.index(this.depth), t = this.pos - this.path[this.path.length - 1];
|
|
426
|
+
return t ? this.parent.child(e).cut(0, t) : e == 0 ? null : this.parent.child(e - 1);
|
|
427
|
+
}
|
|
428
|
+
posAtIndex(e, t) {
|
|
429
|
+
t = this.resolveDepth(t);
|
|
430
|
+
let n = this.path[t * 3], r = t == 0 ? 0 : this.path[t * 3 - 1] + 1;
|
|
431
|
+
for (let t = 0; t < e; t++) r += n.child(t).nodeSize;
|
|
432
|
+
return r;
|
|
433
|
+
}
|
|
434
|
+
marks() {
|
|
435
|
+
let e = this.parent, t = this.index();
|
|
436
|
+
if (e.content.size == 0) return l.none;
|
|
437
|
+
if (this.textOffset) return e.child(t).marks;
|
|
438
|
+
let n = e.maybeChild(t - 1), r = e.maybeChild(t);
|
|
439
|
+
if (!n) {
|
|
440
|
+
let e = n;
|
|
441
|
+
n = r, r = e;
|
|
442
|
+
}
|
|
443
|
+
let i = n.marks;
|
|
444
|
+
for (var a = 0; a < i.length; a++) i[a].type.spec.inclusive === !1 && (!r || !i[a].isInSet(r.marks)) && (i = i[a--].removeFromSet(i));
|
|
445
|
+
return i;
|
|
446
|
+
}
|
|
447
|
+
marksAcross(e) {
|
|
448
|
+
let t = this.parent.maybeChild(this.index());
|
|
449
|
+
if (!t || !t.isInline) return null;
|
|
450
|
+
let n = t.marks, r = e.parent.maybeChild(e.index());
|
|
451
|
+
for (var i = 0; i < n.length; i++) n[i].type.spec.inclusive === !1 && (!r || !n[i].isInSet(r.marks)) && (n = n[i--].removeFromSet(n));
|
|
452
|
+
return n;
|
|
453
|
+
}
|
|
454
|
+
sharedDepth(e) {
|
|
455
|
+
for (let t = this.depth; t > 0; t--) if (this.start(t) <= e && this.end(t) >= e) return t;
|
|
456
|
+
return 0;
|
|
457
|
+
}
|
|
458
|
+
blockRange(e = this, t) {
|
|
459
|
+
if (e.pos < this.pos) return e.blockRange(this);
|
|
460
|
+
for (let n = this.depth - (this.parent.inlineContent || this.pos == e.pos ? 1 : 0); n >= 0; n--) if (e.pos <= this.end(n) && (!t || t(this.node(n)))) return new w(this, e, n);
|
|
461
|
+
return null;
|
|
462
|
+
}
|
|
463
|
+
sameParent(e) {
|
|
464
|
+
return this.pos - this.parentOffset == e.pos - e.parentOffset;
|
|
465
|
+
}
|
|
466
|
+
max(e) {
|
|
467
|
+
return e.pos > this.pos ? e : this;
|
|
468
|
+
}
|
|
469
|
+
min(e) {
|
|
470
|
+
return e.pos < this.pos ? e : this;
|
|
471
|
+
}
|
|
472
|
+
toString() {
|
|
473
|
+
let e = "";
|
|
474
|
+
for (let t = 1; t <= this.depth; t++) e += (e ? "/" : "") + this.node(t).type.name + "_" + this.index(t - 1);
|
|
475
|
+
return e + ":" + this.parentOffset;
|
|
476
|
+
}
|
|
477
|
+
static resolve(t, n) {
|
|
478
|
+
if (!(n >= 0 && n <= t.content.size)) throw RangeError("Position " + n + " out of range");
|
|
479
|
+
let r = [], i = 0, a = n;
|
|
480
|
+
for (let e = t;;) {
|
|
481
|
+
let { index: t, offset: n } = e.content.findIndex(a), o = a - n;
|
|
482
|
+
if (r.push(e, t, i + n), !o || (e = e.child(t), e.isText)) break;
|
|
483
|
+
a = o - 1, i += n + 1;
|
|
484
|
+
}
|
|
485
|
+
return new e(n, r, a);
|
|
486
|
+
}
|
|
487
|
+
static resolveCached(t, n) {
|
|
488
|
+
let r = C.get(t);
|
|
489
|
+
if (r) for (let e = 0; e < r.elts.length; e++) {
|
|
490
|
+
let t = r.elts[e];
|
|
491
|
+
if (t.pos == n) return t;
|
|
492
|
+
}
|
|
493
|
+
else C.set(t, r = new ne());
|
|
494
|
+
let i = r.elts[r.i] = e.resolve(t, n);
|
|
495
|
+
return r.i = (r.i + 1) % re, i;
|
|
496
|
+
}
|
|
497
|
+
}, ne = class {
|
|
498
|
+
constructor() {
|
|
499
|
+
this.elts = [], this.i = 0;
|
|
500
|
+
}
|
|
501
|
+
}, re = 12, C = /* @__PURE__ */ new WeakMap(), w = class {
|
|
502
|
+
constructor(e, t, n) {
|
|
503
|
+
this.$from = e, this.$to = t, this.depth = n;
|
|
504
|
+
}
|
|
505
|
+
get start() {
|
|
506
|
+
return this.$from.before(this.depth + 1);
|
|
507
|
+
}
|
|
508
|
+
get end() {
|
|
509
|
+
return this.$to.after(this.depth + 1);
|
|
510
|
+
}
|
|
511
|
+
get parent() {
|
|
512
|
+
return this.$from.node(this.depth);
|
|
513
|
+
}
|
|
514
|
+
get startIndex() {
|
|
515
|
+
return this.$from.index(this.depth);
|
|
516
|
+
}
|
|
517
|
+
get endIndex() {
|
|
518
|
+
return this.$to.indexAfter(this.depth);
|
|
519
|
+
}
|
|
520
|
+
}, ie = Object.create(null), T = class e {
|
|
521
|
+
constructor(e, t, n, r = l.none) {
|
|
522
|
+
this.type = e, this.attrs = t, this.marks = r, this.content = n || a.empty;
|
|
523
|
+
}
|
|
524
|
+
get children() {
|
|
525
|
+
return this.content.content;
|
|
526
|
+
}
|
|
527
|
+
get nodeSize() {
|
|
528
|
+
return this.isLeaf ? 1 : 2 + this.content.size;
|
|
529
|
+
}
|
|
530
|
+
get childCount() {
|
|
531
|
+
return this.content.childCount;
|
|
532
|
+
}
|
|
533
|
+
child(e) {
|
|
534
|
+
return this.content.child(e);
|
|
535
|
+
}
|
|
536
|
+
maybeChild(e) {
|
|
537
|
+
return this.content.maybeChild(e);
|
|
538
|
+
}
|
|
539
|
+
forEach(e) {
|
|
540
|
+
this.content.forEach(e);
|
|
541
|
+
}
|
|
542
|
+
nodesBetween(e, t, n, r = 0) {
|
|
543
|
+
this.content.nodesBetween(e, t, n, r, this);
|
|
544
|
+
}
|
|
545
|
+
descendants(e) {
|
|
546
|
+
this.nodesBetween(0, this.content.size, e);
|
|
547
|
+
}
|
|
548
|
+
get textContent() {
|
|
549
|
+
return this.isLeaf && this.type.spec.leafText ? this.type.spec.leafText(this) : this.textBetween(0, this.content.size, "");
|
|
550
|
+
}
|
|
551
|
+
textBetween(e, t, n, r) {
|
|
552
|
+
return this.content.textBetween(e, t, n, r);
|
|
553
|
+
}
|
|
554
|
+
get firstChild() {
|
|
555
|
+
return this.content.firstChild;
|
|
556
|
+
}
|
|
557
|
+
get lastChild() {
|
|
558
|
+
return this.content.lastChild;
|
|
559
|
+
}
|
|
560
|
+
eq(e) {
|
|
561
|
+
return this == e || this.sameMarkup(e) && this.content.eq(e.content);
|
|
562
|
+
}
|
|
563
|
+
sameMarkup(e) {
|
|
564
|
+
return this.hasMarkup(e.type, e.attrs, e.marks);
|
|
565
|
+
}
|
|
566
|
+
hasMarkup(e, t, n) {
|
|
567
|
+
return this.type == e && c(this.attrs, t || e.defaultAttrs || ie) && l.sameSet(this.marks, n || l.none);
|
|
568
|
+
}
|
|
569
|
+
copy(t = null) {
|
|
570
|
+
return t == this.content ? this : new e(this.type, this.attrs, t, this.marks);
|
|
571
|
+
}
|
|
572
|
+
mark(t) {
|
|
573
|
+
return t == this.marks ? this : new e(this.type, this.attrs, this.content, t);
|
|
574
|
+
}
|
|
575
|
+
cut(e, t = this.content.size) {
|
|
576
|
+
return e == 0 && t == this.content.size ? this : this.copy(this.content.cut(e, t));
|
|
577
|
+
}
|
|
578
|
+
slice(e, t = this.content.size, n = !1) {
|
|
579
|
+
if (e == t) return d.empty;
|
|
580
|
+
let r = this.resolve(e), i = this.resolve(t), a = n ? 0 : r.sharedDepth(t), o = r.start(a);
|
|
581
|
+
return new d(r.node(a).content.cut(r.pos - o, i.pos - o), r.depth - a, i.depth - a);
|
|
582
|
+
}
|
|
583
|
+
replace(e, t, n) {
|
|
584
|
+
return ee(this.resolve(e), this.resolve(t), n);
|
|
585
|
+
}
|
|
586
|
+
nodeAt(e) {
|
|
587
|
+
for (let t = this;;) {
|
|
588
|
+
let { index: n, offset: r } = t.content.findIndex(e);
|
|
589
|
+
if (t = t.maybeChild(n), !t) return null;
|
|
590
|
+
if (r == e || t.isText) return t;
|
|
591
|
+
e -= r + 1;
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
childAfter(e) {
|
|
595
|
+
let { index: t, offset: n } = this.content.findIndex(e);
|
|
596
|
+
return {
|
|
597
|
+
node: this.content.maybeChild(t),
|
|
598
|
+
index: t,
|
|
599
|
+
offset: n
|
|
600
|
+
};
|
|
601
|
+
}
|
|
602
|
+
childBefore(e) {
|
|
603
|
+
if (e == 0) return {
|
|
604
|
+
node: null,
|
|
605
|
+
index: 0,
|
|
606
|
+
offset: 0
|
|
607
|
+
};
|
|
608
|
+
let { index: t, offset: n } = this.content.findIndex(e);
|
|
609
|
+
if (n < e) return {
|
|
610
|
+
node: this.content.child(t),
|
|
611
|
+
index: t,
|
|
612
|
+
offset: n
|
|
613
|
+
};
|
|
614
|
+
let r = this.content.child(t - 1);
|
|
615
|
+
return {
|
|
616
|
+
node: r,
|
|
617
|
+
index: t - 1,
|
|
618
|
+
offset: n - r.nodeSize
|
|
619
|
+
};
|
|
620
|
+
}
|
|
621
|
+
resolve(e) {
|
|
622
|
+
return S.resolveCached(this, e);
|
|
623
|
+
}
|
|
624
|
+
resolveNoCache(e) {
|
|
625
|
+
return S.resolve(this, e);
|
|
626
|
+
}
|
|
627
|
+
rangeHasMark(e, t, n) {
|
|
628
|
+
let r = !1;
|
|
629
|
+
return t > e && this.nodesBetween(e, t, (e) => (n.isInSet(e.marks) && (r = !0), !r)), r;
|
|
630
|
+
}
|
|
631
|
+
get isBlock() {
|
|
632
|
+
return this.type.isBlock;
|
|
633
|
+
}
|
|
634
|
+
get isTextblock() {
|
|
635
|
+
return this.type.isTextblock;
|
|
636
|
+
}
|
|
637
|
+
get inlineContent() {
|
|
638
|
+
return this.type.inlineContent;
|
|
639
|
+
}
|
|
640
|
+
get isInline() {
|
|
641
|
+
return this.type.isInline;
|
|
642
|
+
}
|
|
643
|
+
get isText() {
|
|
644
|
+
return this.type.isText;
|
|
645
|
+
}
|
|
646
|
+
get isLeaf() {
|
|
647
|
+
return this.type.isLeaf;
|
|
648
|
+
}
|
|
649
|
+
get isAtom() {
|
|
650
|
+
return this.type.isAtom;
|
|
651
|
+
}
|
|
652
|
+
toString() {
|
|
653
|
+
if (this.type.spec.toDebugString) return this.type.spec.toDebugString(this);
|
|
654
|
+
let e = this.type.name;
|
|
655
|
+
return this.content.size && (e += "(" + this.content.toStringInner() + ")"), E(this.marks, e);
|
|
656
|
+
}
|
|
657
|
+
contentMatchAt(e) {
|
|
658
|
+
let t = this.type.contentMatch.matchFragment(this.content, 0, e);
|
|
659
|
+
if (!t) throw Error("Called contentMatchAt on a node with invalid content");
|
|
660
|
+
return t;
|
|
661
|
+
}
|
|
662
|
+
canReplace(e, t, n = a.empty, r = 0, i = n.childCount) {
|
|
663
|
+
let o = this.contentMatchAt(e).matchFragment(n, r, i), s = o && o.matchFragment(this.content, t);
|
|
664
|
+
if (!s || !s.validEnd) return !1;
|
|
665
|
+
for (let e = r; e < i; e++) if (!this.type.allowsMarks(n.child(e).marks)) return !1;
|
|
666
|
+
return !0;
|
|
667
|
+
}
|
|
668
|
+
canReplaceWith(e, t, n, r) {
|
|
669
|
+
if (r && !this.type.allowsMarks(r)) return !1;
|
|
670
|
+
let i = this.contentMatchAt(e).matchType(n), a = i && i.matchFragment(this.content, t);
|
|
671
|
+
return a ? a.validEnd : !1;
|
|
672
|
+
}
|
|
673
|
+
canAppend(e) {
|
|
674
|
+
return e.content.size ? this.canReplace(this.childCount, this.childCount, e.content) : this.type.compatibleContent(e.type);
|
|
675
|
+
}
|
|
676
|
+
check() {
|
|
677
|
+
this.type.checkContent(this.content), this.type.checkAttrs(this.attrs);
|
|
678
|
+
let e = l.none;
|
|
679
|
+
for (let t = 0; t < this.marks.length; t++) {
|
|
680
|
+
let n = this.marks[t];
|
|
681
|
+
n.type.checkAttrs(n.attrs), e = n.addToSet(e);
|
|
682
|
+
}
|
|
683
|
+
if (!l.sameSet(e, this.marks)) throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map((e) => e.type.name)}`);
|
|
684
|
+
this.content.forEach((e) => e.check());
|
|
685
|
+
}
|
|
686
|
+
toJSON() {
|
|
687
|
+
let e = { type: this.type.name };
|
|
688
|
+
for (let t in this.attrs) {
|
|
689
|
+
e.attrs = this.attrs;
|
|
690
|
+
break;
|
|
691
|
+
}
|
|
692
|
+
return this.content.size && (e.content = this.content.toJSON()), this.marks.length && (e.marks = this.marks.map((e) => e.toJSON())), e;
|
|
693
|
+
}
|
|
694
|
+
static fromJSON(e, t) {
|
|
695
|
+
if (!t) throw RangeError("Invalid input for Node.fromJSON");
|
|
696
|
+
let n;
|
|
697
|
+
if (t.marks) {
|
|
698
|
+
if (!Array.isArray(t.marks)) throw RangeError("Invalid mark data for Node.fromJSON");
|
|
699
|
+
n = t.marks.map(e.markFromJSON);
|
|
700
|
+
}
|
|
701
|
+
if (t.type == "text") {
|
|
702
|
+
if (typeof t.text != "string") throw RangeError("Invalid text node in JSON");
|
|
703
|
+
return e.text(t.text, n);
|
|
704
|
+
}
|
|
705
|
+
let r = a.fromJSON(e, t.content), i = e.nodeType(t.type).create(t.attrs, r, n);
|
|
706
|
+
return i.type.checkAttrs(i.attrs), i;
|
|
707
|
+
}
|
|
708
|
+
};
|
|
709
|
+
T.prototype.text = void 0;
|
|
710
|
+
var ae = class e extends T {
|
|
711
|
+
constructor(e, t, n, r) {
|
|
712
|
+
if (super(e, t, null, r), !n) throw RangeError("Empty text nodes are not allowed");
|
|
713
|
+
this.text = n;
|
|
714
|
+
}
|
|
715
|
+
toString() {
|
|
716
|
+
return this.type.spec.toDebugString ? this.type.spec.toDebugString(this) : E(this.marks, JSON.stringify(this.text));
|
|
717
|
+
}
|
|
718
|
+
get textContent() {
|
|
719
|
+
return this.text;
|
|
720
|
+
}
|
|
721
|
+
textBetween(e, t) {
|
|
722
|
+
return this.text.slice(e, t);
|
|
723
|
+
}
|
|
724
|
+
get nodeSize() {
|
|
725
|
+
return this.text.length;
|
|
726
|
+
}
|
|
727
|
+
mark(t) {
|
|
728
|
+
return t == this.marks ? this : new e(this.type, this.attrs, this.text, t);
|
|
729
|
+
}
|
|
730
|
+
withText(t) {
|
|
731
|
+
return t == this.text ? this : new e(this.type, this.attrs, t, this.marks);
|
|
732
|
+
}
|
|
733
|
+
cut(e = 0, t = this.text.length) {
|
|
734
|
+
return e == 0 && t == this.text.length ? this : this.withText(this.text.slice(e, t));
|
|
735
|
+
}
|
|
736
|
+
eq(e) {
|
|
737
|
+
return this.sameMarkup(e) && this.text == e.text;
|
|
738
|
+
}
|
|
739
|
+
toJSON() {
|
|
740
|
+
let e = super.toJSON();
|
|
741
|
+
return e.text = this.text, e;
|
|
742
|
+
}
|
|
743
|
+
};
|
|
744
|
+
function E(e, t) {
|
|
745
|
+
for (let n = e.length - 1; n >= 0; n--) t = e[n].type.name + "(" + t + ")";
|
|
746
|
+
return t;
|
|
747
|
+
}
|
|
748
|
+
var D = class e {
|
|
749
|
+
constructor(e) {
|
|
750
|
+
this.validEnd = e, this.next = [], this.wrapCache = [];
|
|
751
|
+
}
|
|
752
|
+
static parse(t, n) {
|
|
753
|
+
let r = new oe(t, n);
|
|
754
|
+
if (r.next == null) return e.empty;
|
|
755
|
+
let i = O(r);
|
|
756
|
+
r.next && r.err("Unexpected trailing text");
|
|
757
|
+
let a = pe(fe(i));
|
|
758
|
+
return me(a, r), a;
|
|
759
|
+
}
|
|
760
|
+
matchType(e) {
|
|
761
|
+
for (let t = 0; t < this.next.length; t++) if (this.next[t].type == e) return this.next[t].next;
|
|
762
|
+
return null;
|
|
763
|
+
}
|
|
764
|
+
matchFragment(e, t = 0, n = e.childCount) {
|
|
765
|
+
let r = this;
|
|
766
|
+
for (let i = t; r && i < n; i++) r = r.matchType(e.child(i).type);
|
|
767
|
+
return r;
|
|
768
|
+
}
|
|
769
|
+
get inlineContent() {
|
|
770
|
+
return this.next.length != 0 && this.next[0].type.isInline;
|
|
771
|
+
}
|
|
772
|
+
get defaultType() {
|
|
773
|
+
for (let e = 0; e < this.next.length; e++) {
|
|
774
|
+
let { type: t } = this.next[e];
|
|
775
|
+
if (!(t.isText || t.hasRequiredAttrs())) return t;
|
|
776
|
+
}
|
|
777
|
+
return null;
|
|
778
|
+
}
|
|
779
|
+
compatible(e) {
|
|
780
|
+
for (let t = 0; t < this.next.length; t++) for (let n = 0; n < e.next.length; n++) if (this.next[t].type == e.next[n].type) return !0;
|
|
781
|
+
return !1;
|
|
782
|
+
}
|
|
783
|
+
fillBefore(e, t = !1, n = 0) {
|
|
784
|
+
let r = [this];
|
|
785
|
+
function i(o, s) {
|
|
786
|
+
let c = o.matchFragment(e, n);
|
|
787
|
+
if (c && (!t || c.validEnd)) return a.from(s.map((e) => e.createAndFill()));
|
|
788
|
+
for (let e = 0; e < o.next.length; e++) {
|
|
789
|
+
let { type: t, next: n } = o.next[e];
|
|
790
|
+
if (!(t.isText || t.hasRequiredAttrs()) && r.indexOf(n) == -1) {
|
|
791
|
+
r.push(n);
|
|
792
|
+
let e = i(n, s.concat(t));
|
|
793
|
+
if (e) return e;
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
return null;
|
|
797
|
+
}
|
|
798
|
+
return i(this, []);
|
|
799
|
+
}
|
|
800
|
+
findWrapping(e) {
|
|
801
|
+
for (let t = 0; t < this.wrapCache.length; t += 2) if (this.wrapCache[t] == e) return this.wrapCache[t + 1];
|
|
802
|
+
let t = this.computeWrapping(e);
|
|
803
|
+
return this.wrapCache.push(e, t), t;
|
|
804
|
+
}
|
|
805
|
+
computeWrapping(e) {
|
|
806
|
+
let t = Object.create(null), n = [{
|
|
807
|
+
match: this,
|
|
808
|
+
type: null,
|
|
809
|
+
via: null
|
|
810
|
+
}];
|
|
811
|
+
for (; n.length;) {
|
|
812
|
+
let r = n.shift(), i = r.match;
|
|
813
|
+
if (i.matchType(e)) {
|
|
814
|
+
let e = [];
|
|
815
|
+
for (let t = r; t.type; t = t.via) e.push(t.type);
|
|
816
|
+
return e.reverse();
|
|
817
|
+
}
|
|
818
|
+
for (let e = 0; e < i.next.length; e++) {
|
|
819
|
+
let { type: a, next: o } = i.next[e];
|
|
820
|
+
!a.isLeaf && !a.hasRequiredAttrs() && !(a.name in t) && (!r.type || o.validEnd) && (n.push({
|
|
821
|
+
match: a.contentMatch,
|
|
822
|
+
type: a,
|
|
823
|
+
via: r
|
|
824
|
+
}), t[a.name] = !0);
|
|
825
|
+
}
|
|
826
|
+
}
|
|
827
|
+
return null;
|
|
828
|
+
}
|
|
829
|
+
get edgeCount() {
|
|
830
|
+
return this.next.length;
|
|
831
|
+
}
|
|
832
|
+
edge(e) {
|
|
833
|
+
if (e >= this.next.length) throw RangeError(`There's no ${e}th edge in this content match`);
|
|
834
|
+
return this.next[e];
|
|
835
|
+
}
|
|
836
|
+
toString() {
|
|
837
|
+
let e = [];
|
|
838
|
+
function t(n) {
|
|
839
|
+
e.push(n);
|
|
840
|
+
for (let r = 0; r < n.next.length; r++) e.indexOf(n.next[r].next) == -1 && t(n.next[r].next);
|
|
841
|
+
}
|
|
842
|
+
return t(this), e.map((t, n) => {
|
|
843
|
+
let r = n + (t.validEnd ? "*" : " ") + " ";
|
|
844
|
+
for (let n = 0; n < t.next.length; n++) r += (n ? ", " : "") + t.next[n].type.name + "->" + e.indexOf(t.next[n].next);
|
|
845
|
+
return r;
|
|
846
|
+
}).join("\n");
|
|
847
|
+
}
|
|
848
|
+
};
|
|
849
|
+
D.empty = new D(!0);
|
|
850
|
+
var oe = class {
|
|
851
|
+
constructor(e, t) {
|
|
852
|
+
this.string = e, this.nodeTypes = t, this.inline = null, this.pos = 0, this.tokens = e.split(/\s*(?=\b|\W|$)/), this.tokens[this.tokens.length - 1] == "" && this.tokens.pop(), this.tokens[0] == "" && this.tokens.shift();
|
|
853
|
+
}
|
|
854
|
+
get next() {
|
|
855
|
+
return this.tokens[this.pos];
|
|
856
|
+
}
|
|
857
|
+
eat(e) {
|
|
858
|
+
return this.next == e && (this.pos++ || !0);
|
|
859
|
+
}
|
|
860
|
+
err(e) {
|
|
861
|
+
throw SyntaxError(e + " (in content expression '" + this.string + "')");
|
|
862
|
+
}
|
|
863
|
+
};
|
|
864
|
+
function O(e) {
|
|
865
|
+
let t = [];
|
|
866
|
+
do
|
|
867
|
+
t.push(se(e));
|
|
868
|
+
while (e.eat("|"));
|
|
869
|
+
return t.length == 1 ? t[0] : {
|
|
870
|
+
type: "choice",
|
|
871
|
+
exprs: t
|
|
872
|
+
};
|
|
873
|
+
}
|
|
874
|
+
function se(e) {
|
|
875
|
+
let t = [];
|
|
876
|
+
do
|
|
877
|
+
t.push(ce(e));
|
|
878
|
+
while (e.next && e.next != ")" && e.next != "|");
|
|
879
|
+
return t.length == 1 ? t[0] : {
|
|
880
|
+
type: "seq",
|
|
881
|
+
exprs: t
|
|
882
|
+
};
|
|
883
|
+
}
|
|
884
|
+
function ce(e) {
|
|
885
|
+
let t = de(e);
|
|
886
|
+
for (;;) if (e.eat("+")) t = {
|
|
887
|
+
type: "plus",
|
|
888
|
+
expr: t
|
|
889
|
+
};
|
|
890
|
+
else if (e.eat("*")) t = {
|
|
891
|
+
type: "star",
|
|
892
|
+
expr: t
|
|
893
|
+
};
|
|
894
|
+
else if (e.eat("?")) t = {
|
|
895
|
+
type: "opt",
|
|
896
|
+
expr: t
|
|
897
|
+
};
|
|
898
|
+
else if (e.eat("{")) t = le(e, t);
|
|
899
|
+
else break;
|
|
900
|
+
return t;
|
|
901
|
+
}
|
|
902
|
+
function k(e) {
|
|
903
|
+
/\D/.test(e.next) && e.err("Expected number, got '" + e.next + "'");
|
|
904
|
+
let t = Number(e.next);
|
|
905
|
+
return e.pos++, t;
|
|
906
|
+
}
|
|
907
|
+
function le(e, t) {
|
|
908
|
+
let n = k(e), r = n;
|
|
909
|
+
return e.eat(",") && (r = e.next == "}" ? -1 : k(e)), e.eat("}") || e.err("Unclosed braced range"), {
|
|
910
|
+
type: "range",
|
|
911
|
+
min: n,
|
|
912
|
+
max: r,
|
|
913
|
+
expr: t
|
|
914
|
+
};
|
|
915
|
+
}
|
|
916
|
+
function ue(e, t) {
|
|
917
|
+
let n = e.nodeTypes, r = n[t];
|
|
918
|
+
if (r) return [r];
|
|
919
|
+
let i = [];
|
|
920
|
+
for (let e in n) {
|
|
921
|
+
let r = n[e];
|
|
922
|
+
r.isInGroup(t) && i.push(r);
|
|
923
|
+
}
|
|
924
|
+
return i.length == 0 && e.err("No node type or group '" + t + "' found"), i;
|
|
925
|
+
}
|
|
926
|
+
function de(e) {
|
|
927
|
+
if (e.eat("(")) {
|
|
928
|
+
let t = O(e);
|
|
929
|
+
return e.eat(")") || e.err("Missing closing paren"), t;
|
|
930
|
+
}
|
|
931
|
+
if (/\W/.test(e.next)) e.err("Unexpected token '" + e.next + "'");
|
|
932
|
+
else {
|
|
933
|
+
let t = ue(e, e.next).map((t) => (e.inline == null ? e.inline = t.isInline : e.inline != t.isInline && e.err("Mixing inline and block content"), {
|
|
934
|
+
type: "name",
|
|
935
|
+
value: t
|
|
936
|
+
}));
|
|
937
|
+
return e.pos++, t.length == 1 ? t[0] : {
|
|
938
|
+
type: "choice",
|
|
939
|
+
exprs: t
|
|
940
|
+
};
|
|
941
|
+
}
|
|
942
|
+
}
|
|
943
|
+
function fe(e) {
|
|
944
|
+
let t = [[]];
|
|
945
|
+
return i(a(e, 0), n()), t;
|
|
946
|
+
function n() {
|
|
947
|
+
return t.push([]) - 1;
|
|
948
|
+
}
|
|
949
|
+
function r(e, n, r) {
|
|
950
|
+
let i = {
|
|
951
|
+
term: r,
|
|
952
|
+
to: n
|
|
953
|
+
};
|
|
954
|
+
return t[e].push(i), i;
|
|
955
|
+
}
|
|
956
|
+
function i(e, t) {
|
|
957
|
+
e.forEach((e) => e.to = t);
|
|
958
|
+
}
|
|
959
|
+
function a(e, t) {
|
|
960
|
+
if (e.type == "choice") return e.exprs.reduce((e, n) => e.concat(a(n, t)), []);
|
|
961
|
+
if (e.type == "seq") for (let r = 0;; r++) {
|
|
962
|
+
let o = a(e.exprs[r], t);
|
|
963
|
+
if (r == e.exprs.length - 1) return o;
|
|
964
|
+
i(o, t = n());
|
|
965
|
+
}
|
|
966
|
+
else if (e.type == "star") {
|
|
967
|
+
let o = n();
|
|
968
|
+
return r(t, o), i(a(e.expr, o), o), [r(o)];
|
|
969
|
+
} else if (e.type == "plus") {
|
|
970
|
+
let o = n();
|
|
971
|
+
return i(a(e.expr, t), o), i(a(e.expr, o), o), [r(o)];
|
|
972
|
+
} else if (e.type == "opt") return [r(t)].concat(a(e.expr, t));
|
|
973
|
+
else if (e.type == "range") {
|
|
974
|
+
let o = t;
|
|
975
|
+
for (let t = 0; t < e.min; t++) {
|
|
976
|
+
let t = n();
|
|
977
|
+
i(a(e.expr, o), t), o = t;
|
|
978
|
+
}
|
|
979
|
+
if (e.max == -1) i(a(e.expr, o), o);
|
|
980
|
+
else for (let t = e.min; t < e.max; t++) {
|
|
981
|
+
let t = n();
|
|
982
|
+
r(o, t), i(a(e.expr, o), t), o = t;
|
|
983
|
+
}
|
|
984
|
+
return [r(o)];
|
|
985
|
+
} else if (e.type == "name") return [r(t, void 0, e.value)];
|
|
986
|
+
else throw Error("Unknown expr type");
|
|
987
|
+
}
|
|
988
|
+
}
|
|
989
|
+
function A(e, t) {
|
|
990
|
+
return t - e;
|
|
991
|
+
}
|
|
992
|
+
function j(e, t) {
|
|
993
|
+
let n = [];
|
|
994
|
+
return r(t), n.sort(A);
|
|
995
|
+
function r(t) {
|
|
996
|
+
let i = e[t];
|
|
997
|
+
if (i.length == 1 && !i[0].term) return r(i[0].to);
|
|
998
|
+
n.push(t);
|
|
999
|
+
for (let e = 0; e < i.length; e++) {
|
|
1000
|
+
let { term: t, to: a } = i[e];
|
|
1001
|
+
!t && n.indexOf(a) == -1 && r(a);
|
|
1002
|
+
}
|
|
1003
|
+
}
|
|
1004
|
+
}
|
|
1005
|
+
function pe(e) {
|
|
1006
|
+
let t = Object.create(null);
|
|
1007
|
+
return n(j(e, 0));
|
|
1008
|
+
function n(r) {
|
|
1009
|
+
let i = [];
|
|
1010
|
+
r.forEach((t) => {
|
|
1011
|
+
e[t].forEach(({ term: t, to: n }) => {
|
|
1012
|
+
if (!t) return;
|
|
1013
|
+
let r;
|
|
1014
|
+
for (let e = 0; e < i.length; e++) i[e][0] == t && (r = i[e][1]);
|
|
1015
|
+
j(e, n).forEach((e) => {
|
|
1016
|
+
r || i.push([t, r = []]), r.indexOf(e) == -1 && r.push(e);
|
|
1017
|
+
});
|
|
1018
|
+
});
|
|
1019
|
+
});
|
|
1020
|
+
let a = t[r.join(",")] = new D(r.indexOf(e.length - 1) > -1);
|
|
1021
|
+
for (let e = 0; e < i.length; e++) {
|
|
1022
|
+
let r = i[e][1].sort(A);
|
|
1023
|
+
a.next.push({
|
|
1024
|
+
type: i[e][0],
|
|
1025
|
+
next: t[r.join(",")] || n(r)
|
|
1026
|
+
});
|
|
1027
|
+
}
|
|
1028
|
+
return a;
|
|
1029
|
+
}
|
|
1030
|
+
}
|
|
1031
|
+
function me(e, t) {
|
|
1032
|
+
for (let n = 0, r = [e]; n < r.length; n++) {
|
|
1033
|
+
let e = r[n], i = !e.validEnd, a = [];
|
|
1034
|
+
for (let t = 0; t < e.next.length; t++) {
|
|
1035
|
+
let { type: n, next: o } = e.next[t];
|
|
1036
|
+
a.push(n.name), i && !(n.isText || n.hasRequiredAttrs()) && (i = !1), r.indexOf(o) == -1 && r.push(o);
|
|
1037
|
+
}
|
|
1038
|
+
i && t.err("Only non-generatable nodes (" + a.join(", ") + ") in a required position (see https://prosemirror.net/docs/guide/#generatable)");
|
|
1039
|
+
}
|
|
1040
|
+
}
|
|
1041
|
+
function M(e) {
|
|
1042
|
+
let t = Object.create(null);
|
|
1043
|
+
for (let n in e) {
|
|
1044
|
+
let r = e[n];
|
|
1045
|
+
if (!r.hasDefault) return null;
|
|
1046
|
+
t[n] = r.default;
|
|
1047
|
+
}
|
|
1048
|
+
return t;
|
|
1049
|
+
}
|
|
1050
|
+
function N(e, t) {
|
|
1051
|
+
let n = Object.create(null);
|
|
1052
|
+
for (let r in e) {
|
|
1053
|
+
let i = t && t[r];
|
|
1054
|
+
if (i === void 0) {
|
|
1055
|
+
let t = e[r];
|
|
1056
|
+
if (t.hasDefault) i = t.default;
|
|
1057
|
+
else throw RangeError("No value supplied for attribute " + r);
|
|
1058
|
+
}
|
|
1059
|
+
n[r] = i;
|
|
1060
|
+
}
|
|
1061
|
+
return n;
|
|
1062
|
+
}
|
|
1063
|
+
function P(e, t, n, r) {
|
|
1064
|
+
for (let i in t) if (!(i in e)) throw RangeError(`Unsupported attribute ${i} for ${n} of type ${r}`);
|
|
1065
|
+
for (let n in e) e[n].validate && e[n].validate(t[n]);
|
|
1066
|
+
}
|
|
1067
|
+
function F(e, t) {
|
|
1068
|
+
let n = Object.create(null);
|
|
1069
|
+
if (t) for (let r in t) n[r] = new L(e, r, t[r]);
|
|
1070
|
+
return n;
|
|
1071
|
+
}
|
|
1072
|
+
var I = class e {
|
|
1073
|
+
constructor(e, t, n) {
|
|
1074
|
+
this.name = e, this.schema = t, this.spec = n, this.markSet = null, this.groups = n.group ? n.group.split(" ") : [], this.attrs = F(e, n.attrs), this.defaultAttrs = M(this.attrs), this.contentMatch = null, this.inlineContent = null, this.isBlock = !(n.inline || e == "text"), this.isText = e == "text";
|
|
1075
|
+
}
|
|
1076
|
+
get isInline() {
|
|
1077
|
+
return !this.isBlock;
|
|
1078
|
+
}
|
|
1079
|
+
get isTextblock() {
|
|
1080
|
+
return this.isBlock && this.inlineContent;
|
|
1081
|
+
}
|
|
1082
|
+
get isLeaf() {
|
|
1083
|
+
return this.contentMatch == D.empty;
|
|
1084
|
+
}
|
|
1085
|
+
get isAtom() {
|
|
1086
|
+
return this.isLeaf || !!this.spec.atom;
|
|
1087
|
+
}
|
|
1088
|
+
isInGroup(e) {
|
|
1089
|
+
return this.groups.indexOf(e) > -1;
|
|
1090
|
+
}
|
|
1091
|
+
get whitespace() {
|
|
1092
|
+
return this.spec.whitespace || (this.spec.code ? "pre" : "normal");
|
|
1093
|
+
}
|
|
1094
|
+
hasRequiredAttrs() {
|
|
1095
|
+
for (let e in this.attrs) if (this.attrs[e].isRequired) return !0;
|
|
1096
|
+
return !1;
|
|
1097
|
+
}
|
|
1098
|
+
compatibleContent(e) {
|
|
1099
|
+
return this == e || this.contentMatch.compatible(e.contentMatch);
|
|
1100
|
+
}
|
|
1101
|
+
computeAttrs(e) {
|
|
1102
|
+
return !e && this.defaultAttrs ? this.defaultAttrs : N(this.attrs, e);
|
|
1103
|
+
}
|
|
1104
|
+
create(e = null, t, n) {
|
|
1105
|
+
if (this.isText) throw Error("NodeType.create can't construct text nodes");
|
|
1106
|
+
return new T(this, this.computeAttrs(e), a.from(t), l.setFrom(n));
|
|
1107
|
+
}
|
|
1108
|
+
createChecked(e = null, t, n) {
|
|
1109
|
+
return t = a.from(t), this.checkContent(t), new T(this, this.computeAttrs(e), t, l.setFrom(n));
|
|
1110
|
+
}
|
|
1111
|
+
createAndFill(e = null, t, n) {
|
|
1112
|
+
if (e = this.computeAttrs(e), t = a.from(t), t.size) {
|
|
1113
|
+
let e = this.contentMatch.fillBefore(t);
|
|
1114
|
+
if (!e) return null;
|
|
1115
|
+
t = e.append(t);
|
|
1116
|
+
}
|
|
1117
|
+
let r = this.contentMatch.matchFragment(t), i = r && r.fillBefore(a.empty, !0);
|
|
1118
|
+
return i ? new T(this, e, t.append(i), l.setFrom(n)) : null;
|
|
1119
|
+
}
|
|
1120
|
+
validContent(e) {
|
|
1121
|
+
let t = this.contentMatch.matchFragment(e);
|
|
1122
|
+
if (!t || !t.validEnd) return !1;
|
|
1123
|
+
for (let t = 0; t < e.childCount; t++) if (!this.allowsMarks(e.child(t).marks)) return !1;
|
|
1124
|
+
return !0;
|
|
1125
|
+
}
|
|
1126
|
+
checkContent(e) {
|
|
1127
|
+
if (!this.validContent(e)) throw RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0, 50)}`);
|
|
1128
|
+
}
|
|
1129
|
+
checkAttrs(e) {
|
|
1130
|
+
P(this.attrs, e, "node", this.name);
|
|
1131
|
+
}
|
|
1132
|
+
allowsMarkType(e) {
|
|
1133
|
+
return this.markSet == null || this.markSet.indexOf(e) > -1;
|
|
1134
|
+
}
|
|
1135
|
+
allowsMarks(e) {
|
|
1136
|
+
if (this.markSet == null) return !0;
|
|
1137
|
+
for (let t = 0; t < e.length; t++) if (!this.allowsMarkType(e[t].type)) return !1;
|
|
1138
|
+
return !0;
|
|
1139
|
+
}
|
|
1140
|
+
allowedMarks(e) {
|
|
1141
|
+
if (this.markSet == null) return e;
|
|
1142
|
+
let t;
|
|
1143
|
+
for (let n = 0; n < e.length; n++) this.allowsMarkType(e[n].type) ? t && t.push(e[n]) : t ||= e.slice(0, n);
|
|
1144
|
+
return t ? t.length ? t : l.none : e;
|
|
1145
|
+
}
|
|
1146
|
+
static compile(t, n) {
|
|
1147
|
+
let r = Object.create(null);
|
|
1148
|
+
t.forEach((t, i) => r[t] = new e(t, n, i));
|
|
1149
|
+
let i = n.spec.topNode || "doc";
|
|
1150
|
+
if (!r[i]) throw RangeError("Schema is missing its top node type ('" + i + "')");
|
|
1151
|
+
if (!r.text) throw RangeError("Every schema needs a 'text' type");
|
|
1152
|
+
for (let e in r.text.attrs) throw RangeError("The text node type should not have attributes");
|
|
1153
|
+
return r;
|
|
1154
|
+
}
|
|
1155
|
+
};
|
|
1156
|
+
function he(e, t, n) {
|
|
1157
|
+
let r = n.split("|");
|
|
1158
|
+
return (n) => {
|
|
1159
|
+
let i = n === null ? "null" : typeof n;
|
|
1160
|
+
if (r.indexOf(i) < 0) throw RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${i}`);
|
|
1161
|
+
};
|
|
1162
|
+
}
|
|
1163
|
+
var L = class {
|
|
1164
|
+
constructor(e, t, n) {
|
|
1165
|
+
this.hasDefault = Object.prototype.hasOwnProperty.call(n, "default"), this.default = n.default, this.validate = typeof n.validate == "string" ? he(e, t, n.validate) : n.validate;
|
|
1166
|
+
}
|
|
1167
|
+
get isRequired() {
|
|
1168
|
+
return !this.hasDefault;
|
|
1169
|
+
}
|
|
1170
|
+
}, R = class e {
|
|
1171
|
+
constructor(e, t, n, r) {
|
|
1172
|
+
this.name = e, this.rank = t, this.schema = n, this.spec = r, this.attrs = F(e, r.attrs), this.excluded = null;
|
|
1173
|
+
let i = M(this.attrs);
|
|
1174
|
+
this.instance = i ? new l(this, i) : null;
|
|
1175
|
+
}
|
|
1176
|
+
create(e = null) {
|
|
1177
|
+
return !e && this.instance ? this.instance : new l(this, N(this.attrs, e));
|
|
1178
|
+
}
|
|
1179
|
+
static compile(t, n) {
|
|
1180
|
+
let r = Object.create(null), i = 0;
|
|
1181
|
+
return t.forEach((t, a) => r[t] = new e(t, i++, n, a)), r;
|
|
1182
|
+
}
|
|
1183
|
+
removeFromSet(e) {
|
|
1184
|
+
for (var t = 0; t < e.length; t++) e[t].type == this && (e = e.slice(0, t).concat(e.slice(t + 1)), t--);
|
|
1185
|
+
return e;
|
|
1186
|
+
}
|
|
1187
|
+
isInSet(e) {
|
|
1188
|
+
for (let t = 0; t < e.length; t++) if (e[t].type == this) return e[t];
|
|
1189
|
+
}
|
|
1190
|
+
checkAttrs(e) {
|
|
1191
|
+
P(this.attrs, e, "mark", this.name);
|
|
1192
|
+
}
|
|
1193
|
+
excludes(e) {
|
|
1194
|
+
return this.excluded.indexOf(e) > -1;
|
|
1195
|
+
}
|
|
1196
|
+
}, ge = class {
|
|
1197
|
+
constructor(t) {
|
|
1198
|
+
this.linebreakReplacement = null, this.cached = Object.create(null);
|
|
1199
|
+
let n = this.spec = {};
|
|
1200
|
+
for (let e in t) n[e] = t[e];
|
|
1201
|
+
n.nodes = e.from(t.nodes), n.marks = e.from(t.marks || {}), this.nodes = I.compile(this.spec.nodes, this), this.marks = R.compile(this.spec.marks, this);
|
|
1202
|
+
let r = Object.create(null);
|
|
1203
|
+
for (let e in this.nodes) {
|
|
1204
|
+
if (e in this.marks) throw RangeError(e + " can not be both a node and a mark");
|
|
1205
|
+
let t = this.nodes[e], n = t.spec.content || "", i = t.spec.marks;
|
|
1206
|
+
if (t.contentMatch = r[n] || (r[n] = D.parse(n, this.nodes)), t.inlineContent = t.contentMatch.inlineContent, t.spec.linebreakReplacement) {
|
|
1207
|
+
if (this.linebreakReplacement) throw RangeError("Multiple linebreak nodes defined");
|
|
1208
|
+
if (!t.isInline || !t.isLeaf) throw RangeError("Linebreak replacement nodes must be inline leaf nodes");
|
|
1209
|
+
this.linebreakReplacement = t;
|
|
1210
|
+
}
|
|
1211
|
+
t.markSet = i == "_" ? null : i ? z(this, i.split(" ")) : i == "" || !t.inlineContent ? [] : null;
|
|
1212
|
+
}
|
|
1213
|
+
for (let e in this.marks) {
|
|
1214
|
+
let t = this.marks[e], n = t.spec.excludes;
|
|
1215
|
+
t.excluded = n == null ? [t] : n == "" ? [] : z(this, n.split(" "));
|
|
1216
|
+
}
|
|
1217
|
+
this.nodeFromJSON = (e) => T.fromJSON(this, e), this.markFromJSON = (e) => l.fromJSON(this, e), this.topNodeType = this.nodes[this.spec.topNode || "doc"], this.cached.wrappings = Object.create(null);
|
|
1218
|
+
}
|
|
1219
|
+
node(e, t = null, n, r) {
|
|
1220
|
+
if (typeof e == "string") e = this.nodeType(e);
|
|
1221
|
+
else if (!(e instanceof I)) throw RangeError("Invalid node type: " + e);
|
|
1222
|
+
else if (e.schema != this) throw RangeError("Node type from different schema used (" + e.name + ")");
|
|
1223
|
+
return e.createChecked(t, n, r);
|
|
1224
|
+
}
|
|
1225
|
+
text(e, t) {
|
|
1226
|
+
let n = this.nodes.text;
|
|
1227
|
+
return new ae(n, n.defaultAttrs, e, l.setFrom(t));
|
|
1228
|
+
}
|
|
1229
|
+
mark(e, t) {
|
|
1230
|
+
return typeof e == "string" && (e = this.marks[e]), e.create(t);
|
|
1231
|
+
}
|
|
1232
|
+
nodeType(e) {
|
|
1233
|
+
let t = this.nodes[e];
|
|
1234
|
+
if (!t) throw RangeError("Unknown node type: " + e);
|
|
1235
|
+
return t;
|
|
1236
|
+
}
|
|
1237
|
+
};
|
|
1238
|
+
function z(e, t) {
|
|
1239
|
+
let n = [];
|
|
1240
|
+
for (let r = 0; r < t.length; r++) {
|
|
1241
|
+
let i = t[r], a = e.marks[i], o = a;
|
|
1242
|
+
if (a) n.push(a);
|
|
1243
|
+
else for (let t in e.marks) {
|
|
1244
|
+
let r = e.marks[t];
|
|
1245
|
+
(i == "_" || r.spec.group && r.spec.group.split(" ").indexOf(i) > -1) && n.push(o = r);
|
|
1246
|
+
}
|
|
1247
|
+
if (!o) throw SyntaxError("Unknown mark type: '" + t[r] + "'");
|
|
1248
|
+
}
|
|
1249
|
+
return n;
|
|
1250
|
+
}
|
|
1251
|
+
function _e(e) {
|
|
1252
|
+
return e.tag != null;
|
|
1253
|
+
}
|
|
1254
|
+
function ve(e) {
|
|
1255
|
+
return e.style != null;
|
|
1256
|
+
}
|
|
1257
|
+
var ye = class e {
|
|
1258
|
+
constructor(e, t) {
|
|
1259
|
+
this.schema = e, this.rules = t, this.tags = [], this.styles = [];
|
|
1260
|
+
let n = this.matchedStyles = [];
|
|
1261
|
+
t.forEach((e) => {
|
|
1262
|
+
if (_e(e)) this.tags.push(e);
|
|
1263
|
+
else if (ve(e)) {
|
|
1264
|
+
let t = /[^=]*/.exec(e.style)[0];
|
|
1265
|
+
n.indexOf(t) < 0 && n.push(t), this.styles.push(e);
|
|
1266
|
+
}
|
|
1267
|
+
}), this.normalizeLists = !this.tags.some((t) => {
|
|
1268
|
+
if (!/^(ul|ol)\b/.test(t.tag) || !t.node) return !1;
|
|
1269
|
+
let n = e.nodes[t.node];
|
|
1270
|
+
return n.contentMatch.matchType(n);
|
|
1271
|
+
});
|
|
1272
|
+
}
|
|
1273
|
+
parse(e, t = {}) {
|
|
1274
|
+
let n = new q(this, t, !1);
|
|
1275
|
+
return n.addAll(e, l.none, t.from, t.to), n.finish();
|
|
1276
|
+
}
|
|
1277
|
+
parseSlice(e, t = {}) {
|
|
1278
|
+
let n = new q(this, t, !0);
|
|
1279
|
+
return n.addAll(e, l.none, t.from, t.to), d.maxOpen(n.finish());
|
|
1280
|
+
}
|
|
1281
|
+
matchTag(e, t, n) {
|
|
1282
|
+
for (let r = n ? this.tags.indexOf(n) + 1 : 0; r < this.tags.length; r++) {
|
|
1283
|
+
let n = this.tags[r];
|
|
1284
|
+
if (Se(e, n.tag) && (n.namespace === void 0 || e.namespaceURI == n.namespace) && (!n.context || t.matchesContext(n.context))) {
|
|
1285
|
+
if (n.getAttrs) {
|
|
1286
|
+
let t = n.getAttrs(e);
|
|
1287
|
+
if (t === !1) continue;
|
|
1288
|
+
n.attrs = t || void 0;
|
|
1289
|
+
}
|
|
1290
|
+
return n;
|
|
1291
|
+
}
|
|
1292
|
+
}
|
|
1293
|
+
}
|
|
1294
|
+
matchStyle(e, t, n, r) {
|
|
1295
|
+
for (let i = r ? this.styles.indexOf(r) + 1 : 0; i < this.styles.length; i++) {
|
|
1296
|
+
let r = this.styles[i], a = r.style;
|
|
1297
|
+
if (!(a.indexOf(e) != 0 || r.context && !n.matchesContext(r.context) || a.length > e.length && (a.charCodeAt(e.length) != 61 || a.slice(e.length + 1) != t))) {
|
|
1298
|
+
if (r.getAttrs) {
|
|
1299
|
+
let e = r.getAttrs(t);
|
|
1300
|
+
if (e === !1) continue;
|
|
1301
|
+
r.attrs = e || void 0;
|
|
1302
|
+
}
|
|
1303
|
+
return r;
|
|
1304
|
+
}
|
|
1305
|
+
}
|
|
1306
|
+
}
|
|
1307
|
+
static schemaRules(e) {
|
|
1308
|
+
let t = [];
|
|
1309
|
+
function n(e) {
|
|
1310
|
+
let n = e.priority == null ? 50 : e.priority, r = 0;
|
|
1311
|
+
for (; r < t.length; r++) {
|
|
1312
|
+
let e = t[r];
|
|
1313
|
+
if ((e.priority == null ? 50 : e.priority) < n) break;
|
|
1314
|
+
}
|
|
1315
|
+
t.splice(r, 0, e);
|
|
1316
|
+
}
|
|
1317
|
+
for (let t in e.marks) {
|
|
1318
|
+
let r = e.marks[t].spec.parseDOM;
|
|
1319
|
+
r && r.forEach((e) => {
|
|
1320
|
+
n(e = J(e)), e.mark || e.ignore || e.clearMark || (e.mark = t);
|
|
1321
|
+
});
|
|
1322
|
+
}
|
|
1323
|
+
for (let t in e.nodes) {
|
|
1324
|
+
let r = e.nodes[t].spec.parseDOM;
|
|
1325
|
+
r && r.forEach((e) => {
|
|
1326
|
+
n(e = J(e)), e.node || e.ignore || e.mark || (e.node = t);
|
|
1327
|
+
});
|
|
1328
|
+
}
|
|
1329
|
+
return t;
|
|
1330
|
+
}
|
|
1331
|
+
static fromSchema(t) {
|
|
1332
|
+
return t.cached.domParser || (t.cached.domParser = new e(t, e.schemaRules(t)));
|
|
1333
|
+
}
|
|
1334
|
+
}, B = {
|
|
1335
|
+
address: !0,
|
|
1336
|
+
article: !0,
|
|
1337
|
+
aside: !0,
|
|
1338
|
+
blockquote: !0,
|
|
1339
|
+
body: !0,
|
|
1340
|
+
canvas: !0,
|
|
1341
|
+
dd: !0,
|
|
1342
|
+
div: !0,
|
|
1343
|
+
dl: !0,
|
|
1344
|
+
fieldset: !0,
|
|
1345
|
+
figcaption: !0,
|
|
1346
|
+
figure: !0,
|
|
1347
|
+
footer: !0,
|
|
1348
|
+
form: !0,
|
|
1349
|
+
h1: !0,
|
|
1350
|
+
h2: !0,
|
|
1351
|
+
h3: !0,
|
|
1352
|
+
h4: !0,
|
|
1353
|
+
h5: !0,
|
|
1354
|
+
h6: !0,
|
|
1355
|
+
header: !0,
|
|
1356
|
+
hgroup: !0,
|
|
1357
|
+
hr: !0,
|
|
1358
|
+
li: !0,
|
|
1359
|
+
noscript: !0,
|
|
1360
|
+
ol: !0,
|
|
1361
|
+
output: !0,
|
|
1362
|
+
p: !0,
|
|
1363
|
+
pre: !0,
|
|
1364
|
+
section: !0,
|
|
1365
|
+
table: !0,
|
|
1366
|
+
tfoot: !0,
|
|
1367
|
+
ul: !0
|
|
1368
|
+
}, be = {
|
|
1369
|
+
head: !0,
|
|
1370
|
+
noscript: !0,
|
|
1371
|
+
object: !0,
|
|
1372
|
+
script: !0,
|
|
1373
|
+
style: !0,
|
|
1374
|
+
title: !0
|
|
1375
|
+
}, V = {
|
|
1376
|
+
ol: !0,
|
|
1377
|
+
ul: !0
|
|
1378
|
+
}, H = 1, U = 2, W = 4;
|
|
1379
|
+
function G(e, t, n) {
|
|
1380
|
+
return t == null ? e && e.whitespace == "pre" ? 3 : n & -5 : (t ? H : 0) | (t === "full" ? U : 0);
|
|
1381
|
+
}
|
|
1382
|
+
var K = class {
|
|
1383
|
+
constructor(e, t, n, r, i, a) {
|
|
1384
|
+
this.type = e, this.attrs = t, this.marks = n, this.solid = r, this.options = a, this.content = [], this.activeMarks = l.none, this.match = i || (a & W ? null : e.contentMatch);
|
|
1385
|
+
}
|
|
1386
|
+
findWrapping(e) {
|
|
1387
|
+
if (!this.match) {
|
|
1388
|
+
if (!this.type) return [];
|
|
1389
|
+
let t = this.type.contentMatch.fillBefore(a.from(e));
|
|
1390
|
+
if (t) this.match = this.type.contentMatch.matchFragment(t);
|
|
1391
|
+
else {
|
|
1392
|
+
let t = this.type.contentMatch, n;
|
|
1393
|
+
return (n = t.findWrapping(e.type)) ? (this.match = t, n) : null;
|
|
1394
|
+
}
|
|
1395
|
+
}
|
|
1396
|
+
return this.match.findWrapping(e.type);
|
|
1397
|
+
}
|
|
1398
|
+
finish(e) {
|
|
1399
|
+
if (!(this.options & H)) {
|
|
1400
|
+
let e = this.content[this.content.length - 1], t;
|
|
1401
|
+
if (e && e.isText && (t = /[ \t\r\n\u000c]+$/.exec(e.text))) {
|
|
1402
|
+
let n = e;
|
|
1403
|
+
e.text.length == t[0].length ? this.content.pop() : this.content[this.content.length - 1] = n.withText(n.text.slice(0, n.text.length - t[0].length));
|
|
1404
|
+
}
|
|
1405
|
+
}
|
|
1406
|
+
let t = a.from(this.content);
|
|
1407
|
+
return !e && this.match && (t = t.append(this.match.fillBefore(a.empty, !0))), this.type ? this.type.create(this.attrs, t, this.marks) : t;
|
|
1408
|
+
}
|
|
1409
|
+
inlineContext(e) {
|
|
1410
|
+
return this.type ? this.type.inlineContent : this.content.length ? this.content[0].isInline : e.parentNode && !B.hasOwnProperty(e.parentNode.nodeName.toLowerCase());
|
|
1411
|
+
}
|
|
1412
|
+
}, q = class {
|
|
1413
|
+
constructor(e, t, n) {
|
|
1414
|
+
this.parser = e, this.options = t, this.isOpen = n, this.open = 0, this.localPreserveWS = !1;
|
|
1415
|
+
let r = t.topNode, i, a = G(null, t.preserveWhitespace, 0) | (n ? W : 0);
|
|
1416
|
+
i = r ? new K(r.type, r.attrs, l.none, !0, t.topMatch || r.type.contentMatch, a) : n ? new K(null, null, l.none, !0, null, a) : new K(e.schema.topNodeType, null, l.none, !0, null, a), this.nodes = [i], this.find = t.findPositions, this.needsBlock = !1;
|
|
1417
|
+
}
|
|
1418
|
+
get top() {
|
|
1419
|
+
return this.nodes[this.open];
|
|
1420
|
+
}
|
|
1421
|
+
addDOM(e, t) {
|
|
1422
|
+
e.nodeType == 3 ? this.addTextNode(e, t) : e.nodeType == 1 && this.addElement(e, t);
|
|
1423
|
+
}
|
|
1424
|
+
addTextNode(e, t) {
|
|
1425
|
+
let n = e.nodeValue, r = this.top, i = r.options & U ? "full" : this.localPreserveWS || (r.options & H) > 0, { schema: a } = this.parser;
|
|
1426
|
+
if (i === "full" || r.inlineContext(e) || /[^ \t\r\n\u000c]/.test(n)) {
|
|
1427
|
+
if (!i) {
|
|
1428
|
+
if (n = n.replace(/[ \t\r\n\u000c]+/g, " "), /^[ \t\r\n\u000c]/.test(n) && this.open == this.nodes.length - 1) {
|
|
1429
|
+
let t = r.content[r.content.length - 1], i = e.previousSibling;
|
|
1430
|
+
(!t || i && i.nodeName == "BR" || t.isText && /[ \t\r\n\u000c]$/.test(t.text)) && (n = n.slice(1));
|
|
1431
|
+
}
|
|
1432
|
+
} else if (i === "full") n = n.replace(/\r\n?/g, "\n");
|
|
1433
|
+
else if (a.linebreakReplacement && /[\r\n]/.test(n) && this.top.findWrapping(a.linebreakReplacement.create())) {
|
|
1434
|
+
let e = n.split(/\r?\n|\r/);
|
|
1435
|
+
for (let n = 0; n < e.length; n++) n && this.insertNode(a.linebreakReplacement.create(), t, !0), e[n] && this.insertNode(a.text(e[n]), t, !/\S/.test(e[n]));
|
|
1436
|
+
n = "";
|
|
1437
|
+
} else n = n.replace(/\r?\n|\r/g, " ");
|
|
1438
|
+
n && this.insertNode(a.text(n), t, !/\S/.test(n)), this.findInText(e);
|
|
1439
|
+
} else this.findInside(e);
|
|
1440
|
+
}
|
|
1441
|
+
addElement(e, t, n) {
|
|
1442
|
+
let r = this.localPreserveWS, i = this.top;
|
|
1443
|
+
(e.tagName == "PRE" || /pre/.test(e.style && e.style.whiteSpace)) && (this.localPreserveWS = !0);
|
|
1444
|
+
let a = e.nodeName.toLowerCase(), o;
|
|
1445
|
+
V.hasOwnProperty(a) && this.parser.normalizeLists && xe(e);
|
|
1446
|
+
let s = this.options.ruleFromNode && this.options.ruleFromNode(e) || (o = this.parser.matchTag(e, this, n));
|
|
1447
|
+
out: if (s ? s.ignore : be.hasOwnProperty(a)) this.findInside(e), this.ignoreFallback(e, t);
|
|
1448
|
+
else if (!s || s.skip || s.closeParent) {
|
|
1449
|
+
s && s.closeParent ? this.open = Math.max(0, this.open - 1) : s && s.skip.nodeType && (e = s.skip);
|
|
1450
|
+
let n, r = this.needsBlock;
|
|
1451
|
+
if (B.hasOwnProperty(a)) i.content.length && i.content[0].isInline && this.open && (this.open--, i = this.top), n = !0, i.type || (this.needsBlock = !0);
|
|
1452
|
+
else if (!e.firstChild) {
|
|
1453
|
+
this.leafFallback(e, t);
|
|
1454
|
+
break out;
|
|
1455
|
+
}
|
|
1456
|
+
let o = s && s.skip ? t : this.readStyles(e, t);
|
|
1457
|
+
o && this.addAll(e, o), n && this.sync(i), this.needsBlock = r;
|
|
1458
|
+
} else {
|
|
1459
|
+
let n = this.readStyles(e, t);
|
|
1460
|
+
n && this.addElementByRule(e, s, n, s.consuming === !1 ? o : void 0);
|
|
1461
|
+
}
|
|
1462
|
+
this.localPreserveWS = r;
|
|
1463
|
+
}
|
|
1464
|
+
leafFallback(e, t) {
|
|
1465
|
+
e.nodeName == "BR" && this.top.type && this.top.type.inlineContent && this.addTextNode(e.ownerDocument.createTextNode("\n"), t);
|
|
1466
|
+
}
|
|
1467
|
+
ignoreFallback(e, t) {
|
|
1468
|
+
e.nodeName == "BR" && (!this.top.type || !this.top.type.inlineContent) && this.findPlace(this.parser.schema.text("-"), t, !0);
|
|
1469
|
+
}
|
|
1470
|
+
readStyles(e, t) {
|
|
1471
|
+
let n = e.style;
|
|
1472
|
+
if (n && n.length) for (let e = 0; e < this.parser.matchedStyles.length; e++) {
|
|
1473
|
+
let r = this.parser.matchedStyles[e], i = n.getPropertyValue(r);
|
|
1474
|
+
if (i) for (let e;;) {
|
|
1475
|
+
let n = this.parser.matchStyle(r, i, this, e);
|
|
1476
|
+
if (!n) break;
|
|
1477
|
+
if (n.ignore) return null;
|
|
1478
|
+
if (t = n.clearMark ? t.filter((e) => !n.clearMark(e)) : t.concat(this.parser.schema.marks[n.mark].create(n.attrs)), n.consuming === !1) e = n;
|
|
1479
|
+
else break;
|
|
1480
|
+
}
|
|
1481
|
+
}
|
|
1482
|
+
return t;
|
|
1483
|
+
}
|
|
1484
|
+
addElementByRule(e, t, n, r) {
|
|
1485
|
+
let i, a;
|
|
1486
|
+
if (t.node) {
|
|
1487
|
+
if (a = this.parser.schema.nodes[t.node], a.isLeaf) this.insertNode(a.create(t.attrs), n, e.nodeName == "BR") || this.leafFallback(e, n);
|
|
1488
|
+
else {
|
|
1489
|
+
let e = this.enter(a, t.attrs || null, n, t.preserveWhitespace);
|
|
1490
|
+
e && (i = !0, n = e);
|
|
1491
|
+
}
|
|
1492
|
+
} else {
|
|
1493
|
+
let e = this.parser.schema.marks[t.mark];
|
|
1494
|
+
n = n.concat(e.create(t.attrs));
|
|
1495
|
+
}
|
|
1496
|
+
let o = this.top;
|
|
1497
|
+
if (a && a.isLeaf) this.findInside(e);
|
|
1498
|
+
else if (r) this.addElement(e, n, r);
|
|
1499
|
+
else if (t.getContent) this.findInside(e), t.getContent(e, this.parser.schema).forEach((e) => this.insertNode(e, n, !1));
|
|
1500
|
+
else {
|
|
1501
|
+
let r = e;
|
|
1502
|
+
typeof t.contentElement == "string" ? r = e.querySelector(t.contentElement) : typeof t.contentElement == "function" ? r = t.contentElement(e) : t.contentElement && (r = t.contentElement), this.findAround(e, r, !0), this.addAll(r, n), this.findAround(e, r, !1);
|
|
1503
|
+
}
|
|
1504
|
+
i && this.sync(o) && this.open--;
|
|
1505
|
+
}
|
|
1506
|
+
addAll(e, t, n, r) {
|
|
1507
|
+
let i = n || 0;
|
|
1508
|
+
for (let a = n ? e.childNodes[n] : e.firstChild, o = r == null ? null : e.childNodes[r]; a != o; a = a.nextSibling, ++i) this.findAtPoint(e, i), this.addDOM(a, t);
|
|
1509
|
+
this.findAtPoint(e, i);
|
|
1510
|
+
}
|
|
1511
|
+
findPlace(e, t, n) {
|
|
1512
|
+
let r, i;
|
|
1513
|
+
for (let t = this.open, a = 0; t >= 0; t--) {
|
|
1514
|
+
let o = this.nodes[t], s = o.findWrapping(e);
|
|
1515
|
+
if (s && (!r || r.length > s.length + a) && (r = s, i = o, !s.length)) break;
|
|
1516
|
+
if (o.solid) {
|
|
1517
|
+
if (n) break;
|
|
1518
|
+
a += 2;
|
|
1519
|
+
}
|
|
1520
|
+
}
|
|
1521
|
+
if (!r) return null;
|
|
1522
|
+
this.sync(i);
|
|
1523
|
+
for (let e = 0; e < r.length; e++) t = this.enterInner(r[e], null, t, !1);
|
|
1524
|
+
return t;
|
|
1525
|
+
}
|
|
1526
|
+
insertNode(e, t, n) {
|
|
1527
|
+
if (e.isInline && this.needsBlock && !this.top.type) {
|
|
1528
|
+
let e = this.textblockFromContext();
|
|
1529
|
+
e && (t = this.enterInner(e, null, t));
|
|
1530
|
+
}
|
|
1531
|
+
let r = this.findPlace(e, t, n);
|
|
1532
|
+
if (r) {
|
|
1533
|
+
this.closeExtra();
|
|
1534
|
+
let t = this.top;
|
|
1535
|
+
t.match &&= t.match.matchType(e.type);
|
|
1536
|
+
let n = l.none;
|
|
1537
|
+
for (let i of r.concat(e.marks)) (t.type ? t.type.allowsMarkType(i.type) : Y(i.type, e.type)) && (n = i.addToSet(n));
|
|
1538
|
+
return t.content.push(e.mark(n)), !0;
|
|
1539
|
+
}
|
|
1540
|
+
return !1;
|
|
1541
|
+
}
|
|
1542
|
+
enter(e, t, n, r) {
|
|
1543
|
+
let i = this.findPlace(e.create(t), n, !1);
|
|
1544
|
+
return i &&= this.enterInner(e, t, n, !0, r), i;
|
|
1545
|
+
}
|
|
1546
|
+
enterInner(e, t, n, r = !1, i) {
|
|
1547
|
+
this.closeExtra();
|
|
1548
|
+
let a = this.top;
|
|
1549
|
+
a.match = a.match && a.match.matchType(e);
|
|
1550
|
+
let o = G(e, i, a.options);
|
|
1551
|
+
a.options & W && a.content.length == 0 && (o |= W);
|
|
1552
|
+
let s = l.none;
|
|
1553
|
+
return n = n.filter((t) => !(a.type ? a.type.allowsMarkType(t.type) : Y(t.type, e)) || (s = t.addToSet(s), !1)), this.nodes.push(new K(e, t, s, r, null, o)), this.open++, n;
|
|
1554
|
+
}
|
|
1555
|
+
closeExtra(e = !1) {
|
|
1556
|
+
let t = this.nodes.length - 1;
|
|
1557
|
+
if (t > this.open) {
|
|
1558
|
+
for (; t > this.open; t--) this.nodes[t - 1].content.push(this.nodes[t].finish(e));
|
|
1559
|
+
this.nodes.length = this.open + 1;
|
|
1560
|
+
}
|
|
1561
|
+
}
|
|
1562
|
+
finish() {
|
|
1563
|
+
return this.open = 0, this.closeExtra(this.isOpen), this.nodes[0].finish(!!(this.isOpen || this.options.topOpen));
|
|
1564
|
+
}
|
|
1565
|
+
sync(e) {
|
|
1566
|
+
for (let t = this.open; t >= 0; t--) if (this.nodes[t] == e) return this.open = t, !0;
|
|
1567
|
+
else this.localPreserveWS && (this.nodes[t].options |= H);
|
|
1568
|
+
return !1;
|
|
1569
|
+
}
|
|
1570
|
+
get currentPos() {
|
|
1571
|
+
this.closeExtra();
|
|
1572
|
+
let e = 0;
|
|
1573
|
+
for (let t = this.open; t >= 0; t--) {
|
|
1574
|
+
let n = this.nodes[t].content;
|
|
1575
|
+
for (let t = n.length - 1; t >= 0; t--) e += n[t].nodeSize;
|
|
1576
|
+
t && e++;
|
|
1577
|
+
}
|
|
1578
|
+
return e;
|
|
1579
|
+
}
|
|
1580
|
+
findAtPoint(e, t) {
|
|
1581
|
+
if (this.find) for (let n = 0; n < this.find.length; n++) this.find[n].node == e && this.find[n].offset == t && (this.find[n].pos = this.currentPos);
|
|
1582
|
+
}
|
|
1583
|
+
findInside(e) {
|
|
1584
|
+
if (this.find) for (let t = 0; t < this.find.length; t++) this.find[t].pos == null && e.nodeType == 1 && e.contains(this.find[t].node) && (this.find[t].pos = this.currentPos);
|
|
1585
|
+
}
|
|
1586
|
+
findAround(e, t, n) {
|
|
1587
|
+
if (e != t && this.find) for (let r = 0; r < this.find.length; r++) this.find[r].pos == null && e.nodeType == 1 && e.contains(this.find[r].node) && t.compareDocumentPosition(this.find[r].node) & (n ? 2 : 4) && (this.find[r].pos = this.currentPos);
|
|
1588
|
+
}
|
|
1589
|
+
findInText(e) {
|
|
1590
|
+
if (this.find) for (let t = 0; t < this.find.length; t++) this.find[t].node == e && (this.find[t].pos = this.currentPos - (e.nodeValue.length - this.find[t].offset));
|
|
1591
|
+
}
|
|
1592
|
+
matchesContext(e) {
|
|
1593
|
+
if (e.indexOf("|") > -1) return e.split(/\s*\|\s*/).some(this.matchesContext, this);
|
|
1594
|
+
let t = e.split("/"), n = this.options.context, r = !this.isOpen && (!n || n.parent.type == this.nodes[0].type), i = -(n ? n.depth + 1 : 0) + +!r, a = (e, o) => {
|
|
1595
|
+
for (; e >= 0; e--) {
|
|
1596
|
+
let s = t[e];
|
|
1597
|
+
if (s == "") {
|
|
1598
|
+
if (e == t.length - 1 || e == 0) continue;
|
|
1599
|
+
for (; o >= i; o--) if (a(e - 1, o)) return !0;
|
|
1600
|
+
return !1;
|
|
1601
|
+
}
|
|
1602
|
+
{
|
|
1603
|
+
let e = o > 0 || o == 0 && r ? this.nodes[o].type : n && o >= i ? n.node(o - i).type : null;
|
|
1604
|
+
if (!e || e.name != s && !e.isInGroup(s)) return !1;
|
|
1605
|
+
o--;
|
|
1606
|
+
}
|
|
1607
|
+
}
|
|
1608
|
+
return !0;
|
|
1609
|
+
};
|
|
1610
|
+
return a(t.length - 1, this.open);
|
|
1611
|
+
}
|
|
1612
|
+
textblockFromContext() {
|
|
1613
|
+
let e = this.options.context;
|
|
1614
|
+
if (e) for (let t = e.depth; t >= 0; t--) {
|
|
1615
|
+
let n = e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;
|
|
1616
|
+
if (n && n.isTextblock && n.defaultAttrs) return n;
|
|
1617
|
+
}
|
|
1618
|
+
for (let e in this.parser.schema.nodes) {
|
|
1619
|
+
let t = this.parser.schema.nodes[e];
|
|
1620
|
+
if (t.isTextblock && t.defaultAttrs) return t;
|
|
1621
|
+
}
|
|
1622
|
+
}
|
|
1623
|
+
};
|
|
1624
|
+
function xe(e) {
|
|
1625
|
+
for (let t = e.firstChild, n = null; t; t = t.nextSibling) {
|
|
1626
|
+
let e = t.nodeType == 1 ? t.nodeName.toLowerCase() : null;
|
|
1627
|
+
e && V.hasOwnProperty(e) && n ? (n.appendChild(t), t = n) : e == "li" ? n = t : e && (n = null);
|
|
1628
|
+
}
|
|
1629
|
+
}
|
|
1630
|
+
function Se(e, t) {
|
|
1631
|
+
return (e.matches || e.msMatchesSelector || e.webkitMatchesSelector || e.mozMatchesSelector).call(e, t);
|
|
1632
|
+
}
|
|
1633
|
+
function J(e) {
|
|
1634
|
+
let t = {};
|
|
1635
|
+
for (let n in e) t[n] = e[n];
|
|
1636
|
+
return t;
|
|
1637
|
+
}
|
|
1638
|
+
function Y(e, t) {
|
|
1639
|
+
let n = t.schema.nodes;
|
|
1640
|
+
for (let r in n) {
|
|
1641
|
+
let i = n[r];
|
|
1642
|
+
if (!i.allowsMarkType(e)) continue;
|
|
1643
|
+
let a = [], o = (e) => {
|
|
1644
|
+
a.push(e);
|
|
1645
|
+
for (let n = 0; n < e.edgeCount; n++) {
|
|
1646
|
+
let { type: r, next: i } = e.edge(n);
|
|
1647
|
+
if (r == t || a.indexOf(i) < 0 && o(i)) return !0;
|
|
1648
|
+
}
|
|
1649
|
+
};
|
|
1650
|
+
if (o(i.contentMatch)) return !0;
|
|
1651
|
+
}
|
|
1652
|
+
}
|
|
1653
|
+
var Ce = class e {
|
|
1654
|
+
constructor(e, t) {
|
|
1655
|
+
this.nodes = e, this.marks = t;
|
|
1656
|
+
}
|
|
1657
|
+
serializeFragment(e, t = {}, n) {
|
|
1658
|
+
n ||= Z(t).createDocumentFragment();
|
|
1659
|
+
let r = n, i = [];
|
|
1660
|
+
return e.forEach((e) => {
|
|
1661
|
+
if (i.length || e.marks.length) {
|
|
1662
|
+
let n = 0, a = 0;
|
|
1663
|
+
for (; n < i.length && a < e.marks.length;) {
|
|
1664
|
+
let t = e.marks[a];
|
|
1665
|
+
if (!this.marks[t.type.name]) {
|
|
1666
|
+
a++;
|
|
1667
|
+
continue;
|
|
1668
|
+
}
|
|
1669
|
+
if (!t.eq(i[n][0]) || t.type.spec.spanning === !1) break;
|
|
1670
|
+
n++, a++;
|
|
1671
|
+
}
|
|
1672
|
+
for (; n < i.length;) r = i.pop()[1];
|
|
1673
|
+
for (; a < e.marks.length;) {
|
|
1674
|
+
let n = e.marks[a++], o = this.serializeMark(n, e.isInline, t);
|
|
1675
|
+
o && (i.push([n, r]), r.appendChild(o.dom), r = o.contentDOM || o.dom);
|
|
1676
|
+
}
|
|
1677
|
+
}
|
|
1678
|
+
r.appendChild(this.serializeNodeInner(e, t));
|
|
1679
|
+
}), n;
|
|
1680
|
+
}
|
|
1681
|
+
serializeNodeInner(e, t) {
|
|
1682
|
+
if (e.isText) return Z(t).createTextNode(e.text);
|
|
1683
|
+
let { dom: n, contentDOM: r } = $(Z(t), this.nodes[e.type.name](e), null, e.attrs);
|
|
1684
|
+
if (r) {
|
|
1685
|
+
if (e.isLeaf) throw RangeError("Content hole not allowed in a leaf node spec");
|
|
1686
|
+
this.serializeFragment(e.content, t, r);
|
|
1687
|
+
}
|
|
1688
|
+
return n;
|
|
1689
|
+
}
|
|
1690
|
+
serializeNode(e, t = {}) {
|
|
1691
|
+
let n = this.serializeNodeInner(e, t);
|
|
1692
|
+
for (let r = e.marks.length - 1; r >= 0; r--) {
|
|
1693
|
+
let i = this.serializeMark(e.marks[r], e.isInline, t);
|
|
1694
|
+
i && ((i.contentDOM || i.dom).appendChild(n), n = i.dom);
|
|
1695
|
+
}
|
|
1696
|
+
return n;
|
|
1697
|
+
}
|
|
1698
|
+
serializeMark(e, t, n = {}) {
|
|
1699
|
+
let r = this.marks[e.type.name];
|
|
1700
|
+
return r && $(Z(n), r(e, t), null, e.attrs);
|
|
1701
|
+
}
|
|
1702
|
+
static renderSpec(e, t, n = null, r) {
|
|
1703
|
+
return typeof t == "string" ? { dom: e.createTextNode(t) } : $(e, t, n, r);
|
|
1704
|
+
}
|
|
1705
|
+
static fromSchema(t) {
|
|
1706
|
+
return t.cached.domSerializer || (t.cached.domSerializer = new e(this.nodesFromSchema(t), this.marksFromSchema(t)));
|
|
1707
|
+
}
|
|
1708
|
+
static nodesFromSchema(e) {
|
|
1709
|
+
let t = X(e.nodes);
|
|
1710
|
+
return t.text ||= (e) => e.text, t;
|
|
1711
|
+
}
|
|
1712
|
+
static marksFromSchema(e) {
|
|
1713
|
+
return X(e.marks);
|
|
1714
|
+
}
|
|
2736
1715
|
};
|
|
1716
|
+
function X(e) {
|
|
1717
|
+
let t = {};
|
|
1718
|
+
for (let n in e) {
|
|
1719
|
+
let r = e[n].spec.toDOM;
|
|
1720
|
+
r && (t[n] = r);
|
|
1721
|
+
}
|
|
1722
|
+
return t;
|
|
1723
|
+
}
|
|
1724
|
+
function Z(e) {
|
|
1725
|
+
return e.document || window.document;
|
|
1726
|
+
}
|
|
1727
|
+
var Q = /* @__PURE__ */ new WeakMap();
|
|
1728
|
+
function we(e) {
|
|
1729
|
+
let t = Q.get(e);
|
|
1730
|
+
return t === void 0 && Q.set(e, t = Te(e)), t;
|
|
1731
|
+
}
|
|
1732
|
+
function Te(e) {
|
|
1733
|
+
let t = null;
|
|
1734
|
+
function n(e) {
|
|
1735
|
+
if (e && typeof e == "object") {
|
|
1736
|
+
if (Array.isArray(e)) {
|
|
1737
|
+
if (typeof e[0] == "string") t ||= [], t.push(e);
|
|
1738
|
+
else for (let t = 0; t < e.length; t++) n(e[t]);
|
|
1739
|
+
} else for (let t in e) n(e[t]);
|
|
1740
|
+
}
|
|
1741
|
+
}
|
|
1742
|
+
return n(e), t;
|
|
1743
|
+
}
|
|
1744
|
+
function $(e, t, n, r) {
|
|
1745
|
+
if (t.nodeType == 1) return { dom: t };
|
|
1746
|
+
if (t.dom && t.dom.nodeType == 1) return t;
|
|
1747
|
+
let i = t[0], a;
|
|
1748
|
+
if (typeof i != "string") throw RangeError("Invalid array passed to renderSpec");
|
|
1749
|
+
if (r && (a = we(r)) && a.indexOf(t) > -1) throw RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");
|
|
1750
|
+
let o = i.indexOf(" ");
|
|
1751
|
+
o > 0 && (n = i.slice(0, o), i = i.slice(o + 1));
|
|
1752
|
+
let s, c = n ? e.createElementNS(n, i) : e.createElement(i), l = t[1], u = 1;
|
|
1753
|
+
if (l && typeof l == "object" && l.nodeType == null && !Array.isArray(l)) {
|
|
1754
|
+
u = 2;
|
|
1755
|
+
for (let e in l) if (l[e] != null) {
|
|
1756
|
+
let t = e.indexOf(" ");
|
|
1757
|
+
t > 0 ? c.setAttributeNS(e.slice(0, t), e.slice(t + 1), l[e]) : e == "style" && c.style ? c.style.cssText = l[e] : c.setAttribute(e, l[e]);
|
|
1758
|
+
}
|
|
1759
|
+
}
|
|
1760
|
+
for (let i = u; i < t.length; i++) {
|
|
1761
|
+
let a = t[i];
|
|
1762
|
+
if (a === 0) {
|
|
1763
|
+
if (i < t.length - 1 || i > u) throw RangeError("Content hole must be the only child of its parent node");
|
|
1764
|
+
return {
|
|
1765
|
+
dom: c,
|
|
1766
|
+
contentDOM: c
|
|
1767
|
+
};
|
|
1768
|
+
}
|
|
1769
|
+
if (typeof a == "string") c.appendChild(e.createTextNode(a));
|
|
1770
|
+
else {
|
|
1771
|
+
let { dom: t, contentDOM: i } = $(e, a, n, r);
|
|
1772
|
+
if (c.appendChild(t), i) {
|
|
1773
|
+
if (s) throw RangeError("Multiple content holes");
|
|
1774
|
+
s = i;
|
|
1775
|
+
}
|
|
1776
|
+
}
|
|
1777
|
+
}
|
|
1778
|
+
return {
|
|
1779
|
+
dom: c,
|
|
1780
|
+
contentDOM: s
|
|
1781
|
+
};
|
|
1782
|
+
}
|
|
1783
|
+
//#endregion
|
|
1784
|
+
export { D as ContentMatch, ye as DOMParser, Ce as DOMSerializer, a as Fragment, l as Mark, R as MarkType, T as Node, w as NodeRange, I as NodeType, u as ReplaceError, S as ResolvedPos, ge as Schema, d as Slice };
|